mesa/src/intel/vulkan
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
..
tests anv: fold the tests' makefile 2016-05-01 08:38:04 +01:00
.gitignore anv: Suffix the intel_icd file with the host CPU 2016-10-21 09:30:20 -07:00
anv_allocator.c anv: Add missing error-checking to anv_block_pool_init (v2) 2016-11-28 21:11:25 +00:00
anv_batch_chain.c anv: Don't include two different pack headers 2016-11-29 22:02:49 -08:00
anv_blorp.c anv: fix release build unused variable warnings 2016-12-11 20:03:14 +01:00
anv_cmd_buffer.c anv: Handle null in all destructors 2016-11-16 20:07:23 -08:00
anv_descriptor_set.c anv: Set up binding tables and surface states for input attachments 2016-11-22 13:44:55 -08:00
anv_device.c anv,radv: disable StorageImageWriteWithoutFormat for now 2016-12-31 16:38:00 -05:00
anv_dump.c anv/cmd_buffer: Move Begin/End/Execute to genX_cmd_buffer.c 2016-10-17 17:41:35 -07:00
anv_entrypoints_gen.py anv: Make entrypoint resolution take a gen_device_info 2016-10-14 15:40:39 -07:00
anv_formats.c isl: fix VA64 support for double and dvecN vertex attributes 2017-01-09 09:10:13 +01:00
anv_gem.c anv/device: Return the right error for failed maps 2016-11-09 18:17:48 -08:00
anv_gem_stubs.c anv: remove define _DEFAULT_SOURCE 2016-05-23 12:09:11 +01:00
anv_genX.h anv: Implement a depth stall restriction on gen7 2016-11-20 20:40:40 -08:00
anv_image.c anv: Enable fast clears on gen7-8 2016-11-22 14:24:29 -08:00
anv_intel.c anv: Fix unintentional integer overflow in anv_CreateDmaBufImageINTEL 2016-11-22 15:15:45 +00:00
anv_nir.h anv: Add an input attachment lowering pass 2016-11-22 13:44:55 -08:00
anv_nir_apply_dynamic_offsets.c anv/pipeline: Only do buffer bounds checks if robustBufferAccess is enabled 2016-05-19 21:18:59 -07:00
anv_nir_apply_pipeline_layout.c anv/pipeline: Add a input_attachment_index to the bindings 2016-11-22 13:44:55 -08:00
anv_nir_lower_input_attachments.c nir: Make nir_copy_deref follow the "clone" pattern 2016-12-30 12:38:04 -08:00
anv_nir_lower_push_constants.c spirv: compute push constant access offset & range 2017-01-04 21:14:17 +00:00
anv_pass.c anv/pipeline: Handle depth/stencil self-dependencies 2016-11-22 13:44:55 -08:00
anv_pipeline.c anv/pipeline: get map for double input attributes 2017-01-09 09:10:13 +01:00
anv_pipeline_cache.c anv: Store UUID in physical device. 2016-11-28 19:46:05 +00:00
anv_private.h anv: Clean up some unused variables 2016-12-10 11:59:59 +11:00
anv_query.c anv: Handle null in all destructors 2016-11-16 20:07:23 -08:00
anv_util.c anv: port to using new u_vector shared helper. 2016-10-19 09:05:25 +10:00
anv_wsi.c anv: fix segfault in anv_BindImageMemory 2016-11-23 16:11:03 +10:00
anv_wsi_wayland.c anv/wsi: remove all anv references from WSI common code 2016-10-19 10:15:43 +10:00
anv_wsi_x11.c anv/wsi: remove all anv references from WSI common code 2016-10-19 10:15:43 +10:00
dev_icd.json.in anv: Replace "abi_versions" with correct "api_version". 2016-10-25 12:55:39 -07:00
gen7_cmd_buffer.c anv/cmd_buffer: Stop relying on the framebuffer for 3DSTATE_SF on gen7 2016-11-16 10:11:07 -08:00
gen8_cmd_buffer.c anv: Emit cherryview SF state without including gen9_pack.h 2016-11-29 22:02:49 -08:00
genX_blorp_exec.c anv: Implement a depth stall restriction on gen7 2016-11-20 20:40:40 -08:00
genX_cmd_buffer.c anv: fix release build unused variable warnings 2016-12-11 20:03:14 +01:00
genX_gpu_memcpy.c intel: Share URB configuration code between GL and Vulkan. 2016-11-19 11:40:01 -08:00
genX_pipeline.c nir/i965: use two slots from inputs_read for dvec3/dvec4 vertex input attributes 2017-01-09 10:42:22 +01:00
genX_state.c anv/state: if enabled, use anisotropic filtering also with VK_FILTER_NEAREST 2016-11-25 08:20:28 +01:00
intel_icd.json.in anv: Replace "abi_versions" with correct "api_version". 2016-10-25 12:55:39 -07:00
Makefile.am anv: Prefer in-tree headers to out-of-tree headers 2016-11-30 20:01:00 +02:00
Makefile.sources anv: automake: don't generate anv_timestamp.h 2016-11-28 19:47:17 +00:00
TODO anv: add support for extended texture gather 2016-12-29 20:43:33 -05:00
vk_format_info.h anv: Set up binding tables and surface states for input attachments 2016-11-22 13:44:55 -08:00