Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
vkd3d
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Francisco Casas
vkd3d
Commits
2a412670
Commit
2a412670
authored
3 years ago
by
Elizabeth Figura
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tests: Add more tests for pack_matrix pragmas.
parent
af25d5bf
No related branches found
Branches containing commit
Tags
wine-0.9.54
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/hlsl-majority-pragma.shader_test
+131
-0
131 additions, 0 deletions
tests/hlsl-majority-pragma.shader_test
with
131 additions
and
0 deletions
tests/hlsl-majority-pragma.shader_test
+
131
−
0
View file @
2a412670
...
...
@@ -20,6 +20,51 @@ uniform 12 float4 0.2 0.4 0.0 0.0
draw quad
probe all rgba (0.17, 0.39, 0.17, 0.39) 1
%% Test with a struct.
[pixel shader]
#pragma pack_matrix(row_major)
struct apple
{
float2x2 m;
};
#pragma pack_matrix(column_major)
uniform struct apple a;
float4 main() : sv_target
{
return float4(a.m[0], a.m[1]);
}
[test]
uniform 0 float4 0.1 0.2 0.0 0.0
uniform 4 float4 0.3 0.4 0.0 0.0
draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4)
%% Test with an array.
[pixel shader]
#pragma pack_matrix(row_major)
uniform float2x2 m[2];
#pragma pack_matrix(column_major)
float4 main() : sv_target
{
return float4(m[1][0], m[1][1]);
}
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
uniform 4 float4 0.0 0.0 0.0 0.0
uniform 8 float4 0.5 0.6 0.0 0.0
uniform 12 float4 0.7 0.8 0.0 0.0
draw quad
probe all rgba (0.5, 0.6, 0.7, 0.8)
% The documentation claims these strings are subject to macro expansion.
% They are not.
...
...
@@ -47,3 +92,89 @@ uniform 0 float4 0.1 0.2 0.0 0.0
uniform 4 float4 0.3 0.4 0.0 0.0
draw quad
probe all rgba (0.23, 0.34, 0.5, 0.5) 1
% The majority that applies to a typedef is the latent majority at the time
% that typedef was declared.
[pixel shader]
#pragma pack_matrix(row_major)
typedef float2x2 mat_t;
#pragma pack_matrix(column_major)
uniform mat_t m;
float4 main() : sv_target
{
return float4(m[0], m[1]);
}
[test]
uniform 0 float4 0.1 0.2 0.0 0.0
uniform 4 float4 0.3 0.4 0.0 0.0
draw quad
todo probe all rgba (0.1, 0.2, 0.3, 0.4)
% In fact, it's illegal to specify a contradictory majority.
[pixel shader fail todo]
#pragma pack_matrix(row_major)
typedef float2x2 mat_t;
uniform column_major mat_t m;
float4 main() : sv_target
{
return 0;
}
% However, if no pack_matrix directive has been used yet, a typedef has no
% defined majority, and the majority can be overwritten, including by a
% subsequent pragma.
[pixel shader]
typedef float2x2 mat_t;
#pragma pack_matrix(row_major)
uniform mat_t m;
uniform row_major mat_t r;
uniform column_major mat_t c;
float4 main() : sv_target
{
return float4(m[0], m[1]);
}
[test]
uniform 0 float4 0.1 0.2 0.0 0.0
uniform 4 float4 0.3 0.4 0.0 0.0
draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4)
% This does not apply recursively to struct or array members, however. Members
% defined while there is no latent majority are always column-major, even if
% the type is later used after a pack_matrix(row_major) directive.
% Note that the majority of the struct or array type cannot itself be
% overwritten with modifiers; those are only valid on matrix types.
[pixel shader]
struct apple
{
float2x2 m;
};
#pragma pack_matrix(row_major)
typedef struct apple apple_t;
uniform apple_t a;
float4 main() : sv_target
{
return float4(a.m[0], a.m[1]);
}
[test]
uniform 0 float4 0.2 0.4 0.0 0.0
uniform 4 float4 0.3 0.5 0.0 0.0
draw quad
probe all rgba (0.2, 0.3, 0.4, 0.5)
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