Zebediah Figura
d565caafb5
vkd3d-shader/hlsl: Pass hlsl_constant_value and hlsl_type pointers to fold_mul().
2023-05-23 21:08:21 +02:00
Zebediah Figura
623cd94997
vkd3d-shader/hlsl: Pass hlsl_constant_value and hlsl_type pointers to fold_add().
2023-05-23 21:08:20 +02:00
Zebediah Figura
7d9b24fe11
vkd3d-shader/hlsl: Pass hlsl_constant_value and hlsl_type pointers to fold_neg().
2023-05-23 21:08:19 +02:00
Zebediah Figura
eb04829e66
vkd3d-shader/hlsl: Pass hlsl_constant_value and hlsl_type pointers to fold_cast().
2023-05-23 21:08:17 +02:00
Ethan Lee
24d4ab7fb3
vkd3d-shader/hlsl: Add support for SampleGrad() method.
...
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
2023-05-23 21:07:49 +02:00
Nikolay Sivov
cf8cacd336
vkd3d-shader/hlsl: Improve UAV format type checking for buffer types.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-05-22 22:03:27 +02:00
Nikolay Sivov
cff22ecde8
vkd3d-shader/hlsl: Add support for writing RWStructuredBuffer declarations.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-05-22 22:03:26 +02:00
Nikolay Sivov
3de824bfd8
vkd3d-shader/hlsl: Add support for RWBuffer object.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-05-22 22:03:24 +02:00
Nikolay Sivov
44a90f5d41
vkd3d-shader: Fix dcl_uav_typed_* formatting.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-05-22 22:03:24 +02:00
Ethan Lee
fb9328d030
vkd3d-shader/hlsl: Fold constant integral abs().
...
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
2023-05-22 22:03:18 +02:00
Nikolay Sivov
dfa0076473
vkd3d-shader/hlsl: Add support for sample index argument in Load().
2023-05-22 22:03:12 +02:00
Nikolay Sivov
dc41444941
vkd3d-shader/hlsl: Convert ternary operator true/false values to a common type.
2023-05-09 21:51:46 +02:00
Conor McCarthy
be4a71da7d
vkd3d-shader/tpf: Validate input and output index ranges for default control point phases.
2023-05-09 21:51:33 +02:00
Conor McCarthy
3e50c4d13b
vkd3d-shader/tpf: Remove an unnecessary carriage return from a parser error message.
2023-05-09 21:51:32 +02:00
Conor McCarthy
6dd1b01284
vkd3d-shader/tpf: Validate index range declarations.
2023-05-09 21:51:31 +02:00
Conor McCarthy
d565fbdcd6
vkd3d-shader/tpf: Validate input/output registers.
2023-05-09 21:51:29 +02:00
Conor McCarthy
2166088b0b
vkd3d-shader/tpf: Validate signature element masks.
2023-05-09 21:51:28 +02:00
Conor McCarthy
b8e6482365
vkd3d-shader/tpf: Validate signature element register indices.
2023-05-09 21:51:19 +02:00
Conor McCarthy
adf7db021c
vkd3d-shader/tpf: Validate input/output register index counts.
2023-05-09 21:51:17 +02:00
Zebediah Figura
b1bc4044ae
vkd3d-shader/hlsl: Use %option nodefault in the lexer.
2023-05-09 21:51:09 +02:00
Zebediah Figura
600fdcd112
vkd3d-shader/hlsl: Lex invalid characters in #line directives.
...
Avoid letting them fall through to the default rule.
2023-05-09 21:51:08 +02:00
Zebediah Figura
7b8845474d
vkd3d-shader/preproc: Use %option nodefault in the lexer.
2023-05-09 21:51:06 +02:00
Zebediah Figura
871cf0b4b5
vkd3d-shader/preproc: Ignore newlines in C comments.
...
Avoid letting them fall through to the default rule.
2023-05-09 21:51:05 +02:00
Zebediah Figura
ddbfd88e74
vkd3d-shader/preproc: Lex whitespace and invalid characters in #include and #line directives.
...
Avoid letting them fall through to the default rule.
A syntax error will be emitted by the parser.
2023-05-09 21:51:01 +02:00
Zebediah Figura
da7670f7c8
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from add_conditional().
2023-05-09 21:50:37 +02:00
Zebediah Figura
39bbac3cca
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_uint_constant().
2023-05-09 21:50:36 +02:00
Zebediah Figura
b991f98e2f
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_swizzle().
2023-05-09 21:50:35 +02:00
Zebediah Figura
306ae40696
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_store_index().
2023-05-09 21:50:34 +02:00
Zebediah Figura
29a2b87f54
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_simple_store().
2023-05-09 21:50:33 +02:00
Zebediah Figura
145a2dfd2d
vkd3d-shader/hlsl: Return bool from hlsl_new_store_component().
2023-05-09 21:50:31 +02:00
Francisco Casas
fd38c58112
vkd3d-shader/hlsl: Introduce hlsl_calloc().
...
This is just a wrapper of vkd3d_calloc(), that has the advantage of
checking for multiplication overflow.
2023-05-08 20:24:15 +02:00
Francisco Casas
ef7cf9b1ad
vkd3d-shader/hlsl: Support resource arrays when writting SM4.
...
The new fixmes can be triggered in presence of object components within
structs (for SM5).
In shaders such as this one:
struct apple
{
Texture2D tex : TEX;
float4 color : COLOR;
};
float4 main(struct apple input) : sv_target
{
return input.tex.Load(int3(1, 2, 3));
}
Or this one:
struct
{
Texture2D tex;
float4 color;
} s;
float4 main() : sv_target
{
return s.tex.Load(int3(1, 2, 3));
}
2023-05-08 20:24:15 +02:00
Francisco Casas
a91e6d4563
vkd3d-shader/hlsl: Write resource loads in SM1.
2023-05-08 20:24:15 +02:00
Francisco Casas
96c844ffb8
vkd3d-shader/hlsl: Write sampler declarations in SM1.
2023-05-08 20:24:15 +02:00
Francisco Casas
3e9a9c5051
vkd3d-shader/hlsl: Track objects sampling dimension.
2023-05-08 20:24:15 +02:00
Francisco Casas
4dba38e6c8
vkd3d-shader/hlsl: Track object components usage and allocate registers accordingly.
2023-05-08 20:24:14 +02:00
Francisco Casas
6f71077e3e
vkd3d-shader/hlsl: Skip object components when creating input/output copies.
2023-05-08 20:22:19 +02:00
Francisco Casas
4413f6b64b
vkd3d-shader/hlsl: Add fixme for uniform copies for objects within structs.
2023-05-08 20:22:17 +02:00
Francisco Casas
69ff249ef4
vkd3d-shader/hlsl: Support multiple-register variables in object regsets.
...
Variables that contain more than one object (arrays or structs) require
the allocation of contiguous registers in the respective object
register spaces.
2023-05-08 20:22:14 +02:00
Nikolay Sivov
7516adeeae
vkd3d-shader/hlsl: Add support for fmod() intrinsic.
2023-05-08 20:21:52 +02:00
Zebediah Figura
8b57a612d7
vkd3d-shader/hlsl: Map the colour output for ps_1_* to r0.
2023-05-03 21:12:39 +02:00
Zebediah Figura
b2959739ed
vkd3d-shader/hlsl: Rewrite the register allocator to allow allocating in multiple passes.
...
We will need this in order to allocate some "special" registers: ps_1_* output, sincos output, etc.
2023-05-03 21:12:38 +02:00
Zebediah Figura
71d8ff85c6
vkd3d-shader/hlsl: Avoid leaking the allocator register map in allocate_const_registers().
2023-05-03 21:12:37 +02:00
Zebediah Figura
c57ac0b207
vkd3d-shader/hlsl: Rename struct liveness to struct register_allocator.
2023-05-03 21:12:34 +02:00
Conor McCarthy
a0a18b1620
vkd3d-shader: Introduce an internal shader signature structure.
...
A register count is required for Shader Model 6 signatures, including
those normalised from earlier models.
2023-05-03 21:12:07 +02:00
Conor McCarthy
5ae068168c
vkd3d-shader/tpf: Return an error from vkd3d_shader_sm4_parser_create() if the parser failed.
2023-05-03 21:12:06 +02:00
Conor McCarthy
85eb231492
vkd3d-shader/d3dbc: Return an error from vkd3d_shader_sm1_parser_create() if the parser failed.
2023-05-03 21:12:03 +02:00
Francisco Casas
34ddc13390
vkd3d-shader/hlsl: Don't keep the implicit mipmap level on hlsl_ir_index.
2023-05-03 21:11:59 +02:00
Francisco Casas
4aaf6b8895
vkd3d-shader/hlsl: Use hlsl_ir_index for resource access.
...
This patch makes index expressions on resources hlsl_ir_index nodes
instead of hlsl_ir_resource_load nodes, because it is not known if they
will be used later as the lhs of an hlsl_ir_resource_store.
For now, the only benefit is consistency.
2023-05-03 21:11:56 +02:00
Nikolay Sivov
87037d3748
vkd3d-shader/hlsl: Implement asfloat().
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-05-02 20:46:16 +02:00