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
3862bd9d
Commit
3862bd9d
authored
Aug 20, 2020
by
Jesse Natalie
Committed by
Erik Faye-Lund
Oct 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
microsoft/clc: Switch from size_lod intrinsic to just size with lod src
parent
5604c310
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
16 deletions
+7
-16
src/microsoft/clc/clc_compiler.c
src/microsoft/clc/clc_compiler.c
+4
-9
src/microsoft/compiler/nir_to_dxil.c
src/microsoft/compiler/nir_to_dxil.c
+3
-7
No files found.
src/microsoft/clc/clc_compiler.c
View file @
3862bd9d
...
...
@@ -286,8 +286,7 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont
break
;
}
case
nir_intrinsic_image_deref_size
:
case
nir_intrinsic_image_deref_size_lod
:
{
case
nir_intrinsic_image_deref_size
:
{
nir_ssa_def
*
image_deref
=
NULL
;
for
(
unsigned
i
=
0
;
i
<
IMAGE_UNIFORM_TYPE_COUNT
;
++
i
)
{
if
(
uniform_deref_dests
[
i
])
{
...
...
@@ -314,9 +313,7 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont
if
(
in_var
->
data
.
access
&
ACCESS_NON_WRITEABLE
)
{
// Size query on non-readable resource, convert to txs
b
->
cursor
=
nir_before_instr
(
&
intrinsic
->
instr
);
unsigned
num_src
=
1
;
if
(
intrinsic
->
intrinsic
==
nir_intrinsic_image_deref_size_lod
)
num_src
=
2
;
unsigned
num_src
=
2
;
nir_tex_instr
*
tex
=
nir_tex_instr_create
(
b
->
shader
,
num_src
);
tex
->
op
=
nir_texop_txs
;
...
...
@@ -324,10 +321,8 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont
tex
->
sampler_dim
=
glsl_get_sampler_dim
(
in_var
->
type
);
tex
->
src
[
0
].
src
=
nir_src_for_ssa
(
image_deref
);
tex
->
src
[
0
].
src_type
=
nir_tex_src_texture_deref
;
if
(
intrinsic
->
intrinsic
==
nir_intrinsic_image_deref_size_lod
)
{
tex
->
src
[
1
].
src
=
nir_src_for_ssa
(
intrinsic
->
src
[
1
].
ssa
);
tex
->
src
[
1
].
src_type
=
nir_tex_src_lod
;
}
tex
->
src
[
1
].
src
=
nir_src_for_ssa
(
intrinsic
->
src
[
1
].
ssa
);
tex
->
src
[
1
].
src_type
=
nir_tex_src_lod
;
tex
->
dest_type
=
nir_type_uint
;
nir_ssa_dest_init
(
&
tex
->
instr
,
&
tex
->
dest
,
nir_tex_instr_dest_size
(
tex
),
32
,
NULL
);
...
...
src/microsoft/compiler/nir_to_dxil.c
View file @
3862bd9d
...
...
@@ -2956,12 +2956,9 @@ emit_image_deref_size(struct ntd_context *ctx, nir_intrinsic_instr *intr)
if
(
!
handle
)
return
false
;
const
struct
dxil_value
*
lod
=
get_int32_undef
(
&
ctx
->
mod
);
if
(
intr
->
intrinsic
==
nir_intrinsic_image_deref_size_lod
)
{
lod
=
get_src
(
ctx
,
&
intr
->
src
[
1
],
0
,
nir_type_uint
);
if
(
!
lod
)
return
false
;
}
const
struct
dxil_value
*
lod
=
get_src
(
ctx
,
&
intr
->
src
[
1
],
0
,
nir_type_uint
);
if
(
!
lod
)
return
false
;
struct
texop_parameters
params
=
{
.
tex
=
handle
,
...
...
@@ -3230,7 +3227,6 @@ emit_intrinsic(struct ntd_context *ctx, nir_intrinsic_instr *intr)
case
nir_intrinsic_image_deref_store
:
return
emit_image_deref_store
(
ctx
,
intr
);
case
nir_intrinsic_image_deref_size
:
case
nir_intrinsic_image_deref_size_lod
:
return
emit_image_deref_size
(
ctx
,
intr
);
case
nir_intrinsic_load_num_work_groups
:
...
...
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