Commit Graph

4038 Commits

Author SHA1 Message Date
77d716c811 vkd3d-shader/hlsl: Add functions to the global list inside the func_prototype rule. 2023-02-07 22:15:06 +01:00
4c46075d86 vkd3d-shader/hlsl: Use the original hlsl_ir_function_decl struct rather than allocating a new one for each definition.
We need to make sure every invocation points to the same hlsl_ir_function_decl
and the same parameters.

This fixes some invalid memory accesses.
2023-02-07 22:15:06 +01:00
25d49b518d vkd3d-shader/hlsl: Put synthetic variables into a dummy scope.
Prevent them from being ever looked up.

Our naming scheme for synthetic variables already effectively prevents this, but
this is better for clarity. We also will need to be able to move some named
variables into a dummy scope to account for complexities around function
definition and declarations.
2023-02-07 22:15:06 +01:00
8755a92196 vkd3d-shader/hlsl: Add a hlsl_cleanup_semantic() helper. 2023-02-07 22:15:06 +01:00
cb2c89a589 vkd3d-shader/hlsl: Store function parameters in an array. 2023-02-07 22:15:06 +01:00
721c7aa22c tests: Add more tests for function definitions. 2023-02-07 22:15:06 +01:00
898fc9e198 vkd3d: Fix checking for failure from SleepConditionVariableCS().
Fixes: 552926cfca
2023-02-07 22:15:06 +01:00
2e074ebce7 vkd3d: Initialize image aspect for NULL SRVs. 2023-02-07 22:08:00 +01:00
552926cfca vkd3d: Do not allow synchronization primitives to fail.
In practice they never fail. If they fail, it means that there
is some underlying platform problem and there is little we can do
anyway. Under pthreads function prototypes allow returning failure,
but that's only used for "error checking" mutexes, which we
don't use.

On the other hand, error handling in vkd3d is rather inconsistent:
sometimes the errors are ignored, sometimes logged, sometimes
passed to the caller. It's hard to handle failures appropriately
if you can't even keep your state consistent, so I think it's
better to avoid trying, assume that synchronization primitives do
not fail and at least have consistent logging if something goes
wrong.
2023-02-02 20:51:27 +01:00
a66fe31fe5 vkd3d: Do not write the point size for SPIR-V shaders.
We disable shaderTessellationAndGeometryPointSize.
2023-02-02 20:51:19 +01:00
8fc8d34ea0 vkd3d-shader/spirv: Introduce an option to control whether point size is written. 2023-02-02 20:51:18 +01:00
06f300ec59 vkd3d-shader/hlsl: Support dot() for SM1. 2023-02-02 20:51:12 +01:00
68c232cfab tests: Test entry point semantics on function declarations. 2023-01-31 22:27:02 +01:00
4954c36347 tests: Add more tests for early return from the entry point. 2023-01-31 22:27:02 +01:00
7460d7adc2 tests: Add some tests for early return from user-defined functions. 2023-01-31 22:27:02 +01:00
aa3badbd9d vkd3d-shader/hlsl: Emit a hlsl_fixme() for HLSL_IR_CALL instructions.
Avoid outputting invalid shaders.
2023-01-31 22:27:00 +01:00
f9e7cb6345 include: Fix incorrect UpdateTileMappings declaration.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2023-01-26 21:52:39 +01:00
ec00782eae vkd3d-shader/tests: Add some exp()/exp2() tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-01-26 21:52:29 +01:00
8bb023e5af vkd3d-shader/hlsl: Support exp() intrinsic. 2023-01-26 21:52:28 +01:00
8ca2f65bc1 vkd3d-shader/hlsl: Support exp2() intrinsic. 2023-01-26 21:52:26 +01:00
fa971f32bc vkd3d-shader/hlsl: Write 'exp' instructions for SM1. 2023-01-26 21:52:25 +01:00
335f741630 vkd3d-shader/hlsl: Add a helper to write per-component unary instructions. 2023-01-26 21:52:24 +01:00
f33ca836d7 vkd3d-shader/hlsl: Make single-component swizzles retrieve a scalar. 2023-01-26 21:52:18 +01:00
edf86b2248 tests: Add tests for assignments to self with swizzles. 2023-01-26 21:52:18 +01:00
9d7ef64dc0 tests: Test swizzles on scalar values. 2023-01-26 21:52:18 +01:00