From: Jordan Justen Date: Thu, 25 Oct 2018 23:17:04 +0000 (-0700) Subject: intel/blorp: Add compute support to BLORP_CREATE_NIR_INPUT X-Git-Tag: upstream/22.3.5~17270 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ace2e36cc1d9970e5185458670ef763021ab892;p=platform%2Fupstream%2Fmesa.git intel/blorp: Add compute support to BLORP_CREATE_NIR_INPUT Reworks: * Set driver_location (s-b Jason) Signed-off-by: Jordan Justen Reviewed-by: Jason Ekstrand Reviewed-by: Kenneth Graunke Part-of: --- diff --git a/src/intel/blorp/blorp_priv.h b/src/intel/blorp/blorp_priv.h index ac66802..4ae551e 100644 --- a/src/intel/blorp/blorp_priv.h +++ b/src/intel/blorp/blorp_priv.h @@ -161,12 +161,18 @@ blorp_create_nir_input(struct nir_shader *nir, const struct glsl_type *type, unsigned int offset) { - nir_variable *input = - nir_variable_create(nir, nir_var_shader_in, type, name); + nir_variable *input; + if (nir->info.stage == MESA_SHADER_COMPUTE) { + input = nir_variable_create(nir, nir_var_uniform, type, name); + input->data.driver_location = offset; + input->data.location = offset; + } else { + input = nir_variable_create(nir, nir_var_shader_in, type, name); + input->data.location = VARYING_SLOT_VAR0 + offset / (4 * sizeof(float)); + input->data.location_frac = (offset / sizeof(float)) % 4; + } if (nir->info.stage == MESA_SHADER_FRAGMENT) input->data.interpolation = INTERP_MODE_FLAT; - input->data.location = VARYING_SLOT_VAR0 + offset / (4 * sizeof(float)); - input->data.location_frac = (offset / sizeof(float)) % 4; return input; }