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
60237cb7
Commit
60237cb7
authored
2 years ago
by
Francisco Casas
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
vkd3d-shader/hlsl: Don't allow manual and automatic cbuffer offset packing.
parent
4448d114
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!106
vkd3d-shader/hlsl: packoffset() support.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libs/vkd3d-shader/hlsl.h
+3
-0
3 additions, 0 deletions
libs/vkd3d-shader/hlsl.h
libs/vkd3d-shader/hlsl_codegen.c
+19
-0
19 additions, 0 deletions
libs/vkd3d-shader/hlsl_codegen.c
tests/cbuffer.shader_test
+1
-1
1 addition, 1 deletion
tests/cbuffer.shader_test
with
23 additions
and
1 deletion
libs/vkd3d-shader/hlsl.h
+
3
−
0
View file @
60237cb7
...
...
@@ -678,6 +678,9 @@ struct hlsl_buffer
unsigned
size
,
used_size
;
/* Register of type 'b' on which the buffer is allocated. */
struct
hlsl_reg
reg
;
bool
manually_packed_elements
;
bool
automatically_packed_elements
;
};
struct
hlsl_ctx
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d-shader/hlsl_codegen.c
+
19
−
0
View file @
60237cb7
...
...
@@ -2990,6 +2990,25 @@ static void validate_buffer_offsets(struct hlsl_ctx *ctx)
var1
->
name
,
var2
->
name
);
}
}
LIST_FOR_EACH_ENTRY
(
var1
,
&
ctx
->
extern_vars
,
struct
hlsl_ir_var
,
extern_entry
)
{
buffer
=
var1
->
buffer
;
if
(
!
buffer
)
continue
;
if
(
var1
->
reg_reservation
.
offset_type
==
'c'
)
buffer
->
manually_packed_elements
=
true
;
else
buffer
->
automatically_packed_elements
=
true
;
if
(
buffer
->
manually_packed_elements
&&
buffer
->
automatically_packed_elements
)
{
hlsl_error
(
ctx
,
&
buffer
->
loc
,
VKD3D_SHADER_ERROR_HLSL_INVALID_RESERVATION
,
"packoffset() must be specified for all the buffer elements, or none of them."
);
break
;
}
}
}
static
void
allocate_buffers
(
struct
hlsl_ctx
*
ctx
)
...
...
This diff is collapsed.
Click to expand it.
tests/cbuffer.shader_test
+
1
−
1
View file @
60237cb7
...
...
@@ -305,7 +305,7 @@ draw quad
probe all rgba (512.0, 612.0, 712.0, 812.0)
[pixel shader fail
todo
]
[pixel shader fail]
// packoffset cannot be used unless all elements use it.
cbuffer buffer
{
...
...
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