shader->info->name = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name);
if (shader_prog->Label)
shader->info->label = ralloc_strdup(shader, shader_prog->Label);
- shader->info->clip_distance_array_size = sh->Program->ClipDistanceArraySize;
- shader->info->cull_distance_array_size = sh->Program->CullDistanceArraySize;
shader->info->has_transform_feedback_varyings =
shader_prog->TransformFeedback.NumVarying > 0;
/**
* Verify that a vertex shader executable meets all semantic requirements.
*
- * Also sets prog->Vert.ClipDistanceArraySize and
- * prog->Vert.CullDistanceArraySize as a side effect.
+ * Also sets info.clip_distance_array_size and
+ * info.cull_distance_array_size as a side effect.
*
* \param shader Vertex shader executable to be verified
*/
}
analyze_clip_cull_usage(prog, shader, ctx,
- &prog->Vert.ClipDistanceArraySize,
- &prog->Vert.CullDistanceArraySize);
+ &shader->Program->info.clip_distance_array_size,
+ &shader->Program->info.cull_distance_array_size);
}
void
return;
analyze_clip_cull_usage(prog, shader, ctx,
- &prog->TessEval.ClipDistanceArraySize,
- &prog->TessEval.CullDistanceArraySize);
+ &shader->Program->info.clip_distance_array_size,
+ &shader->Program->info.cull_distance_array_size);
}
/**
* Verify that a geometry shader executable meets all semantic requirements
*
- * Also sets prog->Geom.VerticesIn, and prog->Geom.ClipDistanceArraySize and
- * prog->Geom.CullDistanceArraySize as a side effect.
+ * Also sets prog->Geom.VerticesIn, and info.clip_distance_array_sizeand
+ * info.cull_distance_array_size as a side effect.
*
* \param shader Geometry shader executable to be verified
*/
prog->Geom.VerticesIn = num_vertices;
analyze_clip_cull_usage(prog, shader, ctx,
- &prog->Geom.ClipDistanceArraySize,
- &prog->Geom.CullDistanceArraySize);
+ &shader->Program->info.clip_distance_array_size,
+ &shader->Program->info.cull_distance_array_size);
}
/**
}
if (num_shaders[MESA_SHADER_GEOMETRY] > 0) {
- prog->LastClipDistanceArraySize = prog->Geom.ClipDistanceArraySize;
- prog->LastCullDistanceArraySize = prog->Geom.CullDistanceArraySize;
+ prog->LastClipDistanceArraySize = prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program->info.clip_distance_array_size;
+ prog->LastCullDistanceArraySize = prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program->info.cull_distance_array_size;
} else if (num_shaders[MESA_SHADER_TESS_EVAL] > 0) {
- prog->LastClipDistanceArraySize = prog->TessEval.ClipDistanceArraySize;
- prog->LastCullDistanceArraySize = prog->TessEval.CullDistanceArraySize;
+ prog->LastClipDistanceArraySize = prog->_LinkedShaders[MESA_SHADER_TESS_EVAL]->Program->info.clip_distance_array_size;
+ prog->LastCullDistanceArraySize = prog->_LinkedShaders[MESA_SHADER_TESS_EVAL]->Program->info.cull_distance_array_size;
} else if (num_shaders[MESA_SHADER_VERTEX] > 0) {
- prog->LastClipDistanceArraySize = prog->Vert.ClipDistanceArraySize;
- prog->LastCullDistanceArraySize = prog->Vert.CullDistanceArraySize;
+ prog->LastClipDistanceArraySize = prog->_LinkedShaders[MESA_SHADER_VERTEX]->Program->info.clip_distance_array_size;
+ prog->LastCullDistanceArraySize = prog->_LinkedShaders[MESA_SHADER_VERTEX]->Program->info.cull_distance_array_size;
} else {
prog->LastClipDistanceArraySize = 0; /* Not used */
prog->LastCullDistanceArraySize = 0; /* Not used */
if (ctx->Transform.ClipPlanesEnabled != 0 &&
(ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) &&
- vp->program.ClipDistanceArraySize == 0) {
+ vp->program.info.clip_distance_array_size == 0) {
key->nr_userclip_plane_consts =
_mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
}
GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */
GLbitfield ExternalSamplersUsed; /**< Texture units used for samplerExternalOES */
- /* Vertex and geometry shaders fields */
- unsigned ClipDistanceArraySize;
- unsigned CullDistanceArraySize;
-
/* Fragement shader only fields */
GLboolean OriginUpperLeft;
GLboolean PixelCenterInteger;
/** Post-link gl_FragDepth layout for ARB_conservative_depth. */
enum gl_frag_depth_layout FragDepthLayout;
- /**
- * Tessellation Evaluation shader state from layout qualifiers.
- */
- struct {
- /**
- * True if gl_ClipDistance is written to. Copied into
- * gl_program by _mesa_copy_linked_program_data().
- */
- GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or
- 0 if not present. */
- GLuint CullDistanceArraySize; /**< Size of the gl_CullDistance array, or
- 0 if not present. */
- } TessEval;
-
/**
* Geometry shader state - copied into gl_program by
* _mesa_copy_linked_program_data().
struct {
GLint VerticesIn;
- /**
- * True if gl_ClipDistance is written to. Copied into
- * gl_program by _mesa_copy_linked_program_data().
- */
- GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or
- 0 if not present. */
- GLuint CullDistanceArraySize; /**< Size of the gl_CullDistance array, or
- 0 if not present. */
bool UsesEndPrimitive;
bool UsesStreams;
} Geom;
- /** Vertex shader state */
- struct {
- /**
- * True if gl_ClipDistance is written to. Copied into gl_program
- * by _mesa_copy_linked_program_data().
- */
- GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or
- 0 if not present. */
- GLuint CullDistanceArraySize; /**< Size of the gl_CullDistance array, or
- 0 if not present. */
- } Vert;
-
/**
* Compute shader state - copied into gl_program by
* _mesa_copy_linked_program_data().
dst->info.separate_shader = src->SeparateShader;
switch (dst_sh->Stage) {
- case MESA_SHADER_VERTEX:
- dst->ClipDistanceArraySize = src->Vert.ClipDistanceArraySize;
- dst->CullDistanceArraySize = src->Vert.CullDistanceArraySize;
- break;
case MESA_SHADER_TESS_EVAL: {
dst->info.tess.primitive_mode = dst_sh->info.TessEval.PrimitiveMode;
dst->info.tess.spacing = dst_sh->info.TessEval.Spacing;
dst->info.tess.ccw = dst_sh->info.TessEval.VertexOrder == GL_CCW;
dst->info.tess.point_mode = dst_sh->info.TessEval.PointMode;
- dst->ClipDistanceArraySize = src->TessEval.ClipDistanceArraySize;
- dst->CullDistanceArraySize = src->TessEval.CullDistanceArraySize;
break;
}
case MESA_SHADER_GEOMETRY: {
dst->info.gs.invocations = dst_sh->info.Geom.Invocations;
dst->info.gs.input_primitive = dst_sh->info.Geom.InputType;
dst->info.gs.output_primitive = dst_sh->info.Geom.OutputType;
- dst->ClipDistanceArraySize = src->Geom.ClipDistanceArraySize;
- dst->CullDistanceArraySize = src->Geom.CullDistanceArraySize;
dst->info.gs.uses_end_primitive = src->Geom.UsesEndPrimitive;
dst->info.gs.uses_streams = src->Geom.UsesStreams;
break;
if (ureg == NULL)
return false;
- if (stvp->Base.ClipDistanceArraySize)
+ if (stvp->Base.info.clip_distance_array_size)
ureg_property(ureg, TGSI_PROPERTY_NUM_CLIPDIST_ENABLED,
- stvp->Base.ClipDistanceArraySize);
- if (stvp->Base.CullDistanceArraySize)
+ stvp->Base.info.clip_distance_array_size);
+ if (stvp->Base.info.cull_distance_array_size)
ureg_property(ureg, TGSI_PROPERTY_NUM_CULLDIST_ENABLED,
- stvp->Base.CullDistanceArraySize);
+ stvp->Base.info.cull_distance_array_size);
if (ST_DEBUG & DEBUG_MESA) {
_mesa_print_program(&stvp->Base);
memset(outputMapping, 0, sizeof(outputMapping));
memset(out_state, 0, sizeof(*out_state));
- if (prog->ClipDistanceArraySize)
+ if (prog->info.clip_distance_array_size)
ureg_property(ureg, TGSI_PROPERTY_NUM_CLIPDIST_ENABLED,
- prog->ClipDistanceArraySize);
- if (prog->CullDistanceArraySize)
+ prog->info.clip_distance_array_size);
+ if (prog->info.cull_distance_array_size)
ureg_property(ureg, TGSI_PROPERTY_NUM_CULLDIST_ENABLED,
- prog->CullDistanceArraySize);
+ prog->info.cull_distance_array_size);
/*
* Convert Mesa program inputs to TGSI input register semantics.