vkd3d-shader/hlsl: Don't produce a parse error on empty buffer_body.

This commit is contained in:
Francisco Casas 2022-10-31 18:13:26 -03:00 committed by Alexandre Julliard
parent f100f5b726
commit bd501ce336
Notes: Alexandre Julliard 2022-11-18 22:42:34 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/48
3 changed files with 19 additions and 1 deletions

View File

@ -65,6 +65,7 @@ vkd3d_shader_tests = \
tests/cast-to-half.shader_test \
tests/cast-to-int.shader_test \
tests/cast-to-uint.shader_test \
tests/cbuffer.shader_test \
tests/compute.shader_test \
tests/conditional.shader_test \
tests/floor.shader_test \

View File

@ -3361,7 +3361,7 @@ buffer_type:
}
declaration_statement_list:
declaration_statement
%empty
| declaration_statement_list declaration_statement
preproc_directive:

17
tests/cbuffer.shader_test Normal file
View File

@ -0,0 +1,17 @@
[pixel shader]
// Test empty constant buffer.
cbuffer Constants : register(b1)
{
};
float4 foo;
float4 main() : sv_target
{
return foo;
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)