Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
vkd3d
Commits
00c8cf1b
Commit
00c8cf1b
authored
1 year ago
by
Francisco Casas
Committed by
Alexandre Julliard
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
tests: Test function call syntax for state blocks.
parent
9ede2227
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!739
vkd3d-shader/hlsl: Parse state blocks, part 1.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile.am
+1
-0
1 addition, 0 deletions
Makefile.am
tests/hlsl/state-block-function-syntax.shader_test
+99
-0
99 additions, 0 deletions
tests/hlsl/state-block-function-syntax.shader_test
with
100 additions
and
0 deletions
Makefile.am
+
1
−
0
View file @
00c8cf1b
...
...
@@ -185,6 +185,7 @@ vkd3d_shader_tests = \
tests/hlsl/smoothstep.shader_test
\
tests/hlsl/sqrt.shader_test
\
tests/hlsl/srv-buffers.shader_test
\
tests/hlsl/state-block-function-syntax.shader_test
\
tests/hlsl/state-block-syntax.shader_test
\
tests/hlsl/static-initializer.shader_test
\
tests/hlsl/step.shader_test
\
...
...
This diff is collapsed.
Click to expand it.
tests/hlsl/state-block-function-syntax.shader_test
0 → 100644
+
99
−
0
View file @
00c8cf1b
% Unlike assignment syntax, only these names are allowed.
% The parameter count is also checked.
[pixel shader todo]
sampler sam
{
SetBlendState(foo, bar, baz); // 3 parameters
SetDepthStencilState(foo, 2); // 2 parameters
SetRasterizerState(foo); // 1 parameter
SetVertexShader(vs); // 1 parameter
SetDomainShader(ds); // 1 paramter
SetHullShader(100); // 1 parameter
SetGeometryShader(foo + bar); // 1 parameter
SetPixelShader(ps1); // 1 parameter
SetComputeShader("random string"); // 1 parameter
OMSetRenderTargets(RTV0, RTV1, RTV2, RTV3, RTV4, RTV5, RTV6, RTV7, DSV); // 2 to 9 parameters
};
float4 main() : sv_target { return 0; }
[pixel shader fail(sm<6)]
sampler sam
{
SetSomeotherState();
};
float4 main() : sv_target { return 0; }
% It is allowed to use functions together with assignment syntax.
[pixel shader todo]
sampler sam
{
SetDepthStencilState(foo, bar);
arbitrary_field = 42;
};
float4 main() : sv_target { return 0; }
% Test complex expression on the arguments, including function calls.
[pixel shader todo]
float4 addition(float4 a, float4 b)
{
return a + b;
}
sampler sam
{
SetBlendState(addition(foo, bar), p + q, p / q);
};
float4 main() : sv_target { return 0; }
% Test the same thing on technique passes
[pixel shader todo]
technique tech1
{
pass pass1
{
SetBlendState(foo, bar, baz);
SetDepthStencilState(foo, 2);
SetRasterizerState(foo);
SetVertexShader(vs);
}
}
float4 main() : sv_target { return 0; }
% It is not allowed to call the functions to set state blocks on the rhs using the assignment syntax
% for state groups or passes.
[pixel shader fail(sm<6)]
float4 main() : sv_target { return 0; }
technique
{
pass
{
cat = SetPixelShader(foobar);
}
}
% It not allowed to call the functions to set states outside state blocks or passes.
[pixel shader fail]
DepthStencilState dss1
{
DepthEnable = false;
DepthWriteMask = Zero;
DepthFunc = Less;
};
float4 main() : sv_target
{
SetDepthStencilState(NULL, dss1);
return 0;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment