diff options
author | Keith Whitwell <[email protected]> | 2008-09-21 12:22:21 -0700 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-09-21 12:22:21 -0700 |
commit | 3a40dee3eb5151a282ce831b67427f3aa625de28 (patch) | |
tree | a629edbc8a0e5a412faf0172c26013b81e79d462 /src/mesa/state_tracker | |
parent | 53dd838de6cd455f00f43ef7f733d4e9b420b8d8 (diff) | |
parent | 8701e5f702a0b15d44395268e2422c196d8f4efd (diff) |
Merge commit 'origin/gallium-0.1' into gallium-0.2
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 11 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.c | 10 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 2e1ad93942b..958f88bf2c4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -481,8 +481,15 @@ st_TexImage(GLcontext * ctx, if (!stObj->pt) { guess_and_alloc_texture(ctx->st, stObj, stImage); if (!stObj->pt) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); - return; + /* Probably out of memory. + * Try flushing any pending rendering, then retry. + */ + st_finish(ctx->st); + guess_and_alloc_texture(ctx->st, stObj, stImage); + if (!stObj->pt) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); + return; + } } } diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index b9807bb8074..524d8890b5c 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -77,6 +77,7 @@ map_register_file( case PROGRAM_CONSTANT: if (indirectAccess) return TGSI_FILE_CONSTANT; + assert(immediateMapping[index] != ~0); return TGSI_FILE_IMMEDIATE; case PROGRAM_INPUT: return TGSI_FILE_INPUT; @@ -118,6 +119,7 @@ map_register_file_index( case TGSI_FILE_IMMEDIATE: if (indirectAccess) return index; + assert(immediateMapping[index] != ~0); return immediateMapping[index]; default: @@ -242,14 +244,6 @@ compile_instruction( immediateMapping, indirectAccess ); - /** - * This not at all the correct solution. - * FIXME: Roll this up in the above map functions - */ - if (fullsrc->SrcRegister.File == TGSI_FILE_IMMEDIATE && fullsrc->SrcRegister.Index == ~0) { - fullsrc->SrcRegister.File = TGSI_FILE_CONSTANT; - fullsrc->SrcRegister.Index = inst->SrcReg[i].Index; - } /* swizzle (ext swizzle also depends on negation) */ { |