Skip to content
Snippets Groups Projects
Commit 77a63d19 authored by Matt Turner's avatar Matt Turner
Browse files

nir: Don't print swizzles when there are more than 4 components


... as can happen with various types like mat4, or else we'll smash the
stack writing past the end of components_local[].

Fixes: 5a0d3e11 ("nir: Print the components referenced for split or
                      packed shader in/outs.")
Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
parent 34593e97
No related branches found
No related tags found
No related merge requests found
......@@ -457,7 +457,7 @@ print_var_decl(nir_variable *var, print_state *state)
switch (var->data.mode) {
case nir_var_shader_in:
case nir_var_shader_out:
if (num_components != 4 && num_components != 0) {
if (num_components < 4 && num_components != 0) {
const char *xyzw = "xyzw";
for (int i = 0; i < num_components; i++)
components_local[i + 1] = xyzw[i + var->data.location_frac];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment