OSDN Git Service

i965: Add support for integral vertex attributes.
authorPaul Berry <stereotype441@gmail.com>
Tue, 1 Nov 2011 00:31:16 +0000 (17:31 -0700)
committerPaul Berry <stereotype441@gmail.com>
Wed, 2 Nov 2011 16:29:35 +0000 (09:29 -0700)
commit29e2bc8b13be0f7ec48f8514e47322353e041365
treef516a20508b0866b23b28163f3419c5f2492dd8e
parent8f84c237b360be69f9b6ac51465c729b3ada196a
i965: Add support for integral vertex attributes.

When a vertex shader input attribute is declared with an integral type
(e.g. ivec4), we need to ensure that the generated vertex shader code
addresses the vertex attribute register using the proper register
type.  (Previously, we assumed all vertex shader input attributes were
floating-point).

In addition, when uploading vertex data that was specified with
VertexAttribIPointer, we need to instruct the vertex fetch unit to
convert the data to signed or unsigned int, rather than float.  And
when filling in the implied w=1 on a vector with less than 4
components, we need to fill it in with the integer representation of 1
rather than the floating-point representation of 1.

Fixes piglit tests vs-attrib-{ivec4,uvec4}-precision.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_draw_upload.c
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp