Commit Graph

755 Commits

Author SHA1 Message Date
Elizabeth Figura
94c9595196 vkd3d-shader/hlsl: Use replace_ir() for fold_conditional_identities(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
1f40222a0d vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_exprs(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
6e8eeb8f7a vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_identities(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
bdb31a4983 vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_swizzles(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
deb7a67d67 vkd3d-shader/hlsl: Introduce hlsl_block_add_constant(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
937b80f3f2 vkd3d-shader: Remove the no longer used flat_constant_count field from struct vsir_program. 2025-10-13 18:40:25 +02:00
Elizabeth Figura
db41ba557b vkd3d-shader/hlsl: Create vsir descriptor info in hlsl_parse(). 2025-10-13 18:25:05 +02:00
Elizabeth Figura
0bfed6587a vkd3d-shader/hlsl: Use replace_ir() for fold_redundant_casts(). 2025-10-09 13:21:47 +02:00
Elizabeth Figura
adc8d5cfad vkd3d-shader/hlsl: Use replace_ir() for fold_trivial_swizzles(). 2025-10-09 13:21:47 +02:00
Elizabeth Figura
2a4ac90ad2 vkd3d-shader/hlsl: Use replace_ir() for fold_swizzle_chains(). 2025-10-09 13:21:47 +02:00
Elizabeth Figura
f3522eae2e vkd3d-shader/hlsl: Rename lower_ir() to replace_ir().
We want to use it for folding passes as well, but describing these as "lowering"
is not very accurate. Use the more generic term "replace".
2025-10-09 13:21:47 +02:00
Elizabeth Figura
be31842197 vkd3d-shader/hlsl: Return a node from lower_ir().
This allows us to use the same function for "folding" passes, which usually
replace with a node other than the last one added in a block.
2025-10-09 13:20:46 +02:00
Shaun Ren
d5770cd347 vkd3d-shader/hlsl: Add support for the centroid interpolation mode in SM1. 2025-10-06 15:18:50 +02:00
Shaun Ren
cc53965ea9 vkd3d-shader/hlsl: Reject SM1 programs with interpolation modifiers. 2025-10-06 14:39:47 +02:00
Elizabeth Figura
c7529028eb vkd3d-shader/hlsl: Use unique IDs for descriptors before 5.1. 2025-10-06 14:22:58 +02:00
Elizabeth Figura
62b7c5b5e6 vkd3d-shader/hlsl: Use the semantic.resource_type field for texture DCL instructions.
ins->resource_type is intended for VKD3D_SM5_MODIFIER_RESOURCE_TYPE, which is
not used for DCL instructions. At the same time, the validator checks
semantic.resource_type, and would break on HLSL shaders.
2025-10-06 14:22:58 +02:00
Petrichor Park
e35604dbf0 vkd3d-shader/hlsl: Implement the firstbitlow() intrinsic. 2025-09-22 11:26:42 +02:00
Petrichor Park
e6d840170d vkd3d-shader/hlsl: Implement the firstbithigh() intrinsic. 2025-09-22 11:26:42 +02:00
Petrichor Park
e49beca0d5 vkd3d-shader/hlsl: Implement the countbits() intrinsic. 2025-09-22 11:26:42 +02:00
Henri Verbeet
47f2ec1a08 vkd3d-shader/ir: Require default swizzles on vec4 immediate constants.
The SPIR-V, GLSL and MSL backends implicitly handle swizzles on
immediate constants, but the TPF and d3d-asm backends assume a default
swizzle. In principle there's no reason those couldn't support swizzles
on immediate constants, but they're a little pointless.
2025-09-18 11:35:05 +02:00
Henri Verbeet
e69f3da089 vkd3d-shader/hlsl: Set the "has_point_size" flag for vertex shaders outputting point sizes. 2025-09-11 16:09:46 +02:00
Henri Verbeet
84d3a8d167 vkd3d-shader/hlsl: Use VKD3DSPR_COMBINED_SAMPLER destination operands in sm1_generate_vsir_sampler_dcls().
That's what the d3d-asm target expects in shader_print_dcl_usage(), and
what vkd3d_shader_scan() requires to create correct descriptor
information.
2025-09-11 16:09:46 +02:00
Henri Verbeet
4569a9d5ba vkd3d-shader/hlsl: Set the "flat constant" count in sm1_generate_vsir().
Aside from being required in order to produce valid vsir, this is used
by vsir_program_scan() to generate descriptor information.
2025-09-11 16:09:46 +02:00
Henri Verbeet
2b5dc156c7 vkd3d-shader/hlsl: vsir constant buffer sizes are specified in bytes. 2025-09-11 16:09:46 +02:00
Henri Verbeet
38078f2c51 vkd3d-shader/hlsl: Map HLSL_TYPE_HALF to VSIR_DATA_F32.
VSIR_DATA_F16 would require VKD3DSGF_FORCE_NATIVE_LOW_PRECISION, but we
don't currently implement that. vkd3d_component_type_from_data_type()
currently ends up doing this mapping for us in the SPIR-V backend, but
that's about to go away.
2025-09-08 12:34:16 +02:00