}
}
+/**
+ * Update stream-output info for GS/TCS/TES. Normally this is done in
+ * st_translate_program_common() but that is not called for glsl_to_nir
+ * case.
+ */
+static void
+st_translate_program_stream_output(struct gl_program *prog,
+ struct pipe_stream_output_info *stream_output)
+{
+ if (!prog->sh.LinkedTransformFeedback)
+ return;
+
+ ubyte outputMapping[VARYING_SLOT_TESS_MAX];
+ GLuint attr;
+ uint num_outputs = 0;
+
+ memset(outputMapping, 0, sizeof(outputMapping));
+
+ /*
+ * Determine number of outputs, the (default) output register
+ * mapping and the semantic information for each output.
+ */
+ for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
+ if (prog->info.outputs_written & BITFIELD64_BIT(attr)) {
+ GLuint slot = num_outputs++;
+
+ outputMapping[attr] = slot;
+ }
+ }
+
+ st_translate_stream_output_info2(prog->sh.LinkedTransformFeedback,
+ outputMapping,
+ stream_output);
+}
/**
* Translate a geometry program to create a new variant.
struct ureg_program *ureg;
/* We have already compiled to NIR so just return */
- if (stgp->shader_program)
+ if (stgp->shader_program) {
+ st_translate_program_stream_output(&stgp->Base, &stgp->tgsi.stream_output);
return true;
+ }
ureg = ureg_create_with_screen(PIPE_SHADER_GEOMETRY, st->pipe->screen);
if (ureg == NULL)
tgsi.ir.nir = nir_shader_clone(NULL, prog->tgsi.ir.nir);
st_finalize_nir(st, &prog->Base, prog->shader_program,
tgsi.ir.nir);
+ tgsi.stream_output = prog->tgsi.stream_output;
} else
tgsi = prog->tgsi;
/* fill in new variant */
{
struct ureg_program *ureg;
- /* We have already compiler to NIR so just return */
+ /* We have already compiled to NIR so just return */
if (sttcp->shader_program)
return true;
{
struct ureg_program *ureg;
- /* We have already compiler to NIR so just return */
- if (sttep->shader_program)
+ /* We have already compiled to NIR so just return */
+ if (sttep->shader_program) {
+ st_translate_program_stream_output(&sttep->Base, &sttep->tgsi.stream_output);
return true;
+ }
ureg = ureg_create_with_screen(PIPE_SHADER_TESS_EVAL, st->pipe->screen);
if (ureg == NULL)