Mesa (master): intel: Attempt to fix up after "Update vertex texture code."

Eric Anholt anholt at kemper.freedesktop.org
Thu Dec 10 19:17:01 UTC 2009


Module: Mesa
Branch: master
Commit: 51e945ec9c0b803f5e998f87449fb02a7c39ae65
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=51e945ec9c0b803f5e998f87449fb02a7c39ae65

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Dec 10 09:16:37 2009 -0800

intel: Attempt to fix up after "Update vertex texture code."

The MaxCombinedTextureImageUnits is the total number of samplers that can
be bound between vertex, geometry, and fragment, not 0.  This should report
the correct value on 965 now.  Other DRI drivers may also need updating if
their MaxVertexTextureImageUnits != 0 (for example, if using the sw vertex
pipeline).

It's not clear to me if there's going to be a valid value for this
limit other than MaxTextureImageUnits + MaxVertexTextureImageUnits (+
MaxGeometryTextureImageUnits eventually).  If not, then we should probably
just move this into the core at Get time.

Bug #25518 (wine regression).  Fixes piglit vp-combined-image-units.

---

 src/mesa/drivers/dri/i915/i915_context.c |    3 +++
 src/mesa/drivers/dri/i965/brw_context.c  |    4 +++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index 7d4c7cf..0485be2 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -143,6 +143,9 @@ i915CreateContext(const __GLcontextModes * mesaVis,
    ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS;
    ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS;
    ctx->Const.MaxVarying = I915_TEX_UNITS;
+   ctx->Const.MaxCombinedTextureImageUnits =
+      ctx->Const.MaxVertexTextureImageUnits +
+      ctx->Const.MaxTextureImageUnits;
 
    /* Advertise the full hardware capabilities.  The new memory
     * manager should cope much better with overload situations:
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 8bdda60..78bea82 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -111,7 +111,9 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
    ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
                                      ctx->Const.MaxTextureImageUnits);
    ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */
-   ctx->Const.MaxCombinedTextureImageUnits = 0;
+   ctx->Const.MaxCombinedTextureImageUnits =
+      ctx->Const.MaxVertexTextureImageUnits +
+      ctx->Const.MaxTextureImageUnits;
 
    /* Mesa limits textures to 4kx4k; it would be nice to fix that someday
     */




More information about the mesa-commit mailing list