From 70425bcfe63c4e9191809659d019ec4af923595d Mon Sep 17 00:00:00 2001 From: "Joe M. Kniss" Date: Wed, 20 Jun 2018 17:55:10 -0700 Subject: gallium: plumb invariant output attrib thru TGSI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for glsl 'invariant' modifier for output data declarations. Gallium drivers that use TGSI serialization currently loose invariant modifiers in glsl shaders. v2: use boolean for invariant instead of unsigned. Tested: chromiumos on qemu with virglrenderer. Reviewed-by: Marek Olšák Signed-off-by: Dave Airlie --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 673c0f6b67a..00799b4a872 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -123,6 +123,7 @@ struct inout_decl { enum glsl_interp_mode interp; enum glsl_base_type base_type; ubyte usage_mask; /* GLSL-style usage-mask, i.e. single bit per double */ + bool invariant; }; static struct inout_decl * @@ -2508,6 +2509,8 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir) unsigned num_components; num_outputs++; + decl->invariant = var->data.invariant; + if (type_without_array->is_64bit()) component = component / 2; if (type_without_array->vector_elements) @@ -6443,14 +6446,15 @@ st_translate_program( (enum tgsi_semantic) outputSemanticName[slot], outputSemanticIndex[slot], decl->gs_out_streams, - slot, tgsi_usage_mask, decl->array_id, decl->size); - + slot, tgsi_usage_mask, decl->array_id, decl->size, decl->invariant); + dst.Invariant = decl->invariant; for (unsigned j = 0; j < decl->size; ++j) { if (t->outputs[slot + j].File != TGSI_FILE_OUTPUT) { /* The ArrayID is set up in dst_register */ t->outputs[slot + j] = dst; t->outputs[slot + j].ArrayID = 0; t->outputs[slot + j].Index += j; + t->outputs[slot + j].Invariant = decl->invariant; } } } -- cgit v1.2.3