draw: don't translate non-floats to float.
authorDave Airlie <airlied@redhat.com>
Fri, 6 Jan 2012 15:07:24 +0000 (15:07 +0000)
committerDave Airlie <airlied@redhat.com>
Sat, 7 Jan 2012 08:31:43 +0000 (08:31 +0000)
translate signed/unsigned integers to coresponding uint/sint r32g32b32a32 types.

This fixes a bunch of piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/draw/draw_pt_fetch.c

index 81c7ec71ef7aaca01b74224680c01d1cf1b35c74..93aff9ba1b5c38ec0ad17789074171d5f4335d16 100644 (file)
@@ -91,6 +91,28 @@ void draw_pt_fetch_prepare( struct pt_fetch *fetch,
          key.element[nr].output_offset = dst_offset;
 
          dst_offset += sizeof(uint);
+      } else if (util_format_is_pure_sint(draw->pt.vertex_element[i].src_format)) {
+         key.element[nr].type = TRANSLATE_ELEMENT_NORMAL;
+         key.element[nr].input_format = draw->pt.vertex_element[ei].src_format;
+         key.element[nr].input_buffer = draw->pt.vertex_element[ei].vertex_buffer_index;
+         key.element[nr].input_offset = draw->pt.vertex_element[ei].src_offset;
+         key.element[nr].instance_divisor = draw->pt.vertex_element[ei].instance_divisor;
+         key.element[nr].output_format = PIPE_FORMAT_R32G32B32A32_SINT;
+         key.element[nr].output_offset = dst_offset;
+
+         ei++;
+         dst_offset += 4 * sizeof(int);
+      } else if (util_format_is_pure_uint(draw->pt.vertex_element[i].src_format)) {
+         key.element[nr].type = TRANSLATE_ELEMENT_NORMAL;
+         key.element[nr].input_format = draw->pt.vertex_element[ei].src_format;
+         key.element[nr].input_buffer = draw->pt.vertex_element[ei].vertex_buffer_index;
+         key.element[nr].input_offset = draw->pt.vertex_element[ei].src_offset;
+         key.element[nr].instance_divisor = draw->pt.vertex_element[ei].instance_divisor;
+         key.element[nr].output_format = PIPE_FORMAT_R32G32B32A32_UINT;
+         key.element[nr].output_offset = dst_offset;
+
+         ei++;
+         dst_offset += 4 * sizeof(unsigned);
       } else {
          key.element[nr].type = TRANSLATE_ELEMENT_NORMAL;
          key.element[nr].input_format = draw->pt.vertex_element[ei].src_format;