Commit Graph

3427 Commits

Author SHA1 Message Date
Giovanni Mascellani
85856473f6 vkd3d-shader/hlsl: Write SM4 fractional part instructions.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
2022-10-19 21:59:13 +02:00
Francisco Casas
09d7442cb1 tests: Test explicit casts between types that are component-wise compatible. 2022-10-17 17:59:04 +02:00
Francisco Casas
653b109d8f tests: Test implicit casts between types that are equal component-wise. 2022-10-17 17:59:01 +02:00
Francisco Casas
5a1b0dbf44 vkd3d-shader/hlsl: Always go through implicit conversion in assignments.
Otherwise we silently skip some type checks.
2022-10-17 17:58:56 +02:00
Francisco Casas
e56db9bda5 tests: Test for invalid complex broadcasts. 2022-10-17 17:58:56 +02:00
Francisco Casas
791f8a8faa tests: Rename structs for readability in broadcast test. 2022-10-17 17:58:53 +02:00
Francisco Casas
3bae0c92c7 tests: Set ULPs to 2 in normalize() test.
Otherwise the test fails on a NVIDIA GeForce GTX 1050 Ti GPU.

The error being:
shader_runner:535:Section [test], line 9: Test failed: Got {2.72165507e-01, 4.08248246e-01, 5.44331014e-01, 6.80413783e-01}, expected {2.72165537e-01, 4.08248305e-01, 5.44331074e-01, 6.80413842e-01} at (0, 0).
2022-10-17 17:58:50 +02:00
Francisco Casas
ab8f418207 tests: Add missing backslash to restore skipped tests.
Tests after this missing backslash are not being executed since
e9829fdc65.
2022-10-17 17:58:35 +02:00
Giovanni Mascellani
eb7b594002 vkd3d-shader/hlsl: Lower int division. 2022-10-17 17:58:17 +02:00
Giovanni Mascellani
4c13ae5764 vkd3d-shader/hlsl: Lower int absolute value. 2022-10-17 17:58:14 +02:00
Giovanni Mascellani
ef4990d996 tests: Test int absolute value. 2022-10-17 17:58:14 +02:00
Giovanni Mascellani
5442f4236c vkd3d-shader/hlsl: Write SM4 square root instructions. 2022-10-17 17:58:12 +02:00
Giovanni Mascellani
8e5aefb309 vkd3d-shader/hlsl: Parse length() intrinsic. 2022-10-17 17:58:09 +02:00
Giovanni Mascellani
a43242a3e6 tests: Test length() intrinsic. 2022-10-17 17:58:09 +02:00
Zebediah Figura
303ce66cef include: Use __MINGW_PRINTF_FORMAT when compiling with MinGW.
The default for MinGW is always ms_printf rather than gnu_printf, but if we are
using ucrtbase or ANSI stdio, we want gnu_printf.
2022-10-17 17:57:56 +02:00
Zebediah Figura
6b45f290f7 vkd3d-shader/hlsl: Pass a location pointer to init_node().
Instead of a flat location structure.
2022-10-12 21:58:03 +02:00
Zebediah Figura
20fc4375ad vkd3d-shader/hlsl: Introduce a hlsl_new_expr() helper. 2022-10-12 21:58:01 +02:00
Zebediah Figura
1e10b5e616 vkd3d-shader/hlsl: Write SM4 reinterpret instructions. 2022-10-12 21:57:59 +02:00
Zebediah Figura
2d4d2e1244 vkd3d-shader/hlsl: Parse the asuint() intrinsic. 2022-10-12 21:57:57 +02:00
Zebediah Figura
eb70f1aeb5 tests: Add a test for asuint(). 2022-10-12 21:57:55 +02:00
Giovanni Mascellani
3d85d77ced demos/gears: Recompile shaders with our compiler. 2022-10-10 21:13:50 +02:00
Giovanni Mascellani
763f7dfa61 demos/triangle: Recompile shaders with our compiler. 2022-10-10 21:13:06 +02:00
Giovanni Mascellani
1655d309bd vkd3d-shader/hlsl: Write SM4 rsq instructions. 2022-10-10 21:13:04 +02:00
Giovanni Mascellani
d600f0488e vkd3d-shader/hlsl: Parse normalize intrinsic.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
2022-10-10 21:13:03 +02:00
Giovanni Mascellani
4ab1a4cef5 tests: Test normalize() intrinsic. 2022-10-10 21:13:01 +02:00
Giovanni Mascellani
73cf9dee8a include: Add missing vkd3d_shader_compile() transformations and chained structures. 2022-09-28 19:11:13 +02:00
Zebediah Figura
b74a546034 vkd3d-shader/hlsl: Use hlsl_new_constant() in more places. 2022-09-28 19:11:08 +02:00
Zebediah Figura
f8da100052 vkd3d-shader/hlsl: Use hlsl_new_int_constant() in the "primary_expr" rule. 2022-09-28 19:11:05 +02:00
Zebediah Figura
3fc2fdc37f vkd3d-shader/hlsl: Introduce a hlsl_new_bool_constant() helper. 2022-09-28 19:11:02 +02:00
Zebediah Figura
4c5fd9c7b9 vkd3d-shader/hlsl: Introduce a hlsl_new_float_constant() helper. 2022-09-28 19:10:58 +02:00
Zebediah Figura
15a0b44ada vkd3d-shader/hlsl: Pass the arguments to hlsl_new_resource_load() as an indirect structure.
The function has far too many arguments, including multiple different arguments
with the same type. Use a structure for clarity and to avoid errors.

