summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-10-29 13:24:27 -0700
committerEric Anholt <eric@anholt.net>2007-10-29 13:24:27 -0700
commitb0edb9c38a6c63175e4fafdbb54102c4f4a94e2c (patch)
tree7dfa294a9c9f40f5f2e81a95dfd0d59cd4d6fbea /src/mesa/main
parent919f617d08a34d01dd916b08ca4f315bae84f21c (diff)
parentad8ee7db3b406b23136873fc8c87a22e4d8b94de (diff)
Merge branch 'origin'
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/attrib.c3
-rw-r--r--src/mesa/main/buffers.c4
-rw-r--r--src/mesa/main/texenvprogram.c17
3 files changed, 15 insertions, 9 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 3199c9b426..07ec285eeb 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1102,7 +1102,8 @@ _mesa_PopAttrib(void)
(GLint) point->CoordReplace[u]);
}
_mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite);
- _mesa_PointParameteriNV(GL_POINT_SPRITE_R_MODE_NV,
+ if (ctx->Extensions.NV_point_sprite)
+ _mesa_PointParameteriNV(GL_POINT_SPRITE_R_MODE_NV,
ctx->Point.SpriteRMode);
_mesa_PointParameterfEXT(GL_POINT_SPRITE_COORD_ORIGIN,
(GLfloat)ctx->Point.SpriteOrigin);
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index cbbe3e8698..d9c18bfaaf 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -140,7 +140,9 @@ _mesa_Clear( GLbitfield mask )
return;
}
- if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0)
+ if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 ||
+ ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax ||
+ ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax)
return;
if (ctx->RenderMode == GL_RENDER) {
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 9c84da985e..a2b9657bbb 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -35,10 +35,11 @@
#include "texenvprogram.h"
/**
- * According to Glean's texCombine test, no more than 21 instructions
- * are needed. Allow a few extra just in case.
+ * This MAX is probably a bit generous, but that's OK. There can be
+ * up to four instructions per texture unit (TEX + 3 for combine),
+ * then there's fog and specular add.
*/
-#define MAX_INSTRUCTIONS ((MAX_TEXTURE_UNITS * 6) + 10) /* see bug 9829 */
+#define MAX_INSTRUCTIONS ((MAX_TEXTURE_UNITS * 4) + 12)
#define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
@@ -460,8 +461,8 @@ static void emit_dst( struct prog_dst_register *dst,
dst->File = ureg.file;
dst->Index = ureg.idx;
dst->WriteMask = mask;
- dst->CondMask = 0;
- dst->CondSwizzle = 0;
+ dst->CondMask = COND_TR; /* always pass cond test */
+ dst->CondSwizzle = SWIZZLE_NOOP;
}
static struct prog_instruction *
@@ -476,7 +477,9 @@ emit_op(struct texenv_fragment_program *p,
{
GLuint nr = p->program->Base.NumInstructions++;
struct prog_instruction *inst = &p->program->Base.Instructions[nr];
-
+
+ assert(nr < MAX_INSTRUCTIONS);
+
_mesa_init_instructions(inst, 1);
inst->Opcode = op;
@@ -1239,7 +1242,7 @@ _mesa_UpdateTexEnvProgram( GLcontext *ctx )
/* If a conventional fragment program/shader isn't in effect... */
if (!ctx->FragmentProgram._Enabled &&
- !ctx->Shader.CurrentProgram) {
+ (!ctx->Shader.CurrentProgram || !ctx->Shader.CurrentProgram->FragmentProgram)) {
make_state_key(ctx, &key);
hash = hash_key(&key);