Merge branch 'mesa_7_6_branch'

Conflicts:

	src/gallium/auxiliary/util/u_cpu_detect.c
This commit is contained in:
Brian Paul
2009-10-05 14:42:08 -06:00
30 changed files with 123 additions and 92 deletions

View File

@@ -40,6 +40,8 @@ tbd
<li>Fixed crash caused by glXCopyContext() and glXDestroyContext(), bug 24217 <li>Fixed crash caused by glXCopyContext() and glXDestroyContext(), bug 24217
<li>glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211) <li>glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211)
<li>GLSL sqrt(0) returned unpredictable results <li>GLSL sqrt(0) returned unpredictable results
<li>Fixed default texture binding bug when a bound texture was deleted.
<li>r300: Work around an issue with very large fragment programs on R500.
</ul> </ul>
</body> </body>

View File

@@ -16,6 +16,9 @@
#include <GL/glut.h> #include <GL/glut.h>
#include "shaderutil.h" #include "shaderutil.h"
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static char *FragProgFile = "skinning.frag"; static char *FragProgFile = "skinning.frag";
static char *VertProgFile = "skinning.vert"; static char *VertProgFile = "skinning.vert";

View File

@@ -14,6 +14,9 @@
#include <GL/glew.h> #include <GL/glew.h>
#include <GL/glut.h> #include <GL/glut.h>
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static GLint WinWidth = 300, WinHeight = 300; static GLint WinWidth = 300, WinHeight = 300;
static GLint win = 0; static GLint win = 0;

View File

@@ -16,6 +16,9 @@
#include <GL/glut.h> #include <GL/glut.h>
#include "shaderutil.h" #include "shaderutil.h"
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static GLint WinWidth = 300, WinHeight = 300; static GLint WinWidth = 300, WinHeight = 300;
static char *FragProgFile = NULL; static char *FragProgFile = NULL;

View File

@@ -268,7 +268,7 @@ void cso_release_all( struct cso_context *ctx )
void cso_destroy_context( struct cso_context *ctx ) void cso_destroy_context( struct cso_context *ctx )
{ {
if (ctx) { if (ctx) {
//cso_release_all( ctx ); /*cso_release_all( ctx );*/
FREE( ctx ); FREE( ctx );
} }
} }

View File

@@ -212,17 +212,10 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
struct draw_vertex_shader *vs = draw->vs.vertex_shader; struct draw_vertex_shader *vs = draw->vs.vertex_shader;
vs->prepare(vs, draw); vs->prepare(vs, draw);
} }
//return TRUE;
} }
static void fse_run_linear( struct draw_pt_middle_end *middle, static void fse_run_linear( struct draw_pt_middle_end *middle,
unsigned start, unsigned start,
unsigned count ) unsigned count )

View File

@@ -210,7 +210,7 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
pvs->run = post_vs_viewport; pvs->run = post_vs_viewport;
} }
else { else {
//if (opengl) /* if (opengl) */
pvs->run = post_vs_cliptest_viewport_gl; pvs->run = post_vs_cliptest_viewport_gl;
} }
} }

View File

@@ -891,7 +891,7 @@ static void x87_emit_ex2( struct aos_compilation *cp )
struct x86_reg st1 = x86_make_reg(file_x87, 1); struct x86_reg st1 = x86_make_reg(file_x87, 1);
int stack = cp->func->x87_stack; int stack = cp->func->x87_stack;
// set_fpu_round_neg_inf( cp ); /* set_fpu_round_neg_inf( cp ); */
x87_fld(cp->func, st0); /* a a */ x87_fld(cp->func, st0); /* a a */
x87_fprndint( cp->func ); /* int(a) a*/ x87_fprndint( cp->func ); /* int(a) a*/
@@ -1759,14 +1759,14 @@ emit_instruction( struct aos_compilation *cp,
return emit_SUB(cp, inst); return emit_SUB(cp, inst);
case TGSI_OPCODE_LRP: case TGSI_OPCODE_LRP:
// return emit_LERP(cp, inst); /*return emit_LERP(cp, inst);*/
return FALSE; return FALSE;
case TGSI_OPCODE_FRC: case TGSI_OPCODE_FRC:
return emit_FRC(cp, inst); return emit_FRC(cp, inst);
case TGSI_OPCODE_CLAMP: case TGSI_OPCODE_CLAMP:
// return emit_CLAMP(cp, inst); /*return emit_CLAMP(cp, inst);*/
return FALSE; return FALSE;
case TGSI_OPCODE_FLR: case TGSI_OPCODE_FLR:

View File

@@ -584,7 +584,7 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list)
} }
#ifdef DEBUG #ifdef DEBUG
//assert(!fenced_list->numUnfenced); /*assert(!fenced_list->numUnfenced);*/
#endif #endif
pipe_mutex_unlock(fenced_list->mutex); pipe_mutex_unlock(fenced_list->mutex);

View File

@@ -217,7 +217,7 @@ ATTRIB( R8G8_SNORM, 2, char, FROM_8_SNORM, TO_8_SNORM )
ATTRIB( R8_SNORM, 1, char, FROM_8_SNORM, TO_8_SNORM ) ATTRIB( R8_SNORM, 1, char, FROM_8_SNORM, TO_8_SNORM )
ATTRIB( A8R8G8B8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM ) ATTRIB( A8R8G8B8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM )
//ATTRIB( R8G8B8A8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM ) /*ATTRIB( R8G8B8A8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM )*/
ATTRIB( R32G32B32A32_FIXED, 4, int, FROM_32_FIXED, TO_32_FIXED ) ATTRIB( R32G32B32A32_FIXED, 4, int, FROM_32_FIXED, TO_32_FIXED )
ATTRIB( R32G32B32_FIXED, 3, int, FROM_32_FIXED, TO_32_FIXED ) ATTRIB( R32G32B32_FIXED, 3, int, FROM_32_FIXED, TO_32_FIXED )

View File

@@ -254,7 +254,7 @@ debug_profile_start(void)
{ {
WCHAR *p; WCHAR *p;
// increment starting from the less significant digit /* increment starting from the less significant digit */
p = &wFileName[14]; p = &wFileName[14];
while(1) { while(1) {
if(*p == '9') { if(*p == '9') {

View File

@@ -214,7 +214,7 @@ debug_symbol_print_imagehlp(const void *addr)
HANDLE hProcess; HANDLE hProcess;
BYTE symbolBuffer[1024]; BYTE symbolBuffer[1024];
PIMAGEHLP_SYMBOL pSymbol = (PIMAGEHLP_SYMBOL) symbolBuffer; PIMAGEHLP_SYMBOL pSymbol = (PIMAGEHLP_SYMBOL) symbolBuffer;
DWORD dwDisplacement = 0; // Displacement of the input address, relative to the start of the symbol DWORD dwDisplacement = 0; /* Displacement of the input address, relative to the start of the symbol */
hProcess = GetCurrentProcess(); hProcess = GetCurrentProcess();

View File

@@ -1427,6 +1427,7 @@ set_vertex_data(struct gen_mipmap_state *ctx,
rz = -1.0f; rz = -1.0f;
break; break;
default: default:
rx = ry = rz = 0.0f;
assert(0); assert(0);
} }

View File

@@ -138,7 +138,7 @@ fs_sse_run( const struct sp_fragment_shader *base,
machine->Consts, machine->Consts,
(const float (*)[4])shader->immediates, (const float (*)[4])shader->immediates,
machine->InterpCoefs machine->InterpCoefs
// , &machine->QuadPos /*, &machine->QuadPos*/
); );
quad->inout.mask &= ~(machine->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0]); quad->inout.mask &= ~(machine->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0]);

View File

@@ -850,10 +850,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
if (!fbConfig) if (!fbConfig)
return NULL; return NULL;
parselist++; parselist++;
if (*parselist == GLX_RGBA_BIT) { if (*parselist & GLX_RGBA_BIT) {
rgb_flag = GL_TRUE; rgb_flag = GL_TRUE;
} }
else if (*parselist == GLX_COLOR_INDEX_BIT) { else if (*parselist & GLX_COLOR_INDEX_BIT) {
rgb_flag = GL_FALSE; rgb_flag = GL_FALSE;
} }
else if (*parselist == 0) { else if (*parselist == 0) {
@@ -1538,9 +1538,9 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
if (!fbconfig) if (!fbconfig)
return GLX_BAD_ATTRIBUTE; return GLX_BAD_ATTRIBUTE;
if (xmvis->mesa_visual.rgbMode) if (xmvis->mesa_visual.rgbMode)
*value = GLX_RGBA_TYPE; *value = GLX_RGBA_BIT;
else else
*value = GLX_COLOR_INDEX_TYPE; *value = GLX_COLOR_INDEX_BIT;
break; break;
case GLX_X_RENDERABLE_SGIX: case GLX_X_RENDERABLE_SGIX:
if (!fbconfig) if (!fbconfig)

View File

@@ -984,41 +984,35 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb); _mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
/* The drawbuffer won't always be updated by _mesa_make_current: intel->driReadDrawable = driReadPriv;
*/
if (intel->ctx.DrawBuffer == &intel_fb->Base) {
if (intel->driReadDrawable != driReadPriv) if (intel->driDrawable != driDrawPriv) {
intel->driReadDrawable = driReadPriv; if (driDrawPriv->swap_interval == (unsigned)-1) {
int i;
if (intel->driDrawable != driDrawPriv) { driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
if (driDrawPriv->swap_interval == (unsigned)-1) { ? driGetDefaultVBlankFlags(&intel->optionCache)
int i; : VBLANK_FLAG_NO_IRQ;
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0) /* Prevent error printf if one crtc is disabled, this will
? driGetDefaultVBlankFlags(&intel->optionCache) * be properly calculated in intelWindowMoved() next.
: VBLANK_FLAG_NO_IRQ; */
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
/* Prevent error printf if one crtc is disabled, this will (*psp->systemTime->getUST) (&intel_fb->swap_ust);
* be properly calculated in intelWindowMoved() next. driDrawableInitVBlank(driDrawPriv);
*/ intel_fb->vbl_waited = driDrawPriv->vblSeq;
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
(*psp->systemTime->getUST) (&intel_fb->swap_ust); for (i = 0; i < 2; i++) {
driDrawableInitVBlank(driDrawPriv); if (intel_fb->color_rb[i])
intel_fb->vbl_waited = driDrawPriv->vblSeq; intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
}
for (i = 0; i < 2; i++) { }
if (intel_fb->color_rb[i]) intel->driDrawable = driDrawPriv;
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq; intelWindowMoved(intel);
}
}
intel->driDrawable = driDrawPriv;
intelWindowMoved(intel);
}
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
} }
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
} }
else { else {
_mesa_make_current(NULL, NULL, NULL); _mesa_make_current(NULL, NULL, NULL);

View File

@@ -226,14 +226,14 @@ do_blit_readpixels(GLcontext * ctx,
intelFlush(&intel->ctx); intelFlush(&intel->ctx);
LOCK_HARDWARE(intel); LOCK_HARDWARE(intel);
if (intel->driDrawable->numClipRects) { if (intel->driReadDrawable->numClipRects) {
GLboolean all = (width * height * src->cpp == dst->Base.Size && GLboolean all = (width * height * src->cpp == dst->Base.Size &&
x == 0 && dst_offset == 0); x == 0 && dst_offset == 0);
dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst, dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst,
all ? INTEL_WRITE_FULL : all ? INTEL_WRITE_FULL :
INTEL_WRITE_PART); INTEL_WRITE_PART);
__DRIdrawablePrivate *dPriv = intel->driDrawable; __DRIdrawablePrivate *dPriv = intel->driReadDrawable;
int nbox = dPriv->numClipRects; int nbox = dPriv->numClipRects;
drm_clip_rect_t *box = dPriv->pClipRects; drm_clip_rect_t *box = dPriv->pClipRects;
drm_clip_rect_t rect; drm_clip_rect_t rect;

View File

@@ -135,7 +135,7 @@ do_copy_texsubimage(struct intel_context *intel,
if (ctx->ReadBuffer->Name == 0) { if (ctx->ReadBuffer->Name == 0) {
/* reading from a window, adjust x, y */ /* reading from a window, adjust x, y */
__DRIdrawablePrivate *dPriv = intel->driDrawable; const __DRIdrawablePrivate *dPriv = intel->driReadDrawable;
y = dPriv->y + (dPriv->h - (y + height)); y = dPriv->y + (dPriv->h - (y + height));
x += dPriv->x; x += dPriv->x;

View File

@@ -1578,13 +1578,6 @@ static void r200ClearStencil( GLcontext *ctx, GLint s )
* Window position and viewport transformation * Window position and viewport transformation
*/ */
/*
* To correctly position primitives:
*/
#define SUBPIXEL_X 0.125
#define SUBPIXEL_Y 0.125
/** /**
* Called when window size or position changes or viewport or depth range * Called when window size or position changes or viewport or depth range
* state is changed. We update the hardware viewport state here. * state is changed. We update the hardware viewport state here.
@@ -1609,9 +1602,9 @@ void r200UpdateWindow( GLcontext *ctx )
} }
float_ui32_type sx = { v[MAT_SX] }; float_ui32_type sx = { v[MAT_SX] };
float_ui32_type tx = { v[MAT_TX] + xoffset + SUBPIXEL_X }; float_ui32_type tx = { v[MAT_TX] + xoffset };
float_ui32_type sy = { v[MAT_SY] * y_scale }; float_ui32_type sy = { v[MAT_SY] * y_scale };
float_ui32_type ty = { (v[MAT_TY] * y_scale) + y_bias + SUBPIXEL_Y }; float_ui32_type ty = { (v[MAT_TY] * y_scale) + y_bias };
float_ui32_type sz = { v[MAT_SZ] * depthScale }; float_ui32_type sz = { v[MAT_SZ] * depthScale };
float_ui32_type tz = { v[MAT_TZ] * depthScale }; float_ui32_type tz = { v[MAT_TZ] * depthScale };
@@ -1680,8 +1673,8 @@ void r200UpdateViewportOffset( GLcontext *ctx )
float_ui32_type tx; float_ui32_type tx;
float_ui32_type ty; float_ui32_type ty;
tx.f = v[MAT_TX] + xoffset + SUBPIXEL_X; tx.f = v[MAT_TX] + xoffset;
ty.f = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y; ty.f = (- v[MAT_TY]) + yoffset;
if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != tx.ui32 || if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != tx.ui32 ||
rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != ty.ui32 ) rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != ty.ui32 )

View File

@@ -376,11 +376,21 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
if (screen->chip_family >= CHIP_FAMILY_RV515) { if (screen->chip_family >= CHIP_FAMILY_RV515) {
ctx->Const.FragmentProgram.MaxNativeTemps = R500_PFS_NUM_TEMP_REGS; ctx->Const.FragmentProgram.MaxNativeTemps = R500_PFS_NUM_TEMP_REGS;
ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */
ctx->Const.FragmentProgram.MaxNativeParameters = R500_PFS_NUM_CONST_REGS;
ctx->Const.FragmentProgram.MaxNativeAluInstructions = R500_PFS_MAX_INST; /* The hardware limits are higher than this,
ctx->Const.FragmentProgram.MaxNativeTexInstructions = R500_PFS_MAX_INST; * but the non-KMS DRM interface artificially limits us
ctx->Const.FragmentProgram.MaxNativeInstructions = R500_PFS_MAX_INST; * to this many instructions.
ctx->Const.FragmentProgram.MaxNativeTexIndirections = R500_PFS_MAX_INST; *
* 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; ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0;
} else { } else {
ctx->Const.FragmentProgram.MaxNativeTemps = R300_PFS_NUM_TEMP_REGS; ctx->Const.FragmentProgram.MaxNativeTemps = R300_PFS_NUM_TEMP_REGS;

View File

@@ -239,6 +239,19 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog
rewriteFog(&compiler, fp); rewriteFog(&compiler, fp);
r3xx_compile_fragment_program(&compiler); 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->error = compiler.Base.Error;
fp->InputsRead = compiler.Base.Program.InputsRead; fp->InputsRead = compiler.Base.Program.InputsRead;

View File

@@ -1197,10 +1197,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
if (!fbConfig) if (!fbConfig)
return NULL; return NULL;
parselist++; parselist++;
if (*parselist == GLX_RGBA_BIT) { if (*parselist & GLX_RGBA_BIT) {
rgb_flag = GL_TRUE; rgb_flag = GL_TRUE;
} }
else if (*parselist == GLX_COLOR_INDEX_BIT) { else if (*parselist & GLX_COLOR_INDEX_BIT) {
rgb_flag = GL_FALSE; rgb_flag = GL_FALSE;
} }
else if (*parselist == 0) { else if (*parselist == 0) {

View File

@@ -860,6 +860,7 @@ _mesa_initialize_context(GLcontext *ctx,
_mesa_free_shared_state(ctx, ctx->Shared); _mesa_free_shared_state(ctx, ctx->Shared);
if (ctx->Exec) if (ctx->Exec)
_mesa_free(ctx->Exec); _mesa_free(ctx->Exec);
return GL_FALSE;
} }
#if FEATURE_dispatch #if FEATURE_dispatch
_mesa_init_exec_table(ctx->Exec); _mesa_init_exec_table(ctx->Exec);

View File

@@ -1961,6 +1961,9 @@ save_Fogiv(GLenum pname, const GLint *params)
case GL_FOG_END: case GL_FOG_END:
case GL_FOG_INDEX: case GL_FOG_INDEX:
p[0] = (GLfloat) *params; p[0] = (GLfloat) *params;
p[1] = 0.0f;
p[2] = 0.0f;
p[3] = 0.0f;
break; break;
case GL_FOG_COLOR: case GL_FOG_COLOR:
p[0] = INT_TO_FLOAT(params[0]); p[0] = INT_TO_FLOAT(params[0]);
@@ -2249,6 +2252,9 @@ save_LightModeliv(GLenum pname, const GLint *params)
case GL_LIGHT_MODEL_TWO_SIDE: case GL_LIGHT_MODEL_TWO_SIDE:
case GL_LIGHT_MODEL_COLOR_CONTROL: case GL_LIGHT_MODEL_COLOR_CONTROL:
fparam[0] = (GLfloat) params[0]; fparam[0] = (GLfloat) params[0];
fparam[1] = 0.0F;
fparam[2] = 0.0F;
fparam[3] = 0.0F;
break; break;
default: default:
/* Error will be caught later in gl_LightModelfv */ /* Error will be caught later in gl_LightModelfv */

View File

@@ -1501,8 +1501,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
GLuint comps; GLuint comps;
ASSERT(texObj); ASSERT(texObj);
/* XXX choose cube map face here??? */ srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel);
srcImage = texObj->Image[0][texObj->BaseLevel];
ASSERT(srcImage); ASSERT(srcImage);
maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
@@ -1510,7 +1509,9 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
/* Find convertFormat - the format that do_row() will process */ /* Find convertFormat - the format that do_row() will process */
if (srcImage->IsCompressed) { if (srcImage->IsCompressed) {
/* setup for compressed textures */ /* setup for compressed textures - need to allocate temporary
* image buffers to hold uncompressed images.
*/
GLuint row; GLuint row;
GLint components, size; GLint components, size;
GLchan *dst; GLchan *dst;
@@ -1587,11 +1588,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
&dstWidth, &dstHeight, &dstDepth); &dstWidth, &dstHeight, &dstDepth);
if (!nextLevel) { if (!nextLevel) {
/* all done */ /* all done */
if (srcImage->IsCompressed) { break;
_mesa_free((void *) srcData);
_mesa_free(dstData);
}
return;
} }
/* get dest gl_texture_image */ /* get dest gl_texture_image */
@@ -1682,6 +1679,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
} }
} /* loop over mipmap levels */ } /* loop over mipmap levels */
if (srcImage->IsCompressed) {
/* free uncompressed image buffers */
_mesa_free((void *) srcData);
_mesa_free(dstData);
}
} }

View File

@@ -859,7 +859,7 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj)
for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
if (texObj == unit->CurrentTex[tex]) { if (texObj == unit->CurrentTex[tex]) {
_mesa_reference_texobj(&unit->CurrentTex[tex], _mesa_reference_texobj(&unit->CurrentTex[tex],
ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]); ctx->Shared->DefaultTex[tex]);
ASSERT(unit->CurrentTex[tex]); ASSERT(unit->CurrentTex[tex]);
break; break;
} }

View File

@@ -217,6 +217,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
if (inst->SrcReg[j].RelAddr) { if (inst->SrcReg[j].RelAddr) {
if (dbg) if (dbg)
_mesa_printf("abort remove dead code (indirect temp)\n"); _mesa_printf("abort remove dead code (indirect temp)\n");
_mesa_free(removeInst);
return; return;
} }
@@ -232,6 +233,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
if (inst->DstReg.RelAddr) { if (inst->DstReg.RelAddr) {
if (dbg) if (dbg)
_mesa_printf("abort remove dead code (indirect temp)\n"); _mesa_printf("abort remove dead code (indirect temp)\n");
_mesa_free(removeInst);
return; return;
} }
@@ -422,6 +424,8 @@ _mesa_remove_extra_moves(struct gl_program *prog)
/* now remove the instructions which aren't needed */ /* now remove the instructions which aren't needed */
rem = remove_instructions(prog, removeInst); rem = remove_instructions(prog, removeInst);
_mesa_free(removeInst);
if (dbg) { if (dbg) {
_mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem); _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem);
/*_mesa_print_program(prog);*/ /*_mesa_print_program(prog);*/

View File

@@ -670,6 +670,7 @@ get_main_shader(GLcontext *ctx,
!shader->Main || !shader->Main ||
shader->UnresolvedRefs) { shader->UnresolvedRefs) {
link_error(shProg, "Unresolved symbols"); link_error(shProg, "Unresolved symbols");
_mesa_free_shader(ctx, shader);
return NULL; return NULL;
} }
} }

View File

@@ -599,15 +599,15 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
/* viewport state: viewport matching window dims */ /* viewport state: viewport matching window dims */
{ {
const float width = (float) ctx->DrawBuffer->Width; const float w = (float) ctx->DrawBuffer->Width;
const float height = (float) ctx->DrawBuffer->Height; const float h = (float) ctx->DrawBuffer->Height;
struct pipe_viewport_state vp; struct pipe_viewport_state vp;
vp.scale[0] = 0.5f * width; vp.scale[0] = 0.5f * w;
vp.scale[1] = -0.5f * height; vp.scale[1] = -0.5f * h;
vp.scale[2] = 1.0f; vp.scale[2] = 1.0f;
vp.scale[3] = 1.0f; vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * width; vp.translate[0] = 0.5f * w;
vp.translate[1] = 0.5f * height; vp.translate[1] = 0.5f * h;
vp.translate[2] = 0.0f; vp.translate[2] = 0.0f;
vp.translate[3] = 0.0f; vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp); cso_set_viewport(cso, &vp);

View File

@@ -165,12 +165,12 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
strb->texture, strb->texture,
0, 0, 0, 0, 0, 0,
surface_usage ); surface_usage );
if (strb->surface) {
assert(strb->surface->texture); assert(strb->surface->texture);
assert(strb->surface->format); assert(strb->surface->format);
assert(strb->surface->width == width); assert(strb->surface->width == width);
assert(strb->surface->height == height); assert(strb->surface->height == height);
}
return strb->surface != NULL; return strb->surface != NULL;
} }
@@ -298,6 +298,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw)
default: default:
_mesa_problem(NULL, _mesa_problem(NULL,
"Unexpected format in st_new_renderbuffer_fb"); "Unexpected format in st_new_renderbuffer_fb");
_mesa_free(strb);
return NULL; return NULL;
} }