Francisco Casas
5fe8a0c70f
vkd3d-shader/hlsl: Retrieve error_instr instead of NULL in hlsl_block_add_resource_load().
...
Fixes: 06a503975f
2025-11-20 11:31:00 +01:00
Francisco Casas
06a503975f
vkd3d-shader/hlsl: Avoid member access on NULL resource load (ubsan).
...
In some scenarios this resource load is NULL, and we are still doing
&load->node on it.
vkd3d/libs/vkd3d-shader/hlsl.c:2195:12: runtime error: member access
within null pointer of type 'struct hlsl_ir_resource_load'
This happens in tests/hlsl/sampler-state.shader_test, in the following
test:
[pixel shader fail]
Texture2D tex;
float4 main(): sv_target
{
return tex.Sample(sampler_state {}, float2(0, 0));
}
2025-11-18 17:42:11 +01:00
Anna (navi) Figueiredo Gomes
dd3524444d
vkd3d-shader/hlsl: Properly free default values when discarding them.
2025-11-17 15:17:45 +01:00
Shaun Ren
200e66ba4f
vkd3d-shader/hlsl: Store the flatten type in struct hlsl_ir_if.
2025-10-30 17:46:12 +01:00
Shaun Ren
cd9a5bf2b4
vkd3d-shader/hlsl: Dump the jump condition node in dump_ir_jump().
2025-10-30 16:32:30 +01:00
Elizabeth Figura
deb7a67d67
vkd3d-shader/hlsl: Introduce hlsl_block_add_constant().
2025-10-28 16:30:49 +01:00
Elizabeth Figura
be31842197
vkd3d-shader/hlsl: Return a node from lower_ir().
...
This allows us to use the same function for "folding" passes, which usually
replace with a node other than the last one added in a block.
2025-10-09 13:20:46 +02:00
Petrichor Park
e35604dbf0
vkd3d-shader/hlsl: Implement the firstbitlow() intrinsic.
2025-09-22 11:26:42 +02:00
Petrichor Park
e6d840170d
vkd3d-shader/hlsl: Implement the firstbithigh() intrinsic.
2025-09-22 11:26:42 +02:00
Petrichor Park
e49beca0d5
vkd3d-shader/hlsl: Implement the countbits() intrinsic.
2025-09-22 11:26:42 +02:00
Shaun Ren
b6d274e68e
vkd3d-shader/hlsl: Remove the whitespace before the closing parenthesis in dump_ir_expr().
2025-09-17 12:36:54 +02:00
Shaun Ren
320c3c9652
vkd3d-shader/hlsl: Fold some general conditional identities.
...
The following conditional identities are applied:
c ? x : x -> x
false ? x : y -> y; true ? x : y -> x
c ? true : false -> c; c ? false : true -> !c
!c ? x : y -> c ? y : x
Lastly, for expression chains x, y in a conditional expression
c ? x : y,
we evaluate all conditionals in the expression chains with the
condition c, assuming c is true (for x), or false (for y).
2025-08-21 16:00:51 +02:00
Henri Verbeet
f95fc28851
vkd3d-shader/hlsl: Return a vsir program from hlsl_compile_shader().
...
This largely brings the HLSL frontend in line with the other frontends.
2025-08-07 20:40:01 +02:00
Henri Verbeet
85603dc9c6
vkd3d-shader/hlsl: Initialise the vsir program in hlsl_compile_shader().
...
Mostly in preparation for returning a vsir program from
hlsl_compile_shader() in the next commit.
2025-08-07 20:37:41 +02:00
Henri Verbeet
e7be5aa9fd
vkd3d-shader/hlsl: Pass a vkd3d_shader_source_list pointer to hlsl_ctx_init().
...
Instead of storing the list inside struct hlsl_ctx. The source file
names in the list are used by the location information that the HLSL
frontend produces, and end up being referenced by the vsir program. If
we want the vsir program to be able to outlive the hlsl_ctx, its
location information can't reference data owned by the hlsl_ctx.
2025-08-07 20:33:24 +02:00
Henri Verbeet
7c37fc6a8b
vkd3d-shader: Introduce struct vkd3d_shader_source_list.
2025-08-07 20:33:24 +02:00
Shaun Ren
4bb880f9ed
vkd3d-shader/hlsl: Support interlocked operations on non-indexed groupshared variables.
2025-08-05 16:33:08 +02:00
Shaun Ren
8d0d8d106b
vkd3d-shader/hlsl: Support stores to raw groupshared variables.
2025-08-05 16:32:34 +02:00
Victor Chiletto
e718546ee5
vkd3d-shader/hlsl: Transform hlsl_ir_index into structured buffers into field specific hlsl_ir_resource_loads.
2025-08-05 14:25:50 +02:00
Victor Chiletto
5dbf859029
vkd3d-shader/hlsl: Parse SRV structured buffers.
2025-08-05 14:25:50 +02:00
Henri Verbeet
dbaecb3f36
vkd3d-shader/hlsl: Introduce hlsl_compile_effect().
...
The goal being to allow hlsl_compile_shader() to return a vsir program.
2025-07-29 13:14:30 +02:00
Henri Verbeet
eaebef4265
vkd3d-shader/hlsl: Emit vsir from hlsl_emit_bytecode().
2025-07-28 16:10:15 +02:00
Henri Verbeet
a4c25b81c5
vkd3d-shader/hlsl: Get rid of the "hlsl" argument to hlsl_compile_shader().
2025-07-23 17:25:19 +02:00
Anna (navi) Figueiredo Gomes
a7266284ee
vkd3d-shader/hlsl: Move hlsl_ir_function_decl->extern_vars to a local variable.
2025-07-23 16:56:06 +02:00
Francisco Casas
844f33025e
vkd3d-shader/hlsl: Dump processed function bodies.
2025-07-23 16:31:59 +02:00