Mesa (master): r600g: Clean up PS setup.

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

Author: Corbin Simpson mostawesomed...@gmail.com
Date:   Sun Sep 19 22:54:18 2010 -0700

r600g: Clean up PS setup.

I didn't do r600d according to the docs; I split EXPORT_MODE to be a bit more
useful and obvious. Hope this is okay.

---

 src/gallium/drivers/r600/r600_hw_states.c |   35 +++-
 src/gallium/drivers/r600/r600d.h  |6 +
 2 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_hw_states.c 
b/src/gallium/drivers/r600/r600_hw_states.c
index 020d162..fe6635d 100644
--- a/src/gallium/drivers/r600/r600_hw_states.c
+++ b/src/gallium/drivers/r600/r600_hw_states.c
@@ -991,13 +991,12 @@ static int r600_ps_shader(struct r600_context *rctx, 
struct r600_context_state *
 
radeon_state_init(state, rscreen-rw, R600_STATE_SHADER, 0, 
R600_SHADER_PS);
for (i = 0; i  rshader-ninput; i++) {
-   tmp = S_028644_SEMANTIC(i);
-   tmp |= S_028644_SEL_CENTROID(1);
+   tmp = S_028644_SEMANTIC(i) | S_028644_SEL_CENTROID(1);
if (rshader-input[i].name == TGSI_SEMANTIC_POSITION)
have_pos = TRUE;
if (rshader-input[i].name == TGSI_SEMANTIC_COLOR ||
-   rshader-input[i].name == TGSI_SEMANTIC_BCOLOR ||
-   rshader-input[i].name == TGSI_SEMANTIC_POSITION) {
+   rshader-input[i].name == TGSI_SEMANTIC_BCOLOR ||
+   rshader-input[i].name == TGSI_SEMANTIC_POSITION) {
tmp |= S_028644_FLAT_SHADE(rshader-flat_shade);
}
 
@@ -1014,29 +1013,33 @@ static int r600_ps_shader(struct r600_context *rctx, 
struct r600_context_state *
num_cout = 0;
for (i = 0; i  rshader-noutput; i++) {
if (rshader-output[i].name == TGSI_SEMANTIC_POSITION)
-   exports_ps |= 1;
+   exports_ps |= S_028854_EXPORT_Z(1);
else if (rshader-output[i].name == TGSI_SEMANTIC_COLOR) {
num_cout++;
}
}
-   exports_ps |= (num_cout  1);
-   if (!exports_ps) {
-   /* always at least export 1 component per pixel */
-   exports_ps = 2;
+   exports_ps |= S_028854_EXPORT_COLORS(num_cout);
+   if (exports_ps == 0) {
+   /* Always at least export 1 color component per pixel. */
+   exports_ps = S_028854_EXPORT_COLORS(1);
}
-   state-states[R600_PS_SHADER__SPI_PS_IN_CONTROL_0] = 
S_0286CC_NUM_INTERP(rshader-ninput) |
-   
S_0286CC_PERSP_GRADIENT_ENA(1);
+   state-states[R600_PS_SHADER__SPI_PS_IN_CONTROL_0] =
+   S_0286CC_NUM_INTERP(rshader-ninput) |
+   S_0286CC_PERSP_GRADIENT_ENA(1);
+
if (have_pos) {
-   state-states[R600_PS_SHADER__SPI_PS_IN_CONTROL_0] |=  
S_0286CC_POSITION_ENA(1) |
-  
S_0286CC_BARYC_SAMPLE_CNTL(1);
+   state-states[R600_PS_SHADER__SPI_PS_IN_CONTROL_0] |=
+   S_0286CC_POSITION_ENA(1) |
+   S_0286CC_BARYC_SAMPLE_CNTL(1);
state-states[R600_PS_SHADER__SPI_INPUT_Z] |=
S_0286D8_PROVIDE_Z_TO_SPI(1);
}
 
-   state-states[R600_PS_SHADER__SPI_PS_IN_CONTROL_1] = 0x;
-   state-states[R600_PS_SHADER__SPI_PS_IN_CONTROL_1] |= 
S_0286D0_FRONT_FACE_ENA(have_face);
+   state-states[R600_PS_SHADER__SPI_PS_IN_CONTROL_1] =
+   S_0286D0_FRONT_FACE_ENA(have_face);
 
-   state-states[R600_PS_SHADER__SQ_PGM_RESOURCES_PS] = 
S_028868_NUM_GPRS(rshader-bc.ngpr) |
+   state-states[R600_PS_SHADER__SQ_PGM_RESOURCES_PS] =
+   S_028868_NUM_GPRS(rshader-bc.ngpr) |
S_028868_STACK_SIZE(rshader-bc.nstack);
state-states[R600_PS_SHADER__SQ_PGM_EXPORTS_PS] = exports_ps;
radeon_ws_bo_reference(rscreen-rw, state-bo[0], rpshader-bo);
diff --git a/src/gallium/drivers/r600/r600d.h b/src/gallium/drivers/r600/r600d.h
index 3ca3cc7..f1aa49c 100644
--- a/src/gallium/drivers/r600/r600d.h
+++ b/src/gallium/drivers/r600/r600d.h
@@ -2232,6 +2232,12 @@
 #define R_0286C0_SPI_PS_INPUT_CNTL_310x0286C0
 #define R_028850_SQ_PGM_RESOURCES_PS 0x028850
 #define R_028854_SQ_PGM_EXPORTS_PS   0x028854
+#define   S_028854_EXPORT_COLORS(x)(((x)  0xF)  1)
+#define   G_028854_EXPORT_COLORS(x)(((x)  1)  0xF)
+#define   C_028854_EXPORT_COLORS   0xFFE1
+#define   S_028854_EXPORT_Z(x) (((x)  0x1)  0)
+#define   G_028854_EXPORT_Z(x) (((x)  0)  0x1)
+#define  

Mesa (master): r600g: Cleanup viewport floats.

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

Author: Corbin Simpson mostawesomed...@gmail.com
Date:   Sun Sep 19 23:02:19 2010 -0700

r600g: Cleanup viewport floats.

---

 src/gallium/drivers/r600/r600_hw_states.c |   33 
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_hw_states.c 
b/src/gallium/drivers/r600/r600_hw_states.c
index fe6635d..a4cd1bf 100644
--- a/src/gallium/drivers/r600/r600_hw_states.c
+++ b/src/gallium/drivers/r600/r600_hw_states.c
@@ -1064,8 +1064,10 @@ static int r600_vs_shader(struct r600_context *rctx, 
struct r600_context_state *
tmp = i  ((i  3) * 8);
state-states[R600_VS_SHADER__SPI_VS_OUT_ID_0 + i / 4] |= tmp;
}
-   state-states[R600_VS_SHADER__SPI_VS_OUT_CONFIG] = 
S_0286C4_VS_EXPORT_COUNT(rshader-noutput - 2);
-   state-states[R600_VS_SHADER__SQ_PGM_RESOURCES_VS] = 
S_028868_NUM_GPRS(rshader-bc.ngpr) |
+   state-states[R600_VS_SHADER__SPI_VS_OUT_CONFIG] =
+   S_0286C4_VS_EXPORT_COUNT(rshader-noutput - 2);
+   state-states[R600_VS_SHADER__SQ_PGM_RESOURCES_VS] =
+   S_028868_NUM_GPRS(rshader-bc.ngpr) |
S_028868_STACK_SIZE(rshader-bc.nstack);
radeon_ws_bo_reference(rscreen-rw, state-bo[0], rpshader-bo);
radeon_ws_bo_reference(rscreen-rw, state-bo[1], rpshader-bo);
@@ -1204,19 +1206,30 @@ static void r600_texture_state_db(struct r600_screen 
*rscreen, struct r600_resou
 static void r600_texture_state_viewport(struct r600_screen *rscreen, struct 
r600_resource_texture *rtexture, unsigned level)
 {
struct radeon_state *rstate = rtexture-viewport[level];
+   float width, height;
 
radeon_state_init(rstate, rscreen-rw, R600_STATE_VIEWPORT, 0, 0);
 
+   width = rtexture-width[level] * 0.5;
+   height = rtexture-height[level] * 0.5;
+
/* set states (most default value are 0 and struct already
 * initialized to 0, thus avoid resetting them)
 */
-   rstate-states[R600_VIEWPORT__PA_CL_VPORT_XOFFSET_0] = 
fui((float)rtexture-width[level]/2.0);
-   rstate-states[R600_VIEWPORT__PA_CL_VPORT_XSCALE_0] = 
fui((float)rtexture-width[level]/2.0);
-   rstate-states[R600_VIEWPORT__PA_CL_VPORT_YOFFSET_0] = 
fui((float)rtexture-height[level]/2.0);
-   rstate-states[R600_VIEWPORT__PA_CL_VPORT_YSCALE_0] = 
fui((float)-rtexture-height[level]/2.0);
-   rstate-states[R600_VIEWPORT__PA_CL_VPORT_ZOFFSET_0] = 0x3F00;
-   rstate-states[R600_VIEWPORT__PA_CL_VPORT_ZSCALE_0] = 0x3F00;
-   rstate-states[R600_VIEWPORT__PA_CL_VTE_CNTL] = 0x043F;
+   rstate-states[R600_VIEWPORT__PA_CL_VPORT_XOFFSET_0] = fui(width);
+   rstate-states[R600_VIEWPORT__PA_CL_VPORT_XSCALE_0] = fui(width);
+   rstate-states[R600_VIEWPORT__PA_CL_VPORT_YOFFSET_0] = fui(height);
+   rstate-states[R600_VIEWPORT__PA_CL_VPORT_YSCALE_0] = fui(height);
+   rstate-states[R600_VIEWPORT__PA_CL_VPORT_ZOFFSET_0] = fui(0.5);
+   rstate-states[R600_VIEWPORT__PA_CL_VPORT_ZSCALE_0] = fui(0.5);
+   rstate-states[R600_VIEWPORT__PA_CL_VTE_CNTL] =
+   S_028818_VPORT_X_SCALE_ENA(1) |
+   S_028818_VPORT_X_OFFSET_ENA(1) |
+   S_028818_VPORT_Y_SCALE_ENA(1) |
+   S_028818_VPORT_Y_OFFSET_ENA(1) |
+   S_028818_VPORT_Z_SCALE_ENA(1) |
+   S_028818_VPORT_Z_OFFSET_ENA(1) |
+   S_028818_VTX_W0_FMT(1);
rstate-states[R600_VIEWPORT__PA_SC_VPORT_ZMAX_0] = fui(1);
 
radeon_state_pm4(rstate);
@@ -1325,7 +1338,7 @@ void r600_set_constant_buffer_mem(struct pipe_context 
*ctx,
 
nconstant = buffer-width0 / 16;
size = ALIGN_DIVUP(nconstant, 16);
-   
+
radeon_state_init(rstate, rscreen-rw, type, 0, shader_class);
rstate-states[R600_VS_CBUF__ALU_CONST_BUFFER_SIZE_VS_0] = size;
rstate-states[R600_VS_CBUF__ALU_CONST_CACHE_VS_0] = 0;

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


Mesa (master): svga: Integer constant register file has a separate namespace.

2010-09-20 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 279492386ffe741c2f5b91919b37068562b6a282
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=279492386ffe741c2f5b91919b37068562b6a282

Author: Michal Krol mic...@vmware.com
Date:   Thu Sep 16 16:51:03 2010 +

svga: Integer constant register file has a separate namespace.

Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.

---

 src/gallium/drivers/svga/svga_tgsi.c  |2 +-
 src/gallium/drivers/svga/svga_tgsi_emit.h |3 ++-
 src/gallium/drivers/svga/svga_tgsi_insn.c |   12 ++--
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_tgsi.c 
b/src/gallium/drivers/svga/svga_tgsi.c
index 0cd6201..781fe63 100644
--- a/src/gallium/drivers/svga/svga_tgsi.c
+++ b/src/gallium/drivers/svga/svga_tgsi.c
@@ -203,7 +203,7 @@ svga_tgsi_translate( const struct svga_shader *shader,
   emit.imm_start += key.vkey.num_zero_stride_vertex_elements;
}
 
-   emit.nr_hw_const = (emit.imm_start + 
emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
+   emit.nr_hw_float_const = (emit.imm_start + 
emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
 
emit.nr_hw_temp = emit.info.file_max[TGSI_FILE_TEMPORARY] + 1;
emit.in_main_func = TRUE;
diff --git a/src/gallium/drivers/svga/svga_tgsi_emit.h 
b/src/gallium/drivers/svga/svga_tgsi_emit.h
index b4e90a9..63ef7f8 100644
--- a/src/gallium/drivers/svga/svga_tgsi_emit.h
+++ b/src/gallium/drivers/svga/svga_tgsi_emit.h
@@ -62,7 +62,8 @@ struct svga_shader_emitter
 
int imm_start;
 
-   int nr_hw_const;
+   int nr_hw_float_const;
+   int nr_hw_int_const;
int nr_hw_temp;

int insn_offset;
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c 
b/src/gallium/drivers/svga/svga_tgsi_insn.c
index ad7d27a..f2591c5 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -553,7 +553,7 @@ static boolean emit_def_const( struct svga_shader_emitter 
*emit,
 static INLINE boolean
 create_zero_immediate( struct svga_shader_emitter *emit )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT,
 idx, 0, 0, 0, 1 ))
@@ -568,7 +568,7 @@ create_zero_immediate( struct svga_shader_emitter *emit )
 static INLINE boolean
 create_loop_const( struct svga_shader_emitter *emit )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_int_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_INT, idx,
 255, /* iteration count */
@@ -586,7 +586,7 @@ create_loop_const( struct svga_shader_emitter *emit )
 static INLINE boolean
 create_sincos_consts( struct svga_shader_emitter *emit )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT, idx,
 -1.5500992e-006f,
@@ -596,7 +596,7 @@ create_sincos_consts( struct svga_shader_emitter *emit )
   return FALSE;
 
emit-sincos_consts_idx = idx;
-   idx = emit-nr_hw_const++;
+   idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT, idx,
 -0.02084f,
@@ -617,7 +617,7 @@ create_arl_consts( struct svga_shader_emitter *emit )
 
for (i = 0; i  emit-num_arl_consts; i += 4) {
   int j;
-  unsigned idx = emit-nr_hw_const++;
+  unsigned idx = emit-nr_hw_float_const++;
   float vals[4];
   for (j = 0; j  4  (j + i)  emit-num_arl_consts; ++j) {
  vals[j] = emit-arl_consts[i + j].number;
@@ -2407,7 +2407,7 @@ static boolean make_immediate( struct svga_shader_emitter 
*emit,
float d,
struct src_register *out )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT,
 idx, a, b, c, d ))

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


Mesa (master): svga: Fix relative addressing translation for pixel shaders.

2010-09-20 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 0742e0b3767072fe664ca9f39fc31d86d8d314ed
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0742e0b3767072fe664ca9f39fc31d86d8d314ed

Author: Michal Krol mic...@vmware.com
Date:   Thu Sep 16 16:48:00 2010 +

svga: Fix relative addressing translation for pixel shaders.

Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.

---

 src/gallium/drivers/svga/svga_tgsi_insn.c |   51 +
 1 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c 
b/src/gallium/drivers/svga/svga_tgsi_insn.c
index 72dccdf..ad7d27a 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -197,22 +197,37 @@ translate_src_register( const struct svga_shader_emitter 
*emit,
   break;
}
 
-   /* Indirect addressing (for coninstant buffer lookups only)
+   /* Indirect addressing.
 */
-   if (reg-Register.Indirect)
-   {
-  /* we shift the offset towards the minimum */
-  if (svga_arl_needs_adjustment( emit )) {
- src.base.num -= svga_arl_adjustment( emit );
+   if (reg-Register.Indirect) {
+  if (emit-unit == PIPE_SHADER_FRAGMENT) {
+ /* Pixel shaders have only loop registers for relative
+  * addressing into inputs. Ignore the redundant address
+  * register, the contents of aL should be in sync with it.
+  */
+ if (reg-Register.File == TGSI_FILE_INPUT) {
+src.base.relAddr = 1;
+src.indirect = src_token(SVGA3DREG_LOOP, 0);
+ }
+  }
+  else {
+ /* Constant buffers only.
+  */
+ if (reg-Register.File == TGSI_FILE_CONSTANT) {
+/* we shift the offset towards the minimum */
+if (svga_arl_needs_adjustment( emit )) {
+   src.base.num -= svga_arl_adjustment( emit );
+}
+src.base.relAddr = 1;
+
+/* Not really sure what should go in the second token:
+ */
+src.indirect = src_token( SVGA3DREG_ADDR,
+  reg-Indirect.Index );
+
+src.indirect.swizzle = SWIZZLE_;
+ }
   }
-  src.base.relAddr = 1;
-
-  /* Not really sure what should go in the second token:
-   */
-  src.indirect = src_token( SVGA3DREG_ADDR,
-reg-Indirect.Index );
-
-  src.indirect.swizzle = SWIZZLE_;
}
 
src = swizzle( src,
@@ -1593,6 +1608,14 @@ static boolean emit_arl(struct svga_shader_emitter *emit,
 const struct tgsi_full_instruction *insn)
 {
++emit-current_arl;
+   if (emit-unit == PIPE_SHADER_FRAGMENT) {
+  /* MOVA not present in pixel shader instruction set.
+   * Ignore this instruction altogether since it is
+   * only used for loop counters -- and for that
+   * we reference aL directly.
+   */
+  return TRUE;
+   }
if (svga_arl_needs_adjustment( emit )) {
   return emit_fake_arl( emit, insn );
} else {

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


Mesa (7.9): svga: Fix relative addressing translation for pixel shaders.

2010-09-20 Thread Jose Fonseca
Module: Mesa
Branch: 7.9
Commit: 202c1279c668b044085cace3a4ac42428b6c23ff
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=202c1279c668b044085cace3a4ac42428b6c23ff

Author: Michal Krol mic...@vmware.com
Date:   Thu Sep 16 16:48:00 2010 +

svga: Fix relative addressing translation for pixel shaders.

Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.

---

 src/gallium/drivers/svga/svga_tgsi_insn.c |   51 +
 1 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c 
b/src/gallium/drivers/svga/svga_tgsi_insn.c
index 72dccdf..ad7d27a 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -197,22 +197,37 @@ translate_src_register( const struct svga_shader_emitter 
*emit,
   break;
}
 
-   /* Indirect addressing (for coninstant buffer lookups only)
+   /* Indirect addressing.
 */
-   if (reg-Register.Indirect)
-   {
-  /* we shift the offset towards the minimum */
-  if (svga_arl_needs_adjustment( emit )) {
- src.base.num -= svga_arl_adjustment( emit );
+   if (reg-Register.Indirect) {
+  if (emit-unit == PIPE_SHADER_FRAGMENT) {
+ /* Pixel shaders have only loop registers for relative
+  * addressing into inputs. Ignore the redundant address
+  * register, the contents of aL should be in sync with it.
+  */
+ if (reg-Register.File == TGSI_FILE_INPUT) {
+src.base.relAddr = 1;
+src.indirect = src_token(SVGA3DREG_LOOP, 0);
+ }
+  }
+  else {
+ /* Constant buffers only.
+  */
+ if (reg-Register.File == TGSI_FILE_CONSTANT) {
+/* we shift the offset towards the minimum */
+if (svga_arl_needs_adjustment( emit )) {
+   src.base.num -= svga_arl_adjustment( emit );
+}
+src.base.relAddr = 1;
+
+/* Not really sure what should go in the second token:
+ */
+src.indirect = src_token( SVGA3DREG_ADDR,
+  reg-Indirect.Index );
+
+src.indirect.swizzle = SWIZZLE_;
+ }
   }
-  src.base.relAddr = 1;
-
-  /* Not really sure what should go in the second token:
-   */
-  src.indirect = src_token( SVGA3DREG_ADDR,
-reg-Indirect.Index );
-
-  src.indirect.swizzle = SWIZZLE_;
}
 
src = swizzle( src,
@@ -1593,6 +1608,14 @@ static boolean emit_arl(struct svga_shader_emitter *emit,
 const struct tgsi_full_instruction *insn)
 {
++emit-current_arl;
+   if (emit-unit == PIPE_SHADER_FRAGMENT) {
+  /* MOVA not present in pixel shader instruction set.
+   * Ignore this instruction altogether since it is
+   * only used for loop counters -- and for that
+   * we reference aL directly.
+   */
+  return TRUE;
+   }
if (svga_arl_needs_adjustment( emit )) {
   return emit_fake_arl( emit, insn );
} else {

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


Mesa (7.9): svga: Integer constant register file has a separate namespace.

2010-09-20 Thread Jose Fonseca
Module: Mesa
Branch: 7.9
Commit: d36344f9000dded355a14aa90df6bea1a8908929
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d36344f9000dded355a14aa90df6bea1a8908929

Author: Michal Krol mic...@vmware.com
Date:   Thu Sep 16 16:51:03 2010 +

svga: Integer constant register file has a separate namespace.

Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.

---

 src/gallium/drivers/svga/svga_tgsi.c  |2 +-
 src/gallium/drivers/svga/svga_tgsi_emit.h |3 ++-
 src/gallium/drivers/svga/svga_tgsi_insn.c |   12 ++--
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_tgsi.c 
b/src/gallium/drivers/svga/svga_tgsi.c
index 0cd6201..781fe63 100644
--- a/src/gallium/drivers/svga/svga_tgsi.c
+++ b/src/gallium/drivers/svga/svga_tgsi.c
@@ -203,7 +203,7 @@ svga_tgsi_translate( const struct svga_shader *shader,
   emit.imm_start += key.vkey.num_zero_stride_vertex_elements;
}
 
-   emit.nr_hw_const = (emit.imm_start + 
emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
+   emit.nr_hw_float_const = (emit.imm_start + 
emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
 
emit.nr_hw_temp = emit.info.file_max[TGSI_FILE_TEMPORARY] + 1;
emit.in_main_func = TRUE;
diff --git a/src/gallium/drivers/svga/svga_tgsi_emit.h 
b/src/gallium/drivers/svga/svga_tgsi_emit.h
index b4e90a9..63ef7f8 100644
--- a/src/gallium/drivers/svga/svga_tgsi_emit.h
+++ b/src/gallium/drivers/svga/svga_tgsi_emit.h
@@ -62,7 +62,8 @@ struct svga_shader_emitter
 
int imm_start;
 
-   int nr_hw_const;
+   int nr_hw_float_const;
+   int nr_hw_int_const;
int nr_hw_temp;

int insn_offset;
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c 
b/src/gallium/drivers/svga/svga_tgsi_insn.c
index ad7d27a..f2591c5 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -553,7 +553,7 @@ static boolean emit_def_const( struct svga_shader_emitter 
*emit,
 static INLINE boolean
 create_zero_immediate( struct svga_shader_emitter *emit )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT,
 idx, 0, 0, 0, 1 ))
@@ -568,7 +568,7 @@ create_zero_immediate( struct svga_shader_emitter *emit )
 static INLINE boolean
 create_loop_const( struct svga_shader_emitter *emit )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_int_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_INT, idx,
 255, /* iteration count */
@@ -586,7 +586,7 @@ create_loop_const( struct svga_shader_emitter *emit )
 static INLINE boolean
 create_sincos_consts( struct svga_shader_emitter *emit )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT, idx,
 -1.5500992e-006f,
@@ -596,7 +596,7 @@ create_sincos_consts( struct svga_shader_emitter *emit )
   return FALSE;
 
emit-sincos_consts_idx = idx;
-   idx = emit-nr_hw_const++;
+   idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT, idx,
 -0.02084f,
@@ -617,7 +617,7 @@ create_arl_consts( struct svga_shader_emitter *emit )
 
for (i = 0; i  emit-num_arl_consts; i += 4) {
   int j;
-  unsigned idx = emit-nr_hw_const++;
+  unsigned idx = emit-nr_hw_float_const++;
   float vals[4];
   for (j = 0; j  4  (j + i)  emit-num_arl_consts; ++j) {
  vals[j] = emit-arl_consts[i + j].number;
@@ -2407,7 +2407,7 @@ static boolean make_immediate( struct svga_shader_emitter 
*emit,
float d,
struct src_register *out )
 {
-   unsigned idx = emit-nr_hw_const++;
+   unsigned idx = emit-nr_hw_float_const++;
 
if (!emit_def_const( emit, SVGA3D_CONST_TYPE_FLOAT,
 idx, a, b, c, d ))

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


Mesa (master): i915g: Link with wrapper sw winsys with scons

2010-09-20 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: 208f1f381076560cb76aac753d6da2287f53ddb5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=208f1f381076560cb76aac753d6da2287f53ddb5

Author: Jakob Bornecrantz wallbra...@gmail.com
Date:   Mon Sep 20 15:25:18 2010 +0200

i915g: Link with wrapper sw winsys with scons

---

 src/gallium/targets/dri-i915/SConscript |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/targets/dri-i915/SConscript 
b/src/gallium/targets/dri-i915/SConscript
index 6f9336b..172f92d 100644
--- a/src/gallium/targets/dri-i915/SConscript
+++ b/src/gallium/targets/dri-i915/SConscript
@@ -11,6 +11,7 @@ env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
 env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE', 'GALLIUM_GALAHAD'])
 
 env.Prepend(LIBS = [
+ws_wrapper,
 st_dri,
 i915drm,
 i915,

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


Mesa (7.9): i915g: Link with wrapper sw winsys with scons

2010-09-20 Thread Jakob Bornecrantz
Module: Mesa
Branch: 7.9
Commit: b2476208543b9ac360d4ec298b2cc66dd52bb38d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b2476208543b9ac360d4ec298b2cc66dd52bb38d

Author: Jakob Bornecrantz wallbra...@gmail.com
Date:   Mon Sep 20 15:25:18 2010 +0200

i915g: Link with wrapper sw winsys with scons

cherry picked from commit 208f1f381076560cb76aac753d6da2287f53ddb5

---

 src/gallium/targets/dri-i915/SConscript |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/targets/dri-i915/SConscript 
b/src/gallium/targets/dri-i915/SConscript
index 6f9336b..172f92d 100644
--- a/src/gallium/targets/dri-i915/SConscript
+++ b/src/gallium/targets/dri-i915/SConscript
@@ -11,6 +11,7 @@ env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
 env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE', 'GALLIUM_GALAHAD'])
 
 env.Prepend(LIBS = [
+ws_wrapper,
 st_dri,
 i915drm,
 i915,

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


Mesa (master): glsl: Add doxygen comments

2010-09-20 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: e053d62aa573651abdd78666d299272c8219a3aa
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e053d62aa573651abdd78666d299272c8219a3aa

Author: Ian Romanick ian.d.roman...@intel.com
Date:   Sat Sep 18 16:08:38 2010 +0200

glsl: Add doxygen comments

---

 src/glsl/ast.h |   42 +++--
 src/glsl/ir.h  |   91 +++-
 2 files changed, 121 insertions(+), 12 deletions(-)

diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 44c31b6..d7bf909 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -33,6 +33,20 @@ struct _mesa_glsl_parse_state;
 
 struct YYLTYPE;
 
+/**
+ * \defgroup AST Abstract syntax tree node definitions
+ *
+ * An abstract syntax tree is generated by the parser.  This is a fairly
+ * direct representation of the gramma derivation for the source program.
+ * No symantic checking is done during the generation of the AST.  Only
+ * syntactic checking is done.  Symantic checking is performed by a later
+ * stage that converts the AST to a more generic intermediate representation.
+ *
+ *...@{
+ */
+/**
+ * Base class of all abstract syntax tree nodes
+ */
 class ast_node {
 public:
/* Callers of this talloc-based new need not call delete. It's
@@ -54,7 +68,14 @@ public:
   talloc_free(table);
}
 
+   /**
+* Print an AST node in something approximating the original GLSL code
+*/
virtual void print(void) const;
+
+   /**
+* Convert the AST node to the high-level intermediate representation
+*/
virtual ir_rvalue *hir(exec_list *instructions,
  struct _mesa_glsl_parse_state *state);
 
@@ -91,19 +112,29 @@ public:
   this-location.column = locp.first_column;
}
 
+   /**
+* Source location of the AST node.
+*/
struct {
-  unsigned source;
-  unsigned line;
-  unsigned column;
+  unsigned source;/** GLSL source number. */
+  unsigned line;  /** Line number within the source string. */
+  unsigned column;/** Column in the line. */
} location;
 
exec_node link;
 
 protected:
+   /**
+* The only constructor is protected so that only derived class objects can
+* be created.
+*/
ast_node(void);
 };
 
 
+/**
+ * Operators for AST expression nodes.
+ */
 enum ast_operators {
ast_assign,
ast_plus,/** Unary + operator. */
@@ -161,6 +192,9 @@ enum ast_operators {
ast_sequence
 };
 
+/**
+ * Representation of any sort of expression.
+ */
 class ast_expression : public ast_node {
 public:
ast_expression(int oper, ast_expression *,
@@ -651,7 +685,7 @@ public:
ast_function *prototype;
ast_compound_statement *body;
 };
-
+/*...@}*/
 
 extern void
 _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state 
*state);
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index b3b15bb..909f824 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -41,7 +41,31 @@ extern C {
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
 #endif
 
+/**
+ * \defgroup IR Intermediate representation nodes
+ *
+ * @{
+ */
+
+/**
+ * Class tags
+ *
+ * Each concrete class derived from \c ir_instruction has a value in this
+ * enumerant.  The value for the type is stored in \c ir_instruction::ir_type
+ * by the constructor.  While using type tags is not very C++, it is extremely
+ * convenient.  For example, during debugging you can simply inspect
+ * \c ir_instruction::ir_type to find out the actual type of the object.
+ *
+ * In addition, it is possible to use a switch-statement based on \c
+ * \c ir_instruction::ir_type to select different behavior for different object
+ * types.  For functions that have only slight differences for several object
+ * types, this allows writing very straightforward, readable code.
+ */
 enum ir_node_type {
+   /**
+* Zero is unused so that the IR validator can detect cases where
+* \c ir_instruction::ir_type has not been initialized.
+*/
ir_type_unset,
ir_type_variable,
ir_type_assignment,
@@ -156,9 +180,12 @@ protected:
 };
 
 
+/**
+ * Variable storage classes
+ */
 enum ir_variable_mode {
-   ir_var_auto = 0,
-   ir_var_uniform,
+   ir_var_auto = 0, /** Function local variables and globals. */
+   ir_var_uniform,  /** Variable declared as a uniform. */
ir_var_in,
ir_var_out,
ir_var_inout,
@@ -209,6 +236,9 @@ public:
 */
unsigned component_slots() const;
 
+   /**
+* Delcared name of the variable
+*/
const char *name;
 
/**
@@ -218,11 +248,28 @@ public:
 */
unsigned max_array_access;
 
+   /**
+* Is the variable read-only?
+*
+* This is set for variables declared as \c const, shader inputs,
+* and uniforms.
+*/
unsigned read_only:1;
unsigned centroid:1;
unsigned invariant:1;
 
+   /**
+* Storage class of the variable.
+*
+* \sa ir_variable_mode
+*/
unsigned mode:3;
+
+   /**
+* Interpolation mode for shader 

Mesa (master): mesa: don't call valid_texture_object() in non-debug builds

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 55228878420733e77a09c67d5175e90e4b2e7245
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=55228878420733e77a09c67d5175e90e4b2e7245

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 08:19:08 2010 -0600

mesa: don't call valid_texture_object() in non-debug builds

This reverts commit c32bac57ed445e48856d74113364287ed6e5cdd4
and silences the warning differently.

The _mesa_reference_texobj() function is called quite a bit and
we don't want to call valid_texture_object() all the time in non-
debug builds.

---

 src/mesa/main/texobj.c |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index c96226d..1fedc87 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -330,11 +330,8 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
   GLboolean deleteFlag = GL_FALSE;
   struct gl_texture_object *oldTex = *ptr;
 
-  {
- GLboolean valid = valid_texture_object(oldTex);
- ASSERT(valid);
- (void) valid;
-  }
+  ASSERT(valid_texture_object(oldTex));
+  (void) valid_texture_object; /* silence warning in release builds */
 
   _glthread_LOCK_MUTEX(oldTex-Mutex);
   ASSERT(oldTex-RefCount  0);

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


Mesa (master): glsl2: silence compiler warnings in printf() calls

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 17391241599137b9729e9ee6c5487d05e04d8aee
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=17391241599137b9729e9ee6c5487d05e04d8aee

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 08:22:51 2010 -0600

glsl2: silence compiler warnings in printf() calls

Such as: ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’

---

 src/glsl/ir_validate.cpp |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 58ab8aa..912d1c0 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -124,7 +124,8 @@ ir_validate::visit_leave(ir_loop *ir)
from:  %p\n
to:%p\n
increment: %p\n,
-   ir-counter, ir-from, ir-to, ir-increment);
+   (void *) ir-counter, (void *) ir-from, (void *) ir-to,
+(void *) ir-increment);
 abort();
   }
 
@@ -139,7 +140,8 @@ ir_validate::visit_leave(ir_loop *ir)
from:  %p\n
to:%p\n
increment: %p\n,
-   ir-counter, ir-from, ir-to, ir-increment);
+   (void *) ir-counter, (void *) ir-from, (void *) ir-to,
+(void *) ir-increment);
 abort();
   }
}

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


Mesa (master): docs: remove old broken link

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: a8fde1ba4df17427c82404e0c91930a6290391bf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8fde1ba4df17427c82404e0c91930a6290391bf

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 08:54:04 2010 -0600

docs: remove old broken link

---

 docs/news.html |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/docs/news.html b/docs/news.html
index 09385ad..2f3f143 100644
--- a/docs/news.html
+++ b/docs/news.html
@@ -1277,7 +1277,6 @@ grateful.
 p
 /ph2March 18, 1999/h2
 pThe new webpages are now online. Enjoy, and let me know if you find any 
errors.
-For an eye-candy free version you can use a 
href=http://www.mesa3d.org/txt/;http://www.mesa3d.org/txt//a./p
 p
 /ph2February 16, 1999/h2
 pa href=http://www.sgi.com/;SGI/a releases its a 
href=http://www.sgi.com/software/opensource/glx/;GLX

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


Mesa (master): docs: mark as obsolete, remove dead links

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 0bc3e1f4f4b0827ac4a880cdbdb1da069e80fac9
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0bc3e1f4f4b0827ac4a880cdbdb1da069e80fac9

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 08:57:53 2010 -0600

docs: mark as obsolete, remove dead links

---

 docs/fbdev-dri.html |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/docs/fbdev-dri.html b/docs/fbdev-dri.html
index e941b16..0eea5e8 100644
--- a/docs/fbdev-dri.html
+++ b/docs/fbdev-dri.html
@@ -9,6 +9,9 @@
 centerh1Mesa fbdev/DRI Drivers/h1/center
 br
 
+h1centerNOTE: this information is obsolete and will be removed at
+a future date/center/h1
+
 h11. Introduction/h1
 
 p
@@ -22,7 +25,7 @@ Contributors to this project include Jon Smirl, Keith 
Whitwell and Dave Airlie.
 
 p
 Applications in the fbdev/DRI environment use
-the a href=http://www.nabble.com/file/p15480666/MiniGXL.html; MiniGLX/a 
interface to choose pixel
+the MiniGLX interface to choose pixel
 formats, create rendering contexts, etc.  It's a subset of the GLX and
 Xlib interfaces allowing some degree of application portability between
 the X and X-less environments.
@@ -315,8 +318,7 @@ It means that the sample_server process is not running.
 h15.0 Programming Information/h1
 
 p
-OpenGL/Mesa is interfaced to fbdev via the a 
href=http://www.nabble.com/file/p15480666/MiniGLX.html;MiniGLX/a
-interface.
+OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface.
 MiniGLX is a subset of Xlib and GLX API functions which provides just
 enough functionality to setup OpenGL rendering and respond to simple
 input events.
@@ -332,7 +334,7 @@ This allows some degree of flexibility for software 
development and testing.
 However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
 Some of the structures are different and some macros/functions work
 differently.
-See the codeGL/miniglx.h/code header file for details.
+See the GL/miniglx.h header file for details.
 /p
 
 

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


Mesa (master): glsl: Add comments to clarify the types of comparison binops .

2010-09-20 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 14eea268284491d64ff92b37723bff1e9ff14b40
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=14eea268284491d64ff92b37723bff1e9ff14b40

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sun Sep 19 04:50:28 2010 +0200

glsl: Add comments to clarify the types of comparison binops.

---

 src/glsl/ir.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 909f824..240e7cd 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -719,7 +719,8 @@ enum ir_expression_operation {
ir_binop_mod,
 
/**
-* \name Binary comparison operators
+* \name Binary comparison operators which return a boolean vector.
+* The type of both operands must be equal.
 */
/*...@{*/
ir_binop_less,

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


Mesa (master): glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.

2010-09-20 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 6ea16b6c510ee7f0e68505838a99562f0852f8e4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ea16b6c510ee7f0e68505838a99562f0852f8e4

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sun Sep 19 04:51:07 2010 +0200

glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.

When ir_binop_all_equal and ir_binop_any_nequal were introduced, the
meaning of these two opcodes changed to return vectors rather than a
single scalar, but the constant expression handling code was incorrectly
written and only worked for scalars.  As a result, only the first
component of the returned vector would be properly initialized.

---

 src/glsl/ir_constant_expression.cpp |   55 +++
 1 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/src/glsl/ir_constant_expression.cpp 
b/src/glsl/ir_constant_expression.cpp
index ec0e26d..61a708f 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -623,36 +623,41 @@ ir_expression::constant_expression_value()
   }
   break;
case ir_binop_equal:
-  switch (op[0]-type-base_type) {
-  case GLSL_TYPE_UINT:
- data.b[0] = op[0]-value.u[0] == op[1]-value.u[0];
- break;
-  case GLSL_TYPE_INT:
- data.b[0] = op[0]-value.i[0] == op[1]-value.i[0];
- break;
-  case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]-value.f[0] == op[1]-value.f[0];
- break;
-  default:
- assert(0);
+  assert(op[0]-type == op[1]-type);
+  for (unsigned c = 0; c  components; c++) {
+switch (op[0]-type-base_type) {
+case GLSL_TYPE_UINT:
+   data.b[c] = op[0]-value.u[c] == op[1]-value.u[c];
+   break;
+case GLSL_TYPE_INT:
+   data.b[c] = op[0]-value.i[c] == op[1]-value.i[c];
+   break;
+case GLSL_TYPE_FLOAT:
+   data.b[c] = op[0]-value.f[c] == op[1]-value.f[c];
+   break;
+default:
+   assert(0);
+}
   }
   break;
case ir_binop_nequal:
-  switch (op[0]-type-base_type) {
-  case GLSL_TYPE_UINT:
- data.b[0] = op[0]-value.u[0] != op[1]-value.u[0];
- break;
-  case GLSL_TYPE_INT:
- data.b[0] = op[0]-value.i[0] != op[1]-value.i[0];
- break;
-  case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]-value.f[0] != op[1]-value.f[0];
- break;
-  default:
- assert(0);
+  assert(op[0]-type != op[1]-type);
+  for (unsigned c = 0; c  components; c++) {
+switch (op[0]-type-base_type) {
+case GLSL_TYPE_UINT:
+   data.b[c] = op[0]-value.u[c] != op[1]-value.u[c];
+   break;
+case GLSL_TYPE_INT:
+   data.b[c] = op[0]-value.i[c] != op[1]-value.i[c];
+   break;
+case GLSL_TYPE_FLOAT:
+   data.b[c] = op[0]-value.f[c] != op[1]-value.f[c];
+   break;
+default:
+   assert(0);
+}
   }
   break;
-
case ir_binop_all_equal:
   data.b[0] = op[0]-has_value(op[1]);
   break;

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


Mesa (master): r600g: move chip class to radeon common structure

2010-09-20 Thread Jerome Glisse
Module: Mesa
Branch: master
Commit: 363dfb83f1ca7f1ab09eec30aeb89732c5ce3e02
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=363dfb83f1ca7f1ab09eec30aeb89732c5ce3e02

Author: Jerome Glisse jgli...@redhat.com
Date:   Mon Sep 20 11:58:00 2010 -0400

r600g: move chip class to radeon common structure

So texture code can be shared btw new state design
 old one.

Signed-off-by: Jerome Glisse jgli...@redhat.com

---

 src/gallium/drivers/r600/r600.h   |7 +
 src/gallium/drivers/r600/r600_blit.c  |4 +-
 src/gallium/drivers/r600/r600_context.c   |2 +-
 src/gallium/drivers/r600/r600_hw_states.c |4 +-
 src/gallium/drivers/r600/r600_screen.c|   32 ++---
 src/gallium/drivers/r600/r600_screen.h|9 +--
 src/gallium/drivers/r600/r600_state.c |2 +-
 src/gallium/drivers/r600/r600_state2.c|   28 --
 src/gallium/drivers/r600/r600_texture.c   |6 +---
 src/gallium/drivers/r600/radeon.h |7 +
 src/gallium/winsys/r600/drm/r600.c|   36 +
 src/gallium/winsys/r600/drm/r600_priv.h   |1 +
 src/gallium/winsys/r600/drm/radeon.c  |   36 +
 src/gallium/winsys/r600/drm/radeon_priv.h |1 +
 14 files changed, 100 insertions(+), 75 deletions(-)

diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h
index 7cbacea..a123eb6 100644
--- a/src/gallium/drivers/r600/r600.h
+++ b/src/gallium/drivers/r600/r600.h
@@ -90,7 +90,14 @@ enum radeon_family {
CHIP_LAST,
 };
 
+enum chip_class {
+   R600,
+   R700,
+   EVERGREEN,
+};
+
 enum radeon_family r600_get_family(struct radeon *rw);
+enum chip_class r600_get_family_class(struct radeon *radeon);
 
 /* lowlevel WS bo */
 struct radeon_ws_bo;
diff --git a/src/gallium/drivers/r600/r600_blit.c 
b/src/gallium/drivers/r600/r600_blit.c
index 54fbc50..0506e82 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -283,7 +283,7 @@ static void r600_blit_state_vs_shader(struct r600_screen 
*rscreen, struct radeon
radeon_ws_bo_reference(rscreen-rw, bo, NULL);
return;
}
-   switch (rscreen-chip_class) {
+   switch (radeon_get_family_class(rscreen-rw)) {
case R600:
memcpy(data, shader_bc_r600, 128);
break;
@@ -347,7 +347,7 @@ static void r600_blit_state_ps_shader(struct r600_screen 
*rscreen, struct radeon
radeon_ws_bo_reference(rscreen-rw, bo, NULL);
return;
}
-   switch (rscreen-chip_class) {
+   switch (radeon_get_family_class(rscreen-rw)) {
case R600:
memcpy(data, shader_bc_r600, 48);
break;
diff --git a/src/gallium/drivers/r600/r600_context.c 
b/src/gallium/drivers/r600/r600_context.c
index 97b21d5..72aab91 100644
--- a/src/gallium/drivers/r600/r600_context.c
+++ b/src/gallium/drivers/r600/r600_context.c
@@ -113,7 +113,7 @@ struct pipe_context *r600_create_context(struct pipe_screen 
*screen, void *priv)
rctx-screen = rscreen;
rctx-rw = rscreen-rw;
 
-   if (rscreen-chip_class == EVERGREEN)
+   if (radeon_get_family_class(rscreen-rw) == EVERGREEN)
rctx-vtbl = eg_hw_state_vtbl;
else
rctx-vtbl = r600_hw_state_vtbl;
diff --git a/src/gallium/drivers/r600/r600_hw_states.c 
b/src/gallium/drivers/r600/r600_hw_states.c
index a4cd1bf..271bd1a 100644
--- a/src/gallium/drivers/r600/r600_hw_states.c
+++ b/src/gallium/drivers/r600/r600_hw_states.c
@@ -457,7 +457,7 @@ static void r600_dsa(struct r600_context *rctx, struct 
radeon_state *rstate)
 
if (query_running) {
db_render_override |= S_028D10_NOOP_CULL_DISABLE(1);
-   if (rscreen-chip_class == R700)
+   if (radeon_get_family_class(rscreen-rw) == R700)
db_render_control |= 
S_028D0C_R700_PERFECT_ZPASS_COUNTS(1);
}
 
@@ -656,7 +656,7 @@ static void r600_cb_cntl(struct r600_context *rctx, struct 
radeon_state *rstate)
rstate-states[R600_CB_CNTL__CB_SHADER_MASK] = shader_mask;
rstate-states[R600_CB_CNTL__CB_TARGET_MASK] = target_mask;
rstate-states[R600_CB_CNTL__CB_COLOR_CONTROL] = color_control;
-   if (rscreen-chip_class == R700)
+   if (radeon_get_family_class(rscreen-rw) == R700)
rstate-states[R600_CB_CNTL__CB_SHADER_CONTROL] = 
shader_control;
rstate-states[R600_CB_CNTL__PA_SC_AA_CONFIG] = 0x;
rstate-states[R600_CB_CNTL__PA_SC_AA_SAMPLE_LOCS_MCTX] = 0x;
diff --git a/src/gallium/drivers/r600/r600_screen.c 
b/src/gallium/drivers/r600/r600_screen.c
index 1711fab..d280a45 100644
--- a/src/gallium/drivers/r600/r600_screen.c
+++ b/src/gallium/drivers/r600/r600_screen.c
@@ -242,39 +242,13 @@ struct pipe_screen *r600_screen_create(struct radeon *rw)
if (rscreen == NULL) {
return 

Mesa (master): st/mesa: fix assertion failure in GetTexImage for cubemaps

2010-09-20 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 168554904bc079650124fbd026d9b75834eabc92
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=168554904bc079650124fbd026d9b75834eabc92

Author: Marek Olšák mar...@gmail.com
Date:   Fri Sep 17 02:43:38 2010 +0200

st/mesa: fix assertion failure in GetTexImage for cubemaps

Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.

---

 src/mesa/state_tracker/st_cb_texture.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index 124cd32..cd50014 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -240,6 +240,12 @@ get_texture_dims(GLenum target)
   return 1;
case GL_TEXTURE_2D:
case GL_TEXTURE_CUBE_MAP_ARB:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
case GL_TEXTURE_RECTANGLE_NV:
case GL_TEXTURE_2D_ARRAY_EXT:
   return 2;

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


Mesa (7.9): st/mesa: fix assertion failure in GetTexImage for cubemaps

2010-09-20 Thread Marek Olšák
Module: Mesa
Branch: 7.9
Commit: 0f1faa9c7b370e80a9dc488178ef8cc19ab4b090
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f1faa9c7b370e80a9dc488178ef8cc19ab4b090

Author: Marek Olšák mar...@gmail.com
Date:   Fri Sep 17 02:43:38 2010 +0200

st/mesa: fix assertion failure in GetTexImage for cubemaps

Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 168554904bc079650124fbd026d9b75834eabc92)

---

 src/mesa/state_tracker/st_cb_texture.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index 124cd32..cd50014 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -240,6 +240,12 @@ get_texture_dims(GLenum target)
   return 1;
case GL_TEXTURE_2D:
case GL_TEXTURE_CUBE_MAP_ARB:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+   case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
case GL_TEXTURE_RECTANGLE_NV:
case GL_TEXTURE_2D_ARRAY_EXT:
   return 2;

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


Mesa (master): llvmpipe: fix query bug when no there's no scene

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 7888a2f82200738ac03c78d9900eb028d48725a1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7888a2f82200738ac03c78d9900eb028d48725a1

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 10:50:15 2010 -0600

llvmpipe: fix query bug when no there's no scene

---

 src/gallium/drivers/llvmpipe/lp_query.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_query.c 
b/src/gallium/drivers/llvmpipe/lp_query.c
index ff0e207..84c66dd 100644
--- a/src/gallium/drivers/llvmpipe/lp_query.c
+++ b/src/gallium/drivers/llvmpipe/lp_query.c
@@ -92,8 +92,9 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
int i;
 
if (!pq-fence) {
-  assert(0);/* query not in issued state */
-  return FALSE;
+  /* no fence because there was no scene, so results is zero */
+  *result = 0;
+  return TRUE;
}
 
if (!lp_fence_signalled(pq-fence)) {

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


Mesa (7.9): gallivm: fix incorrect vector shuffle datatype

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: febd353bcd198a38d5f5fe7d31162c42bc87b93e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=febd353bcd198a38d5f5fe7d31162c42bc87b93e

Author: Brian Paul bri...@vmware.com
Date:   Fri Sep 17 12:20:15 2010 -0600

gallivm: fix incorrect vector shuffle datatype

The permutation vector must always be a vector of int32 values.

(cherry picked from commit 3c9f4c7b750ce7e9c60d75dbe186aaaf69e4baab)

---

 src/gallium/auxiliary/gallivm/lp_bld_swizzle.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c 
b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
index d4d2f2b..1dfbe56 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
@@ -76,11 +76,15 @@ lp_build_broadcast_scalar(struct lp_build_context *bld,
}
else {
   LLVMValueRef res;
+  /* The shuffle vector is always made of int32 elements */
+  struct lp_type i32_vec_type = lp_type_int_vec(32);
+  i32_vec_type.length = type.length;
+
 #if HAVE_LLVM = 0x207
   res = LLVMBuildInsertElement(bld-builder, bld-undef, scalar,
LLVMConstInt(LLVMInt32Type(), 0, 0), );
   res = LLVMBuildShuffleVector(bld-builder, res, bld-undef,
-   lp_build_const_int_vec(type, 0), );
+   lp_build_const_int_vec(i32_vec_type, 0), 
);
 #else
   /* XXX: The above path provokes a bug in LLVM 2.6 */
   unsigned i;

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


Mesa (7.9): llvmpipe: fix query bug when no there's no scene

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: a9fceb69792acb2e6e6fad8c2a8ba27d0b04470f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9fceb69792acb2e6e6fad8c2a8ba27d0b04470f

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 10:56:10 2010 -0600

llvmpipe: fix query bug when no there's no scene

(cherry picked from commit 7888a2f82200738ac03c78d9900eb028d48725a1)

---

 src/gallium/drivers/llvmpipe/lp_query.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_query.c 
b/src/gallium/drivers/llvmpipe/lp_query.c
index ff0e207..84c66dd 100644
--- a/src/gallium/drivers/llvmpipe/lp_query.c
+++ b/src/gallium/drivers/llvmpipe/lp_query.c
@@ -92,8 +92,9 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
int i;
 
if (!pq-fence) {
-  assert(0);/* query not in issued state */
-  return FALSE;
+  /* no fence because there was no scene, so results is zero */
+  *result = 0;
+  return TRUE;
}
 
if (!lp_fence_signalled(pq-fence)) {

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


Mesa (7.9): docs: remove old broken link

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 1b90889eb40cc74777ad2034813dc4deffb0aa67
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b90889eb40cc74777ad2034813dc4deffb0aa67

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 10:56:41 2010 -0600

docs: remove old broken link

(cherry picked from commit a8fde1ba4df17427c82404e0c91930a6290391bf)

---

 docs/news.html |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/docs/news.html b/docs/news.html
index 09385ad..2f3f143 100644
--- a/docs/news.html
+++ b/docs/news.html
@@ -1277,7 +1277,6 @@ grateful.
 p
 /ph2March 18, 1999/h2
 pThe new webpages are now online. Enjoy, and let me know if you find any 
errors.
-For an eye-candy free version you can use a 
href=http://www.mesa3d.org/txt/;http://www.mesa3d.org/txt//a./p
 p
 /ph2February 16, 1999/h2
 pa href=http://www.sgi.com/;SGI/a releases its a 
href=http://www.sgi.com/software/opensource/glx/;GLX

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


Mesa (7.9): docs: mark as obsolete, remove dead links

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: e678c3f4e17ed9dba0651a3ba540f97d66c59718
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e678c3f4e17ed9dba0651a3ba540f97d66c59718

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 10:56:53 2010 -0600

docs: mark as obsolete, remove dead links

(cherry picked from commit 0bc3e1f4f4b0827ac4a880cdbdb1da069e80fac9)

---

 docs/fbdev-dri.html |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/docs/fbdev-dri.html b/docs/fbdev-dri.html
index e941b16..0eea5e8 100644
--- a/docs/fbdev-dri.html
+++ b/docs/fbdev-dri.html
@@ -9,6 +9,9 @@
 centerh1Mesa fbdev/DRI Drivers/h1/center
 br
 
+h1centerNOTE: this information is obsolete and will be removed at
+a future date/center/h1
+
 h11. Introduction/h1
 
 p
@@ -22,7 +25,7 @@ Contributors to this project include Jon Smirl, Keith 
Whitwell and Dave Airlie.
 
 p
 Applications in the fbdev/DRI environment use
-the a href=http://www.nabble.com/file/p15480666/MiniGXL.html; MiniGLX/a 
interface to choose pixel
+the MiniGLX interface to choose pixel
 formats, create rendering contexts, etc.  It's a subset of the GLX and
 Xlib interfaces allowing some degree of application portability between
 the X and X-less environments.
@@ -315,8 +318,7 @@ It means that the sample_server process is not running.
 h15.0 Programming Information/h1
 
 p
-OpenGL/Mesa is interfaced to fbdev via the a 
href=http://www.nabble.com/file/p15480666/MiniGLX.html;MiniGLX/a
-interface.
+OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface.
 MiniGLX is a subset of Xlib and GLX API functions which provides just
 enough functionality to setup OpenGL rendering and respond to simple
 input events.
@@ -332,7 +334,7 @@ This allows some degree of flexibility for software 
development and testing.
 However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
 Some of the structures are different and some macros/functions work
 differently.
-See the codeGL/miniglx.h/code header file for details.
+See the GL/miniglx.h header file for details.
 /p
 
 

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


Mesa (master): gallivm: remove debug code

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: b2ad8b5c221da0a7fd0d12c718d13b9a903179cc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b2ad8b5c221da0a7fd0d12c718d13b9a903179cc

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 11:21:44 2010 -0600

gallivm: remove debug code

---

 src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 2d80db6..f86d055 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -1195,7 +1195,6 @@ lp_build_sample_soa(LLVMBuilderRef builder,
 lp_is_simple_wrap_mode(static_state-wrap_s) 
 lp_is_simple_wrap_mode(static_state-wrap_t)) {
   /* do sampling/filtering with fixed pt arithmetic */
-  printf(new sample\n);
   lp_build_sample_aos(bld, unit, s, t, r, ddx, ddy,
   lod_bias, explicit_lod,
   width, height, depth,
@@ -1217,7 +1216,6 @@ lp_build_sample_soa(LLVMBuilderRef builder,
   static_state-wrap_t);
   }
 
-  printf(old sample\n);
   lp_build_sample_general(bld, unit, s, t, r, ddx, ddy,
   lod_bias, explicit_lod,
   width, height, depth,

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


Mesa (master): softpipe: make z/s test always pass if no zsbuf, instead of crashing

2010-09-20 Thread Luca Barbieri
Module: Mesa
Branch: master
Commit: 2e7d1c2c86014d8bdd615d587fb9e98bc8eda605
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e7d1c2c86014d8bdd615d587fb9e98bc8eda605

Author: Luca Barbieri l...@luca-barbieri.com
Date:   Mon Sep 20 19:22:44 2010 +0200

softpipe: make z/s test always pass if no zsbuf, instead of crashing

D3D10 specifies this.

---

 src/gallium/drivers/softpipe/sp_quad_depth_test.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c 
b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index 5590d40..425fecd 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -695,8 +695,9 @@ depth_test_quads_fallback(struct quad_stage *qs,
   nr = alpha_test_quads(qs, quads, nr);
}
 
-   if (qs-softpipe-depth_stencil-depth.enabled ||
-   qs-softpipe-depth_stencil-stencil[0].enabled) {
+   if (qs-softpipe-framebuffer.zsbuf 
+   (qs-softpipe-depth_stencil-depth.enabled ||
+   qs-softpipe-depth_stencil-stencil[0].enabled)) {
 
   data.ps = qs-softpipe-framebuffer.zsbuf;
   data.format = data.ps-format;
@@ -805,6 +806,9 @@ choose_depth_test(struct quad_stage *qs,
 
boolean occlusion = qs-softpipe-active_query_count;
 
+   if(!qs-softpipe-framebuffer.zsbuf)
+  depth = depthwrite = stencil = FALSE;
+
/* default */
qs-run = depth_test_quads_fallback;
 

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


Mesa (master): gallium: avoid the C++ keyword template in sw_winsys.h

2010-09-20 Thread Luca Barbieri
Module: Mesa
Branch: master
Commit: 6d0b695fa7fa521c5e815f185841732163dfbb3e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d0b695fa7fa521c5e815f185841732163dfbb3e

Author: Luca Barbieri l...@luca-barbieri.com
Date:   Mon Sep 20 20:13:30 2010 +0200

gallium: avoid the C++ keyword template in sw_winsys.h

---

 src/gallium/include/state_tracker/sw_winsys.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/include/state_tracker/sw_winsys.h 
b/src/gallium/include/state_tracker/sw_winsys.h
index d461ded..0b11fe3 100644
--- a/src/gallium/include/state_tracker/sw_winsys.h
+++ b/src/gallium/include/state_tracker/sw_winsys.h
@@ -97,7 +97,7 @@ struct sw_winsys
 */
struct sw_displaytarget *
(*displaytarget_from_handle)( struct sw_winsys *ws,
- const struct pipe_resource *template,
+ const struct pipe_resource *templat,
  struct winsys_handle *whandle,
  unsigned *stride );
 

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


Mesa (master): tgsi: add switch/case opcodes to tgsi_opcode_tmp.h

2010-09-20 Thread Luca Barbieri
Module: Mesa
Branch: master
Commit: de71e7a4c96e513beacb94eccbb8e5241a71aaf3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=de71e7a4c96e513beacb94eccbb8e5241a71aaf3

Author: Luca Barbieri l...@luca-barbieri.com
Date:   Mon Sep 20 19:19:50 2010 +0200

tgsi: add switch/case opcodes to tgsi_opcode_tmp.h

---

 src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h 
b/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h
index e472947..b3123ed 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h
@@ -163,6 +163,10 @@ OP12(USGE)
 OP12(USHR)
 OP12(USLT)
 OP12(USNE)
+OP01(SWITCH)
+OP01(CASE)
+OP00(DEFAULT)
+OP00(ENDSWITCH)
 
 
 #undef OP00

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


Mesa (master): softpipe: fix whitespace

2010-09-20 Thread Luca Barbieri
Module: Mesa
Branch: master
Commit: 86d5ec70d1a7bccdc26325d07c18f2a4d532dc81
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=86d5ec70d1a7bccdc26325d07c18f2a4d532dc81

Author: Luca Barbieri l...@luca-barbieri.com
Date:   Mon Sep 20 20:49:03 2010 +0200

softpipe: fix whitespace

---

 src/gallium/drivers/softpipe/sp_quad_depth_test.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c 
b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index 425fecd..e9b9262 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -696,8 +696,8 @@ depth_test_quads_fallback(struct quad_stage *qs,
}
 
if (qs-softpipe-framebuffer.zsbuf 
-   (qs-softpipe-depth_stencil-depth.enabled ||
-   qs-softpipe-depth_stencil-stencil[0].enabled)) {
+ (qs-softpipe-depth_stencil-depth.enabled ||
+  qs-softpipe-depth_stencil-stencil[0].enabled)) {
 
   data.ps = qs-softpipe-framebuffer.zsbuf;
   data.format = data.ps-format;

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


Mesa (master): r600g: Honour destination operand' s writemask in the SCS implementation.

2010-09-20 Thread Tilman Sauerbeck
Module: Mesa
Branch: master
Commit: 57bf96b43be2abcbadc387d7b5466b772125a093
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=57bf96b43be2abcbadc387d7b5466b772125a093

Author: Tilman Sauerbeck til...@code-monkey.de
Date:   Sun Sep 19 10:06:34 2010 +0200

r600g: Honour destination operand's writemask in the SCS implementation.

If we are not going to write to the X or Y components of the destination
vector we also don't need to prepare to compute SIN or COS.

Signed-off-by: Tilman Sauerbeck til...@code-monkey.de

---

 src/gallium/drivers/r600/r600_shader.c |   61 ++-
 1 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index bce5297..523b6d2 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -926,38 +926,47 @@ static int tgsi_scs(struct r600_shader_ctx *ctx)
struct r600_bc_alu alu;
int r;
 
-   r = tgsi_setup_trig(ctx, r600_src);
-   if (r)
-   return r;
-
+   /* We'll only need the trig stuff if we are going to write to the
+* X or Y components of the destination vector.
+*/
+   if (likely(inst-Dst[0].Register.WriteMask  TGSI_WRITEMASK_XY)) {
+   r = tgsi_setup_trig(ctx, r600_src);
+   if (r)
+   return r;
+   }
 
/* dst.x = COS */
-   memset(alu, 0, sizeof(struct r600_bc_alu));
-   alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_COS);
-   r = tgsi_dst(ctx, inst-Dst[0], 0, alu.dst);
-   if (r)
-   return r;
+   if (inst-Dst[0].Register.WriteMask  TGSI_WRITEMASK_X) {
+   memset(alu, 0, sizeof(struct r600_bc_alu));
+   alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_COS);
+   r = tgsi_dst(ctx, inst-Dst[0], 0, alu.dst);
+   if (r)
+   return r;
 
-   alu.src[0].sel = ctx-temp_reg;
-   alu.src[0].chan = 0;
-   alu.last = 1;
-   r = r600_bc_add_alu(ctx-bc, alu);
-   if (r)
-   return r;
+   alu.src[0].sel = ctx-temp_reg;
+   alu.src[0].chan = 0;
+   alu.last = 1;
+   r = r600_bc_add_alu(ctx-bc, alu);
+   if (r)
+   return r;
+   }
 
/* dst.y = SIN */
-   memset(alu, 0, sizeof(struct r600_bc_alu));
-   alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SIN);
-   r = tgsi_dst(ctx, inst-Dst[0], 1, alu.dst);
-   if (r)
-   return r;
+   if (inst-Dst[0].Register.WriteMask  TGSI_WRITEMASK_Y) {
+   memset(alu, 0, sizeof(struct r600_bc_alu));
+   alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SIN);
+   r = tgsi_dst(ctx, inst-Dst[0], 1, alu.dst);
+   if (r)
+   return r;
+
+   alu.src[0].sel = ctx-temp_reg;
+   alu.src[0].chan = 0;
+   alu.last = 1;
+   r = r600_bc_add_alu(ctx-bc, alu);
+   if (r)
+   return r;
+   }
 
-   alu.src[0].sel = ctx-temp_reg;
-   alu.src[0].chan = 0;
-   alu.last = 1;
-   r = r600_bc_add_alu(ctx-bc, alu);
-   if (r)
-   return r;
return 0;
 }
 

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


Mesa (master): r600g: Implemented the Z and W component write for the SCS opcode.

2010-09-20 Thread Tilman Sauerbeck
Module: Mesa
Branch: master
Commit: ef419599d9b18de2a9077c5f0a7f02bfc11d1762
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef419599d9b18de2a9077c5f0a7f02bfc11d1762

Author: Tilman Sauerbeck til...@code-monkey.de
Date:   Mon Sep 20 21:27:59 2010 +0200

r600g: Implemented the Z and W component write for the SCS opcode.

Signed-off-by: Tilman Sauerbeck til...@code-monkey.de

---

 src/gallium/drivers/r600/r600_shader.c |   49 
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index 523b6d2..1702475 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -967,6 +967,55 @@ static int tgsi_scs(struct r600_shader_ctx *ctx)
return r;
}
 
+   /* dst.z = 0.0; */
+   if (inst-Dst[0].Register.WriteMask  TGSI_WRITEMASK_Z) {
+   fprintf(stderr, writing z\n);
+   memset(alu, 0, sizeof(struct r600_bc_alu));
+
+   alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
+
+   r = tgsi_dst(ctx, inst-Dst[0], 2, alu.dst);
+   if (r)
+   return r;
+
+   alu.src[0].sel = V_SQ_ALU_SRC_0;
+   alu.src[0].chan = 0;
+
+   alu.last = 1;
+
+   r = r600_bc_add_alu(ctx-bc, alu);
+   if (r)
+   return r;
+
+   r = r600_bc_add_literal(ctx-bc, ctx-value);
+   if (r)
+   return r;
+   }
+
+   /* dst.w = 1.0; */
+   if (inst-Dst[0].Register.WriteMask  TGSI_WRITEMASK_W) {
+   memset(alu, 0, sizeof(struct r600_bc_alu));
+
+   alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
+
+   r = tgsi_dst(ctx, inst-Dst[0], 3, alu.dst);
+   if (r)
+   return r;
+
+   alu.src[0].sel = V_SQ_ALU_SRC_1;
+   alu.src[0].chan = 0;
+
+   alu.last = 1;
+
+   r = r600_bc_add_alu(ctx-bc, alu);
+   if (r)
+   return r;
+
+   r = r600_bc_add_literal(ctx-bc, ctx-value);
+   if (r)
+   return r;
+   }
+
return 0;
 }
 

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


Mesa (master): python/tests: Fixed tri.py for API and TGSI syntax changes.

2010-09-20 Thread Tilman Sauerbeck
Module: Mesa
Branch: master
Commit: 021e68b2cdc9a675887dac33689d5ffe244d8f9a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=021e68b2cdc9a675887dac33689d5ffe244d8f9a

Author: Tilman Sauerbeck til...@code-monkey.de
Date:   Sun Sep 19 19:25:21 2010 +0200

python/tests: Fixed tri.py for API and TGSI syntax changes.

Signed-off-by: Tilman Sauerbeck til...@code-monkey.de

---

 src/gallium/tests/python/samples/tri.py |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/tests/python/samples/tri.py 
b/src/gallium/tests/python/samples/tri.py
index fed929d..6d17c88 100644
--- a/src/gallium/tests/python/samples/tri.py
+++ b/src/gallium/tests/python/samples/tri.py
@@ -88,8 +88,8 @@ def test(dev):
 
 # rasterizer
 rasterizer = Rasterizer()
-rasterizer.front_winding = PIPE_WINDING_CW
-rasterizer.cull_mode = PIPE_WINDING_NONE
+rasterizer.front_ccw = False
+rasterizer.cull_face = PIPE_FACE_NONE
 rasterizer.scissor = 1
 ctx.set_rasterizer(rasterizer)
 
@@ -161,8 +161,8 @@ def test(dev):
 # vertex shader
 vs = Shader('''
 VERT
-DCL IN[0], POSITION, CONSTANT
-DCL IN[1], COLOR, CONSTANT
+DCL IN[0]
+DCL IN[1]
 DCL OUT[0], POSITION, CONSTANT
 DCL OUT[1], COLOR, CONSTANT
 0:MOV OUT[0], IN[0]

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


Mesa (d3d1x): d3d1x: add new Direct3D 10/11 COM state tracker for Gallium

2010-09-20 Thread Luca Barbieri
Module: Mesa
Branch: d3d1x
Commit: e80d59faaa410bfc78af64204bc4055b837c7fad
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e80d59faaa410bfc78af64204bc4055b837c7fad

Author: Luca Barbieri l...@luca-barbieri.com
Date:   Sun Sep 12 02:49:36 2010 +0200

d3d1x: add new Direct3D 10/11 COM state tracker for Gallium

This is a new implementation of the Direct3D 11 COM API for Gallium.

Direct3D 10 and 10.1 implementations are also provided, which are
automatically generated with s/D3D11/D3D10/g plus a bunch of #ifs.

While this in an initial version, most of the code is there (limited
to what Gallium can express), and tri, gears and texturing demos
are working.

The primary goal is to realize Gallium's promise of multiple API
support, and provide an API that can be easily implemented with just
a very thin wrapper over Gallium, instead of the enormous amount of
complex code needed for OpenGL.

The secondary goal is to run Windows Direct3D 10/11 games on Linux
using Wine.
Wine dlls are currently not provided, but adding them should be
quite easy.

Fglrx and nvidia drivers can also be supported by writing a Gallium
driver that talks to them using OpenGL, which is a relatively easy
task.
Thanks to the great design of Direct3D 10/11 and closeness to Gallium,
this approach should not result in detectable overhead, and is the
most maintainable way to do it, providing a path to switch to the
open Gallium drivers once they are on par with the proprietary ones.

Currently Wine has a very limited Direct3D 10 implementation, and
completely lacks a Direct3D 11 implementation.

Note that Direct3D 10/11 are completely different from Direct3D 9
and earlier, and thus warrant a fully separate implementation.

The third goal is to provide a superior alternative to OpenGL for
graphics programming on non-Windows systems, particularly Linux
and other free and open systems.

Thanks to a very clean and well-though design done from scratch,
the Direct3D 10/11 APIs are vastly better than OpenGL and can be
supported with orders of magnitude less code and development time,
as you can see by comparing the lines of code of this commit and
those in the existing Mesa OpenGL implementation.

This would have been true for the Longs Peak proposal as well, but
unfortunately it was abandoned by Khronos, leaving the OpenGL
ecosystem without a graphics API with a modern design.

A binding of Direct3D 10/11 to EGL would solve this issue in the
most economical way possible, and this would be great to provide
in Mesa, since DXGI, the API used to bind Direct3D 10/11 to Windows,
is a bit suboptimal, especially on non-Windows platforms.

Finally, a mature Direct3D 10/11 implementation is intrinsically going
to be faster and more reliable than an OpenGL implementation, thanks
to the dramatically smaller API and the segregation of all nontrivial
work to object creation that the application must perform ahead of
time.

Currently, this commit contains:
- Independently created headers for Direct3D 10, 10.1, 11 and DXGI 1.1,
  partially based on the existing Wine headers for D3D10 and DXGI 1.0
- A parser for Direct3D 10/11 DXBC and TokenizedProgramFormat (TPF)
- A shader translator from TokenizedProgramFormat to TGSI
- Implementation of the Direct3D 11 core interfaces
- Automatically generated implementation of Direct3D 10 and 10.1
- Implementation of DXGI using the native framework of the EGL st
- Demos, usable either on Windows or on this implementation
  - d3d11tri, a clone of tri
  - d3d11tex, a (multi)texturing demo
  - d3d11gears, an improved version of glxgears
  - d3d11spikysphere, a D3D11 tessellation demo (currently Windows-only)
- A downloader for the Microsoft HLSL compiler, needed to recompile
  the shaders (compiled shader bytecode is also included)

To compile this, configure at least with these options:
--with-state-trackers=egl,d3d1x --with-egl-platforms=x11
plus some gallium drivers (such as softpipe with --enable-gallium-swrast)

The Wine headers (usually from a wine-dev or wine-devel package) must
be installed.
Only x86-32 has been tested.

You may need to run make in the subdirectories of src/gallium/winsys/sw
and you may need to manually run sudo make install in
src/gallium/targets/egl

To test it, run the demos in the progs directory.
Windows binaries are included to find out how demos should work, and to
test Wine integration when it will be done.

Enjoy, and let me know if you manage to compile and run this, or
which issues you are facing if not.

Using softpipe is recommended for now, and your mileage with hardware
drivers may vary.
However, getting this to work on hardware drivers is also obviously very
important.

Note that currently llvmpipe is buggy and causes all 3 gears to be
drawn with the same color.
Use export GALLIUM_DRIVER=softpipe to avoid this.

Thanks to all the Gallium contributors and especially the VMware
team, whose work made it possible to implement Direct3D 10/11 much
more easily than it would have been 

Mesa (master): r600g: use pipe context for flushing inside map

2010-09-20 Thread Jerome Glisse
Module: Mesa
Branch: master
Commit: 0f099f2906773690210661fb533e207626dc8e40
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f099f2906773690210661fb533e207626dc8e40

Author: Jerome Glisse jgli...@redhat.com
Date:   Mon Sep 20 15:35:19 2010 -0400

r600g: use pipe context for flushing inside map

This allow to share code path btw old  new, also
remove check on reference this might make things
a little slower but new design doesn't use reference
stuff.

Signed-off-by: Jerome Glisse jgli...@redhat.com

---

 src/gallium/drivers/r600/r600_buffer.c |2 +-
 src/gallium/drivers/r600/r600_context.c|   21 ++---
 src/gallium/drivers/r600/r600_query.c  |2 +-
 src/gallium/drivers/r600/r600_shader.c |2 +-
 src/gallium/drivers/r600/r600_state2.c |3 +++
 src/gallium/drivers/r600/r600_texture.c|2 +-
 src/gallium/drivers/r600/radeon.h  |1 -
 src/gallium/winsys/r600/drm/radeon_bo_pb.c |   14 +++---
 8 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_buffer.c 
b/src/gallium/drivers/r600/r600_buffer.c
index dc3fc81..ea37078 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -171,7 +171,7 @@ static void *r600_buffer_transfer_map(struct pipe_context 
*pipe,
if (transfer-usage  PIPE_TRANSFER_WRITE) {
write = 1;
}
-   data = radeon_ws_bo_map(rscreen-rw, rbuffer-r.bo, transfer-usage, 
rctx);
+   data = radeon_ws_bo_map(rscreen-rw, rbuffer-r.bo, transfer-usage, 
pipe);
if (!data)
return NULL;
 
diff --git a/src/gallium/drivers/r600/r600_context.c 
b/src/gallium/drivers/r600/r600_context.c
index 72aab91..7a63d96 100644
--- a/src/gallium/drivers/r600/r600_context.c
+++ b/src/gallium/drivers/r600/r600_context.c
@@ -69,6 +69,10 @@ void r600_flush(struct pipe_context *ctx, unsigned flags,
 {
struct r600_context *rctx = r600_context(ctx);
struct r600_query *rquery = NULL;
+#if 0
+   static int dc = 0;
+   char dname[256];
+#endif
 
/* flush upload buffers */
u_upload_flush(rctx-upload_vb);
@@ -77,6 +81,16 @@ void r600_flush(struct pipe_context *ctx, unsigned flags,
/* suspend queries */
r600_queries_suspend(ctx);
 
+
+#if 0
+   sprintf(dname, gallium-%08d.bof, dc);
+   if (dc  2) {
+   radeon_ctx_dump_bof(rctx-ctx, dname);
+   R600_ERR(dumped %s\n, dname);
+   }
+   dc++;
+#endif
+
radeon_ctx_submit(rctx-ctx);
 
LIST_FOR_EACH_ENTRY(rquery, rctx-query_list, list) {
@@ -88,13 +102,6 @@ void r600_flush(struct pipe_context *ctx, unsigned flags,
r600_queries_resume(ctx);
 }
 
-void r600_flush_ctx(void *data)
-{
-struct r600_context *rctx = data;
-
-rctx-context.flush(rctx-context, 0, NULL);
-}
-
 struct pipe_context *r600_create_context(struct pipe_screen *screen, void 
*priv)
 {
struct r600_context *rctx = CALLOC_STRUCT(r600_context);
diff --git a/src/gallium/drivers/r600/r600_query.c 
b/src/gallium/drivers/r600/r600_query.c
index 023b09e..6e50701 100644
--- a/src/gallium/drivers/r600/r600_query.c
+++ b/src/gallium/drivers/r600/r600_query.c
@@ -108,7 +108,7 @@ static void r600_query_result(struct pipe_context *ctx, 
struct r600_query *rquer
u32 *results;
int i;
 
-   results = radeon_ws_bo_map(rscreen-rw, rquery-buffer, 0, 
r600_context(ctx));
+   results = radeon_ws_bo_map(rscreen-rw, rquery-buffer, 0, ctx);
for (i = 0; i  rquery-num_results; i += 4) {
start = (u64)results[i] | (u64)results[i + 1]  32;
end = (u64)results[i + 2] | (u64)results[i + 3]  32;
diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index 1702475..e1e2891 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -167,7 +167,7 @@ static int r600_pipe_shader(struct pipe_context *ctx, 
struct r600_context_state
if (rpshader-bo == NULL) {
return -ENOMEM;
}
-   data = radeon_ws_bo_map(rscreen-rw, rpshader-bo, 0, rctx);
+   data = radeon_ws_bo_map(rscreen-rw, rpshader-bo, 0, ctx);
memcpy(data, rshader-bc.bytecode, rshader-bc.ndw * 4);
radeon_ws_bo_unmap(rscreen-rw, rpshader-bo);
/* build state */
diff --git a/src/gallium/drivers/r600/r600_state2.c 
b/src/gallium/drivers/r600/r600_state2.c
index ffb18ab..5269e6d 100644
--- a/src/gallium/drivers/r600/r600_state2.c
+++ b/src/gallium/drivers/r600/r600_state2.c
@@ -1600,6 +1600,9 @@ static void r600_set_framebuffer_state(struct 
pipe_context *ctx,
/* unreference old buffer and reference new one */
rstate-id = R600_PIPE_STATE_FRAMEBUFFER;
for (int i = 0; i  rctx-framebuffer.nr_cbufs; i++) {
+   pipe_surface_reference(rctx-framebuffer.cbufs[i], NULL);
+   }
+   for (int i = 0; i  state-nr_cbufs; 

Mesa (sprite-coord): llvmpipe: maintain fragment shader state for draw module

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: sprite-coord
Commit: 955d76c3d2004c058c326d68eddc5a06d1611a41
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=955d76c3d2004c058c326d68eddc5a06d1611a41

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 12:52:16 2010 -0600

llvmpipe: maintain fragment shader state for draw module

---

 src/gallium/drivers/llvmpipe/lp_state_fs.c |   12 
 src/gallium/drivers/llvmpipe/lp_state_fs.h |2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c 
b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index e54dd9f..fb673db 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -886,6 +886,7 @@ static void *
 llvmpipe_create_fs_state(struct pipe_context *pipe,
  const struct pipe_shader_state *templ)
 {
+   struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
struct lp_fragment_shader *shader;
int nr_samplers;
 
@@ -902,6 +903,12 @@ llvmpipe_create_fs_state(struct pipe_context *pipe,
/* we need to keep a local copy of the tokens */
shader-base.tokens = tgsi_dup_tokens(templ-tokens);
 
+   shader-draw_data = draw_create_fragment_shader(llvmpipe-draw, templ);
+   if (shader-draw_data == NULL) {
+  FREE((void *) shader-base.tokens);
+  return NULL;
+   }
+
nr_samplers = shader-info.file_max[TGSI_FILE_SAMPLER] + 1;
 
shader-variant_key_size = Offset(struct lp_fragment_shader_variant_key,
@@ -938,6 +945,9 @@ llvmpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
 
draw_flush(llvmpipe-draw);
 
+   draw_bind_fragment_shader(llvmpipe-draw,
+ (llvmpipe-fs ? llvmpipe-fs-draw_data : NULL));
+
llvmpipe-fs = fs;
 
llvmpipe-dirty |= LP_NEW_FS;
@@ -995,6 +1005,8 @@ llvmpipe_delete_fs_state(struct pipe_context *pipe, void 
*fs)
   li = next;
}
 
+   draw_delete_fragment_shader(llvmpipe-draw, shader-draw_data);
+
assert(shader-variants_cached == 0);
FREE((void *) shader-base.tokens);
FREE(shader);
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.h 
b/src/gallium/drivers/llvmpipe/lp_state_fs.h
index 2914e7d..4999b8d 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.h
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.h
@@ -100,6 +100,8 @@ struct lp_fragment_shader
 
struct lp_fs_variant_list_item variants;
 
+   struct draw_fragment_shader *draw_data;
+
/* For debugging/profiling purposes */
unsigned variant_key_size;
unsigned no;

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


Mesa (sprite-coord): llvmpipe: indentation fix

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: sprite-coord
Commit: ebba92875aca586b661f6547888a2ed95e70e0ff
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ebba92875aca586b661f6547888a2ed95e70e0ff

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 12:55:29 2010 -0600

llvmpipe: indentation fix

---

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

diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c 
b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
index 0bad732..b81c2cf 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
@@ -79,7 +79,7 @@ llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, 
void *handle)
llvmpipe-rasterizer-point_size,
llvmpipe-rasterizer-point_size_per_vertex,
llvmpipe-rasterizer-sprite_coord_enable);
-   }
+   }
 
llvmpipe-dirty |= LP_NEW_RASTERIZER;
 }

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


Mesa (sprite-coord): llvmpipe: reformatting, remove trailing whitespace, etc

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: sprite-coord
Commit: 924c18da95bbc62492f8e54bd8273a4981a919dc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=924c18da95bbc62492f8e54bd8273a4981a919dc

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 13:07:59 2010 -0600

llvmpipe: reformatting, remove trailing whitespace, etc

---

 src/gallium/drivers/llvmpipe/lp_setup_point.c |   44 +
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c 
b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index 5538987..5521cbb 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -52,26 +52,29 @@ struct point_info {
 /**
  * Compute a0 for a constant-valued coefficient (GL_FLAT shading).
  */
-static void constant_coef( struct lp_setup_context *setup,
-   struct lp_rast_triangle *point,
-   unsigned slot,
-   const float value,
-   unsigned i )
+static void
+constant_coef(struct lp_setup_context *setup,
+  struct lp_rast_triangle *point,
+  unsigned slot,
+  const float value,
+  unsigned i)
 {
point-inputs.a0[slot][i] = value;
point-inputs.dadx[slot][i] = 0.0f;
point-inputs.dady[slot][i] = 0.0f;
 }
 
-static void perspective_coef( struct lp_setup_context *setup,
-  struct lp_rast_triangle *point,
-  const struct point_info *info,
-  unsigned slot,
-  unsigned vert_attr,
-  unsigned i)
+
+static void
+perspective_coef(struct lp_setup_context *setup,
+ struct lp_rast_triangle *point,
+ const struct point_info *info,
+ unsigned slot,
+ unsigned vert_attr,
+ unsigned i)
 {
-   if (i == 0) {   
-  float dadx = FIXED_ONE / (float)info-dx12;  
+   if (i == 0) {
+  float dadx = FIXED_ONE / (float)info-dx12;
   float dady =  0.0f;
   point-inputs.dadx[slot][i] = dadx;
   point-inputs.dady[slot][i] = dady;
@@ -79,30 +82,26 @@ static void perspective_coef( struct lp_setup_context 
*setup,
   (dadx * ((float)info-v0[0][0] - 
setup-pixel_offset) +
dady * ((float)info-v0[0][1] - 
setup-pixel_offset)));
}
-
else if (i == 1) {
-  float dadx =  0.0f; 
+  float dadx =  0.0f;
   float dady =  FIXED_ONE / (float)info-dx12;
-   
+
   point-inputs.dadx[slot][i] = dadx;
   point-inputs.dady[slot][i] = dady;
   point-inputs.a0[slot][i] = (0.5 -
   (dadx * ((float)info-v0[0][0] - 
setup-pixel_offset) +
dady * ((float)info-v0[0][1] - 
setup-pixel_offset)));
}
-
else if (i == 2) {
   point-inputs.a0[slot][i] = 0.0f;
   point-inputs.dadx[slot][i] = 0.0f;
   point-inputs.dady[slot][i] = 0.0f;
}
-  
else if (i == 3) {
   point-inputs.a0[slot][i] = 1.0f;
   point-inputs.dadx[slot][i] = 0.0f;
   point-inputs.dady[slot][i] = 0.0f;
}
-
 }
 
 
@@ -144,6 +143,7 @@ setup_point_fragcoord_coef(struct lp_setup_context *setup,
}
 }
 
+
 /**
  * Compute the point-coef[] array dadx, dady, a0 values.
  */
@@ -203,6 +203,7 @@ setup_point_coefficients( struct lp_setup_context *setup,
   fragcoord_usage_mask);
 }
 
+
 static INLINE int
 subpixel_snap(float a)
 {
@@ -322,8 +323,9 @@ try_setup_point( struct lp_setup_context *setup,
 }
 
 
-static void lp_setup_point( struct lp_setup_context *setup,
-   const float (*v0)[4] )
+static void 
+lp_setup_point(struct lp_setup_context *setup,
+   const float (*v0)[4])
 {
if (!try_setup_point( setup, v0 ))
{

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


Mesa (sprite-coord): llvmpipe: clean-up, comments in setup_point_coefficient()

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: sprite-coord
Commit: b7a5eac1f3723a369885bad369a04c456bdf1565
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7a5eac1f3723a369885bad369a04c456bdf1565

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 13:26:27 2010 -0600

llvmpipe: clean-up, comments in setup_point_coefficient()

---

 src/gallium/drivers/llvmpipe/lp_setup_point.c |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c 
b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index 5521cbb..fb4fb2c 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -152,6 +152,7 @@ setup_point_coefficients( struct lp_setup_context *setup,
   struct lp_rast_triangle *point,
   const struct point_info *info)
 {
+   const struct lp_fragment_shader *shader = setup-fs.current.variant-shader;
unsigned fragcoord_usage_mask = TGSI_WRITEMASK_XYZ;
unsigned slot;
 
@@ -172,12 +173,16 @@ setup_point_coefficients( struct lp_setup_context *setup,
  fragcoord_usage_mask |= usage_mask;
  break;
 
+  case LP_INTERP_LINEAR:
+ /* Sprite tex coords may use linear interpolation someday */
+ /* fall-through */
+
   case LP_INTERP_PERSPECTIVE:
- /* For point sprite textures */
- if (setup-fs.current.variant-shader-info.input_semantic_name[slot] 
- == TGSI_SEMANTIC_GENERIC) 
- {
-int index = 
setup-fs.current.variant-shader-info.input_semantic_index[slot];
+ /* check if the sprite coord flag is set for this attribute.
+  * If so, set it up so it up so x any y vary from 0 to 1.
+  */
+ if (shader-info.input_semantic_name[slot] == TGSI_SEMANTIC_GENERIC) {
+const int index = shader-info.input_semantic_index[slot];
 
 if (setup-sprite  (1  index)) {
for (i = 0; i  NUM_CHANNELS; i++)

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


Mesa (sprite-coord): llvmpipe: rename sprite field, add sprite_coord_origin

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: sprite-coord
Commit: c3982c6bcdeb88f7fb1b20f8bd300db31cd7288d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3982c6bcdeb88f7fb1b20f8bd300db31cd7288d

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 13:29:55 2010 -0600

llvmpipe: rename sprite field, add sprite_coord_origin

---

 src/gallium/drivers/llvmpipe/lp_setup.c|6 --
 src/gallium/drivers/llvmpipe/lp_setup.h|3 ++-
 src/gallium/drivers/llvmpipe/lp_setup_context.h|2 +-
 src/gallium/drivers/llvmpipe/lp_setup_point.c  |2 +-
 src/gallium/drivers/llvmpipe/lp_state_rasterizer.c |3 ++-
 5 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c 
b/src/gallium/drivers/llvmpipe/lp_setup.c
index 6674d28..ea7002a 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -490,12 +490,14 @@ void
 lp_setup_set_point_state( struct lp_setup_context *setup,
   float point_size,  
   boolean point_size_per_vertex,
-  uint sprite)
+  uint sprite_coord_enable,
+  uint sprite_coord_origin)
 {
LP_DBG(DEBUG_SETUP, %s\n, __FUNCTION__);
 
setup-point_size = point_size;
-   setup-sprite = sprite;
+   setup-sprite_coord_enable = sprite_coord_enable;
+   setup-sprite_coord_origin = sprite_coord_origin;
setup-point_size_per_vertex = point_size_per_vertex;
 }
 
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h 
b/src/gallium/drivers/llvmpipe/lp_setup.h
index b94061b..81ff43f 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup.h
@@ -107,7 +107,8 @@ void
 lp_setup_set_point_state( struct lp_setup_context *setup,
   float point_size,  
   boolean point_size_per_vertex,
-  uint sprite);
+  uint sprite_coord_enable,
+  uint sprite_coord_origin);
 
 void
 lp_setup_set_fs_inputs( struct lp_setup_context *setup,
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h 
b/src/gallium/drivers/llvmpipe/lp_setup_context.h
index 80b3564..8506ed2 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h
@@ -73,7 +73,7 @@ struct lp_setup_context
uint prim;
uint vertex_size;
uint nr_vertices;
-   uint sprite;
+   uint sprite_coord_enable, sprite_coord_origin;
uint vertex_buffer_size;
void *vertex_buffer;
 
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c 
b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index fb4fb2c..f8f411f 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -184,7 +184,7 @@ setup_point_coefficients( struct lp_setup_context *setup,
  if (shader-info.input_semantic_name[slot] == TGSI_SEMANTIC_GENERIC) {
 const int index = shader-info.input_semantic_index[slot];
 
-if (setup-sprite  (1  index)) {
+if (setup-sprite_coord_enable  (1  index)) {
for (i = 0; i  NUM_CHANNELS; i++)
   if (usage_mask  (1  i))
  perspective_coef(setup, point, info, slot+1, vert_attr, 
i);
diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c 
b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
index b81c2cf..dbd7381 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
@@ -78,7 +78,8 @@ llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, 
void *handle)
   lp_setup_set_point_state( llvmpipe-setup,
llvmpipe-rasterizer-point_size,
llvmpipe-rasterizer-point_size_per_vertex,
-   llvmpipe-rasterizer-sprite_coord_enable);
+   llvmpipe-rasterizer-sprite_coord_enable,
+   llvmpipe-rasterizer-sprite_coord_mode);
}
 
llvmpipe-dirty |= LP_NEW_RASTERIZER;

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


Mesa (sprite-coord): llvmpipe: implement sprite coord origin modes

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: sprite-coord
Commit: 61fcd9aaa2bf91eb400eeb4df2ab2c7e48b3bb6c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=61fcd9aaa2bf91eb400eeb4df2ab2c7e48b3bb6c

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 13:48:02 2010 -0600

llvmpipe: implement sprite coord origin modes

---

 src/gallium/drivers/llvmpipe/lp_setup_point.c |   18 --
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c 
b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index f8f411f..bb6b880 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -71,7 +71,8 @@ perspective_coef(struct lp_setup_context *setup,
  const struct point_info *info,
  unsigned slot,
  unsigned vert_attr,
- unsigned i)
+ unsigned i,
+ unsigned sprite_coord_origin)
 {
if (i == 0) {
   float dadx = FIXED_ONE / (float)info-dx12;
@@ -83,14 +84,18 @@ perspective_coef(struct lp_setup_context *setup,
dady * ((float)info-v0[0][1] - 
setup-pixel_offset)));
}
else if (i == 1) {
-  float dadx =  0.0f;
-  float dady =  FIXED_ONE / (float)info-dx12;
+  float dadx = 0.0f;
+  float dady = FIXED_ONE / (float)info-dx12;
+
+  if (sprite_coord_origin == PIPE_SPRITE_COORD_LOWER_LEFT) {
+ dady = -dady;
+  }
 
   point-inputs.dadx[slot][i] = dadx;
   point-inputs.dady[slot][i] = dady;
   point-inputs.a0[slot][i] = (0.5 -
-  (dadx * ((float)info-v0[0][0] - 
setup-pixel_offset) +
-   dady * ((float)info-v0[0][1] - 
setup-pixel_offset)));
+   (dadx * ((float)info-v0[0][0] - 
setup-pixel_offset) +
+dady * ((float)info-v0[0][1] - 
setup-pixel_offset)));
}
else if (i == 2) {
   point-inputs.a0[slot][i] = 0.0f;
@@ -187,7 +192,8 @@ setup_point_coefficients( struct lp_setup_context *setup,
 if (setup-sprite_coord_enable  (1  index)) {
for (i = 0; i  NUM_CHANNELS; i++)
   if (usage_mask  (1  i))
- perspective_coef(setup, point, info, slot+1, vert_attr, 
i);
+ perspective_coef(setup, point, info, slot+1, vert_attr, i,
+  setup-sprite_coord_origin);
fragcoord_usage_mask |= TGSI_WRITEMASK_W;
break; 
 }

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


Mesa (sprite-coord): draw: fix test for using the wide-point stage

2010-09-20 Thread Brian Paul
Module: Mesa
Branch: sprite-coord
Commit: a7ea4d11fb5a2a39daaad8752706291ac93013f7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7ea4d11fb5a2a39daaad8752706291ac93013f7

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 20 13:48:29 2010 -0600

draw: fix test for using the wide-point stage

As it was, we weren't obeying the draw-pipeline.point_sprite state.
Fixes point sprites in llvmpipe driver.

---

 src/gallium/auxiliary/draw/draw_pipe_validate.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_validate.c 
b/src/gallium/auxiliary/draw/draw_pipe_validate.c
index 8b92543..c575a8a 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_validate.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_validate.c
@@ -172,7 +172,7 @@ static struct draw_stage *validate_pipeline( struct 
draw_stage *stage )
wide_lines = (rast-line_width  draw-pipeline.wide_line_threshold
   !rast-line_smooth);
 
-   /* drawing large points? */
+   /* drawing large/sprite points (but not AA points)? */
if (rast-sprite_coord_enable  draw-pipeline.point_sprite)
   wide_points = TRUE;
else if (rast-point_smooth  draw-pipeline.aapoint)
@@ -207,7 +207,7 @@ static struct draw_stage *validate_pipeline( struct 
draw_stage *stage )
   precalc_flat = TRUE;
}
 
-   if (wide_points || rast-sprite_coord_enable) {
+   if (wide_points) {
   draw-pipeline.wide_point-next = next;
   next = draw-pipeline.wide_point;
}

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


Mesa (master): r600g: add back reference check when mapping buffer

2010-09-20 Thread Jerome Glisse
Module: Mesa
Branch: master
Commit: 4fc5050f82a6b59a86370f44c64e7592ff621f6f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4fc5050f82a6b59a86370f44c64e7592ff621f6f

Author: Jerome Glisse jgli...@redhat.com
Date:   Mon Sep 20 17:21:37 2010 -0400

r600g: add back reference check when mapping buffer

Signed-off-by: Jerome Glisse jgli...@redhat.com

---

 src/gallium/targets/dri-r600/target.c  |2 +-
 src/gallium/winsys/r600/drm/radeon_bo_pb.c |   13 +++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/gallium/targets/dri-r600/target.c 
b/src/gallium/targets/dri-r600/target.c
index eb268d5..2c1b2f5 100644
--- a/src/gallium/targets/dri-r600/target.c
+++ b/src/gallium/targets/dri-r600/target.c
@@ -4,7 +4,7 @@
 #include r600/drm/r600_drm_public.h
 #include r600/r600_public.h
 
-#if 1
+#if 0
 static struct pipe_screen *
 create_screen(int fd)
 {
diff --git a/src/gallium/winsys/r600/drm/radeon_bo_pb.c 
b/src/gallium/winsys/r600/drm/radeon_bo_pb.c
index 148cf6d..897938c 100644
--- a/src/gallium/winsys/r600/drm/radeon_bo_pb.c
+++ b/src/gallium/winsys/r600/drm/radeon_bo_pb.c
@@ -55,7 +55,6 @@ radeon_bo_pb_map_internal(struct pb_buffer *_buf,
struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
struct pipe_context *pctx = ctx;
 
-//printf(%s:%d \n, __func__, 
__LINE__);
if (flags  PB_USAGE_UNSYNCHRONIZED) {
if (!buf-bo-data  radeon_bo_map(buf-mgr-radeon, buf-bo)) 
{
return NULL;
@@ -64,11 +63,13 @@ radeon_bo_pb_map_internal(struct pb_buffer *_buf,
return buf-bo-data;
}
 
-   if (flags  PB_USAGE_DONTBLOCK) {
-   return NULL;
-   }
-   if (ctx) {
-   pctx-flush(pctx, 0, NULL);
+   if (p_atomic_read(buf-bo-reference.count)  1) {
+   if (flags  PB_USAGE_DONTBLOCK) {
+   return NULL;
+   }
+   if (ctx) {
+   pctx-flush(pctx, 0, NULL);
+   }
}
 
if (flags  PB_USAGE_DONTBLOCK) {

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


Demos (master): pointcoord: use 'o' key to toggle point sprite origin

2010-09-20 Thread Brian Paul
Module: Demos
Branch: master
Commit: feb52054aa9078e701727c7edfad5d4fd1f99ceb
URL:
http://cgit.freedesktop.org/mesa/demos/commit/?id=feb52054aa9078e701727c7edfad5d4fd1f99ceb

Author: Brian Paul bri...@vmware.com
Date:   Fri Sep 17 10:41:55 2010 -0600

pointcoord: use 'o' key to toggle point sprite origin

---

 src/glsl/pointcoord.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/glsl/pointcoord.c b/src/glsl/pointcoord.c
index 5dced6f..00b91f4 100644
--- a/src/glsl/pointcoord.c
+++ b/src/glsl/pointcoord.c
@@ -24,11 +24,17 @@ static GLuint program;
 static GLint win = 0;
 static GLint tex0;
 static GLenum Filter = GL_NEAREST;
+static GLenum Origin = GL_UPPER_LEFT;
 
 
 static void
 Redisplay(void)
 {
+   printf(GL_POINT_SPRITE_COORD_ORIGIN = %s\n,
+  (Origin == GL_UPPER_LEFT ? GL_UPPER_LEFT : GL_LOWER_LEFT));
+
+   glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, Origin);
+
glClear(GL_COLOR_BUFFER_BIT);
 
/* draw one point/sprite */
@@ -76,6 +82,13 @@ Key(unsigned char key, int x, int y)
   (void) y;
 
switch(key) {
+   case 'o':
+   case 'O':
+  if (Origin == GL_UPPER_LEFT)
+ Origin = GL_LOWER_LEFT;
+  else
+ Origin = GL_UPPER_LEFT;
+  break;
case 27:
   CleanUp();
   exit(0);

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


Mesa (master): Fix typos in comments and debug output strings.

2010-09-20 Thread Eric Anholt
Module: Mesa
Branch: master
Commit: 99907303f6a1e9abe02977664ad8457c122213ce
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=99907303f6a1e9abe02977664ad8457c122213ce

Author: Timo Wiren timo.wi...@gmail.com
Date:   Mon Sep 20 15:27:34 2010 -0700

Fix typos in comments and debug output strings.

Bug #30208.

---

 src/mesa/drivers/dri/common/vblank.c   |2 +-
 src/mesa/drivers/dri/common/xmlconfig.c|8 
 src/mesa/drivers/dri/intel/intel_context.c |2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/common/vblank.c 
b/src/mesa/drivers/dri/common/vblank.c
index 49b22a2..cb98dd0 100644
--- a/src/mesa/drivers/dri/common/vblank.c
+++ b/src/mesa/drivers/dri/common/vblank.c
@@ -241,7 +241,7 @@ GLuint driGetDefaultVBlankFlags( const driOptionCache 
*optionCache )
  * the first time the \c drmWaitVBlank fails.  If \c drmWaitVBlank is
  * successful, \c vbl_seq will be set the sequence value in the reply.
  *
- * \param vbl  Pointer to drmVBlank packet desribing how to wait.
+ * \param vbl  Pointer to drmVBlank packet describing how to wait.
  * \param vbl_seq  Location to store the current refresh counter.
  * \param fd   File descriptor use to call into the DRM.
  * \return Zero on success or -1 on failure.
diff --git a/src/mesa/drivers/dri/common/xmlconfig.c 
b/src/mesa/drivers/dri/common/xmlconfig.c
index 738b1ae..bde6b23 100644
--- a/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/src/mesa/drivers/dri/common/xmlconfig.c
@@ -206,7 +206,7 @@ static GLint strToI (const XML_Char *string, const XML_Char 
**tail, int base) {
  *
  * Works similar to strtod. Leading space is NOT skipped. The input
  * number may have an optional sign. '.' is interpreted as decimal
- * point and may occor at most once. Optionally the number may end in
+ * point and may occur at most once. Optionally the number may end in
  * [eE]exponent, where exponent is an integer as recognized by
  * strToI. In that case the result is number * 10^exponent. After
  * returning tail points to the first character that is not part of
@@ -728,7 +728,7 @@ static void parseDeviceAttr (struct OptConfData *data, 
const XML_Char **attr) {
 for (i = 0; attr[i]; i += 2) {
if (!strcmp (attr[i], driver)) driver = attr[i+1];
else if (!strcmp (attr[i], screen)) screen = attr[i+1];
-   else XML_WARNING(unkown device attribute: %s., attr[i]);
+   else XML_WARNING(unknown device attribute: %s., attr[i]);
 }
 if (driver  strcmp (driver, data-driverName))
data-ignoringDevice = data-inDevice;
@@ -748,7 +748,7 @@ static void parseAppAttr (struct OptConfData *data, const 
XML_Char **attr) {
 for (i = 0; attr[i]; i += 2) {
if (!strcmp (attr[i], name)) name = attr[i+1];
else if (!strcmp (attr[i], executable)) exec = attr[i+1];
-   else XML_WARNING(unkown application attribute: %s., attr[i]);
+   else XML_WARNING(unknown application attribute: %s., attr[i]);
 }
 if (exec  strcmp (exec, data-execName))
data-ignoringApp = data-inApp;
@@ -761,7 +761,7 @@ static void parseOptConfAttr (struct OptConfData *data, 
const XML_Char **attr) {
 for (i = 0; attr[i]; i += 2) {
if (!strcmp (attr[i], name)) name = attr[i+1];
else if (!strcmp (attr[i], value)) value = attr[i+1];
-   else XML_WARNING(unkown option attribute: %s., attr[i]);
+   else XML_WARNING(unknown option attribute: %s., attr[i]);
 }
 if (!name) XML_WARNING1 (name attribute missing in option.);
 if (!value) XML_WARNING1 (value attribute missing in option.);
diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index 08069d7..109c670 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -354,7 +354,7 @@ intel_update_renderbuffers(__DRIcontext *context, 
__DRIdrawable *drawable)
case __DRI_BUFFER_ACCUM:
default:
   fprintf(stderr,
-  unhandled buffer attach event, attacment type %d\n,
+  unhandled buffer attach event, attachment type %d\n,
   buffers[i].attachment);
   return;
}

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


Mesa (master): tgsi: Don' t ignore indirect registers in tgsi_check_soa_dependencies

2010-09-20 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: c66f0c46297996613fa8271925e37e594cf5d16b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c66f0c46297996613fa8271925e37e594cf5d16b

Author: José Fonseca jfons...@vmware.com
Date:   Tue Sep 21 02:16:19 2010 +0200

tgsi: Don't ignore indirect registers in tgsi_check_soa_dependencies

NOTE: This is a candidate for the 7.9 branch.

---

 src/gallium/auxiliary/tgsi/tgsi_exec.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c 
b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 0757f05..3a71540 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -605,8 +605,10 @@ tgsi_check_soa_dependencies(const struct 
tgsi_full_instruction *inst)
for (i = 0; i  inst-Instruction.NumSrcRegs; i++) {
   if ((inst-Src[i].Register.File ==
inst-Dst[0].Register.File) 
-  (inst-Src[i].Register.Index ==
-   inst-Dst[0].Register.Index)) {
+  ((inst-Src[i].Register.Index ==
+inst-Dst[0].Register.Index) ||
+  inst-Src[i].Register.Indirect ||
+  inst-Dst[0].Register.Indirect)) {
  /* loop over dest channels */
  uint channelsWritten = 0x0;
  FOR_EACH_ENABLED_CHANNEL(*inst, chan) {

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


Mesa (master): tgsi: Actually care what check_soa_dependencies says

2010-09-20 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: d21301675c249602e19310d5b62fad424f2f2ac2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d21301675c249602e19310d5b62fad424f2f2ac2

Author: Jakob Bornecrantz wallbra...@gmail.com
Date:   Tue Sep 21 02:16:31 2010 +0200

tgsi: Actually care what check_soa_dependencies says

Thanks to José for the more complete list of supported opcodes.

NOTE: This is a candidate for the 7.9 branch.

---

 src/gallium/auxiliary/tgsi/tgsi_sse2.c |   56 ++--
 1 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c 
b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
index 13e2e8e..83a6d75 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
@@ -2830,31 +2830,53 @@ static void soa_to_aos( struct x86_function *func,
  * Check if the instructions dst register is the same as any src
  * register and warn if there's a posible SOA dependency.
  */
-static void
+static boolean
 check_soa_dependencies(const struct tgsi_full_instruction *inst)
 {
-   switch (inst-Instruction.Opcode) {
+   uint opcode = inst-Instruction.Opcode;
+
+   /* XXX: we only handle src/dst aliasing in a few opcodes currently.
+* Need to use an additional temporay to hold the result in the
+* cases where the code is too opaque to fix.
+*/
+
+   switch (opcode) {
case TGSI_OPCODE_ADD:
case TGSI_OPCODE_MOV:
case TGSI_OPCODE_MUL:
case TGSI_OPCODE_XPD:
+   case TGSI_OPCODE_RCP:
+   case TGSI_OPCODE_RSQ:
+   case TGSI_OPCODE_EXP:
+   case TGSI_OPCODE_LOG:
+   case TGSI_OPCODE_DP3:
+   case TGSI_OPCODE_DP4:
+   case TGSI_OPCODE_DP2A:
+   case TGSI_OPCODE_EX2:
+   case TGSI_OPCODE_LG2:
+   case TGSI_OPCODE_POW:
+   case TGSI_OPCODE_XPD:
+   case TGSI_OPCODE_DPH:
+   case TGSI_OPCODE_COS:
+   case TGSI_OPCODE_SIN:
+   case TGSI_OPCODE_TEX:
+   case TGSI_OPCODE_TXB:
+   case TGSI_OPCODE_TXP:
+   case TGSI_OPCODE_NRM:
+   case TGSI_OPCODE_NRM4:
+   case TGSI_OPCODE_DP2:
   /* OK - these opcodes correctly handle SOA dependencies */
-  break;
+  return TRUE;
default:
-  if (tgsi_check_soa_dependencies(inst)) {
- uint opcode = inst-Instruction.Opcode;
+  if (!tgsi_check_soa_dependencies(inst))
+ return TRUE;
 
- /* XXX: we only handle src/dst aliasing in a few opcodes
-  * currently.  Need to use an additional temporay to hold
-  * the result in the cases where the code is too opaque to
-  * fix.
-  */
- if (opcode != TGSI_OPCODE_MOV) {
-debug_printf(Warning: src/dst aliasing in instruction
-  is not handled:\n);
-tgsi_dump_instruction(inst, 1);
- }
-  }
+  debug_printf(Warning: src/dst aliasing in instruction
+is not handled:\n);
+  debug_printf(Warning: );
+  tgsi_dump_instruction(inst, 1);
+
+  return FALSE;
}
 }
 
@@ -2954,7 +2976,7 @@ tgsi_emit_sse2(
  tgsi_get_processor_name(proc));
 }
 
- check_soa_dependencies(parse.FullToken.FullInstruction);
+ ok = check_soa_dependencies(parse.FullToken.FullInstruction);
  break;
 
   case TGSI_TOKEN_TYPE_IMMEDIATE:

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


Mesa (master): dri/nv04: Use nvgl_wrap_mode().

2010-09-20 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: 72e5fd5c02cb745d95f11573e7119ad1ba4bc1a8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=72e5fd5c02cb745d95f11573e7119ad1ba4bc1a8

Author: Francisco Jerez curroje...@riseup.net
Date:   Fri Sep 17 15:03:14 2010 +0200

dri/nv04: Use nvgl_wrap_mode().

---

 src/mesa/drivers/dri/nouveau/nv04_state_tex.c |   22 ++
 1 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c 
b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
index 4ac8327..b720089 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
@@ -55,24 +55,6 @@ get_tex_format(struct gl_texture_image *ti)
}
 }
 
-static inline unsigned
-get_wrap_mode(unsigned wrap)
-{
-   switch (wrap) {
-   case GL_REPEAT:
-   return 0x1;
-   case GL_MIRRORED_REPEAT:
-   return 0x2;
-   case GL_CLAMP:
-   case GL_CLAMP_TO_EDGE:
-   return 0x3;
-   case GL_CLAMP_TO_BORDER:
-   return 0x4;
-   default:
-   assert(0);
-   }
-}
-
 void
 nv04_emit_tex_obj(GLcontext *ctx, int emit)
 {
@@ -106,8 +88,8 @@ nv04_emit_tex_obj(GLcontext *ctx, int emit)
 t-LodBias, -16, 15) * 8;
}
 
-   format |= get_wrap_mode(t-WrapT)  28 |
-   get_wrap_mode(t-WrapS)  24 |
+   format |= nvgl_wrap_mode(t-WrapT)  28 |
+   nvgl_wrap_mode(t-WrapS)  24 |
ti-HeightLog2  20 |
ti-WidthLog2  16 |
lod_max  12 |

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


Mesa (master): dri/nouveau: Remove unnecessary assertion.

2010-09-20 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: 13c246bceafd356959daff3d9872ffb0549c531a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=13c246bceafd356959daff3d9872ffb0549c531a

Author: Francisco Jerez curroje...@riseup.net
Date:   Fri Sep 17 15:25:03 2010 +0200

dri/nouveau: Remove unnecessary assertion.

---

 src/mesa/drivers/dri/nouveau/nv04_surface.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c 
b/src/mesa/drivers/dri/nouveau/nv04_surface.c
index 9e7dcf0..ce01036 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c
@@ -214,11 +214,6 @@ nv04_surface_copy_swizzle(GLcontext *ctx,
assert(_mesa_is_pow_two(dst-width) 
   _mesa_is_pow_two(dst-height));
 
-/* If area is too large to copy in one shot we must copy it in
-* POT chunks to meet alignment requirements */
-   assert(sub_w == w || _mesa_is_pow_two(w));
-   assert(sub_h == h || _mesa_is_pow_two(h));
-
nouveau_bo_marko(bctx, sifm, NV03_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE,
 src-bo, bo_flags | NOUVEAU_BO_RD);
nouveau_bo_marko(bctx, swzsurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE,

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


Mesa (master): dri/nouveau: Cleanup more references to old FBOs and VBOs.

2010-09-20 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: 22c83ac47a50ed1fdab59476886a7e56910a653a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=22c83ac47a50ed1fdab59476886a7e56910a653a

Author: Francisco Jerez curroje...@riseup.net
Date:   Fri Sep 17 16:35:49 2010 +0200

dri/nouveau: Cleanup more references to old FBOs and VBOs.

---

 src/mesa/drivers/dri/nouveau/nouveau_context.c |7 +++
 src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c   |1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c 
b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index eff1016..0fecdee 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -262,7 +262,10 @@ update_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable 
*draw,
nouveau_update_renderbuffers(dri_ctx, draw);
_mesa_resize_framebuffer(ctx, fb, draw-w, draw-h);
 
+   /* Clean up references to the old framebuffer objects. */
context_dirty(ctx, FRAMEBUFFER);
+   context_bctx(ctx, FRAMEBUFFER);
+   FIRE_RING(context_chan(ctx));
 }
 
 GLboolean
@@ -283,10 +286,6 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, 
__DRIdrawable *dri_draw,
update_framebuffer(dri_ctx, dri_read,
   dri_ctx-dri2.read_stamp);
 
-   /* Clean up references to the old framebuffer objects. */
-   context_bctx(ctx, FRAMEBUFFER);
-   FIRE_RING(context_chan(ctx));
-
/* Pass it down to mesa. */
_mesa_make_current(ctx, dri_draw-driverPrivate,
   dri_read-driverPrivate);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c 
b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
index e5858f8..e4415cb 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
@@ -143,6 +143,7 @@ vbo_deinit_arrays(GLcontext *ctx, const struct 
_mesa_index_buffer *ib,
}
 
render-attr_count = 0;
+   context_bctx(ctx, VERTEX);
 }
 
 /* Make some rendering decisions from the GL context. */

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


Mesa (master): dri/nv10-nv20: Fix texturing in some cases after a base level change.

2010-09-20 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: 98add55fffc29e0c40859fd5e9cec47fa1e352f5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=98add55fffc29e0c40859fd5e9cec47fa1e352f5

Author: Francisco Jerez curroje...@riseup.net
Date:   Fri Sep 17 20:56:48 2010 +0200

dri/nv10-nv20: Fix texturing in some cases after a base level change.

---

 src/mesa/drivers/dri/nouveau/nouveau_texture.c |   17 -
 src/mesa/drivers/dri/nouveau/nv10_state_tex.c  |2 +-
 src/mesa/drivers/dri/nouveau/nv20_state_tex.c  |2 +-
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c 
b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index d86f78b..b2f6faf 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -178,7 +178,7 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint 
internalFormat,
 }
 
 static GLboolean
-teximage_fits(GLcontext *ctx, struct gl_texture_object *t, int level)
+teximage_fits(struct gl_texture_object *t, int level)
 {
struct nouveau_surface *s = to_nouveau_texture(t)-surfaces[level];
struct gl_texture_image *ti = t-Image[0][level];
@@ -186,8 +186,7 @@ teximage_fits(GLcontext *ctx, struct gl_texture_object *t, 
int level)
if (!ti || !to_nouveau_teximage(ti)-surface.bo)
return GL_FALSE;
 
-   if (context_chipset(ctx)  0x10 
-   level == t-BaseLevel  (s-offset  0x7f))
+   if (level == t-BaseLevel  (s-offset  0x7f))
return GL_FALSE;
 
return t-Target == GL_TEXTURE_RECTANGLE ||
@@ -202,7 +201,7 @@ validate_teximage(GLcontext *ctx, struct gl_texture_object 
*t,
 {
struct gl_texture_image *ti = t-Image[0][level];
 
-   if (teximage_fits(ctx, t, level)) {
+   if (teximage_fits(t, level)) {
struct nouveau_surface *ss = to_nouveau_texture(t)-surfaces;
struct nouveau_surface *s = to_nouveau_teximage(ti)-surface;
 
@@ -290,8 +289,8 @@ nouveau_texture_validate(GLcontext *ctx, struct 
gl_texture_object *t)
struct nouveau_texture *nt = to_nouveau_texture(t);
int i, last = get_last_level(t);
 
-   if (!teximage_fits(ctx, t, t-BaseLevel) ||
-   !teximage_fits(ctx, t, last))
+   if (!teximage_fits(t, t-BaseLevel) ||
+   !teximage_fits(t, last))
return GL_FALSE;
 
if (nt-dirty) {
@@ -314,8 +313,8 @@ nouveau_texture_validate(GLcontext *ctx, struct 
gl_texture_object *t)
 void
 nouveau_texture_reallocate(GLcontext *ctx, struct gl_texture_object *t)
 {
-   if (!teximage_fits(ctx, t, t-BaseLevel) ||
-   !teximage_fits(ctx, t, get_last_level(t))) {
+   if (!teximage_fits(t, t-BaseLevel) ||
+   !teximage_fits(t, get_last_level(t))) {
texture_dirty(t);
relayout_texture(ctx, t);
nouveau_texture_validate(ctx, t);
@@ -377,7 +376,7 @@ nouveau_teximage(GLcontext *ctx, GLint dims, GLenum target, 
GLint level,
}
 
if (level == t-BaseLevel) {
-   if (!teximage_fits(ctx, t, level))
+   if (!teximage_fits(t, level))
relayout_texture(ctx, t);
nouveau_texture_validate(ctx, t);
}
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c 
b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
index 6dedb18..6961ccb 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
@@ -225,7 +225,7 @@ nv10_emit_tex_obj(GLcontext *ctx, int emit)
bo_flags | NOUVEAU_BO_OR);
 
nouveau_bo_markl(bctx, celsius, NV10TCL_TX_OFFSET(i),
-s-bo, 0, bo_flags);
+s-bo, s-offset, bo_flags);
 
BEGIN_RING(chan, celsius, NV10TCL_TX_FILTER(i), 1);
OUT_RING(chan, tx_filter);
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c 
b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
index 2d45513..ea6b9b9 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
@@ -236,7 +236,7 @@ nv20_emit_tex_obj(GLcontext *ctx, int emit)
bo_flags | NOUVEAU_BO_OR);
 
nouveau_bo_markl(bctx, kelvin, NV20TCL_TX_OFFSET(i),
-s-bo, 0, bo_flags);
+s-bo, s-offset, bo_flags);
 
BEGIN_RING(chan, kelvin, NV20TCL_TX_WRAP(i), 1);
OUT_RING(chan, tx_wrap);

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


Mesa (master): dri/nouveau: Fix software mipmap generation on 1x1 textures.

2010-09-20 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: bf8f24c1c84ab39207301ae5d298850d72e11876
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf8f24c1c84ab39207301ae5d298850d72e11876

Author: Francisco Jerez curroje...@riseup.net
Date:   Fri Sep 17 20:58:43 2010 +0200

dri/nouveau: Fix software mipmap generation on 1x1 textures.

---

 src/mesa/drivers/dri/nouveau/nouveau_texture.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c 
b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index b2f6faf..14c7b5f 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -603,7 +603,7 @@ store_mipmap(GLcontext *ctx, GLenum target, int first, int 
last,
.BufferObj = ctx-Shared-NullBufferObj,
.Alignment = 1
};
-   GLenum format = t-Image[0][first]-TexFormat;
+   GLenum format = t-Image[0][t-BaseLevel]-TexFormat;
unsigned base_format, type, comps;
int i;
 

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


Mesa (master): tgsi: Remove duplicate case value.

2010-09-20 Thread Vinson Lee
Module: Mesa
Branch: master
Commit: 2491258436a9c404f177c861101f7bcefc8fffb3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2491258436a9c404f177c861101f7bcefc8fffb3

Author: Vinson Lee v...@vmware.com
Date:   Mon Sep 20 18:20:04 2010 -0700

tgsi: Remove duplicate case value.

---

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

diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c 
b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
index 83a6d75..67deffb 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
@@ -2844,7 +2844,6 @@ check_soa_dependencies(const struct tgsi_full_instruction 
*inst)
case TGSI_OPCODE_ADD:
case TGSI_OPCODE_MOV:
case TGSI_OPCODE_MUL:
-   case TGSI_OPCODE_XPD:
case TGSI_OPCODE_RCP:
case TGSI_OPCODE_RSQ:
case TGSI_OPCODE_EXP:

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


Mesa (master): r600g: deal with overflow of VTX/TEX CF clauses.

2010-09-20 Thread Dave Airlie
Module: Mesa
Branch: master
Commit: 8e8b60588b37e2d9cce7c0c04cdae73ce8206d09
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e8b60588b37e2d9cce7c0c04cdae73ce8206d09

Author: Dave Airlie airl...@redhat.com
Date:   Tue Sep 21 11:24:49 2010 +1000

r600g: deal with overflow of VTX/TEX CF clauses.

running piglit's texrect-many caused the vtx to overflow.

---

 src/gallium/drivers/r600/r600_asm.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_asm.c 
b/src/gallium/drivers/r600/r600_asm.c
index 8c01987..dcb1b4f 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -531,7 +531,8 @@ int r600_bc_add_vtx(struct r600_bc *bc, const struct 
r600_bc_vtx *vtx)
/* cf can contains only alu or only vtx or only tex */
if (bc-cf_last == NULL ||
(bc-cf_last-inst != V_SQ_CF_WORD1_SQ_CF_INST_VTX 
-bc-cf_last-inst != V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC)) {
+bc-cf_last-inst != V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC) ||
+bc-force_add_cf) {
r = r600_bc_add_cf(bc);
if (r) {
free(nvtx);
@@ -543,6 +544,8 @@ int r600_bc_add_vtx(struct r600_bc *bc, const struct 
r600_bc_vtx *vtx)
/* each fetch use 4 dwords */
bc-cf_last-ndw += 4;
bc-ndw += 4;
+   if ((bc-ndw / 4)  7)
+   bc-force_add_cf = 1;
return 0;
 }
 
@@ -557,7 +560,8 @@ int r600_bc_add_tex(struct r600_bc *bc, const struct 
r600_bc_tex *tex)
 
/* cf can contains only alu or only vtx or only tex */
if (bc-cf_last == NULL ||
-   bc-cf_last-inst != V_SQ_CF_WORD1_SQ_CF_INST_TEX) {
+   bc-cf_last-inst != V_SQ_CF_WORD1_SQ_CF_INST_TEX ||
+   bc-force_add_cf) {
r = r600_bc_add_cf(bc);
if (r) {
free(ntex);
@@ -569,6 +573,8 @@ int r600_bc_add_tex(struct r600_bc *bc, const struct 
r600_bc_tex *tex)
/* each texture fetch use 4 dwords */
bc-cf_last-ndw += 4;
bc-ndw += 4;
+   if ((bc-ndw / 4)  7)
+   bc-force_add_cf = 1;
return 0;
 }
 

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


Mesa (master): r600g: set back to correct codepaths.

2010-09-20 Thread Dave Airlie
Module: Mesa
Branch: master
Commit: 84997cd5663a2f528c1c8b2c1f7329d546c087be
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=84997cd5663a2f528c1c8b2c1f7329d546c087be

Author: Dave Airlie airl...@redhat.com
Date:   Tue Sep 21 11:32:15 2010 +1000

r600g: set back to correct codepaths.

Jerome please use git diff and git show before pushing.

---

 src/gallium/targets/dri-r600/target.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/targets/dri-r600/target.c 
b/src/gallium/targets/dri-r600/target.c
index 2c1b2f5..eb268d5 100644
--- a/src/gallium/targets/dri-r600/target.c
+++ b/src/gallium/targets/dri-r600/target.c
@@ -4,7 +4,7 @@
 #include r600/drm/r600_drm_public.h
 #include r600/r600_public.h
 
-#if 0
+#if 1
 static struct pipe_screen *
 create_screen(int fd)
 {

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


Mesa (master): r300/compiler: Refactor the pair instruction data structures

2010-09-20 Thread Tom Stellard
Module: Mesa
Branch: master
Commit: 610aed81dbaee73bc2a1fb9a030d7ec0e49e73cb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=610aed81dbaee73bc2a1fb9a030d7ec0e49e73cb

Author: Tom Stellard tstel...@gmail.com
Date:   Thu Sep 16 10:31:19 2010 -0700

r300/compiler: Refactor the pair instruction data structures

Use rc_pair_ prefix for all pair instruction structs

Create a named struct for pair instruction args

Replace structs radeon_pair_instruction_{rgb,alpha} with struct
radeon_pair_sub_instruction.  These two structs were nearly identical
and were creating a lot of cut and paste code.  These changes are the
first step towards removing some of that code.

---

 .../drivers/dri/r300/compiler/r300_fragprog_emit.c |2 +-
 .../drivers/dri/r300/compiler/r500_fragprog_emit.c |2 +-
 .../dri/r300/compiler/radeon_pair_schedule.c   |8 ++--
 .../dri/r300/compiler/radeon_program_pair.h|   47 ++-
 4 files changed, 21 insertions(+), 38 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c 
b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
index 3b2b06f..4f13e51 100644
--- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
@@ -74,7 +74,7 @@ static void use_temporary(struct r300_fragment_program_code 
*code, unsigned int
code-pixsize = index;
 }
 
-static unsigned int use_source(struct r300_fragment_program_code* code, struct 
radeon_pair_instruction_source src)
+static unsigned int use_source(struct r300_fragment_program_code* code, struct 
rc_pair_instruction_source src)
 {
if (src.File == RC_FILE_CONSTANT) {
return src.Index | (1  5);
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 54cff91..bad1684 100644
--- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
@@ -198,7 +198,7 @@ static void use_temporary(struct 
r500_fragment_program_code* code, unsigned int
code-max_temp_idx = index;
 }
 
-static unsigned int use_source(struct r500_fragment_program_code* code, struct 
radeon_pair_instruction_source src)
+static unsigned int use_source(struct r500_fragment_program_code* code, struct 
rc_pair_instruction_source src)
 {
if (src.File == RC_FILE_CONSTANT) {
return src.Index | 0x100;
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c 
b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
index 5269d65..a33b2fd 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
@@ -301,9 +301,9 @@ static int destructive_merge_instructions(
unsigned int arg;
int free_source;
unsigned int one_way = 0;
-   struct radeon_pair_instruction_source srcp =
+   struct rc_pair_instruction_source srcp =
alpha-RGB.Src[srcp_src];
-   struct radeon_pair_instruction_source temp;
+   struct rc_pair_instruction_source temp;
/* 2nd arg of 1 means this is an rgb source.
 * 3rd arg of 0 means this is not an alpha source. */
free_source = rc_pair_alloc_source(rgb, 1, 0,
@@ -366,9 +366,9 @@ static int destructive_merge_instructions(
unsigned int arg;
int free_source;
unsigned int one_way = 0;
-   struct radeon_pair_instruction_source srcp =
+   struct rc_pair_instruction_source srcp =
alpha-Alpha.Src[srcp_src];
-   struct radeon_pair_instruction_source temp;
+   struct rc_pair_instruction_source temp;
/* 2nd arg of 0 means this is not an rgb source.
 * 3rd arg of 1 means this is an alpha source. */
free_source = rc_pair_alloc_source(rgb, 0, 1,
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h 
b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h
index e0061e4..01cdb15 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h
@@ -55,52 +55,35 @@ struct radeon_compiler;
  */
 #define RC_PAIR_PRESUB_SRC 3
 
-struct radeon_pair_instruction_source {
+struct rc_pair_instruction_source {
unsigned int Used:1;
unsigned int File:3;
unsigned int Index:RC_REGISTER_INDEX_BITS;
 };
 
-struct radeon_pair_instruction_rgb {
-   unsigned int Opcode:8;
-   unsigned int DestIndex:RC_REGISTER_INDEX_BITS;
-   unsigned int 

Mesa (master): r600g: fixup evergreen miptree setup.

2010-09-20 Thread Dave Airlie
Module: Mesa
Branch: master
Commit: b6ced8ee7b2c86e94fd7467d12aca5e322048ba4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6ced8ee7b2c86e94fd7467d12aca5e322048ba4

Author: Dave Airlie airl...@redhat.com
Date:   Tue Sep 21 19:57:15 2010 +1000

r600g: fixup evergreen miptree setup.

eg seems to have a higher pitch aligmment requirement and uses r700 cube setup

this fixes a couple of piglit tests here.

---

 src/gallium/drivers/r600/r600_texture.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_texture.c 
b/src/gallium/drivers/r600/r600_texture.c
index abfe406..f60fe9f 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -84,10 +84,13 @@ static void r600_setup_miptree(struct r600_resource_texture 
*rtex, enum chip_cla
h = u_minify(ptex-height0, i);
h = util_next_power_of_two(h);
pitch = util_format_get_stride(ptex-format, align(w, 64));
-   pitch = align(pitch, 256);
+   if (chipc == EVERGREEN)
+   pitch = align(pitch, 512);
+   else
+   pitch = align(pitch, 256);
layer_size = pitch * h;
if (ptex-target == PIPE_TEXTURE_CUBE) {
-   if (chipc == R700)
+   if (chipc = R700)
size = layer_size * 8;
else
size = layer_size * 6;

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


Mesa (master): r600g: fix eg texture borders.

2010-09-20 Thread Dave Airlie
Module: Mesa
Branch: master
Commit: 88934273776242878dbaabdae25a7027fdeaff05
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=88934273776242878dbaabdae25a7027fdeaff05

Author: Dave Airlie airl...@redhat.com
Date:   Tue Sep 21 19:57:58 2010 +1000

r600g: fix eg texture borders.

texture border regs are indexed on evergreen.

---

 src/gallium/drivers/r600/eg_hw_states.c  |1 +
 src/gallium/drivers/r600/eg_states_inc.h |   33 -
 src/gallium/winsys/r600/drm/eg_states.h  |   27 +--
 src/gallium/winsys/r600/drm/r600_state.c |2 +-
 4 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/src/gallium/drivers/r600/eg_hw_states.c 
b/src/gallium/drivers/r600/eg_hw_states.c
index 1d3a3e1..3d10095 100644
--- a/src/gallium/drivers/r600/eg_hw_states.c
+++ b/src/gallium/drivers/r600/eg_hw_states.c
@@ -471,6 +471,7 @@ static void eg_sampler_border(struct r600_context *rctx, 
struct radeon_state *rs
 
radeon_state_init(rstate, rscreen-rw, R600_STATE_SAMPLER_BORDER, id, 
R600_SHADER_PS);
if (uc.ui) {
+   
rstate-states[EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_INDEX] = id;
rstate-states[EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_RED] 
= fui(state-border_color[0]);

rstate-states[EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_GREEN] = 
fui(state-border_color[1]);

rstate-states[EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_BLUE] = 
fui(state-border_color[2]);
diff --git a/src/gallium/drivers/r600/eg_states_inc.h 
b/src/gallium/drivers/r600/eg_states_inc.h
index 462f31c..9f8007c 100644
--- a/src/gallium/drivers/r600/eg_states_inc.h
+++ b/src/gallium/drivers/r600/eg_states_inc.h
@@ -368,27 +368,30 @@
 #define EG_GS_SAMPLER_PM4 128  
 
 /* EG_PS_SAMPLER_BORDER */
-#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_RED0
-#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_GREEN  1
-#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_BLUE   2
-#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_ALPHA  3
-#define EG_PS_SAMPLER_BORDER_SIZE  4
+#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_INDEX  0
+#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_RED1
+#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_GREEN  2
+#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_BLUE   3
+#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_ALPHA  4
+#define EG_PS_SAMPLER_BORDER_SIZE  5
 #define EG_PS_SAMPLER_BORDER_PM4 128   
 
 /* EG_VS_SAMPLER_BORDER */
-#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_RED0
-#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_GREEN  1
-#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_BLUE   2
-#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_ALPHA  3
-#define EG_VS_SAMPLER_BORDER_SIZE  4
+#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_INDEX  0
+#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_RED1
+#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_GREEN  2
+#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_BLUE   3
+#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_ALPHA  4
+#define EG_VS_SAMPLER_BORDER_SIZE  5
 #define EG_VS_SAMPLER_BORDER_PM4 128   
 
 /* EG_GS_SAMPLER_BORDER */
-#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_RED0
-#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_GREEN  1
-#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_BLUE   2
-#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_ALPHA  3
-#define EG_GS_SAMPLER_BORDER_SIZE  4
+#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_INDEX  0
+#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_RED1
+#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_GREEN  2
+#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_BLUE   3
+#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_ALPHA  4
+#define EG_GS_SAMPLER_BORDER_SIZE  5
 #define EG_GS_SAMPLER_BORDER_PM4 128   
 
 /* EG_CB */
diff --git a/src/gallium/winsys/r600/drm/eg_states.h 
b/src/gallium/winsys/r600/drm/eg_states.h
index c26ba6c..518e05f 100644
--- a/src/gallium/winsys/r600/drm/eg_states.h
+++ b/src/gallium/winsys/r600/drm/eg_states.h
@@ -371,24 +371,27 @@ static const struct radeon_register EG_names_GS_SAMPLER[] 
= {
 };
 
 static const struct radeon_register EG_names_PS_SAMPLER_BORDER[] = {
-   {0xA400, 0, 0, TD_PS_SAMPLER0_BORDER_RED},
-   {0xA404, 0, 0, TD_PS_SAMPLER0_BORDER_GREEN},
-   {0xA408, 0, 0, TD_PS_SAMPLER0_BORDER_BLUE},
-   {0xA40C, 0, 0, TD_PS_SAMPLER0_BORDER_ALPHA},
+   {0xA400, 0, 0,