Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Erik Faye-Lund
mesa
Commits
51d56001
Commit
51d56001
authored
Sep 17, 2020
by
Jesse Natalie
Committed by
Erik Faye-Lund
Oct 28, 2020
Browse files
FORK ONLY: nir_lower_io: Deal with shader_in and non-merged variable list
parent
17b9f908
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/compiler/nir/nir_lower_io.c
View file @
51d56001
...
...
@@ -1668,6 +1668,7 @@ lower_vars_to_explicit(nir_shader *shader,
unsigned
offset
;
switch
(
mode
)
{
case
nir_var_uniform
:
case
nir_var_shader_in
:
assert
(
shader
->
info
.
stage
==
MESA_SHADER_KERNEL
);
offset
=
0
;
break
;
...
...
@@ -1685,6 +1686,9 @@ lower_vars_to_explicit(nir_shader *shader,
unreachable
(
"Unsupported mode"
);
}
nir_foreach_variable
(
var
,
vars
)
{
if
(
var
->
data
.
mode
!=
mode
)
continue
;
unsigned
size
,
align
;
const
struct
glsl_type
*
explicit_type
=
glsl_get_explicit_type_for_size_align
(
var
->
type
,
type_info
,
&
size
,
&
align
);
...
...
@@ -1699,6 +1703,7 @@ lower_vars_to_explicit(nir_shader *shader,
switch
(
mode
)
{
case
nir_var_uniform
:
case
nir_var_shader_in
:
assert
(
shader
->
info
.
stage
==
MESA_SHADER_KERNEL
);
shader
->
num_uniforms
=
offset
;
break
;
...
...
@@ -1731,14 +1736,18 @@ nir_lower_vars_to_explicit_types(nir_shader *shader,
* - interface types
*/
ASSERTED
nir_variable_mode
supported
=
nir_var_mem_shared
|
nir_var_mem_global
|
nir_var_shader_temp
|
nir_var_function_temp
|
nir_var_uniform
;
nir_var_mem_shared
|
nir_var_mem_global
|
nir_var_mem_constant
|
nir_var_shader_temp
|
nir_var_function_temp
|
nir_var_uniform
|
nir_var_shader_in
;
assert
(
!
(
modes
&
~
supported
)
&&
"unsupported"
);
bool
progress
=
false
;
if
(
modes
&
nir_var_uniform
)
progress
|=
lower_vars_to_explicit
(
shader
,
&
shader
->
variables
,
nir_var_uniform
,
type_info
);
progress
|=
lower_vars_to_explicit
(
shader
,
&
shader
->
uniforms
,
nir_var_uniform
,
type_info
);
if
(
modes
&
nir_var_mem_constant
)
progress
|=
lower_vars_to_explicit
(
shader
,
&
shader
->
uniforms
,
nir_var_mem_constant
,
type_info
);
if
(
modes
&
nir_var_shader_in
)
progress
|=
lower_vars_to_explicit
(
shader
,
&
shader
->
inputs
,
nir_var_shader_in
,
type_info
);
if
(
modes
&
nir_var_mem_shared
)
progress
|=
lower_vars_to_explicit
(
shader
,
&
shader
->
shared
,
nir_var_mem_shared
,
type_info
);
if
(
modes
&
nir_var_shader_temp
)
...
...
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