Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Erik Faye-Lund
mesa
Commits
80351602
Commit
80351602
authored
Aug 28, 2020
by
Jesse Natalie
Committed by
Erik Faye-Lund
Oct 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
microsoft/clc: Use kernel input variable locations instead of a loop counter
parent
44307792
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/microsoft/clc/clc_compiler.c
src/microsoft/clc/clc_compiler.c
+9
-6
No files found.
src/microsoft/clc/clc_compiler.c
View file @
80351602
...
...
@@ -1265,9 +1265,13 @@ clc_to_dxil(struct clc_context *ctx,
}
// Calculate input offsets/metadata.
unsigned
i
=
0
,
uav_id
=
0
,
sampler_id
=
0
,
offset
=
0
;
unsigned
uav_id
=
0
,
sampler_id
=
0
,
offset
=
0
;
dxil_wrap_sampler_state
int_sampler_states
[
PIPE_MAX_SHADER_SAMPLER_VIEWS
]
=
{{{
0
}}};
nir_foreach_variable
(
var
,
&
nir
->
inputs
)
{
int
i
=
var
->
data
.
location
;
if
(
i
<
0
)
continue
;
unsigned
size
=
glsl_get_cl_size
(
var
->
type
);
offset
=
align
(
offset
,
glsl_get_cl_alignment
(
var
->
type
));
var
->
data
.
driver_location
=
offset
;
...
...
@@ -1292,16 +1296,16 @@ clc_to_dxil(struct clc_context *ctx,
conf
?
conf
->
args
[
i
].
sampler
.
linear_filtering
:
0
;
metadata
->
args
[
i
].
sampler
.
sampler_id
=
var
->
data
.
binding
=
sampler_id
++
;
}
i
++
;
offset
+=
size
;
}
assert
(
i
==
dxil
->
kernel
->
num_args
);
// Second pass over inputs to calculate image bindings
unsigned
srv_id
=
0
;
i
=
0
;
nir_foreach_variable
(
var
,
&
nir
->
inputs
)
{
int
i
=
var
->
data
.
location
;
if
(
i
<
0
)
continue
;
if
(
glsl_type_is_image
(
var
->
type
))
{
if
(
var
->
data
.
access
==
ACCESS_NON_WRITEABLE
)
{
metadata
->
args
[
i
].
image
.
buf_ids
[
0
]
=
srv_id
++
;
...
...
@@ -1313,7 +1317,6 @@ clc_to_dxil(struct clc_context *ctx,
metadata
->
args
[
i
].
image
.
num_buf_ids
=
1
;
var
->
data
.
binding
=
metadata
->
args
[
i
].
image
.
buf_ids
[
0
];
}
i
++
;
}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment