vkd3d-shader: Accept 'loop' attribute, on loops.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2023-10-29 01:30:13 +02:00 committed by Alexandre Julliard
parent 26784672d8
commit ecdc3f39d4
Notes: Alexandre Julliard 2023-11-01 22:40:21 +01: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/431
2 changed files with 11 additions and 8 deletions

View File

@ -563,8 +563,11 @@ static struct hlsl_block *create_loop(struct hlsl_ctx *ctx, enum loop_type type,
hlsl_warning(ctx, loc, VKD3D_SHADER_ERROR_HLSL_NOT_IMPLEMENTED, "Loop unrolling is not implemented."); hlsl_warning(ctx, loc, VKD3D_SHADER_ERROR_HLSL_NOT_IMPLEMENTED, "Loop unrolling is not implemented.");
} }
} }
else if (!strcmp(attr->name, "loop") else if (!strcmp(attr->name, "loop"))
|| !strcmp(attr->name, "fastopt") {
/* TODO: this attribute will be used to disable unrolling, once it's implememented. */
}
else if (!strcmp(attr->name, "fastopt")
|| !strcmp(attr->name, "allow_uav_condition")) || !strcmp(attr->name, "allow_uav_condition"))
{ {
hlsl_fixme(ctx, loc, "Unhandled attribute '%s'.", attr->name); hlsl_fixme(ctx, loc, "Unhandled attribute '%s'.", attr->name);

View File

@ -102,7 +102,7 @@ todo(sm>=6) draw quad
probe all rgba (410.1, 410.1, 410.1, 410.1) probe all rgba (410.1, 410.1, 410.1, 410.1)
% loop attribute by itself % loop attribute by itself
[pixel shader todo] [pixel shader]
float4 main() : sv_target float4 main() : sv_target
{ {
float ret = 0.0; float ret = 0.0;
@ -116,10 +116,10 @@ float4 main() : sv_target
} }
[test] [test]
todo draw quad todo(sm>=6) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0) probe all rgba (10.0, 10.0, 10.0, 10.0)
[pixel shader todo] [pixel shader]
float4 main() : sv_target float4 main() : sv_target
{ {
float ret = 0.0; float ret = 0.0;
@ -135,10 +135,10 @@ float4 main() : sv_target
} }
[test] [test]
todo draw quad todo(sm>=6) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0) probe all rgba (10.0, 10.0, 10.0, 10.0)
[pixel shader todo] [pixel shader]
float4 main() : sv_target float4 main() : sv_target
{ {
float ret = 0.0; float ret = 0.0;
@ -154,7 +154,7 @@ float4 main() : sv_target
} }
[test] [test]
todo draw quad todo(sm>=6) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0) probe all rgba (10.0, 10.0, 10.0, 10.0)
% unroll can't be used with fastopt or loop % unroll can't be used with fastopt or loop