Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Erik Faye-Lund
mesa
Commits
4666f8c9
Commit
4666f8c9
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
nir/spirv: Use uniform rather than shader_in for kernel inputs
parent
265fae06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_lower_io.c
+2
-2
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/spirv_to_nir.c
+1
-1
src/compiler/spirv/vtn_variables.c
src/compiler/spirv/vtn_variables.c
+2
-2
No files found.
src/compiler/nir/nir_lower_io.c
View file @
4666f8c9
...
...
@@ -827,7 +827,7 @@ static nir_ssa_def *
build_addr_for_var
(
nir_builder
*
b
,
nir_variable
*
var
,
nir_address_format
addr_format
)
{
assert
(
var
->
data
.
mode
&
(
nir_var_
shader_in
|
nir_var_mem_shared
|
assert
(
var
->
data
.
mode
&
(
nir_var_
uniform
|
nir_var_mem_shared
|
nir_var_shader_temp
|
nir_var_function_temp
|
nir_var_mem_constant
));
...
...
@@ -977,7 +977,7 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin,
assert
(
addr_format_is_global
(
addr_format
));
op
=
nir_intrinsic_load_global
;
break
;
case
nir_var_
shader_in
:
case
nir_var_
uniform
:
assert
(
addr_format_is_offset
(
addr_format
));
op
=
nir_intrinsic_load_kernel_input
;
break
;
...
...
src/compiler/spirv/spirv_to_nir.c
View file @
4666f8c9
...
...
@@ -5454,7 +5454,7 @@ vtn_emit_kernel_entry_point_wrapper(struct vtn_builder *b,
/* input variable */
nir_variable
*
in_var
=
rzalloc
(
b
->
nb
.
shader
,
nir_variable
);
in_var
->
data
.
mode
=
nir_var_
shader_in
;
in_var
->
data
.
mode
=
nir_var_
uniform
;
in_var
->
data
.
read_only
=
true
;
in_var
->
data
.
location
=
i
;
if
(
param_type
->
base_type
==
vtn_base_type_image
)
{
...
...
src/compiler/spirv/vtn_variables.c
View file @
4666f8c9
...
...
@@ -2631,12 +2631,12 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
ptr_type
=
rzalloc
(
b
,
struct
vtn_type
);
ptr_type
->
base_type
=
vtn_base_type_pointer
;
ptr_type
->
deref
=
sampler_type
;
ptr_type
->
storage_class
=
SpvStorageClassUniform
;
ptr_type
->
storage_class
=
SpvStorageClassUniform
Constant
;
ptr_type
->
type
=
nir_address_format_to_glsl_type
(
vtn_mode_to_address_format
(
b
,
vtn_variable_mode_function
));
vtn_create_variable
(
b
,
val
,
ptr_type
,
ptr_type
->
s
torage
_c
lass
,
NULL
,
NULL
);
vtn_create_variable
(
b
,
val
,
ptr_type
,
SpvS
torage
C
lass
Uniform
,
NULL
,
NULL
);
nir_variable
*
nir_var
=
val
->
pointer
->
var
->
var
;
nir_var
->
data
.
sampler
.
is_inline_sampler
=
true
;
...
...
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