Mesa (master): nouveau: fix scratch buffer leak
Module: Mesa Branch: master Commit: 17e047242e82111859eb8220369c601c79a26350 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=17e047242e82111859eb8220369c601c79a26350 Author: Marcin Slusarz Date: Tue Jun 5 23:26:05 2012 +0200 nouveau: fix scratch buffer leak ...and create common function for destroying nouveau_context --- src/gallium/drivers/nouveau/nouveau_context.h | 12 src/gallium/drivers/nv30/nv30_context.c |2 +- src/gallium/drivers/nv50/nv50_context.c |2 +- src/gallium/drivers/nvc0/nvc0_context.c |2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_context.h b/src/gallium/drivers/nouveau/nouveau_context.h index 531c623..b3fe05b 100644 --- a/src/gallium/drivers/nouveau/nouveau_context.h +++ b/src/gallium/drivers/nouveau/nouveau_context.h @@ -2,6 +2,7 @@ #define __NOUVEAU_CONTEXT_H__ #include "pipe/p_context.h" +#include #define NOUVEAU_MAX_SCRATCH_BUFS 4 @@ -72,4 +73,15 @@ void * nouveau_scratch_get(struct nouveau_context *, unsigned size, uint64_t *gpu_addr, struct nouveau_bo **); +static INLINE void +nouveau_context_destroy(struct nouveau_context *ctx) +{ + int i; + + for (i = 0; i < NOUVEAU_MAX_SCRATCH_BUFS; ++i) + if (ctx->scratch.bo[i]) + nouveau_bo_ref(NULL, &ctx->scratch.bo[i]); + + FREE(ctx); +} #endif diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c index b16cb23..42e844f 100644 --- a/src/gallium/drivers/nv30/nv30_context.c +++ b/src/gallium/drivers/nv30/nv30_context.c @@ -92,7 +92,7 @@ nv30_context_destroy(struct pipe_context *pipe) if (nv30->screen->cur_ctx == nv30) nv30->screen->cur_ctx = NULL; - FREE(nv30); + nouveau_context_destroy(&nv30->base); } #define FAIL_CONTEXT_INIT(str, err) \ diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index 952dc03..cb9dd41 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -111,7 +111,7 @@ nv50_destroy(struct pipe_context *pipe) draw_destroy(nv50->draw); #endif - FREE(nv50); + nouveau_context_destroy(&nv50->base); } struct pipe_context * diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c index f930814..b021f2e 100644 --- a/src/gallium/drivers/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nvc0/nvc0_context.c @@ -99,7 +99,7 @@ nvc0_destroy(struct pipe_context *pipe) draw_destroy(nvc0->draw); #endif - FREE(nvc0); + nouveau_context_destroy(&nvc0->base); } void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nv50: fix nv50_stream_output_state leak
Module: Mesa Branch: master Commit: 3232a86efe76df9fcee869c4ed4af8d68824920c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3232a86efe76df9fcee869c4ed4af8d68824920c Author: Marcin Slusarz Date: Tue Jun 5 20:26:54 2012 +0200 nv50: fix nv50_stream_output_state leak --- src/gallium/drivers/nv50/nv50_program.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 67f8629..9c5a080 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -427,6 +427,9 @@ nv50_program_destroy(struct nv50_context *nv50, struct nv50_program *p) if (p->fixups) FREE(p->fixups); + if (p->so) + FREE(p->so); + memset(p, 0, sizeof(*p)); p->pipe = pipe; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nv50: fix symbol table memory leak
Module: Mesa Branch: master Commit: cfa7cb991ce7d2fd77ea7f5abf96c90d8a1ea68c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cfa7cb991ce7d2fd77ea7f5abf96c90d8a1ea68c Author: Marcin Slusarz Date: Tue Jun 5 20:18:33 2012 +0200 nv50: fix symbol table memory leak --- src/gallium/drivers/nv50/nv50_program.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index ca40ac2..67f8629 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -343,6 +343,9 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset) NOUVEAU_ERR("shader translation failed: %i\n", ret); goto out; } + if (info->bin.syms) /* we don't need them yet */ + FREE(info->bin.syms); + prog->code = info->bin.code; prog->code_size = info->bin.codeSize; prog->fixups = info->bin.relocData; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i965/fs: Fix user-defined FS outputs with less than four components.
Module: Mesa Branch: master Commit: 2f18698220d8b27991fab550c4721590d17278e0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2f18698220d8b27991fab550c4721590d17278e0 Author: Kenneth Graunke Date: Fri Jun 1 13:16:58 2012 -0700 i965/fs: Fix user-defined FS outputs with less than four components. OpenGL allows you to declare user-defined fragment shader outputs with less than four components: out ivec2 color; This makes sense if you're rendering to an RG format render target. Previously, we assumed that all color outputs had four components (like the built-in gl_FragColor/gl_FragData variables). This caused us to call emit_color_write for invalid indices, incrementing the output virtual GRF's reg_offset beyond the size of the register. This caused cascading failures: split_virtual_grfs would allocate new size-1 registers based on the virtual GRF size, but then proceed to rewrite the out-of-bounds accesses assuming that it had allocated enough new (contiguously numbered) registers. This resulted in instructions that accessed size-1 GRFs which register numbers beyond virtual_grf_next (i.e. registers that were never allocated). Finally, this manifested as live variable analysis and instruction scheduling accessing their temporary array with an out of bounds index (as they're all sized based on virtual_grf_next), and the program would segfault. It looks like the hardware's Render Target Write message requires you to send four components, even for RT formats such as RG or RGB. This patch continues to use all four MRFs, but doesn't bother to fill any data for the last few, which should be unused. +2 oglconforms. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_fs.h |1 + src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 10 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 9d1746c..0c6c3e4 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -610,6 +610,7 @@ public: struct hash_table *variable_ht; ir_variable *frag_depth; fs_reg outputs[BRW_MAX_DRAW_BUFFERS]; + unsigned output_components[BRW_MAX_DRAW_BUFFERS]; fs_reg dual_src_output; int first_non_payload_grf; int max_grf; diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 845ab49..2634b08 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -80,6 +80,7 @@ fs_visitor::visit(ir_variable *ir) /* Writing gl_FragColor outputs to all color regions. */ for (unsigned int i = 0; i < MAX2(c->key.nr_color_regions, 1); i++) { this->outputs[i] = *reg; + this->output_components[i] = 4; } } else if (ir->location == FRAG_RESULT_DEPTH) { this->frag_depth = ir; @@ -88,11 +89,16 @@ fs_visitor::visit(ir_variable *ir) assert(ir->location >= FRAG_RESULT_DATA0 && ir->location < FRAG_RESULT_DATA0 + BRW_MAX_DRAW_BUFFERS); +int vector_elements = + ir->type->is_array() ? ir->type->fields.array->vector_elements +: ir->type->vector_elements; + /* General color output. */ for (unsigned int i = 0; i < MAX2(1, ir->type->length); i++) { int output = ir->location - FRAG_RESULT_DATA0 + i; this->outputs[output] = *reg; - this->outputs[output].reg_offset += 4 * i; + this->outputs[output].reg_offset += vector_elements * i; + this->output_components[output] = vector_elements; } } } else if (ir->mode == ir_var_uniform) { @@ -2166,7 +2172,7 @@ fs_visitor::emit_fb_writes() this->current_annotation = ralloc_asprintf(this->mem_ctx, "FB write target %d", target); - for (int i = 0; i < 4; i++) + for (unsigned i = 0; i < this->output_components[target]; i++) emit_color_write(target, i, color_mrf); fs_inst *inst = emit(FS_OPCODE_FB_WRITE); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i965/fs: Fix texelFetchOffset() on pre-Gen7.
Module: Mesa Branch: master Commit: 217b62bf001f6b1da31807b803bbe45d7cabe3ba URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=217b62bf001f6b1da31807b803bbe45d7cabe3ba Author: Kenneth Graunke Date: Mon Jun 4 14:07:13 2012 -0700 i965/fs: Fix texelFetchOffset() on pre-Gen7. Commit f41ecade7b458c02d504158b522acb2231585040 fixed texelFetchOffset() on Ivybridge, but didn't update the Ironlake/Sandybridge code. +15 piglits on Sandybridge. NOTE: This and f41ecade7b458 are both candidates for stable branches. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 40 ++ 1 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 275a1f4..845ab49 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -884,20 +884,36 @@ fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, fs_reg coordinate, const int vector_elements = ir->coordinate ? ir->coordinate->type->vector_elements : 0; - if (ir->offset) { - /* The offsets set up by the ir_texture visitor are in the - * m1 header, so we can't go headerless. + if (ir->offset != NULL && ir->op == ir_txf) { + /* It appears that the ld instruction used for txf does its + * address bounds check before adding in the offset. To work + * around this, just add the integer offset to the integer texel + * coordinate, and don't put the offset in the header. */ - header_present = true; - mlen++; - base_mrf--; - } + ir_constant *offset = ir->offset->as_constant(); + for (int i = 0; i < vector_elements; i++) { +emit(BRW_OPCODE_ADD, + fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type), + coordinate, + offset->value.i[i]); +coordinate.reg_offset++; + } + } else { + if (ir->offset) { +/* The offsets set up by the ir_texture visitor are in the + * m1 header, so we can't go headerless. + */ +header_present = true; +mlen++; +base_mrf--; + } - for (int i = 0; i < vector_elements; i++) { - emit(BRW_OPCODE_MOV, - fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type), - coordinate); - coordinate.reg_offset++; + for (int i = 0; i < vector_elements; i++) { +emit(BRW_OPCODE_MOV, + fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type), + coordinate); +coordinate.reg_offset++; + } } mlen += vector_elements * reg_width; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i965/vs: Fix texelFetchOffset() on pre-Gen7.
Module: Mesa Branch: master Commit: cb18472eca9910e7a4222ebc1b6b1b66869f5b53 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb18472eca9910e7a4222ebc1b6b1b66869f5b53 Author: Kenneth Graunke Date: Mon Jun 4 14:12:15 2012 -0700 i965/vs: Fix texelFetchOffset() on pre-Gen7. Commit 4650aea7a536ddce120576fadb91845076e8e37a fixed texelFetchOffset() on Ivybridge, but didn't update the Ironlake/Sandybridge code. +18 piglits on Sandybridge. NOTE: This and 4650aea7a536ddce are both candidates for stable branches. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index c2b1033..cfffef4 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -1838,7 +1838,7 @@ vec4_visitor::visit(ir_texture *ir) inst->dst = dst_reg(this, ir->type); inst->shadow_compare = ir->shadow_comparitor != NULL; - if (ir->offset != NULL && !(intel->gen >= 7 && ir->op == ir_txf)) + if (ir->offset != NULL && ir->op != ir_txf) inst->texture_offset = brw_texture_offset(ir->offset->as_constant()); /* MRF for the first parameter */ @@ -1859,7 +1859,7 @@ vec4_visitor::visit(ir_texture *ir) zero_mask |= (1 << i); ir->coordinate->accept(this); - if (ir->offset && intel->gen >= 7 && ir->op == ir_txf) { + if (ir->offset && ir->op == ir_txf) { /* It appears that the ld instruction used for txf does its * address bounds check before adding in the offset. To work * around this, just add the integer offset to the integer ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().
Module: Mesa Branch: master Commit: 7fde071f04afff86d4f8d7895073e22e60970b4e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fde071f04afff86d4f8d7895073e22e60970b4e Author: Kenneth Graunke Date: Mon Jun 4 11:40:23 2012 -0700 meta: Fix GL_RENDERBUFFER binding in decompress_texture_image(). This isn't saved/restored by _mesa_meta_begin, so we need to do it manually (like we do for the read/draw framebuffers). Additionally, we neglected to re-bind before the glRenderbufferStorage call. +13 oglconforms. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke Reviewed-by: Brian Paul --- src/mesa/drivers/common/meta.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index a20e419..7978b08 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3269,6 +3269,7 @@ decompress_texture_image(struct gl_context *ctx, }; struct vertex verts[4]; GLuint fboDrawSave, fboReadSave; + GLuint rbSave; if (slice > 0) { assert(target == GL_TEXTURE_3D || @@ -3285,6 +3286,7 @@ decompress_texture_image(struct gl_context *ctx, /* save fbo bindings (not saved by _mesa_meta_begin()) */ fboDrawSave = ctx->DrawBuffer->Name; fboReadSave = ctx->ReadBuffer->Name; + rbSave = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0; _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_PIXEL_STORE); @@ -3305,6 +3307,7 @@ decompress_texture_image(struct gl_context *ctx, /* alloc dest surface */ if (width > decompress->Width || height > decompress->Height) { + _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, decompress->RBO); _mesa_RenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA, width, height); decompress->Width = width; @@ -3437,6 +3440,7 @@ decompress_texture_image(struct gl_context *ctx, _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fboDrawSave); _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fboReadSave); } + _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, rbSave); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Unbind ARB_transform_feedback2 binding points on Delete too.
Module: Mesa Branch: master Commit: 3edd2ba22bdb9abd4e2b10db4379f4182b5c3ecd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3edd2ba22bdb9abd4e2b10db4379f4182b5c3ecd Author: Kenneth Graunke Date: Mon Jun 4 00:51:34 2012 -0700 mesa: Unbind ARB_transform_feedback2 binding points on Delete too. DeleteBuffer needs to unbind from these binding points as well, based on the same rationale as the previous patch. +51 oglconforms (together with the last patch). NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke Reviewed-by: Brian Paul --- src/mesa/main/bufferobj.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index fe7db2a..36a7619 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -42,6 +42,7 @@ #include "mfeatures.h" #include "mtypes.h" #include "texobj.h" +#include "transformfeedback.h" /* Debug flags */ @@ -829,10 +830,15 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) _mesa_BindBufferARB( GL_COPY_WRITE_BUFFER, 0 ); } - /* unbind transform feedback binding point */ + /* unbind transform feedback binding points */ if (ctx->TransformFeedback.CurrentBuffer == bufObj) { _mesa_BindBufferARB( GL_TRANSFORM_FEEDBACK_BUFFER, 0 ); } + for (j = 0; j < MAX_FEEDBACK_ATTRIBS; j++) { +if (ctx->TransformFeedback.CurrentObject->Buffers[j] == bufObj) { + _mesa_BindBufferBase( GL_TRANSFORM_FEEDBACK_BUFFER, j, 0 ); +} + } /* unbind any pixel pack/unpack pointers bound to this buffer */ if (ctx->Pack.BufferObj == bufObj) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Support BindBuffer{Base,Offset, Range} with a buffer of 0.
Module: Mesa Branch: master Commit: 05b086ce934fa2967da736db8db429d0886735a9 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=05b086ce934fa2967da736db8db429d0886735a9 Author: Kenneth Graunke Date: Mon Jun 4 00:48:23 2012 -0700 mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0. _mesa_lookup_bufferobj returns NULL for 0, which caused us to say "there's no such buffer object" and raise an error, rather than correctly binding the shared NullBufferObj. Now you can unbind your buffers. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke Reviewed-by: Brian Paul --- src/mesa/main/transformfeedback.c | 21 ++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index f2c1435..1bd76d1 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -470,7 +470,12 @@ _mesa_BindBufferRange(GLenum target, GLuint index, return; } - bufObj = _mesa_lookup_bufferobj(ctx, buffer); + if (buffer == 0) { + bufObj = ctx->Shared->NullBufferObj; + } else { + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + } + if (!bufObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBindBufferRange(invalid buffer=%u)", buffer); @@ -518,7 +523,12 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) return; } - bufObj = _mesa_lookup_bufferobj(ctx, buffer); + if (buffer == 0) { + bufObj = ctx->Shared->NullBufferObj; + } else { + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + } + if (!bufObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBindBufferBase(invalid buffer=%u)", buffer); @@ -574,7 +584,12 @@ _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, return; } - bufObj = _mesa_lookup_bufferobj(ctx, buffer); + if (buffer == 0) { + bufObj = ctx->Shared->NullBufferObj; + } else { + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + } + if (!bufObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBindBufferOffsetEXT(invalid buffer=%u)", buffer); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.
Module: Mesa Branch: master Commit: cb8ed93dd0faf958493d35a4729c4a00a201af8d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb8ed93dd0faf958493d35a4729c4a00a201af8d Author: Kenneth Graunke Date: Sun Jun 3 22:34:32 2012 -0700 mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete. According to the GL 3.1 spec, section 2.9 ("Buffer Objects"): "If a buffer object is deleted while it is bound, all bindings to that object in the current context (i.e. in the thread that called DeleteBuffers) are reset to zero." The code already checked for a number of cases, but neglected these newer binding points. +21 oglconforms. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke Reviewed-by: Brian Paul --- src/mesa/main/bufferobj.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index ae7bac1..fe7db2a 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -821,6 +821,19 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) _mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 ); } + /* unbind ARB_copy_buffer binding points */ + if (ctx->CopyReadBuffer == bufObj) { +_mesa_BindBufferARB( GL_COPY_READ_BUFFER, 0 ); + } + if (ctx->CopyWriteBuffer == bufObj) { +_mesa_BindBufferARB( GL_COPY_WRITE_BUFFER, 0 ); + } + + /* unbind transform feedback binding point */ + if (ctx->TransformFeedback.CurrentBuffer == bufObj) { +_mesa_BindBufferARB( GL_TRANSFORM_FEEDBACK_BUFFER, 0 ); + } + /* unbind any pixel pack/unpack pointers bound to this buffer */ if (ctx->Pack.BufferObj == bufObj) { _mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 ); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl/builtins: Fix textureGrad() for Array samplers.
Module: Mesa Branch: master Commit: 25edfbfccfb8af9eecd949c3fc4f2680c5b963b6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=25edfbfccfb8af9eecd949c3fc4f2680c5b963b6 Author: Kenneth Graunke Date: Fri Jun 1 02:56:50 2012 -0700 glsl/builtins: Fix textureGrad() for Array samplers. We were incorrectly assuming that the coordinate's dimensionality is equal to the gradient's dimensionality. For array types, the coordinate has one more component. Fixes 12 subcases of oglconform's glsl-bif-tex-grad test. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke --- src/glsl/builtins/tools/texture_builtins.py |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py index 84a144e..94971bc 100755 --- a/src/glsl/builtins/tools/texture_builtins.py +++ b/src/glsl/builtins/tools/texture_builtins.py @@ -56,7 +56,7 @@ def get_txs_dim(sampler_type): def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0): coord_dim = get_coord_dim(sampler_type) extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields) -offset_dim = get_sampler_dim(sampler_type) +sampler_dim = get_sampler_dim(sampler_type) if variant & Single: return_type = "float" @@ -76,12 +76,12 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0): elif ((tex_inst == "txf" or tex_inst == "txs") and "Buffer" not in sampler_type and "Rect" not in sampler_type): print "\n (declare (in) int lod)", elif tex_inst == "txd": -grad_type = vec_type("", coord_dim) +grad_type = vec_type("", sampler_dim) print "\n (declare (in) " + grad_type + " dPdx)", print "\n (declare (in) " + grad_type + " dPdy)", if variant & Offset: -print "\n (declare (const_in) " + vec_type("i", offset_dim) + " offset)", +print "\n (declare (const_in) " + vec_type("i", sampler_dim) + " offset)", if tex_inst == "txb": print "\n (declare (in) float bias)", ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): configure.ac: Fail if egl x11 platform dependencies are not available
Module: Mesa Branch: master Commit: 2c4f6ceeb466cb15df34670aaacbcbdd4aba5fd6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c4f6ceeb466cb15df34670aaacbcbdd4aba5fd6 Author: Kristian Høgsberg Date: Fri Jun 1 14:14:20 2012 -0400 configure.ac: Fail if egl x11 platform dependencies are not available Currently, if you pass --with-egl-platforms=x11 but xcb-dri2 isn't available we just silently fail and disables building the EGL DRI2 driver. This commit cleans up the EGL platfrom checking and fails if a selected platform can't find its required dependencies. Reviewed-by: Eric Anholt --- configure.ac | 67 + 1 files changed, 39 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index fc1c28e..fb7c4a6 100644 --- a/configure.ac +++ b/configure.ac @@ -1434,18 +1434,9 @@ if test "x$enable_egl" = xyes; then if test "$have_libudev" = yes; then DEFINES="$DEFINES -DHAVE_LIBUDEV" fi + if test "x$enable_dri" = xyes; then -# build egl_dri2 when xcb-dri2 is available -PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes], - [have_xcb_dri2=yes],[have_xcb_dri2=no]) -if test "$have_xcb_dri2" = yes; then - HAVE_EGL_DRIVER_DRI2=1 -# workaround a bug in xcb-dri2 generated by xcb-proto 1.6 - save_LIBS="$LIBS" -AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [], - [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"]) - LIBS="$save_LIBS" -fi + HAVE_EGL_DRIVER_DRI2=1 fi fi @@ -1723,6 +1714,9 @@ esac AC_SUBST([VG_LIB_DEPS]) AC_SUBST([EGL_CLIENT_APIS]) +dnl +dnl EGL Platforms configuration +dnl AC_ARG_WITH([egl-platforms], [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@], [comma delimited native platforms libEGL supports, e.g. @@ -1740,28 +1734,45 @@ if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then AC_MSG_ERROR([cannot build egl state tracker without EGL library]) fi -# verify the requested driver directories exist +# Do per-EGL platform setups and checks egl_platforms=`IFS=', '; echo $with_egl_platforms` for plat in $egl_platforms; do -test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \ -AC_MSG_ERROR([EGL platform '$plat' does not exist]) -if test "$plat" = "fbdev"; then -GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev" -fi -if test "$plat" = "null"; then -GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null" -fi - if test "$plat" = "wayland"; then + case "$plat" in + fbdev|null) + GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/$plat" + ;; + + wayland) PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \ [AC_MSG_ERROR([cannot find libwayland-client])]) -GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland" + GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland" + + m4_ifdef([WAYLAND_SCANNER_RULES], + [WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])]) + ;; + + x11) + PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes]) + # workaround a bug in xcb-dri2 generated by xcb-proto 1.6 + save_LIBS="$LIBS" + AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [], +[DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"]) + LIBS="$save_LIBS" + ;; + + drm) + test "x$enable_gbm" = "xno" && + AC_MSG_ERROR([EGL platform drm needs gbm]) + ;; + + android|gdi) + ;; + + *) + AC_MSG_ERROR([EGL platform '$plat' does not exist]) + ;; + esac -m4_ifdef([WAYLAND_SCANNER_RULES], - [WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])]) - fi -if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then -AC_MSG_ERROR([EGL platform drm needs gbm]) -fi case "$plat$have_libudev" in waylandno|drmno) AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r600g: add new Sumo, Palm, BTC pci ids
Module: Mesa Branch: master Commit: 6ce298f9ce575444029a7c8aac5e86fcf368582a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ce298f9ce575444029a7c8aac5e86fcf368582a Author: Alex Deucher Date: Tue Jun 5 10:15:16 2012 -0400 r600g: add new Sumo, Palm, BTC pci ids Note this is a candidate for the stable branch. Signed-off-by: Alex Deucher --- include/pci_ids/r600_pci_ids.h |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/pci_ids/r600_pci_ids.h b/include/pci_ids/r600_pci_ids.h index 360c73d..77d6b05 100644 --- a/include/pci_ids/r600_pci_ids.h +++ b/include/pci_ids/r600_pci_ids.h @@ -195,6 +195,7 @@ CHIPSET(0x9806, PALM_9806, PALM) CHIPSET(0x9807, PALM_9807, PALM) CHIPSET(0x9808, PALM_9808, PALM) CHIPSET(0x9809, PALM_9809, PALM) +CHIPSET(0x980A, PALM_980A, PALM) CHIPSET(0x9640, SUMO_9640, SUMO) CHIPSET(0x9641, SUMO_9641, SUMO) @@ -204,6 +205,7 @@ CHIPSET(0x9644, SUMO2_9644, SUMO2) CHIPSET(0x9645, SUMO2_9645, SUMO2) CHIPSET(0x9647, SUMO_9647, SUMO) CHIPSET(0x9648, SUMO_9648, SUMO) +CHIPSET(0x9649, SUMO_9649, SUMO) CHIPSET(0x964a, SUMO_964A, SUMO) CHIPSET(0x964b, SUMO_964B, SUMO) CHIPSET(0x964c, SUMO_964C, SUMO) @@ -239,6 +241,7 @@ CHIPSET(0x6729, BARTS_6729, BARTS) CHIPSET(0x6738, BARTS_6738, BARTS) CHIPSET(0x6739, BARTS_6739, BARTS) CHIPSET(0x673E, BARTS_673E, BARTS) + CHIPSET(0x6740, TURKS_6740, TURKS) CHIPSET(0x6741, TURKS_6741, TURKS) CHIPSET(0x6742, TURKS_6742, TURKS) @@ -249,6 +252,7 @@ CHIPSET(0x6746, TURKS_6746, TURKS) CHIPSET(0x6747, TURKS_6747, TURKS) CHIPSET(0x6748, TURKS_6748, TURKS) CHIPSET(0x6749, TURKS_6749, TURKS) +CHIPSET(0x674A, TURKS_674A, TURKS) CHIPSET(0x6750, TURKS_6750, TURKS) CHIPSET(0x6751, TURKS_6751, TURKS) CHIPSET(0x6758, TURKS_6758, TURKS) @@ -275,6 +279,7 @@ CHIPSET(0x6766, CAICOS_6766, CAICOS) CHIPSET(0x6767, CAICOS_6767, CAICOS) CHIPSET(0x6768, CAICOS_6768, CAICOS) CHIPSET(0x6770, CAICOS_6770, CAICOS) +CHIPSET(0x6771, CAICOS_6771, CAICOS) CHIPSET(0x6772, CAICOS_6772, CAICOS) CHIPSET(0x6778, CAICOS_6778, CAICOS) CHIPSET(0x6779, CAICOS_6779, CAICOS) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r600g: add new Trinity PCI ids
Module: Mesa Branch: master Commit: 75f9d24ac4a539a8f0c16c9bd66e11dc394ba81b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=75f9d24ac4a539a8f0c16c9bd66e11dc394ba81b Author: Alex Deucher Date: Tue Jun 5 10:16:42 2012 -0400 r600g: add new Trinity PCI ids Signed-off-by: Alex Deucher --- include/pci_ids/r600_pci_ids.h | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/include/pci_ids/r600_pci_ids.h b/include/pci_ids/r600_pci_ids.h index 77d6b05..2478b6b 100644 --- a/include/pci_ids/r600_pci_ids.h +++ b/include/pci_ids/r600_pci_ids.h @@ -289,6 +289,23 @@ CHIPSET(0x9900, ARUBA_9900, ARUBA) CHIPSET(0x9901, ARUBA_9901, ARUBA) CHIPSET(0x9903, ARUBA_9903, ARUBA) CHIPSET(0x9904, ARUBA_9904, ARUBA) +CHIPSET(0x9905, ARUBA_9905, ARUBA) +CHIPSET(0x9906, ARUBA_9906, ARUBA) +CHIPSET(0x9907, ARUBA_9907, ARUBA) +CHIPSET(0x9908, ARUBA_9908, ARUBA) +CHIPSET(0x9909, ARUBA_9909, ARUBA) +CHIPSET(0x990A, ARUBA_990A, ARUBA) CHIPSET(0x990F, ARUBA_990F, ARUBA) +CHIPSET(0x9910, ARUBA_9910, ARUBA) +CHIPSET(0x9913, ARUBA_9913, ARUBA) +CHIPSET(0x9917, ARUBA_9917, ARUBA) +CHIPSET(0x9918, ARUBA_9918, ARUBA) +CHIPSET(0x9919, ARUBA_9919, ARUBA) CHIPSET(0x9990, ARUBA_9990, ARUBA) CHIPSET(0x9991, ARUBA_9991, ARUBA) +CHIPSET(0x9992, ARUBA_9992, ARUBA) +CHIPSET(0x9993, ARUBA_9993, ARUBA) +CHIPSET(0x9994, ARUBA_9994, ARUBA) +CHIPSET(0x99A0, ARUBA_99A0, ARUBA) +CHIPSET(0x99A2, ARUBA_99A2, ARUBA) +CHIPSET(0x99A4, ARUBA_99A4, ARUBA) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): radeonsi: add new SI pci ids
Module: Mesa Branch: master Commit: 01b7eb7c74a2e2ee0dfa6ceb7eb0fdb373e8f9d1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=01b7eb7c74a2e2ee0dfa6ceb7eb0fdb373e8f9d1 Author: Alex Deucher Date: Tue Jun 5 10:12:21 2012 -0400 radeonsi: add new SI pci ids Signed-off-by: Alex Deucher --- include/pci_ids/radeonsi_pci_ids.h | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/pci_ids/radeonsi_pci_ids.h b/include/pci_ids/radeonsi_pci_ids.h index 55ade12..585e4f4 100644 --- a/include/pci_ids/radeonsi_pci_ids.h +++ b/include/pci_ids/radeonsi_pci_ids.h @@ -1,11 +1,11 @@ CHIPSET(0x6780, TAHITI_6780, TAHITI) CHIPSET(0x6784, TAHITI_6784, TAHITI) -CHIPSET(0x6788, TAHITI_678A, TAHITI) +CHIPSET(0x6788, TAHITI_6788, TAHITI) CHIPSET(0x678A, TAHITI_678A, TAHITI) CHIPSET(0x6790, TAHITI_6790, TAHITI) CHIPSET(0x6798, TAHITI_6798, TAHITI) CHIPSET(0x6799, TAHITI_6799, TAHITI) -CHIPSET(0x679A, TAHITI_679E, TAHITI) +CHIPSET(0x679A, TAHITI_679A, TAHITI) CHIPSET(0x679E, TAHITI_679E, TAHITI) CHIPSET(0x679F, TAHITI_679F, TAHITI) @@ -21,18 +21,19 @@ CHIPSET(0x684C, PITCAIRN_684C, PITCAIRN) CHIPSET(0x6820, VERDE_6820, VERDE) CHIPSET(0x6821, VERDE_6821, VERDE) -CHIPSET(0x6823, VERDE_6824, VERDE) +CHIPSET(0x6823, VERDE_6823, VERDE) CHIPSET(0x6824, VERDE_6824, VERDE) CHIPSET(0x6825, VERDE_6825, VERDE) -CHIPSET(0x6826, VERDE_6825, VERDE) +CHIPSET(0x6826, VERDE_6826, VERDE) CHIPSET(0x6827, VERDE_6827, VERDE) CHIPSET(0x6828, VERDE_6828, VERDE) CHIPSET(0x6829, VERDE_6829, VERDE) +CHIPSET(0x682B, VERDE_682B, VERDE) CHIPSET(0x682D, VERDE_682D, VERDE) CHIPSET(0x682F, VERDE_682F, VERDE) CHIPSET(0x6830, VERDE_6830, VERDE) CHIPSET(0x6831, VERDE_6831, VERDE) -CHIPSET(0x6837, VERDE_6831, VERDE) +CHIPSET(0x6837, VERDE_6837, VERDE) CHIPSET(0x6838, VERDE_6838, VERDE) CHIPSET(0x6839, VERDE_6839, VERDE) CHIPSET(0x683B, VERDE_683B, VERDE) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit