Commit Graph

3707 Commits

Author SHA1 Message Date
Nikolay Sivov
8c5db57ea7 vkd3d-shader/fx: Reject fx_2_0 output without techniques.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-06 23:04:19 +01:00
Nikolay Sivov
dd5e42d347 vkd3d-shader/hlsl: Allow technique10 {} blocks for fx_2_0.
Such techniques are ignored later, but do not cause compilation errors.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-06 23:04:18 +01:00
Nikolay Sivov
5edbccd33b vkd3d-shader/hlsl: Add keyword tokens for fx_5_0 shader object types.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-06 23:04:16 +01:00
Conor McCarthy
5082893e5d vkd3d-shader/spirv: Always use a 64-bit write mask for IMMCONST64 src params.
There is no way to tell in spirv_compiler_emit_load_reg() if the write
mask is 64-bit. All loads are 32-bit except for IMMCONST64 and SSA, and
the latter ignores the mask, so the only issue lies with IMMCONST64.
2024-03-06 23:04:12 +01:00
Francisco Casas
58c456ff2b vkd3d-shader/d3dbc: Implement bool to float cast as MOV.
In SM1, bools are always represented as either 0.0f or 1.0f at runtime.
2024-03-06 23:04:07 +01:00
Francisco Casas
747511131d vkd3d-shader/hlsl: Lower non-float operators for SM1. 2024-03-06 23:04:05 +01:00
Francisco Casas
a3319339e4 vkd3d-shader/hlsl: Lower casts to int using REINTERPRET instead.
I realized that it is better to lower casts to int to FLOOR+REINTERPET
instead of appending a FLOOR to all casts to int and assuming that this
is the case for all of them in d3dbc.c.

This in case we introduce new passes in the future that add casts that
we forget to lower, after the lower_casts_to_bool pass.
2024-03-06 23:04:04 +01:00
Nikolay Sivov
937d76507d vkd3d-shader/hlsl: Implement ternary operator for older vertex profiles.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56333
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-06 23:03:59 +01:00
Henri Verbeet
f866fb95ad Release 1.11. 2024-03-05 20:39:45 +01:00
Zebediah Figura
9177df883e vkd3d-shader/hlsl: Write the SFI0 section and "REQUIRES_ROVS" flag when ROVs are used. 2024-03-04 22:34:46 +01:00
Henri Verbeet
0914561f85 vkd3d: Store a D3D12_RESOURCE_DESC structure in struct vkd3d_image_resource_create_info.
Like we did before commit 6d4782ed7f. That
commit somehow managed to change the "desc" field from
D3D12_RESOURCE_DESC to D3D12_RESOURCE_DESC1, but that breaks the ABI.
2024-02-26 23:04:05 +01:00
Victor Chiletto
7e27ae73af vkd3d-shader/hlsl: Fix hlsl_ir_resource_store::resource cleanup. 2024-02-26 23:03:51 +01:00
Conor McCarthy
c083b1d0fc vkd3d-shader/dxil: Implement DX intrinsic GetDimensions. 2024-02-26 23:03:48 +01:00
Conor McCarthy
292bbdefbf vkd3d-shader/dxil: Move the resource kind helper functions up. 2024-02-26 23:03:46 +01:00
Henri Verbeet
d65f331efc configure: Build with -Wwrite-strings.
libs/vkd3d-shader/hlsl.c: In function ‘declare_predefined_types’:
libs/vkd3d-shader/hlsl.c:3408:10: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         {"technique",    9},
          ^~~~~~~~~~~
...
programs/vkd3d-compiler/main.c: In function ‘parse_formatting’:
programs/vkd3d-compiler/main.c:303:10: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         {"colour",  VKD3D_SHADER_COMPILE_OPTION_FORMATTING_COLOUR},
          ^~~~~~~~
...

macOS tigetstr() takes a non-const char *, so account for that as well.
2024-02-22 22:46:29 +01:00
Henri Verbeet
7029d821be configure: Build with -Wtype-limits.
libs/vkd3d-shader/tpf.c: In function ‘write_sm4_unary_op_with_two_destinations’:
libs/vkd3d-shader/tpf.c:4489:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(1 - dst_idx >= 0);
                        ^~
libs/vkd3d-shader/tpf.c: In function ‘write_sm4_binary_op_with_two_destinations’:
libs/vkd3d-shader/tpf.c:4549:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(1 - dst_idx >= 0);
                        ^~
2024-02-22 22:46:22 +01:00
Henri Verbeet
773f02d82f vkd3d: Disable "robustBufferAccess2" as well when we disable "robustBufferAccess".
From the validation layers: "If robustBufferAccess2 is enabled then
robustBufferAccess must also be enabled
(https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkPhysicalDeviceRobustness2FeaturesEXT-robustBufferAccess2-04000)"
2024-02-22 22:45:46 +01:00
Conor McCarthy
ba4bd651e5 vkd3d-shader/dxil: Implement DX intrinsics SampleCmp and SampleCmpLevelZero. 2024-02-22 22:45:36 +01:00
Conor McCarthy
2330ffdeda vkd3d-shader/dxil: Implement DX intrinsics SampleBias and SampleLevel. 2024-02-22 22:45:34 +01:00
Zebediah Figura
87b1de94da vkd3d-shader/hlsl: Check the resource format for UAVs also in hlsl_types_are_equal().
Spotted by Henri Verbeet.
2024-02-22 22:45:31 +01:00
Nikolay Sivov
5474d91804 vkd3d-shader/fx: Write DepthStencilView types. 2024-02-22 22:45:27 +01:00
Nikolay Sivov
371be3b60a vkd3d-shader/hlsl: Add DepthStencilView object type. 2024-02-22 22:45:26 +01:00
Nikolay Sivov
9632adaaec vkd3d-shader/fx: Handle fx_4+ UAV types. 2024-02-22 22:45:24 +01:00
Nikolay Sivov
e5f4f60214 vkd3d-shader/fx: Handle fx_4+ texture types. 2024-02-22 22:45:23 +01:00
Nikolay Sivov
a6057a1365 vkd3d-shader/fx: Add initial support for writing object variables.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-02-22 22:45:22 +01:00
Nikolay Sivov
c2b1714c5c vkd3d-shader/hlsl: Add RenderTargetView object type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-02-22 22:45:21 +01:00
Giovanni Mascellani
9c678532a7 vkd3d-shader/ir: Dump the domination relationship. 2024-02-22 22:45:16 +01:00
Giovanni Mascellani
04c2852c1a vkd3d-shader/ir: Compute the domination relationship. 2024-02-22 22:45:15 +01:00
Giovanni Mascellani
2573d86ccf vkd3d-shader/ir: Dump the control flow graph in the GraphViz format. 2024-02-22 22:45:14 +01:00
Giovanni Mascellani
da037b61ba vkd3d-shader/ir: Build a representation of the control flow graph. 2024-02-22 22:45:13 +01:00
Conor McCarthy
1dffc281c9 vkd3d-shader/dxil: Implement DX intrinsic RawBufferStore. 2024-02-22 22:45:08 +01:00
Conor McCarthy
cab8b781ab vkd3d-shader/dxil: Handle raw and structured buffers in sm6_parser_emit_dx_buffer_store(). 2024-02-22 22:45:07 +01:00
Conor McCarthy
ce1875c435 vkd3d-shader/dxil: Implement DX intrinsic BufferStore. 2024-02-22 22:45:06 +01:00
Petrichor Park
02a3667822 vkd3d-shader/hlsl: Implement atan and atan2.
Also narrows some more todos on the tests.
2024-02-21 23:23:13 +01:00
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