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
18baf467
Commit
18baf467
authored
2 years ago
by
Francisco Casas
Browse files
Options
Downloads
Patches
Plain Diff
vkd3d-shader/hlsl: Support matrix indexing in the lhs.
parent
d0e02873
No related branches found
Branches containing commit
Tags
wine-0.9.54
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libs/vkd3d-shader/hlsl.y
+36
-2
36 additions, 2 deletions
libs/vkd3d-shader/hlsl.y
tests/hlsl-matrix-indexing.shader_test
+3
-3
3 additions, 3 deletions
tests/hlsl-matrix-indexing.shader_test
with
39 additions
and
5 deletions
libs/vkd3d-shader/hlsl.y
+
36
−
2
View file @
18baf467
...
...
@@ -1719,8 +1719,42 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in
}
else if (lhs->type == HLSL_IR_INDEX && hlsl_index_is_crooked_matrix_indexing(hlsl_ir_index(lhs)))
{
hlsl_fixme(ctx, &lhs->loc, "Column-major matrix index store.");
return NULL;
struct hlsl_ir_node *mat = hlsl_ir_index(lhs)->val.node, *idx = hlsl_ir_index(lhs)->idx.node;
unsigned int i, k = 0;
for (i = 0; i < mat->data_type->dimx; ++i)
{
struct hlsl_ir_store *store;
struct hlsl_ir_constant *c;
struct hlsl_ir_load *load;
struct hlsl_ir_index *col;
struct hlsl_deref deref;
if (!(writemask & (1 << i)))
continue;
if (!(c = hlsl_new_uint_constant(ctx, i, &lhs->loc)))
return NULL;
list_add_tail(instrs, &c->node.entry);
if (!(col = hlsl_new_index(ctx, mat, &c->node, true, &lhs->loc)))
return NULL;
list_add_tail(instrs, &col->node.entry);
if (!(load = add_load_component(ctx, instrs, rhs, k++, &rhs->loc)))
return NULL;
if (!hlsl_init_deref_from_index_chain(ctx, &deref, &col->node))
return NULL;
if (!(store = hlsl_new_store_index(ctx, &deref, idx, &load->node, 0, &rhs->loc)))
{
hlsl_cleanup_deref(&deref);
return NULL;
}
list_add_tail(instrs, &store->node.entry);
hlsl_cleanup_deref(&deref);
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
tests/hlsl-matrix-indexing.shader_test
+
3
−
3
View file @
18baf467
...
...
@@ -78,7 +78,7 @@ draw quad
probe all rgba (1.0, 5.0, 7.0, 12.0)
[pixel shader
todo
]
[pixel shader]
float4 main() : SV_TARGET
{
float3x2 m = {1, 2, 3, 4, 5, 6};
...
...
@@ -89,8 +89,8 @@ float4 main() : SV_TARGET
}
[test]
todo
draw quad
todo
probe all rgba (30.0, 40.0, 5.0, 6.0)
draw quad
probe all rgba (30.0, 40.0, 5.0, 6.0)
[pixel shader]
...
...
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