Merge branch 'mesa_7_6_branch'
Conflicts: src/gallium/auxiliary/util/u_cpu_detect.c
This commit is contained in:
@@ -40,6 +40,8 @@ tbd
|
||||
<li>Fixed crash caused by glXCopyContext() and glXDestroyContext(), bug 24217
|
||||
<li>glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211)
|
||||
<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>
|
||||
|
||||
</body>
|
||||
|
@@ -16,6 +16,9 @@
|
||||
#include <GL/glut.h>
|
||||
#include "shaderutil.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535
|
||||
#endif
|
||||
|
||||
static char *FragProgFile = "skinning.frag";
|
||||
static char *VertProgFile = "skinning.vert";
|
||||
|
@@ -14,6 +14,9 @@
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535
|
||||
#endif
|
||||
|
||||
static GLint WinWidth = 300, WinHeight = 300;
|
||||
static GLint win = 0;
|
||||
|
@@ -16,6 +16,9 @@
|
||||
#include <GL/glut.h>
|
||||
#include "shaderutil.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535
|
||||
#endif
|
||||
|
||||
static GLint WinWidth = 300, WinHeight = 300;
|
||||
static char *FragProgFile = NULL;
|
||||
|
@@ -268,7 +268,7 @@ void cso_release_all( struct cso_context *ctx )
|
||||
void cso_destroy_context( struct cso_context *ctx )
|
||||
{
|
||||
if (ctx) {
|
||||
//cso_release_all( ctx );
|
||||
/*cso_release_all( ctx );*/
|
||||
FREE( ctx );
|
||||
}
|
||||
}
|
||||
|
@@ -212,17 +212,10 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
|
||||
struct draw_vertex_shader *vs = draw->vs.vertex_shader;
|
||||
vs->prepare(vs, draw);
|
||||
}
|
||||
|
||||
|
||||
//return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void fse_run_linear( struct draw_pt_middle_end *middle,
|
||||
unsigned start,
|
||||
unsigned count )
|
||||
|
@@ -210,7 +210,7 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
|
||||
pvs->run = post_vs_viewport;
|
||||
}
|
||||
else {
|
||||
//if (opengl)
|
||||
/* if (opengl) */
|
||||
pvs->run = post_vs_cliptest_viewport_gl;
|
||||
}
|
||||
}
|
||||
|
@@ -891,7 +891,7 @@ static void x87_emit_ex2( struct aos_compilation *cp )
|
||||
struct x86_reg st1 = x86_make_reg(file_x87, 1);
|
||||
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_fprndint( cp->func ); /* int(a) a*/
|
||||
@@ -1759,14 +1759,14 @@ emit_instruction( struct aos_compilation *cp,
|
||||
return emit_SUB(cp, inst);
|
||||
|
||||
case TGSI_OPCODE_LRP:
|
||||
// return emit_LERP(cp, inst);
|
||||
/*return emit_LERP(cp, inst);*/
|
||||
return FALSE;
|
||||
|
||||
case TGSI_OPCODE_FRC:
|
||||
return emit_FRC(cp, inst);
|
||||
|
||||
case TGSI_OPCODE_CLAMP:
|
||||
// return emit_CLAMP(cp, inst);
|
||||
/*return emit_CLAMP(cp, inst);*/
|
||||
return FALSE;
|
||||
|
||||
case TGSI_OPCODE_FLR:
|
||||
|
@@ -584,7 +584,7 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list)
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
//assert(!fenced_list->numUnfenced);
|
||||
/*assert(!fenced_list->numUnfenced);*/
|
||||
#endif
|
||||
|
||||
pipe_mutex_unlock(fenced_list->mutex);
|
||||
|
@@ -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( 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( R32G32B32_FIXED, 3, int, FROM_32_FIXED, TO_32_FIXED )
|
||||
|
@@ -254,7 +254,7 @@ debug_profile_start(void)
|
||||
{
|
||||
WCHAR *p;
|
||||
|
||||
// increment starting from the less significant digit
|
||||
/* increment starting from the less significant digit */
|
||||
p = &wFileName[14];
|
||||
while(1) {
|
||||
if(*p == '9') {
|
||||
|
@@ -214,7 +214,7 @@ debug_symbol_print_imagehlp(const void *addr)
|
||||
HANDLE hProcess;
|
||||
BYTE symbolBuffer[1024];
|
||||
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();
|
||||
|
||||
|
@@ -1427,6 +1427,7 @@ set_vertex_data(struct gen_mipmap_state *ctx,
|
||||
rz = -1.0f;
|
||||
break;
|
||||
default:
|
||||
rx = ry = rz = 0.0f;
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
@@ -138,7 +138,7 @@ fs_sse_run( const struct sp_fragment_shader *base,
|
||||
machine->Consts,
|
||||
(const float (*)[4])shader->immediates,
|
||||
machine->InterpCoefs
|
||||
// , &machine->QuadPos
|
||||
/*, &machine->QuadPos*/
|
||||
);
|
||||
|
||||
quad->inout.mask &= ~(machine->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0]);
|
||||
|
@@ -850,10 +850,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
|
||||
if (!fbConfig)
|
||||
return NULL;
|
||||
parselist++;
|
||||
if (*parselist == GLX_RGBA_BIT) {
|
||||
if (*parselist & GLX_RGBA_BIT) {
|
||||
rgb_flag = GL_TRUE;
|
||||
}
|
||||
else if (*parselist == GLX_COLOR_INDEX_BIT) {
|
||||
else if (*parselist & GLX_COLOR_INDEX_BIT) {
|
||||
rgb_flag = GL_FALSE;
|
||||
}
|
||||
else if (*parselist == 0) {
|
||||
@@ -1538,9 +1538,9 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
|
||||
if (!fbconfig)
|
||||
return GLX_BAD_ATTRIBUTE;
|
||||
if (xmvis->mesa_visual.rgbMode)
|
||||
*value = GLX_RGBA_TYPE;
|
||||
*value = GLX_RGBA_BIT;
|
||||
else
|
||||
*value = GLX_COLOR_INDEX_TYPE;
|
||||
*value = GLX_COLOR_INDEX_BIT;
|
||||
break;
|
||||
case GLX_X_RENDERABLE_SGIX:
|
||||
if (!fbconfig)
|
||||
|
@@ -984,41 +984,35 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
||||
|
||||
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
|
||||
|
||||
/* The drawbuffer won't always be updated by _mesa_make_current:
|
||||
*/
|
||||
if (intel->ctx.DrawBuffer == &intel_fb->Base) {
|
||||
intel->driReadDrawable = driReadPriv;
|
||||
|
||||
if (intel->driReadDrawable != driReadPriv)
|
||||
intel->driReadDrawable = driReadPriv;
|
||||
if (intel->driDrawable != driDrawPriv) {
|
||||
if (driDrawPriv->swap_interval == (unsigned)-1) {
|
||||
int i;
|
||||
|
||||
if (intel->driDrawable != driDrawPriv) {
|
||||
if (driDrawPriv->swap_interval == (unsigned)-1) {
|
||||
int i;
|
||||
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
|
||||
? driGetDefaultVBlankFlags(&intel->optionCache)
|
||||
: VBLANK_FLAG_NO_IRQ;
|
||||
|
||||
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
|
||||
? driGetDefaultVBlankFlags(&intel->optionCache)
|
||||
: VBLANK_FLAG_NO_IRQ;
|
||||
/* Prevent error printf if one crtc is disabled, this will
|
||||
* be properly calculated in intelWindowMoved() next.
|
||||
*/
|
||||
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
|
||||
|
||||
/* Prevent error printf if one crtc is disabled, this will
|
||||
* be properly calculated in intelWindowMoved() next.
|
||||
*/
|
||||
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
|
||||
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
|
||||
driDrawableInitVBlank(driDrawPriv);
|
||||
intel_fb->vbl_waited = driDrawPriv->vblSeq;
|
||||
|
||||
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
|
||||
driDrawableInitVBlank(driDrawPriv);
|
||||
intel_fb->vbl_waited = driDrawPriv->vblSeq;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (intel_fb->color_rb[i])
|
||||
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
|
||||
}
|
||||
}
|
||||
intel->driDrawable = driDrawPriv;
|
||||
intelWindowMoved(intel);
|
||||
}
|
||||
|
||||
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (intel_fb->color_rb[i])
|
||||
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
|
||||
}
|
||||
}
|
||||
intel->driDrawable = driDrawPriv;
|
||||
intelWindowMoved(intel);
|
||||
}
|
||||
|
||||
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
|
||||
}
|
||||
else {
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
|
@@ -226,14 +226,14 @@ do_blit_readpixels(GLcontext * ctx,
|
||||
intelFlush(&intel->ctx);
|
||||
LOCK_HARDWARE(intel);
|
||||
|
||||
if (intel->driDrawable->numClipRects) {
|
||||
if (intel->driReadDrawable->numClipRects) {
|
||||
GLboolean all = (width * height * src->cpp == dst->Base.Size &&
|
||||
x == 0 && dst_offset == 0);
|
||||
|
||||
dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst,
|
||||
all ? INTEL_WRITE_FULL :
|
||||
INTEL_WRITE_PART);
|
||||
__DRIdrawablePrivate *dPriv = intel->driDrawable;
|
||||
__DRIdrawablePrivate *dPriv = intel->driReadDrawable;
|
||||
int nbox = dPriv->numClipRects;
|
||||
drm_clip_rect_t *box = dPriv->pClipRects;
|
||||
drm_clip_rect_t rect;
|
||||
|
@@ -135,7 +135,7 @@ do_copy_texsubimage(struct intel_context *intel,
|
||||
|
||||
if (ctx->ReadBuffer->Name == 0) {
|
||||
/* reading from a window, adjust x, y */
|
||||
__DRIdrawablePrivate *dPriv = intel->driDrawable;
|
||||
const __DRIdrawablePrivate *dPriv = intel->driReadDrawable;
|
||||
y = dPriv->y + (dPriv->h - (y + height));
|
||||
x += dPriv->x;
|
||||
|
||||
|
@@ -1578,13 +1578,6 @@ static void r200ClearStencil( GLcontext *ctx, GLint s )
|
||||
* 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
|
||||
* 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 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 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 tz = { v[MAT_TZ] * depthScale };
|
||||
|
||||
@@ -1680,8 +1673,8 @@ void r200UpdateViewportOffset( GLcontext *ctx )
|
||||
float_ui32_type tx;
|
||||
float_ui32_type ty;
|
||||
|
||||
tx.f = v[MAT_TX] + xoffset + SUBPIXEL_X;
|
||||
ty.f = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
|
||||
tx.f = v[MAT_TX] + xoffset;
|
||||
ty.f = (- v[MAT_TY]) + yoffset;
|
||||
|
||||
if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != tx.ui32 ||
|
||||
rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != ty.ui32 )
|
||||
|
@@ -376,11 +376,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;
|
||||
|
@@ -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;
|
||||
|
@@ -1197,10 +1197,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
|
||||
if (!fbConfig)
|
||||
return NULL;
|
||||
parselist++;
|
||||
if (*parselist == GLX_RGBA_BIT) {
|
||||
if (*parselist & GLX_RGBA_BIT) {
|
||||
rgb_flag = GL_TRUE;
|
||||
}
|
||||
else if (*parselist == GLX_COLOR_INDEX_BIT) {
|
||||
else if (*parselist & GLX_COLOR_INDEX_BIT) {
|
||||
rgb_flag = GL_FALSE;
|
||||
}
|
||||
else if (*parselist == 0) {
|
||||
|
@@ -860,6 +860,7 @@ _mesa_initialize_context(GLcontext *ctx,
|
||||
_mesa_free_shared_state(ctx, ctx->Shared);
|
||||
if (ctx->Exec)
|
||||
_mesa_free(ctx->Exec);
|
||||
return GL_FALSE;
|
||||
}
|
||||
#if FEATURE_dispatch
|
||||
_mesa_init_exec_table(ctx->Exec);
|
||||
|
@@ -1961,6 +1961,9 @@ save_Fogiv(GLenum pname, const GLint *params)
|
||||
case GL_FOG_END:
|
||||
case GL_FOG_INDEX:
|
||||
p[0] = (GLfloat) *params;
|
||||
p[1] = 0.0f;
|
||||
p[2] = 0.0f;
|
||||
p[3] = 0.0f;
|
||||
break;
|
||||
case GL_FOG_COLOR:
|
||||
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_COLOR_CONTROL:
|
||||
fparam[0] = (GLfloat) params[0];
|
||||
fparam[1] = 0.0F;
|
||||
fparam[2] = 0.0F;
|
||||
fparam[3] = 0.0F;
|
||||
break;
|
||||
default:
|
||||
/* Error will be caught later in gl_LightModelfv */
|
||||
|
@@ -1501,8 +1501,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
|
||||
GLuint comps;
|
||||
|
||||
ASSERT(texObj);
|
||||
/* XXX choose cube map face here??? */
|
||||
srcImage = texObj->Image[0][texObj->BaseLevel];
|
||||
srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel);
|
||||
ASSERT(srcImage);
|
||||
|
||||
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 */
|
||||
if (srcImage->IsCompressed) {
|
||||
/* setup for compressed textures */
|
||||
/* setup for compressed textures - need to allocate temporary
|
||||
* image buffers to hold uncompressed images.
|
||||
*/
|
||||
GLuint row;
|
||||
GLint components, size;
|
||||
GLchan *dst;
|
||||
@@ -1587,11 +1588,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
|
||||
&dstWidth, &dstHeight, &dstDepth);
|
||||
if (!nextLevel) {
|
||||
/* all done */
|
||||
if (srcImage->IsCompressed) {
|
||||
_mesa_free((void *) srcData);
|
||||
_mesa_free(dstData);
|
||||
}
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
/* get dest gl_texture_image */
|
||||
@@ -1682,6 +1679,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
|
||||
}
|
||||
|
||||
} /* loop over mipmap levels */
|
||||
|
||||
if (srcImage->IsCompressed) {
|
||||
/* free uncompressed image buffers */
|
||||
_mesa_free((void *) srcData);
|
||||
_mesa_free(dstData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -859,7 +859,7 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj)
|
||||
for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
|
||||
if (texObj == unit->CurrentTex[tex]) {
|
||||
_mesa_reference_texobj(&unit->CurrentTex[tex],
|
||||
ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]);
|
||||
ctx->Shared->DefaultTex[tex]);
|
||||
ASSERT(unit->CurrentTex[tex]);
|
||||
break;
|
||||
}
|
||||
|
@@ -217,6 +217,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
|
||||
if (inst->SrcReg[j].RelAddr) {
|
||||
if (dbg)
|
||||
_mesa_printf("abort remove dead code (indirect temp)\n");
|
||||
_mesa_free(removeInst);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -232,6 +233,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
|
||||
if (inst->DstReg.RelAddr) {
|
||||
if (dbg)
|
||||
_mesa_printf("abort remove dead code (indirect temp)\n");
|
||||
_mesa_free(removeInst);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -422,6 +424,8 @@ _mesa_remove_extra_moves(struct gl_program *prog)
|
||||
/* now remove the instructions which aren't needed */
|
||||
rem = remove_instructions(prog, removeInst);
|
||||
|
||||
_mesa_free(removeInst);
|
||||
|
||||
if (dbg) {
|
||||
_mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem);
|
||||
/*_mesa_print_program(prog);*/
|
||||
|
@@ -670,6 +670,7 @@ get_main_shader(GLcontext *ctx,
|
||||
!shader->Main ||
|
||||
shader->UnresolvedRefs) {
|
||||
link_error(shProg, "Unresolved symbols");
|
||||
_mesa_free_shader(ctx, shader);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -599,15 +599,15 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
|
||||
|
||||
/* viewport state: viewport matching window dims */
|
||||
{
|
||||
const float width = (float) ctx->DrawBuffer->Width;
|
||||
const float height = (float) ctx->DrawBuffer->Height;
|
||||
const float w = (float) ctx->DrawBuffer->Width;
|
||||
const float h = (float) ctx->DrawBuffer->Height;
|
||||
struct pipe_viewport_state vp;
|
||||
vp.scale[0] = 0.5f * width;
|
||||
vp.scale[1] = -0.5f * height;
|
||||
vp.scale[0] = 0.5f * w;
|
||||
vp.scale[1] = -0.5f * h;
|
||||
vp.scale[2] = 1.0f;
|
||||
vp.scale[3] = 1.0f;
|
||||
vp.translate[0] = 0.5f * width;
|
||||
vp.translate[1] = 0.5f * height;
|
||||
vp.translate[0] = 0.5f * w;
|
||||
vp.translate[1] = 0.5f * h;
|
||||
vp.translate[2] = 0.0f;
|
||||
vp.translate[3] = 0.0f;
|
||||
cso_set_viewport(cso, &vp);
|
||||
|
@@ -165,12 +165,12 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
||||
strb->texture,
|
||||
0, 0, 0,
|
||||
surface_usage );
|
||||
|
||||
assert(strb->surface->texture);
|
||||
assert(strb->surface->format);
|
||||
assert(strb->surface->width == width);
|
||||
assert(strb->surface->height == height);
|
||||
|
||||
if (strb->surface) {
|
||||
assert(strb->surface->texture);
|
||||
assert(strb->surface->format);
|
||||
assert(strb->surface->width == width);
|
||||
assert(strb->surface->height == height);
|
||||
}
|
||||
|
||||
return strb->surface != NULL;
|
||||
}
|
||||
@@ -298,6 +298,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw)
|
||||
default:
|
||||
_mesa_problem(NULL,
|
||||
"Unexpected format in st_new_renderbuffer_fb");
|
||||
_mesa_free(strb);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user