When we got NIR directly from state tracker (vs using tgsi_to_nir) we
need to realize this and skip some TGSI specific hacks.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
tgsi_dump(toks, 0);
nir_shader *nir = ir3_tgsi_to_nir(toks);
+ s.from_tgsi = true;
s.compiler = ir3_compiler_create(NULL, gpu_id);
s.nir = ir3_optimize_nir(&s, nir, NULL);
/* preserve hack for depth output.. tgsi writes depth to .z,
* but what we give the hw is the scalar register:
*/
- if ((so->type == SHADER_FRAGMENT) &&
- (so->outputs[i].slot == FRAG_RESULT_DEPTH))
+ if (so->shader->from_tgsi && (so->type == SHADER_FRAGMENT) &&
+ (so->outputs[i].slot == FRAG_RESULT_DEPTH))
so->outputs[i].regid += 2;
}
tgsi_dump(cso->tokens, 0);
}
nir = ir3_tgsi_to_nir(cso->tokens);
+ shader->from_tgsi = true;
}
/* do first pass optimization, ignoring the key: */
shader->nir = ir3_optimize_nir(shader, nir, NULL);
uint32_t id;
uint32_t variant_count;
+ /* so we know when we can disable TGSI related hacks: */
+ bool from_tgsi;
+
struct ir3_compiler *compiler;
nir_shader *nir;