Mesa (master): Revert "r300g: add generating texture coordinates for point sprites (WIP)"

2010-03-26 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 38c7a01b6c220ad04c5754602673ad3cf36ad508
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=38c7a01b6c220ad04c5754602673ad3cf36ad508

Author: Corbin Simpson 
Date:   Fri Mar 26 04:15:53 2010 -0700

Revert "r300g: add generating texture coordinates for point sprites (WIP)"

This reverts commit cba6430524198a1bdcdeada03cbe946a454f3935.

Breaks celestia with a hardlock. :T

We really need to sit down and study texture stuffing further.

---

 src/gallium/drivers/r300/r300_context.c |2 -
 src/gallium/drivers/r300/r300_context.h |   13 
 src/gallium/drivers/r300/r300_emit.c|6 
 src/gallium/drivers/r300/r300_state.c   |   35 +--
 src/gallium/drivers/r300/r300_state_derived.c   |5 +--
 src/gallium/drivers/r300/r300_state_invariant.c |   13 +++-
 6 files changed, 13 insertions(+), 61 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c 
b/src/gallium/drivers/r300/r300_context.c
index 4433dcf..4b470b2 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -195,8 +195,6 @@ struct pipe_context* r300_create_context(struct 
pipe_screen* screen,
 
 r300_setup_atoms(r300);
 
-r300->sprite_coord_index = -1;
-
 /* Open up the OQ BO. */
 r300->oqbo = screen->buffer_create(screen, 4096,
 PIPE_BUFFER_USAGE_PIXEL, 4096);
diff --git a/src/gallium/drivers/r300/r300_context.h 
b/src/gallium/drivers/r300/r300_context.h
index 4bb3852..eb9178a 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -99,16 +99,6 @@ struct r300_rs_state {
 uint32_t line_stipple_value;/* R300_GA_LINE_STIPPLE_VALUE: 0x4260 */
 uint32_t color_control; /* R300_GA_COLOR_CONTROL: 0x4278 */
 uint32_t polygon_mode;  /* R300_GA_POLY_MODE: 0x4288 */
-
-/* Specifies top of Raster pipe specific enable controls,
- * i.e. texture coordinates stuffing for points, lines, triangles */
-uint32_t stuffing_enable;   /* R300_GB_ENABLE: 0x4008 */
-
-/* Point sprites texture coordinates, 0: lower left, 1: upper right */
-float point_texcoord_left;  /* R300_GA_POINT_S0: 0x4200 */
-float point_texcoord_bottom;/* R300_GA_POINT_T0: 0x4204 */
-float point_texcoord_right; /* R300_GA_POINT_S1: 0x4208 */
-float point_texcoord_top;   /* R300_GA_POINT_T1: 0x420c */
 };
 
 struct r300_rs_block {
@@ -387,9 +377,6 @@ struct r300_context {
 uint32_t zbuffer_bpp;
 /* Whether scissor is enabled. */
 boolean scissor_enabled;
-/* Point sprites texcoord index, -1 = unused. */
-int sprite_coord_index;
-
 /* upload managers */
 struct u_upload_mgr *upload_vb;
 struct u_upload_mgr *upload_ib;
diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 796e3ec..92266ba 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -614,12 +614,6 @@ void r300_emit_rs_state(struct r300_context* r300, 
unsigned size, void* state)
 OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, rs->line_stipple_config);
 OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, rs->line_stipple_value);
 OUT_CS_REG(R300_GA_POLY_MODE, rs->polygon_mode);
-OUT_CS_REG(R300_GB_ENABLE, rs->stuffing_enable);
-OUT_CS_REG_SEQ(R300_GA_POINT_S0, 4);
-OUT_CS_32F(rs->point_texcoord_left);
-OUT_CS_32F(rs->point_texcoord_bottom);
-OUT_CS_32F(rs->point_texcoord_right);
-OUT_CS_32F(rs->point_texcoord_top);
 END_CS;
 }
 
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 31e3211..8e92854 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -714,7 +714,6 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
 {
 struct r300_screen* r300screen = r300_screen(pipe->screen);
 struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state);
-unsigned coord_index;
 
 /* Copy rasterizer state for Draw. */
 rs->rs = *state;
@@ -807,32 +806,6 @@ static void* r300_create_rs_state(struct pipe_context* 
pipe,
 rs->color_control = R300_SHADE_MODEL_SMOOTH;
 }
 
-/* Point sprites */
-if (state->sprite_coord_enable) {
-coord_index = ffs(state->sprite_coord_enable)-1;
-
-SCREEN_DBG(r300screen, DBG_DRAW,
-   "r300: point sprite: shader coord=%d\n", coord_index);
-
-rs->stuffing_enable =
-R300_GB_POINT_STUFF_ENABLE |
-R300_GB_TEX_ST << (R300_GB_TEX0_SOURCE_SHIFT + (coord_index*2));
-
-rs->point_texcoord_left = 0.0f;
-rs->point_texcoord_right = 1.0f;
-
-switch (state->sprite_coord_mode) {
-case PIPE_SPRITE_COORD_UPPER_LEFT:
-rs->point_texcoord_top = 0.0f;
-  

Mesa (master): r300/compiler: Lower CMP for vertex programs.

2010-03-26 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: b6df7aed60189d5f28a139c6fe351022ca2907a4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6df7aed60189d5f28a139c6fe351022ca2907a4

Author: Corbin Simpson 
Date:   Fri Mar 26 05:24:44 2010 -0700

r300/compiler: Lower CMP for vertex programs.

I think my maths is right?

---

 .../drivers/dri/r300/compiler/radeon_program_alu.c |   41 
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
index b5c08ae..f5b7d57 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
@@ -506,6 +506,46 @@ static void transform_r300_vertex_ABS(struct 
radeon_compiler* c,
inst->U.I.SrcReg[1].Negate ^= RC_MASK_XYZW;
 }
 
+static void transform_r300_vertex_CMP(struct radeon_compiler* c,
+   struct rc_instruction* inst)
+{
+   /* There is no decent CMP available, so let's rig one up.
+* CMP is defined as dst = src0 < 0.0 ? src1 : src2
+* The following sequence consumes two temps and three extra slots,
+* but should be equivalent:
+*
+* SLT tmp0, src0, 0.0
+* SGE tmp1, src0, 0.0
+* MUL tmp0, tmp0, src1
+* MAD dst, src2, tmp1, tmp0
+*
+* Yes, I know, I'm a mad scientist. ~ C. */
+   int tempreg0 = rc_find_free_temporary(c);
+   int tempreg1 = rc_find_free_temporary(c);
+
+   /* SLT tmp0, src0, 0.0 */
+   emit2(c, inst->Prev, RC_OPCODE_SLT, 0,
+   dstreg(RC_FILE_TEMPORARY, tempreg0),
+   inst->U.I.SrcReg[0], builtin_zero);
+
+   /* SGE tmp1, src0, 0.0 */
+   emit2(c, inst->Prev, RC_OPCODE_SGE, 0,
+   dstreg(RC_FILE_TEMPORARY, tempreg1),
+   inst->U.I.SrcReg[0], builtin_zero);
+
+   /* MUL tmp0, tmp0, src1 */
+   emit2(c, inst->Prev, RC_OPCODE_MUL, 0,
+   dstreg(RC_FILE_TEMPORARY, tempreg0),
+   srcreg(RC_FILE_TEMPORARY, tempreg0), inst->U.I.SrcReg[1]);
+
+   /* MAD dst, src2, tmp1, tmp0 */
+   emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode,
+   inst->U.I.DstReg,
+   inst->U.I.SrcReg[2], srcreg(RC_FILE_TEMPORARY, tempreg1), 
srcreg(RC_FILE_TEMPORARY, tempreg0));
+
+   rc_remove_instruction(inst);
+}
+
 /**
  * For use with radeonLocalTransform, this transforms non-native ALU
  * instructions of the r300 up to r500 vertex engine.
@@ -517,6 +557,7 @@ int r300_transform_vertex_alu(
 {
switch(inst->U.I.Opcode) {
case RC_OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return 1;
+   case RC_OPCODE_CMP: transform_r300_vertex_CMP(c, inst); return 1;
case RC_OPCODE_DP3: transform_DP3(c, inst); return 1;
case RC_OPCODE_DPH: transform_DPH(c, inst); return 1;
case RC_OPCODE_FLR: transform_FLR(c, inst); return 1;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Make SWTCL clear work again.

2010-03-27 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: c8844c5549dec7e9c47ab49d6e229980f62da74d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8844c5549dec7e9c47ab49d6e229980f62da74d

Author: Corbin Simpson 
Date:   Sat Mar 27 01:07:39 2010 -0700

r300g: Make SWTCL clear work again.

Kind of surprised that this was as little as it took. Worrying.

---

 src/gallium/drivers/r300/r300_state.c |  128 
 src/gallium/drivers/r300/r300_state_derived.c |  132 +
 2 files changed, 132 insertions(+), 128 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 8e92854..1fc9f39 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1141,72 +1141,6 @@ static void r300_set_vertex_buffers(struct pipe_context* 
pipe,
 }
 }
 
-static void r300_draw_emit_attrib(struct r300_context* r300,
-  enum attrib_emit emit,
-  enum interp_mode interp,
-  int index)
-{
-struct r300_vertex_shader* vs = r300->vs_state.state;
-struct tgsi_shader_info* info = &vs->info;
-int output;
-
-output = draw_find_shader_output(r300->draw,
- info->output_semantic_name[index],
- info->output_semantic_index[index]);
-draw_emit_vertex_attr(&r300->vertex_info, emit, interp, output);
-}
-
-static void r300_draw_emit_all_attribs(struct r300_context* r300)
-{
-struct r300_vertex_shader* vs = r300->vs_state.state;
-struct r300_shader_semantics* vs_outputs = &vs->outputs;
-int i, gen_count;
-
-/* Position. */
-if (vs_outputs->pos != ATTR_UNUSED) {
-r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
-  vs_outputs->pos);
-} else {
-assert(0);
-}
-
-/* Point size. */
-if (vs_outputs->psize != ATTR_UNUSED) {
-r300_draw_emit_attrib(r300, EMIT_1F_PSIZE, INTERP_POS,
-  vs_outputs->psize);
-}
-
-/* Colors. */
-for (i = 0; i < ATTR_COLOR_COUNT; i++) {
-if (vs_outputs->color[i] != ATTR_UNUSED) {
-r300_draw_emit_attrib(r300, EMIT_4F, INTERP_LINEAR,
-  vs_outputs->color[i]);
-}
-}
-
-/* XXX Back-face colors. */
-
-/* Texture coordinates. */
-gen_count = 0;
-for (i = 0; i < ATTR_GENERIC_COUNT; i++) {
-if (vs_outputs->generic[i] != ATTR_UNUSED) {
-r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
-  vs_outputs->generic[i]);
-gen_count++;
-}
-}
-
-/* Fog coordinates. */
-if (vs_outputs->fog != ATTR_UNUSED) {
-r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
-  vs_outputs->fog);
-gen_count++;
-}
-
-/* XXX magic */
-assert(gen_count <= 8);
-}
-
 /* Update the PSC tables. */
 static void r300_vertex_psc(struct r300_vertex_element_state *velems)
 {
@@ -1246,63 +1180,6 @@ static void r300_vertex_psc(struct 
r300_vertex_element_state *velems)
 vstream->count = (i >> 1) + 1;
 }
 
