mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 23:08:18 +02:00
nir: use nir_variable_clone in nir_create_passthrough_gs
Some stream out properties where not being copied causing problems in zink. Use the appropiate helper instead of copying fields by hand. Fixes:d0342e28b3("nir: Add helper to create passthrough GS shader") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22871> (cherry picked from commit78d59ef4b1)
This commit is contained in:
parent
95053266cc
commit
41ba7bb42e
2 changed files with 12 additions and 24 deletions
|
|
@ -3019,7 +3019,7 @@
|
|||
"description": "nir: use `nir_variable_clone` in `nir_create_passthrough_gs`",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d0342e28b32d7aa4b25cf045ac9933348ec053a9"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -194,16 +194,12 @@ nir_create_passthrough_gs(const nir_shader_compiler_options *options,
|
|||
else
|
||||
snprintf(name, sizeof(name), "in_%d", var->data.driver_location);
|
||||
|
||||
nir_variable *in = nir_variable_create(nir, nir_var_shader_in,
|
||||
glsl_array_type(var->type,
|
||||
array_size_for_prim(primitive_type),
|
||||
false),
|
||||
name);
|
||||
in->data.location = var->data.location;
|
||||
in->data.location_frac = var->data.location_frac;
|
||||
in->data.driver_location = var->data.driver_location;
|
||||
in->data.interpolation = var->data.interpolation;
|
||||
in->data.compact = var->data.compact;
|
||||
nir_variable *in = nir_variable_clone(var, nir);
|
||||
ralloc_free(in->name);
|
||||
in->name = ralloc_strdup(in, name);
|
||||
in->type = glsl_array_type(var->type, 4, false);
|
||||
in->data.mode = nir_var_shader_in;
|
||||
nir_shader_add_variable(nir, in);
|
||||
|
||||
in_vars[num_inputs++] = in;
|
||||
|
||||
|
|
@ -219,19 +215,11 @@ nir_create_passthrough_gs(const nir_shader_compiler_options *options,
|
|||
else
|
||||
snprintf(name, sizeof(name), "out_%d", var->data.driver_location);
|
||||
|
||||
nir_variable *out = nir_variable_create(nir, nir_var_shader_out,
|
||||
var->type, name);
|
||||
out->data.location = var->data.location;
|
||||
out->data.location_frac = var->data.location_frac;
|
||||
out->data.driver_location = var->data.driver_location;
|
||||
out->data.interpolation = var->data.interpolation;
|
||||
out->data.compact = var->data.compact;
|
||||
out->data.is_xfb = var->data.is_xfb;
|
||||
out->data.is_xfb_only = var->data.is_xfb_only;
|
||||
out->data.explicit_xfb_buffer = var->data.explicit_xfb_buffer;
|
||||
out->data.explicit_xfb_stride = var->data.explicit_xfb_stride;
|
||||
out->data.xfb = var->data.xfb;
|
||||
out->data.offset = var->data.offset;
|
||||
nir_variable *out = nir_variable_clone(var, nir);
|
||||
ralloc_free(out->name);
|
||||
out->name = ralloc_strdup(out, name);
|
||||
out->data.mode = nir_var_shader_out;
|
||||
nir_shader_add_variable(nir, out);
|
||||
|
||||
out_vars[num_outputs++] = out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue