mesa/src/compiler/spirv
Caio Oliveira 6affcb43a7 spirv: Fix spec constant to handle Select for non-native floats
There was an assumption that if the instruction had non-native float
as a source, the first source would have such type.  This doesn't
hold for Select, and the code failed in two ways

- The boolean source of Select was being converted to the non-native
  float type.

- The loop that resolves the bit-size for unsized operands would
  trip at `assert(i == 0)` because Select has more than one source.

Re-organize the code to track the types of the sources independently,
and fix both issues above.

Fixes: 90e1b12890 ("spirv: Add bfloat16 support to SpecConstantOp")
Fixes: 51d3c4c889 ("spirv: support float8 spec constant op")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40157>
2026-03-04 22:04:45 +00:00
..
tests treewide: add & use parent instr helpers 2025-11-12 21:22:13 +00:00
gl_spirv.c all: rename gl_shader_stage to mesa_shader_stage 2025-08-06 10:28:40 +08:00
GLSL.ext.AMD.h spirv: Update headers and grammer JSON 2023-08-18 16:57:22 +00:00
GLSL.std.450.h spirv: bump headers 2025-06-06 14:38:17 +00:00
meson.build mesa: stop using inc_mesa in most places that have nothing to do with GL 2025-08-06 20:35:26 +00:00
nir_spirv.h spirv: Remove view_index_is_input 2025-12-03 22:52:29 +00:00
NonSemanticShaderDebugInfo100.h spirv: bump headers 2025-06-06 14:38:17 +00:00
OpenCL.std.h spirv: bump headers 2025-06-06 14:38:17 +00:00
spir-v.xml spirv: Update headers and metadata from latest Khronos commit 2025-08-08 22:41:14 +00:00
spirv.core.grammar.json vulkan,spirv: update headers 2026-02-24 08:55:52 +00:00
spirv.h vulkan,spirv: update headers 2026-02-24 08:55:52 +00:00
spirv2nir.c nir: rename nir_copy_prop -> nir_opt_copy_prop 2025-11-15 02:16:38 +00:00
spirv_info_gen.py build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
spirv_internal_exts.h spirv: Add internal f2f16 opcodes 2026-01-10 11:34:07 +01:00
spirv_to_nir.c spirv: Fix spec constant to handle Select for non-native floats 2026-03-04 22:04:45 +00:00
vtn_alu.c spirv: Refactor ALU opcode translation to take bit sizes 2026-03-04 22:04:44 +00:00
vtn_amd.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
vtn_bindgen2.c nir/lower_printf: fix missing singleton add 2025-11-25 14:18:42 +00:00
vtn_cfg.c spirv: remove vtn_builder::exact 2026-01-27 23:01:44 +00:00
vtn_cmat.c spirv: Refactor ALU opcode translation to take bit sizes 2026-03-04 22:04:44 +00:00
vtn_debug.c spirv: plumb spirv-dis --offsets 2026-02-04 12:05:10 +00:00
vtn_gather_types_c.py spirv: OpAsmTargetINTEL is untyped 2025-03-08 19:54:19 +00:00
vtn_generator_ids_h.py util,vulkan,mesa,compiler: Generate source files with utf8 encoding from mako template 2023-12-07 12:41:07 +00:00
vtn_glsl450.c spirv: use nan/inf preserve for glsl.std.450 min/max instead of exact 2026-02-10 18:42:02 +00:00
vtn_opencl.c vtn: fix wait_group_events memory scope 2026-02-13 19:50:22 +00:00
vtn_private.h spirv: Refactor ALU opcode translation to take bit sizes 2026-03-04 22:04:44 +00:00
vtn_structured_cfg.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
vtn_subgroup.c spirv: ensure ballot find_lsb/find_msb/bit_count have 32bit result 2025-09-04 14:03:58 +00:00
vtn_variables.c nir,spirv: Add support for SPV_QCOM_image_processing. 2026-01-27 02:00:40 +00:00