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
ade3daa3
Commit
ade3daa3
authored
1 year ago
by
Francisco Casas
Committed by
Henri Verbeet
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
tests: Test matrix default value initializers.
parent
affadf31
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!787
vkd3d-shader/hlsl: Parse and write default values.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/hlsl/default-values.shader_test
+74
-0
74 additions, 0 deletions
tests/hlsl/default-values.shader_test
with
74 additions
and
0 deletions
tests/hlsl/default-values.shader_test
+
74
−
0
View file @
ade3daa3
...
...
@@ -220,6 +220,80 @@ todo(glsl) draw quad
probe all rgba (70, 80, 90, 100)
% In SM4, the values in the default values initializer of matrices end up in different components
% than for regular initializers. The values are assigned to the matrix components in Chinese
% reading order, i.e. the components of a whole column are assigned before the next column, unlike
% regular initializers where the components of each row are assigned before the next row.
[pixel shader]
int2x3 m = {1, 2, 3, 4, 5, 6};
// int2x3 m; // Offset: 0 Size: 40
// = 0x00000001 0x00000002 0x00000000 0x00000000
// 0x00000003 0x00000004 0x00000000 0x00000000
// 0x00000005 0x00000006
float4 main() : sv_target
{
return m[0][0];
}
% The same happens for numeric constructors.
[pixel shader]
int2x3 m = int2x3(1, 2, 3, 4, 5, 6);
// int2x3 m; // Offset: 0 Size: 40
// = 0x00000001 0x00000002 0x00000000 0x00000000
// 0x00000003 0x00000004 0x00000000 0x00000000
// 0x00000005 0x00000006
float4 main() : sv_target
{
return m[0][0];
}
[pixel shader]
cbuffer buff
{
row_major int2x3 m = {1, 2, 3, 4, 5, 6};
// row_major int2x3 m; // Offset: 0 Size: 28
// = 0x00000001 0x00000003 0x00000005 0x00000000
// 0x00000002 0x00000004 0x00000006
}
float4 main() : sv_target
{
return m[0][0];
}
[pixel shader fail(sm>=6)]
struct
{
float2 a[2];
row_major int2x3 b;
float3 c[2];
} apple = {100, 101, 110, 111, 1, 2, 3, 4, 5, 6, 200, 201, 202, 210, 211, 212};
// struct
// {
//
// float2 a[2]; // Offset: 0
// row_major int2x3 b; // Offset: 32
// float3 c[2]; // Offset: 64
//
// } apple; // Offset: 0 Size: 92
// = 0x42c80000 0x42ca0000 0x00000000 0x00000000
// 0x42dc0000 0x42de0000 0x00000000 0x00000000
// 0x00000001 0x00000003 0x00000005 0x00000000
// 0x00000002 0x00000004 0x00000006 0x00000000
// 0x43480000 0x43490000 0x434a0000 0x00000000
// 0x43520000 0x43530000 0x43540000
float4 main() : sv_target
{
return float4(apple.c[0], 0);
}
[require]
shader model >= 5.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