mesa/src
Antia Puentes 61a8a55f55 i965/gen8: Fix vertex attrib upload for dvec3/4 shader inputs
The emission of vertex attributes corresponding to dvec3 and dvec4
vertex shader input variables was not correct when the <size> passed
to the VertexAttribL* commands was <= 2.

This was because we were using the vertex array size when emitting vertices
to decide if we uploaded a 64-bit floating point attribute as 1 slot (128-bits)
for sizes 1 and 2, or 2 slots (256-bits) for sizes 3 and 4. This caused problems
when mapping the input variables to registers because, for deciding which
registers contain the values uploaded for a certain variable, we use the size
and type given to the variable in the shader, so we will be assigning 256-bits
to dvec3/4 variables, even if we only uploaded 128-bits for them, which happened
when the vertex array size was <= 2.

The patch uses the shader information to only emit as 128-bits those 64-bit floating
point variables that were declared as double or dvec2 in the vertex shader. Dvec3 and
dvec4 variables will be always uploaded as 256-bits, independently of the <size> given
to the VertexAttribL* command.

From the ARB_vertex_attrib_64bit specification:

   "For the 64-bit double precision types listed in Table X.1, no default
    attribute values are provided if the values of the vertex attribute variable
    are specified with fewer components than required for the attribute
    variable. For example, the fourth component of a variable of type dvec4
    will be undefined if specified using VertexAttribL3dv or using a vertex
    array specified with VertexAttribLPointer and a size of three."

We are filling these unspecified components with zeros, which coincidentally is
also what the GL44-CTS.vertex_attrib_binding.basic-inputL-case1 expects.

v2: Do not use bitcount (Kenneth Graunke)

Fixes: GL44-CTS.vertex_attrib_binding.basic-inputL-case1 test

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97287
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-11-01 09:39:09 +01:00
..
amd radv: drop some unused cmask info members. 2016-11-01 15:11:35 +10:00
compiler glsl: use a non-malloc'd storage for short ir_variable names 2016-10-31 11:53:38 +01:00
egl egl: set preserved behavior for surface only if config supports it 2016-10-27 07:12:51 +03:00
gallium st/omx/dec: disable tunnel for size different case 2016-10-31 11:45:29 -04:00
gbm loader: remove loader_get_driver_for_fd() driver_type 2016-10-18 17:06:29 +01:00
getopt Introduce .editorconfig 2016-08-31 17:06:54 -07:00
glx loader: remove loader_get_driver_for_fd() driver_type 2016-10-18 17:06:29 +01:00
gtest Introduce .editorconfig 2016-08-31 17:06:54 -07:00
hgl glapi/hgl: remove the final user of _glapi_check_table() 2016-10-06 15:03:46 +01:00
intel intel: aubinator: fix printing missing gen option 2016-10-31 22:03:13 +00:00
loader loader: cleanup copyright section 2016-10-18 17:06:32 +01:00
mapi mesa: add missing CONTEXT_ROBUST_ACCESS enum 2016-10-27 07:06:41 +03:00
mesa i965/gen8: Fix vertex attrib upload for dvec3/4 shader inputs 2016-11-01 09:39:09 +01:00
util ralloc: add a linear allocator as a child node of ralloc 2016-10-31 11:53:38 +01:00
vulkan/wsi vulkan/wsi/x11: Smplify implementation of vkGetPhysicalDeviceSurfaceFormatsKHR 2016-10-28 16:53:28 +02:00
Makefile.am anv: move to using shared wsi code 2016-10-19 10:15:43 +10:00
SConscript scons: put the generated git_sha1.h file in top-level src/ directory 2016-06-17 10:33:00 -06:00