diff options
author | Paul Berry <[email protected]> | 2014-01-08 10:00:28 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-01-09 09:31:01 -0800 |
commit | 84732a982c3eeaca2e2809532c8422dc5f7045c1 (patch) | |
tree | 851c411dc92ad2192d2c63db0898dec46a200611 /src/mesa/drivers/dri | |
parent | 9b96be595b93544266436ec3b22b2cbd349d180c (diff) |
mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.
These are replaced with
ctx->Const.Program[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In
patches to follow, this will allow us to replace a lot of ad-hoc logic
with a variable index into the array.
With the exception of the changes to mtypes.h, this patch was
generated entirely by the command:
find src -type f '(' -iname '*.c' -o -iname '*.cpp' -o -iname '*.py' \
-o -iname '*.y' ')' -print0 | xargs -0 sed -i \
-e 's/Const\.VertexProgram/Const.Program[MESA_SHADER_VERTEX]/g' \
-e 's/Const\.GeometryProgram/Const.Program[MESA_SHADER_GEOMETRY]/g' \
-e 's/Const\.FragmentProgram/Const.Program[MESA_SHADER_FRAGMENT]/g'
Suggested-by: Brian Paul <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_context.c | 52 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 98 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv04_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv20_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_context.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_state.c | 2 |
10 files changed, 88 insertions, 88 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index 87d1a496ecc..e8959ac3d0d 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -97,7 +97,7 @@ i830CreateContext(int api, 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 diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 23890439ca5..c30eed95266 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -192,14 +192,14 @@ i915CreateContext(int api, 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: @@ -217,33 +217,33 @@ i915CreateContext(int api, * 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; diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 8d202a2d425..1b4275138d1 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -288,20 +288,20 @@ brw_initialize_context_constants(struct brw_context *brw) 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) @@ -385,49 +385,49 @@ brw_initialize_context_constants(struct brw_context *brw) 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; } @@ -456,10 +456,10 @@ brw_initialize_context_constants(struct brw_context *brw) 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 */ diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c index c198c03f095..6cd191e7a78 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_context.c +++ b/src/mesa/drivers/dri/nouveau/nv04_context.c @@ -159,7 +159,7 @@ nv04_context_create(struct nouveau_screen *screen, const struct gl_config *visua /* 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; diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c index 1918f12238d..8582cb25d97 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_context.c +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c @@ -457,7 +457,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua /* 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; diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c index 1d77132db11..618280f4c8f 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_context.c +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c @@ -467,7 +467,7 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua /* 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; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 5c53720d1b1..f82424b8eb5 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -295,7 +295,7 @@ GLboolean r200CreateContext( gl_api api, 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; @@ -329,11 +329,11 @@ GLboolean r200CreateContext( gl_api api, 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; diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index ee7b9459664..b4ef7cfa6f8 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -2243,7 +2243,7 @@ static GLboolean r200ValidateBuffers(struct gl_context *ctx) 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) diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 02dbe064421..1e059ebb386 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -258,7 +258,7 @@ r100CreateContext( gl_api api, 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; diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 625271dd168..843a5a6cf07 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -2020,7 +2020,7 @@ static GLboolean r100ValidateBuffers(struct gl_context *ctx) 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) |