[Mesa-dev] [PATCH 18/18] st/glsl_to_nir/radeonsi: enable tessellation shaders
Timothy Arceri
tarceri at itsqueeze.com
Mon Dec 11 02:43:28 UTC 2017
---
src/gallium/drivers/radeonsi/si_shader_nir.c | 2 ++
src/mesa/state_tracker/st_glsl_to_nir.cpp | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index f96bf7c2d2f..5ac020d9fc4 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -150,20 +150,22 @@ void si_nir_scan_tess_ctrl(const struct nir_shader *nir,
}
void si_nir_scan_shader(const struct nir_shader *nir,
struct tgsi_shader_info *info)
{
nir_function *func;
unsigned i;
assert(nir->info.stage == MESA_SHADER_VERTEX ||
nir->info.stage == MESA_SHADER_GEOMETRY ||
+ nir->info.stage == MESA_SHADER_TESS_CTRL ||
+ nir->info.stage == MESA_SHADER_TESS_EVAL ||
nir->info.stage == MESA_SHADER_FRAGMENT);
info->processor = pipe_shader_type_from_mesa(nir->info.stage);
info->num_tokens = 2; /* indicate that the shader is non-empty */
info->num_instructions = 2;
if (nir->info.stage == MESA_SHADER_TESS_CTRL) {
info->properties[TGSI_PROPERTY_TCS_VERTICES_OUT] =
nir->info.tess.tcs_vertices_out;
}
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 36adf55cd45..90b65ee85ed 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -648,21 +648,23 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog,
/* Needs special handling so drvloc matches the vbo state: */
st_nir_assign_vs_in_locations(prog, nir);
/* Re-lower global vars, to deal with any dead VS inputs. */
NIR_PASS_V(nir, nir_lower_global_vars_to_local);
sort_varyings(&nir->outputs);
st_nir_assign_var_locations(&nir->outputs,
&nir->num_outputs,
nir->info.stage);
st_nir_fixup_varying_slots(st, &nir->outputs);
- } else if (nir->info.stage == MESA_SHADER_GEOMETRY) {
+ } else if (nir->info.stage == MESA_SHADER_GEOMETRY ||
+ nir->info.stage == MESA_SHADER_TESS_CTRL ||
+ nir->info.stage == MESA_SHADER_TESS_EVAL) {
sort_varyings(&nir->inputs);
st_nir_assign_var_locations(&nir->inputs,
&nir->num_inputs,
nir->info.stage);
st_nir_fixup_varying_slots(st, &nir->inputs);
sort_varyings(&nir->outputs);
st_nir_assign_var_locations(&nir->outputs,
&nir->num_outputs,
nir->info.stage);
--
2.14.3
More information about the mesa-dev
mailing list