mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Propagate structure fields modifiers when copying shader inputs.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
parent
1930b51d97
commit
8479ceedfc
Notes:
Alexandre Julliard
2023-10-09 23:10:36 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/358
@ -377,6 +377,8 @@ static void prepend_input_copy_recurse(struct hlsl_ctx *ctx, struct hlsl_block *
|
||||
|
||||
for (i = 0; i < hlsl_type_element_count(type); ++i)
|
||||
{
|
||||
unsigned int element_modifiers = modifiers;
|
||||
|
||||
if (type->class == HLSL_CLASS_ARRAY)
|
||||
{
|
||||
elem_semantic_index = semantic_index
|
||||
@ -391,6 +393,17 @@ static void prepend_input_copy_recurse(struct hlsl_ctx *ctx, struct hlsl_block *
|
||||
semantic = &field->semantic;
|
||||
elem_semantic_index = semantic->index;
|
||||
loc = &field->loc;
|
||||
element_modifiers |= field->storage_modifiers;
|
||||
|
||||
/* TODO: 'sample' modifier is not supported yet */
|
||||
|
||||
/* 'nointerpolation' always takes precedence, next the same is done for 'sample',
|
||||
remaining modifiers are combined. */
|
||||
if (element_modifiers & HLSL_STORAGE_NOINTERPOLATION)
|
||||
{
|
||||
element_modifiers &= ~HLSL_INTERPOLATION_MODIFIERS_MASK;
|
||||
element_modifiers |= HLSL_STORAGE_NOINTERPOLATION;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(c = hlsl_new_uint_constant(ctx, i, &var->loc)))
|
||||
@ -402,7 +415,7 @@ static void prepend_input_copy_recurse(struct hlsl_ctx *ctx, struct hlsl_block *
|
||||
return;
|
||||
list_add_after(&c->entry, &element_load->node.entry);
|
||||
|
||||
prepend_input_copy_recurse(ctx, block, element_load, modifiers, semantic, elem_semantic_index);
|
||||
prepend_input_copy_recurse(ctx, block, element_load, element_modifiers, semantic, elem_semantic_index);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -51,7 +51,7 @@ float4 main(ps_input input) : sv_target
|
||||
|
||||
[test]
|
||||
draw triangle list 3
|
||||
todo probe all rgba (0.0, 1.0, 0.0, 1.0)
|
||||
probe all rgba (0.0, 1.0, 0.0, 1.0)
|
||||
|
||||
[vertex shader]
|
||||
struct ps_input
|
||||
@ -105,7 +105,7 @@ float4 main(centroid ps_input input) : sv_target
|
||||
|
||||
[test]
|
||||
draw triangle list 3
|
||||
todo probe all rgba (0.0, 1.0, 0.0, 1.0)
|
||||
probe all rgba (0.0, 1.0, 0.0, 1.0)
|
||||
|
||||
[vertex shader]
|
||||
struct ps_input
|
||||
|
Loading…
x
Reference in New Issue
Block a user