Re: [Mesa-dev] [PATCH 1/2] draw: fix prim id float cast for non-llvm path

2014-08-07 Thread Brian Paul

On 08/07/2014 02:50 PM, srol...@vmware.com wrote:

From: Roland Scheidegger 

These values are always uints, casting them to floats does no good.
Fixes piglit glsl-1.50-geometry-primitive-id-restart tests for softpipe.
---
  src/gallium/auxiliary/draw/draw_gs.c | 12 
  1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_gs.c 
b/src/gallium/auxiliary/draw/draw_gs.c
index f622822..2b6d2a0 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -144,14 +144,10 @@ static void tgsi_fetch_gs_input(struct 
draw_geometry_shader *shader,
for (slot = 0, vs_slot = 0; slot < shader->info.num_inputs; ++slot) {
   unsigned idx = i * TGSI_EXEC_MAX_INPUT_ATTRIBS + slot;
   if (shader->info.input_semantic_name[slot] == TGSI_SEMANTIC_PRIMID) {
-machine->Inputs[idx].xyzw[0].f[prim_idx] =
-   (float)shader->in_prim_idx;
-machine->Inputs[idx].xyzw[1].f[prim_idx] =
-   (float)shader->in_prim_idx;
-machine->Inputs[idx].xyzw[2].f[prim_idx] =
-   (float)shader->in_prim_idx;
-machine->Inputs[idx].xyzw[3].f[prim_idx] =
-   (float)shader->in_prim_idx;
+machine->Inputs[idx].xyzw[0].u[prim_idx] = shader->in_prim_idx;
+machine->Inputs[idx].xyzw[1].u[prim_idx] = shader->in_prim_idx;
+machine->Inputs[idx].xyzw[2].u[prim_idx] = shader->in_prim_idx;
+machine->Inputs[idx].xyzw[3].u[prim_idx] = shader->in_prim_idx;
   } else {
  vs_slot = draw_gs_get_input_index(
 shader->info.input_semantic_name[slot],



Reviewed-by: Brian Paul 

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


[Mesa-dev] [PATCH 1/2] draw: fix prim id float cast for non-llvm path

2014-08-07 Thread sroland
From: Roland Scheidegger 

These values are always uints, casting them to floats does no good.
Fixes piglit glsl-1.50-geometry-primitive-id-restart tests for softpipe.
---
 src/gallium/auxiliary/draw/draw_gs.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_gs.c 
b/src/gallium/auxiliary/draw/draw_gs.c
index f622822..2b6d2a0 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -144,14 +144,10 @@ static void tgsi_fetch_gs_input(struct 
draw_geometry_shader *shader,
   for (slot = 0, vs_slot = 0; slot < shader->info.num_inputs; ++slot) {
  unsigned idx = i * TGSI_EXEC_MAX_INPUT_ATTRIBS + slot;
  if (shader->info.input_semantic_name[slot] == TGSI_SEMANTIC_PRIMID) {
-machine->Inputs[idx].xyzw[0].f[prim_idx] =
-   (float)shader->in_prim_idx;
-machine->Inputs[idx].xyzw[1].f[prim_idx] =
-   (float)shader->in_prim_idx;
-machine->Inputs[idx].xyzw[2].f[prim_idx] =
-   (float)shader->in_prim_idx;
-machine->Inputs[idx].xyzw[3].f[prim_idx] =
-   (float)shader->in_prim_idx;
+machine->Inputs[idx].xyzw[0].u[prim_idx] = shader->in_prim_idx;
+machine->Inputs[idx].xyzw[1].u[prim_idx] = shader->in_prim_idx;
+machine->Inputs[idx].xyzw[2].u[prim_idx] = shader->in_prim_idx;
+machine->Inputs[idx].xyzw[3].u[prim_idx] = shader->in_prim_idx;
  } else {
 vs_slot = draw_gs_get_input_index(
shader->info.input_semantic_name[slot],
-- 
1.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev