mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Fix the conditions to discard default values.
Otherwise default_values for strings are lost. Thanks to Nikolay Sivov for pointing this out.
This commit is contained in:
parent
b7314e2438
commit
0b989c9f37
Notes:
Henri Verbeet
2024-10-07 17:52:25 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1137
@ -2366,9 +2366,9 @@ static void initialize_var_components(struct hlsl_ctx *ctx, struct hlsl_block *i
|
||||
{
|
||||
struct hlsl_default_value default_value = {0};
|
||||
|
||||
if (hlsl_is_numeric_type(dst_comp_type))
|
||||
{
|
||||
if (src->type == HLSL_IR_COMPILE || src->type == HLSL_IR_SAMPLER_STATE)
|
||||
{
|
||||
if (hlsl_is_numeric_type(dst_comp_type))
|
||||
{
|
||||
/* Default values are discarded if they contain an object
|
||||
* literal expression for a numeric component. */
|
||||
@ -2381,6 +2381,7 @@ static void initialize_var_components(struct hlsl_ctx *ctx, struct hlsl_block *i
|
||||
dst->default_values = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!hlsl_clone_block(ctx, &block, instrs))
|
||||
@ -2393,7 +2394,6 @@ static void initialize_var_components(struct hlsl_ctx *ctx, struct hlsl_block *i
|
||||
hlsl_block_cleanup(&block);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (src->type == HLSL_IR_SAMPLER_STATE)
|
||||
|
@ -86,7 +86,7 @@ technique10
|
||||
// Without initializer
|
||||
technique10 < int a; > {}
|
||||
|
||||
[effect fail todo]
|
||||
[effect fail]
|
||||
// Only numeric types and strings are allowed
|
||||
technique10 < DepthStencilState ds = { 0 }; > {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user