-/* Update the PSC tables for SW TCL, using Draw. */
-static void r300_swtcl_vertex_psc(struct r300_context *r300,
-  struct r300_vertex_element_state *velems)
-{
-struct r300_vertex_stream_state *vstream = &velems->vertex_stream;
-struct r300_vertex_shader* vs = r300->vs_state.state;
-struct vertex_info* vinfo = &r300->vertex_info;
-uint16_t type, swizzle;
-enum pipe_format format;
-unsigned i, attrib_count;
-int* vs_output_tab = vs->stream_loc_notcl;
-
-/* For each Draw attribute, route it to the fragment shader according
- * to the vs_output_tab. */
-attrib_count = vinfo->num_attribs;
-DBG(r300, DBG_DRAW, "r300: attrib count: %d\n", attrib_count);
-for (i = 0; i < attrib_count; i++) {
-DBG(r300, DBG_DRAW, "r300: attrib: offset %d, interp %d, size %d,"
-   " vs_output_tab %d\n", vinfo->attrib[i].src_index,
-   vinfo->attrib[i].interp_mode, vinfo->attrib[i].emit,
-   vs_output_tab[i]);
-}
-
-for (i = 0; i < attrib_count; i++) {
-/* Make sure we have a proper destination for our attribute. */
-assert(vs_output_tab[i] != -1);
-
-format = draw_translate_vinfo_format(vinfo->attrib[i].emit);
-
-/* Obtain the type of data in this attribute. */
-type = r300_translate_vertex_data_type(format) |
-vs_output_tab[i] << R300_DST_VEC_LOC_SHIFT;
-
-/* Obtain the swizzle for this attribute. Note that the default
- * swizzle in the hardware is not XYZW! 

Mesa (master): r300g: Bind constantbuf to Draw immediately, don' t wait for render.

2010-03-29 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 587c5ef01fad962bcfb087232d0925a8eec86953
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=587c5ef01fad962bcfb087232d0925a8eec86953

Author: Corbin Simpson 
Date:   Mon Mar 29 15:10:18 2010 -0700

r300g: Bind constantbuf to Draw immediately, don't wait for render.

Doesn't hurt, and reduces code duplication.

---

 src/gallium/drivers/r300/r300_render.c |   14 --
 src/gallium/drivers/r300/r300_state.c  |8 ++--
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index 93bf388..1fb7eac 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -569,13 +569,6 @@ void r300_swtcl_draw_arrays(struct pipe_context* pipe,
 
 draw_set_mapped_element_buffer(r300->draw, 0, NULL);
 
-draw_set_mapped_constant_buffer(r300->draw,
-   PIPE_SHADER_VERTEX,
-0,
-   
r300->shader_constants[PIPE_SHADER_VERTEX].constants,
-   
r300->shader_constants[PIPE_SHADER_VERTEX].count *
-(sizeof(float) * 4));
-
 draw_arrays(r300->draw, mode, start, count);
 
 for (i = 0; i < r300->vertex_buffer_count; i++) {
@@ -614,13 +607,6 @@ void r300_swtcl_draw_range_elements(struct pipe_context* 
pipe,
 draw_set_mapped_element_buffer_range(r300->draw, indexSize,
  minIndex, maxIndex, indices);
 
-draw_set_mapped_constant_buffer(r300->draw,
-   PIPE_SHADER_VERTEX,
-0,
-r300->shader_constants[PIPE_SHADER_VERTEX].constants,
-r300->shader_constants[PIPE_SHADER_VERTEX].count *
-(sizeof(float) * 4));
-
 draw_arrays(r300->draw, mode, start, count);
 
 for (i = 0; i < r300->vertex_buffer_count; i++) {
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index b7b5e1e..ace71d6 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1365,10 +1365,14 @@ static void r300_set_constant_buffer(struct 
pipe_context *pipe,
 if (r300screen->caps->has_tcl) {
 r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS;
 r300->pvs_flush.dirty = TRUE;
+} else if (r300->draw) {
+draw_set_mapped_constant_buffer(r300->draw, PIPE_SHADER_VERTEX,
+0, r300->shader_constants[PIPE_SHADER_VERTEX].constants,
+buf->size);
 }
-}
-else if (shader == PIPE_SHADER_FRAGMENT)
+} else if (shader == PIPE_SHADER_FRAGMENT) {
 r300->dirty_state |= R300_NEW_FRAGMENT_SHADER_CONSTANTS;
+}
 }
 
 void r300_init_state_functions(struct r300_context* r300)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300/compiler: Unbreak DDX/DDY.

2010-03-30 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 3623202834e9ca1073a4aa66f72f584812fb14df
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3623202834e9ca1073a4aa66f72f584812fb14df

Author: Corbin Simpson 
Date:   Tue Mar 30 10:43:51 2010 -0700

r300/compiler: Unbreak DDX/DDY.

Fixes progs/glsl/deriv.

---

 .../drivers/dri/r300/compiler/r500_fragprog_emit.c |   23 ++-
 .../drivers/dri/r300/compiler/radeon_opcodes.c |4 +-
 .../dri/r300/compiler/radeon_pair_translate.c  |5 
 3 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c 
b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
index 4e84eef..b6dfe28 100644
--- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
@@ -190,6 +190,17 @@ static unsigned int use_source(struct 
r500_fragment_program_code* code, struct r
return 0;
 }
 
+/**
+ * NOP the specified instruction if it is not a texture lookup.
+ */
+static void alu_nop(struct r300_fragment_program_compiler *c, int ip)
+{
+   PROG_CODE;
+
+   if ((code->inst[ip].inst0 & 0x3) != R500_INST_TYPE_TEX) {
+   code->inst[ip].inst0 |= R500_INST_NOP;
+   }
+}
 
 /**
  * Emit a paired ALU instruction.
@@ -205,6 +216,14 @@ static void emit_paired(struct 
r300_fragment_program_compiler *c, struct rc_pair
 
int ip = ++code->inst_end;
 
+   /* Quirk: MDH/MDV (DDX/DDY) need a NOP on previous non-TEX 
instructions. */
+   if (inst->RGB.Opcode == RC_OPCODE_DDX || inst->Alpha.Opcode == 
RC_OPCODE_DDX ||
+   inst->RGB.Opcode == RC_OPCODE_DDY || inst->Alpha.Opcode == 
RC_OPCODE_DDY) {
+   if (ip > 0) {
+   alu_nop(c, ip - 1);
+   }
+   }
+
code->inst[ip].inst5 = translate_rgb_op(c, inst->RGB.Opcode);
code->inst[ip].inst4 = translate_alpha_op(c, inst->Alpha.Opcode);
 
@@ -252,8 +271,8 @@ static void emit_paired(struct 
r300_fragment_program_compiler *c, struct rc_pair
code->inst[ip].inst4 |= translate_arg_alpha(inst, 1) << 
R500_ALPHA_SEL_B_SHIFT;
code->inst[ip].inst5 |= translate_arg_alpha(inst, 2) << 
R500_ALU_RGBA_ALPHA_SEL_C_SHIFT;
 
-code->inst[ip].inst3 |= R500_ALU_RGB_TARGET(inst->RGB.Target);
-code->inst[ip].inst4 |= R500_ALPHA_TARGET(inst->Alpha.Target);
+   code->inst[ip].inst3 |= R500_ALU_RGB_TARGET(inst->RGB.Target);
+   code->inst[ip].inst4 |= R500_ALPHA_TARGET(inst->Alpha.Target);
 
if (inst->WriteALUResult) {
code->inst[ip].inst3 |= R500_ALU_RGB_WMASK;
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
index c1c0181..9d289fc 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
@@ -75,14 +75,14 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = {
{
.Opcode = RC_OPCODE_DDX,
.Name = "DDX",
-   .NumSrcRegs = 1,
+   .NumSrcRegs = 2,
.HasDstReg = 1,
.IsComponentwise = 1
},
{
.Opcode = RC_OPCODE_DDY,
.Name = "DDY",
-   .NumSrcRegs = 1,
+   .NumSrcRegs = 2,
.HasDstReg = 1,
.IsComponentwise = 1
},
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
index fff5b0c..3a26e7d 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
@@ -159,11 +159,6 @@ static void set_pair_instruction(struct 
r300_fragment_program_compiler *c,
int nargs = opcode->NumSrcRegs;
int i;
 
-   /* Special case for DDX/DDY (MDH/MDV). */
-   if (inst->Opcode == RC_OPCODE_DDX || inst->Opcode == RC_OPCODE_DDY) {
-   nargs++;
-   }
-
for(i = 0; i < opcode->NumSrcRegs; ++i) {
int source;
if (needrgb && !istranscendent) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Init half-float tables on demand.

2010-04-01 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 950300eb255f0e3507bf2757d16c3b5bc8ff3471
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=950300eb255f0e3507bf2757d16c3b5bc8ff3471

Author: Corbin Simpson 
Date:   Thu Apr  1 14:41:18 2010 -0700

util: Init half-float tables on demand.

Gets rid of unnecessary delays on startup and compiler-specific hax.

---

 src/gallium/auxiliary/util/u_half.c |   12 +---
 src/gallium/auxiliary/util/u_half.h |7 -
 src/gallium/auxiliary/util/u_init.h |   52 ---
 3 files changed, 14 insertions(+), 57 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_half.c 
b/src/gallium/auxiliary/util/u_half.c
index 4611b20..64eaa00 100644
--- a/src/gallium/auxiliary/util/u_half.c
+++ b/src/gallium/auxiliary/util/u_half.c
@@ -50,7 +50,6 @@
  */
 
 #include "util/u_half.h"
-#include "util/u_init.h"
 
 uint32_t util_half_to_float_mantissa_table[2048];
 uint32_t util_half_to_float_exponent_table[64];
@@ -58,10 +57,15 @@ uint32_t util_half_to_float_offset_table[64];
 uint16_t util_float_to_half_base_table[512];
 uint8_t util_float_to_half_shift_table[512];
 
-static void util_half_init_tables(void)
+void util_half_init_tables(void)
 {
+static boolean inited = FALSE;
int i;
 
+if (inited) {
+return;
+}
+
/* zero */
util_half_to_float_mantissa_table[0] = 0;
 
@@ -153,6 +157,6 @@ static void util_half_init_tables(void)
util_float_to_half_base_table[256 + i] = 
util_float_to_half_base_table[i] | 0x8000;
util_float_to_half_shift_table[256 + i] = 
util_float_to_half_shift_table[i];
}
-}
 
-UTIL_INIT(util_half_init_tables);
+inited = TRUE;
+}
diff --git a/src/gallium/auxiliary/util/u_half.h 
b/src/gallium/auxiliary/util/u_half.h
index 5afdd92..50948ca 100644
--- a/src/gallium/auxiliary/util/u_half.h
+++ b/src/gallium/auxiliary/util/u_half.h
@@ -8,13 +8,14 @@
 extern "C" {
 #endif
 
-
 extern uint32_t util_half_to_float_mantissa_table[2048];
 extern uint32_t util_half_to_float_exponent_table[64];
 extern uint32_t util_half_to_float_offset_table[64];
 extern uint16_t util_float_to_half_base_table[512];
 extern uint8_t util_float_to_half_shift_table[512];
 
+void util_half_init_tables(void);
+
 /*
  * Note that if the half float is a signaling NaN, the x87 FPU will turn
  * it into a quiet NaN immediately upon loading into a float.
@@ -30,6 +31,7 @@ static INLINE uint32_t
 util_half_to_floatui(half h)
 {
unsigned exp = h >> 10;
+util_half_init_tables();
return 
util_half_to_float_mantissa_table[util_half_to_float_offset_table[exp] + (h & 
0x3ff)]
+ util_half_to_float_exponent_table[exp];
 }
@@ -38,6 +40,7 @@ static INLINE float
 util_half_to_float(half h)
 {
union fi r;
+util_half_init_tables();
r.ui = util_half_to_floatui(h);
return r.f;
 }
@@ -46,6 +49,7 @@ static INLINE half
 util_floatui_to_half(uint32_t v)
 {
unsigned signexp = v >> 23;
+util_half_init_tables();
return util_float_to_half_base_table[signexp]
+ ((v & 0x007f) >> util_float_to_half_shift_table[signexp]);
 }
@@ -54,6 +58,7 @@ static INLINE half
 util_float_to_half(float f)
 {
union fi i;
+util_half_init_tables();
i.f = f;
return util_floatui_to_half(i.ui);
 }
diff --git a/src/gallium/auxiliary/util/u_init.h 
b/src/gallium/auxiliary/util/u_init.h
deleted file mode 100644
index 40dafad..000
--- a/src/gallium/auxiliary/util/u_init.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2010 Luca Barbieri
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **/
-
-#ifndef U_INIT_H
-#define U_INIT_H
-
-/* Use UTIL_INIT(f) to have f called at program initializ

Mesa (master): gallium: fix dri_destroy_option_cache() when optionCache. info is NULL

2010-04-02 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 1d11ba0ba3d3919bdee62a6513bc0c0d1e68aa66
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d11ba0ba3d3919bdee62a6513bc0c0d1e68aa66

Author: Yann Droneaud 
Date:   Fri Apr  2 13:44:26 2010 +

gallium: fix dri_destroy_option_cache() when optionCache.info is NULL

With an Intel 855GM handled by intel_drv, there's a crash with Gallium3D
enabled DRI driver for Intel i915 (--enable-gallium-intel).
The Gallium3D driver doesn't support the 855GM as expected by
intel_drv, it failed to open the screen and give an half
initialized screen structure to dri_destroy_option_cache():
optionCache.info is NULL, so it's crashing while trying
to free array content. This patch at least fix the crash in the function.

Here's some logs of the fixed version:

[ 16274.137] LoaderOpen(/opt/mesa/lib/xorg/modules/drivers/intel_drv.so)
[ 16274.139] (II) Loading /opt/mesa/lib/xorg/modules/drivers/intel_drv.so
[ 16274.183] (II) Module intel: vendor="X.Org Foundation"
[ 16274.183]compiled for 1.8.0, module version = 2.11.0
[ 16274.183]Module class: X.Org Video Driver
[ 16274.183]ABI class: X.Org Video Driver, version 7.0
[ 16274.183] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
i810-dc100, i810e, i815, i830M, 845G, 852GM/855GM, 865G, 915G,
E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
4 Series, G45/G43, Q45/Q43, G41, B43, Clarkdale, Arrandale
[ 16274.382] (II) intel(0): Integrated Graphics Chipset: Intel(R) 855GME
[ 16274.382] (--) intel(0): Chipset: "852GM/855GM"
[ 16276.675] (II) intel(0): [DRI2] Setup complete
[ 16276.675] (II) intel(0): [DRI2]   DRI driver: i915
debug_get_option: GALLIUM_TRACE = (null)
debug_get_bool_option: GALLIUM_RBUG = FALSE
debug_get_bool_option: INTEL_DUMP_CMD = FALSE
i915_create_screen: unknown pci id 0x3582, cannot create screen
dri_init_screen_helper: failed to create pipe_screen
[ 16276.794] (EE) AIGLX error: Calling driver entry point failed
[ 16276.794] (EE) AIGLX: reverting to software rendering
[ 16276.794] (II) AIGLX: Screen 0 is not DRI capable
[ 16276.796] (II) AIGLX: Loaded and initialized /opt/mesa/lib/dri/swrast_dri.so
[ 16276.796] (II) GLX: Initialized DRISWRAST GL provider for screen 0

Signed-off-by: Yann Droneaud 
Reviewed-by: Corbin Simpson 

---

 src/gallium/state_trackers/dri/common/dri_screen.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c 
b/src/gallium/state_trackers/dri/common/dri_screen.c
index 6fc7487..6e17614 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -288,12 +288,14 @@ dri_destroy_option_cache(struct dri_screen * screen)
 {
int i;
 
-   for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
-  FREE(screen->optionCache.info[i].name);
-  FREE(screen->optionCache.info[i].ranges);
+   if (screen->optionCache.info) {
+  for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
+ FREE(screen->optionCache.info[i].name);
+ FREE(screen->optionCache.info[i].ranges);
+  }
+  FREE(screen->optionCache.info);
}
 
-   FREE(screen->optionCache.info);
FREE(screen->optionCache.values);
 }
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Expound on dithering comment.

2010-04-02 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 21961f6e9614f234be704da93032cb4ec197eef4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=21961f6e9614f234be704da93032cb4ec197eef4

Author: Corbin Simpson 
Date:   Fri Apr  2 14:21:50 2010 -0700

r300g: Expound on dithering comment.

---

 src/gallium/drivers/r300/r300_state.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index bf17d5d..2c0a7d8 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -320,12 +320,17 @@ static void* r300_create_blend_state(struct pipe_context* 
pipe,
 }
 }
 
+/* Neither fglrx nor classic r300 ever set this, regardless of dithering
+ * state. Since it's an optional implementation detail, we can leave it
+ * out and never dither.
+ *
+ * This could be revisited if we ever get quality or conformance hints.
+ *
 if (state->dither) {
-   /* fglrx appears to never set this */
-   blend->dither = 0;
-/* blend->dither = R300_RB3D_DITHER_CTL_DITHER_MODE_LUT |
-   R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_LUT; */
+blend->dither = R300_RB3D_DITHER_CTL_DITHER_MODE_LUT |
+R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_LUT;
 }
+*/
 
 return (void*)blend;
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Dithering might not actually do anything.

2010-04-02 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 73cd1cf7c1ab28eadbd6b7564fd103b799b126a0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=73cd1cf7c1ab28eadbd6b7564fd103b799b126a0

Author: Corbin Simpson 
Date:   Fri Apr  2 14:25:38 2010 -0700

gallium/docs: Dithering might not actually do anything.

---

 src/gallium/docs/source/cso/blend.rst |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/docs/source/cso/blend.rst 
b/src/gallium/docs/source/cso/blend.rst
index 55c0f32..c743962 100644
--- a/src/gallium/docs/source/cso/blend.rst
+++ b/src/gallium/docs/source/cso/blend.rst
@@ -28,7 +28,7 @@ logicop_enable
 logicop_func
The logic operation to use if logic ops are enabled. One of PIPE_LOGICOP.
 dither
-   Whether dithering is enabled.
+   Whether dithering is enabled. Note: Dithering is implementation-dependent.
 rt
Contains the per-rendertarget blend state.
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Include u_debug for debug_print_format.

2010-04-09 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 9c2efb071f8b0a377b6a6e713cbae332b64a6705
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c2efb071f8b0a377b6a6e713cbae332b64a6705

Author: Corbin Simpson 
Date:   Tue Nov 24 07:42:44 2009 -0800

util: Include u_debug for debug_print_format.

Caused fun linker errors on r600g.

---

 src/gallium/auxiliary/util/u_pack_color.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_pack_color.h 
b/src/gallium/auxiliary/util/u_pack_color.h
index ad4a06d..3ebef9f 100644
--- a/src/gallium/auxiliary/util/u_pack_color.h
+++ b/src/gallium/auxiliary/util/u_pack_color.h
@@ -37,6 +37,7 @@
 
 #include "pipe/p_compiler.h"
 #include "pipe/p_format.h"
+#include "util/u_debug.h"
 #include "util/u_format.h"
 #include "util/u_math.h"
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Fill out dummy fence functions.

2010-04-09 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: d2cf1e85c88890b60fdfa1b0236a90bb6916d267
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d2cf1e85c88890b60fdfa1b0236a90bb6916d267

Author: Corbin Simpson 
Date:   Fri Apr  9 03:37:53 2010 -0700

r300g: Fill out dummy fence functions.

xorg st needs them.

---

 src/gallium/drivers/r300/r300_screen.c |   24 
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 894a8c2..00c16b8 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -264,6 +264,26 @@ static void r300_destroy_screen(struct pipe_screen* 
pscreen)
 FREE(r300screen);
 }
 
+static void r300_fence_reference(struct pipe_screen *screen,
+ struct pipe_fence_handle **ptr,
+ struct pipe_fence_handle *fence)
+{
+}
+
+static int r300_fence_signalled(struct pipe_screen *screen,
+struct pipe_fence_handle *fence,
+unsigned flags)
+{
+return 0;
+}
+
+static int r300_fence_finish(struct pipe_screen *screen,
+ struct pipe_fence_handle *fence,
+ unsigned flags)
+{
+return 0;
+}
+
 struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws)
 {
 struct r300_screen *r300screen = CALLOC_STRUCT(r300_screen);
@@ -290,6 +310,10 @@ struct pipe_screen* r300_create_screen(struct 
r300_winsys_screen *rws)
 r300screen->screen.is_format_supported = r300_is_format_supported;
 r300screen->screen.context_create = r300_create_context;
 
+r300screen->screen.fence_reference = r300_fence_reference;
+r300screen->screen.fence_signalled = r300_fence_signalled;
+r300screen->screen.fence_finish = r300_fence_finish;
+
 r300_init_screen_texture_functions(&r300screen->screen);
 
 r300_screen_init_buffer_functions(r300screen);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/xorg: Fix bad paramf.

2010-04-09 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 8ddb4e2c81c88c9320ed7fb75464e0b37f4d4536
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ddb4e2c81c88c9320ed7fb75464e0b37f4d4536

Author: Corbin Simpson 
Date:   Fri Apr  9 03:38:23 2010 -0700

st/xorg: Fix bad paramf.

Should be an integer param, according to docs.

---

 src/gallium/state_trackers/xorg/xorg_driver.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c 
b/src/gallium/state_trackers/xorg/xorg_driver.c
index 8ac5179..d5dd0d7 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -676,10 +676,8 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int 
argc, char **argv)
 }
 
 if (ms->screen) {
-   float maxf;
int max;
-   maxf = ms->screen->get_paramf(ms->screen, 
PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
-   max = (1 << (int)(maxf - 1.0f));
+   max = ms->screen->get_param(ms->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
max_width = max < max_width ? max : max_width;
max_height = max < max_height ? max : max_height;
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/xorg: Fix thinko.

2010-04-09 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 51c40680518b0d76d2eae373a474392d18be05d7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=51c40680518b0d76d2eae373a474392d18be05d7

Author: Corbin Simpson 
Date:   Fri Apr  9 06:48:04 2010 -0700

st/xorg: Fix thinko.

---

 src/gallium/state_trackers/xorg/xorg_driver.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c 
b/src/gallium/state_trackers/xorg/xorg_driver.c
index d5dd0d7..a59e8dc 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -678,6 +678,7 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, 
char **argv)
 if (ms->screen) {
int max;
max = ms->screen->get_param(ms->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
+   max = 1 << (max - 1);
max_width = max < max_width ? max : max_width;
max_height = max < max_height ? max : max_height;
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300/compiler: Add NPOT compatibility fields to external state.

2010-04-11 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 484079d7245e089a908090c0944e2088a3a074f6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=484079d7245e089a908090c0944e2088a3a074f6

Author: Corbin Simpson 
Date:   Sun Apr 11 13:31:54 2010 -0700

r300/compiler: Add NPOT compatibility fields to external state.

Completely unused for now.

---

 src/mesa/drivers/dri/r300/compiler/radeon_code.h |   28 -
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h 
b/src/mesa/drivers/dri/r300/compiler/radeon_code.h
index 6d979bb..45cc7df 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h
@@ -108,6 +108,18 @@ typedef enum {
 } rc_compare_func;
 
 /**
+ * Coordinate wrapping modes.
+ *
+ * These are not quite the same as their GL counterparts yet.
+ */
+typedef enum {
+   RC_WRAP_NONE = 0,
+   RC_WRAP_CLAMP,
+   RC_WRAP_REPEAT,
+   RC_WRAP_MIRROR
+} rc_wrap_mode;
+
+/**
  * Stores state that influences the compilation of a fragment program.
  */
 struct r300_fragment_program_external_state {
@@ -127,11 +139,23 @@ struct r300_fragment_program_external_state {
 * this field specifies the compare function.
 *
 * Otherwise, this field is \ref RC_COMPARE_FUNC_NEVER (aka 0).
-*
-* Otherwise, this field is 0.
 * \sa rc_compare_func
 */
unsigned texture_compare_func : 3;
+
+   /**
+* If the sampler will be accessed with non-normalized coords,
+* this field is set.
+*/
+   unsigned non_normalized_coords : 1;
+
+   /**
+* This field specifies wrapping modes for the sampler.
+*
+* If this field is \ref RC_WRAP_NONE (aka 0), no wrapping maths
+* will be performed on the coordinates.
+*/
+   unsigned wrap_mode : 2;
} unit[16];
 };
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Cleanup fragment program external state setup.

2010-04-11 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 8f37f910bf9c3e34c6afc5a2ec8cc1828f792b16
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f37f910bf9c3e34c6afc5a2ec8cc1828f792b16

Author: Corbin Simpson 
Date:   Sun Apr 11 13:52:01 2010 -0700

r300g: Cleanup fragment program external state setup.

---

 src/gallium/drivers/r300/r300_fs.c |   34 --
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_fs.c 
b/src/gallium/drivers/r300/r300_fs.c
index 762cbf2..bd9608e 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -130,20 +130,21 @@ static void allocate_hardware_inputs(
 }
 }
 
-static void get_compare_state(
+static void get_external_state(
 struct r300_context* r300,
-struct r300_fragment_program_external_state* state,
-unsigned shadow_samplers)
+struct r300_fragment_program_external_state* state)
 {
-struct r300_textures_state *texstate =
-(struct r300_textures_state*)r300->textures_state.state;
-
-memset(state, 0, sizeof(*state));
+struct r300_textures_state *texstate = r300->textures_state.state;
+unsigned i;
 
-for (int i = 0; i < texstate->sampler_state_count; i++) {
+for (i = 0; i < texstate->sampler_state_count; i++) {
 struct r300_sampler_state* s = texstate->sampler_states[i];
 
-if (s && s->state.compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
+if (!s) {
+continue;
+}
+
+if (s->state.compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
 /* XXX Gallium doesn't provide us with any information regarding
  * this mode, so we are screwed. I'm setting 0 = LUMINANCE. */
 state->unit[i].depth_texture_mode = 0;
@@ -279,24 +280,21 @@ static void r300_translate_fragment_shader(
 boolean r300_pick_fragment_shader(struct r300_context* r300)
 {
 struct r300_fragment_shader* fs = r300_fs(r300);
-struct r300_fragment_program_external_state state;
+struct r300_fragment_program_external_state state = {{{ 0 }}};
 struct r300_fragment_shader_code* ptr;
 
+get_external_state(r300, &state);
+
 if (!fs->first) {
 /* Build the fragment shader for the first time. */
 fs->first = fs->shader = CALLOC_STRUCT(r300_fragment_shader_code);
 
-/* BTW shadow samplers will be known after the first translation,
- * therefore we set ~0, which means it should look at all sampler
- * states. This choice doesn't have any impact on the correctness. */
-get_compare_state(r300, &fs->shader->compare_state, ~0);
+memcpy(&fs->shader->compare_state, &state,
+sizeof(struct r300_fragment_program_external_state));
 r300_translate_fragment_shader(r300, fs->shader, fs->state.tokens);
-fs->shadow_samplers = fs->shader->shadow_samplers;
 return TRUE;
 
-} else if (fs->shadow_samplers) {
-get_compare_state(r300, &state, fs->shadow_samplers);
-
+} else {
 /* Check if the currently-bound shader has been compiled
  * with the texture-compare state we need. */
 if (memcmp(&fs->shader->compare_state, &state, sizeof(state)) != 0) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Setup external state for wrap modes.

2010-04-11 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: f95ff1cf48a3da090dc999621f2d153af0c7db14
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f95ff1cf48a3da090dc999621f2d153af0c7db14

Author: Corbin Simpson 
Date:   Sun Apr 11 13:55:00 2010 -0700

r300g: Setup external state for wrap modes.

---

 src/gallium/drivers/r300/r300_fs.c |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_fs.c 
b/src/gallium/drivers/r300/r300_fs.c
index bd9608e..c0d26e5 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -152,6 +152,32 @@ static void get_external_state(
 /* Fortunately, no need to translate this. */
 state->unit[i].texture_compare_func = s->state.compare_func;
 }
+
+/* Should we ask the shader to handle wrapping modes for us? */
+if (!s->state.normalized_coords) {
+state->unit[i].non_normalized_coords = 1;
+
+/* XXX this should probably take into account STR, not just S. */
+switch (s->state.wrap_s) {
+case PIPE_TEX_WRAP_REPEAT:
+state->unit[i].wrap_mode = RC_WRAP_REPEAT;
+break;
+case PIPE_TEX_WRAP_CLAMP:
+case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
+case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
+state->unit[i].wrap_mode = RC_WRAP_CLAMP;
+break;
+case PIPE_TEX_WRAP_MIRROR_REPEAT:
+case PIPE_TEX_WRAP_MIRROR_CLAMP:
+case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
+case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
+state->unit[i].wrap_mode = RC_WRAP_MIRROR;
+break;
+default:
+state->unit[i].wrap_mode = RC_WRAP_NONE;
+break;
+}
+}
 }
 }
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300/compiler: Implement texcoord repeat and mirror for NPOT .

2010-04-11 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: d5af1dce8fc23dc3763773e3c0b7e0be128d2aa0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d5af1dce8fc23dc3763773e3c0b7e0be128d2aa0

Author: Corbin Simpson 
Date:   Sun Apr 11 16:13:45 2010 -0700

r300/compiler: Implement texcoord repeat and mirror for NPOT.

---

 src/gallium/drivers/r300/r300_fs.c |   51 
 src/mesa/drivers/dri/r300/compiler/r300_fragprog.c |   66 
 src/mesa/drivers/dri/r300/compiler/r500_fragprog.c |   57 +
 src/mesa/drivers/dri/r300/compiler/radeon_code.h   |7 ++-
 4 files changed, 142 insertions(+), 39 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_fs.c 
b/src/gallium/drivers/r300/r300_fs.c
index c0d26e5..6af6028 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -139,11 +139,14 @@ static void get_external_state(
 
 for (i = 0; i < texstate->sampler_state_count; i++) {
 struct r300_sampler_state* s = texstate->sampler_states[i];
+struct r300_texture *t;
 
-if (!s) {
+if (!s || !texstate->sampler_views[i]) {
 continue;
 }
 
+t = (struct r300_texture*)texstate->sampler_views[i]->base.texture;
+
 if (s->state.compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
 /* XXX Gallium doesn't provide us with any information regarding
  * this mode, so we are screwed. I'm setting 0 = LUMINANCE. */
@@ -153,30 +156,28 @@ static void get_external_state(
 state->unit[i].texture_compare_func = s->state.compare_func;
 }
 
-/* Should we ask the shader to handle wrapping modes for us? */
-if (!s->state.normalized_coords) {
-state->unit[i].non_normalized_coords = 1;
-
-/* XXX this should probably take into account STR, not just S. */
-switch (s->state.wrap_s) {
-case PIPE_TEX_WRAP_REPEAT:
-state->unit[i].wrap_mode = RC_WRAP_REPEAT;
-break;
-case PIPE_TEX_WRAP_CLAMP:
-case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
-case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
-state->unit[i].wrap_mode = RC_WRAP_CLAMP;
-break;
-case PIPE_TEX_WRAP_MIRROR_REPEAT:
-case PIPE_TEX_WRAP_MIRROR_CLAMP:
-case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
-case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
-state->unit[i].wrap_mode = RC_WRAP_MIRROR;
-break;
-default:
-state->unit[i].wrap_mode = RC_WRAP_NONE;
-break;
-}
+state->unit[i].fake_npot = t->uses_pitch;
+state->unit[i].non_normalized_coords = !s->state.normalized_coords;
+
+/* XXX this should probably take into account STR, not just S. */
+switch (s->state.wrap_s) {
+case PIPE_TEX_WRAP_REPEAT:
+state->unit[i].wrap_mode = RC_WRAP_REPEAT;
+break;
+case PIPE_TEX_WRAP_CLAMP:
+case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
+case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
+state->unit[i].wrap_mode = RC_WRAP_CLAMP;
+break;
+case PIPE_TEX_WRAP_MIRROR_REPEAT:
+case PIPE_TEX_WRAP_MIRROR_CLAMP:
+case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
+case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
+state->unit[i].wrap_mode = RC_WRAP_MIRROR;
+break;
+default:
+state->unit[i].wrap_mode = RC_WRAP_NONE;
+break;
 }
 }
 }
diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c 
b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
index 928c15e..4a60d05 100644
--- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
@@ -143,19 +143,59 @@ int r300_transform_TEX(
 * instead of [0..Width]x[0..Height].
 * Add a scaling instruction.
 */
-   if (inst->U.I.Opcode != RC_OPCODE_KIL && inst->U.I.TexSrcTarget == 
RC_TEXTURE_RECT) {
-   struct rc_instruction * inst_mul = rc_insert_new_instruction(c, 
inst->Prev);
+   if (inst->U.I.Opcode != RC_OPCODE_KIL &&
+   (inst->U.I.TexSrcTarget == RC_TEXTURE_RECT ||
+   compiler->state.unit[inst->U.I.TexSrcUnit].fake_npot ||
+   
compiler->state.unit[inst->U.I.TexSrcUnit].non_normalized_coords)) {
+   rc_wrap_mode wrapmode = 
compiler->state.unit[inst->U.I.TexSrcUnit].wrap_mode;
+   struct rc_instruction *inst_rect = NULL;
+   unsigned temp = rc_find_free_temporary(c);
+
+   if (

Mesa (master): r300/compiler: Comment code, add much better mirror maths.

2010-04-12 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: f0b8677d57f32ea66c997dfc8c3bf06987c6ebcd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0b8677d57f32ea66c997dfc8c3bf06987c6ebcd

Author: Corbin Simpson 
Date:   Mon Apr 12 02:40:40 2010 -0700

r300/compiler: Comment code, add much better mirror maths.

---

 src/mesa/drivers/dri/r300/compiler/r300_fragprog.c |   81 ---
 src/mesa/drivers/dri/r300/compiler/r500_fragprog.c |  109 +---
 2 files changed, 161 insertions(+), 29 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c 
b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
index 4a60d05..50360de 100644
--- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
@@ -142,6 +142,8 @@ int r300_transform_TEX(
/* Hardware uses [0..1]x[0..1] range for rectangle textures
 * instead of [0..Width]x[0..Height].
 * Add a scaling instruction.
+*
+* See also comments in this same section in r500_fragprog.c
 */
if (inst->U.I.Opcode != RC_OPCODE_KIL &&
(inst->U.I.TexSrcTarget == RC_TEXTURE_RECT ||
@@ -166,35 +168,86 @@ int r300_transform_TEX(
 
reset_srcreg(&inst->U.I.SrcReg[0]);
inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY;
-   inst->U.I.SrcReg[0].Index = inst_rect->U.I.DstReg.Index;
+   inst->U.I.SrcReg[0].Index = temp;
 
inst->U.I.TexSrcTarget = RC_TEXTURE_2D;
}
 
if (compiler->state.unit[inst->U.I.TexSrcUnit].fake_npot &&
wrapmode != RC_WRAP_NONE && wrapmode != RC_WRAP_CLAMP) {
-   /* Repeat, with optional mirror */
-   inst_rect = rc_insert_new_instruction(c, inst->Prev);
+   if (wrapmode == RC_WRAP_REPEAT) {
+   inst_rect = rc_insert_new_instruction(c, 
inst->Prev);
 
-   inst_rect->U.I.Opcode = RC_OPCODE_FRC;
-   inst_rect->U.I.DstReg.File = RC_FILE_TEMPORARY;
-   inst_rect->U.I.DstReg.Index = temp;
-   inst_rect->U.I.SrcReg[0] = inst->U.I.SrcReg[0];
+   inst_rect->U.I.Opcode = RC_OPCODE_FRC;
+   inst_rect->U.I.DstReg.File = RC_FILE_TEMPORARY;
+   inst_rect->U.I.DstReg.Index = temp;
+   inst_rect->U.I.SrcReg[0] = inst->U.I.SrcReg[0];
+
+   reset_srcreg(&inst->U.I.SrcReg[0]);
+   inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY;
+   inst->U.I.SrcReg[0].Index = temp;
+   } else if (wrapmode == RC_WRAP_MIRROR) {
+   unsigned temp1;
+   /*
+* MUL temp0, abs(temp0), 0.5
+* FRC temp0, temp0
+* SGE temp1, temp0, 0.5
+* MAD temp0, neg(0.5), temp1, temp0
+* ADD temp0, temp0, temp0
+*/
+
+   inst_rect = rc_insert_new_instruction(c, 
inst->Prev);
+
+   inst_rect->U.I.Opcode = RC_OPCODE_MUL;
+   inst_rect->U.I.DstReg.File = RC_FILE_TEMPORARY;
+   inst_rect->U.I.DstReg.Index = temp;
+   inst_rect->U.I.SrcReg[0] = inst->U.I.SrcReg[0];
+   inst_rect->U.I.SrcReg[1].Swizzle = 
RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_HALF);
+
+   inst_rect = rc_insert_new_instruction(c, 
inst->Prev);
+
+   inst_rect->U.I.Opcode = RC_OPCODE_FRC;
+   inst_rect->U.I.DstReg.File = RC_FILE_TEMPORARY;
+   inst_rect->U.I.DstReg.Index = temp;
+   inst_rect->U.I.SrcReg[0].File = 
RC_FILE_TEMPORARY;
+   inst_rect->U.I.SrcReg[0].Index = temp;
+
+   temp1 = rc_find_free_temporary(c);
+   inst_rect = rc_insert_new_instruction(c, 
inst->Prev);
+
+   inst_rect->U.I.Opcode = RC_OPCODE_SGE;
+   inst_rect->U.I.DstReg.File = RC_FILE_TEMPORARY;
+   inst_rect->U.I.DstReg.Index = temp1;
+   inst_rect->U.I.SrcReg[0].File = 
RC_FILE_TEMPORARY;
+   inst_rect->U.I.SrcReg[0].Index = temp;
+   inst_rect->

Mesa (master): r300/compiler: Hax around instructions limits in mirroring code.

2010-04-12 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: c2e804a7e1de99a60ff293972772835772d49391
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2e804a7e1de99a60ff293972772835772d49391

Author: Corbin Simpson 
Date:   Mon Apr 12 18:23:17 2010 -0700

r300/compiler: Hax around instructions limits in mirroring code.

Stuff's starting to show up in arbnpot.

---

 src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c 
b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
index d064292..a581487 100644
--- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
@@ -110,6 +110,16 @@ void r3xx_compile_fragment_program(struct 
r300_fragment_program_compiler* c)
c->Base.SwizzleCaps = &r300_swizzle_caps;
}
 
+   /* As a stopgap, run the ALU lowering sequence once again.
+*
+* The entire lowering sequence should be fixed so that these little
+* inter-dependent instructions aren't an issue. I suppose we'd need a
+* list of safe instructions first... */
+   struct radeon_program_transformation maths_lowering[] = {
+   { &radeonTransformALU, 0 }
+   };
+   radeonLocalTransform(&c->Base, 1, maths_lowering);
+
if (c->Base.Debug) {
fprintf(stderr, "Fragment Program: After native rewrite:\n");
rc_print_program(&c->Base.Program);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): u_blitter: Coords are normalized.

2010-04-13 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 2ee0d19ccf768c4c12c3c3476c1cd7eff508629a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2ee0d19ccf768c4c12c3c3476c1cd7eff508629a

Author: Corbin Simpson 
Date:   Tue Apr 13 23:28:11 2010 -0700

u_blitter: Coords are normalized.

Thanks to Luca Barbieri for spotting this one.

---

 src/gallium/auxiliary/util/u_blitter.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_blitter.c 
b/src/gallium/auxiliary/util/u_blitter.c
index 104cbf7..f3b42f7 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -168,6 +168,7 @@ struct blitter_context *util_blitter_create(struct 
pipe_context *pipe)
sampler_state->wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
sampler_state->wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
sampler_state->wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+   sampler_state->normalized_coords = TRUE;
/* The sampler state objects which sample from a specified mipmap level
 * are created on-demand. */
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300/compiler: Split off texture fixes to their own file.

2010-04-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: f8a14186809356871ae74159c774e9e3959a22e5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8a14186809356871ae74159c774e9e3959a22e5

Author: Corbin Simpson 
Date:   Thu Apr 15 22:48:18 2010 -0700

r300/compiler: Split off texture fixes to their own file.

Yes, I'm fully aware this generates subpar code on r500.

---

 src/mesa/drivers/dri/r300/compiler/Makefile|1 +
 src/mesa/drivers/dri/r300/compiler/r300_fragprog.c |  253 ---
 src/mesa/drivers/dri/r300/compiler/r300_fragprog.h |2 -
 src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c |   19 +-
 src/mesa/drivers/dri/r300/compiler/r500_fragprog.c |  284 -
 src/mesa/drivers/dri/r300/compiler/r500_fragprog.h |5 -
 .../drivers/dri/r300/compiler/radeon_program_tex.c |  321 
 .../drivers/dri/r300/compiler/radeon_program_tex.h |   39 +++
 8 files changed, 369 insertions(+), 555 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile 
b/src/mesa/drivers/dri/r300/compiler/Makefile
index d83888d..c8acd3a 100644
--- a/src/mesa/drivers/dri/r300/compiler/Makefile
+++ b/src/mesa/drivers/dri/r300/compiler/Makefile
@@ -13,6 +13,7 @@ C_SOURCES = \
radeon_opcodes.c \
radeon_program_alu.c \
radeon_program_pair.c \
+   radeon_program_tex.c \
radeon_pair_translate.c \
radeon_pair_schedule.c \
radeon_pair_regalloc.c \
diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c 
b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
index b2cb916..794db83 100644
--- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c
@@ -31,259 +31,6 @@
 
 #include "../r300_reg.h"
 
-static struct rc_src_register shadow_ambient(struct radeon_compiler * c, int 
tmu)
-{
-   struct rc_src_register reg = { 0, };
-
-   reg.File = RC_FILE_CONSTANT;
-   reg.Index = rc_constants_add_state(&c->Program.Constants, 
RC_STATE_SHADOW_AMBIENT, tmu);
-   reg.Swizzle = RC_SWIZZLE_;
-   return reg;
-}
-
-/**
- * Transform TEX, TXP, TXB, and KIL instructions in the following way:
- *  - premultiply texture coordinates for RECT
- *  - extract operand swizzles
- *  - introduce a temporary register when write masks are needed
- */
-int r300_transform_TEX(
-   struct radeon_compiler * c,
-   struct rc_instruction* inst,
-   void* data)
-{
-   struct r300_fragment_program_compiler *compiler =
-   (struct r300_fragment_program_compiler*)data;
-
-   if (inst->U.I.Opcode != RC_OPCODE_TEX &&
-   inst->U.I.Opcode != RC_OPCODE_TXB &&
-   inst->U.I.Opcode != RC_OPCODE_TXP &&
-   inst->U.I.Opcode != RC_OPCODE_KIL)
-   return 0;
-
-   /* ARB_shadow & EXT_shadow_funcs */
-   if (inst->U.I.Opcode != RC_OPCODE_KIL &&
-   c->Program.ShadowSamplers & (1 << inst->U.I.TexSrcUnit)) {
-   rc_compare_func comparefunc = 
compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func;
-
-   if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == 
RC_COMPARE_FUNC_ALWAYS) {
-   inst->U.I.Opcode = RC_OPCODE_MOV;
-
-   if (comparefunc == RC_COMPARE_FUNC_ALWAYS) {
-   inst->U.I.SrcReg[0].File = RC_FILE_NONE;
-   inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_;
-   } else {
-   inst->U.I.SrcReg[0] = shadow_ambient(c, 
inst->U.I.TexSrcUnit);
-   }
-
-   return 1;
-   } else {
-   rc_compare_func comparefunc = 
compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func;
-   unsigned int depthmode = 
compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_mode;
-   struct rc_instruction * inst_rcp = 
rc_insert_new_instruction(c, inst);
-   struct rc_instruction * inst_mad = 
rc_insert_new_instruction(c, inst_rcp);
-   struct rc_instruction * inst_cmp = 
rc_insert_new_instruction(c, inst_mad);
-   int pass, fail;
-
-   inst_rcp->U.I.Opcode = RC_OPCODE_RCP;
-   inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY;
-   inst_rcp->U.I.DstReg.Index = rc_find_free_temporary(c);
-   inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W;
-   inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0];
-   inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_;
-
-   inst_cmp->U.I.DstReg = inst->U.I.DstReg;
-   inst->U.I.DstReg.File = RC_FILE_

Mesa (master): r300/compiler: Save Q for mirror and repeat.

2010-04-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 2e74bc440eb110f1256af26f777e1b283df08df2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e74bc440eb110f1256af26f777e1b283df08df2

Author: Corbin Simpson 
Date:   Thu Apr 15 23:23:52 2010 -0700

r300/compiler: Save Q for mirror and repeat.

---

 .../drivers/dri/r300/compiler/radeon_program_tex.c |   42 +--
 1 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
index b95cea2..655e84b 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
@@ -58,14 +58,14 @@ int radeonTransformTEX(
(struct r300_fragment_program_compiler*)data;
 
if (inst->U.I.Opcode != RC_OPCODE_TEX &&
-   inst->U.I.Opcode != RC_OPCODE_TXB &&
-   inst->U.I.Opcode != RC_OPCODE_TXP &&
-   inst->U.I.Opcode != RC_OPCODE_KIL)
+   inst->U.I.Opcode != RC_OPCODE_TXB &&
+   inst->U.I.Opcode != RC_OPCODE_TXP &&
+   inst->U.I.Opcode != RC_OPCODE_KIL)
return 0;
 
/* ARB_shadow & EXT_shadow_funcs */
if (inst->U.I.Opcode != RC_OPCODE_KIL &&
-   c->Program.ShadowSamplers & (1 << inst->U.I.TexSrcUnit)) {
+   c->Program.ShadowSamplers & (1 << inst->U.I.TexSrcUnit)) {
rc_compare_func comparefunc = 
compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func;
 
if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == 
RC_COMPARE_FUNC_ALWAYS) {
@@ -201,27 +201,17 @@ int radeonTransformTEX(
 
if (compiler->state.unit[inst->U.I.TexSrcUnit].fake_npot &&
wrapmode != RC_WRAP_NONE) {
+   struct rc_instruction *inst_mov;
+
if (wrapmode == RC_WRAP_REPEAT) {
/* Both instructions will be paired up. */
struct rc_instruction *inst_frc = 
rc_insert_new_instruction(c, inst->Prev);
-   struct rc_instruction *inst_mov = 
rc_insert_new_instruction(c, inst_frc);
 
inst_frc->U.I.Opcode = RC_OPCODE_FRC;
inst_frc->U.I.DstReg.File = RC_FILE_TEMPORARY;
inst_frc->U.I.DstReg.Index = temp;
inst_frc->U.I.DstReg.WriteMask = RC_MASK_XYZ;
inst_frc->U.I.SrcReg[0] = inst->U.I.SrcReg[0];
-
-   /* Preserve W for TXP. */
-   inst_mov->U.I.Opcode = RC_OPCODE_MOV;
-   inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY;
-   inst_mov->U.I.DstReg.Index = temp;
-   inst_mov->U.I.DstReg.WriteMask = RC_MASK_W;
-   inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0];
-
-   reset_srcreg(&inst->U.I.SrcReg[0]);
-   inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY;
-   inst->U.I.SrcReg[0].Index = temp;
} else if (wrapmode == RC_WRAP_MIRROR) {
unsigned temp1;
/*
@@ -279,17 +269,26 @@ int radeonTransformTEX(
inst_rect->U.I.SrcReg[0].Index = temp;
inst_rect->U.I.SrcReg[1].File = 
RC_FILE_TEMPORARY;
inst_rect->U.I.SrcReg[1].Index = temp;
-
-   reset_srcreg(&inst->U.I.SrcReg[0]);
-   inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY;
-   inst->U.I.SrcReg[0].Index = temp;
}
+
+   /* Preserve W for TXP/TXB. */
+   inst_mov = rc_insert_new_instruction(c, inst->Prev);
+
+   inst_mov->U.I.Opcode = RC_OPCODE_MOV;
+   inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY;
+   inst_mov->U.I.DstReg.Index = temp;
+   inst_mov->U.I.DstReg.WriteMask = RC_MASK_W;
+   inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0];
+
+   reset_srcreg(&inst->U.I.SrcReg[0]);
+   inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY;
+   inst->U.I.SrcReg[0].Index = temp;
}
}
 
/* Cannot write texture to output registers or with masks */
if (inst->U.I.Opcode != RC_OPCODE_KIL &&
-   (inst-&

Mesa (master): r300/compiler: Oops, this slipped through.

2010-04-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: a089fe281645395d68cfae6d66151a8a88fe5f8e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a089fe281645395d68cfae6d66151a8a88fe5f8e

Author: Corbin Simpson 
Date:   Thu Apr 15 23:35:48 2010 -0700

r300/compiler: Oops, this slipped through.

---

 src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c 
b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
index 1e126d5..5fe10db 100644
--- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
@@ -113,9 +113,11 @@ void r3xx_compile_fragment_program(struct 
r300_fragment_program_compiler* c)
 * Remember, lowering comes last! */
struct radeon_program_transformation common_transformations[] = {
{ &radeonTransformTEX, c },
-   { &radeonTransformALU, 0 }
};
-   radeonLocalTransform(&c->Base, 2, common_transformations);
+   radeonLocalTransform(&c->Base, 1, common_transformations);
+
+   common_transformations[0].function = &radeonTransformALU;
+   radeonLocalTransform(&c->Base, 1, common_transformations);
 
if (c->Base.Debug) {
fprintf(stderr, "Fragment Program: After native rewrite:\n");

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300/compiler: Fix magic numbers in readmasks.

2010-04-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 2c5b35807eb506a1f7a4fc675f5644ae2f675d84
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c5b35807eb506a1f7a4fc675f5644ae2f675d84

Author: Corbin Simpson 
Date:   Fri Apr 16 00:35:10 2010 -0700

r300/compiler: Fix magic numbers in readmasks.

---

 .../drivers/dri/r300/compiler/radeon_opcodes.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
index 9d289fc..cf8602e 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
@@ -412,15 +412,15 @@ void rc_compute_sources_for_writemask(
srcmasks[0] |= RC_MASK_XYZW;
break;
case RC_OPCODE_DST:
-   srcmasks[0] |= 0x6;
-   srcmasks[1] |= 0xa;
+   srcmasks[0] |= RC_MASK_Y | RC_MASK_Z;
+   srcmasks[1] |= RC_MASK_Y | RC_MASK_W;
break;
case RC_OPCODE_EXP:
case RC_OPCODE_LOG:
srcmasks[0] |= RC_MASK_XY;
break;
case RC_OPCODE_LIT:
-   srcmasks[0] |= 0xb;
+   srcmasks[0] |= RC_MASK_X | RC_MASK_Y | RC_MASK_W;
break;
default:
break;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300/compiler: Fix texture instruction readmasks.

2010-04-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: b1a89ea1abe1c69e3e0abcdfc2b525fe7f727864
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1a89ea1abe1c69e3e0abcdfc2b525fe7f727864

Author: Corbin Simpson 
Date:   Fri Apr 16 00:39:42 2010 -0700

r300/compiler: Fix texture instruction readmasks.

No immediate benefit, it was just bugging me.

---

 .../dri/r300/compiler/radeon_dataflow_deadcode.c   |6 ++--
 .../drivers/dri/r300/compiler/radeon_opcodes.c |   24 +--
 .../drivers/dri/r300/compiler/radeon_opcodes.h |4 ++-
 3 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c
index e0c66c4..f373485 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c
@@ -162,7 +162,7 @@ static void update_instruction(struct deadcode_state * s, 
struct rc_instruction
}
 
unsigned int srcmasks[3];
-   rc_compute_sources_for_writemask(opcode, usedmask, srcmasks);
+   rc_compute_sources_for_writemask(inst, usedmask, srcmasks);
 
for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) {
unsigned int refmask = 0;
@@ -250,7 +250,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, 
rc_dataflow_mark_outputs_f
for(struct rc_instruction * inst = c->Program.Instructions.Next;
inst != &c->Program.Instructions;
inst = inst->Next, ++ip) {
-   const struct rc_opcode_info * opcode = 
rc_get_opcode_info(inst->U.I.Opcode);\
+   const struct rc_opcode_info * opcode = 
rc_get_opcode_info(inst->U.I.Opcode);
int dead = 1;
 
if (!opcode->HasDstReg) {
@@ -281,7 +281,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, 
rc_dataflow_mark_outputs_f
else if (inst->U.I.WriteALUResult == RC_ALURESULT_W)
usemask |= RC_MASK_W;
 
-   rc_compute_sources_for_writemask(opcode, usemask, srcmasks);
+   rc_compute_sources_for_writemask(inst, usemask, srcmasks);
 
for(unsigned int src = 0; src < 3; ++src) {
for(unsigned int chan = 0; chan < 4; ++chan) {
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
index cf8602e..ffc9124 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
@@ -26,6 +26,7 @@
  */
 
 #include "radeon_opcodes.h"
+#include "radeon_program.h"
 
 #include "radeon_program_constants.h"
 
@@ -371,10 +372,11 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = {
 };
 
 void rc_compute_sources_for_writemask(
-   const struct rc_opcode_info * opcode,
+   const struct rc_instruction *inst,
unsigned int writemask,
unsigned int *srcmasks)
 {
+   const struct rc_opcode_info * opcode = 
rc_get_opcode_info(inst->U.I.Opcode);
srcmasks[0] = 0;
srcmasks[1] = 0;
srcmasks[2] = 0;
@@ -406,10 +408,26 @@ void rc_compute_sources_for_writemask(
srcmasks[0] |= RC_MASK_XYZW;
srcmasks[1] |= RC_MASK_XYZW;
break;
-   case RC_OPCODE_TEX:
case RC_OPCODE_TXB:
case RC_OPCODE_TXP:
-   srcmasks[0] |= RC_MASK_XYZW;
+   srcmasks[0] |= RC_MASK_W;
+   /* Fall through */
+   case RC_OPCODE_TEX:
+   switch (inst->U.I.TexSrcTarget) {
+   case RC_TEXTURE_1D:
+   srcmasks[0] |= RC_MASK_X;
+   break;
+   case RC_TEXTURE_2D:
+   case RC_TEXTURE_RECT:
+   case RC_TEXTURE_1D_ARRAY:
+   srcmasks[0] |= RC_MASK_XY;
+   break;
+   case RC_TEXTURE_3D:
+   case RC_TEXTURE_CUBE:
+   case RC_TEXTURE_2D_ARRAY:
+   srcmasks[0] |= RC_MASK_XYZ;
+   break;
+   }
break;
case RC_OPCODE_DST:
srcmasks[0] |= RC_MASK_Y | RC_MASK_Z;
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h 
b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h
index a3c5b86..1c9b34d 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h
@@ -227,8 +227,10 @@ static 

Mesa (master): r300g: Spill a bit more info about implementation errors in surface_copy.

2010-04-20 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 73c0f9f0f45b11a6a63d8f5e81a498d1362b7a04
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=73c0f9f0f45b11a6a63d8f5e81a498d1362b7a04

Author: Corbin Simpson 
Date:   Tue Apr 20 13:08:55 2010 -0700

r300g: Spill a bit more info about implementation errors in surface_copy.

compiz appears to hit this. Weird.

---

 src/gallium/drivers/r300/r300_blit.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_blit.c 
b/src/gallium/drivers/r300/r300_blit.c
index e15c71e..928ad30 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -126,7 +126,13 @@ void r300_surface_copy(struct pipe_context* pipe,
 enum pipe_format old_format = dst->texture->format;
 enum pipe_format new_format = old_format;
 
-assert(dst->texture->format == src->texture->format);
+if (dst->texture->format != src->texture->format) {
+debug_printf("r300: Implementation error: Format mismatch in %s\n"
+": src: %s dst: %s\n", __FUNCTION__,
+util_format_name(src->texture->format),
+util_format_name(dst->texture->format));
+debug_assert(0);
+}
 
 if (!pipe->screen->is_format_supported(pipe->screen,
old_format, src->texture->target,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Use table CS writing when applicable.

2010-04-26 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 59fcbc0ac5458c14ae2ec783df8736f3e2fe0963
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=59fcbc0ac5458c14ae2ec783df8736f3e2fe0963

Author: Corbin Simpson 
Date:   Mon Apr 26 00:23:16 2010 -0700

r300g: Use table CS writing when applicable.

I just broke the 2000 fps barrier on glxgears. Yay?

---

 src/gallium/drivers/r300/r300_emit.c |   48 +
 1 files changed, 13 insertions(+), 35 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index ac3b5b0..a6716db 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -93,10 +93,7 @@ void r300_emit_clip_state(struct r300_context* r300,
  R500_PVS_UCP_START : R300_PVS_UCP_START));
 OUT_CS_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, 6 * 4);
 for (i = 0; i < 6; i++) {
-OUT_CS_32F(clip->ucp[i][0]);
-OUT_CS_32F(clip->ucp[i][1]);
-OUT_CS_32F(clip->ucp[i][2]);
-OUT_CS_32F(clip->ucp[i][3]);
+OUT_CS_TABLE(clip->ucp[i], 4);
 }
 OUT_CS_REG(R300_VAP_CLIP_CNTL, ((1 << clip->nr) - 1) |
 R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
@@ -244,8 +241,7 @@ void r300_emit_fs(struct r300_context* r300, unsigned size, 
void *state)
 OUT_CS_REG(R300_US_CODE_OFFSET, code->code_offset);
 
 OUT_CS_REG_SEQ(R300_US_CODE_ADDR_0, 4);
-for(i = 0; i < 4; ++i)
-OUT_CS(code->code_addr[i]);
+OUT_CS_TABLE(code->code_addr, 4);
 
 OUT_CS_REG_SEQ(R300_US_ALU_RGB_INST_0, code->alu.length);
 for (i = 0; i < code->alu.length; i++)
@@ -265,8 +261,7 @@ void r300_emit_fs(struct r300_context* r300, unsigned size, 
void *state)
 
 if (code->tex.length) {
 OUT_CS_REG_SEQ(R300_US_TEX_INST_0, code->tex.length);
-for(i = 0; i < code->tex.length; ++i)
-OUT_CS(code->tex.inst[i]);
+OUT_CS_TABLE(code->tex.inst, code->tex.length);
 }
 
 /* Emit immediates. */
@@ -396,10 +391,7 @@ void r500_emit_fs(struct r300_context* r300, unsigned 
size, void *state)
R500_GA_US_VECTOR_INDEX_TYPE_CONST |
(i & R500_GA_US_VECTOR_INDEX_MASK));
 OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, 4);
-OUT_CS_32F(data[0]);
-OUT_CS_32F(data[1]);
-OUT_CS_32F(data[2]);
-OUT_CS_32F(data[3]);
+OUT_CS_TABLE(data, 4);
 }
 }
 }
@@ -428,10 +420,7 @@ void r500_emit_fs_constants(struct r300_context* r300, 
unsigned size, void *stat
 assert(constants->Constants[i].Type == RC_CONSTANT_EXTERNAL);
 data = buf->constants[i];
 
-OUT_CS_32F(data[0]);
-OUT_CS_32F(data[1]);
-OUT_CS_32F(data[2]);
-OUT_CS_32F(data[3]);
+OUT_CS_TABLE(data, 4);
 }
 END_CS;
 }
@@ -459,10 +448,7 @@ void r500_emit_fs_rc_constant_state(struct r300_context* 
r300, unsigned size, vo
R500_GA_US_VECTOR_INDEX_TYPE_CONST |
(i & R500_GA_US_VECTOR_INDEX_MASK));
 OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, 4);
-OUT_CS_32F(data[0]);
-OUT_CS_32F(data[1]);
-OUT_CS_32F(data[2]);
-OUT_CS_32F(data[3]);
+OUT_CS_TABLE(data, 4);
 }
 }
 END_CS;
@@ -743,8 +729,8 @@ void r300_emit_rs_block_state(struct r300_context* r300,
 } else {
 OUT_CS_REG_SEQ(R300_RS_IP_0, count);
 }
+OUT_CS_TABLE(rs->ip, count);
 for (i = 0; i < count; i++) {
-OUT_CS(rs->ip[i]);
 DBG(r300, DBG_DRAW, ": ip %d: 0x%08x\n", i, rs->ip[i]);
 }
 
@@ -757,8 +743,8 @@ void r300_emit_rs_block_state(struct r300_context* r300,
 } else {
 OUT_CS_REG_SEQ(R300_RS_INST_0, count);
 }
+OUT_CS_TABLE(rs->inst, count);
 for (i = 0; i < count; i++) {
-OUT_CS(rs->inst[i]);
 DBG(r300, DBG_DRAW, ": inst %d: 0x%08x\n", i, rs->inst[i]);
 }
 
@@ -908,14 +894,14 @@ void r300_emit_vertex_stream_state(struct r300_context* 
r300,
 
 BEGIN_CS(size);
 OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, streams->count);
+OUT_CS_TABLE(streams->vap_prog_stream_cntl, streams->count);
 for (i = 0; i < streams->count; i++) {
-OUT_CS(streams->vap_prog_stream_cntl[i]);
 DBG(r300, DBG_DRAW, ": prog_stream_cntl%d: 0x%08x\n", i,
streams->vap_prog_stream_cntl[i]);
 }
 OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_EXT_0, streams->count);
+OUT_CS_TABLE(streams->vap_prog_stream_cntl_ext, streams->count);
 for (i = 0; i < streams->count; i++) {
-OUT_CS(streams->vap_prog_stream_cntl_ext[i]);
 DBG(r300, DBG_DRAW, ": prog_stream_cntl_

Mesa (master): r300g: Add CS table writing.

2010-04-26 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: c53142c3f46735f91b2f11308d08fa7e17edbf91
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c53142c3f46735f91b2f11308d08fa7e17edbf91

Author: Corbin Simpson 
Date:   Mon Apr 26 00:08:46 2010 -0700

r300g: Add CS table writing.

---

 src/gallium/drivers/r300/r300_cs.h  |7 +++
 src/gallium/drivers/r300/r300_winsys.h  |4 
 src/gallium/winsys/radeon/drm/radeon_r300.c |8 
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_cs.h 
b/src/gallium/drivers/r300/r300_cs.h
index 456b2ec..96f2825 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -104,6 +104,13 @@
 cs_count--; \
 } while (0)
 
+#define OUT_CS_TABLE(values, count) do { \
+if (VERY_VERBOSE_REGISTERS) \
+DBG(cs_context_copy, DBG_CS, "r300: writing table of %d dwords\n", 
count); \
+cs_winsys->write_cs_table(cs_winsys, values, count); \
+cs_count -= count; \
+} while (0)
+
 #define OUT_CS_BUF_RELOC(bo, offset, rd, wd, flags) do { \
 DBG(cs_context_copy, DBG_CS, "r300: writing relocation for buffer %p, 
offset %d, " \
 "domains (%d, %d, %d)\n", \
diff --git a/src/gallium/drivers/r300/r300_winsys.h 
b/src/gallium/drivers/r300/r300_winsys.h
index fa00a0c..60c4d18 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -119,6 +119,10 @@ struct r300_winsys_screen {
 /* Write a dword to the command buffer. */
 void (*write_cs_dword)(struct r300_winsys_screen* winsys, uint32_t dword);
 
+/* Write a table of dwords to the command buffer. */
+void (*write_cs_table)(struct r300_winsys_screen* winsys,
+   void *dwords, unsigned count);
+
 /* Write a relocated dword to the command buffer. */
 void (*write_cs_reloc)(struct r300_winsys_screen *winsys,
struct r300_winsys_buffer *buf,
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c 
b/src/gallium/winsys/radeon/drm/radeon_r300.c
index 90675ad..cab41db 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -201,6 +201,13 @@ static void radeon_write_cs_dword(struct 
r300_winsys_screen *rws,
 radeon_cs_write_dword(ws->cs, dword);
 }
 
+static void radeon_write_cs_table(struct r300_winsys_screen *rws,
+  void *table, unsigned count)
+{
+struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws);
+radeon_cs_write_table(ws->cs, table, count);
+}
+
 static void radeon_write_cs_reloc(struct r300_winsys_screen *rws,
   struct r300_winsys_buffer *buf,
   uint32_t rd,
@@ -322,6 +329,7 @@ radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws)
 ws->base.check_cs = radeon_check_cs;
 ws->base.begin_cs = radeon_begin_cs;
 ws->base.write_cs_dword = radeon_write_cs_dword;
+ws->base.write_cs_table = radeon_write_cs_table;
 ws->base.write_cs_reloc = radeon_write_cs_reloc;
 ws->base.end_cs = radeon_end_cs;
 ws->base.flush_cs = radeon_flush_cs;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Rudimentary stats, printed on exit.

2010-04-26 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: b02f1c86f5bf8b1169776975491c7df929e94e2c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b02f1c86f5bf8b1169776975491c7df929e94e2c

Author: Corbin Simpson 
Date:   Mon Apr 26 07:13:15 2010 -0700

r300g: Rudimentary stats, printed on exit.

Whoo!

---

 src/gallium/drivers/r300/r300_context.c |   11 +++
 src/gallium/drivers/r300/r300_context.h |5 +
 src/gallium/drivers/r300/r300_cs.h  |3 +++
 src/gallium/drivers/r300/r300_emit.c|3 +++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c 
b/src/gallium/drivers/r300/r300_context.c
index deaa03e..43a4249 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -41,10 +41,21 @@ static void r300_destroy_context(struct pipe_context* 
context)
 {
 struct r300_context* r300 = r300_context(context);
 struct r300_query* query, * temp;
+struct r300_atom *atom;
 
 util_blitter_destroy(r300->blitter);
 draw_destroy(r300->draw);
 
+/* Print stats, if enabled. */
+if (SCREEN_DBG_ON(r300->screen, DBG_STATS)) {
+fprintf(stderr, "r300: Stats for context %p:\n", r300);
+fprintf(stderr, ": Flushes: %llu\n", r300->flush_counter);
+foreach(atom, &r300->atom_list) {
+fprintf(stderr, ": %s: %llu emits\n",
+atom->name, atom->counter);
+}
+}
+
 /* Free the OQ BO. */
 context->screen->resource_destroy(context->screen, r300->oqbo);
 
diff --git a/src/gallium/drivers/r300/r300_context.h 
b/src/gallium/drivers/r300/r300_context.h
index 1e4fd9e..b6e2059 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -45,6 +45,8 @@ struct r300_atom {
 struct r300_atom *prev, *next;
 /* Name, for debugging. */
 const char* name;
+/* Stat counter. */
+uint64_t counter;
 /* Opaque state. */
 void* state;
 /* Emit the state to the context. */
@@ -435,6 +437,9 @@ struct r300_context {
 /* upload managers */
 struct u_upload_mgr *upload_vb;
 struct u_upload_mgr *upload_ib;
+
+/* Stat counter. */
+uint64_t flush_counter;
 };
 
 /* Convenience cast wrapper. */
diff --git a/src/gallium/drivers/r300/r300_cs.h 
b/src/gallium/drivers/r300/r300_cs.h
index 96f2825..996a4f4 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -157,6 +157,9 @@
 DBG(cs_context_copy, DBG_CS, "r300: FLUSH_CS in %s (%s:%d)\n\n", 
__FUNCTION__, \
 __FILE__, __LINE__); \
 } \
+if (SCREEN_DBG_ON(r300->screen, DBG_STATS)) { \
+r300->flush_counter++; \
+} \
 cs_winsys->flush_cs(cs_winsys); \
 } while (0)
 
diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index a6716db..2816c35 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -1187,6 +1187,9 @@ void r300_emit_dirty_state(struct r300_context* r300)
 foreach(atom, &r300->atom_list) {
 if (atom->dirty) {
 atom->emit(r300, atom->size, atom->state);
+if (SCREEN_DBG_ON(r300->screen, DBG_STATS)) {
+atom->counter++;
+}
 atom->dirty = FALSE;
 }
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Add stats debug flag.

2010-04-26 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: bf98d6170851487a94d9c611035cc2f2e807f8b6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf98d6170851487a94d9c611035cc2f2e807f8b6

Author: Corbin Simpson 
Date:   Mon Apr 26 07:01:27 2010 -0700

r300g: Add stats debug flag.

---

 src/gallium/drivers/r300/r300_debug.c  |1 +
 src/gallium/drivers/r300/r300_screen.h |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_debug.c 
b/src/gallium/drivers/r300/r300_debug.c
index 6e84bf8..aed0ffe 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -41,6 +41,7 @@ static struct debug_option debug_options[] = {
 { "anisohq", DBG_ANISOHQ, "High quality anisotropic filtering (for 
benchmarking)" },
 { "notiling", DBG_NO_TILING, "Disable tiling (for benchmarking)" },
 { "noimmd", DBG_NO_IMMD, "Disable immediate mode (for benchmarking)" },
+{ "stats", DBG_STATS, "Gather statistics (for lulz)" },
 
 { "all", ~0, "Convenience option that enables all debug flags" },
 
diff --git a/src/gallium/drivers/r300/r300_screen.h 
b/src/gallium/drivers/r300/r300_screen.h
index 330bd9b..70ea2fe 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -71,6 +71,7 @@ static INLINE struct r300_screen* r300_screen(struct 
pipe_screen* screen) {
 #define DBG_ANISOHQ 0x080
 #define DBG_NO_TILING 0x100
 #define DBG_NO_IMMD 0x200
+#define DBG_STATS   0x400
 /*...@}*/
 
 static INLINE boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned 
flags)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Fix indentation.

2010-05-12 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: c037c376fbf468020caf2469e83e7a66c18e6f86
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c037c376fbf468020caf2469e83e7a66c18e6f86

Author: Corbin Simpson 
Date:   Wed May 12 10:09:28 2010 -0700

r300g: Fix indentation.

---

 src/gallium/drivers/r300/r300_emit.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 9344b53..568109c 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -1003,16 +1003,16 @@ void r300_emit_viewport_state(struct r300_context* r300,
 struct r300_viewport_state* viewport = (struct r300_viewport_state*)state;
 CS_LOCALS(r300);
 
- BEGIN_CS(size);
- OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6);
- OUT_CS_32F(viewport->xscale);
- OUT_CS_32F(viewport->xoffset);
- OUT_CS_32F(viewport->yscale);
- OUT_CS_32F(viewport->yoffset);
- OUT_CS_32F(viewport->zscale);
- OUT_CS_32F(viewport->zoffset);
- OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control);
- END_CS;
+BEGIN_CS(size);
+OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6);
+OUT_CS_32F(viewport->xscale);
+OUT_CS_32F(viewport->xoffset);
+OUT_CS_32F(viewport->yscale);
+OUT_CS_32F(viewport->yoffset);
+OUT_CS_32F(viewport->zscale);
+OUT_CS_32F(viewport->zoffset);
+OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control);
+END_CS;
 }
 
 void r300_emit_ztop_state(struct r300_context* r300,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Immediate mode won't work with SW TCL right now.

2010-05-12 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 505bea835501d834b0c999700d06280aa57cb6b1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=505bea835501d834b0c999700d06280aa57cb6b1

Author: Corbin Simpson 
Date:   Wed May 12 10:09:50 2010 -0700

r300g: Immediate mode won't work with SW TCL right now.

This could be done later of course. SW TCL should have a much different
threshold because it's much more worth it.

---

 src/gallium/drivers/r300/r300_render.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index 4d76997..db71960 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -198,7 +198,15 @@ static boolean immd_is_good_idea(struct r300_context *r300,
 unsigned vertex_element_count = r300->velems->count;
 unsigned i, vbi;
 
-if (count > 10 || DBG_ON(r300, DBG_NO_IMMD)) {
+if (DBG_ON(r300, DBG_NO_IMMD)) {
+return FALSE;
+}
+
+if (r300->draw) {
+return FALSE;
+}
+
+if (count > 10) {
 return FALSE;
 }
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Add VBO dumper for SW TCL.

2010-05-12 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 3bb1724f3796ad799a93c319e03eae48c0114f1e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3bb1724f3796ad799a93c319e03eae48c0114f1e

Author: Corbin Simpson 
Date:   Wed May 12 10:10:54 2010 -0700

r300g: Add VBO dumper for SW TCL.

Commented out, not easily enabled. *Very* noisy.

---

 src/gallium/drivers/r300/r300_render.c |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index db71960..8795410 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -926,6 +926,8 @@ static void r500_render_draw_arrays(struct vbuf_render* 
render,
 {
 struct r300_render* r300render = r300_render(render);
 struct r300_context* r300 = r300render->r300;
+uint8_t* ptr;
+unsigned i;
 
 CS_LOCALS(r300);
 
@@ -933,6 +935,23 @@ static void r500_render_draw_arrays(struct vbuf_render* 
render,
 
 DBG(r300, DBG_DRAW, "r300: Doing vbuf render, count %d\n", count);
 
+/* Uncomment to dump all VBOs rendered through this interface.
+ * Slow and noisy!
+ptr = pipe_buffer_map(&r300render->r300->context,
+  r300render->vbo, PIPE_TRANSFER_READ,
+  &r300render->vbo_transfer);
+
+for (i = 0; i < count; i++) {
+printf("r300: Vertex %d\n", i);
+draw_dump_emitted_vertex(&r300->vertex_info, ptr);
+ptr += r300->vertex_info.size * 4;
+printf("\n");
+}
+
+pipe_buffer_unmap(&r300render->r300->context, r300render->vbo,
+r300render->vbo_transfer);
+*/
+
 BEGIN_CS(2);
 OUT_CS_PKT3(R300_PACKET3_3D_DRAW_VBUF_2, 0);
 OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (count << 16) |

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Correct viewport setup for SW TCL.

2010-05-12 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 5f161261c70d680c6b227bbf84735348af0973c6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f161261c70d680c6b227bbf84735348af0973c6

Author: Corbin Simpson 
Date:   Wed May 12 10:14:02 2010 -0700

r300g: Correct viewport setup for SW TCL.

glxgears now renders in the right place on-screen, although it is still
rather...psychedelic.

---

 src/gallium/drivers/r300/r300_context.c |3 ---
 src/gallium/drivers/r300/r300_context.h |2 --
 src/gallium/drivers/r300/r300_state.c   |   11 +--
 src/gallium/drivers/r300/r300_state_invariant.c |5 -
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c 
b/src/gallium/drivers/r300/r300_context.c
index e84bce0..0444fda 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -201,9 +201,6 @@ struct pipe_context* r300_create_context(struct 
pipe_screen* screen,
 draw_set_rasterize_stage(r300->draw, r300_draw_stage(r300));
 /* Enable Draw's clipping. */
 draw_set_driver_clipping(r300->draw, FALSE);
-/* Force Draw to never do viewport transform, since we can do
- * transform in hardware, always. */
-draw_set_viewport_state(r300->draw, &r300_viewport_identity);
 }
 
 r300_setup_atoms(r300);
diff --git a/src/gallium/drivers/r300/r300_context.h 
b/src/gallium/drivers/r300/r300_context.h
index 4b401a7..5ad4489 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -321,8 +321,6 @@ struct r300_vertex_element_state {
 struct r300_vertex_stream_state vertex_stream;
 };
 
-extern struct pipe_viewport_state r300_viewport_identity;
-
 struct r300_context {
 /* Parent class */
 struct pipe_context context;
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 3990997..e7fc872 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -395,13 +395,13 @@ static void r300_set_clip_state(struct pipe_context* pipe,
 if (r300->screen->caps.has_tcl) {
 memcpy(r300->clip_state.state, state, sizeof(struct pipe_clip_state));
 r300->clip_state.size = 29;
+
+r300->clip_state.dirty = TRUE;
 } else {
 draw_flush(r300->draw);
 draw_set_clip_state(r300->draw, state);
 r300->clip_state.size = 2;
 }
-
-r300->clip_state.dirty = TRUE;
 }
 
 /* Create a new depth, stencil, and alpha state based on the CSO dsa state.
@@ -1098,6 +1098,13 @@ static void r300_set_viewport_state(struct pipe_context* 
pipe,
 
 r300->viewport = *state;
 
+if (r300->draw) {
+draw_flush(r300->draw);
+draw_set_viewport_state(r300->draw, state);
+viewport->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT;
+return;
+}
+
 /* Do the transform in HW. */
 viewport->vte_control = R300_VTX_W0_FMT;
 
diff --git a/src/gallium/drivers/r300/r300_state_invariant.c 
b/src/gallium/drivers/r300/r300_state_invariant.c
index cd9443f..34d3a16 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.c
+++ b/src/gallium/drivers/r300/r300_state_invariant.c
@@ -27,11 +27,6 @@
 #include "r300_screen.h"
 #include "r300_state_invariant.h"
 
-struct pipe_viewport_state r300_viewport_identity = {
-.scale = {1.0, 1.0, 1.0, 1.0},
-.translate = {0.0, 0.0, 0.0, 0.0},
-};
-
 /* Calculate and emit invariant state. This is data that the 3D engine
  * will probably want at the beginning of every CS, but it's not currently
  * handled by any CSO setup, and in addition it doesn't really change much.

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium: EXT_timer_query support.

2010-05-17 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: cdbd5f4203391ee7eb12911bc86fea34dc61c957
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cdbd5f4203391ee7eb12911bc86fea34dc61c957

Author: Mathias Fröhlich 
Date:   Mon May 17 11:48:56 2010 -0700

gallium: EXT_timer_query support.

Signed-off-by: Corbin Simpson 

---

 src/gallium/drivers/cell/ppu/cell_screen.c |2 +
 src/gallium/drivers/i915/i915_screen.c |2 +
 src/gallium/drivers/i965/brw_screen.c  |2 +
 src/gallium/drivers/llvmpipe/lp_screen.c   |2 +
 src/gallium/drivers/nv50/nv50_screen.c |2 +
 src/gallium/drivers/nvfx/nvfx_screen.c |2 +
 src/gallium/drivers/r300/r300_screen.c |1 +
 src/gallium/drivers/softpipe/sp_query.c|   35 ---
 src/gallium/drivers/softpipe/sp_screen.c   |2 +
 src/gallium/drivers/svga/svga_screen.c |2 +
 src/gallium/include/pipe/p_defines.h   |4 ++-
 src/mesa/state_tracker/st_cb_queryobj.c|3 ++
 src/mesa/state_tracker/st_extensions.c |3 ++
 13 files changed, 57 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c 
b/src/gallium/drivers/cell/ppu/cell_screen.c
index 5af4eaa..750f0aa 100644
--- a/src/gallium/drivers/cell/ppu/cell_screen.c
+++ b/src/gallium/drivers/cell/ppu/cell_screen.c
@@ -76,6 +76,8 @@ cell_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
   return 1;
case PIPE_CAP_OCCLUSION_QUERY:
   return 1;
+   case PIPE_CAP_TIMER_QUERY:
+  return 0;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
   return 10;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index d196c77..7cf627d 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -113,6 +113,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
   return 1;
case PIPE_CAP_OCCLUSION_QUERY:
   return 0;
+   case PIPE_CAP_TIMER_QUERY:
+  return 0;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
   return 1;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
diff --git a/src/gallium/drivers/i965/brw_screen.c 
b/src/gallium/drivers/i965/brw_screen.c
index d242691..1890b64 100644
--- a/src/gallium/drivers/i965/brw_screen.c
+++ b/src/gallium/drivers/i965/brw_screen.c
@@ -172,6 +172,8 @@ brw_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
   return 1;
case PIPE_CAP_OCCLUSION_QUERY:
   return 0;
+   case PIPE_CAP_TIMER_QUERY:
+  return 0;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
   return 1;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 6ab0970..22fbf38 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -105,6 +105,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
   return PIPE_MAX_COLOR_BUFS;
case PIPE_CAP_OCCLUSION_QUERY:
   return 1;
+   case PIPE_CAP_TIMER_QUERY:
+  return 0;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
   return 1;
case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
diff --git a/src/gallium/drivers/nv50/nv50_screen.c 
b/src/gallium/drivers/nv50/nv50_screen.c
index ff3a7b2..a0eed8c 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -125,6 +125,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
return 8;
case PIPE_CAP_OCCLUSION_QUERY:
return 1;
+case PIPE_CAP_TIMER_QUERY:
+   return 0;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
return 1;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c 
b/src/gallium/drivers/nvfx/nvfx_screen.c
index 6b01d86..a44f9e9 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -52,6 +52,8 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
return screen->is_nv4x ? 4 : 2;
case PIPE_CAP_OCCLUSION_QUERY:
return 1;
+case PIPE_CAP_TIMER_QUERY:
+   return 0;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
return 1;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 8399f5d..640b3d3 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -115,6 +115,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
 return 1;
 
 /* Unsupported features (boolean caps). */
+case PIPE_CAP_TIMER_QUERY:
 case PIPE_CAP_DUAL_SOURCE_BLEND:
 case PIPE_CAP_TGSI_CONT_SUPPORTED:
 case PIPE_CAP_INDEP_BLEND_ENABLE:
diff --git a/src/gallium/drivers/softpipe/sp_query.c 
b/src/gallium/drivers/softpipe/sp_query.c
in

Mesa (master): r300g: Add RS block dump.

2010-05-17 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: fea91ee22d468bf2b66aaba9e7b509d30914a110
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fea91ee22d468bf2b66aaba9e7b509d30914a110

Author: Corbin Simpson 
Date:   Thu May 13 18:02:08 2010 -0700

r300g: Add RS block dump.

Shows what's actually going on in the RS block.

---

 src/gallium/drivers/r300/r300_debug.c |   81 +
 src/gallium/drivers/r300/r300_emit.c  |4 ++
 2 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_debug.c 
b/src/gallium/drivers/r300/r300_debug.c
index 74125f0..85a1aa7 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -98,3 +98,84 @@ void r300_init_debug(struct r300_screen * screen)
 }
 }
 }
+
+void r500_dump_rs_block(struct r300_rs_block *rs)
+{
+unsigned count, ip, it_count, ic_count, i, j;
+unsigned tex_ptr;
+unsigned col_ptr, col_fmt;
+
+count = rs->inst_count & 0xf;
+count++;
+
+it_count = rs->count & 0x7f;
+ic_count = (rs->count >> 7) & 0xf;
+
+fprintf(stderr, "RS Block: %d texcoords (linear), %d colors 
(perspective)\n",
+it_count, ic_count);
+fprintf(stderr, "%d instructions\n", count);
+
+for (i = 0; i < count; i++) {
+if (rs->inst[i] & 0x10) {
+ip = rs->inst[i] & 0xf;
+fprintf(stderr, "texture: ip %d to psf %d\n",
+ip, (rs->inst[i] >> 5) & 0x7f);
+
+tex_ptr = rs->ip[ip] & 0xff;
+fprintf(stderr, "   : ");
+
+j = 3;
+do {
+if (tex_ptr & 0x3f == 63) {
+fprintf(stderr, "1.0");
+} else if (tex_ptr & 0x3f == 62) {
+fprintf(stderr, "0.0");
+} else {
+fprintf(stderr, "[%d]", tex_ptr & 0x3f);
+}
+} while (j-- && fprintf(stderr, "/"));
+fprintf(stderr, "\n");
+}
+
+if (rs->inst[i] & 0x1) {
+ip = (rs->inst[i] >> 12) & 0xf;
+fprintf(stderr, "color: ip %d to psf %d\n",
+ip, (rs->inst[i] >> 18) & 0x7f);
+
+col_ptr = (rs->ip[ip] >> 24) & 0x7;
+col_fmt = (rs->ip[ip] >> 27) & 0xf;
+fprintf(stderr, " : offset %d ", col_ptr);
+
+switch (col_fmt) {
+case 0:
+fprintf(stderr, "(R/G/B/A)");
+break;
+case 1:
+fprintf(stderr, "(R/G/B/0)");
+break;
+case 2:
+fprintf(stderr, "(R/G/B/1)");
+break;
+case 4:
+fprintf(stderr, "(0/0/0/A)");
+break;
+case 5:
+fprintf(stderr, "(0/0/0/0)");
+break;
+case 6:
+fprintf(stderr, "(0/0/0/1)");
+break;
+case 8:
+fprintf(stderr, "(1/1/1/A)");
+break;
+case 9:
+fprintf(stderr, "(1/1/1/0)");
+break;
+case 10:
+fprintf(stderr, "(1/1/1/1)");
+break;
+}
+fprintf(stderr, "\n");
+}
+}
+}
diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 49a51fb..7f7f292 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -716,6 +716,10 @@ void r300_emit_rs_block_state(struct r300_context* r300,
 unsigned count = (rs->inst_count & R300_RS_INST_COUNT_MASK) + 1;
 CS_LOCALS(r300);
 
+if (SCREEN_DBG_ON(r300->screen, DBG_DRAW)) {
+r500_dump_rs_block(rs);
+}
+
 DBG(r300, DBG_DRAW, "r300: RS emit:\n");
 
 BEGIN_CS(size);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Update for timer queries.

2010-05-17 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: f1cf6b0d371c907938fd3780ef7a53f294ec1064
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1cf6b0d371c907938fd3780ef7a53f294ec1064

Author: Corbin Simpson 
Date:   Mon May 17 12:00:59 2010 -0700

gallium/docs: Update for timer queries.

---

 src/gallium/docs/source/context.rst |   13 ++---
 src/gallium/docs/source/screen.rst  |3 +++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/gallium/docs/source/context.rst 
b/src/gallium/docs/source/context.rst
index c82e681..66028a6 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
@@ -200,9 +200,16 @@ returned).  Otherwise, if the ``wait`` parameter is FALSE, 
the call
 will not block and the return value will be TRUE if the query has
 completed or FALSE otherwise.
 
-A common type of query is the occlusion query which counts the number of
-fragments/pixels which are written to the framebuffer (and not culled by
-Z/stencil/alpha testing or shader KILL instructions).
+The most common type of query is the occlusion query,
+``PIPE_QUERY_OCCLUSION_COUNTER``, which counts the number of fragments which
+are written to the framebuffer without being culled by
+:ref:`Depth, Stencil, & Alpha` testing or shader KILL instructions.
+
+Another type of query, ``PIPE_QUERY_TIME_ELAPSED``, returns the amount of
+time, in milliseconds, the context takes to perform operations.
+
+Gallium does not guarantee the availability of any query types; one must
+always check the capabilities of the :ref:`Screen` first.
 
 
 Conditional Rendering
diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 71b7aec..96257f9 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -1,3 +1,5 @@
+.. _screen:
+
 Screen
 ==
 
@@ -33,6 +35,7 @@ The integer capabilities:
 * ``MAX_RENDER_TARGETS``: The maximum number of render targets that may be
   bound.
 * ``OCCLUSION_QUERY``: Whether occlusion queries are available.
+* ``TIMER_QUERY``: Whether timer queries are available.
 * ``TEXTURE_SHADOW_MAP``: XXX
 * ``MAX_TEXTURE_2D_LEVELS``: The maximum number of mipmap levels available
   for a 2D texture.

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Fix missing ref.

2010-05-17 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: bb81f65b18b98cb539edf88e171e58fabd732ca3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bb81f65b18b98cb539edf88e171e58fabd732ca3

Author: Corbin Simpson 
Date:   Mon May 17 12:58:29 2010 -0700

gallium/docs: Fix missing ref.

Can't ref in the middle of a paragraph.

---

 src/gallium/docs/source/context.rst |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/gallium/docs/source/context.rst 
b/src/gallium/docs/source/context.rst
index 66028a6..bce1eef 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
@@ -291,11 +291,6 @@ data to be written to the resource at this point.
 The returned map points to the start of the mapped range according to
 the box region, not the beginning of the resource.
 
-.. _transfer_flush_region:
-``transfer_flush_region`` If a transfer was created with 
TRANFER_FLUSH_EXPLICIT,
-only the region specified is guaranteed to be written to. This is relative to
-the mapped range, not the beginning of the resource.
-
 ``transfer_unmap`` remove the memory mapping for the transfer object.
 Any pointers into the map should be considered invalid and discarded.
 
@@ -303,6 +298,16 @@ Any pointers into the map should be considered invalid and 
discarded.
 Basically get_transfer, transfer_map, data write, transfer_unmap, and
 transfer_destroy all in one.
 
+.. _transfer_flush_region:
+
+transfer_flush_region
+%
+
+If a transfer was created with ``FLUSH_EXPLICIT``, it will not automatically
+be flushed on write or unmap. Flushes must be requested with
+``transfer_flush_region``. Flush ranges are relative to the mapped range, not
+the beginning of the resource.
+
 .. _pipe_transfer:
 
 PIPE_TRANSFER
@@ -322,5 +327,4 @@ These flags control the behavior of a transfer object.
   operations pending on the resource are undefined. Cannot be used with
   ``READ``.
 * ``FLUSH_EXPLICIT``: Written ranges will be notified later with
-  :ref:`transfer_flush_region`. Cannot be used with
-  ``READ``.
+  :ref:`transfer_flush_region`. Cannot be used with ``READ``.

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Old MSAA code from before gallium-msaa.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 5c58618406bd5b4ee0bc5121f562560702ebbf98
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c58618406bd5b4ee0bc5121f562560702ebbf98

Author: Corbin Simpson 
Date:   Tue May 25 21:45:38 2010 -0700

r300g: Old MSAA code from before gallium-msaa.

---

 src/gallium/drivers/r300/r300_context.h |2 ++
 src/gallium/drivers/r300/r300_emit.c|7 +++
 src/gallium/drivers/r300/r300_state.c   |7 ++-
 src/gallium/drivers/r300/r300_state_invariant.c |8 
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.h 
b/src/gallium/drivers/r300/r300_context.h
index 90de53e..0d7ff2e 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -103,6 +103,8 @@ struct r300_rs_state {
 struct pipe_rasterizer_state rs_draw;
 
 uint32_t vap_control_status;/* R300_VAP_CNTL_STATUS: 0x2140 */
+uint32_t multisample_position_0;/* R300_GB_MSPOS0: 0x4010 */
+uint32_t multisample_position_1;/* R300_GB_MSPOS1: 0x4014 */
 uint32_t antialiasing_config;   /* R300_GB_AA_CONFIG: 0x4020 */
 uint32_t point_size;/* R300_GA_POINT_SIZE: 0x421c */
 uint32_t point_minmax;  /* R300_GA_POINT_MINMAX: 0x4230 */
diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 64d66e4..aae2e49 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -484,6 +484,13 @@ void r300_emit_rs_state(struct r300_context* r300, 
unsigned size, void* state)
 
 OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config);
 
+OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
+if (r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0)) {
+OUT_CS_REG_SEQ(R300_GB_MSPOS0, 2);
+OUT_CS(rs->multisample_position_0);
+OUT_CS(rs->multisample_position_1);
+}
+OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config);
 OUT_CS_REG(R300_GA_POINT_SIZE, rs->point_size);
 OUT_CS_REG_SEQ(R300_GA_POINT_MINMAX, 2);
 OUT_CS(rs->point_minmax);
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 0772c1f..815f969 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -950,6 +950,11 @@ static void* r300_create_rs_state(struct pipe_context* 
pipe,
 }
 }
 
+if (state->gl_rasterization_rules) {
+rs->multisample_position_0 = 0x;
+rs->multisample_position_1 = 0x666;
+}
+
 return (void*)rs;
 }
 
@@ -979,7 +984,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, 
void* state)
 }
 
 UPDATE_STATE(state, r300->rs_state);
-r300->rs_state.size = 27 + (r300->polygon_offset_enabled ? 5 : 0);
+r300->rs_state.size = 31 + (r300->polygon_offset_enabled ? 5 : 0);
 
 if (last_sprite_coord_enable != r300->sprite_coord_enable ||
 last_two_sided_color != r300->two_sided_color) {
diff --git a/src/gallium/drivers/r300/r300_state_invariant.c 
b/src/gallium/drivers/r300/r300_state_invariant.c
index b3181a3..e67a0ae 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.c
+++ b/src/gallium/drivers/r300/r300_state_invariant.c
@@ -38,14 +38,6 @@ void r300_emit_invariant_state(struct r300_context* r300,
 {
 CS_LOCALS(r300);
 
-if (r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0)) {
-/* Subpixel multisampling for AA. */
-BEGIN_CS(4);
-OUT_CS_REG(R300_GB_MSPOS0, 0x);
-OUT_CS_REG(R300_GB_MSPOS1, 0x666);
-END_CS;
-}
-
 BEGIN_CS(12 + (r300->screen->caps.has_tcl ? 2 : 0));
 
 /*** Graphics Backend (GB) ***/

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Fix indentation.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 3784b0fa69491aa14bdf6f7a61c4d5de2589d234
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3784b0fa69491aa14bdf6f7a61c4d5de2589d234

Author: Corbin Simpson 
Date:   Tue May 25 21:57:10 2010 -0700

r300g: Fix indentation.

I could *not* let this slide since I'm on a 78-char-wide terminal.

---

 src/gallium/drivers/r300/r300_texture.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_texture.c 
b/src/gallium/drivers/r300/r300_texture.c
index adab736..5d8bcff 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -620,8 +620,10 @@ void r300_texture_reinterpret_format(struct pipe_screen 
*screen,
 {
 struct r300_screen *r300screen = r300_screen(screen);
 
-SCREEN_DBG(r300screen, DBG_TEX, "r300: texture_reinterpret_format: %s -> 
%s\n",
-   util_format_short_name(tex->format), 
util_format_short_name(new_format));
+SCREEN_DBG(r300screen, DBG_TEX,
+"r300: texture_reinterpret_format: %s -> %s\n",
+util_format_short_name(tex->format),
+util_format_short_name(new_format));
 
 tex->format = new_format;
 
@@ -784,8 +786,9 @@ static void r300_setup_miptree(struct r300_screen* screen,
 unsigned stride, size, layer_size, nblocksy, i;
 boolean rv350_mode = screen->caps.is_rv350;
 
-SCREEN_DBG(screen, DBG_TEXALLOC, "r300: Making miptree for texture, format 
%s\n",
-   util_format_short_name(base->format));
+SCREEN_DBG(screen, DBG_TEXALLOC,
+"r300: Making miptree for texture, format %s\n",
+util_format_short_name(base->format));
 
 for (i = 0; i <= base->last_level; i++) {
 /* Let's see if this miplevel can be macrotiled. */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Add resource resolve function.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: e163fc0b15c80172fb2615fc04d7fc7bdc0d25c3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e163fc0b15c80172fb2615fc04d7fc7bdc0d25c3

Author: Corbin Simpson 
Date:   Sun Jun 13 20:52:58 2010 -0700

r300g: Add resource resolve function.

---

 src/gallium/drivers/r300/r300_render.c |   35 
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index b97f7be..c5a4406 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -1013,6 +1013,39 @@ struct draw_stage* r300_draw_stage(struct r300_context* 
r300)
 return stage;
 }
 
+/
+ * End of SW TCL functions  *
+ ***/
+
+static void r300_resource_resolve(struct pipe_context* pipe,
+  struct pipe_resource* dest,
+  struct pipe_subresource subdest,
+  struct pipe_resource* src,
+  struct pipe_subresource subsrc)
+{
+struct r300_context* r300 = r300_context(pipe);
+struct r300_texture* tex;
+CS_LOCALS(r300);
+
+assert(tex && tex->buffer && "resolvebuf is marked, but NULL!");
+
+OUT_CS_REG_SEQ(R300_RB3D_AARESOLVE_OFFSET, 1);
+OUT_CS_TEX_RELOC(tex, tex->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+
+OUT_CS_REG_SEQ(R300_RB3D_AARESOLVE_PITCH, 1);
+OUT_CS_TEX_RELOC(tex, tex->fb_state.colorpitch[tex->level],
+0, RADEON_GEM_DOMAIN_VRAM, 0);
+
+OUT_CS_REG(R300_RB3D_AARESOLVE_CTL,
+R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_RESOLVE |
+R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_AVERAGE);
+
+r300->context.resource_fill_region(pipe,
+src, subsrc, 0, 0, 0, src->width0, src->height0, 0x0);
+
+OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x0);
+}
+
 void r300_init_render_functions(struct r300_context *r300)
 {
 /* Set generic functions. */
@@ -1027,6 +1060,8 @@ void r300_init_render_functions(struct r300_context *r300)
 r300->context.draw_range_elements = r300_swtcl_draw_range_elements;
 }
 
+r300->context.resource_resolve = r300_resource_resolve;
+
 /* Plug in the two-sided stencil reference value fallback if needed. */
 if (!r300->screen->caps.is_r500)
 r300_plug_in_stencil_ref_fallback(r300);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Moar MSAA setup.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: a91fea65dc574cc0ba2ccec936d60366b034489a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a91fea65dc574cc0ba2ccec936d60366b034489a

Author: Corbin Simpson 
Date:   Tue May 25 22:33:21 2010 -0700

r300g: Moar MSAA setup.

Need to just add the resolve, then go switch to new DRM and test.

---

 src/gallium/drivers/r300/r300_emit.c|   54 ++
 src/gallium/drivers/r300/r300_screen.c  |   13 ++-
 src/gallium/drivers/r300/r300_state.c   |3 +-
 src/gallium/drivers/r300/r300_texture.c |4 ++
 4 files changed, 63 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index aae2e49..251e170 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -475,22 +475,60 @@ void r300_emit_query_end(struct r300_context* r300)
 
 void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state)
 {
-struct r300_rs_state* rs = (struct r300_rs_state*)state;
+struct r300_rs_state* rs = state;
+struct pipe_framebuffer_state* fb = r300->fb_state.state;
 float scale, offset;
+unsigned mspos0, mspos1, aa_config;
 CS_LOCALS(r300);
 
 BEGIN_CS(size);
 OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
 
-OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config);
-
-OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
+/* Multisampling. Depends on framebuffer sample count. */
 if (r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0)) {
-OUT_CS_REG_SEQ(R300_GB_MSPOS0, 2);
-OUT_CS(rs->multisample_position_0);
-OUT_CS(rs->multisample_position_1);
+if (fb->nr_cbufs && fb->cbufs[0]->texture->nr_samples > 1) {
+aa_config = R300_GB_AA_CONFIG_AA_ENABLE;
+/* Subsample placement. These may not be optimal. */
+switch (fb->cbufs[0]->texture->nr_samples) {
+case 2:
+aa_config |= R300_GB_AA_CONFIG_NUM_AA_SUBSAMPLES_2;
+mspos0 = 0x33996633;
+mspos1 = 0x663;
+break;
+case 3:
+aa_config |= R300_GB_AA_CONFIG_NUM_AA_SUBSAMPLES_3;
+mspos0 = 0x33936933;
+mspos1 = 0x663;
+break;
+case 4:
+aa_config |= R300_GB_AA_CONFIG_NUM_AA_SUBSAMPLES_4;
+mspos0 = 0x33939933;
+mspos1 = 0x393;
+break;
+case 6:
+aa_config |= R300_GB_AA_CONFIG_NUM_AA_SUBSAMPLES_6;
+mspos0 = 0x22a2aa22;
+mspos1 = 0x2a65672;
+break;
+default:
+debug_printf("r300: Bad number of multisamples!\n");
+break;
+}
+
+OUT_CS_REG_SEQ(R300_GB_MSPOS0, 2);
+OUT_CS(mspos0);
+OUT_CS(mspos1);
+
+OUT_CS_REG(R300_GB_AA_CONFIG, aa_config);
+} else {
+OUT_CS_REG_SEQ(R300_GB_MSPOS0, 2);
+OUT_CS(rs->multisample_position_0);
+OUT_CS(rs->multisample_position_1);
+
+OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config);
+}
 }
-OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config);
+
 OUT_CS_REG(R300_GA_POINT_SIZE, rs->point_size);
 OUT_CS_REG_SEQ(R300_GA_POINT_MINMAX, 2);
 OUT_CS(rs->point_minmax);
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index f0c562b..c599f76 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -275,8 +275,17 @@ static boolean r300_is_format_supported(struct 
pipe_screen* screen,
 return FALSE;
 }
 
-   if (sample_count > 1)
-  return FALSE;
+switch (sample_count) {
+case 0:
+case 1:
+case 2:
+case 3:
+case 4:
+case 6:
+break;
+default:
+return FALSE;
+}
 
 /* Check sampler format support. */
 if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 815f969..651ad7d 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -984,7 +984,8 @@ static void r300_bind_rs_state(struct pipe_context* pipe, 
void* state)
 }
 
 UPDATE_STATE(state, r300->rs_state);
-r300->rs_state.size = 31 + (r300->polygon_offset_enabled ? 5 : 0);
+r300->rs_state.size = 25 + (r300->polygon_offset_enabled ? 5 : 0 +
+r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0) ? 6 : 0);
 
 if (last_sprite_coord_enable != r300->sprite_coord_enable

Mesa (master): r300g: Finish resolve function.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 68cefb423a1bd7cb2bee6375cae8e9c46b1211c5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=68cefb423a1bd7cb2bee6375cae8e9c46b1211c5

Author: Corbin Simpson 
Date:   Wed Jun 16 10:50:37 2010 -0700

r300g: Finish resolve function.

---

 src/gallium/drivers/r300/r300_render.c |   20 ++--
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index c5a4406..16add41 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -1024,24 +1024,32 @@ static void r300_resource_resolve(struct pipe_context* 
pipe,
   struct pipe_subresource subsrc)
 {
 struct r300_context* r300 = r300_context(pipe);
-struct r300_texture* tex;
+struct r300_texture* tex = r300_texture(dest);
+struct pipe_surface* surf = dest->screen->get_tex_surface(dest->screen,
+dest, subdest.face, subdest.level, 0, 0);
+float color[] = {0, 0, 0, 0};
 CS_LOCALS(r300);
 
+DBG(r300, DBG_DRAW, "r300: Resolving resource...\n");
+
 assert(tex && tex->buffer && "resolvebuf is marked, but NULL!");
 
 OUT_CS_REG_SEQ(R300_RB3D_AARESOLVE_OFFSET, 1);
-OUT_CS_TEX_RELOC(tex, tex->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+OUT_CS_TEX_RELOC(tex, surf->offset, 0, tex->domain, 0);
 
 OUT_CS_REG_SEQ(R300_RB3D_AARESOLVE_PITCH, 1);
-OUT_CS_TEX_RELOC(tex, tex->fb_state.colorpitch[tex->level],
-0, RADEON_GEM_DOMAIN_VRAM, 0);
+OUT_CS_TEX_RELOC(tex, tex->fb_state.colorpitch[surf->level],
+0, tex->domain, 0);
 
 OUT_CS_REG(R300_RB3D_AARESOLVE_CTL,
 R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_RESOLVE |
 R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_AVERAGE);
 
-r300->context.resource_fill_region(pipe,
-src, subsrc, 0, 0, 0, src->width0, src->height0, 0x0);
+surf = src->screen->get_tex_surface(src->screen,
+src, subsrc.face, subsrc.level, 0, 0);
+
+r300->context.clear_render_target(pipe,
+surf, color, 0, 0, src->width0, src->height0);
 
 OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x0);
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Don't multisample non-32-bpp render targets.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 8ecca392da70eb0137117e73448fe610a5638ae7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ecca392da70eb0137117e73448fe610a5638ae7

Author: Corbin Simpson 
Date:   Wed Jun 16 10:51:04 2010 -0700

r300g: Don't multisample non-32-bpp render targets.

---

 src/gallium/drivers/r300/r300_screen.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index c599f76..8f7c96b 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -278,10 +278,16 @@ static boolean r300_is_format_supported(struct 
pipe_screen* screen,
 switch (sample_count) {
 case 0:
 case 1:
+break;
 case 2:
 case 3:
 case 4:
 case 6:
+if (usage != PIPE_BIND_RENDER_TARGET ||
+!util_format_is_rgba8_variant(
+util_format_description(format))) {
+return FALSE;
+}
 break;
 default:
 return FALSE;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Fix MSAA state size.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 61145c0d5c1abe6882a076f57b1b51c83aedbc33
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=61145c0d5c1abe6882a076f57b1b51c83aedbc33

Author: Corbin Simpson 
Date:   Wed Jun 16 10:51:35 2010 -0700

r300g: Fix MSAA state size.

---

 src/gallium/drivers/r300/r300_state.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 651ad7d..ed0dbe8 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -985,7 +985,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, 
void* state)
 
 UPDATE_STATE(state, r300->rs_state);
 r300->rs_state.size = 25 + (r300->polygon_offset_enabled ? 5 : 0 +
-r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0) ? 6 : 0);
+r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0) ? 5 : 0);
 
 if (last_sprite_coord_enable != r300->sprite_coord_enable ||
 last_two_sided_color != r300->two_sided_color) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Fix up resolve.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: e41ad8d2c5cac28cbdc3c1c234f1149c91a8d803
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e41ad8d2c5cac28cbdc3c1c234f1149c91a8d803

Author: Corbin Simpson 
Date:   Wed Jun 16 11:01:34 2010 -0700

r300g: Fix up resolve.

Yay for old code.

---

 src/gallium/drivers/r300/r300_render.c |   20 
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index 16add41..9b08187 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -1024,32 +1024,28 @@ static void r300_resource_resolve(struct pipe_context* 
pipe,
   struct pipe_subresource subsrc)
 {
 struct r300_context* r300 = r300_context(pipe);
-struct r300_texture* tex = r300_texture(dest);
-struct pipe_surface* surf = dest->screen->get_tex_surface(dest->screen,
-dest, subdest.face, subdest.level, 0, 0);
+struct r300_surface* destsurf = r300_surface(
+dest->screen->get_tex_surface(dest->screen,
+dest, subdest.face, subdest.level, 0, 0));
+struct pipe_surface* srcsurf = src->screen->get_tex_surface(src->screen,
+src, subsrc.face, subsrc.level, 0, 0);
 float color[] = {0, 0, 0, 0};
 CS_LOCALS(r300);
 
 DBG(r300, DBG_DRAW, "r300: Resolving resource...\n");
 
-assert(tex && tex->buffer && "resolvebuf is marked, but NULL!");
-
 OUT_CS_REG_SEQ(R300_RB3D_AARESOLVE_OFFSET, 1);
-OUT_CS_TEX_RELOC(tex, surf->offset, 0, tex->domain, 0);
+OUT_CS_RELOC(destsurf->buffer, destsurf->offset, 0, destsurf->domain, 0);
 
 OUT_CS_REG_SEQ(R300_RB3D_AARESOLVE_PITCH, 1);
-OUT_CS_TEX_RELOC(tex, tex->fb_state.colorpitch[surf->level],
-0, tex->domain, 0);
+OUT_CS_RELOC(destsurf->buffer, destsurf->pitch, 0, destsurf->domain, 0);
 
 OUT_CS_REG(R300_RB3D_AARESOLVE_CTL,
 R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_RESOLVE |
 R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_AVERAGE);
 
-surf = src->screen->get_tex_surface(src->screen,
-src, subsrc.face, subsrc.level, 0, 0);
-
 r300->context.clear_render_target(pipe,
-surf, color, 0, 0, src->width0, src->height0);
+srcsurf, color, 0, 0, src->width0, src->height0);
 
 OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x0);
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Flesh out the distro information.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: e7d05f1f0d2b16b316a1a801baba0d237272b094
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7d05f1f0d2b16b316a1a801baba0d237272b094

Author: Corbin Simpson 
Date:   Wed Jun 16 16:52:52 2010 -0700

gallium/docs: Flesh out the distro information.

I'm not sure I picked the best voice here. I might come back to this
later.

---

 src/gallium/docs/source/context.rst |2 +
 src/gallium/docs/source/distro.rst  |   54 --
 2 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/src/gallium/docs/source/context.rst 
b/src/gallium/docs/source/context.rst
index 9e3a272..4e35a4c 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
@@ -1,3 +1,5 @@
+.. _context:
+
 Context
 ===
 
diff --git a/src/gallium/docs/source/distro.rst 
b/src/gallium/docs/source/distro.rst
index 100afe3..6ba5a05 100644
--- a/src/gallium/docs/source/distro.rst
+++ b/src/gallium/docs/source/distro.rst
@@ -10,69 +10,100 @@ Drivers
 Cell
 
 
+Simple driver for the IBM Cell architecture. Runs faster than :ref:`softpipe`
+on Cell-based machines.
+
 Failover
 
 
-Deprecated.
+Broken and deprecated.
 
 Intel i915
 ^^
 
+Driver for Intel i915 and i945 chipsets.
+
 Intel i965
 ^^
 
-Highly experimental.
+Highly experimental driver for Intel i965 chipsets.
 
 Identity
 
 
-Wrapper driver.
+Wrapper driver. The identity driver is a simple skeleton that passes through
+all of its :ref:`Context` and :ref:`Screen` methods to an underlying Context
+and Screen, and as such, it is an excellent starting point for new drivers.
 
 LLVM Softpipe
 ^
 
-nVidia nv30
-^^^
+A version of :ref:`softpipe` that uses the Low-Level Virtual Machine to
+dynamically generate optimized rasterizing pipelines.
 
-nVidia nv40
+nVidia nvfx
 ^^^
 
+Driver for the nVidia nv30 and nv40 families of GPUs.
+
 nVidia nv50
 ^^^
 
+Driver for the nVidia nv50 family of GPUs.
+
 VMWare SVGA
 ^^^
 
+Driver for VMWare virtualized guest operating system graphics processing.
+
 ATI r300
 
 
-Testing-quality.
+Driver for the ATI/AMD r300, r400, and r500 families of GPUs.
+
+.. _softpipe:
 
 Softpipe
 
 
-Reference software rasterizer.
+Reference software rasterizer. Slow but accurate.
 
 Trace
 ^
 
-Wrapper driver.
+Wrapper driver. Trace dumps an XML record of the calls made to the
+:ref:`Context` and :ref:`Screen` objects that it wraps.
 
 State Trackers
 --
 
+.. _dri:
+
 Direct Rendering Infrastructure
 ^^^
 
+Tracker that implements the client-side DRI protocol, for providing direct
+acceleration services to X11 servers with the DRI extension. Supports DRI1
+and DRI2. Only GL is supported.
+
+.. _egl:
+
 EGL
 ^^^
 
+Tracker for the Khronos EGL standard, used to set up GL and GLES contexts
+without extra knowledge of the underlying windowing system.
+
 GLX
 ^^^
 
 MesaGL
 ^^
 
+Tracker implementing a GL state machine. Not usable as a standalone tracker;
+Mesa should be built with another state tracker, such as :ref:`DRI` or
+:ref:`EGL`.
+
 Python
 ^^
 
@@ -82,9 +113,12 @@ OpenVG
 WGL
 ^^^
 
-Xorg XFree86 DDX
+Xorg/XFree86 DDX
 
 
+Tracker for XFree86 and Xorg X11 servers. Provides device-dependent
+modesetting and acceleration as a DDX driver.
+
 Auxiliary
 -
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Fix RST error.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 517a4fb051017caa446730977899c9d36ca18d87
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=517a4fb051017caa446730977899c9d36ca18d87

Author: Corbin Simpson 
Date:   Wed Jun 16 11:10:46 2010 -0700

gallium/docs: Fix RST error.

---

 src/gallium/docs/source/context.rst |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/docs/source/context.rst 
b/src/gallium/docs/source/context.rst
index 0242ded..9e3a272 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
@@ -120,7 +120,7 @@ will be cleared.
 color value. While it is only possible to clear one surface at a time (which 
can
 include several layers), this surface need not be bound to the framebuffer.
 
-``clear_depth_stencil``clears a single depth, stencil or depth/stencil surface
+``clear_depth_stencil`` clears a single depth, stencil or depth/stencil surface
 with the specified depth and stencil values (for combined depth/stencil 
buffers,
 is is also possible to only clear one or the other part). While it is only
 possible to clear one surface at a time (which can include several layers),

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: R and RG texture swizzles.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 92867dcc42089a71031d1d49f574dc64af9387de
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=92867dcc42089a71031d1d49f574dc64af9387de

Author: Corbin Simpson 
Date:   Wed Jun 16 16:56:55 2010 -0700

gallium/docs: R and RG texture swizzles.

We *did* reach an agreement on this a few months ago, and now the docs
reflect it. However, we never got around to UV and Z...

---

 src/gallium/docs/source/tgsi.rst |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 411dce8..03f27cd 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -1420,9 +1420,9 @@ well.
 ++--++--+
 | Texture Components | Gallium  | OpenGL | Direct3D 9   |
 ++==++==+
-| R  | XXX TBD  | (r, 0, 0, 1)   | (r, 1, 1, 1) |
+| R  | (r, 0, 0, 1) | (r, 0, 0, 1)   | (r, 1, 1, 1) |
 ++--++--+
-| RG | XXX TBD  | (r, g, 0, 1)   | (r, g, 1, 1) |
+| RG | (r, g, 0, 1) | (r, g, 0, 1)   | (r, g, 1, 1) |
 ++--++--+
 | RGB| (r, g, b, 1) | (r, g, b, 1)   | (r, g, b, 1) |
 ++--++--+

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Label opcodes by capability bits.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 9d4cb6ea36aa0335aa8a6a1e1adc39e40ec5138d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d4cb6ea36aa0335aa8a6a1e1adc39e40ec5138d

Author: Corbin Simpson 
Date:   Wed Jun 16 18:34:32 2010 -0700

gallium/docs: Label opcodes by capability bits.

---

 src/gallium/docs/source/tgsi.rst |   29 -
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 03f27cd..706383a 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -26,9 +26,11 @@ each of the components of *dst*. When this happens, the 
result is said to be
 Instruction Set
 ---
 
-From GL_NV_vertex_program
+Core ISA
 ^
 
+These opcodes are guaranteed to be available regardless of the driver being
+used.
 
 .. opcode:: ARL - Address Register Load
 
@@ -637,10 +639,6 @@ This instruction replicates its result.
Considered for removal.
 
 
-From GL_NV_vertex_program2
-^^
-
-
 .. opcode:: ARA - Address Register Add
 
   TBD
@@ -827,11 +825,14 @@ This instruction replicates its result.
Considered for removal.
 
 
-From GL_NV_gpu_program4
+Compute ISA
 
 
+These opcodes are primarily provided for special-use computational shaders.
 Support for these opcodes indicated by a special pipe capability bit (TBD).
 
+XXX so let's discuss it, yeah?
+
 .. opcode:: CEIL - Ceiling
 
 .. math::
@@ -989,10 +990,17 @@ Support for these opcodes indicated by a special pipe 
capability bit (TBD).
 
   TBD
 
+.. note::
+
+   Support for CONT is determined by a special capability bit,
+   ``TGSI_CONT_SUPPORTED``. See :ref:`Screen` for more information.
+
 
-From GL_NV_geometry_program4
+Geometry ISA
 ^
 
+These opcodes are only supported in geometry shaders; they have no meaning
+in any other type of shader.
 
 .. opcode:: EMIT - Emit
 
@@ -1004,9 +1012,11 @@ From GL_NV_geometry_program4
   TBD
 
 
-From GLSL
+GLSL ISA
 ^^
 
+These opcodes are part of :term:`GLSL`'s opcode set. Support for these
+opcodes is determined by a special capability bit, ``GLSL``.
 
 .. opcode:: BGNLOOP - Begin a Loop
 
@@ -1045,6 +1055,7 @@ This instruction replicates its result.
 ps_2_x
 
 
+XXX wait what
 
 .. opcode:: CALLNZ - Subroutine Call If Not Zero
 
@@ -1062,7 +1073,7 @@ ps_2_x
 
 .. _doubleopcodes:
 
-Double Opcodes
+Double ISA
 ^^^
 
 .. opcode:: DADD - Add Double

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Explain DFRACEXP/DLDEXP.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: f98c462770ad26888c4c89f7e0989c2dba48e77d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f98c462770ad26888c4c89f7e0989c2dba48e77d

Author: Corbin Simpson 
Date:   Wed Jun 16 18:45:50 2010 -0700

gallium/docs: Explain DFRACEXP/DLDEXP.

---

 src/gallium/docs/source/tgsi.rst |   20 +++-
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index ba844a2..ecab7cb 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -1125,19 +1125,29 @@ Support for these opcodes is XXX undecided. :T
 
 .. opcode:: DFRACEXP - Convert Number to Fractional and Integral Components
 
+Like the ``frexp()`` routine in many math libraries, this opcode stores the
+exponent of its source to ``dst0``, and the significand to ``dst1``, such that
+:math:`dst1 \times 2^{dst0} = src` .
+
 .. math::
 
-  dst0.xy = frexp(src.xy, dst1.xy)
+  dst0.xy = exp(src.xy)
+
+  dst1.xy = frac(src.xy)
+
+  dst0.zw = exp(src.zw)
+
+  dst1.zw = frac(src.zw)
 
-  dst0.zw = frexp(src.zw, dst1.zw)
+.. opcode:: DLDEXP - Multiply Number by Integral Power of 2
 
-.. opcode:: DLDEXP - Multiple Number by Integral Power of 2
+This opcode is the inverse of :opcode:`DFRACEXP`.
 
 .. math::
 
-  dst.xy = ldexp(src0.xy, src1.xy)
+  dst.xy = src0.xy \times 2^{src1.xy}
 
-  dst.zw = ldexp(src0.zw, src1.zw)
+  dst.zw = src0.zw \times 2^{src1.zw}
 
 .. opcode:: DMIN - Minimum
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Remove unneeded "doubles", add double blurb.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: dbc95e8edca408346c5a2fae5e584658c5feea76
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbc95e8edca408346c5a2fae5e584658c5feea76

Author: Corbin Simpson 
Date:   Wed Jun 16 18:34:51 2010 -0700

gallium/docs: Remove unneeded "doubles", add double blurb.

---

 src/gallium/docs/source/tgsi.rst |   31 ++-
 1 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 706383a..ba844a2 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -1076,7 +1076,12 @@ XXX wait what
 Double ISA
 ^^^
 
-.. opcode:: DADD - Add Double
+The double-precision opcodes reinterpret four-component vectors into
+two-component vectors with doubled precision in each component.
+
+Support for these opcodes is XXX undecided. :T
+
+.. opcode:: DADD - Add
 
 .. math::
 
@@ -1085,7 +1090,7 @@ Double ISA
   dst.zw = src0.zw + src1.zw
 
 
-.. opcode:: DDIV - Divide Double
+.. opcode:: DDIV - Divide
 
 .. math::
 
@@ -1093,7 +1098,7 @@ Double ISA
 
   dst.zw = src0.zw / src1.zw
 
-.. opcode:: DSEQ - Set Double on Equal
+.. opcode:: DSEQ - Set on Equal
 
 .. math::
 
@@ -1101,7 +1106,7 @@ Double ISA
 
   dst.zw = src0.zw == src1.zw ? 1.0F : 0.0F
 
-.. opcode:: DSLT - Set Double on Less than
+.. opcode:: DSLT - Set on Less than
 
 .. math::
 
@@ -1109,7 +1114,7 @@ Double ISA
 
   dst.zw = src0.zw < src1.zw ? 1.0F : 0.0F
 
-.. opcode:: DFRAC - Double Fraction
+.. opcode:: DFRAC - Fraction
 
 .. math::
 
@@ -1118,7 +1123,7 @@ Double ISA
   dst.zw = src.zw - \lfloor src.zw\rfloor
 
 
-.. opcode:: DFRACEXP - Convert Double Number to Fractional and Integral 
Components
+.. opcode:: DFRACEXP - Convert Number to Fractional and Integral Components
 
 .. math::
 
@@ -1126,7 +1131,7 @@ Double ISA
 
   dst0.zw = frexp(src.zw, dst1.zw)
 
-.. opcode:: DLDEXP - Multiple Double Number by Integral Power of 2
+.. opcode:: DLDEXP - Multiple Number by Integral Power of 2
 
 .. math::
 
@@ -1134,7 +1139,7 @@ Double ISA
 
   dst.zw = ldexp(src0.zw, src1.zw)
 
-.. opcode:: DMIN - Minimum Double
+.. opcode:: DMIN - Minimum
 
 .. math::
 
@@ -1142,7 +1147,7 @@ Double ISA
 
   dst.zw = min(src0.zw, src1.zw)
 
-.. opcode:: DMAX - Maximum Double
+.. opcode:: DMAX - Maximum
 
 .. math::
 
@@ -1150,7 +1155,7 @@ Double ISA
 
   dst.zw = max(src0.zw, src1.zw)
 
-.. opcode:: DMUL - Multiply Double
+.. opcode:: DMUL - Multiply
 
 .. math::
 
@@ -1159,7 +1164,7 @@ Double ISA
   dst.zw = src0.zw \times src1.zw
 
 
-.. opcode:: DMAD - Multiply And Add Doubles
+.. opcode:: DMAD - Multiply And Add
 
 .. math::
 
@@ -1168,7 +1173,7 @@ Double ISA
   dst.zw = src0.zw \times src1.zw + src2.zw
 
 
-.. opcode:: DRCP - Reciprocal Double
+.. opcode:: DRCP - Reciprocal
 
 .. math::
 
@@ -1176,7 +1181,7 @@ Double ISA
 
dst.zw = \frac{1}{src.zw}
 
-.. opcode:: DSQRT - Square root double
+.. opcode:: DSQRT - Square Root
 
 .. math::
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: GLSL glossary entry.

2010-06-16 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 1e6d51e805baa11eff17ea784c92ffc7933c56c5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e6d51e805baa11eff17ea784c92ffc7933c56c5

Author: Corbin Simpson 
Date:   Wed Jun 16 18:57:51 2010 -0700

gallium/docs: GLSL glossary entry.

---

 src/gallium/docs/source/glossary.rst |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/docs/source/glossary.rst 
b/src/gallium/docs/source/glossary.rst
index 0696cb5..acde56e 100644
--- a/src/gallium/docs/source/glossary.rst
+++ b/src/gallium/docs/source/glossary.rst
@@ -21,3 +21,7 @@ Glossary
LOD
   Level of Detail. Also spelled "LoD." The value that determines when the
   switches between mipmaps occur during texture sampling.
+
+   GLSL
+  GL Shading Language. The official, common high-level shader language used
+  in GL 2.0 and above.

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/drivers: Create Galahad from identity.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: d3ad6fa579d89d8c3ee27882d5baf8f8d2ecb3ea
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d3ad6fa579d89d8c3ee27882d5baf8f8d2ecb3ea

Author: Corbin Simpson 
Date:   Tue Jun 22 21:58:56 2010 -0700

gallium/drivers: Create Galahad from identity.

Galahad is a sanity-checking layer meant to replace the crufty and
scattered sanity checks inside drivers with a robust, non-silenceable,
useful set of warnings and errors that can be used to keep misbehaving
state trackers from going unnoticed.

---

 src/gallium/drivers/galahad/Makefile   |   12 +
 src/gallium/drivers/galahad/SConscript |   14 +
 src/gallium/drivers/galahad/glhd_context.c |  952 
 src/gallium/drivers/galahad/glhd_context.h |   52 ++
 src/gallium/drivers/galahad/glhd_drm.c |   93 +++
 src/gallium/drivers/galahad/glhd_drm.h |   35 +
 src/gallium/drivers/galahad/glhd_objects.c |  186 ++
 src/gallium/drivers/galahad/glhd_objects.h |  176 +
 src/gallium/drivers/galahad/glhd_public.h  |   37 ++
 src/gallium/drivers/galahad/glhd_screen.c  |  325 ++
 src/gallium/drivers/galahad/glhd_screen.h  |   48 ++
 11 files changed, 1930 insertions(+), 0 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=d3ad6fa579d89d8c3ee27882d5baf8f8d2ecb3ea
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): configure: Add galahad to default build.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 256097858881323d0b6ece248be163bb157f43aa
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=256097858881323d0b6ece248be163bb157f43aa

Author: Corbin Simpson 
Date:   Tue Jun 22 22:00:43 2010 -0700

configure: Add galahad to default build.

---

 configure.ac |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7f5db09..5cfdd45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -474,7 +474,7 @@ GLU_DIRS="sgi"
 GALLIUM_DIRS="auxiliary drivers state_trackers"
 GALLIUM_TARGET_DIRS=""
 GALLIUM_WINSYS_DIRS="sw"
-GALLIUM_DRIVERS_DIRS="softpipe failover trace rbug identity"
+GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug identity"
 GALLIUM_STATE_TRACKERS_DIRS=""
 
 case "$mesa_driver" in

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): id, glhd: Fix segfault with misreferenced pipe member.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 75612aa19946c6e546ff72b83d0e1bbe4db90db2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=75612aa19946c6e546ff72b83d0e1bbe4db90db2

Author: Corbin Simpson 
Date:   Tue Jun 22 22:13:33 2010 -0700

id, glhd: Fix segfault with misreferenced pipe member.

And remove the offending member to keep that from happening again.

---

 src/gallium/drivers/galahad/glhd_objects.c |4 ++--
 src/gallium/drivers/galahad/glhd_objects.h |1 -
 src/gallium/drivers/identity/id_objects.c  |4 ++--
 src/gallium/drivers/identity/id_objects.h  |1 -
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_objects.c 
b/src/gallium/drivers/galahad/glhd_objects.c
index cea32d7..4682d71 100644
--- a/src/gallium/drivers/galahad/glhd_objects.c
+++ b/src/gallium/drivers/galahad/glhd_objects.c
@@ -180,7 +180,7 @@ galahad_transfer_destroy(struct galahad_context 
*glhd_context,
   struct galahad_transfer *glhd_transfer)
 {
pipe_resource_reference(&glhd_transfer->base.resource, NULL);
-   glhd_transfer->pipe->transfer_destroy(glhd_context->pipe,
-   glhd_transfer->transfer);
+   glhd_context->pipe->transfer_destroy(glhd_context->pipe,
+glhd_transfer->transfer);
FREE(glhd_transfer);
 }
diff --git a/src/gallium/drivers/galahad/glhd_objects.h 
b/src/gallium/drivers/galahad/glhd_objects.h
index 16e1d94..9358039 100644
--- a/src/gallium/drivers/galahad/glhd_objects.h
+++ b/src/gallium/drivers/galahad/glhd_objects.h
@@ -65,7 +65,6 @@ struct galahad_transfer
 {
struct pipe_transfer base;
 
-   struct pipe_context *pipe;
struct pipe_transfer *transfer;
 };
 
diff --git a/src/gallium/drivers/identity/id_objects.c 
b/src/gallium/drivers/identity/id_objects.c
index ca4743f..82d06e7 100644
--- a/src/gallium/drivers/identity/id_objects.c
+++ b/src/gallium/drivers/identity/id_objects.c
@@ -180,8 +180,8 @@ identity_transfer_destroy(struct identity_context 
*id_context,
   struct identity_transfer *id_transfer)
 {
pipe_resource_reference(&id_transfer->base.resource, NULL);
-   id_transfer->pipe->transfer_destroy(id_context->pipe,
-   id_transfer->transfer);
+   id_context->pipe->transfer_destroy(id_context->pipe,
+  id_transfer->transfer);
FREE(id_transfer);
 }
 
diff --git a/src/gallium/drivers/identity/id_objects.h 
b/src/gallium/drivers/identity/id_objects.h
index 5eea10b..e8deabf 100644
--- a/src/gallium/drivers/identity/id_objects.h
+++ b/src/gallium/drivers/identity/id_objects.h
@@ -65,7 +65,6 @@ struct identity_transfer
 {
struct pipe_transfer base;
 
-   struct pipe_context *pipe;
struct pipe_transfer *transfer;
 };
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): targets, radeong: Add Galahad.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 40faedfe7b4c17bc62da4c5f661fac3cc292082d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=40faedfe7b4c17bc62da4c5f661fac3cc292082d

Author: Corbin Simpson 
Date:   Tue Jun 22 22:09:52 2010 -0700

targets, radeong: Add Galahad.

Currently unconditional and causes segfaults.

---

 src/gallium/drivers/galahad/Makefile   |2 +-
 src/gallium/targets/dri-radeong/Makefile   |1 +
 src/gallium/targets/egl-radeon/Makefile|1 +
 src/gallium/targets/xorg-radeon/Makefile   |3 ++-
 src/gallium/winsys/radeon/drm/radeon_drm.c |4 +++-
 5 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/galahad/Makefile 
b/src/gallium/drivers/galahad/Makefile
index d5df84b..67d0874 100644
--- a/src/gallium/drivers/galahad/Makefile
+++ b/src/gallium/drivers/galahad/Makefile
@@ -1,7 +1,7 @@
 TOP = ../../../..
 include $(TOP)/configs/current
 
-LIBNAME = identity
+LIBNAME = galahad
 
 C_SOURCES = \
glhd_objects.c \
diff --git a/src/gallium/targets/dri-radeong/Makefile 
b/src/gallium/targets/dri-radeong/Makefile
index 8ef24c0..8ba1972 100644
--- a/src/gallium/targets/dri-radeong/Makefile
+++ b/src/gallium/targets/dri-radeong/Makefile
@@ -7,6 +7,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \
$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+   $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
diff --git a/src/gallium/targets/egl-radeon/Makefile 
b/src/gallium/targets/egl-radeon/Makefile
index 8fcca26..64c20af 100644
--- a/src/gallium/targets/egl-radeon/Makefile
+++ b/src/gallium/targets/egl-radeon/Makefile
@@ -7,6 +7,7 @@ EGL_DRIVER_LIBS = -ldrm_radeon
 
 EGL_DRIVER_PIPES = \
$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
+   $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
diff --git a/src/gallium/targets/xorg-radeon/Makefile 
b/src/gallium/targets/xorg-radeon/Makefile
index a4951c4..6cbc61e 100644
--- a/src/gallium/targets/xorg-radeon/Makefile
+++ b/src/gallium/targets/xorg-radeon/Makefile
@@ -13,10 +13,11 @@ DRIVER_LINKS = \
 $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
 $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
 $(TOP)/src/gallium/drivers/r300/libr300.a \
+   $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
 $(TOP)/src/gallium/drivers/trace/libtrace.a \
 $(TOP)/src/gallium/drivers/rbug/librbug.a \
 $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
 $(GALLIUM_AUXILIARIES) \
-   $(shell pkg-config --libs libdrm libdrm_intel)
+   $(shell pkg-config --libs libdrm libdrm_radeon)
 
 include ../Makefile.xorg
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm.c 
b/src/gallium/winsys/radeon/drm/radeon_drm.c
index 59f1b10..a9ae09c 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm.c
@@ -34,6 +34,8 @@
 #include "radeon_buffer.h"
 
 #include "r300_winsys.h"
+
+#include "galahad/glhd_drm.h"
 #include "trace/tr_drm.h"
 
 #include "util/u_memory.h"
@@ -188,5 +190,5 @@ static struct drm_api radeon_drm_api_hooks = {
 
 struct drm_api* drm_api_create()
 {
-return trace_drm_create(&radeon_drm_api_hooks);
+return galahad_drm_create(trace_drm_create(&radeon_drm_api_hooks));
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Add glhd_warn for unconditional stderr output.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 7d551eb03df0a732e9e55dd960afffc6a1525377
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d551eb03df0a732e9e55dd960afffc6a1525377

Author: Corbin Simpson 
Date:   Tue Jun 22 22:37:39 2010 -0700

glhd: Add glhd_warn for unconditional stderr output.

Design decision. Bad API errors should never be silenced.

Of course, you can always not use galahad.

---

 src/gallium/drivers/galahad/glhd_context.h |9 +
 src/gallium/drivers/galahad/glhd_screen.c  |1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.h 
b/src/gallium/drivers/galahad/glhd_context.h
index b316ec3..a8753d0 100644
--- a/src/gallium/drivers/galahad/glhd_context.h
+++ b/src/gallium/drivers/galahad/glhd_context.h
@@ -28,6 +28,8 @@
 #ifndef GLHD_CONTEXT_H
 #define GLHD_CONTEXT_H
 
+#include 
+
 #include "pipe/p_state.h"
 #include "pipe/p_context.h"
 
@@ -49,4 +51,11 @@ galahad_context(struct pipe_context *pipe)
return (struct galahad_context *)pipe;
 }
 
+#define glhd_warn(...) \
+do { \
+fprintf(stderr, "galahad: %s: ", __FUNCTION__); \
+fprintf(stderr, __VA_ARGS__); \
+fprintf(stderr, "\n"); \
+} while (0)
+
 #endif /* GLHD_CONTEXT_H */
diff --git a/src/gallium/drivers/galahad/glhd_screen.c 
b/src/gallium/drivers/galahad/glhd_screen.c
index 3f56c3b..33cf9d2 100644
--- a/src/gallium/drivers/galahad/glhd_screen.c
+++ b/src/gallium/drivers/galahad/glhd_screen.c
@@ -1,6 +1,7 @@
 /**
  *
  * Copyright 2009 VMware, Inc.
+ * 2010 Corbin Simpson 
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Grab is_format_supported warning from r300g.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: de7b181e99a64cb517a021f00f714c6af9b337ee
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=de7b181e99a64cb517a021f00f714c6af9b337ee

Author: Corbin Simpson 
Date:   Tue Jun 22 22:39:53 2010 -0700

glhd: Grab is_format_supported warning from r300g.

---

 src/gallium/drivers/galahad/glhd_screen.c |4 
 src/gallium/drivers/r300/r300_screen.c|6 --
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_screen.c 
b/src/gallium/drivers/galahad/glhd_screen.c
index 33cf9d2..bcc37cb 100644
--- a/src/gallium/drivers/galahad/glhd_screen.c
+++ b/src/gallium/drivers/galahad/glhd_screen.c
@@ -99,6 +99,10 @@ galahad_screen_is_format_supported(struct pipe_screen 
*_screen,
struct galahad_screen *glhd_screen = galahad_screen(_screen);
struct pipe_screen *screen = glhd_screen->screen;
 
+   if (target >= PIPE_MAX_TEXTURE_TYPES) {
+  glhd_warn("Received bogus texture target %d", target);
+   }
+
return screen->is_format_supported(screen,
   format,
   target,
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 8f7c96b..d3d36a7 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -269,12 +269,6 @@ static boolean r300_is_format_supported(struct 
pipe_screen* screen,
 format == PIPE_FORMAT_R16G16B16_FLOAT ||
 format == PIPE_FORMAT_R16G16B16A16_FLOAT;
 
-if (target >= PIPE_MAX_TEXTURE_TYPES) {
-fprintf(stderr, "r300: Implementation error: Received bogus texture "
-"target %d in %s\n", target, __FUNCTION__);
-return FALSE;
-}
-
 switch (sample_count) {
 case 0:
 case 1:

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Grab resource_copy_region from r300g.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 3f758d4ed42f6b4c6bed60f8270ef908d3829ee5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f758d4ed42f6b4c6bed60f8270ef908d3829ee5

Author: Corbin Simpson 
Date:   Tue Jun 22 22:46:15 2010 -0700

glhd: Grab resource_copy_region from r300g.

---

 src/gallium/drivers/galahad/glhd_context.c |8 
 src/gallium/drivers/r300/r300_blit.c   |8 
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c 
b/src/gallium/drivers/galahad/glhd_context.c
index ae4fc92..6dfee2c 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -27,6 +27,8 @@
 
 
 #include "pipe/p_context.h"
+
+#include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
 
@@ -633,6 +635,12 @@ galahad_resource_copy_region(struct pipe_context *_pipe,
struct pipe_resource *dst = glhd_resource_dst->resource;
struct pipe_resource *src = glhd_resource_src->resource;
 
+   if (_dst->format != _src->format) {
+  glhd_warn("Format mismatch: Source is %s, destination is %s",
+ util_format_short_name(_src->format),
+ util_format_short_name(_dst->format));
+   }
+
pipe->resource_copy_region(pipe,
   dst,
   subdst,
diff --git a/src/gallium/drivers/r300/r300_blit.c 
b/src/gallium/drivers/r300/r300_blit.c
index 2a47701..389354c 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -185,14 +185,6 @@ static void r300_resource_copy_region(struct pipe_context 
*pipe,
 enum pipe_format old_format = dst->format;
 enum pipe_format new_format = old_format;
 
-if (dst->format != src->format) {
-debug_printf("r300: Implementation error: Format mismatch in %s\n"
-": src: %s dst: %s\n", __FUNCTION__,
-util_format_short_name(src->format),
-util_format_short_name(dst->format));
-debug_assert(0);
-}
-
 if (!pipe->screen->is_format_supported(pipe->screen,
old_format, src->target,
src->nr_samples,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Grab framebuffer state checks from r300g.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: aa451d509df844e4652853f08e31bc1ee18c04ac
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa451d509df844e4652853f08e31bc1ee18c04ac

Author: Corbin Simpson 
Date:   Tue Jun 22 23:00:44 2010 -0700

glhd: Grab framebuffer state checks from r300g.

---

 src/gallium/drivers/galahad/glhd_context.c |   10 ++
 src/gallium/drivers/galahad/glhd_context.h |3 +++
 src/gallium/drivers/r300/r300_state.c  |6 --
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c 
b/src/gallium/drivers/galahad/glhd_context.c
index 6dfee2c..7a856ef 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -497,6 +497,16 @@ galahad_set_framebuffer_state(struct pipe_context *_pipe,
struct pipe_framebuffer_state *state = NULL;
unsigned i;
 
+   if (_state->nr_cbufs > PIPE_MAX_COLOR_BUFS) {
+  glhd_error("%d render targets bound, but only %d are permitted by API",
+ _state->nr_cbufs, PIPE_MAX_COLOR_BUFS);
+   } else if (_state->nr_cbufs >
+  pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_RENDER_TARGETS)) {
+  glhd_warn("%d render targets bound, but only %d are supported",
+ _state->nr_cbufs,
+ pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_RENDER_TARGETS));
+   }
+
/* unwrap the input state */
if (_state) {
   memcpy(&unwrapped_state, _state, sizeof(unwrapped_state));
diff --git a/src/gallium/drivers/galahad/glhd_context.h 
b/src/gallium/drivers/galahad/glhd_context.h
index a8753d0..4e71753 100644
--- a/src/gallium/drivers/galahad/glhd_context.h
+++ b/src/gallium/drivers/galahad/glhd_context.h
@@ -58,4 +58,7 @@ do { \
 fprintf(stderr, "\n"); \
 } while (0)
 
+#define glhd_error(...) \
+glhd_warn(__VA_ARGS__);
+
 #endif /* GLHD_CONTEXT_H */
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index bc2b62b..927e936 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -668,12 +668,6 @@ static void
 unsigned max_width, max_height, i;
 uint32_t zbuffer_bpp = 0;
 
-if (state->nr_cbufs > 4) {
-fprintf(stderr, "r300: Implementation error: Too many MRTs in %s, "
-"refusing to bind framebuffer state!\n", __FUNCTION__);
-return;
-}
-
 if (r300->screen->caps.is_r500) {
 max_width = max_height = 4096;
 } else if (r300->screen->caps.is_r400) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Add query protection.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: a6cc91487446f8e1e72e4f67823a359c0b3a41d6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a6cc91487446f8e1e72e4f67823a359c0b3a41d6

Author: Corbin Simpson 
Date:   Tue Jun 22 23:11:01 2010 -0700

glhd: Add query protection.

Not quite copied from r300g. This is slightly more API-compliant.

---

 src/gallium/drivers/galahad/glhd_context.c |   10 ++
 src/gallium/drivers/r300/r300_query.c  |4 +++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c 
b/src/gallium/drivers/galahad/glhd_context.c
index 7a856ef..5531f57 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -119,6 +119,16 @@ galahad_create_query(struct pipe_context *_pipe,
struct galahad_context *glhd_pipe = galahad_context(_pipe);
struct pipe_context *pipe = glhd_pipe->pipe;
 
+   if (query_type == PIPE_QUERY_OCCLUSION_COUNTER &&
+  !pipe->screen->get_param(pipe->screen, PIPE_CAP_OCCLUSION_QUERY)) {
+  glhd_error("Occlusion query requested but not supported");
+   }
+
+   if (query_type == PIPE_QUERY_TIME_ELAPSED &&
+  !pipe->screen->get_param(pipe->screen, PIPE_CAP_TIMER_QUERY)) {
+  glhd_error("Timer query requested but not supported");
+   }
+
return pipe->create_query(pipe,
  query_type);
 }
diff --git a/src/gallium/drivers/r300/r300_query.c 
b/src/gallium/drivers/r300/r300_query.c
index 10cb468..10086ee 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -37,7 +37,9 @@ static struct pipe_query *r300_create_query(struct 
pipe_context *pipe,
 struct r300_screen *r300screen = r300->screen;
 struct r300_query *q;
 
-assert(query_type == PIPE_QUERY_OCCLUSION_COUNTER);
+if (query_type != PIPE_QUERY_OCCLUSION_COUNTER) {
+return NULL;
+}
 
 q = CALLOC_STRUCT(r300_query);
 if (!q)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): id, glhd: Fix malloc/calloc of struct.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: ee2c6d748de170e0ffc30bb4a8366526a1a25f65
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee2c6d748de170e0ffc30bb4a8366526a1a25f65

Author: Corbin Simpson 
Date:   Tue Jun 22 23:40:11 2010 -0700

id, glhd: Fix malloc/calloc of struct.

( >&)

---

 src/gallium/drivers/galahad/glhd_objects.c |2 +-
 src/gallium/drivers/identity/id_objects.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_objects.c 
b/src/gallium/drivers/galahad/glhd_objects.c
index 4682d71..c9680d1 100644
--- a/src/gallium/drivers/galahad/glhd_objects.c
+++ b/src/gallium/drivers/galahad/glhd_objects.c
@@ -120,7 +120,7 @@ galahad_sampler_view_create(struct galahad_context 
*glhd_context,
 
assert(view->texture == glhd_resource->resource);
 
-   glhd_view = MALLOC(sizeof(struct galahad_sampler_view));
+   glhd_view = CALLOC_STRUCT(galahad_sampler_view);
 
glhd_view->base = *view;
glhd_view->base.reference.count = 1;
diff --git a/src/gallium/drivers/identity/id_objects.c 
b/src/gallium/drivers/identity/id_objects.c
index 82d06e7..cd364a2 100644
--- a/src/gallium/drivers/identity/id_objects.c
+++ b/src/gallium/drivers/identity/id_objects.c
@@ -120,7 +120,7 @@ identity_sampler_view_create(struct identity_context 
*id_context,
 
assert(view->texture == id_resource->resource);
 
-   id_view = MALLOC(sizeof(struct identity_sampler_view));
+   id_view = CALLOC_STRUCT(identity_sampler_view);
 
id_view->base = *view;
id_view->base.reference.count = 1;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): radeong: Disable Galahad for now; breaks texturing.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 7dc1cf19ace0587254e86bf6544a6659a31f0af8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7dc1cf19ace0587254e86bf6544a6659a31f0af8

Author: Corbin Simpson 
Date:   Wed Jun 23 00:11:42 2010 -0700

radeong: Disable Galahad for now; breaks texturing.

---

 src/gallium/winsys/radeon/drm/radeon_drm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm.c 
b/src/gallium/winsys/radeon/drm/radeon_drm.c
index a9ae09c..590b1d0 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm.c
@@ -190,5 +190,6 @@ static struct drm_api radeon_drm_api_hooks = {
 
 struct drm_api* drm_api_create()
 {
-return galahad_drm_create(trace_drm_create(&radeon_drm_api_hooks));
+//return galahad_drm_create(trace_drm_create(&radeon_drm_api_hooks));
+return trace_drm_create(&radeon_drm_api_hooks);
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Use an environment variable (GALAHAD) to enable. Off by default.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 95263058349060fcba9f59a866eb30b4656c33a5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=95263058349060fcba9f59a866eb30b4656c33a5

Author: Corbin Simpson 
Date:   Wed Jun 23 11:06:42 2010 -0700

glhd: Use an environment variable (GALAHAD) to enable. Off by default.

---

 src/gallium/drivers/galahad/glhd_drm.c |3 +++
 src/gallium/winsys/radeon/drm/radeon_drm.c |3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_drm.c 
b/src/gallium/drivers/galahad/glhd_drm.c
index 78e290c..d62f6f4 100644
--- a/src/gallium/drivers/galahad/glhd_drm.c
+++ b/src/gallium/drivers/galahad/glhd_drm.c
@@ -75,6 +75,9 @@ galahad_drm_create(struct drm_api *api)
if (!api)
   goto error;
 
+   if (!debug_get_option("GALAHAD", FALSE))
+  goto error;
+
glhd_api = CALLOC_STRUCT(galahad_drm_api);
 
if (!glhd_api)
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm.c 
b/src/gallium/winsys/radeon/drm/radeon_drm.c
index 590b1d0..a9ae09c 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm.c
@@ -190,6 +190,5 @@ static struct drm_api radeon_drm_api_hooks = {
 
 struct drm_api* drm_api_create()
 {
-//return galahad_drm_create(trace_drm_create(&radeon_drm_api_hooks));
-return trace_drm_create(&radeon_drm_api_hooks);
+return galahad_drm_create(trace_drm_create(&radeon_drm_api_hooks));
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): id, glhd: Unbreak texturing.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 666fdc01c4a00eef0e114001441441fb7caeee15
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=666fdc01c4a00eef0e114001441441fb7caeee15

Author: Corbin Simpson 
Date:   Wed Jun 23 11:25:52 2010 -0700

id, glhd: Unbreak texturing.

Argfl.

---

 src/gallium/drivers/galahad/glhd_objects.c |1 +
 src/gallium/drivers/identity/id_objects.c  |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_objects.c 
b/src/gallium/drivers/galahad/glhd_objects.c
index c9680d1..6c5a21a 100644
--- a/src/gallium/drivers/galahad/glhd_objects.c
+++ b/src/gallium/drivers/galahad/glhd_objects.c
@@ -127,6 +127,7 @@ galahad_sampler_view_create(struct galahad_context 
*glhd_context,
glhd_view->base.texture = NULL;
pipe_resource_reference(&glhd_view->base.texture, glhd_resource->resource);
glhd_view->base.context = glhd_context->pipe;
+   glhd_view->sampler_view = view;
 
return &glhd_view->base;
 error:
diff --git a/src/gallium/drivers/identity/id_objects.c 
b/src/gallium/drivers/identity/id_objects.c
index cd364a2..593928f 100644
--- a/src/gallium/drivers/identity/id_objects.c
+++ b/src/gallium/drivers/identity/id_objects.c
@@ -127,6 +127,7 @@ identity_sampler_view_create(struct identity_context 
*id_context,
id_view->base.texture = NULL;
pipe_resource_reference(&id_view->base.texture, id_resource->resource);
id_view->base.context = id_context->pipe;
+   id_view->sampler_view = view;
 
return &id_view->base;
 error:

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Simple rasterizer checks.

2010-06-23 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: e6ee4e1bdf0f82fd3c09a0cb95a5844bed25a1d1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6ee4e1bdf0f82fd3c09a0cb95a5844bed25a1d1

Author: Corbin Simpson 
Date:   Wed Jun 23 11:34:51 2010 -0700

glhd: Simple rasterizer checks.

>From the documentation.

---

 src/gallium/drivers/galahad/glhd_context.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c 
b/src/gallium/drivers/galahad/glhd_context.c
index 5531f57..3b20cb1 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -269,6 +269,16 @@ galahad_create_rasterizer_state(struct pipe_context *_pipe,
struct galahad_context *glhd_pipe = galahad_context(_pipe);
struct pipe_context *pipe = glhd_pipe->pipe;
 
+   if (rasterizer->point_quad_rasterization) {
+   if (rasterizer->point_smooth) {
+   glhd_warn("Point smoothing requested but ignored");
+   }
+   } else {
+   if (rasterizer->sprite_coord_enable) {
+   glhd_warn("Point sprites requested but ignored");
+   }
+   }
+
return pipe->create_rasterizer_state(pipe,
 rasterizer);
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Slight clarification and formatting for Blend.

2010-06-24 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 1e10464557308d0fe31c7b30f1be41e1a8c2245c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e10464557308d0fe31c7b30f1be41e1a8c2245c

Author: Corbin Simpson 
Date:   Wed Jun 23 13:57:30 2010 -0700

gallium/docs: Slight clarification and formatting for Blend.

---

 src/gallium/docs/source/cso/blend.rst |   39 +++--
 1 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/src/gallium/docs/source/cso/blend.rst 
b/src/gallium/docs/source/cso/blend.rst
index c743962..a3ccc67 100644
--- a/src/gallium/docs/source/cso/blend.rst
+++ b/src/gallium/docs/source/cso/blend.rst
@@ -14,21 +14,46 @@ in other modern and legacy drawing APIs.
 
 XXX blurb about dual-source blends
 
+Logical Operations
+--
+
+Logical operations, also known as logicops, lops, or rops, are supported.
+Only two-operand logicops are available. When logicops are enabled, all other
+blend state is ignored, including per-render-target state, so logicops are
+performed on all enabled render targets.
+
+XXX do lops still apply if blend_enable isn't set?
+
 Members
 ---
 
+These members affect all render targets.
+
+dither
+%%
+
+Whether dithering is enabled.
+
+.. note::
+   Dithering is completely implementation-dependent. It may be ignored by
+   drivers for any reason, and some render targets may always or never be
+   dithered depending on their format or usage flags.
+
+logicop_enable
+%%
+
+Whether the blender should perform a logicop instead of blending.
+
+logicop_func
+
+
+The logicop to use. One of ``PIPE_LOGICOP``.
+
 independent_blend_enable
If enabled, blend state is different for each render target, and
for each render target set in the respective member of the rt array.
If disabled, blend state is the same for all render targets, and only
the first member of the rt array contains valid data.
-logicop_enable
-   Enables logic ops. Cannot be enabled at the same time as blending, and
-   is always the same for all render targets.
-logicop_func
-   The logic operation to use if logic ops are enabled. One of PIPE_LOGICOP.
-dither
-   Whether dithering is enabled. Note: Dithering is implementation-dependent.
 rt
Contains the per-rendertarget blend state.
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): pipe: Add PIPE_OS_HURD

2010-06-24 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: fd7de146f6c5989ab3a8459d600ca3386571b31f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd7de146f6c5989ab3a8459d600ca3386571b31f

Author: nobled 
Date:   Wed Jun 23 21:31:28 2010 -0400

pipe: Add PIPE_OS_HURD

One tiny step toward porting Gallium to the GNU/Hurd kernel
(and fixing Debian bug #585618).

Signed-off-by: Corbin Simpson 

---

 src/gallium/include/pipe/p_config.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/gallium/include/pipe/p_config.h 
b/src/gallium/include/pipe/p_config.h
index b81702a..c6ea198 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -146,6 +146,11 @@
 #define PIPE_OS_UNIX
 #endif
 
+#if defined(__GNU__)
+#define PIPE_OS_HURD
+#define PIPE_OS_UNIX
+#endif
+
 #if defined(__sun)
 #define PIPE_OS_SOLARIS
 #define PIPE_OS_UNIX

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Add lop table.

2010-06-24 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 06a75bd8730fea6cb04b2e6b1754704fc196f050
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=06a75bd8730fea6cb04b2e6b1754704fc196f050

Author: Corbin Simpson 
Date:   Wed Jun 23 14:25:26 2010 -0700

gallium/docs: Add lop table.

Was feeling kind of weird without it.

---

 src/gallium/docs/source/cso/blend.rst |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/gallium/docs/source/cso/blend.rst 
b/src/gallium/docs/source/cso/blend.rst
index a3ccc67..d97e3d3 100644
--- a/src/gallium/docs/source/cso/blend.rst
+++ b/src/gallium/docs/source/cso/blend.rst
@@ -24,6 +24,32 @@ performed on all enabled render targets.
 
 XXX do lops still apply if blend_enable isn't set?
 
+For a source component `s` and destination component `d`, the logical
+operations are defined as taking the bits of each channel of each component,
+and performing one of the following operations per-channel:
+
+* ``CLEAR``: 0
+* ``NOR``: :math:`\lnot(s \lor d)`
+* ``AND_INVERTED``: :math:`\lnot s \land d`
+* ``COPY_INVERTED``: :math:`\lnot s`
+* ``AND_REVERSE``: :math:`s \land \lnot d`
+* ``INVERT``: :math:`\lnot d`
+* ``XOR``: :math:`s \oplus d`
+* ``NAND``: :math:`\lnot(s \land d)`
+* ``AND``: :math:`s \land d`
+* ``EQUIV``: :math:`\lnot(s \oplus d)`
+* ``NOOP``: :math:`d`
+* ``OR_INVERTED``: :math:`\lnot s \lor d`
+* ``COPY``: :math:`s`
+* ``OR_REVERSE``: :math:`s \lor \lnot d`
+* ``OR``: :math:`s \lor d`
+* ``SET``: 1
+
+.. note::
+   The logical operation names and definitions match those of the OpenGL API,
+   and are similar to the ROP2 and ROP3 definitions of GDI. This is
+   intentional, to ease transitions to Gallium.
+
 Members
 ---
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glhd: Add test for logicop enable.

2010-06-24 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 484bb0ea58aae909c3f0accf9b085ac0a5861fe2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=484bb0ea58aae909c3f0accf9b085ac0a5861fe2

Author: Corbin Simpson 
Date:   Thu Jun 24 07:18:59 2010 -0700

glhd: Add test for logicop enable.

Only for first RT at the moment, as there is no trivial way in galahad
to look at framebuffer state and (sadly) people don't usually calloc
their CSOs, so flags could be wrongly set.

On the other hand, of course, galahad will hopefully encourage more
people to calloc their CSOs. :3

---

 src/gallium/drivers/galahad/glhd_context.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c 
b/src/gallium/drivers/galahad/glhd_context.c
index 3b20cb1..ab6f17b 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -188,6 +188,13 @@ galahad_create_blend_state(struct pipe_context *_pipe,
struct galahad_context *glhd_pipe = galahad_context(_pipe);
struct pipe_context *pipe = glhd_pipe->pipe;
 
+   if (blend->logicop_enable) {
+  if (blend->rt[0].blend_enable) {
+ glhd_warn("Blending enabled for render target 0, but logicops "
+"are enabled");
+  }
+   }
+
return pipe->create_blend_state(pipe,
blend);
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Vertex data formats.

2010-06-24 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 474dc40fb4a99ff0f8d86538407cd90b7ee3bb14
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=474dc40fb4a99ff0f8d86538407cd90b7ee3bb14

Author: Corbin Simpson 
Date:   Thu Jun 24 07:54:00 2010 -0700

gallium/docs: Vertex data formats.

I'm not sure if I really got it right. This seems like one of those
"Duh, of course it works that way" things, but I'd like the
documentation to be readable by people not acquainted with OGL/D3D.

---

 src/gallium/docs/source/cso/velems.rst |   41 +--
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/gallium/docs/source/cso/velems.rst 
b/src/gallium/docs/source/cso/velems.rst
index 92cde01..978ad4a 100644
--- a/src/gallium/docs/source/cso/velems.rst
+++ b/src/gallium/docs/source/cso/velems.rst
@@ -3,9 +3,44 @@
 Vertex Elements
 ===
 
-This state controls format etc. of the input attributes contained
-in the pipe_vertex_buffer(s). There's one pipe_vertex_element array member
-for each input attribute.
+This state controls the format of the input attributes contained in
+pipe_vertex_buffers. There is one pipe_vertex_element array member for each
+input attribute.
+
+Input Formats
+-
+
+Gallium supports a diverse range of formats for vertex data. Drivers are
+guaranteed to support 32-bit floating-point vectors of one to four components.
+Additionally, they may support the following formats:
+
+* Integers, signed or unsigned, normalized or non-normalized, 8, 16, or 32
+  bits wide
+* Floating-point, 16, 32, or 64 bits wide
+
+At this time, support for varied vertex data formats is limited by driver
+deficiencies. It is planned to support a single uniform set of formats for all
+Gallium drivers at some point.
+
+Rather than attempt to specify every small nuance of behavior, Gallium uses a
+very simple set of rules for padding out unspecified components. If an input
+uses less than four components, it will be padded out with the constant vector
+``(0, 0, 0, 1)``.
+
+Fog, point size, the facing bit, and edgeflags, all are in the standard format
+of ``(x, 0, 0, 1)``, and so only the first component of those inputs is used.
+
+Position
+
+
+Vertex position may be specified with two to four components. Using less than
+two components is not allowed.
+
+Colors
+%%
+
+Colors, both front- and back-facing, may omit the alpha component, only using
+three components. Using less than three components is not allowed.
 
 Members
 ---

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium/docs: Lops override the rest of the blending state when enabled.

2010-06-24 Thread Corbin Simpson
Module: Mesa
Branch: master
Commit: 49735d1c6c6d8dbb41eba0495be0c657b6714fe8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=49735d1c6c6d8dbb41eba0495be0c657b6714fe8

Author: Corbin Simpson 
Date:   Thu Jun 24 07:13:10 2010 -0700

gallium/docs: Lops override the rest of the blending state when enabled.

---

 src/gallium/docs/source/cso/blend.rst |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/docs/source/cso/blend.rst 
b/src/gallium/docs/source/cso/blend.rst
index d97e3d3..7bde10c 100644
--- a/src/gallium/docs/source/cso/blend.rst
+++ b/src/gallium/docs/source/cso/blend.rst
@@ -20,9 +20,11 @@ Logical Operations
 Logical operations, also known as logicops, lops, or rops, are supported.
 Only two-operand logicops are available. When logicops are enabled, all other
 blend state is ignored, including per-render-target state, so logicops are
-performed on all enabled render targets.
+performed on all render targets.
 
-XXX do lops still apply if blend_enable isn't set?
+.. warning::
+   The blend_enable flag is ignored for all render targets when logical
+   operations are enabled.
 
 For a source component `s` and destination component `d`, the logical
 operations are defined as taking the bits of each channel of each component,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-03 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r300_context.h  |   48 +
 src/mesa/drivers/dri/r300/r300_fragprog.c |1 +
 src/mesa/drivers/dri/r300/r300_render.c   |   25 +-
 src/mesa/drivers/dri/r300/r300_state.c|   61 +-
 src/mesa/drivers/dri/r300/r500_fragprog.c | 2629 +
 src/mesa/drivers/dri/r300/r500_fragprog.h |5 +-
 6 files changed, 536 insertions(+), 2233 deletions(-)

   via  0f07e0aea3c5eb5bfb307aa50e04f088b889ddfc (commit)
   via  e081603850cb4e3839a76f0bfbb90cff922dff03 (commit)
   via  568d369d7747c6cc2a421a816c85d888ccfc9957 (commit)
   via  92a0e93ac33ceb64a4e7e930223950d4529cef37 (commit)
   via  9a82fde43aaaeab4370126d549aee8061b3a6937 (commit)
   via  b15c49e59bdc149b978d2b35a4efcc99d15f16b2 (commit)
   via  029cb1fd0f576dd7587bc306b126318fbfcdde2d (commit)
   via  b5246de562706aa2f423edaa060f4530da84f3a0 (commit)
   via  6e96ea535a8fe4d2487fed27c06feaeef449470d (commit)
   via  c02d1863d1bfa87c8c4fdd0c36f90245613d5bbd (commit)
   via  d06e61aa80fcf6d9681d5112f0625b1602975aed (commit)
   via  a3996ba2d1b43795c289d3e59e561e4fc84d9b7e (commit)
   via  8e33a83b6820af84862c45c30829a8ef52578743 (commit)
   via  70335540c68a35121979ac63d976fb5edc1d68ca (commit)
   via  14c3bdb3f7de153d93eda13980275d2840d62016 (commit)
   via  e46c3d7bcf000803e2a7d7339fe36db4fb97cf62 (commit)
   via  99e75135ee5437e47bb64983dbb2deaef131f2d6 (commit)
   via  9d9f66cc8d57dc16bb94c092b3821b56afce6cab (commit)
   via  a87914993d2d4a5ed32adfe16e2a2ac006d997c0 (commit)
   via  55418dc87d132875feb50c2bd9531b5f5ed13334 (commit)
   via  2ffa112ed32cf8123e5177a0fe2c12130c6f78c7 (commit)
   via  cd66f0e2d9e79b03b4773ccacf758fd3d141ccab (commit)
   via  1226aba119c46c09ec6620dc0be29b63fb3440a7 (commit)
   via  25d9f2dd247f9d9cc4bb18032d10542fd67ccea2 (commit)
   via  734ef96d5f7dae620115f328296d7e560e624042 (commit)
   via  db1fc51ccc24745e83bd2f635bed97787873341b (commit)
   via  45077fc3232eebf2b657c552afa92b24e4770bb0 (commit)
   via  279ea105d8e91aa922ad946b66ee076e5e7e21c7 (commit)
   via  f25b37c1da2c9f1109b9169b89216c2be4750f98 (commit)
   via  44791e2d78f894e62ab00b85277ee3ad4515519f (commit)
   via  eff6f1203222a776c5990b5d104b57a7f69b9aab (commit)
   via  09df5eaff2ba2694b82d1211fd24410cb2997e25 (commit)
   via  9566cf0e2f326d8fe638748d0bc10626e8c0387e (commit)
   via  4feac4e40e08d95c4549ef28ad89cc4d3d8f74a7 (commit)
   via  583ed4bde3aa450f049ad893820aece9fb6b1a9a (commit)
   via  3eb8e5871f3b3e572ae5e281f55fb7282c82c47e (commit)
   via  ed18005a9940c26cafa5ed8ccadc46e2fbe63f9e (commit)
   via  d019f101e840e20b0f47799c17336599d829ae54 (commit)
   via  2b8e422b3173388075b010f10e935c735edcd9a1 (commit)
   via  9e6e4ae49a49c60f9b15d9276a44a1ad25865c81 (commit)
   via  57028236c8b6ab0a56cba3a504d1d8ff12ab6c0d (commit)
   via  1c71ec4d45a8da2a5c83b09e2e39d4a7c2ecc99b (commit)
   via  5da8289e9cc086ac9c010ee41d0c06161c240dbd (commit)
  from  a03e261193bdee1ae1cf3e12af3455cbf085fcc7 (commit)


- Commits ---
commit 0f07e0aea3c5eb5bfb307aa50e04f088b889ddfc
Merge: a03e261193bdee1ae1cf3e12af3455cbf085fcc7 
e081603850cb4e3839a76f0bfbb90cff922dff03
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 3 08:39:15 2008 -0700

Merge branch 'r500test' of git://people.freedesktop.org/~csimpson/mesa into 
r500-support

commit e081603850cb4e3839a76f0bfbb90cff922dff03
Merge: 568d369d7747c6cc2a421a816c85d888ccfc9957 
37924cf175b5f61ca85dab685ec5d7879519ebc4
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 2 20:49:13 2008 -0700

Merge branch 'r500-support' into r500test
Bringing the FPS code up-to-date.
Conflicts:

src/mesa/drivers/dri/r300/r300_emit.c
src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_swtcl.c
src/mesa/drivers/dri/r300/r500_fragprog.c
src/mesa/drivers/dri/r300/r500_fragprog.h

commit 568d369d7747c6cc2a421a816c85d888ccfc9957
Merge: 92a0e93ac33ceb64a4e7e930223950d4529cef37 
1226aba119c46c09ec6620dc0be29b63fb3440a7
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 2 15:57:57 2008 -0700

Merge branch 'r345-cleanup' of git://people.freedesktop.org/~agd5f/mesa 
into r500test
Adding Alex's cleanup patches. This adds r5xx TCL! Whoo-hoo!
Conflicts:

src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/radeon/radeon_chipset.h
src/mesa/drivers/dri/radeon/radeon_screen.c

commit 92a0e93ac33ceb64a4e7e930223950d4529cef37
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 2 15:33:02 2008 -0700


mesa: Changes to 'r500-support'

2008-05-03 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   58 ++---
 1 files changed, 36 insertions(+), 22 deletions(-)

   via  b79a769b2d878d6e8e55f675209ffa7f3f2a6f68 (commit)
   via  4ef195a36946c8d587d129abd54683c73eecc304 (commit)
  from  0f07e0aea3c5eb5bfb307aa50e04f088b889ddfc (commit)


- Commits ---
commit b79a769b2d878d6e8e55f675209ffa7f3f2a6f68
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 3 09:09:57 2008 -0700

r5xx: Fix for loops.
Thanks to dli in IRC for pointing this out.

commit 4ef195a36946c8d587d129abd54683c73eecc304
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 3 09:08:07 2008 -0700

r5xx: Fix dumb shader.
For some reason, FGLRX doesn't actually set R500_US_INST_TEX.
Let us not make that same mistake.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-06 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   18 ++
 1 files changed, 14 insertions(+), 4 deletions(-)

   via  171ba1d0d154f7fdeb712fd411f19e1ebddd3b55 (commit)
   via  06e2e1b87ce7db9f48b9d198d71d46636f7e6fe3 (commit)
  from  66a49df9cba8f17059be420126346a4234e81cba (commit)


- Commits ---
commit 171ba1d0d154f7fdeb712fd411f19e1ebddd3b55
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 12:18:07 2008 -0700

r5xx: Fix typo.
Gotta be more careful with my cut'n'paste, lawl.

commit 06e2e1b87ce7db9f48b9d198d71d46636f7e6fe3
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 11:57:24 2008 -0700

r5xx: Use max_temp_idx.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-06 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   30 +++-
 1 files changed, 24 insertions(+), 6 deletions(-)

   via  1562dd2c26d43bffa8c6bd08ec6128c750ad58ff (commit)
   via  fa465fb2b1ce4119e4ae8f9b64721f385f361ad9 (commit)
  from  171ba1d0d154f7fdeb712fd411f19e1ebddd3b55 (commit)


- Commits ---
commit 1562dd2c26d43bffa8c6bd08ec6128c750ad58ff
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 12:44:53 2008 -0700

r5xx: Emit an OUT instruction at the end of execution.
This should make TEX/TXP work right. (Note: "Should" is not "does.")

commit fa465fb2b1ce4119e4ae8f9b64721f385f361ad9
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 12:42:40 2008 -0700

r5xx: We update max_temp_idx now, so no need to hard-code it.
This roughly doubles the speed of glxgears (GINAB) by allowing
more pixels to run concurrently.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-06 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   80 +++--
 1 files changed, 41 insertions(+), 39 deletions(-)

   via  40db59038cc62a5a8e4f94cb069eeb1d9b95a1a9 (commit)
   via  20baf128ef39dca058636c1bff4c526a8879b3d5 (commit)
  from  1562dd2c26d43bffa8c6bd08ec6128c750ad58ff (commit)


- Commits ---
commit 40db59038cc62a5a8e4f94cb069eeb1d9b95a1a9
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 18:14:21 2008 -0700

r5xx: FP: Add OPCODE_TXB.
Tex lookup with biased LOD. Should magically work.

commit 20baf128ef39dca058636c1bff4c526a8879b3d5
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 17:21:30 2008 -0700

r5xx: FP: Make MOV/ABS look pretty.
We can't really do anything like emit_alu, so we're doing emit_mov instead.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-06 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r300_context.h  |5 +-
 src/mesa/drivers/dri/r300/r500_fragprog.c |  131 +
 2 files changed, 41 insertions(+), 95 deletions(-)

   via  dc24fb51a31de8443e653655105d4e1c88847bcc (commit)
  from  40db59038cc62a5a8e4f94cb069eeb1d9b95a1a9 (commit)


- Commits ---
commit dc24fb51a31de8443e653655105d4e1c88847bcc
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 22:18:28 2008 -0700

r5xx: Index inputs and temps.
This is not the same as r3xx indexing. It only tries to protect inputs on
the pixel stack from getting clobbered by temps or texs.

Texs don't need special treatment since they read from special input regs
and write to the same temp regs as ALU/FC instructions.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-07 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   93 +
 1 files changed, 67 insertions(+), 26 deletions(-)

   via  1da094c9adf49c48a8b61ee7ab5336e8ba3f9e8d (commit)
   via  49c30ce958e5e95e9e6ab79d2308751705d0ff22 (commit)
  from  dc24fb51a31de8443e653655105d4e1c88847bcc (commit)


- Commits ---
commit 1da094c9adf49c48a8b61ee7ab5336e8ba3f9e8d
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Wed May 7 00:06:26 2008 -0700

r5xx: Fix FP inputs. (For good?)
FP inputs are now counted and mapped correctly, and temps
are allocated tightly and correctly.

commit 49c30ce958e5e95e9e6ab79d2308751705d0ff22
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 6 23:36:50 2008 -0700

r5xx: Fix false error with DP3/DP4.
DP3/DP4 only takes two arguments, but tried to load three, causing
a false fallback to the dumb shader.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-17 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |  166 -
 1 files changed, 163 insertions(+), 3 deletions(-)

   via  16cc362f0ba9fb240f3d47f06e74ac215c4d6c27 (commit)
   via  c11a33fe76123abb19cfc1da7d3701a44fca2f23 (commit)
   via  d5aa42166152c4817d4fb06f183552efc135304b (commit)
   via  405ee871c54d78e63cef1a570578a755250102c8 (commit)
   via  0de02f1716edc16257339af78f198072da87539f (commit)
   via  d8529d9b008ede05165317b8ebb834525fd9835c (commit)
  from  5e075fb80968744c72dfaba062e0b591ac69fad0 (commit)


- Commits ---
commit 16cc362f0ba9fb240f3d47f06e74ac215c4d6c27
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 16 11:46:26 2008 -0700

r5xx: Fix SCS.
Output instructions need to be marked OUT so they can write to the fifo.
Also, negation doesn't work with SWZ yet.

commit c11a33fe76123abb19cfc1da7d3701a44fca2f23
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Thu May 15 10:51:52 2008 -0700

r5xx: Add OPCODE_SWZ.
It's so easy!

commit d5aa42166152c4817d4fb06f183552efc135304b
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Thu May 15 10:29:38 2008 -0700

r5xx: Add OPCODE_SCS.
It's disabled, though, because it doesn't work. I'll figure it out later...

commit 405ee871c54d78e63cef1a570578a755250102c8
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Thu May 15 00:49:32 2008 -0700

r5xx: Adding more opcodes.
EX2, FRC, LG2, SIN, RCP, and RSQ, if you care.
All of these except FRC are like COS. This pretty much rounds out the set of
opcodes which can be done in one ALU inst.

commit 0de02f1716edc16257339af78f198072da87539f
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Thu May 15 00:18:08 2008 -0700

r5xx: First swing at OPCODE_COS.

commit d8529d9b008ede05165317b8ebb834525fd9835c
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Thu May 15 00:11:10 2008 -0700

r5xx: Unbreak MAX and MIN.
Both of them had faulty copypasta.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-17 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

   via  6dd3c0ed962dd3c2d4db331d4c745b39b7dde8c3 (commit)
  from  16cc362f0ba9fb240f3d47f06e74ac215c4d6c27 (commit)


- Commits ---
commit 6dd3c0ed962dd3c2d4db331d4c745b39b7dde8c3
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 17 09:27:35 2008 -0700

r5xx: Fix FRC.
This makes tri-frc work.
(Remind me again why I'm allowed near a compiler, lawl.)

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-17 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)

   via  0910d9d4d68a3757f8777974ead2e4e34f48433e (commit)
   via  c57b3b1d2c4344603763c8d200f111a132d3899f (commit)
  from  6dd3c0ed962dd3c2d4db331d4c745b39b7dde8c3 (commit)


- Commits ---
commit 0910d9d4d68a3757f8777974ead2e4e34f48433e
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 17 13:38:35 2008 -0700

r5xx: Add OPCODE_KIL.

commit c57b3b1d2c4344603763c8d200f111a132d3899f
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 17 12:45:46 2008 -0700

r5xx: Added OPCODE_DPH.
Like DP4, but with one swizzle change.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-18 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   99 +
 1 files changed, 43 insertions(+), 56 deletions(-)

   via  2225b9bdb08228fc824e9011341e8c0916fe2e07 (commit)
  from  bdfd5d95c5543154f7af17f0c001dc2b7044c1c4 (commit)


- Commits ---
commit 2225b9bdb08228fc824e9011341e8c0916fe2e07
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun May 18 22:38:28 2008 -0700

r5xx: ALU/OUT fixups.
Lots of small changes. Intentionally breaks some tex stuffs.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-18 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   23 ++-
 1 files changed, 14 insertions(+), 9 deletions(-)

   via  2708d7f7005c6a65980f5eb0377a9fd7917bce51 (commit)
   via  a6c38f2f648f91f35594383666eec01abdc19632 (commit)
  from  2225b9bdb08228fc824e9011341e8c0916fe2e07 (commit)


- Commits ---
commit 2708d7f7005c6a65980f5eb0377a9fd7917bce51
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun May 18 23:52:54 2008 -0700

r5xx: Swap sources for CMP.
Follows the same pattern as the op on r3xx/r4xx. Thanks airlied.

commit a6c38f2f648f91f35594383666eec01abdc19632
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun May 18 23:35:07 2008 -0700

r5xx: Fix typo of epic proportions.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-19 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

   via  c60bdcf8a80b7307add8e09aca2356591c86fbcd (commit)
  from  2708d7f7005c6a65980f5eb0377a9fd7917bce51 (commit)


- Commits ---
commit c60bdcf8a80b7307add8e09aca2356591c86fbcd
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Mon May 19 00:00:08 2008 -0700

r5xx: Fix magic offsets for output fifo write masks.
Well, this sure explains a lot.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-19 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |  170 ++---
 1 files changed, 105 insertions(+), 65 deletions(-)

   via  476248befe2bd04558ce53e937230c1a400a51b6 (commit)
  from  03b3fed8f1dcd5df5049b9236cfaa60a17e56e6f (commit)


- Commits ---
commit 476248befe2bd04558ce53e937230c1a400a51b6
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Mon May 19 11:01:00 2008 -0700

r5xx: Fixup emit_tex, add debugging info, enable temp temps.
emit_tex now chases itself with an OUT if needed.
Added airlied's dump_program, with some fixes.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-19 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   53 ++---
 1 files changed, 26 insertions(+), 27 deletions(-)

   via  94994b13c51e076a4df069d550ec2f27550f6a28 (commit)
   via  78fa5060593b9a419281230a264eb1180c9ed2b2 (commit)
  from  f0d76d526b0d37f36085d58b0c5c8cb9d9d9d7c9 (commit)


- Commits ---
commit 94994b13c51e076a4df069d550ec2f27550f6a28
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Mon May 19 23:55:59 2008 -0700

r5xx: Fixup SOP insts.
Use the correct swizzle for alpha/SOP stuff.

commit 78fa5060593b9a419281230a264eb1180c9ed2b2
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Mon May 19 12:26:04 2008 -0700

r5xx: New fix for COS/SIN/SCS.
Not perfect yet, but getting better.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-20 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   35 
 1 files changed, 25 insertions(+), 10 deletions(-)

   via  2bda1a9502206ca2b7b35e39c82356f91de06914 (commit)
  from  94994b13c51e076a4df069d550ec2f27550f6a28 (commit)


- Commits ---
commit 2bda1a9502206ca2b7b35e39c82356f91de06914
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Tue May 20 09:47:50 2008 -0700

r5xx: Count refs so we don't have to guess on temp reg allocation.
As a bonus, we can now have multiple temp temps, by slot.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-21 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   47 +
 1 files changed, 47 insertions(+), 0 deletions(-)

   via  1e2907f170116138b1ae304dc075ee52e377fd73 (commit)
  from  bb57c30a537f2ae01a146dd697ca332f7667c5c5 (commit)


- Commits ---
commit 1e2907f170116138b1ae304dc075ee52e377fd73
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Wed May 21 08:24:28 2008 -0700

r5xx: Add OPCODE_POW.
Necessary for Google Earth, among other things.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-21 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   49 -
 1 files changed, 48 insertions(+), 1 deletions(-)

   via  4f9dcdc35b277aa1ded60059a654da22d2075067 (commit)
   via  0dfbe9cdd7e076fb23d90e99e225fd0e19b63dfb (commit)
   via  d06f4edb146cfb42fa2a3f654db141f88dcfe074 (commit)
  from  1e2907f170116138b1ae304dc075ee52e377fd73 (commit)


- Commits ---
commit 4f9dcdc35b277aa1ded60059a654da22d2075067
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Wed May 21 23:35:43 2008 -0700

r5xx: Fixed LRP.
Works perfectly. It's a complex one, though, so it might fail in weird 
ways...

commit 0dfbe9cdd7e076fb23d90e99e225fd0e19b63dfb
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Wed May 21 23:33:13 2008 -0700

r5xx: Change debug info for readability.
It's weird seeing the compiled program before the assembly, that's all.

commit d06f4edb146cfb42fa2a3f654db141f88dcfe074
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Wed May 21 13:51:32 2008 -0700

r5xx: Initial (broken) OPCODE_LRP.
Will compile, run, and not eat your kids, but the math is wrong.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-23 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |  319 +++--
 1 files changed, 211 insertions(+), 108 deletions(-)

   via  9ab7a2df030fe3eb7b82a99d9f17093c0036bc06 (commit)
   via  30e61500e162453d7affd855fe531ed2d1d6e80b (commit)
   via  34010bcc91bc2e8503e7b80187c1aea0e51e53b0 (commit)
   via  d4e93864b8f05f8973d291ac287b27febbb5cb62 (commit)
  from  a01816da59cd7a18fca281ef94a822f08cec5c6e (commit)


- Commits ---
commit 9ab7a2df030fe3eb7b82a99d9f17093c0036bc06
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 23 00:16:49 2008 -0700

r5xx: Clean up some compiler warnings.

commit 30e61500e162453d7affd855fe531ed2d1d6e80b
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 23 00:14:31 2008 -0700

r5xx: Move dumb_shader.
Was getting ticked having to scroll around it, lawl.

commit 34010bcc91bc2e8503e7b80187c1aea0e51e53b0
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 23 00:12:37 2008 -0700

r5xx: Add OPCODE_DST.
Works completely, swizzles and everything.

commit d4e93864b8f05f8973d291ac287b27febbb5cb62
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Thu May 22 02:34:57 2008 -0700

r5xx: More trig work.
SCS now works. COS/SIN have slight issues still.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-24 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |  121 +
 1 files changed, 70 insertions(+), 51 deletions(-)

   via  f1d04cd76681a3b8d37bc1a06b7ab36350087135 (commit)
   via  b6b51906824bbf02769eeaf42646ff709877ae42 (commit)
   via  6f918a9fda91321b50ae327791787f21417226c8 (commit)
  from  af77de66d9e97a1f37849a51f7b48ae36a0c8127 (commit)


- Commits ---
commit f1d04cd76681a3b8d37bc1a06b7ab36350087135
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 24 11:30:57 2008 -0700

r5xx: Consolidate FP tex insts.
They're all the same, really.

commit b6b51906824bbf02769eeaf42646ff709877ae42
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 24 09:17:28 2008 -0700

r5xx: Fix SGE/SLT.

commit 6f918a9fda91321b50ae327791787f21417226c8
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri May 23 02:05:24 2008 -0700

r5xx: Remove some debugging cruft.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'r500-support'

2008-05-25 Thread Corbin Simpson
The branch, r500-support has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=r500-support

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |  187 -
 1 files changed, 102 insertions(+), 85 deletions(-)

   via  f776f693c0aca4d01cc2bfdaedbb527062189e6d (commit)
   via  594760148cb42cdaf568eef63357fac1c1b7f124 (commit)
   via  bd74d2aa26a2b87b05e8d086c020a6bdde9e06a7 (commit)
   via  810270ad11d51c65e33bbe9337c2db9dd4cebb98 (commit)
  from  f1d04cd76681a3b8d37bc1a06b7ab36350087135 (commit)


- Commits ---
commit f776f693c0aca4d01cc2bfdaedbb527062189e6d
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun May 25 11:46:16 2008 -0700

r5xx: Massive MAD cleanup.
Common uses of MAD now use emit_mad(), the two common negation masks work,
and fixed a few off-by-one errors.

commit 594760148cb42cdaf568eef63357fac1c1b7f124
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun May 25 11:35:54 2008 -0700

r5xx: Negation masks for every inst except SWZ.
Yay?

commit bd74d2aa26a2b87b05e8d086c020a6bdde9e06a7
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun May 25 11:35:20 2008 -0700

r5xx: More emit_alu().
Converted ADD.

commit 810270ad11d51c65e33bbe9337c2db9dd4cebb98
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun May 25 11:07:51 2008 -0700

r5xx: Add emit_mad() for FP.
If it uses MAD, emit it with emit_mad()!
(Now available at your local grocer's. Multiply and add responsibly.)

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'master'

2008-05-31 Thread Corbin Simpson
The branch, master has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=master

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |  177 +++--
 1 files changed, 69 insertions(+), 108 deletions(-)

   via  9a34c68faf2a9e83e60ed4833816db56342f658d (commit)
   via  bffa0909cbd395aac7d974c0475dc7ed9fd208a9 (commit)
   via  ea58dceb1c803953d3a9b77adcac5ee131d1c038 (commit)
   via  c9679ce1d22e706bfe1cdc6a5cf8553ffedb2842 (commit)
  from  7013eecf282d2b1151cdb5cd3ba356295e1e1b79 (commit)


- Commits ---
commit 9a34c68faf2a9e83e60ed4833816db56342f658d
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 31 22:41:54 2008 -0700

r5xx: Last emit_sop() for now.
This should also clean up LIT later on.

commit bffa0909cbd395aac7d974c0475dc7ed9fd208a9
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 31 22:23:11 2008 -0700

r5xx: More emit_sop(), stage 2.
SIN/COS.

commit ea58dceb1c803953d3a9b77adcac5ee131d1c038
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 31 22:09:38 2008 -0700

r5xx: Cleanup SOP with emit_sop().
I wish I had a snarky commit message, but I'll save that for after I get the
trig working with this.

commit c9679ce1d22e706bfe1cdc6a5cf8553ffedb2842
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat May 31 20:48:15 2008 -0700

r5xx: Dump shader constants when dumping program assembly.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'master'

2008-06-01 Thread Corbin Simpson
The branch, master has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=master

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |   32 +
 1 files changed, 32 insertions(+), 0 deletions(-)

   via  3225e2cdb60868ace70db16407ec5cf5fc64be3c (commit)
  from  9a34c68faf2a9e83e60ed4833816db56342f658d (commit)


- Commits ---
commit 3225e2cdb60868ace70db16407ec5cf5fc64be3c
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun Jun 1 03:23:00 2008 -0700

r5xx: Add OPCODE_FLR.
Why didn't anybody tell me we were missing this one? I thought I committed 
it ages ago!

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'master'

2008-06-01 Thread Corbin Simpson
The branch, master has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=master

Summary of changes:
 src/mesa/drivers/dri/r300/r300_context.h  |2 ++
 src/mesa/drivers/dri/r300/r300_state.c|5 -
 src/mesa/drivers/dri/r300/r500_fragprog.c |6 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

   via  915e49e0fd61d7b8eee304d756813455612e98d9 (commit)
  from  c9ea62444c6969da8706ea88e12df8c458a6acce (commit)


- Commits ---
commit 915e49e0fd61d7b8eee304d756813455612e98d9
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sun Jun 1 11:45:30 2008 -0700

r5xx: Enable depth write emission.
Thanks to nh for the r3xx version.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'master'

2008-06-06 Thread Corbin Simpson
The branch, master has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=master

Summary of changes:
 src/mesa/drivers/dri/r300/r500_fragprog.c |  113 +
 1 files changed, 52 insertions(+), 61 deletions(-)

   via  f39780242e0dc7060d716fe255977a0a89734945 (commit)
  from  ae18cbcfc51314c17d4fb7a2b4d44cd4a43adca4 (commit)


- Commits ---
commit f39780242e0dc7060d716fe255977a0a89734945
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Fri Jun 6 21:53:05 2008 -0700

r5xx: Fix speedy LIT once and for all.
To do: Add a slightly more accurate LIT. Will do later.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'master'

2008-06-07 Thread Corbin Simpson
The branch, master has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=master

Summary of changes:
 src/mesa/drivers/dri/r300/r300_reg.h |3 +++
 src/mesa/drivers/dri/r300/r300_tex.c |   19 +--
 2 files changed, 16 insertions(+), 6 deletions(-)

   via  5e58e5d77792891fac953ff0ec30990f3e0ca854 (commit)
  from  f39780242e0dc7060d716fe255977a0a89734945 (commit)


- Commits ---
commit 5e58e5d77792891fac953ff0ec30990f3e0ca854
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat Jun 7 01:37:35 2008 -0700

r5xx: Unbreak anisotropic filtering?
Not quite finished, maybe? Not sure.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


mesa: Changes to 'master'

2008-06-07 Thread Corbin Simpson
The branch, master has been updated
Commits at: http://cgit.freedesktop.org/mesa/mesa/log/?h=master

Summary of changes:
 src/mesa/drivers/dri/r300/r300_tex.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

   via  21f50818b09c1ab3b5b1dc797b34c23b9b1634dc (commit)
  from  cb1687660844d42f929e11a2261c0eeb3fe859be (commit)


- Commits ---
commit 21f50818b09c1ab3b5b1dc797b34c23b9b1634dc
Author: Corbin Simpson <[EMAIL PROTECTED]>
Date:   Sat Jun 7 12:37:10 2008 -0700

r300: Allow driconf to set a default anisotropy.
If an app does not use GL_EXT_tex_filter_aniso, this lets driconf set it 
instead.

-

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


  1   2   3   4   5   6   7   8   >