From: Dave Airlie Date: Fri, 6 Jan 2012 15:07:24 +0000 (+0000) Subject: draw: don't translate non-floats to float. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17707d89f438d7f52a3918f9b351e1419314cb17;p=mesa.git draw: don't translate non-floats to float. translate signed/unsigned integers to coresponding uint/sint r32g32b32a32 types. This fixes a bunch of piglit tests. Signed-off-by: Dave Airlie --- diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c index 81c7ec71ef7..93aff9ba1b5 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c @@ -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;