Petrichor Park
69294c290b
vkd3d-shader/hlsl: Implement acos and asin trig intrinsics.
...
Tests have already been implemented in 92044d5e; this commit also reduces
the scope of some of the todos (because now they're implemented!).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55154
2024-02-21 23:23:11 +01:00
Henri Verbeet
d4223a03c8
vkd3d-shader/hlsl: Replace HLSL_MODIFIER_RASTERIZER_ORDERED with a hlsl_type.e.resource flag.
2024-02-21 23:23:08 +01:00
Henri Verbeet
49d14613a5
vkd3d-shader/hlsl: Introduce hlsl_type.e.resource.
2024-02-21 23:23:06 +01:00
Conor McCarthy
d9c68ee481
vkd3d-shader/dxil: Handle resource descriptor additional tag/value pairs.
...
These are tag/value pairs, and the current code only works if an element
type or element stride pair is present at index zero.
2024-02-20 22:50:19 +01:00
Conor McCarthy
96a0685ba6
vkd3d-shader/dxil: Implement DX intrinsic AtomicCompareExchange.
2024-02-20 22:50:16 +01:00
Conor McCarthy
560c9413c3
vkd3d-shader/dxil: Implement DX intrinsic AtomicBinOp.
2024-02-20 22:50:15 +01:00
Evan Tang
7b41abaa1b
vkd3d-shader/hlsl: Support SV_PrimitiveID in pixel shaders.
2024-02-19 21:12:23 +01:00
Francisco Casas
8df34fce62
vkd3d-shader/hlsl: Emit fixme on non-direct resource stores.
...
Co-authored-by: Giovanni Mascellani <gmascellani@codeweavers.com>
These may happen when storing to structured buffers, and we are not
handling them properly yet. The included test reaches unreacheable code
before this patch.
Storing to buffers is complicated since we need to split the index
chain in two paths:
- The path within the variable where the resource is.
- The subpath to the part of the resource element that is being stored
to.
For now, we will emit a fixme when the index chain in the lhs is not a
direct resource access.
2024-02-19 21:12:14 +01:00
Nikolay Sivov
315b7c5a42
vkd3d-shader/fx: Do not align structured data section.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-02-19 21:12:09 +01:00
Nikolay Sivov
c107ec03b8
vkd3d-shader/fx: Add initial support for writing buffers descriptions.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-02-19 21:12:08 +01:00
Nikolay Sivov
656c068b32
vkd3d-shader/fx: Do not align strings for fx_4/fx_5 profiles.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-02-19 21:12:07 +01:00
Nikolay Sivov
d5f562d994
vkd3d-shader/fx: Use variable pointer in write_group().
...
The helper will need to access group annotations later, and these are
available for variables.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-02-19 21:12:05 +01:00
Francisco Casas
c249461e97
vkd3d-shader/hlsl: Parse Buffer types.
2024-02-19 21:11:55 +01:00
Francisco Casas
e1c759e1c9
vkd3d-shader/hlsl: Record valid methods in object_methods[].
...
Also, call hlsl_sampler_dim_count() and hlsl_offset_dim_count() after
type checking, to avoid reaching unreacheable cases.
2024-02-19 21:11:46 +01:00
Evan Tang
ee867bd470
vkd3d-shader/hlsl: Parse rasteriser-ordered view types.
2024-02-15 23:29:46 +01:00
Francisco Casas
e3ed5ac77e
vkd3d-shader/hlsl: Lower casts to int for SM1.
2024-02-15 23:29:39 +01:00
Francisco Casas
4b5c7e3721
vkd3d-shader/d3dbc: Implement casts from ints to floats as a MOV.
...
For temporary registers, SM1-SM3 integer types are internally
represented as floating point, so, in order to perform a cast
from ints to floats we need a mere MOV.
For constant integer registers "iN" there is no operation for casting
from a floating point register to them. For address registers "aN", and
the loop counting register "aL", vertex shaders have the "mova" operation
but we haven't used these registers in any way yet.
We probably would want to introduce these as synthetic variables
allocated in a special register set. In that case we have to remember to
use MOVA instead of MOV in the store operations, but they shouldn't be src
or dst of CAST operations.
Regarding constant integer registers, in some shaders, constants are
expected to be received formatted as an integer, such as:
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m; ++k)
res += k;
return res;
}
which compiles as:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m i0 1
//
ps_3_0
def c0, 0, 1, 0, 0
mov r0, c0.x
mov r1.x, c0.x
rep i0
add r0, r0, r1.x
add r1.x, r1.x, c0.y
endrep
mov oC0, r0
but this only happens if the integer constant is used directly in an
instruction that needs it, and as I said there is no instruction that
allows converting them to a float representation.
Notice how a more complex shader, that performs operations with this
integer variable "m":
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m * m; ++k)
res += k;
return res;
}
gives the following output:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m c0 1
//
ps_3_0
def c1, 0, 0, 1, 0
defi i0, 255, 0, 0, 0
mul r0.x, c0.x, c0.x
mov r1, c1.y
mov r0.y, c1.y
rep i0
mov r0.z, r0.x
break_ge r0.y, r0.z
add r1, r0.y, r1
add r0.y, r0.y, c1.z
endrep
mov oC0, r1
Meaning that the uniform "m" is just stored as a floating point in
"c0", the constant integer register "i0" is just set to 255 (hoping
it is a high enough value) using "defi", and the "break_ge"
involving c0 is used to break from the loop.
We could potentially use this approach to implement loops from SM3
without expecting the variables being received as constant integer
registers.
According to the D3D documentation, for SM1-SM3 constant integer
registers are only used by the 'loop' and 'rep' instructions.
2024-02-15 23:29:37 +01:00
Conor McCarthy
6e634ad690
vkd3d-shader: Raise the instruction parameter allocation size if necessary.
...
Monolithic switch instructions have no definite case count limit.
2024-02-14 21:48:38 +01:00
Conor McCarthy
55c28e94f8
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_vselect().
2024-02-14 21:48:32 +01:00
Conor McCarthy
c89627ec73
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_store().
2024-02-14 21:48:31 +01:00
Conor McCarthy
4c7d956bdb
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_load().
2024-02-14 21:48:30 +01:00
Conor McCarthy
04a9340164
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_extractval().
2024-02-14 21:48:28 +01:00
Conor McCarthy
3c1ad054f0
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_cmp2().
2024-02-14 21:48:26 +01:00
Conor McCarthy
cddb696499
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_cast().
2024-02-14 21:48:25 +01:00
Conor McCarthy
76455580e2
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_texture_load().
2024-02-14 21:48:24 +01:00
Conor McCarthy
d04a8ea893
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_split_double().
2024-02-14 21:48:23 +01:00
Conor McCarthy
8c3512bd10
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_sincos().
2024-02-14 21:48:22 +01:00
Conor McCarthy
cc5293bb4f
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_buffer_load().
2024-02-14 21:48:21 +01:00
Conor McCarthy
6e3e200e96
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_load_input().
2024-02-14 21:48:20 +01:00
Conor McCarthy
eb1bfaa821
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_tertiary().
2024-02-14 21:48:19 +01:00
Conor McCarthy
1a2de25273
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_cbuffer_load().
2024-02-14 21:48:18 +01:00
Conor McCarthy
0a23c81196
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_binary().
2024-02-14 21:48:17 +01:00
Conor McCarthy
83e6ee4b3d
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_unary().
2024-02-14 21:48:14 +01:00
Conor McCarthy
217eb06f37
vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_binop().
2024-02-14 21:48:13 +01:00
Conor McCarthy
5a76cedf87
vkd3d-shader/dxil: Implement DX intrinsic SampleGrad.
2024-02-14 21:48:08 +01:00
Conor McCarthy
5178fb7364
vkd3d-shader/dxil: Implement DX intrinsic Sample.
2024-02-14 21:48:06 +01:00
Conor McCarthy
0a3eb61170
vkd3d-shader/dxil: Load sampler descriptors.
2024-02-14 21:48:03 +01:00
Giovanni Mascellani
5905489b7f
vkd3d-shader/hlsl: Free the selector in postfix_expr (Valgrind).
2024-02-09 22:47:46 +01:00
Giovanni Mascellani
a10de1b239
vkd3d-shader/hlsl: Free the individual attributes in func_prototype (Valgrind).
2024-02-09 22:47:45 +01:00
Giovanni Mascellani
049327a270
vkd3d-shader/hlsl: Free the parse initializer in attribute (Valgrind).
2024-02-09 22:47:44 +01:00
Giovanni Mascellani
521082afbe
vkd3d-shader/hlsl: Free variable identifiers in primary_expr (Valgrind).
2024-02-09 22:47:42 +01:00
Conor McCarthy
625e289574
vkd3d-shader/dxil: Handle hyperbolic trigonometric functions in sm6_parser_emit_dx_unary().
2024-02-07 22:59:23 +01:00
Conor McCarthy
c35ec4f820
vkd3d-shader/dxil: Implement DX intrinsic TextureStore.
2024-02-07 22:59:18 +01:00
Conor McCarthy
efddcc9a99
vkd3d-shader/dxil: Support forward-referenced value ids.
2024-02-07 22:59:10 +01:00
Conor McCarthy
7f87a3e5fc
vkd3d-shader/spirv: Handle the ACOS, ASIN and ATAN instructions in spirv_compiler_emit_ext_glsl_instruction().
2024-02-06 23:09:55 +01:00
Conor McCarthy
19d23fa696
vkd3d-shader/dxil: Handle inverse trigonometric functions in sm6_parser_emit_dx_unary().
2024-02-06 23:09:53 +01:00
Giovanni Mascellani
51f13391e6
vkd3d-shader/ir: Introduce a simple control flow graph structurizer.
...
The structurizer is implemented along the lines of what is usually called
the "structured program theorem": the control flow is completely
virtualized by mean of an additional TEMP register which stores the
block index which is currently running. The whole program is then
converted to a huge switch construction enclosed in a loop, executing
at each iteration the appropriate block and updating the register
depending on block jump instruction.
The algorithm's generality is also its major weakness: it accepts any
input program, even if its CFG is not reducible, but the output
program lacks any useful convergence information. It satisfies the
letter of the SPIR-V requirements, but it is expected that it will
be very inefficient to run on a GPU (unless a downstream compiler is
able to devirtualize the control flow and do a proper convergence
analysis pass). The algorithm is however very simple, and good enough
to at least pass tests, enabling further development. A better
alternative is expected to be upstreamed incrementally.
Side note: the structured program theorem is often called the
Böhm-Jacopini theorem; Böhm and Jacopini did indeed prove a variation
of it, but their algorithm is different from what is commontly attributed
to them and implemented here, so I opted for not using their name.
2024-02-06 23:07:07 +01:00
Giovanni Mascellani
19aef21369
vkd3d-shader/ir: Handle PHI nodes when materializing SSA registers.
...
PHI nodes cannot be used with TEMP registers, so they have to be
converted to MOV/MOVC nodes and moved before the BRANCH node.
2024-02-06 23:07:03 +01:00
Giovanni Mascellani
e0d3e9c376
vkd3d-shader/ir: Materialize SSA registers to temporaries.
...
For simplicity PHI nodes are not currently handled.
The goal for this pass is to make the CFG structurizer simpler, because
it doesn't have to care about the more rigid rules SSA registers have
to satisfy than TEMP registers.
It is likely that the generated code will be harder for downstream
compilers to optimize and execute efficiently, so once a complete
structurizer is in place this pass should be removed, or at least
greatly reduced in scope.
2024-02-06 23:07:00 +01:00
Giovanni Mascellani
eb723a8d2b
vkd3d-shader/spirv: Support bool TEMP registers.
2024-02-06 23:06:58 +01:00
Giovanni Mascellani
49f0fd42b8
vkd3d-shader/spirv: Move bool casting helpers above register loading helpers.
2024-02-06 23:06:55 +01:00
Giovanni Mascellani
ee994e95dd
vkd3d-shader/spirv: Convert the swizzle according to the source bit width.
...
Fixes: 1f536238a8
2024-02-06 23:06:53 +01:00
Giovanni Mascellani
674f86042d
vkd3d-shader/dxil: Set the register before calling src_param_init_scalar().
...
Which uses the register to compute the appropriate swizzle.
Fixes: 1f536238a8
2024-02-06 23:06:49 +01:00
Conor McCarthy
95e4222cc6
vkd3d-shader/spirv: Emit a vector bitcast if necessary in spirv_compiler_emit_load_ssa_reg().
2024-02-01 22:25:04 +01:00
Conor McCarthy
ebec0aa434
vkd3d-shader/dxil: Implement DX intrinsic TextureLoad.
2024-02-01 22:25:02 +01:00
Conor McCarthy
e6d52861e9
vkd3d-shader/dxil: Implement DX intrinsic SplitDouble.
2024-02-01 22:24:58 +01:00
Giovanni Mascellani
cc72a8d311
vkd3d-shader/spirv: Free binary SPIR-V code (Valgrind).
2024-02-01 00:08:28 +01:00
Henri Verbeet
d38221bd68
vkd3d-shader/ir: Pass a struct vsir_program to shader_parser_get_src_params().
2024-02-01 00:08:23 +01:00
Henri Verbeet
47ec24ebad
vkd3d-shader/ir: Pass a struct vsir_program to shader_parser_get_dst_params().
2024-02-01 00:08:22 +01:00
Henri Verbeet
ced8543952
vkd3d-shader: Use vkd3d_atomic_increment_u32() in vkd3d_shader_dump_blob().
2024-02-01 00:08:18 +01:00
Henri Verbeet
fef30dac2c
vkd3d-shader/d3dbc: Do not fail parsing the shader when undeclared inputs are encountered.
...
These can be disassembled by D3DDisassemble() just fine, and perhaps
more importantly, shader model 1 vertex shaders do not require dcl_
instructions in Direct3D 8.
2024-01-29 22:33:46 +01:00
Giovanni Mascellani
edc406d297
vkd3d-shader/ir: Check that SSA registers are used with compatible data types.
...
Specifically, accesses are always 32 bit or always 64 bit.
2024-01-29 22:33:34 +01:00
Giovanni Mascellani
1f536238a8
vkd3d-shader: Use 64 bit swizzles for 64 bit data types in VSIR.
...
The handling of write masks and swizzles for 64 bit data types is
currently irregular: write masks are always 64 bit, while swizzles
are usually 32 bit, except for SSA registers with are 64 bit.
With this change we always use 64 bit swizzles, in order to make
the situation less surprising and make it easier to convert
registers between SSA and TEMP.
64 bit swizzles are always required to have X in their last two
components.
2024-01-29 22:33:33 +01:00
Giovanni Mascellani
2b93aae069
vkd3d-shader: Convert write masks between 32 and 64 bit by cases.
...
There are only three cases, and while the code is longer it is also
hopefully easier to read. Moreover, an error message is casted if
we're doing something unexpected.
2024-01-29 22:33:30 +01:00
Francisco Casas
13f713f74b
vkd3d-shader/hlsl: Turn register(cX) reservations into buffer offset for SM4.
2024-01-29 22:33:27 +01:00
Francisco Casas
c7f7636534
vkd3d-shader/hlsl: Make register(cX) reservations work for SM1.
2024-01-29 22:33:25 +01:00
Conor McCarthy
92f0b37133
vkd3d-shader/spirv: Support 64-bit source value for bitfield instructions.
2024-01-29 22:33:22 +01:00
Conor McCarthy
3bbe374ca8
vkd3d-shader/dxil: Implement DX intrinsic Tertiary.
...
IBFE and UBFE are not emitted for HLSL sources which perform bitfield
extractions, e.g. loading a value from a struct containing bitfields, or
the equivalent done with bit shifts. These instructions are probably
only emitted by the TPF -> DXIL converter, which makes them hard to test.
2024-01-29 22:33:20 +01:00
Giovanni Mascellani
026c502f31
vkd3d-shader/ir: Fixup PHI nodes when lowering switches to selection ladders.
...
A map between the blocks before and after the pass is built and then
used to fix the PHI nodes.
2024-01-29 22:33:17 +01:00
Giovanni Mascellani
378109051c
vkd3d-shader/ir: Lower monolithic switches to selection ladders.
...
PHI nodes must be fixed up after this pass, because the block references
might have become broken. For simplicitly this is not handled yet.
The goal for this pass is to make the CFG structurizer simpler, because
only conditional and unconditional branches must be supported.
Eventually this limitation might be lifted if there is advantage in
doing so.
2024-01-29 22:33:15 +01:00
Giovanni Mascellani
b97edee03d
vkd3d-shader/spirv: Emit an error if merge information is missing.
...
Instead of crashing.
2024-01-29 22:33:14 +01:00
Conor McCarthy
e08c0cfc4f
vkd3d-shader/dxil: Implement DX intrinsic RawBufferLoad.
2024-01-29 22:33:10 +01:00
Conor McCarthy
1bab93843d
vkd3d-shader/dxil: Load raw/structured buffer SRV/UAV descriptors.
2024-01-29 22:33:09 +01:00
Henri Verbeet
fee3b94563
vkd3d-shader: Start an if-block on VKD3DSIH_IFC in vkd3d_shader_scan_instruction().
2024-01-25 22:24:50 +01:00
Conor McCarthy
f954724870
vkd3d-shader/spirv: Handle the TAN instruction in spirv_compiler_emit_ext_glsl_instruction().
2024-01-25 22:24:44 +01:00
Conor McCarthy
93d7c30395
vkd3d-shader/dxil: Handle DX intrinsic Tan in sm6_parser_emit_dx_unary().
2024-01-25 22:24:43 +01:00
Conor McCarthy
2a260b8d56
vkd3d-shader/dxil: Implement DX intrinsics Cos and Sin.
2024-01-25 22:24:41 +01:00
Francisco Casas
cec45da45b
vkd3d-shader/ir: Update flatten_control_flow_constructs() comment.
2024-01-25 22:24:27 +01:00
Conor McCarthy
8ae69c745b
vkd3d-shader/spirv: Handle thread group UAV barriers.
2024-01-25 22:24:23 +01:00
Conor McCarthy
18e9148f58
vkd3d-shader/spirv: Include Uniform in the memory semantics for UAV barriers.
...
The UniformMemory semantic applies the constraints to Uniform storage
class memory, which matches how UAV variables are declared.
2024-01-25 22:24:22 +01:00
Conor McCarthy
adfbecef3c
vkd3d-shader/spirv: Handle globally coherent UAVs.
2024-01-25 22:24:20 +01:00
Henri Verbeet
eabcaf15fb
vkd3d-shader/ir: Use vsir_instruction_is_dcl() in vsir_validate_instruction().
2024-01-24 22:38:36 +01:00
Henri Verbeet
365ad56888
vkd3d-shader/ir: Get rid of shader_instruction_is_dcl().
2024-01-24 22:38:34 +01:00
Conor McCarthy
54f6e6dd67
vkd3d-shader/spirv: Check for FEATURE_FLOAT64 when double precision use is flagged.
2024-01-24 22:38:09 +01:00
Conor McCarthy
e973271a40
vkd3d-shader/spirv: Handle the ISINF and ISNAN instructions in spirv_compiler_emit_alu_instruction().
2024-01-24 22:38:04 +01:00
Conor McCarthy
cd674d593e
vkd3d-shader/spirv: Implement the ISFINITE instruction.
2024-01-24 22:38:03 +01:00
Conor McCarthy
41cce4cbf1
vkd3d-shader/dxil: Handle floating point special value comparisons in sm6_parser_emit_dx_unary().
2024-01-24 22:37:59 +01:00
Francisco Casas
b92f6c448a
vkd3d-shader/ir: Lower texkill instructions to discard_nz.
2024-01-24 22:37:41 +01:00
Francisco Casas
7e75ac63a1
vkd3d-shader/d3dbc: Emit fixme for HLSL_RESOURCE_SAMPLE_LOD.
...
Currently, HLSL_RESOURCE_SAMPLE_LOD is not implemented for d3dbc,
but we are incorrectly writting a texld instruction to handle it.
This causes SM1 tests with the vulkan backend (in following patches)
to fail if VKD3D_SHADER_CONFIG="force_validation" is enabled.
For now a fixme is emited in these cases.
2024-01-24 22:37:38 +01:00
Henri Verbeet
bf628f0c74
vkd3d-shader/ir: Store block names in struct vsir_program.
2024-01-23 20:27:35 +01:00
Henri Verbeet
f3c7d2d05c
vkd3d-shader/ir: Store the block count in struct vsir_program.
2024-01-23 20:27:34 +01:00
Henri Verbeet
98c6e85b33
vkd3d-shader/ir: Store control point counts in struct vsir_program.
2024-01-23 20:27:32 +01:00
Conor McCarthy
e4660fe0e6
vkd3d-shader/spirv: Emit DISCARD as a function call.
2024-01-23 20:26:59 +01:00
Conor McCarthy
367a06d748
vkd3d-shader/dxil: Use strcmp() to find the handle type.
...
We use strcmp() on the same type name elsewhere, and case-insensitive
matching does not seem necessary.
2024-01-23 20:26:53 +01:00
Conor McCarthy
1cca18a228
vkd3d-shader/dxil: Use strcmp() to find function names.
...
Function names are case-sensitive.
2024-01-23 20:26:52 +01:00
Conor McCarthy
4dec25cbde
vkd3d-shader/dxil: Use strcmp() to check the entry point name.
...
Function names are case-sensitive.
2024-01-23 20:26:50 +01:00
Zebediah Figura
a8b0c03912
vkd3d-shader/hlsl: Always cast to bool in if() statements.
...
We emit sm4 if_nz for these, but that does a bitwise comparison to zero, which is wrong for floats.
2024-01-23 20:26:46 +01:00
Zebediah Figura
183172eff4
vkd3d-shader/hlsl: Validate that condition expressions are numeric.
2024-01-23 20:26:45 +01:00
Zebediah Figura
09220edd21
vkd3d-shader/hlsl: Validate the condition data type for loops as well.
2024-01-23 20:26:44 +01:00
Zebediah Figura
c18a349a3f
vkd3d-shader/hlsl: Copy some missing fields in hlsl_type_clone().
2024-01-23 20:26:42 +01:00
Giovanni Mascellani
de9725b6ba
vkd3d-shader/ir: Remove DCL_TEMPS instructions.
...
We have to do work to keep it updated across passes and we never read it.
2024-01-23 20:26:38 +01:00
Giovanni Mascellani
4b869f73bb
vkd3d-shader/ir: Run tracing and validation for DXIL code too.
2024-01-23 20:26:36 +01:00
Conor McCarthy
6df725718a
vkd3d-shader/ir: Refactor return code checking in vkd3d_shader_normalise().
...
We started with only one or two of these but it has become excessive.
Patch originally written by Conor McCarthy and updated by Giovanni Mascellani.
2024-01-23 20:26:34 +01:00
Conor McCarthy
b3903636f7
vkd3d-shader/dxil: Implement DX intrinsic Binary.
2024-01-23 20:26:29 +01:00
Conor McCarthy
6c71cd5a72
vkd3d-shader/dxil: Add an operand type code for the return type.
2024-01-23 20:26:28 +01:00
Nikolay Sivov
0117e4fb7e
vkd3d-shader/fx: Add initial support for writing passes for fx_2_0.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:22 +01:00
Nikolay Sivov
b478f0a300
vkd3d-shader/fx: Add initial support for writing fx_2_0 binaries.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:21 +01:00
Nikolay Sivov
56100d36b1
vkd3d-shader/fx: Check technique type in global scope as well.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:20 +01:00
Nikolay Sivov
2c1905b780
vkd3d-shader/hlsl: Allow annotations on techniques.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:19 +01:00
Nikolay Sivov
76a689d43f
vkd3d-shader/hlsl: Allow annotations on passes.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:18 +01:00
Nikolay Sivov
e72f8f9a30
vkd3d-shader/hlsl: Add passes variables to the techniques.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:16 +01:00
Nikolay Sivov
fe8881747b
vkd3d-shader/hlsl: Add initial support for parsing annotations.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:15 +01:00
Giovanni Mascellani
232b2ad360
vkd3d-shader/ir: Validate PHI instructions.
2024-01-23 20:26:08 +01:00
Giovanni Mascellani
56f9057985
vkd3d-shader/ir: Do not allow IMMCONST and IMMCONST64 as destination registers.
2024-01-23 20:26:06 +01:00
Giovanni Mascellani
21633fcc52
vkd3d-shader/ir: Refactor register-type-specific code in parameter validation.
...
To better accommodate code for other register types.
2024-01-23 20:26:05 +01:00
Giovanni Mascellani
fb6409bda1
vkd3d-shader/ir: Check that all instructions appear in a block.
2024-01-23 20:26:03 +01:00
Giovanni Mascellani
dc56320b31
vkd3d-shader/tpf: Support SV_ViewportArrayIndex in pixel and vertex shaders.
2024-01-22 22:19:14 +01:00
Giovanni Mascellani
3a90f3e29d
vkd3d-shader/tpf: Support SV_InstanceID in vertex shaders.
2024-01-22 22:19:13 +01:00
Giovanni Mascellani
b500381b5c
vkd3d-shader/tpf: Support SV_RenderTargetArrayIndex in pixel and vertex shaders.
2024-01-22 22:19:12 +01:00
Giovanni Mascellani
45495f54f2
vkd3d-shader/spirv: Use capability ShaderViewportIndexLayerEXT for decoration ViewportIndex.
2024-01-22 22:19:11 +01:00
Giovanni Mascellani
6ac525d6c3
vkd3d-shader/spirv: Use capability ShaderViewportIndexLayerEXT for decoration Layer.
...
Capability Geometry allows to use the Layer builtin in geometry and pixel
shaders. For vertex and domain shaders ShaderLayer should be used, but it's only
available starting from SPIR-V 1.5. ShaderViewportIndexLayerEXT can be used
instead with extension SPV_EXT_shader_viewport_index_layer.
2024-01-22 22:19:09 +01:00
Henri Verbeet
adc02eada8
vkd3d-shader/ir: Store the temporary register count in struct vsir_program.
2024-01-22 22:18:53 +01:00
Henri Verbeet
94ca46916a
vkd3d-shader/ir: Store the SSA register count in struct vsir_program.
2024-01-22 22:18:52 +01:00
Henri Verbeet
7b85cd6a31
vkd3d-shader/ir: Store the "use_vocp" field in struct vsir_program.
2024-01-22 22:18:51 +01:00
Henri Verbeet
23dcd4f22b
vkd3d-shader/ir: Store the shader version in struct vsir_program.
2024-01-22 22:18:50 +01:00
Henri Verbeet
fc9043be3c
vkd3d-shader/ir: Introduce struct vsir_program.
2024-01-22 22:18:48 +01:00
Conor McCarthy
55c7cd5c22
vkd3d-shader/dxil: Handle semantic kind ISFRONTFACE.
2024-01-22 22:18:33 +01:00
Conor McCarthy
9f409b67d7
vkd3d-shader/dxil: Handle semantic kind VERTEXID.
2024-01-22 22:18:32 +01:00
Conor McCarthy
ca7487a56d
vkd3d-shader/spirv: Handle UINT32_MAX result from FIRSTBIT_HI and FIRSTBIT_SHI instructions.
2024-01-22 22:18:27 +01:00
Conor McCarthy
bfdc8b31a3
vkd3d-shader/dxil: Implement DX intrinsic BufferLoad for typed buffers.
2024-01-22 22:18:21 +01:00
Conor McCarthy
85052ba93e
vkd3d-shader/dxil: Load typed UAV descriptors.
2024-01-22 22:18:19 +01:00
Conor McCarthy
89d1ef83f4
vkd3d-shader/dxil: Load typed SRV descriptors.
2024-01-22 22:18:18 +01:00
Conor McCarthy
5ebe0cc717
vkd3d-shader/spirv: Do not assert VKD3D_DATA_UINT in spirv_compiler_emit_ld_raw_structured_srv_uav().
2024-01-22 22:18:17 +01:00
Conor McCarthy
80d7ea2924
vkd3d-shader/dxil: Pass the code block and instruction in a struct to intrinsic handlers.
...
Simplifies handling of intrinsics which need to emit more than one
instruction.
2024-01-22 22:18:16 +01:00
Henri Verbeet
f69c8b1cc4
vkd3d-shader/d3dbc: Store the "offset" field as an unsigned int in hlsl_sm1_register_from_semantic().
2024-01-18 23:16:06 +01:00
Giovanni Mascellani
67902d4304
vkd3d-shader/ir: Validate RET instructions.
2024-01-18 23:15:58 +01:00
Giovanni Mascellani
af96730276
vkd3d-shader/ir: Validate SWITCH_MONOLITHIC instructions.
2024-01-18 23:15:57 +01:00
Giovanni Mascellani
46ebb404d7
vkd3d-shader/ir: Validate BRANCH instructions.
2024-01-18 23:15:56 +01:00
Giovanni Mascellani
bc9db34cdc
vkd3d-shader/ir: Validate LABEL instructions.
2024-01-18 23:15:55 +01:00
Giovanni Mascellani
dd1b2feec0
vkd3d-shader/ir: Validate LABEL registers.
2024-01-18 23:15:54 +01:00
Giovanni Mascellani
17f4afc2b5
vkd3d-shader/ir: Validate that structured CF does not appear in block-based shaders.
2024-01-18 23:15:53 +01:00
Giovanni Mascellani
1d45b7a422
vkd3d-shader/spirv: Normalise the shader before allocating registers.
...
So registers are allocated after normalisation (which could require
additional registers).
2024-01-18 23:15:48 +01:00
Zebediah Figura
9ad48f16ea
vkd3d-shader/hlsl: Forbid mismatched argument types in ternaries.
2024-01-18 23:15:44 +01:00
Zebediah Figura
275901557c
vkd3d-shader/hlsl: Handle scalar values in ternaries.
2024-01-18 23:15:43 +01:00
Zebediah Figura
11112798c8
vkd3d-shader/hlsl: Handle scalar conditions in ternaries.
2024-01-18 23:15:42 +01:00
Zebediah Figura
2c8751478f
vkd3d-shader/hlsl: Forbid objects in ternary conditions.
2024-01-18 23:15:41 +01:00
Giovanni Mascellani
38fdf24002
vkd3d-shader: Make relative address sources mutable too.
...
They were forgotten in 78d95889bd
.
Fixes: 78d95889bd
2024-01-18 23:15:35 +01:00
Conor McCarthy
83851133c5
vkd3d-shader/ir: Set merged signature element interpolation mode only from used elements.
2024-01-18 23:15:27 +01:00
Conor McCarthy
b8280e4210
vkd3d-shader/ir: Revert "Do not merge signature elements which have different interpolation modes.".
...
This reverts commit b5c067b41a
.
The commit causes regressions in other shaders because unused elements
do not have an interpolation mode.
2024-01-18 23:15:25 +01:00
Conor McCarthy
efe800f7f0
vkd3d-shader/dxil: Handle the DXIL SWITCH instruction.
2024-01-18 23:15:14 +01:00
Conor McCarthy
ba1ee27b4b
vkd3d-shader/dxil: Handle the DXIL PHI instruction.
2024-01-18 23:15:12 +01:00
Conor McCarthy
8a5804eb43
vkd3d-shader/dxil: Handle the DXIL BR instruction conditional variant.
2024-01-18 23:15:10 +01:00
Conor McCarthy
c9493884ef
vkd3d-shader/dxil: Handle the DXIL BR instruction unconditional variant.
2024-01-18 23:15:03 +01:00
Conor McCarthy
9e964fa0c7
vkd3d-shader/dxil: Introduce a code block terminator struct.
2024-01-18 23:15:01 +01:00
Conor McCarthy
c40093474e
vkd3d-shader/tpf: Validate sysvals in index range declarations.
2024-01-17 22:29:01 +01:00
Conor McCarthy
4c30b23821
vkd3d-shader: Make the control point count the outer dimension of I/O arrays.
...
The relative-addressed case in shader_register_normalise_arrayed_addressing()
leaves the control point id in idx[0], while for constant register
indices it is placed in idx[1]. The latter case could be fixed instead,
but placing the control point count in the outer dimension is more
logical.
2024-01-17 22:28:59 +01:00
Conor McCarthy
418e8d8100
vkd3d-shader/ir: Expand index range write masks to cover all element masks.
...
For example, this occurred in a shader:
reg_idx write_mask
0 xyz
1 xyzw
2 xyzw
3 xyz
The dcl_indexrange instruction covered only xyz, so once merged, searching for
xyzw failed.
It is impossible to declare an input array where elements have different
component counts, but the optimiser can create this case. One way for
this to occur is to dynamically index input values via a local array
containing copies of the input values. The optimiser converts this to
dynamically indexed inputs.
2024-01-17 22:28:56 +01:00
Zebediah Figura
16962ac6f1
vkd3d-shader/hlsl: Allow non-numeric types in the ternary operator.
2024-01-17 22:28:51 +01:00
Zebediah Figura
46bd099341
vkd3d-shader/hlsl: Separate an add_ternary() helper.
2024-01-17 22:28:50 +01:00
Zebediah Figura
a5549bae38
vkd3d-shader/hlsl: Do not try to lower ternaries of types other than scalar or vector.
2024-01-17 22:28:49 +01:00
Zebediah Figura
e0b1f2e273
vkd3d-shader/hlsl: Remove a redundant definition of the "float" type.
2024-01-17 22:28:47 +01:00
Conor McCarthy
559d9d4ee0
vkd3d-shader/ir: Include an initial label instruction in the first control flow block.
2024-01-17 22:28:41 +01:00
Conor McCarthy
d402804851
vkd3d-shader/spirv: Do not emit function code before the main prolog.
2024-01-17 22:28:40 +01:00
Conor McCarthy
b4b2b0d3ac
vkd3d-shader/spirv: Declare indexable temps as Private unless function scope is specified.
2024-01-17 22:28:39 +01:00
Conor McCarthy
37d9dba512
vkd3d-shader/ir: Store code block names in struct vkd3d_shader_desc.
2024-01-17 22:28:38 +01:00
Conor McCarthy
ffc65215ba
vkd3d-shader/ir: Flatten SWITCH/CASE/DEFAULT/ENDSWITCH control flow instructions.
2024-01-17 22:28:36 +01:00
Conor McCarthy
dcb8527327
vkd3d-shader/ir: Flatten LOOP/BREAK/CONTINUE/ENDLOOP control flow instructions.
2024-01-17 22:28:35 +01:00
Conor McCarthy
e1dddc01b7
vkd3d-shader/ir: Flatten IF/ELSE/ENDIF control flow instructions.
2024-01-17 22:28:34 +01:00
Conor McCarthy
f3d464de0e
vkd3d-shader/spirv: Handle RETP in spirv_compiler_handle_instruction().
2024-01-17 22:28:33 +01:00
Conor McCarthy
bc1b5e7132
vkd3d-shader/spirv: Handle DISCARD and TEXKILL in spirv_compiler_handle_instruction().
2024-01-17 22:28:31 +01:00
Conor McCarthy
db0d51675c
vkd3d-shader/spirv: Emit descriptor offset loads in the function entry block.
...
Ensures they are loaded only once per function independent of the
control flow graph.
2024-01-17 22:28:29 +01:00
Henri Verbeet
68b898fcb6
vkd3d-shader/tpf: Store the "precise" mask as a uint32_t in shader_sm4_read_instruction().
2024-01-15 19:58:22 +01:00
Henri Verbeet
ad2af68d2a
vkd3d-shader/tpf: Store the "recognized_bits" mask as a uint32_t in shader_sm4_read_instruction_modifier().
2024-01-15 19:58:21 +01:00
Henri Verbeet
b8903f5526
vkd3d-shader/tpf: Store the current token as a uint32_t in shader_sm4_read_dst_param().
2024-01-15 19:58:20 +01:00
Henri Verbeet
fd854bc0c0
vkd3d-shader/tpf: Store the current token as a uint32_t in shader_sm4_read_src_param().
2024-01-15 19:58:19 +01:00
Henri Verbeet
c5facd4e03
vkd3d-shader/tpf: Store the "addressing" token as a uint32_t in shader_sm4_read_param().
2024-01-15 19:58:18 +01:00
Henri Verbeet
b1c538e0fe
vkd3d-shader/tpf: Store the "components" token as a uint32_t in shader_sm4_read_dcl_resource().
2024-01-15 19:58:17 +01:00
Henri Verbeet
9896394220
vkd3d-shader/tpf: Pass a uint32_t modifier token to shader_sm4_read_instruction_modifier().
2024-01-15 19:58:15 +01:00
Nikolay Sivov
1a036ddff6
vkd3d-shader/fx: Do not write the same string twice.
2024-01-15 19:57:43 +01:00
Nikolay Sivov
e7d65d39ba
vkd3d-shader/fx: Initial support for fx_5_0 output.
2024-01-15 19:57:42 +01:00
Nikolay Sivov
8014c11e88
vkd3d-shader/fx: Write empty passes blocks.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-15 19:57:41 +01:00
Nikolay Sivov
e1dca9b27a
vkd3d-shader/hlsl: Add a scope for technique variables.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-15 19:57:39 +01:00
Nikolay Sivov
0a6d842ed1
vkd3d-shader/hlsl: Rename the rule for an optional name.
...
Names are optional for both techniques and passes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-15 19:57:37 +01:00
Francisco Casas
43ff28b00b
vkd3d-shader/hlsl: Emit fixmes on non-constant vector addressing.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56162
Storing to a vector component using a non-constant index is not allowed
on profiles lower than 6.0. Unless this happens inside a loop that can be
unrolled, which we are not doing yet.
For this reason, a validate_nonconstant_vector_store_derefs pass is
added to detect these cases.
Ideally we would want to emit an hlsl_error on this pass, but before
implementing loop unrolling, we could reach this point on valid HLSL.
Also, as pointed out by Nikolay in the mentioned bug, currently
new_offset_from_path_index() fails an assertion when this happens,
because it expects an hlsl_ir_constant, so a check is added.
It also felt correct to emit an hlsl_fixme there, despite the
redundancy.
2024-01-15 19:57:12 +01:00
Giovanni Mascellani
b0c8a47f9d
vkd3d-shader/ir: Check that SSA registers are used validly.
...
Specifically, they are assigned only once and only assigned components
are used.
Right now we don't check that the assignment dominates all usages.
2024-01-15 19:57:01 +01:00
Giovanni Mascellani
26bebe8f91
vkd3d-shader/ir: Check that SSA registers have consistent dimensions.
2024-01-15 19:57:00 +01:00
Giovanni Mascellani
7503429555
vkd3d-shader/ir: Check that TEMP registers have consistent dimensions.
2024-01-15 19:56:59 +01:00
Giovanni Mascellani
fbd77486de
vkd3d-shader/ir: Use vkd3d_free() instead of free().
2024-01-15 19:56:58 +01:00
Giovanni Mascellani
26c6a87268
vkd3d-shader/ir: Simplify control flow in vsir_validate_register().
2024-01-15 19:56:56 +01:00
Conor McCarthy
52902b042f
vkd3d-shader/spirv: Support vector source param for FIRSTBIT_HI and FIRSTBIT_SHI instructions.
2024-01-15 19:56:35 +01:00
Henri Verbeet
3e2ace8d33
vkd3d-shader/dxbc: Use sizeof(uint32_t) instead of sizeof(DWORD) in calls to require_space().
2024-01-11 23:05:56 +01:00
Henri Verbeet
69350e1ff0
vkd3d-shader/dxbc: Pass an unsigned int count to shader_parse_root_parameters1().
2024-01-11 23:05:54 +01:00
Henri Verbeet
04acc52496
vkd3d-shader/dxbc: Pass a size_t offset to shader_get_string().
2024-01-11 23:05:52 +01:00
Conor McCarthy
ac9b14599f
vkd3d-shader/dxil: Avoid null dereference on failure to find function pointer type.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55684
2024-01-11 23:05:17 +01:00
Giovanni Mascellani
78d95889bd
vkd3d-shader: Make *src and *dst mutable in vkd3d_shader_instruction.
...
They were originally made const because no optimization/normalization
pass existed. Now having to cast away const all the time is becoming
more and more burdening.
2024-01-11 23:05:11 +01:00
Henri Verbeet
fd8a0d7fb6
vkd3d-shader/spirv: Pass a uint32_t write mask to spirv_compiler_emit_neg().
2024-01-11 23:05:03 +01:00
Henri Verbeet
b4da553d28
vkd3d-shader/spirv: Pass a uint32_t write mask to spirv_compiler_emit_abs().
2024-01-11 23:05:02 +01:00
Henri Verbeet
97acca715e
vkd3d-shader/spirv: Pass a uin32_t write mask to spirv_compiler_emit_load_src().
2024-01-11 23:05:01 +01:00
Henri Verbeet
5c2d0f42b5
vkd3d-shader/spirv: Pass a uint32_t write mask to vkd3d_symbol_set_register_info().
2024-01-11 23:05:00 +01:00
Henri Verbeet
9dd5b2840f
vkd3d-shader: Recognise DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS in shader_validate_descriptor_range1().
2024-01-11 23:04:54 +01:00
Nikolay Sivov
a0207436f2
vkd3d-shader/tpf: Add initial support for writing fx_4_0/fx_4_1 binaries.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:48 +01:00
Nikolay Sivov
9494b72224
vkd3d-shader: Add separate binary target type for effects.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:48 +01:00
Nikolay Sivov
e527d7c1e7
vkd3d-shader/hlsl: Handle effect group statement.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:46 +01:00
Nikolay Sivov
f7a02a5da2
vkd3d-shader/hlsl: Add variables for techniques.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:45 +01:00
Nikolay Sivov
8494342fa0
vkd3d-shader/hlsl: Rename rule for top-level techniques.
...
Only technique10 and technique11 types could be nested in groups.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:43 +01:00
Nikolay Sivov
c3af1f9989
vkd3d-shader/hlsl: Add 'fxgroup' token.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:42 +01:00
Giovanni Mascellani
017f86aaaf
vkd3d-shader/d3d-asm: Guess a sensible data type for literals.
...
When the typing information is not reliable.
2024-01-11 23:04:34 +01:00
Henri Verbeet
3344c4e93d
vkd3d-shader/hlsl: Store modifier flags as a uint32_t.
2024-01-08 21:45:26 +01:00
Henri Verbeet
fafe2a1dba
vkd3d-shader/hlsl: Store swizzles as a uint32_t.
2024-01-08 21:45:24 +01:00
Giovanni Mascellani
7f9803620f
vkd3d-shader/spirv: Specify behavior for bit field instructions.
...
Bit field instructions in SPIR-V do not specify what happens when
offset + count exceeds the type bit width. After this commit we
refine the emitted code's behavior to match TPF.
This fixes a few failures on MoltenVK.
2024-01-08 21:44:52 +01:00
Henri Verbeet
5b9a0dfaea
vkd3d-shader/ir: Store destination parameter shifts as an unsigned int.
2024-01-04 22:23:54 +01:00
Henri Verbeet
4b5d3a078b
vkd3d-shader/ir: Store destination parameter modifier flags as a uint32_t.
2024-01-04 22:23:52 +01:00
Henri Verbeet
60842b7181
vkd3d-shader/ir: Store source parameter swizzles as a uint32_t.
2024-01-04 22:23:51 +01:00
Henri Verbeet
9f4ca3bc9c
vkd3d-shader/ir: Store instruction flags as a uint32_t.
2024-01-04 22:23:49 +01:00
Giovanni Mascellani
bd9118cac4
vkd3d-shader/ir: Validate destination write masks depending on the dimension.
2024-01-04 22:23:25 +01:00
Giovanni Mascellani
15e7711786
vkd3d-shader/ir: Validate source swizzles depending on the dimension.
2024-01-04 22:23:24 +01:00
Giovanni Mascellani
e91da41dea
vkd3d-shader/ir: Validate SSA registers.
2024-01-04 22:23:23 +01:00
Giovanni Mascellani
e29ae1550c
vkd3d-shader/dxil: Create constant buffer registers with dimension vec4.
2024-01-04 22:23:21 +01:00
Giovanni Mascellani
df2ae56de8
vkd3d-shader/d3dbc: Override the write mask when the destination is not vec4.
2024-01-04 22:23:20 +01:00
Zebediah Figura
1ce7e3d8b1
vkd3d-shader/d3dbc: Assign unique register indices for VKD3DSPR_RASTOUT.
2024-01-04 22:23:09 +01:00
Zebediah Figura
3f52fda8ad
vkd3d-shader: Lower shader model 1/2 inter-stage I/O to a flat array.
...
An alternative is that we stash the reg_type in the signature, but this seems
far simpler for the backend to deal with.
2024-01-04 22:23:07 +01:00
Giovanni Mascellani
3bafee344d
vkd3d-shader/dxil: Use vkd3d_shader_parser_error() for error reporting when available.
2024-01-03 22:38:26 +01:00
Giovanni Mascellani
a02cd1cf64
vkd3d-shader/dxil: Do not use the parser before it is initialized.
2024-01-03 22:38:24 +01:00
Conor McCarthy
111818eabb
vkd3d-shader/dxil: Pre-allocate instruction space for globals in sm6_parser_globals_init().
...
For simplicity, declaration handlers assume instruction allocation will
not fail.
2024-01-03 22:38:21 +01:00
Conor McCarthy
8aa6e2228e
vkd3d-shader/dxil: Count global variables in dxil_block_compute_module_decl_count().
2024-01-03 22:38:19 +01:00
Henri Verbeet
ed4f3f3272
vkd3d-shader/ir: Rename the "immconst_double" field of struct vkd3d_shader_register to "immconst_f64".
2024-01-03 22:37:49 +01:00
Henri Verbeet
7f94fda05c
vkd3d-shader/ir: Rename the "immconst_uint64" field of struct vkd3d_shader_register to "immconst_u64".
2024-01-03 22:37:43 +01:00
Henri Verbeet
05a542ba00
vkd3d-shader/ir: Rename the "immconst_float" field of struct vkd3d_shader_register to "immconst_f32".
2024-01-03 22:37:41 +01:00
Henri Verbeet
e33d3b3954
vkd3d-shader/ir: Rename the "immconst_uint" field of struct vkd3d_shader_register to "immconst_u32".
...
For consistency with the rest of vkd3d-shader; e.g. put_u32() and
read_u32().
2024-01-03 22:37:39 +01:00
Conor McCarthy
78343dcf87
vkd3d-shader/spirv: Decorate non-float32 non-built-in pixel shader inputs as Flat.
...
As per VUID-StandaloneSpirv-Flat-04744. Not strictly a regression, but
revealed by 66cb2815f
because it declares unused inputs.
2024-01-02 23:03:59 +01:00
Conor McCarthy
812f01c2e2
vkd3d-shader/spirv: Handle ITOI and UTOU in spirv_compiler_map_alu_instruction().
...
These instructions perform integer casts to/from 64 bits.
2024-01-02 23:03:07 +01:00
Conor McCarthy
1eaa7d1dbe
vkd3d-shader/spirv: Support UINT64 source in spirv_compiler_emit_bool_cast().
2024-01-02 23:03:06 +01:00
Conor McCarthy
99924d913b
vkd3d-shader/spirv: Support 64-bit sources in spirv_compiler_emit_int_div().
2024-01-02 23:03:05 +01:00
Conor McCarthy
13459a55f1
vkd3d-shader/spirv: Introduce a UINT64 component type.
2024-01-02 23:03:04 +01:00
Conor McCarthy
fe44873979
vkd3d-shader/spirv: Introduce a data_type_is_64_bit() helper function.
2024-01-02 23:03:03 +01:00
Conor McCarthy
511c66d595
vkd3d-shader/spirv: Use data_type_is_integer() in spirv_compiler_emit_neg().
2024-01-02 23:03:02 +01:00
Henri Verbeet
f96a791807
vkd3d-shader/ir: Pass a uint32_t swizzle to vkd3d_swizzle_get_component64().
2023-12-14 23:19:51 +01:00
Henri Verbeet
8a1de71fb1
vkd3d-shader/ir: Pass a uint32_t swizzle to vkd3d_swizzle_get_component().
2023-12-14 23:19:49 +01:00
Zebediah Figura
4ff389854c
vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.
2023-12-14 23:19:31 +01:00
Zebediah Figura
2bc40385d9
vkd3d-shader: Do not scan DCL instructions which do not declare resources.
2023-12-14 23:19:28 +01:00
Zebediah Figura
8af47a96ea
vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
2023-12-14 23:19:28 +01:00
Henri Verbeet
21491d1bbb
vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_32_from_64().
2023-12-13 22:33:07 +01:00
Henri Verbeet
3759186193
vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_64_from_32().
2023-12-13 22:33:06 +01:00
Henri Verbeet
713adaa56a
vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_component_count().
2023-12-13 22:33:04 +01:00
Henri Verbeet
e1aa12f94b
vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_get_component_idx().
2023-12-13 22:33:03 +01:00
Giovanni Mascellani
ec4986e9e2
vkd3d-shader/spirv: Honor force_validation after emitting SPIR-V code.
2023-12-13 22:32:25 +01:00
Giovanni Mascellani
1015cc952e
vkd3d-shader/d3d-asm: Add an "internal" mode for the ASM dumper.
...
The new mode exposes more details about what's going on inside the VSIR
code and it's meant to ease development and debugging.
2023-12-12 23:16:26 +01:00
Giovanni Mascellani
e7fdf2e97f
vkd3d-shader/d3d-asm: Dump unknown types as "<unknown>".
...
In analogy with "<continued>" and "<unused>".
2023-12-12 23:16:24 +01:00
Giovanni Mascellani
1caaf90ee2
vkd3d-shader/d3d-asm: Dump recently added types.
2023-12-12 23:16:23 +01:00
Giovanni Mascellani
4b6e596740
vkd3d-shader/d3d-asm: Write a single type in shader_dump_data_type().
2023-12-12 23:16:22 +01:00