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
15ea5ff9
Commit
15ea5ff9
authored
1 year ago
by
Francisco Casas
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
vkd3d-shader/hlsl: Separate tracking of sampler_dim and usage for object components.
parent
c4f074d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!209
vkd3d-shader/hlsl: Broaden resources support v2, part 3.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/vkd3d-shader/hlsl_codegen.c
+32
-18
32 additions, 18 deletions
libs/vkd3d-shader/hlsl_codegen.c
with
32 additions
and
18 deletions
libs/vkd3d-shader/hlsl_codegen.c
+
32
−
18
View file @
15ea5ff9
...
...
@@ -3097,7 +3097,7 @@ static const char *debug_register(char class, struct hlsl_reg reg, const struct
return
vkd3d_dbg_sprintf
(
"%c%u%s"
,
class
,
reg
.
id
,
debug_hlsl_writemask
(
reg
.
writemask
));
}
static
bool
track_object_components_
u
sa
ge
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_ir_node
*
instr
,
void
*
context
)
static
bool
track_object_components_sa
mpler_dim
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_ir_node
*
instr
,
void
*
context
)
{
struct
hlsl_ir_resource_load
*
load
;
struct
hlsl_ir_var
*
var
;
...
...
@@ -3109,15 +3109,16 @@ static bool track_object_components_usage(struct hlsl_ctx *ctx, struct hlsl_ir_n
load
=
hlsl_ir_resource_load
(
instr
);
var
=
load
->
resource
.
var
;
regset
=
hlsl_type_get_regset
(
hlsl_deref_get_type
(
ctx
,
&
load
->
resource
));
if
(
!
hlsl_regset_index_from_deref
(
ctx
,
&
load
->
resource
,
regset
,
&
index
))
return
false
;
if
(
regset
==
HLSL_REGSET_SAMPLERS
)
{
enum
hlsl_sampler_dim
dim
;
assert
(
!
load
->
sampler
.
var
);
if
(
!
hlsl_regset_index_from_deref
(
ctx
,
&
load
->
resource
,
regset
,
&
index
))
return
false
;
dim
=
var
->
objects_usage
[
regset
][
index
].
sampler_dim
;
if
(
dim
!=
load
->
sampling_dim
)
...
...
@@ -3135,25 +3136,37 @@ static bool track_object_components_usage(struct hlsl_ctx *ctx, struct hlsl_ir_n
return
false
;
}
}
var
->
objects_usage
[
regset
][
index
].
used
=
true
;
var
->
objects_usage
[
regset
][
index
].
sampler_dim
=
load
->
sampling_dim
;
}
else
{
if
(
!
hlsl_regset_index_from_deref
(
ctx
,
&
load
->
resource
,
regset
,
&
index
))
return
false
;
var
->
objects_usage
[
regset
][
index
].
sampler_dim
=
load
->
sampling_dim
;
var
->
objects_usage
[
regset
][
index
].
used
=
tru
e
;
var
->
objects_usage
[
regset
][
index
].
sampler_dim
=
load
->
sampling_dim
;
return
fals
e
;
}
if
(
load
->
sampler
.
var
)
{
var
=
load
->
sampler
.
var
;
if
(
!
hlsl_regset_index_from_deref
(
ctx
,
&
load
->
sampler
,
HLSL_REGSET_SAMPLERS
,
&
index
))
return
false
;
static
bool
track_object_components_usage
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_ir_node
*
instr
,
void
*
context
)
{
struct
hlsl_ir_resource_load
*
load
;
struct
hlsl_ir_var
*
var
;
enum
hlsl_regset
regset
;
unsigned
int
index
;
var
->
objects_usage
[
HLSL_REGSET_SAMPLERS
][
index
].
used
=
true
;
}
if
(
instr
->
type
!=
HLSL_IR_RESOURCE_LOAD
)
return
false
;
load
=
hlsl_ir_resource_load
(
instr
);
var
=
load
->
resource
.
var
;
regset
=
hlsl_type_get_regset
(
hlsl_deref_get_type
(
ctx
,
&
load
->
resource
));
if
(
!
hlsl_regset_index_from_deref
(
ctx
,
&
load
->
resource
,
regset
,
&
index
))
return
false
;
var
->
objects_usage
[
regset
][
index
].
used
=
true
;
if
(
load
->
sampler
.
var
)
{
var
=
load
->
sampler
.
var
;
if
(
!
hlsl_regset_index_from_deref
(
ctx
,
&
load
->
sampler
,
HLSL_REGSET_SAMPLERS
,
&
index
))
return
false
;
var
->
objects_usage
[
HLSL_REGSET_SAMPLERS
][
index
].
used
=
true
;
}
return
false
;
...
...
@@ -4194,6 +4207,7 @@ int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry
}
hlsl_transform_ir
(
ctx
,
validate_static_object_references
,
body
,
NULL
);
hlsl_transform_ir
(
ctx
,
track_object_components_sampler_dim
,
body
,
NULL
);
hlsl_transform_ir
(
ctx
,
track_object_components_usage
,
body
,
NULL
);
/* TODO: move forward, remove when no longer needed */
...
...
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