mesa/src/intel
Juan A. Suarez Romero c2acf97fcc nir/i965: use two slots from inputs_read for dvec3/dvec4 vertex input attributes
So far, input_reads was a bitmap tracking which vertex input locations
were being used.

In OpenGL, an attribute bigger than a vec4 (like a dvec3 or dvec4)
consumes just one location, any other small attribute. So we mark the
proper bit in inputs_read, and also the same bit in double_inputs_read
if the attribute is a dvec3/dvec4.

But in Vulkan, this is slightly different: a dvec3/dvec4 attribute
consumes two locations, not just one. And hence two bits would be marked
in inputs_read for the same vertex input attribute.

To avoid handling two different situations in NIR, we just choose the
latest one: in OpenGL, when creating NIR from GLSL/IR, any dvec3/dvec4
vertex input attribute is marked with two bits in the inputs_read bitmap
(and also in the double_inputs_read), and following attributes are
adjusted accordingly.

As example, if in our GLSL/IR shader we have three attributes:

layout(location = 0) vec3  attr0;
layout(location = 1) dvec4 attr1;
layout(location = 2) dvec3 attr2;

then in our NIR shader we put attr0 in location 0, attr1 in locations 1
and 2, and attr2 in location 3 and 4.

Checking carefully, basically we are using slots rather than locations
in NIR.

When emitting the vertices, we do a inverse map to know the
corresponding location for each slot.

v2 (Jason):
- use two slots from inputs_read for dvec3/dvec4 NIR from GLSL/IR.

v3 (Jason):
- Fix commit log error.
- Use ladder ifs and fix braces.
- elements_double is divisible by 2, don't need DIV_ROUND_UP().
- Use if ladder instead of a switch.
- Add comment about hardware restriction in 64bit vertex attributes.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-01-09 10:42:22 +01:00
..
blorp intel/blorp_blit: Fix max blit size for gen6 2016-12-26 08:50:21 -08:00
common i965: Fix a mistake from porting the URB allocation code to arrays. 2016-11-23 16:57:29 -08:00
genxml genxml: Make Gen8 3DSTATE_DS SIMD8 enable work like Gen9+. 2016-12-14 14:59:06 -08:00
isl isl: fix VA64 support for double and dvecN vertex attributes 2017-01-09 09:10:13 +01:00
tools intel/aubinator: fix 32bit shift overflow warning 2016-12-11 20:04:15 +01:00
vulkan nir/i965: use two slots from inputs_read for dvec3/dvec4 vertex input attributes 2017-01-09 10:42:22 +01:00
Android.blorp.mk intel/blorp: fix typo in android makefile 2016-09-03 08:22:53 -07:00
Android.common.mk android: intel: fix include paths in new "common" library 2016-09-03 20:03:16 -07:00
Android.genxml.mk android: intel: Flatten the makefile structure 2016-08-29 12:17:34 -07:00
Android.isl.mk android: intel: Flatten the makefile structure 2016-08-29 12:17:34 -07:00
Android.mk intel: Add a new "common" library for more code sharing 2016-09-03 08:23:06 -07:00
Makefile.am intel: Add a new "common" library for more code sharing 2016-09-03 08:23:06 -07:00
Makefile.blorp.am i965: Move blorp into src/intel/blorp 2016-08-29 12:17:34 -07:00
Makefile.common.am intel: Add a new "common" library for more code sharing 2016-09-03 08:23:06 -07:00
Makefile.genxml.am genxml: Handle failure of Python codegen scripts. 2016-10-26 14:06:45 -07:00
Makefile.isl.am intel: Add a new "common" library for more code sharing 2016-09-03 08:23:06 -07:00
Makefile.sources intel: Share URB configuration code between GL and Vulkan. 2016-11-19 11:40:01 -08:00