I am still working on parsing the remaining features of the effects framework, such as the FX functions for the state block entries -- such as SetBlendState() -- and the "compile" and "Compileshader()" syntax. However, after adding the many tests included in 2/7 and reading the feedback from !708, I think that this first batch of patches are going in the right direction in terms of parsing the state blocks and how to represent them internally.
As Nikolay mentioned in https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/708#note_64421 and https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/708#note_64444 there are many types of state blocks entries, which should be identified for writing the effect metadata.
A part that may cause discussion on this series is that I kept the representation of `struct hlsl_state_block_entry` using a `hlsl_block` to keep it general enough to represent all these types of state block entries, thinking on later implementing a helper to identify which type of entry we are dealing with.
Even though, as Nikolay pointed out, the instruction set of fx shaders is different, I still think that HLSL IR should be enough to represent the rhs of state blocks, and hopefully we won't need to pollute it too much (apart from the introduction of hlsl_ir_undeclared_load in 4/7 to avoid creating a new variable) if we find operations that are fx-specific, since I intend to represent calls to FX functions with the same `struct hlsl_state_block_entry`, given that they cannot be called in regular HLSL code. There are many validations that are applied on regular HLSL that still should be applied to state blocks, such as the use of valid swizzles and the correct use of operators.
--
v5: vkd3d-shader/hlsl: Allow KW_PIXELSHADER and KW_VERTEXSHADER as stateblock lhs.
vkd3d-shader/hlsl: Store state block on pass variables.
vkd3d-shader/hlsl: Parse list of state blocks.
vkd3d-shader/hlsl: Introduce hlsl_ir_stateblock_constant.
vkd3d-shader/hlsl: Parse and store state blocks on variables.
tests: Add tests for "compile" and CompileShader() syntax.
tests: Add tests for fxgroup syntax.
tests: Test function call syntax for state blocks.
tests: Add more state block syntax tests.
vkd3d-shader/hlsl: Also call dce before lowering deref paths.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/739
--
v20: tests/d3d12: Test multiple clip distance inputs in test_clip_distance().
tests/d3d12: Use five clip distances for the multiple test in test_clip_distance().
vkd3d-shader/ir: Transform clip/cull outputs and patch constants into arrays.
vkd3d-shader/ir: Transform clip/cull inputs into an array.
vkd3d-shader/spirv: Support no-op signature elements.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/564
--
v2: vkd3d-shader/hlsl: Use LOGIC_AND instead of MUL in all().
vkd3d-shader/hlsl: Use LOGIC_OR instead of BIT_OR in any().
vkd3d-shader/ir: Add missing src swizzle in vsir_program_lower_texkills().
tests: Add failing test for clip.shader_test in SM1.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/744
HLSL_CLASS_OBJECT does not really have much in common, and a lot of code currently uses it assuming that all objects are resources, which is not actually true. Most users of HLSL_CLASS_OBJECT want to check for specific types, and so we can simplify code a fair amount by promoting all object "base types" to top-level classes.
This series is a first step, comprising some cleanup towards that goal.
--
v3: vkd3d-shader/hlsl: Use hlsl_is_numeric_type() in type_has_object_components().
vkd3d-shader/hlsl: Simplify type_has_object_components().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/745
The Mesa version in Debian bookworm (22.3.6) we use for testing is now a bit outdated. While it's valuable to test on older drivers because they might be more representative of what users are running, it's also useful to test on recent drivers, which gives a less noisy signal to developers.
For the moment we enable it only for llvmpipe, because RADV is already passing all the tests anyway. And we don't bother with 32 bit here.
On llvmpipe using Mesa 24 fixes three shader runner tests.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/743