Merge hlsl_new_sample_lod() into hlsl_new_resource_load() accordingly.
2022-09-27 20:14:54 +02:00
Zebediah Figura
fb724d60e3 vkd3d-shader/hlsl: Make the source parameter to hlsl_copy_deref() const. 2022-09-27 20:14:53 +02:00
Zebediah Figura
e3123f5bd0 vkd3d-shader/hlsl: Pass only a template string to hlsl_new_synthetic_var().
Synthesize the internal name from the template inside of this function.
2022-09-27 20:14:51 +02:00
Zebediah Figura
991cddd139 vkd3d-shader/hlsl: Handle failure from hlsl_copy_deref(). 2022-09-27 20:14:49 +02:00
Zebediah Figura
32999fc12b vkd3d-common: Tweak the WARN for VKD3D_ERROR_INVALID_SHADER.
vkd3d-shader does not consume only bytecode anymore.
2022-09-27 20:14:42 +02:00
Zebediah Figura
27a6963d6a vkd3d: Avoid an unused variable warning when building for Win32. 2022-09-27 20:14:35 +02:00
Giovanni Mascellani
d5fd309ef8 vkd3d: Add a macro to mark unreachable code.
This should silence warnings about some branches non returning any value
without requiring additional "return 0" statement or similar.

Also, in theory this might enable to compiler to optimize the program
a little bit more, though that's unlikely to have any measurable effect.
2022-09-27 20:14:27 +02:00
Henri Verbeet
56b2f56b86 Release 1.5. 2022-09-21 16:47:49 +02:00
Henri Verbeet
d484a08d10 vkd3d-shader: Add version information to enum vkd3d_shader_compile_option_typed_uav. 2022-09-21 16:47:49 +02:00
Henri Verbeet
6381bc4857 vkd3d-shader: Add a VKD3D_FORCE_32_BIT_ENUM element to enum vkd3d_shader_api_version. 2022-09-21 16:47:49 +02:00
Henri Verbeet
1e559cd51d vkd3d: Add a VKD3D_FORCE_32_BIT_ENUM element to enum vkd3d_api_version. 2022-09-21 16:47:47 +02:00
Zebediah Figura
b7c94b0213 tests: Check for failure from init_test_context() in the d3d11 runner. 2022-09-19 21:51:30 +02:00
Zebediah Figura
53d6966a5d tests: Mark test_hull_shader_relative_addressing() as broken on radv.
Broken for me with "AMD Radeon RX 560 Series (RADV POLARIS11)" (1002:67ef) but works with llvmpipe; Mesa 22.2.0-rc3.
2022-09-19 21:51:30 +02:00
Zebediah Figura
7393e6ed13 tests: Transition back to D3D12_RESOURCE_STATE_RENDER_TARGET in test_bufinfo_instruction(). 2022-09-19 20:13:57 +02:00
Francisco Casas
8e07423ba1 vkd3d-shader/hlsl: Add offset parameter to 'Load' method.
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
2022-08-23 15:57:54 -05:00
Francisco Casas
609632279f vkd3d-shader/hlsl: Properly check argument count in gather methods. 2022-08-23 15:57:54 -05:00
Francisco Casas
32e6f594f2 vkd3d-shader/hlsl: Properly check argument count in SampleLevel method.
Also, TextureCube and TextureCubeArray don't support the offset
argument, so this check is updated here too.

Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
2022-08-23 15:57:54 -05:00
Francisco Casas
15b19b15c0 vkd3d-shader/hlsl: Use proper dimensions on SampleLevel method offset parameter. 2022-08-23 15:57:54 -05:00
Francisco Casas
c4be4a4ebf vkd3d-shader/hlsl: Properly check argument count in Sample method.
Also, TextureCube and TextureCubeArray don't support the offset
argument, so this check is updated.

Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
2022-08-23 15:57:54 -05:00
Francisco Casas
562f647c2a vkd3d-shader/hlsl: Use proper dimensions on gather methods offset parameter. 2022-08-23 15:57:54 -05:00