[Mesa-dev] [PATCH] radeon: Fix variable initialization typo.
Fixes Coverity uninitialized scalar variable defect. --- src/mesa/drivers/dri/radeon/radeon_common.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 2ef3faf..2b87f96 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -93,7 +93,7 @@ void radeonRecalcScissorRects(radeonContextPtr radeon) bounds.x1 = 0; bounds.y1 = 0; bounds.x2 = ctx->DrawBuffer->Width; - bounds.x2 = ctx->DrawBuffer->Height; + bounds.y2 = ctx->DrawBuffer->Height; if (!radeon->state.scissor.numAllocedClipRects) { radeon->state.scissor.numAllocedClipRects = 1; -- 1.7.7 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radeon: Fix variable initialization typo.
On Don, 2011-11-03 at 00:52 -0700, Vinson Lee wrote: > Fixes Coverity uninitialized scalar variable defect. > --- > src/mesa/drivers/dri/radeon/radeon_common.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c > b/src/mesa/drivers/dri/radeon/radeon_common.c > index 2ef3faf..2b87f96 100644 > --- a/src/mesa/drivers/dri/radeon/radeon_common.c > +++ b/src/mesa/drivers/dri/radeon/radeon_common.c > @@ -93,7 +93,7 @@ void radeonRecalcScissorRects(radeonContextPtr radeon) > bounds.x1 = 0; > bounds.y1 = 0; > bounds.x2 = ctx->DrawBuffer->Width; > - bounds.x2 = ctx->DrawBuffer->Height; > + bounds.y2 = ctx->DrawBuffer->Height; > > if (!radeon->state.scissor.numAllocedClipRects) { > radeon->state.scissor.numAllocedClipRects = 1; Reviewed-by: Michel Dänzer -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Debian, X and DRI developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 06/04] state_trackers/vdpau: Add support for VC-1 decoding
I've just tested and pushed the whole series, thanks for that. Christian. On 31.10.2011 18:37, Maarten Lankhorst wrote: Add a struct with all the fields. Signed-off-by: Maarten Lankhorst --- Just because vdpau state tracker supports it, doesn't mean anything uses it yet. Patience.. src/gallium/include/pipe/p_video_state.h | 34 +++ src/gallium/state_trackers/vdpau/decode.c| 65 +- src/gallium/state_trackers/vdpau/vdpau_private.h | 12 3 files changed, 109 insertions(+), 2 deletions(-) diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index 0530b4a..1940bf1 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -212,6 +212,40 @@ struct pipe_mpeg4_quant_matrix const uint8_t *non_intra_matrix; }; +struct pipe_vc1_picture_desc +{ + struct pipe_picture_desc base; + uint32_t slice_count; + uint8_t picture_type; + uint8_t frame_coding_mode; + uint8_t postprocflag; + uint8_t pulldown; + uint8_t interlace; + uint8_t tfcntrflag; + uint8_t finterpflag; + uint8_t psf; + uint8_t dquant; + uint8_t panscan_flag; + uint8_t refdist_flag; + uint8_t quantizer; + uint8_t extended_mv; + uint8_t extended_dmv; + uint8_t overlap; + uint8_t vstransform; + uint8_t loopfilter; + uint8_t fastuvmc; + uint8_t range_mapy_flag; + uint8_t range_mapy; + uint8_t range_mapuv_flag; + uint8_t range_mapuv; + uint8_t multires; + uint8_t syncmarker; + uint8_t rangered; + uint8_t maxbframes; + uint8_t deblockEnable; + uint8_t pquant; +}; + #ifdef __cplusplus } #endif diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index c39c365..f135129 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -258,7 +258,7 @@ vlVdpDecoderRenderMpeg12(struct pipe_video_decoder *decoder, } /** - * Decode a mpeg 1/2 video. + * Decode a mpeg 4 video. */ static VdpStatus vlVdpDecoderRenderMpeg4(struct pipe_video_decoder *decoder, @@ -313,6 +313,65 @@ vlVdpDecoderRenderMpeg4(struct pipe_video_decoder *decoder, return VDP_STATUS_OK; } +static VdpStatus +vlVdpDecoderRenderVC1(struct pipe_video_decoder *decoder, + VdpPictureInfoVC1 *picture_info) +{ + struct pipe_vc1_picture_desc picture; + struct pipe_video_buffer *ref_frames[2] = {}; + unsigned i; + + VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Decoding VC-1\n"); + + /* if surfaces equals VDP_STATUS_INVALID_HANDLE, they are not used */ + if (picture_info->forward_reference != VDP_INVALID_HANDLE) { + ref_frames[0] = ((vlVdpSurface *)vlGetDataHTAB(picture_info->forward_reference))->video_buffer; + if (!ref_frames[0]) + return VDP_STATUS_INVALID_HANDLE; + } + + if (picture_info->backward_reference != VDP_INVALID_HANDLE) { + ref_frames[1] = ((vlVdpSurface *)vlGetDataHTAB(picture_info->backward_reference))->video_buffer; + if (!ref_frames[1]) + return VDP_STATUS_INVALID_HANDLE; + } + decoder->set_reference_frames(decoder, ref_frames, 2); + + memset(&picture, 0, sizeof(picture)); + picture.base.profile = decoder->profile; + picture.slice_count = picture_info->slice_count; + picture.picture_type = picture_info->picture_type; + picture.frame_coding_mode = picture_info->frame_coding_mode; + picture.postprocflag = picture_info->postprocflag; + picture.pulldown = picture_info->pulldown; + picture.interlace = picture_info->interlace; + picture.tfcntrflag = picture_info->tfcntrflag; + picture.finterpflag = picture_info->finterpflag; + picture.psf = picture_info->psf; + picture.dquant = picture_info->dquant; + picture.panscan_flag = picture_info->panscan_flag; + picture.refdist_flag = picture_info->refdist_flag; + picture.quantizer = picture_info->quantizer; + picture.extended_mv = picture_info->extended_mv; + picture.extended_dmv = picture_info->extended_dmv; + picture.overlap = picture_info->overlap; + picture.vstransform = picture_info->vstransform; + picture.loopfilter = picture_info->loopfilter; + picture.fastuvmc = picture_info->fastuvmc; + picture.range_mapy_flag = picture_info->range_mapy_flag; + picture.range_mapy = picture_info->range_mapy; + picture.range_mapuv_flag = picture_info->range_mapuv_flag; + picture.range_mapuv = picture_info->range_mapuv; + picture.multires = picture_info->multires; + picture.syncmarker = picture_info->syncmarker; + picture.rangered = picture_info->rangered; + picture.maxbframes = picture_info->maxbframes; + picture.deblockEnable = picture_info->deblockEnable; + picture.pquant = picture_info->pquant; + decoder->set_picture_parameters(decoder,&picture.base); + return VDP_STATUS_OK; +} + /** * Decode a compressed field/frame and render the result into a VdpVideoSurface. */ @@ -363,7 +422,9 @@ vlVdpDecoder
Re: [Mesa-dev] unify common/dri_util & common/drisw_util
I put an attempt to unify dri_util & drisw_util at: http://cgit.freedesktop.org/~gsap7/mesa/log/?h=dri There is one caveat: dri_util.h is now used by both dri2 and drisw, so it should stay opaque to drm. I tested drisw only, so please test (on dri2) and review. regards, George. 2011/11/2 George Sapountzis : > Hi > > [please cc: me in any replies] > > After the nice cleanups wrt to DRI, I think it's possible to unify the > two dri helper files. Has anyone already done this ? See any reason > against this ? > > I'll git it a try otherwise. > > regards, > George. > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] mesa: fix texture target mix-up in NV_fragment_program parser
The returned value should be a texture target index, not a bit. I spotted this from seeing a new compiler warning caused by the increase in the number of texture targets. This has been broken for a long time. --- src/mesa/program/nvfragparse.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mesa/program/nvfragparse.c b/src/mesa/program/nvfragparse.c index ce72c61..bcc553a 100644 --- a/src/mesa/program/nvfragparse.c +++ b/src/mesa/program/nvfragparse.c @@ -568,7 +568,7 @@ Parse_VectorOrScalarConstant(struct parse_state *parseState, GLfloat *vec) */ static GLboolean Parse_TextureImageId(struct parse_state *parseState, - GLubyte *texUnit, GLubyte *texTargetBit) + GLubyte *texUnit, GLubyte *texTarget) { GLubyte imageSrc[100]; GLint unit; @@ -592,26 +592,26 @@ Parse_TextureImageId(struct parse_state *parseState, RETURN_ERROR1("Expected ,"); if (Parse_String(parseState, "1D")) { - *texTargetBit = TEXTURE_1D_BIT; + *texTarget = TEXTURE_1D_INDEX; } else if (Parse_String(parseState, "2D")) { - *texTargetBit = TEXTURE_2D_BIT; + *texTarget = TEXTURE_2D_INDEX; } else if (Parse_String(parseState, "3D")) { - *texTargetBit = TEXTURE_3D_BIT; + *texTarget = TEXTURE_3D_INDEX; } else if (Parse_String(parseState, "CUBE")) { - *texTargetBit = TEXTURE_CUBE_BIT; + *texTarget = TEXTURE_CUBE_INDEX; } else if (Parse_String(parseState, "RECT")) { - *texTargetBit = TEXTURE_RECT_BIT; + *texTarget = TEXTURE_RECT_INDEX; } else { RETURN_ERROR1("Invalid texture target token"); } /* update record of referenced texture units */ - parseState->texturesUsed[*texUnit] |= *texTargetBit; + parseState->texturesUsed[*texUnit] |= (1 << *texTarget); if (_mesa_bitcount(parseState->texturesUsed[*texUnit]) > 1) { RETURN_ERROR1("Only one texture target can be used per texture unit."); } -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] 7.11.1 release, and picking NormalMatrix fix
On 11/02/2011 06:02 PM, Yuanhan Liu wrote: On Wed, Nov 02, 2011 at 12:48:23PM -0700, Ian Romanick wrote: On 11/02/2011 12:04 PM, tom fogal wrote: It's been three months since 7.11 came out. Have there been any thoughts on a 7.11.1 release date? "Soon." After the last big round of cherry picking that I did, our internal QA has been running the full round of tests, and they've found one or two regressions (e.g., bug #42268). Hi Ian, I sent out a patch[0] to fix this issue. Did you see that? [0]: [PATCH] intel: don't call unmap pbo if pbo is not mapped Somehow I missed that patch. I've modified the commit message slightly, and I've pushed it. Thanks! Thanks, Yuanhan Liu Once those get resolved, I don't think there's anything to hold up a release. Eugeni or Gordon might have some thoughts. Also, any qualms about me cherry-picking the 'NormalMatrix' fix below into 7.11? I think that one should be safe. It has sat on master for awhile, and there haven't been any regressions reported. There are probably a couple similar fixes on master that could get picked over. Thanks, -tom commit cc4ddc3a1e4bbe5fccd03b39b3590368be8c172f Author: Eric Anholt Date: Tue Oct 18 17:17:28 2011 -0700 glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants. A driver trying to set up builtin uniforms is faced with a problem: How do I walk the ir_variable structure (representing an array of structs, or array of matrices, or struct, or whatever), and set up driver structures so that dereference of that uniform gets the corresponding ParameterValues[] entry. The rule in general is that each corresponding vector-sized field of an array of structs is one builtin uniform state slot. i965 relied on another invariant: each state slot has a number of unique channel swizzles corresponding to the number of elements in the field's vector, to avoid needing to walk the glsl_type in parallel to get at vector_elements. All of the builtin uniforms followed this behavior, except for gl_NormalMatrix. That's a mat3 (so 3 vec3s), but it was swizzled as 3 vec4s. Fixes piglit glsl-fs-normalmatrix. Reviewed-by: Paul Berry src/glsl/ir_variable.cpp |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: fix texture target mix-up in NV_fragment_program parser
On 11/03/2011 09:44 AM, Brian Paul wrote: The returned value should be a texture target index, not a bit. I spotted this from seeing a new compiler warning caused by the increase in the number of texture targets. This has been broken for a long time. Reviewed-by: Ian Romanick --- src/mesa/program/nvfragparse.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mesa/program/nvfragparse.c b/src/mesa/program/nvfragparse.c index ce72c61..bcc553a 100644 --- a/src/mesa/program/nvfragparse.c +++ b/src/mesa/program/nvfragparse.c @@ -568,7 +568,7 @@ Parse_VectorOrScalarConstant(struct parse_state *parseState, GLfloat *vec) */ static GLboolean Parse_TextureImageId(struct parse_state *parseState, - GLubyte *texUnit, GLubyte *texTargetBit) + GLubyte *texUnit, GLubyte *texTarget) { GLubyte imageSrc[100]; GLint unit; @@ -592,26 +592,26 @@ Parse_TextureImageId(struct parse_state *parseState, RETURN_ERROR1("Expected ,"); if (Parse_String(parseState, "1D")) { - *texTargetBit = TEXTURE_1D_BIT; + *texTarget = TEXTURE_1D_INDEX; } else if (Parse_String(parseState, "2D")) { - *texTargetBit = TEXTURE_2D_BIT; + *texTarget = TEXTURE_2D_INDEX; } else if (Parse_String(parseState, "3D")) { - *texTargetBit = TEXTURE_3D_BIT; + *texTarget = TEXTURE_3D_INDEX; } else if (Parse_String(parseState, "CUBE")) { - *texTargetBit = TEXTURE_CUBE_BIT; + *texTarget = TEXTURE_CUBE_INDEX; } else if (Parse_String(parseState, "RECT")) { - *texTargetBit = TEXTURE_RECT_BIT; + *texTarget = TEXTURE_RECT_INDEX; } else { RETURN_ERROR1("Invalid texture target token"); } /* update record of referenced texture units */ - parseState->texturesUsed[*texUnit] |= *texTargetBit; + parseState->texturesUsed[*texUnit] |= (1<< *texTarget); if (_mesa_bitcount(parseState->texturesUsed[*texUnit])> 1) { RETURN_ERROR1("Only one texture target can be used per texture unit."); } ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCIL
From: Ian Romanick The spec says "Only ClearBufferiv should be used to clear stencil buffers." and "Only ClearBufferfv should be used to clear depth buffers." However, on the following page it also says: "The result of ClearBuffer is undefined if no conversion between the type of the specified value and the type of the buffer being cleared is defined (for example, if ClearBufferiv is called for a fixed- or floating-point buffer, or if ClearBufferfv is called for a signed or unsigned integer buffer). *This is not an error.*" Emphasis mine. Fixes problems with piglit's clearbuffer-invalid-drawbuffer test. Signed-off-by: Ian Romanick --- src/mesa/main/clear.c | 56 + 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index c35675f..c4e87e1 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -373,6 +373,23 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) } } break; + case GL_DEPTH: + /* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says: + * + * "The result of ClearBuffer is undefined if no conversion between + * the type of the specified value and the type of the buffer being + * cleared is defined (for example, if ClearBufferiv is called for a + * fixed- or floating-point buffer, or if ClearBufferfv is called + * for a signed or unsigned integer buffer). This is not an error." + * + * In this case we take "undefined" and "not an error" to mean "ignore." + */ + if (drawbuffer != 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferiv(drawbuffer=%d)", + drawbuffer); + return; + } + return; default: _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferiv(buffer=%s)", _mesa_lookup_enum_by_nr(buffer)); @@ -424,6 +441,28 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value) } } break; + case GL_DEPTH: + case GL_STENCIL: + /* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says: + * + * "The result of ClearBuffer is undefined if no conversion between + * the type of the specified value and the type of the buffer being + * cleared is defined (for example, if ClearBufferiv is called for a + * fixed- or floating-point buffer, or if ClearBufferfv is called + * for a signed or unsigned integer buffer). This is not an error." + * + * In this case we take "undefined" and "not an error" to mean "ignore." + * Even though we could do something sensible for GL_STENCIL, page 263 + * (page 279 of the PDF) says: + * + * "Only ClearBufferiv should be used to clear stencil buffers." + */ + if (drawbuffer != 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferuiv(drawbuffer=%d)", + drawbuffer); + return; + } + return; default: _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferuiv(buffer=%s)", _mesa_lookup_enum_by_nr(buffer)); @@ -498,6 +537,23 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) } } break; + case GL_STENCIL: + /* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says: + * + * "The result of ClearBuffer is undefined if no conversion between + * the type of the specified value and the type of the buffer being + * cleared is defined (for example, if ClearBufferiv is called for a + * fixed- or floating-point buffer, or if ClearBufferfv is called + * for a signed or unsigned integer buffer). This is not an error." + * + * In this case we take "undefined" and "not an error" to mean "ignore." + */ + if (drawbuffer != 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfv(drawbuffer=%d)", + drawbuffer); + return; + } + return; default: _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfv(buffer=%s)", _mesa_lookup_enum_by_nr(buffer)); -- 1.7.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCIL
On 11/03/2011 04:29 PM, Ian Romanick wrote: From: Ian Romanick The spec says "Only ClearBufferiv should be used to clear stencil buffers." and "Only ClearBufferfv should be used to clear depth buffers." However, on the following page it also says: "The result of ClearBuffer is undefined if no conversion between the type of the specified value and the type of the buffer being cleared is defined (for example, if ClearBufferiv is called for a fixed- or floating-point buffer, or if ClearBufferfv is called for a signed or unsigned integer buffer). *This is not an error.*" Emphasis mine. Fixes problems with piglit's clearbuffer-invalid-drawbuffer test. Signed-off-by: Ian Romanick LGTM. Reviewed-by: Brian Paul ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 41571] libglapi.so.0: undefined symbol: is_selinux_enabled
https://bugs.freedesktop.org/show_bug.cgi?id=41571 Alexandre Demers changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | Severity|critical|major --- Comment #4 from Alexandre Demers 2011-11-03 17:20:49 PDT --- Well, after fighting a bit with a different bug, it still seems there. Could it be a linker problem? I had a quick look at linked files and it may be missing something when Selinux is enabled. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] swrast: update program type assertion
Fixes bogus failed assertion when using NV_fragment_program, such as with demos/fplight.c Note: This is a candidate for the 7.11 branch. --- src/mesa/swrast/s_context.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 9112cf3..98702f0 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -249,7 +249,9 @@ _swrast_update_fog_state( struct gl_context *ctx ) SWcontext *swrast = SWRAST_CONTEXT(ctx); const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - assert((fp == NULL) || (fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB)); + assert((fp == NULL) || + (fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB) || + (fp->Base.Target == GL_FRAGMENT_PROGRAM_NV)); /* determine if fog is needed, and if so, which fog mode */ swrast->_FogEnabled = (fp == NULL && ctx->Fog.Enabled); -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] mesa: check for immutable texture in _mesa_test_texobj_completeness()
One of the points of GL_ARB_texture_storage is to make it impossible to have malformed mipmap stacks. If we know the texture object is immutable, we can skip a bunch of size checking. --- src/mesa/main/texobj.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index e2f0dc8..17c78ce 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -415,10 +415,6 @@ incomplete(struct gl_texture_object *t, const char *fmt, ...) * The gl_texture_object::Complete flag will be set to GL_TRUE or GL_FALSE * accordingly. * - * XXX TODO: For immutable textures (GL_ARB_texture_storage) we can skip - * many of the checks below since we know the mipmap images will have - * consistent sizes. - * * \param ctx GL context. * \param t texture object. * @@ -504,6 +500,15 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, /* Compute _MaxLambda = q - b (see the 1.2 spec) used during mipmapping */ t->_MaxLambda = (GLfloat) (t->_MaxLevel - t->BaseLevel); + if (t->Immutable) { + /* This texture object was created with glTexStorage1/2/3D() so we + * know that all the mipmap levels are the right size and all cube + * map faces are the same size. + * We don't need to do any of the additional checks below. + */ + return; + } + if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { /* make sure that all six cube map level 0 images are the same size */ const GLuint w = t->Image[0][baseLevel]->Width2; -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] pp: Reorder calloc to avoid memory leak on error path.
Fixes Coverity resource leak defect. --- src/gallium/auxiliary/postprocess/pp_mlaa.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/postprocess/pp_mlaa.c b/src/gallium/auxiliary/postprocess/pp_mlaa.c index f514e69..51bc02e 100644 --- a/src/gallium/auxiliary/postprocess/pp_mlaa.c +++ b/src/gallium/auxiliary/postprocess/pp_mlaa.c @@ -212,9 +212,7 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n, struct pipe_box box; struct pipe_resource res; - - char *tmp_text = CALLOC(sizeof(blend2fs_1) + sizeof(blend2fs_2) + - IMM_SPACE, sizeof(char)); + char *tmp_text; constbuf = pipe_buffer_create(ppq->p->screen, PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_STATIC, sizeof(constants)); @@ -226,6 +224,9 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n, pp_debug("mlaa: using %u max search steps\n", val); + tmp_text = CALLOC(sizeof(blend2fs_1) + sizeof(blend2fs_2) + + IMM_SPACE, sizeof(char)); + if (!tmp_text) { pp_debug("Failed to allocate shader space\n"); return; -- 1.7.7 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] g3dvl: Fix memory leaks on error paths.
Fixes Coverity resource leak defect. --- src/gallium/auxiliary/vl/vl_mpeg12_decoder.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c index d4b8ae0..2442d78 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c @@ -1116,11 +1116,14 @@ vl_create_mpeg12_decoder(struct pipe_context *context, default: assert(0); + FREE(dec); return NULL; } - if (!format_config) + if (!format_config) { + FREE(dec); return NULL; + } if (!init_zscan(dec, format_config)) goto error_zscan; -- 1.7.7 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCIL
On Thu, 3 Nov 2011 15:29:29 -0700, "Ian Romanick" wrote: > From: Ian Romanick > > The spec says "Only ClearBufferiv should be used to clear > stencil buffers." and "Only ClearBufferfv should be used to clear > depth buffers." However, on the following page it also says: > > "The result of ClearBuffer is undefined if no conversion between > the type of the specified value and the type of the buffer being > cleared is defined (for example, if ClearBufferiv is called for a > fixed- or floating-point buffer, or if ClearBufferfv is called > for a signed or unsigned integer buffer). *This is not an error.*" > > Emphasis mine. > > Fixes problems with piglit's clearbuffer-invalid-drawbuffer test. > > Signed-off-by: Ian Romanick > --- > src/mesa/main/clear.c | 56 > + > 1 files changed, 56 insertions(+), 0 deletions(-) > > diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c > index c35675f..c4e87e1 100644 > --- a/src/mesa/main/clear.c > +++ b/src/mesa/main/clear.c > @@ -373,6 +373,23 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, > const GLint *value) > } >} >break; > + case GL_DEPTH: > + /* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says: > + * > + * "The result of ClearBuffer is undefined if no conversion between > + * the type of the specified value and the type of the buffer being > + * cleared is defined (for example, if ClearBufferiv is called for > a > + * fixed- or floating-point buffer, or if ClearBufferfv is called > + * for a signed or unsigned integer buffer). This is not an error." > + * > + * In this case we take "undefined" and "not an error" to mean > "ignore." > + */ > + if (drawbuffer != 0) { > + _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferiv(drawbuffer=%d)", > + drawbuffer); > + return; > + } > + return; Quoting spec about not generating an error for some condition right above code for generating an error for an unrelated condition is rather confusing. I think quoting the bits about the required value for drawbuffer as well would clear that up to me. pgp2OUuMHtL9S.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev