mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-20 02:38:07 +02:00
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> |
||
|---|---|---|
| .. | ||
| tests | ||
| .gitignore | ||
| anv_allocator.c | ||
| anv_batch_chain.c | ||
| anv_blorp.c | ||
| anv_cmd_buffer.c | ||
| anv_descriptor_set.c | ||
| anv_device.c | ||
| anv_dump.c | ||
| anv_entrypoints_gen.py | ||
| anv_formats.c | ||
| anv_gem.c | ||
| anv_gem_stubs.c | ||
| anv_genX.h | ||
| anv_image.c | ||
| anv_intel.c | ||
| anv_nir.h | ||
| anv_nir_apply_dynamic_offsets.c | ||
| anv_nir_apply_pipeline_layout.c | ||
| anv_nir_lower_input_attachments.c | ||
| anv_nir_lower_push_constants.c | ||
| anv_pass.c | ||
| anv_pipeline.c | ||
| anv_pipeline_cache.c | ||
| anv_private.h | ||
| anv_query.c | ||
| anv_util.c | ||
| anv_wsi.c | ||
| anv_wsi_wayland.c | ||
| anv_wsi_x11.c | ||
| dev_icd.json.in | ||
| gen7_cmd_buffer.c | ||
| gen8_cmd_buffer.c | ||
| genX_blorp_exec.c | ||
| genX_cmd_buffer.c | ||
| genX_gpu_memcpy.c | ||
| genX_pipeline.c | ||
| genX_state.c | ||
| intel_icd.json.in | ||
| Makefile.am | ||
| Makefile.sources | ||
| TODO | ||
| vk_format_info.h | ||