unsigned limit = 0;
switch (state->stage) {
case MESA_SHADER_VERTEX:
- limit = ctx->Const.VertexProgram.MaxTextureImageUnits;
+ limit = ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits;
break;
case MESA_SHADER_GEOMETRY:
- limit = ctx->Const.GeometryProgram.MaxTextureImageUnits;
+ limit = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits;
break;
case MESA_SHADER_FRAGMENT:
- limit = ctx->Const.FragmentProgram.MaxTextureImageUnits;
+ limit = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
break;
}
*/
if (state->is_version(0, 300)) {
add_const("gl_MaxVertexOutputVectors",
- state->ctx->Const.VertexProgram.MaxOutputComponents / 4);
+ state->ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4);
add_const("gl_MaxFragmentInputVectors",
- state->ctx->Const.FragmentProgram.MaxInputComponents / 4);
+ state->ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4);
} else {
add_const("gl_MaxVaryingVectors",
state->ctx->Const.MaxVarying);
this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes;
this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits;
this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits;
- this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
- this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
- this->Const.MaxVertexTextureImageUnits = ctx->Const.VertexProgram.MaxTextureImageUnits;
+ this->Const.MaxVertexAttribs = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs;
+ this->Const.MaxVertexUniformComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents;
+ this->Const.MaxVertexTextureImageUnits = ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits;
this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
- this->Const.MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits;
- this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
+ this->Const.MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
+ this->Const.MaxFragmentUniformComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents;
this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset;
this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset;
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
/* 1.50 constants */
- this->Const.MaxVertexOutputComponents = ctx->Const.VertexProgram.MaxOutputComponents;
- this->Const.MaxGeometryInputComponents = ctx->Const.GeometryProgram.MaxInputComponents;
- this->Const.MaxGeometryOutputComponents = ctx->Const.GeometryProgram.MaxOutputComponents;
- this->Const.MaxFragmentInputComponents = ctx->Const.FragmentProgram.MaxInputComponents;
- this->Const.MaxGeometryTextureImageUnits = ctx->Const.GeometryProgram.MaxTextureImageUnits;
+ this->Const.MaxVertexOutputComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ this->Const.MaxGeometryInputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
+ this->Const.MaxGeometryOutputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents;
+ this->Const.MaxFragmentInputComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents;
+ this->Const.MaxGeometryTextureImageUnits = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits;
this->Const.MaxGeometryOutputVertices = ctx->Const.MaxGeometryOutputVertices;
this->Const.MaxGeometryTotalOutputComponents = ctx->Const.MaxGeometryTotalOutputComponents;
- this->Const.MaxGeometryUniformComponents = ctx->Const.GeometryProgram.MaxUniformComponents;
+ this->Const.MaxGeometryUniformComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents;
- this->Const.MaxVertexAtomicCounters = ctx->Const.VertexProgram.MaxAtomicCounters;
- this->Const.MaxGeometryAtomicCounters = ctx->Const.GeometryProgram.MaxAtomicCounters;
- this->Const.MaxFragmentAtomicCounters = ctx->Const.FragmentProgram.MaxAtomicCounters;
+ this->Const.MaxVertexAtomicCounters = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters;
+ this->Const.MaxGeometryAtomicCounters = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters;
+ this->Const.MaxFragmentAtomicCounters = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters;
this->Const.MaxCombinedAtomicCounters = ctx->Const.MaxCombinedAtomicCounters;
this->Const.MaxAtomicBufferBindings = ctx->Const.MaxAtomicBufferBindings;
struct gl_shader_program *prog)
{
const unsigned max_atomic_counters[] = {
- ctx->Const.VertexProgram.MaxAtomicCounters,
- ctx->Const.GeometryProgram.MaxAtomicCounters,
- ctx->Const.FragmentProgram.MaxAtomicCounters
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters
};
STATIC_ASSERT(Elements(max_atomic_counters) == MESA_SHADER_STAGES);
const unsigned max_atomic_buffers[] = {
- ctx->Const.VertexProgram.MaxAtomicBuffers,
- ctx->Const.GeometryProgram.MaxAtomicBuffers,
- ctx->Const.FragmentProgram.MaxAtomicBuffers
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuffers,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers
};
STATIC_ASSERT(Elements(max_atomic_buffers) == MESA_SHADER_STAGES);
unsigned num_buffers;
unsigned max_output_components;
switch (producer->Stage) {
case MESA_SHADER_VERTEX:
- max_output_components = ctx->Const.VertexProgram.MaxOutputComponents;
+ max_output_components = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
break;
case MESA_SHADER_GEOMETRY:
- max_output_components = ctx->Const.GeometryProgram.MaxOutputComponents;
+ max_output_components = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents;
break;
case MESA_SHADER_FRAGMENT:
default:
unsigned max_input_components;
switch (consumer->Stage) {
case MESA_SHADER_GEOMETRY:
- max_input_components = ctx->Const.GeometryProgram.MaxInputComponents;
+ max_input_components = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
break;
case MESA_SHADER_FRAGMENT:
- max_input_components = ctx->Const.FragmentProgram.MaxInputComponents;
+ max_input_components = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents;
break;
case MESA_SHADER_VERTEX:
default:
check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
{
const unsigned max_samplers[] = {
- ctx->Const.VertexProgram.MaxTextureImageUnits,
- ctx->Const.GeometryProgram.MaxTextureImageUnits,
- ctx->Const.FragmentProgram.MaxTextureImageUnits
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits
};
STATIC_ASSERT(Elements(max_samplers) == MESA_SHADER_STAGES);
const unsigned max_default_uniform_components[] = {
- ctx->Const.VertexProgram.MaxUniformComponents,
- ctx->Const.GeometryProgram.MaxUniformComponents,
- ctx->Const.FragmentProgram.MaxUniformComponents
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents
};
STATIC_ASSERT(Elements(max_default_uniform_components) ==
MESA_SHADER_STAGES);
const unsigned max_combined_uniform_components[] = {
- ctx->Const.VertexProgram.MaxCombinedUniformComponents,
- ctx->Const.GeometryProgram.MaxCombinedUniformComponents,
- ctx->Const.FragmentProgram.MaxCombinedUniformComponents
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxCombinedUniformComponents,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents
};
STATIC_ASSERT(Elements(max_combined_uniform_components) ==
MESA_SHADER_STAGES);
const unsigned max_uniform_blocks[] = {
- ctx->Const.VertexProgram.MaxUniformBlocks,
- ctx->Const.GeometryProgram.MaxUniformBlocks,
- ctx->Const.FragmentProgram.MaxUniformBlocks
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformBlocks,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformBlocks
};
STATIC_ASSERT(Elements(max_uniform_blocks) == MESA_SHADER_STAGES);
ctx->Const.MaxTextureCoordUnits = 0;
ctx->Const.MaxTextureUnits = 8;
- ctx->Const.VertexProgram.MaxAttribs = 8;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
- ctx->Const.VertexProgram.MaxUniformComponents = 128 * 4;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 32;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 8;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 128 * 4;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32;
- ctx->Const.FragmentProgram.MaxTextureImageUnits =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits =
ctx->Const.MaxCombinedTextureImageUnits;
- ctx->Const.FragmentProgram.MaxUniformComponents = 16 * 4;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 16 * 4;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4;
break;
case 110:
case 120:
ctx->Const.MaxTextureCoordUnits = 2;
ctx->Const.MaxTextureUnits = 2;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
- ctx->Const.VertexProgram.MaxUniformComponents = 512;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 32;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32;
- ctx->Const.FragmentProgram.MaxTextureImageUnits =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits =
ctx->Const.MaxCombinedTextureImageUnits;
- ctx->Const.FragmentProgram.MaxUniformComponents = 64;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4;
break;
case 130:
case 140:
ctx->Const.MaxTextureCoordUnits = 8;
ctx->Const.MaxTextureUnits = 2;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 1024;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 64;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
- ctx->Const.FragmentProgram.MaxUniformComponents = 1024;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4;
break;
case 150:
case 330:
ctx->Const.MaxTextureCoordUnits = 8;
ctx->Const.MaxTextureUnits = 2;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 1024;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 64;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64;
- ctx->Const.GeometryProgram.MaxTextureImageUnits = 16;
- ctx->Const.GeometryProgram.MaxUniformComponents = 1024;
- ctx->Const.GeometryProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.GeometryProgram.MaxOutputComponents = 128;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = 128;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
- ctx->Const.FragmentProgram.MaxUniformComponents = 1024;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.GeometryProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
ctx->Const.MaxCombinedTextureImageUnits =
- ctx->Const.VertexProgram.MaxTextureImageUnits
- + ctx->Const.GeometryProgram.MaxTextureImageUnits
- + ctx->Const.FragmentProgram.MaxTextureImageUnits;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits
+ + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits
+ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
ctx->Const.MaxGeometryOutputVertices = 256;
ctx->Const.MaxGeometryTotalOutputComponents = 1024;
ctx->Const.MaxTextureCoordUnits = 0;
ctx->Const.MaxTextureUnits = 0;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 1024;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 16 * 4;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 16 * 4;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
- ctx->Const.FragmentProgram.MaxUniformComponents = 224;
- ctx->Const.FragmentProgram.MaxInputComponents = 15 * 4;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 224;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 15 * 4;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.FragmentProgram.MaxInputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4;
break;
}
ctx->Const.MaxClipPlanes = 6;
ctx->Const.MaxTextureUnits = 2;
ctx->Const.MaxTextureCoordUnits = 2;
- ctx->Const.VertexProgram.MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 512;
- ctx->Const.VertexProgram.MaxOutputComponents = 32;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32;
ctx->Const.MaxVarying = 8; /* == gl_MaxVaryingFloats / 4 */
- ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0;
ctx->Const.MaxCombinedTextureImageUnits = 2;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = 2;
- ctx->Const.FragmentProgram.MaxUniformComponents = 64;
- ctx->Const.FragmentProgram.MaxInputComponents = 32;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 2;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 32;
ctx->Const.MaxDrawBuffers = 1;
FALLBACK(intel, INTEL_FALLBACK_USER, 1);
intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS;
- intel->ctx.Const.FragmentProgram.MaxTextureImageUnits = I830_TEX_UNITS;
+ intel->ctx.Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = I830_TEX_UNITS;
intel->ctx.Const.MaxTextureCoordUnits = I830_TEX_UNITS;
/* Advertise the full hardware capabilities. The new memory
FALLBACK(intel, INTEL_FALLBACK_USER, 1);
ctx->Const.MaxTextureUnits = I915_TEX_UNITS;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = I915_TEX_UNITS;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = I915_TEX_UNITS;
ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS;
ctx->Const.MaxVarying = I915_TEX_UNITS;
- ctx->Const.VertexProgram.MaxOutputComponents =
- ctx->Const.FragmentProgram.MaxInputComponents = ctx->Const.MaxVarying * 4;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = ctx->Const.MaxVarying * 4;
ctx->Const.MaxCombinedTextureImageUnits =
- ctx->Const.VertexProgram.MaxTextureImageUnits +
- ctx->Const.FragmentProgram.MaxTextureImageUnits;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits +
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
/* Advertise the full hardware capabilities. The new memory
* manager should cope much better with overload situations:
* instruction can translate to more than one HW instruction, so
* we'll still have to check and fallback each time.
*/
- ctx->Const.FragmentProgram.MaxNativeTemps = I915_MAX_TEMPORARY;
- ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* 8 tex, 2 color, fog */
- ctx->Const.FragmentProgram.MaxNativeParameters = I915_MAX_CONSTANT;
- ctx->Const.FragmentProgram.MaxNativeAluInstructions = I915_MAX_ALU_INSN;
- ctx->Const.FragmentProgram.MaxNativeTexInstructions = I915_MAX_TEX_INSN;
- ctx->Const.FragmentProgram.MaxNativeInstructions = (I915_MAX_ALU_INSN +
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeTemps = I915_MAX_TEMPORARY;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeAttribs = 11; /* 8 tex, 2 color, fog */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeParameters = I915_MAX_CONSTANT;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeAluInstructions = I915_MAX_ALU_INSN;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeTexInstructions = I915_MAX_TEX_INSN;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeInstructions = (I915_MAX_ALU_INSN +
I915_MAX_TEX_INSN);
- ctx->Const.FragmentProgram.MaxNativeTexIndirections =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeTexIndirections =
I915_MAX_TEX_INDIRECT;
- ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
- ctx->Const.FragmentProgram.MaxEnvParams =
- MIN2(ctx->Const.FragmentProgram.MaxNativeParameters,
- ctx->Const.FragmentProgram.MaxEnvParams);
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeAddressRegs = 0; /* I don't think we have one */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams =
+ MIN2(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeParameters,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams);
/* i915 stores all values in single-precision floats. Values aren't set
* for other program targets because software is used for those targets.
*/
- ctx->Const.FragmentProgram.MediumFloat.RangeMin = 127;
- ctx->Const.FragmentProgram.MediumFloat.RangeMax = 127;
- ctx->Const.FragmentProgram.MediumFloat.Precision = 23;
- ctx->Const.FragmentProgram.LowFloat = ctx->Const.FragmentProgram.HighFloat =
- ctx->Const.FragmentProgram.MediumFloat;
- ctx->Const.FragmentProgram.MediumInt.RangeMin = 24;
- ctx->Const.FragmentProgram.MediumInt.RangeMax = 24;
- ctx->Const.FragmentProgram.MediumInt.Precision = 0;
- ctx->Const.FragmentProgram.LowInt = ctx->Const.FragmentProgram.HighInt =
- ctx->Const.FragmentProgram.MediumInt;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumFloat.RangeMin = 127;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumFloat.RangeMax = 127;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumFloat.Precision = 23;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].LowFloat = ctx->Const.Program[MESA_SHADER_FRAGMENT].HighFloat =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumFloat;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumInt.RangeMin = 24;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumInt.RangeMax = 24;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumInt.Precision = 0;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].LowInt = ctx->Const.Program[MESA_SHADER_FRAGMENT].HighInt =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumInt;
ctx->FragmentProgram._MaintainTexEnvProgram = true;
ctx->Const.MaxDualSourceDrawBuffers = 1;
ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
ctx->Const.MaxTextureCoordUnits = 8; /* Mesa limit */
ctx->Const.MaxTextureUnits =
MIN2(ctx->Const.MaxTextureCoordUnits,
- ctx->Const.FragmentProgram.MaxTextureImageUnits);
- ctx->Const.VertexProgram.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits);
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
if (brw->gen >= 7)
- ctx->Const.GeometryProgram.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
else
- ctx->Const.GeometryProgram.MaxTextureImageUnits = 0;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 0;
ctx->Const.MaxCombinedTextureImageUnits =
- ctx->Const.VertexProgram.MaxTextureImageUnits +
- ctx->Const.FragmentProgram.MaxTextureImageUnits +
- ctx->Const.GeometryProgram.MaxTextureImageUnits;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits +
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits +
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits;
ctx->Const.MaxTextureLevels = 14; /* 8192 */
if (ctx->Const.MaxTextureLevels > MAX_TEXTURE_LEVELS)
if (brw->gen >= 5 || brw->is_g4x)
ctx->Const.MaxClipPlanes = 8;
- ctx->Const.VertexProgram.MaxNativeInstructions = 16 * 1024;
- ctx->Const.VertexProgram.MaxAluInstructions = 0;
- ctx->Const.VertexProgram.MaxTexInstructions = 0;
- ctx->Const.VertexProgram.MaxTexIndirections = 0;
- ctx->Const.VertexProgram.MaxNativeAluInstructions = 0;
- ctx->Const.VertexProgram.MaxNativeTexInstructions = 0;
- ctx->Const.VertexProgram.MaxNativeTexIndirections = 0;
- ctx->Const.VertexProgram.MaxNativeAttribs = 16;
- ctx->Const.VertexProgram.MaxNativeTemps = 256;
- ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
- ctx->Const.VertexProgram.MaxNativeParameters = 1024;
- ctx->Const.VertexProgram.MaxEnvParams =
- MIN2(ctx->Const.VertexProgram.MaxNativeParameters,
- ctx->Const.VertexProgram.MaxEnvParams);
-
- ctx->Const.FragmentProgram.MaxNativeInstructions = 1024;
- ctx->Const.FragmentProgram.MaxNativeAluInstructions = 1024;
- ctx->Const.FragmentProgram.MaxNativeTexInstructions = 1024;
- ctx->Const.FragmentProgram.MaxNativeTexIndirections = 1024;
- ctx->Const.FragmentProgram.MaxNativeAttribs = 12;
- ctx->Const.FragmentProgram.MaxNativeTemps = 256;
- ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0;
- ctx->Const.FragmentProgram.MaxNativeParameters = 1024;
- ctx->Const.FragmentProgram.MaxEnvParams =
- MIN2(ctx->Const.FragmentProgram.MaxNativeParameters,
- ctx->Const.FragmentProgram.MaxEnvParams);
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeInstructions = 16 * 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAluInstructions = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTexInstructions = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTexIndirections = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeAluInstructions = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeTexInstructions = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeTexIndirections = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeTemps = 256;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeAddressRegs = 1;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeParameters = 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams =
+ MIN2(ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeParameters,
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams);
+
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeInstructions = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeAluInstructions = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeTexInstructions = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeTexIndirections = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeAttribs = 12;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeTemps = 256;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeAddressRegs = 0;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeParameters = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams =
+ MIN2(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxNativeParameters,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams);
/* Fragment shaders use real, 32-bit twos-complement integers for all
* integer types.
*/
- ctx->Const.FragmentProgram.LowInt.RangeMin = 31;
- ctx->Const.FragmentProgram.LowInt.RangeMax = 30;
- ctx->Const.FragmentProgram.LowInt.Precision = 0;
- ctx->Const.FragmentProgram.HighInt = ctx->Const.FragmentProgram.LowInt;
- ctx->Const.FragmentProgram.MediumInt = ctx->Const.FragmentProgram.LowInt;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].LowInt.RangeMin = 31;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].LowInt.RangeMax = 30;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].LowInt.Precision = 0;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].HighInt = ctx->Const.Program[MESA_SHADER_FRAGMENT].LowInt;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MediumInt = ctx->Const.Program[MESA_SHADER_FRAGMENT].LowInt;
if (brw->gen >= 7) {
- ctx->Const.FragmentProgram.MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
- ctx->Const.VertexProgram.MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
- ctx->Const.GeometryProgram.MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
- ctx->Const.FragmentProgram.MaxAtomicBuffers = BRW_MAX_ABO;
- ctx->Const.VertexProgram.MaxAtomicBuffers = BRW_MAX_ABO;
- ctx->Const.GeometryProgram.MaxAtomicBuffers = BRW_MAX_ABO;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers = BRW_MAX_ABO;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers = BRW_MAX_ABO;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuffers = BRW_MAX_ABO;
ctx->Const.MaxCombinedAtomicBuffers = 3 * BRW_MAX_ABO;
}
if (brw->gen >= 6) {
ctx->Const.MaxVarying = 32;
- ctx->Const.VertexProgram.MaxOutputComponents = 128;
- ctx->Const.GeometryProgram.MaxInputComponents = 64;
- ctx->Const.GeometryProgram.MaxOutputComponents = 128;
- ctx->Const.FragmentProgram.MaxInputComponents = 128;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 128;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents = 64;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = 128;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 128;
}
/* We want the GLSL compiler to emit code that uses condition codes */
/* GL constants. */
ctx->Const.MaxTextureLevels = 11;
ctx->Const.MaxTextureCoordUnits = NV04_TEXTURE_UNITS;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = NV04_TEXTURE_UNITS;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = NV04_TEXTURE_UNITS;
ctx->Const.MaxTextureUnits = NV04_TEXTURE_UNITS;
ctx->Const.MaxTextureMaxAnisotropy = 2;
ctx->Const.MaxTextureLodBias = 15;
/* GL constants. */
ctx->Const.MaxTextureLevels = 12;
ctx->Const.MaxTextureCoordUnits = NV10_TEXTURE_UNITS;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = NV10_TEXTURE_UNITS;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = NV10_TEXTURE_UNITS;
ctx->Const.MaxTextureUnits = NV10_TEXTURE_UNITS;
ctx->Const.MaxTextureMaxAnisotropy = 2;
ctx->Const.MaxTextureLodBias = 15;
/* GL constants. */
ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = NV20_TEXTURE_UNITS;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = NV20_TEXTURE_UNITS;
ctx->Const.MaxTextureUnits = NV20_TEXTURE_UNITS;
ctx->Const.MaxTextureMaxAnisotropy = 8;
ctx->Const.MaxTextureLodBias = 15;
ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache,
"texture_units");
- ctx->Const.FragmentProgram.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxLineWidthAA = 10.0;
ctx->Const.LineWidthGranularity = 0.0625;
- ctx->Const.VertexProgram.MaxNativeInstructions = R200_VSF_MAX_INST;
- ctx->Const.VertexProgram.MaxNativeAttribs = 12;
- ctx->Const.VertexProgram.MaxNativeTemps = R200_VSF_MAX_TEMPS;
- ctx->Const.VertexProgram.MaxNativeParameters = R200_VSF_MAX_PARAM;
- ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeInstructions = R200_VSF_MAX_INST;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeAttribs = 12;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeTemps = R200_VSF_MAX_TEMPS;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeParameters = R200_VSF_MAX_PARAM;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxNativeAddressRegs = 1;
ctx->Const.MaxDrawBuffers = 1;
ctx->Const.MaxColorAttachments = 1;
0, RADEON_GEM_DOMAIN_VRAM);
}
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; ++i) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; ++i) {
radeonTexObj *t;
if (!ctx->Texture.Unit[i]._ReallyEnabled)
ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache,
"texture_units");
- ctx->Const.FragmentProgram.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits;
0, RADEON_GEM_DOMAIN_VRAM);
}
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; ++i) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; ++i) {
radeonTexObj *t;
if (!ctx->Texture.Unit[i]._ReallyEnabled)
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
prog = &(ctx->VertexProgram.Current->Base);
- maxParams = ctx->Const.VertexProgram.MaxLocalParams;
+ maxParams = ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams;
}
else if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
prog = &(ctx->FragmentProgram.Current->Base);
- maxParams = ctx->Const.FragmentProgram.MaxLocalParams;
+ maxParams = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams;
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,
{
if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
- if (index >= ctx->Const.FragmentProgram.MaxEnvParams) {
+ if (index >= ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
return GL_FALSE;
}
}
else if (target == GL_VERTEX_PROGRAM_ARB &&
ctx->Extensions.ARB_vertex_program) {
- if (index >= ctx->Const.VertexProgram.MaxEnvParams) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
return GL_FALSE;
}
if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
- if ((index + count) > ctx->Const.FragmentProgram.MaxEnvParams) {
+ if ((index + count) > ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
return;
}
}
else if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
- if ((index + count) > ctx->Const.VertexProgram.MaxEnvParams) {
+ if ((index + count) > ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
return;
}
if (get_local_param_pointer(ctx, "glProgramLocalParameters4fvEXT",
target, index, &dest)) {
GLuint maxParams = target == GL_FRAGMENT_PROGRAM_ARB ?
- ctx->Const.FragmentProgram.MaxLocalParams :
- ctx->Const.VertexProgram.MaxLocalParams;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams :
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams;
if ((index + count) > maxParams) {
_mesa_error(ctx, GL_INVALID_VALUE,
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
prog = &(ctx->VertexProgram.Current->Base);
- limits = &ctx->Const.VertexProgram;
+ limits = &ctx->Const.Program[MESA_SHADER_VERTEX];
}
else if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
prog = &(ctx->FragmentProgram.Current->Base);
- limits = &ctx->Const.FragmentProgram;
+ limits = &ctx->Const.Program[MESA_SHADER_FRAGMENT];
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(target)");
ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS;
ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
- ctx->Const.FragmentProgram.MaxTextureImageUnits);
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits);
ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
ctx->Const.MaxTextureBufferSize = 65536;
ctx->Const.MaxUniformBlockSize = 16384;
ctx->Const.UniformBufferOffsetAlignment = 1;
- init_program_limits(ctx, GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
- init_program_limits(ctx, GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.FragmentProgram);
- init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram);
+ init_program_limits(ctx, GL_VERTEX_PROGRAM_ARB, &ctx->Const.Program[MESA_SHADER_VERTEX]);
+ init_program_limits(ctx, GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.Program[MESA_SHADER_FRAGMENT]);
+ init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, &ctx->Const.Program[MESA_SHADER_GEOMETRY]);
ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE;
- ctx->Const.VertexProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */
- ctx->Const.GeometryProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES;
ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS;
(8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead)));
/* shader-related checks */
- assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
- assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
+ assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
/* Texture unit checks */
- assert(ctx->Const.FragmentProgram.MaxTextureImageUnits > 0);
- assert(ctx->Const.FragmentProgram.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits > 0);
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureCoordUnits > 0);
assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS);
assert(ctx->Const.MaxTextureUnits > 0);
assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS);
- assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.FragmentProgram.MaxTextureImageUnits,
+ assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
ctx->Const.MaxTextureCoordUnits));
assert(ctx->Const.MaxCombinedTextureImageUnits > 0);
assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
/* number of coord units cannot be greater than number of image units */
- assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.FragmentProgram.MaxTextureImageUnits);
+ assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits);
/* Texture size checks */
create_new_program( &key, prog,
ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4,
- ctx->Const.VertexProgram.MaxTemps );
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps );
#if 0
if (ctx->Driver.ProgramStringNotify)
v->value_float = ctx->Color.AlphaRefUnclamped;
break;
case GL_MAX_VERTEX_UNIFORM_VECTORS:
- v->value_int = ctx->Const.VertexProgram.MaxUniformComponents / 4;
+ v->value_int = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4;
break;
case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
- v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4;
+ v->value_int = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4;
break;
/* GL_ARB_texture_buffer_object */
case GL_VERTEX_BINDING_DIVISOR:
if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_instanced_arrays)
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].InstanceDivisor;
return TYPE_INT;
case GL_VERTEX_BINDING_OFFSET:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Offset;
return TYPE_INT;
case GL_VERTEX_BINDING_STRIDE:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
return TYPE_INT;
# GL_ARB_fragment_program
# == GL_MAX_TEXTURE_IMAGE_UNITS_NV
- [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.FragmentProgram.MaxTextureImageUnits), extra_ARB_fragment_program" ],
- [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxTextureImageUnits), extra_ARB_vertex_shader" ],
+ [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits), extra_ARB_fragment_program" ],
+ [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits), extra_ARB_vertex_shader" ],
[ "MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxCombinedTextureImageUnits), extra_ARB_vertex_shader" ],
# GL_ARB_shader_objects
[ "STENCIL_BACK_FAIL", "CONTEXT_ENUM(Stencil.FailFunc[1]), NO_EXTRA" ],
[ "STENCIL_BACK_PASS_DEPTH_FAIL", "CONTEXT_ENUM(Stencil.ZFailFunc[1]), NO_EXTRA" ],
[ "STENCIL_BACK_PASS_DEPTH_PASS", "CONTEXT_ENUM(Stencil.ZPassFunc[1]), NO_EXTRA" ],
- [ "MAX_VERTEX_ATTRIBS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxAttribs), extra_ARB_vertex_program_api_es2" ],
+ [ "MAX_VERTEX_ATTRIBS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAttribs), extra_ARB_vertex_program_api_es2" ],
# OES_texture_3D
[ "TEXTURE_BINDING_3D", "LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA" ],
[ "MINOR_VERSION", "LOC_CUSTOM, TYPE_INT, 0, extra_gl30_es3" ],
# GL 3.2 / GLES3
- [ "MAX_VERTEX_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.VertexProgram.MaxOutputComponents), extra_gl32_es3" ],
- [ "MAX_FRAGMENT_INPUT_COMPONENTS", "CONTEXT_INT(Const.FragmentProgram.MaxInputComponents), extra_gl32_es3" ],
+ [ "MAX_VERTEX_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents), extra_gl32_es3" ],
+ [ "MAX_FRAGMENT_INPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents), extra_gl32_es3" ],
# GL_ARB_ES3_compatibility
[ "MAX_ELEMENT_INDEX", "CONTEXT_INT64(Const.MaxElementIndex), extra_ARB_ES3_compatibility_api_es3"],
# GL_ARB_fragment_shader
- [ "MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.FragmentProgram.MaxUniformComponents), extra_ARB_fragment_shader" ],
+ [ "MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents), extra_ARB_fragment_shader" ],
# GL_ARB_framebuffer_object
[ "MAX_SAMPLES", "CONTEXT_INT(Const.MaxSamples), extra_ARB_framebuffer_object_EXT_framebuffer_multisample" ],
[ "TRANSFORM_FEEDBACK_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_transform_feedback2_api_es3" ],
# GL_ARB_uniform_buffer_object
- [ "MAX_VERTEX_UNIFORM_BLOCKS", "CONTEXT_INT(Const.VertexProgram.MaxUniformBlocks), extra_ARB_uniform_buffer_object" ],
- [ "MAX_FRAGMENT_UNIFORM_BLOCKS", "CONTEXT_INT(Const.FragmentProgram.MaxUniformBlocks), extra_ARB_uniform_buffer_object" ],
+ [ "MAX_VERTEX_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxUniformBlocks), extra_ARB_uniform_buffer_object" ],
+ [ "MAX_FRAGMENT_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxUniformBlocks), extra_ARB_uniform_buffer_object" ],
[ "MAX_COMBINED_UNIFORM_BLOCKS", "CONTEXT_INT(Const.MaxCombinedUniformBlocks), extra_ARB_uniform_buffer_object" ],
[ "MAX_UNIFORM_BLOCK_SIZE", "CONTEXT_INT(Const.MaxUniformBlockSize), extra_ARB_uniform_buffer_object" ],
[ "MAX_UNIFORM_BUFFER_BINDINGS", "CONTEXT_INT(Const.MaxUniformBufferBindings), extra_ARB_uniform_buffer_object" ],
- [ "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.VertexProgram.MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ],
- [ "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.FragmentProgram.MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ],
+ [ "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ],
+ [ "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ],
[ "UNIFORM_BUFFER_OFFSET_ALIGNMENT", "CONTEXT_INT(Const.UniformBufferOffsetAlignment), extra_ARB_uniform_buffer_object" ],
[ "UNIFORM_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_uniform_buffer_object" ],
# GL_ARB_vertex_shader
- [ "MAX_VERTEX_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxUniformComponents), extra_ARB_vertex_shader" ],
+ [ "MAX_VERTEX_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents), extra_ARB_vertex_shader" ],
[ "MAX_VARYING_FLOATS_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_vertex_shader" ],
# GL_EXT_framebuffer_blit
[ "MAX_VERTEX_STREAMS", "CONTEXT_INT(Const.MaxVertexStreams), extra_ARB_transform_feedback3" ],
# GL_ARB_geometry_shader4
- [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxTextureImageUnits), extra_gl32_ARB_geometry_shader4" ],
+ [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits), extra_gl32_ARB_geometry_shader4" ],
[ "MAX_GEOMETRY_OUTPUT_VERTICES_ARB", "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_gl32_ARB_geometry_shader4" ],
[ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents), extra_gl32_ARB_geometry_shader4" ],
- [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents), extra_gl32_ARB_geometry_shader4" ],
- [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxOutputComponents), extra_ARB_geometry_shader4" ],
- [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxOutputComponents), extra_ARB_geometry_shader4" ],
+ [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents), extra_gl32_ARB_geometry_shader4" ],
+ [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_ARB_geometry_shader4" ],
+ [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents), extra_ARB_geometry_shader4" ],
# GL_ARB_color_buffer_float
[ "RGBA_FLOAT_MODE_ARB", "BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), extra_core_ARB_color_buffer_float_and_new_buffers" ],
# GL 3.2
[ "CONTEXT_PROFILE_MASK", "CONTEXT_INT(Const.ProfileMask), extra_version_32" ],
- [ "MAX_GEOMETRY_INPUT_COMPONENTS", "CONTEXT_INT(Const.GeometryProgram.MaxInputComponents), extra_version_32" ],
- [ "MAX_GEOMETRY_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.GeometryProgram.MaxOutputComponents), extra_version_32" ],
+ [ "MAX_GEOMETRY_INPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents), extra_version_32" ],
+ [ "MAX_GEOMETRY_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_version_32" ],
# GL_ARB_robustness
[ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA" ],
[ "MAX_DUAL_SOURCE_DRAW_BUFFERS", "CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
# GL_ARB_uniform_buffer_object
- [ "MAX_GEOMETRY_UNIFORM_BLOCKS", "CONTEXT_INT(Const.GeometryProgram.MaxUniformBlocks), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
- [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.GeometryProgram.MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
+ [ "MAX_GEOMETRY_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
+ [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
# GL_ARB_timer_query
[ "TIMESTAMP", "LOC_CUSTOM, TYPE_INT64, 0, extra_ARB_timer_query" ],
[ "ATOMIC_COUNTER_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_shader_atomic_counters" ],
[ "MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", "CONTEXT_INT(Const.MaxAtomicBufferBindings), extra_ARB_shader_atomic_counters" ],
[ "MAX_ATOMIC_COUNTER_BUFFER_SIZE", "CONTEXT_INT(Const.MaxAtomicBufferSize), extra_ARB_shader_atomic_counters" ],
- [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.VertexProgram.MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ],
- [ "MAX_VERTEX_ATOMIC_COUNTERS", "CONTEXT_INT(Const.VertexProgram.MaxAtomicCounters), extra_ARB_shader_atomic_counters" ],
- [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.FragmentProgram.MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ],
- [ "MAX_FRAGMENT_ATOMIC_COUNTERS", "CONTEXT_INT(Const.FragmentProgram.MaxAtomicCounters), extra_ARB_shader_atomic_counters" ],
- [ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.GeometryProgram.MaxAtomicBuffers), extra_ARB_shader_atomic_counters_and_geometry_shader" ],
- [ "MAX_GEOMETRY_ATOMIC_COUNTERS", "CONTEXT_INT(Const.GeometryProgram.MaxAtomicCounters), extra_ARB_shader_atomic_counters_and_geometry_shader" ],
+ [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ],
+ [ "MAX_VERTEX_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters), extra_ARB_shader_atomic_counters" ],
+ [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ],
+ [ "MAX_FRAGMENT_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), extra_ARB_shader_atomic_counters" ],
+ [ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuffers), extra_ARB_shader_atomic_counters_and_geometry_shader" ],
+ [ "MAX_GEOMETRY_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters), extra_ARB_shader_atomic_counters_and_geometry_shader" ],
[ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.MaxCombinedAtomicBuffers), extra_ARB_shader_atomic_counters" ],
[ "MAX_COMBINED_ATOMIC_COUNTERS", "CONTEXT_INT(Const.MaxCombinedAtomicCounters), extra_ARB_shader_atomic_counters" ],
GLuint MaxViewportWidth, MaxViewportHeight;
- struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */
- struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */
- struct gl_program_constants GeometryProgram; /**< GL_ARB_geometry_shader4 */
+ struct gl_program_constants Program[MESA_SHADER_STAGES];
GLuint MaxProgramMatrices;
GLuint MaxProgramMatrixStackDepth;
return;
}
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)");
return;
}
switch (shadertype) {
case GL_VERTEX_SHADER:
- limits = &ctx->Const.VertexProgram;
+ limits = &ctx->Const.Program[MESA_SHADER_VERTEX];
break;
case GL_FRAGMENT_SHADER:
- limits = &ctx->Const.FragmentProgram;
+ limits = &ctx->Const.Program[MESA_SHADER_FRAGMENT];
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM,
}
else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
GLint count = 0;
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) {
if (ctx->Const.SupportedBumpUnits & (1 << i)) {
count++;
}
*param = count;
}
else if (pname == GL_BUMP_TEX_UNITS_ATI) {
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) {
if (ctx->Const.SupportedBumpUnits & (1 << i)) {
*param++ = i + GL_TEXTURE0;
}
}
else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
GLint count = 0;
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) {
if (ctx->Const.SupportedBumpUnits & (1 << i)) {
count++;
}
*param = (GLfloat) count;
}
else if (pname == GL_BUMP_TEX_UNITS_ATI) {
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) {
if (ctx->Const.SupportedBumpUnits & (1 << i)) {
*param++ = (GLfloat) (i + GL_TEXTURE0);
}
UNSIGNED_INT_10F_11F_11F_REV_BIT);
GET_CURRENT_CONTEXT(ctx);
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(index)");
return;
}
const GLboolean integer = GL_TRUE;
GET_CURRENT_CONTEXT(ctx);
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribIPointer(index)");
return;
}
struct gl_array_object *arrayObj;
GET_CURRENT_CONTEXT(ctx);
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glEnableVertexAttribArrayARB(index)");
return;
struct gl_array_object *arrayObj;
GET_CURRENT_CONTEXT(ctx);
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glDisableVertexAttribArrayARB(index)");
return;
const struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
const struct gl_vertex_attrib_array *array;
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", caller, index);
return 0;
}
return NULL;
}
}
- else if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ else if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"%s(index>=GL_MAX_VERTEX_ATTRIBS)", function);
return NULL;
{
GET_CURRENT_CONTEXT(ctx);
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribPointerARB(index)");
return;
}
return;
}
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribDivisor(index = %u)",
index);
return;
* "The error INVALID_VALUE is generated if index is greater than or equal
* to the value of MAX_VERTEX_ATTRIBS."
*/
- if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glVertexAttribFormat(attribindex=%u > "
"GL_MAX_VERTEX_ATTRIBS)",
* "The error INVALID_VALUE is generated if index is greater than
* or equal to the value of MAX_VERTEX_ATTRIBS."
*/
- if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glVertexAttribIFormat(attribindex=%u > "
"GL_MAX_VERTEX_ATTRIBS)",
* "The error INVALID_VALUE is generated if <attribindex> is greater than
* or equal to the value of MAX_VERTEX_ATTRIBS."
*/
- if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glVertexAttribLFormat(attribindex=%u > "
"GL_MAX_VERTEX_ATTRIBS)",
* MAX_VERTEX_ATTRIB_BINDINGS, otherwise the error INVALID_VALUE
* is generated."
*/
- if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) {
+ if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glVertexAttribBinding(attribindex=%u >= "
"GL_MAX_VERTEX_ATTRIBS)",
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.NV_primitive_restart &&
ctx->Extensions.NV_texture_rectangle &&
- ctx->Const.VertexProgram.MaxTextureImageUnits >= 16);
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits >= 16);
const GLboolean ver_3_2 = (ver_3_1 &&
ctx->Const.GLSLVersion >= 150 &&
ctx->Extensions.ARB_depth_clamp &&
* If this assertion fails, we need to increase the field
* size for register indexes (see INST_INDEX_BITS).
*/
- ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4
+ ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4
<= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
+ ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4
<= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.VertexProgram.MaxTemps <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxTemps <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTemps <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
- ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
+ ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents <= 4 * MAX_UNIFORMS);
+ ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents <= 4 * MAX_UNIFORMS);
- ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxAddressOffset <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAddressOffset <= (1 << INST_INDEX_BITS));
/* If this fails, increase prog_instruction::TexSrcUnit size */
STATIC_ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
switch (shaderType) {
case MESA_SHADER_VERTEX:
- c = &ctx->Const.VertexProgram;
+ c = &ctx->Const.Program[MESA_SHADER_VERTEX];
break;
case MESA_SHADER_FRAGMENT:
- c = &ctx->Const.FragmentProgram;
+ c = &ctx->Const.Program[MESA_SHADER_FRAGMENT];
break;
case MESA_SHADER_GEOMETRY:
- c = &ctx->Const.GeometryProgram;
+ c = &ctx->Const.Program[MESA_SHADER_GEOMETRY];
break;
default:
_mesa_problem(ctx,
state->st = _mesa_symbol_table_ctor();
state->limits = (target == GL_VERTEX_PROGRAM_ARB)
- ? & ctx->Const.VertexProgram
- : & ctx->Const.FragmentProgram;
+ ? & ctx->Const.Program[MESA_SHADER_VERTEX]
+ : & ctx->Const.Program[MESA_SHADER_FRAGMENT];
- state->MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits;
+ state->MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits;
state->MaxTextureUnits = ctx->Const.MaxTextureUnits;
state->MaxClipPlanes = ctx->Const.MaxClipPlanes;
update_shader_samplers(st,
PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base,
- ctx->Const.FragmentProgram.MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
st->state.samplers[PIPE_SHADER_FRAGMENT],
&st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
update_shader_samplers(st,
PIPE_SHADER_VERTEX,
&ctx->VertexProgram._Current->Base,
- ctx->Const.VertexProgram.MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits,
st->state.samplers[PIPE_SHADER_VERTEX],
&st->state.num_samplers[PIPE_SHADER_VERTEX]);
update_shader_samplers(st,
PIPE_SHADER_GEOMETRY,
&ctx->GeometryProgram._Current->Base,
- ctx->Const.GeometryProgram.MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits,
st->state.samplers[PIPE_SHADER_GEOMETRY],
&st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
}
{
const struct gl_context *ctx = st->ctx;
- if (ctx->Const.VertexProgram.MaxTextureImageUnits > 0) {
+ if (ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits > 0) {
update_textures(st,
PIPE_SHADER_VERTEX,
&ctx->VertexProgram._Current->Base,
- ctx->Const.VertexProgram.MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_VERTEX],
&st->state.num_sampler_views[PIPE_SHADER_VERTEX]);
}
update_textures(st,
PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base,
- ctx->Const.FragmentProgram.MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_FRAGMENT],
&st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
}
update_textures(st,
PIPE_SHADER_GEOMETRY,
&ctx->GeometryProgram._Current->Base,
- ctx->Const.FragmentProgram.MaxTextureImageUnits,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_GEOMETRY],
&st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]);
}
assert(i == program->num_immediates);
/* texture samplers */
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) {
if (program->samplers_used & (1 << i)) {
t->samplers[i] = ureg_DECL_sampler(ureg, i);
}
}
/* texture samplers */
- for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) {
if (program->SamplersUsed & (1 << i)) {
t->samplers[i] = ureg_DECL_sampler( ureg, i );
}
swrast->PointSpan.facing = 0;
swrast->PointSpan.array = swrast->SpanArrays;
- init_program_native_limits(&ctx->Const.VertexProgram);
- init_program_native_limits(&ctx->Const.GeometryProgram);
- init_program_native_limits(&ctx->Const.FragmentProgram);
+ init_program_native_limits(&ctx->Const.Program[MESA_SHADER_VERTEX]);
+ init_program_native_limits(&ctx->Const.Program[MESA_SHADER_GEOMETRY]);
+ init_program_native_limits(&ctx->Const.Program[MESA_SHADER_FRAGMENT]);
ctx->swrast_context = swrast;
* thread.
*/
swrast->TexelBuffer =
- malloc(ctx->Const.FragmentProgram.MaxTextureImageUnits * maxThreads *
+ malloc(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits * maxThreads *
SWRAST_MAX_WIDTH * 4 * sizeof(GLfloat));
#ifdef _OPENMP
} /* critical section */
{
GLuint u;
- for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) {
+ for (u = 0; u < ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits; u++) {
if (vp->Base.TexturesUsed[u]) {
/* Note: _Current *should* correspond to the target indicated
* in TexturesUsed[u].
{
GLuint u;
- for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) {
+ for (u = 0; u < ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits; u++) {
if (vp->Base.TexturesUsed[u]) {
/* Note: _Current *should* correspond to the target indicated
* in TexturesUsed[u].