From c01a77d304776153e968d68617a2c84e3af35555 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Oct 2009 09:58:16 -0600 Subject: docs: document default texture binding fix --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 3271f47989..a475845c02 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -40,6 +40,7 @@ tbd
  • Fixed crash caused by glXCopyContext() and glXDestroyContext(), bug 24217
  • glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211)
  • GLSL sqrt(0) returned unpredictable results +
  • Fixed default texture binding bug when a bound texture was deleted. -- cgit v1.2.3 From bbe384c86afeaf5995cddd286a76e1fd789e18f1 Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Sat, 3 Oct 2009 01:26:38 +0200 Subject: r300: Workaround problem on R500 with very large fragment programs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The non-KMS interface is to blame here. In theory, a proper fix could be produced that works for the KMS interface only, but it require cleaning a lot of mess. Easier to just do it right in r300g. Signed-off-by: Nicolai Hähnle --- docs/relnotes-7.6.1.html | 1 + src/mesa/drivers/dri/r300/r300_context.c | 20 +++++++++++++++----- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 13 +++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index a475845c02..d69af7aec2 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -41,6 +41,7 @@ tbd
  • glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211)
  • GLSL sqrt(0) returned unpredictable results
  • Fixed default texture binding bug when a bound texture was deleted. +
  • r300: Work around an issue with very large fragment programs on R500. diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 2ea1b826de..9df3897e65 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -374,11 +374,21 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen) if (screen->chip_family >= CHIP_FAMILY_RV515) { ctx->Const.FragmentProgram.MaxNativeTemps = R500_PFS_NUM_TEMP_REGS; ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ - ctx->Const.FragmentProgram.MaxNativeParameters = R500_PFS_NUM_CONST_REGS; - ctx->Const.FragmentProgram.MaxNativeAluInstructions = R500_PFS_MAX_INST; - ctx->Const.FragmentProgram.MaxNativeTexInstructions = R500_PFS_MAX_INST; - ctx->Const.FragmentProgram.MaxNativeInstructions = R500_PFS_MAX_INST; - ctx->Const.FragmentProgram.MaxNativeTexIndirections = R500_PFS_MAX_INST; + + /* The hardware limits are higher than this, + * but the non-KMS DRM interface artificially limits us + * to this many instructions. + * + * We could of course work around it in the KMS path, + * but it would be a mess, so it seems wiser + * to leave it as is. Going forward, the Gallium driver + * will not be subject to these limitations. + */ + ctx->Const.FragmentProgram.MaxNativeParameters = 255; + ctx->Const.FragmentProgram.MaxNativeAluInstructions = 255; + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 255; + ctx->Const.FragmentProgram.MaxNativeInstructions = 255; + ctx->Const.FragmentProgram.MaxNativeTexIndirections = 255; ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; } else { ctx->Const.FragmentProgram.MaxNativeTemps = R300_PFS_NUM_TEMP_REGS; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index 0bdc90b4a8..70c9252894 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -239,6 +239,19 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog rewriteFog(&compiler, fp); r3xx_compile_fragment_program(&compiler); + + if (compiler.is_r500) { + /* We need to support the non-KMS DRM interface, which + * artificially limits the number of instructions and + * constants which are available to us. + * + * See also the comment in r300_context.c where we + * set the MAX_NATIVE_xxx values. + */ + if (fp->code.code.r500.inst_end >= 255 || fp->code.constants.Count > 255) + rc_error(&compiler.Base, "Program is too big (upgrade to r300g to avoid this limitation).\n"); + } + fp->error = compiler.Base.Error; fp->InputsRead = compiler.Base.Program.InputsRead; -- cgit v1.2.3