Mesa (master): r600: Silence uninitialized variable warning.
Module: Mesa Branch: master Commit: 4f131356cc5d2df4316c2146d3d9447d1b4dcd48 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f131356cc5d2df4316c2146d3d9447d1b4dcd48 Author: Vinson Lee Date: Sun Feb 14 00:45:23 2010 -0800 r600: Silence uninitialized variable warning. --- src/mesa/drivers/dri/r600/r700_assembler.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 89adb77..f67f882 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2260,7 +2260,7 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { -R700ALUInstruction* alu_instruction_ptr; +R700ALUInstruction* alu_instruction_ptr = NULL; R700ALUInstructionHalfLiteral * alu_instruction_ptr_hl; R700ALUInstructionFullLiteral * alu_instruction_ptr_fl; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300: Silence uninitialized variable warning.
Module: Mesa Branch: master Commit: 3a299071d41d2e45adba4aebab53ab1391176585 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a299071d41d2e45adba4aebab53ab1391176585 Author: Vinson Lee Date: Sun Feb 14 00:56:57 2010 -0800 r300: Silence uninitialized variable warning. --- src/mesa/drivers/dri/r300/r300_draw.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c index 4ae0d6f..3efa0e3 100644 --- a/src/mesa/drivers/dri/r300/r300_draw.c +++ b/src/mesa/drivers/dri/r300/r300_draw.c @@ -332,7 +332,7 @@ static void r300TranslateAttrib(GLcontext *ctx, GLuint attr, int count, const st { r300ContextPtr r300 = R300_CONTEXT(ctx); struct r300_vertex_buffer *vbuf = &r300->vbuf; - struct vertex_attribute r300_attr; + struct vertex_attribute r300_attr = { 0 }; GLenum type; GLuint stride; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glut: Silence uninitialized variable warning.
Module: Mesa Branch: master Commit: 0a3e3621752be5b054739ce606cad4f77cb65049 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a3e3621752be5b054739ce606cad4f77cb65049 Author: Vinson Lee Date: Sun Feb 14 02:04:17 2010 -0800 glut: Silence uninitialized variable warning. --- src/glut/glx/glut_overlay.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/glut/glx/glut_overlay.c b/src/glut/glx/glut_overlay.c index db1abe0..3243465 100644 --- a/src/glut/glx/glut_overlay.c +++ b/src/glut/glx/glut_overlay.c @@ -388,6 +388,7 @@ glutEstablishOverlay(void) if (!overlay->vis) { __glutFatalError("lacks overlay support."); } + overlay->ctx = NULL; #if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) if (fbc) { window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): python: Pass p_format. h as-is to swig now that it has no inlines.
Module: Mesa Branch: master Commit: 04cc5055db9b418abfc6abb97b69c022abfdff2d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=04cc5055db9b418abfc6abb97b69c022abfdff2d Author: José Fonseca Date: Sun Feb 14 11:26:58 2010 + python: Pass p_format.h as-is to swig now that it has no inlines. --- src/gallium/state_trackers/python/gallium.i |2 +- src/gallium/state_trackers/python/p_format.i | 154 -- 2 files changed, 1 insertions(+), 155 deletions(-) diff --git a/src/gallium/state_trackers/python/gallium.i b/src/gallium/state_trackers/python/gallium.i index 99e177b..d45c8bb 100644 --- a/src/gallium/state_trackers/python/gallium.i +++ b/src/gallium/state_trackers/python/gallium.i @@ -93,7 +93,7 @@ %include "p_compiler.i" %include "p_defines.h"; -%include "p_format.i" +%include "p_format.h" %include "p_device.i" %include "p_context.i" diff --git a/src/gallium/state_trackers/python/p_format.i b/src/gallium/state_trackers/python/p_format.i deleted file mode 100644 index 68df009..000 --- a/src/gallium/state_trackers/python/p_format.i +++ /dev/null @@ -1,154 +0,0 @@ -/** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * Copyright (c) 2008 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **/ - -/* - * XXX: SWIG can't parse p_format.h, so we need to duplicate the relevant - * declarations here - */ - -%{ -#include "pipe/p_format.h" -%} - -enum pipe_format { - PIPE_FORMAT_NONE, - PIPE_FORMAT_A8R8G8B8_UNORM, - PIPE_FORMAT_X8R8G8B8_UNORM, - PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_FORMAT_B8G8R8X8_UNORM, - PIPE_FORMAT_A1R5G5B5_UNORM, - PIPE_FORMAT_A4R4G4B4_UNORM, - PIPE_FORMAT_R5G6B5_UNORM, - PIPE_FORMAT_A2B10G10R10_UNORM, - PIPE_FORMAT_L8_UNORM, - PIPE_FORMAT_A8_UNORM, - PIPE_FORMAT_I8_UNORM, - PIPE_FORMAT_A8L8_UNORM, - PIPE_FORMAT_L16_UNORM, - PIPE_FORMAT_YCBCR, - PIPE_FORMAT_YCBCR_REV, - PIPE_FORMAT_Z16_UNORM, - PIPE_FORMAT_Z32_UNORM, - PIPE_FORMAT_Z32_FLOAT, - PIPE_FORMAT_S8Z24_UNORM, - PIPE_FORMAT_Z24S8_UNORM, - PIPE_FORMAT_X8Z24_UNORM, - PIPE_FORMAT_Z24X8_UNORM, - PIPE_FORMAT_S8_UNORM, - PIPE_FORMAT_R64_FLOAT, - PIPE_FORMAT_R64G64_FLOAT, - PIPE_FORMAT_R64G64B64_FLOAT, - PIPE_FORMAT_R64G64B64A64_FLOAT, - PIPE_FORMAT_R32_FLOAT, - PIPE_FORMAT_R32G32_FLOAT, - PIPE_FORMAT_R32G32B32_FLOAT, - PIPE_FORMAT_R32G32B32A32_FLOAT, - PIPE_FORMAT_R32_UNORM, - PIPE_FORMAT_R32G32_UNORM, - PIPE_FORMAT_R32G32B32_UNORM, - PIPE_FORMAT_R32G32B32A32_UNORM, - PIPE_FORMAT_R32_USCALED, - PIPE_FORMAT_R32G32_USCALED, - PIPE_FORMAT_R32G32B32_USCALED, - PIPE_FORMAT_R32G32B32A32_USCALED, - PIPE_FORMAT_R32_SNORM, - PIPE_FORMAT_R32G32_SNORM, - PIPE_FORMAT_R32G32B32_SNORM, - PIPE_FORMAT_R32G32B32A32_SNORM, - PIPE_FORMAT_R32_SSCALED, - PIPE_FORMAT_R32G32_SSCALED, - PIPE_FORMAT_R32G32B32_SSCALED, - PIPE_FORMAT_R32G32B32A32_SSCALED, - PIPE_FORMAT_R16_UNORM, - PIPE_FORMAT_R16G16_UNORM, - PIPE_FORMAT_R16G16B16_UNORM, - PIPE_FORMAT_R16G16B16A16_UNORM, - PIPE_FORMAT_R16_USCALED, - PIPE_FORMAT_R16G16_USCALED, - PIPE_FORMAT_R16G16B16_USCALED, - PIPE_FORMAT_R16G16B16A16_USCALED, - PIPE_FORMAT_R16_SNORM, - PIPE_FORMAT_R16G16_SNORM, - PIPE_FORMAT_R16G16B16_SNORM, - PIPE_FORMAT_R16G16B16A16_SNORM, - PIPE_FORMAT_R16_SSCALED, - PIPE_FORMAT_R16G16_SSCALED, - PIPE_FORMAT_R16G16B16_SSCALED, - PIPE_FORMAT_R16G16B16A16_SSCALED, - PIPE_FORMAT_R8_UNORM, - PIPE_FORMAT_R8G8_UNORM, - PIPE_FORMAT_R8G8B8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM, - PIPE_FORMAT_R8G8B8X8_UNORM, - PIPE_FORMAT_R8_USCALED, - PIPE_FORMAT_R8G8_USCALED, - PIPE_FORMAT_R8G8B8_USCALED, - PIPE_FORMAT_R8G8B8A8_USCALED, - PIPE_F
Mesa (master): progs/gallium/python: New home for python statetracker scripts.
Module: Mesa Branch: master Commit: 50812e633fa433937c7ba885fa334f44ec0bad58 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=50812e633fa433937c7ba885fa334f44ec0bad58 Author: José Fonseca Date: Sun Feb 14 11:15:19 2010 + progs/gallium/python: New home for python statetracker scripts. --- .../gallium}/python/retrace/README |0 .../gallium}/python/retrace/format.py |0 .../gallium}/python/retrace/interpreter.py |0 .../gallium}/python/retrace/model.py |0 .../gallium}/python/retrace/parse.py |0 .../gallium}/python/retrace/parser.py |0 .../gallium}/python/samples/gs.py |0 .../gallium}/python/samples/tri.py |0 .../gallium}/python/tests/.gitignore |0 .../gallium}/python/tests/base.py |0 .../tests/regress/fragment-shader/.gitignore |0 .../tests/regress/fragment-shader/frag-abs.sh |0 .../tests/regress/fragment-shader/frag-add.sh |0 .../tests/regress/fragment-shader/frag-cb-1d.sh|0 .../tests/regress/fragment-shader/frag-cb-2d.sh|0 .../tests/regress/fragment-shader/frag-dp3.sh |0 .../tests/regress/fragment-shader/frag-dp4.sh |0 .../tests/regress/fragment-shader/frag-dst.sh |0 .../tests/regress/fragment-shader/frag-ex2.sh |0 .../tests/regress/fragment-shader/frag-flr.sh |0 .../tests/regress/fragment-shader/frag-frc.sh |0 .../tests/regress/fragment-shader/frag-lg2.sh |0 .../tests/regress/fragment-shader/frag-lit.sh |0 .../tests/regress/fragment-shader/frag-lrp.sh |0 .../tests/regress/fragment-shader/frag-mad.sh |0 .../tests/regress/fragment-shader/frag-max.sh |0 .../tests/regress/fragment-shader/frag-min.sh |0 .../tests/regress/fragment-shader/frag-mov.sh |0 .../tests/regress/fragment-shader/frag-mul.sh |0 .../tests/regress/fragment-shader/frag-rcp.sh |0 .../tests/regress/fragment-shader/frag-rsq.sh |0 .../tests/regress/fragment-shader/frag-sge.sh |0 .../tests/regress/fragment-shader/frag-slt.sh |0 .../regress/fragment-shader/frag-srcmod-abs.sh |0 .../regress/fragment-shader/frag-srcmod-absneg.sh |0 .../regress/fragment-shader/frag-srcmod-neg.sh |0 .../regress/fragment-shader/frag-srcmod-swz.sh |0 .../tests/regress/fragment-shader/frag-sub.sh |0 .../tests/regress/fragment-shader/frag-xpd.sh |0 .../regress/fragment-shader/fragment-shader.py |0 .../python/tests/regress/vertex-shader/.gitignore |0 .../python/tests/regress/vertex-shader/vert-abs.sh |0 .../python/tests/regress/vertex-shader/vert-add.sh |0 .../python/tests/regress/vertex-shader/vert-arl.sh |0 .../python/tests/regress/vertex-shader/vert-arr.sh |0 .../tests/regress/vertex-shader/vert-cb-1d.sh |0 .../tests/regress/vertex-shader/vert-cb-2d.sh |0 .../python/tests/regress/vertex-shader/vert-dp3.sh |0 .../python/tests/regress/vertex-shader/vert-dp4.sh |0 .../python/tests/regress/vertex-shader/vert-dst.sh |0 .../python/tests/regress/vertex-shader/vert-ex2.sh |0 .../python/tests/regress/vertex-shader/vert-flr.sh |0 .../python/tests/regress/vertex-shader/vert-frc.sh |0 .../python/tests/regress/vertex-shader/vert-lg2.sh |0 .../python/tests/regress/vertex-shader/vert-lit.sh |0 .../python/tests/regress/vertex-shader/vert-lrp.sh |0 .../python/tests/regress/vertex-shader/vert-mad.sh |0 .../python/tests/regress/vertex-shader/vert-max.sh |0 .../python/tests/regress/vertex-shader/vert-min.sh |0 .../python/tests/regress/vertex-shader/vert-mov.sh |0 .../python/tests/regress/vertex-shader/vert-mul.sh |0 .../python/tests/regress/vertex-shader/vert-rcp.sh |0 .../python/tests/regress/vertex-shader/vert-rsq.sh |0 .../python/tests/regress/vertex-shader/vert-sge.sh |0 .../python/tests/regress/vertex-shader/vert-slt.sh |0 .../tests/regress/vertex-shader/vert-srcmod-abs.sh |0 .../regress/vertex-shader/vert-srcmod-absneg.sh|0 .../tests/regress/vertex-shader/vert-srcmod-neg.sh |0 .../tests/regress/vertex-shader/vert-srcmod-swz.sh |0 .../python/tests/regress/vertex-shader/vert-sub.sh |0 .../python/tests/regress/vertex-shader/vert-xpd.sh |0 .../tests/regress/vertex-shader/vertex-shader.py |0 .../gallium}/python/tests/surface_copy.py |0 .../gallium}/python/tests/texture_render.py|0 .../gallium}/python/tests/texture_sample.py|0 .../gallium}/python/tests/texture_transfer.py |0 .../gallium}/python/tests/tree.py |0 src/gallium/state_trackers/python/README |2 +- src/gal
Mesa (master): python: Tell swig how to index per-rendertarget blend state.
Module: Mesa Branch: master Commit: f1848977e8f55e6d8cf5169520fb9b0a6c817884 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1848977e8f55e6d8cf5169520fb9b0a6c817884 Author: José Fonseca Date: Sun Feb 14 12:06:37 2010 + python: Tell swig how to index per-rendertarget blend state. --- src/gallium/state_trackers/python/p_state.i | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/gallium/state_trackers/python/p_state.i b/src/gallium/state_trackers/python/p_state.i index 90f157e..318fe1c 100644 --- a/src/gallium/state_trackers/python/p_state.i +++ b/src/gallium/state_trackers/python/p_state.i @@ -44,6 +44,20 @@ %array_class(struct pipe_stencil_state, StencilArray); +%extend pipe_rt_blend_state +{ + struct pipe_rt_blend_state * + __getitem__(int index) + { + if(index < 0 || index >= PIPE_MAX_COLOR_BUFS) + SWIG_exception(SWIG_ValueError, "index out of bounds"); + return $self + index; + fail: + return NULL; + }; +}; + + %extend pipe_framebuffer_state { pipe_framebuffer_state(void) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): trace: Fix generated XML.
Module: Mesa Branch: master Commit: 11a981fda189515d4ea51ef1709b15e7ce90507d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=11a981fda189515d4ea51ef1709b15e7ce90507d Author: José Fonseca Date: Sun Feb 14 12:47:40 2010 + trace: Fix generated XML. --- src/gallium/drivers/trace/tr_context.c|2 +- src/gallium/drivers/trace/tr_dump_state.c | 27 --- src/gallium/drivers/trace/tr_dump_state.h |2 -- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 866e228..879778b 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -843,7 +843,7 @@ trace_context_set_constant_buffer(struct pipe_context *_pipe, trace_dump_arg(ptr, pipe); trace_dump_arg(uint, shader); trace_dump_arg(uint, index); - trace_dump_arg(constant_buffer, buffer); + trace_dump_arg(ptr, buffer); /* XXX hmm? */ if (buffer) { diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index a4c7255..0e485db 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -227,24 +227,6 @@ void trace_dump_clip_state(const struct pipe_clip_state *state) } -void trace_dump_constant_buffer(const struct pipe_buffer *state) -{ - if (!trace_dumping_enabled_locked()) - return; - - if(!state) { - trace_dump_null(); - return; - } - - trace_dump_struct_begin("pipe_constant_buffer"); - - trace_dump_reference(&state->reference); - - trace_dump_struct_end(); -} - - void trace_dump_shader_state(const struct pipe_shader_state *state) { static char str[8192]; @@ -322,6 +304,10 @@ void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_ static void trace_dump_rt_blend_state(const struct pipe_rt_blend_state *state) { + trace_dump_struct_begin("pipe_rt_blend_state"); + + trace_dump_member(uint, state, blend_enable); + trace_dump_member(uint, state, rgb_func); trace_dump_member(uint, state, rgb_src_factor); trace_dump_member(uint, state, rgb_dst_factor); @@ -332,11 +318,13 @@ static void trace_dump_rt_blend_state(const struct pipe_rt_blend_state *state) trace_dump_member(uint, state, colormask); + trace_dump_struct_end(); } void trace_dump_blend_state(const struct pipe_blend_state *state) { unsigned valid_entries = 1; + if (!trace_dumping_enabled_locked()) return; @@ -354,10 +342,11 @@ void trace_dump_blend_state(const struct pipe_blend_state *state) trace_dump_member(bool, state, independent_blend_enable); + trace_dump_member_begin("rt"); if (state->independent_blend_enable) valid_entries = PIPE_MAX_COLOR_BUFS; - trace_dump_struct_array(rt_blend_state, state->rt, valid_entries); + trace_dump_member_end(); trace_dump_struct_end(); } diff --git a/src/gallium/drivers/trace/tr_dump_state.h b/src/gallium/drivers/trace/tr_dump_state.h index 825519d..3400367 100644 --- a/src/gallium/drivers/trace/tr_dump_state.h +++ b/src/gallium/drivers/trace/tr_dump_state.h @@ -47,8 +47,6 @@ void trace_dump_scissor_state(const struct pipe_scissor_state *state); void trace_dump_clip_state(const struct pipe_clip_state *state); -void trace_dump_constant_buffer(const struct pipe_buffer *state); - void trace_dump_token(const struct tgsi_token *token); void trace_dump_shader_state(const struct pipe_shader_state *state); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): python/retrace: Interpret pipe_screen::context_create().
Module: Mesa Branch: master Commit: 4ab3f0edef438334d70d26381e3b2acdc48b176b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4ab3f0edef438334d70d26381e3b2acdc48b176b Author: José Fonseca Date: Sun Feb 14 12:48:11 2010 + python/retrace: Interpret pipe_screen::context_create(). --- progs/gallium/python/retrace/interpreter.py |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/progs/gallium/python/retrace/interpreter.py b/progs/gallium/python/retrace/interpreter.py index 7277701..a34122e 100755 --- a/progs/gallium/python/retrace/interpreter.py +++ b/progs/gallium/python/retrace/interpreter.py @@ -272,6 +272,10 @@ class Screen(Object): def get_paramf(self, param): pass +def context_create(self): +context = self.real.context_create() +return Context(self.interpreter, context) + def is_format_supported(self, format, target, tex_usage, geom_flags): return self.real.is_format_supported(format, target, tex_usage, geom_flags) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): makefiles: Don' t complaint about changing configs if the same one is reselected.
Module: Mesa Branch: master Commit: c3168e050eabff55e12485c8648f4cf0744182c1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3168e050eabff55e12485c8648f4cf0744182c1 Author: José Fonseca Date: Sun Feb 14 13:15:49 2010 + makefiles: Don't complaint about changing configs if the same one is reselected. Otherwise it creates unnecessary pain when automating builds in a build server/farm. --- Makefile | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3a9c92b..ea5751d 100644 --- a/Makefile +++ b/Makefile @@ -173,11 +173,14 @@ sunos5-v9 \ sunos5-v9-static \ sunos5-v9-cc-g++ \ ultrix-gcc: - @ if test -f configs/current || test -L configs/current ; then \ - echo "Please run 'make realclean' before changing configs" ; \ - exit 1 ; \ + @ if test -f configs/current -o -L configs/current; then \ + if ! cmp configs/$@ configs/current > /dev/null; then \ + echo "Please run 'make realclean' before changing configs" ; \ + exit 1 ; \ + fi ; \ + else \ + cd configs && rm -f current && ln -s $@ current ; \ fi - (cd configs && rm -f current && ln -s $@ current) $(MAKE) default ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Use util_format_name().
Module: Mesa Branch: master Commit: d468791cc8307f8aaed72ccec78b504d7922de42 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d468791cc8307f8aaed72ccec78b504d7922de42 Author: José Fonseca Date: Sun Feb 14 13:24:43 2010 + mesa: Use util_format_name(). --- src/mesa/state_tracker/st_draw.c |2 +- src/mesa/state_tracker/st_format.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 34df4d4..f72f564 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -596,7 +596,7 @@ st_draw_vbo(GLcontext *ctx, printf("vlements[%d].vbuffer_index = %u\n", i, velements[i].vertex_buffer_index); printf("vlements[%d].src_offset = %u\n", i, velements[i].src_offset); printf("vlements[%d].nr_comps = %u\n", i, velements[i].nr_components); - printf("vlements[%d].format = %s\n", i, pf_name(velements[i].src_format)); + printf("vlements[%d].format = %s\n", i, util_format_name(velements[i].src_format)); } } #endif diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 3ffc2ae..851c16f 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -85,7 +85,7 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) if (desc->layout == UTIL_FORMAT_LAYOUT_ARITH || desc->layout == UTIL_FORMAT_LAYOUT_ARRAY) { #if 0 - printf("%s\n", pf_name( format ) ); + printf("%s\n", util_format_name( format ) ); #endif /* Data type */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): xorg: Use util_format_name().
Module: Mesa Branch: master Commit: ee65faffc1ae878fc7998ca52f1c5e298ae61176 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee65faffc1ae878fc7998ca52f1c5e298ae61176 Author: José Fonseca Date: Sun Feb 14 13:24:58 2010 + xorg: Use util_format_name(). --- src/gallium/state_trackers/xorg/xorg_exa.c | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index ae66c4b..665efdc 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -45,6 +45,7 @@ #include "util/u_rect.h" #include "util/u_math.h" #include "util/u_debug.h" +#include "util/u_format.h" #define DEBUG_PRINT 0 #define ROUND_UP_TEXTURES 1 @@ -360,7 +361,7 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format, priv->tex->target, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) { - XORG_FALLBACK("format %s", pf_name(priv->tex->format)); + XORG_FALLBACK("format %s", util_format_name(priv->tex->format)); } return xorg_solid_bind_state(exa, priv, fg); @@ -441,12 +442,12 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format, priv->tex->target, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) - XORG_FALLBACK("pDst format %s", pf_name(priv->tex->format)); + XORG_FALLBACK("pDst format %s", util_format_name(priv->tex->format)); if (!exa->scrn->is_format_supported(exa->scrn, src_priv->tex->format, src_priv->tex->target, PIPE_TEXTURE_USAGE_SAMPLER, 0)) - XORG_FALLBACK("pSrc format %s", pf_name(src_priv->tex->format)); + XORG_FALLBACK("pSrc format %s", util_format_name(src_priv->tex->format)); exa->copy.src = src_priv; exa->copy.dst = priv; @@ -652,7 +653,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture, if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format, priv->tex->target, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) - XORG_FALLBACK("pDst format: %s", pf_name(priv->tex->format)); + XORG_FALLBACK("pDst format: %s", util_format_name(priv->tex->format)); if (priv->picture_format != pDstPicture->format) XORG_FALLBACK("pDst pic_format: %s != %s", @@ -667,7 +668,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture, if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format, priv->tex->target, PIPE_TEXTURE_USAGE_SAMPLER, 0)) - XORG_FALLBACK("pSrc format: %s", pf_name(priv->tex->format)); + XORG_FALLBACK("pSrc format: %s", util_format_name(priv->tex->format)); if (!picture_check_formats(priv, pSrcPicture)) XORG_FALLBACK("pSrc pic_format: %s != %s", @@ -684,7 +685,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture, if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format, priv->tex->target, PIPE_TEXTURE_USAGE_SAMPLER, 0)) - XORG_FALLBACK("pMask format: %s", pf_name(priv->tex->format)); + XORG_FALLBACK("pMask format: %s", util_format_name(priv->tex->format)); if (!picture_check_formats(priv, pMaskPicture)) XORG_FALLBACK("pMask pic_format: %s != %s", ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): util: Add pf_name() replacement: util_format_name().
Module: Mesa Branch: master Commit: 5784381b1e8a7f7535bbd5cc1672770026662bb0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5784381b1e8a7f7535bbd5cc1672770026662bb0 Author: José Fonseca Date: Sun Feb 14 13:23:32 2010 + util: Add pf_name() replacement: util_format_name(). --- src/gallium/auxiliary/util/u_format.h | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 4323bc8..2fbbb83 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -156,6 +156,19 @@ util_format_description(enum pipe_format format); * Format query functions. */ +static INLINE const char * +util_format_name(enum pipe_format format) +{ + const struct util_format_description *desc = util_format_description(format); + + assert(format); + if (!format) { + return "???"; + } + + return desc->name; +} + static INLINE boolean util_format_is_compressed(enum pipe_format format) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): trace: Use util_format_name().
Module: Mesa Branch: master Commit: 6f5e0539dc681b800bd08d14221751d0f3484280 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f5e0539dc681b800bd08d14221751d0f3484280 Author: José Fonseca Date: Sun Feb 14 13:25:06 2010 + trace: Use util_format_name(). --- src/gallium/drivers/trace/tr_dump_state.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index 0e485db..7cbf705 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -28,6 +28,7 @@ #include "pipe/p_compiler.h" #include "util/u_memory.h" +#include "util/u_format.h" #include "tgsi/tgsi_dump.h" #include "tr_dump.h" @@ -39,7 +40,7 @@ void trace_dump_format(enum pipe_format format) if (!trace_dumping_enabled_locked()) return; - trace_dump_enum(pf_name(format) ); + trace_dump_enum(util_format_name(format) ); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300g: Use util_format_name().
Module: Mesa Branch: master Commit: 06f76e4a6b8a3949918e55643f39525de1276815 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=06f76e4a6b8a3949918e55643f39525de1276815 Author: José Fonseca Date: Sun Feb 14 13:25:22 2010 + r300g: Use util_format_name(). --- src/gallium/drivers/r300/r300_screen.c|4 ++-- src/gallium/drivers/r300/r300_state_inlines.h | 16 src/gallium/drivers/r300/r300_texture.c |2 +- src/gallium/drivers/r300/r300_texture.h |3 ++- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 7c8dd75..1668cae 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -277,7 +277,7 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, case PIPE_FORMAT_X8Z24_UNORM: SCREEN_DBG(r300_screen(screen), DBG_TEX, "r300: Note: Got unsupported format: %s in %s\n", - pf_name(format), __FUNCTION__); + util_format_name(format), __FUNCTION__); return FALSE; /* XXX Add all remaining gallium-supported formats, @@ -286,7 +286,7 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, default: /* Unknown format... */ debug_printf("r300: Warning: Got unknown format: %s in %s\n", -pf_name(format), __FUNCTION__); +util_format_name(format), __FUNCTION__); break; } diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 779ba2c..08d8d2e 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -367,7 +367,7 @@ static INLINE uint32_t r300_translate_colorformat(enum pipe_format format) default: debug_printf("r300: Implementation error: " "Got unsupported color format %s in %s\n", -pf_name(format), __FUNCTION__); +util_format_name(format), __FUNCTION__); assert(0); break; } @@ -389,7 +389,7 @@ static INLINE uint32_t r300_translate_zsformat(enum pipe_format format) default: debug_printf("r300: Implementation error: " "Got unsupported ZS format %s in %s\n", -pf_name(format), __FUNCTION__); +util_format_name(format), __FUNCTION__); assert(0); break; } @@ -428,7 +428,7 @@ static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format) default: debug_printf("r300: Implementation error: " "Got unsupported output format %s in %s\n", -pf_name(format), __FUNCTION__); +util_format_name(format), __FUNCTION__); assert(0); return R300_US_OUT_FMT_UNUSED; } @@ -494,7 +494,7 @@ r300_translate_vertex_data_type(enum pipe_format format) { if (desc->layout != UTIL_FORMAT_LAYOUT_ARITH && desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) { -debug_printf("r300: Bad format %s in %s:%d\n", pf_name(format), +debug_printf("r300: Bad format %s in %s:%d\n", util_format_name(format), __FUNCTION__, __LINE__); assert(0); } @@ -508,7 +508,7 @@ r300_translate_vertex_data_type(enum pipe_format format) { break; default: debug_printf("r300: Bad format %s in %s:%d\n", -pf_name(format), __FUNCTION__, __LINE__); +util_format_name(format), __FUNCTION__, __LINE__); assert(0); } break; @@ -529,7 +529,7 @@ r300_translate_vertex_data_type(enum pipe_format format) { break; default: debug_printf("r300: Bad format %s in %s:%d\n", -pf_name(format), __FUNCTION__, __LINE__); +util_format_name(format), __FUNCTION__, __LINE__); debug_printf("r300: util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0) == %d\n", util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0)); assert(0); @@ -537,7 +537,7 @@ r300_translate_vertex_data_type(enum pipe_format format) { break; default: debug_printf("r300: Bad format %s in %s:%d\n", -pf_name(format), __FUNCTION__, __LINE__); +util_format_name(format), __FUNCTION__, __LINE__); assert(0); } @@ -561,7 +561,7 @@ r300_translate_vertex_data_swizzle(enum pipe_format format) { if (desc->layout != UTIL_FORMAT_LAYOUT_ARITH && desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) { debug_printf("r
Mesa (master): llvmpipe: Use util_format_name().
Module: Mesa Branch: master Commit: 9189d04cdb55dd5d4d5d78d1a7edab30d4c25340 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9189d04cdb55dd5d4d5d78d1a7edab30d4c25340 Author: José Fonseca Date: Sun Feb 14 13:26:37 2010 + llvmpipe: Use util_format_name(). --- src/gallium/drivers/llvmpipe/lp_state_fs.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 15c10d8..b7ae426 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -861,7 +861,7 @@ generate_variant(struct llvmpipe_context *lp, tgsi_dump(shader->base.tokens, 0); if(key->depth.enabled) { - debug_printf("depth.format = %s\n", pf_name(key->zsbuf_format)); + debug_printf("depth.format = %s\n", util_format_name(key->zsbuf_format)); debug_printf("depth.func = %s\n", debug_dump_func(key->depth.func, TRUE)); debug_printf("depth.writemask = %u\n", key->depth.writemask); } @@ -885,7 +885,7 @@ generate_variant(struct llvmpipe_context *lp, if(key->sampler[i].format) { debug_printf("sampler[%u] = \n", i); debug_printf(" .format = %s\n", - pf_name(key->sampler[i].format)); + util_format_name(key->sampler[i].format)); debug_printf(" .target = %s\n", debug_dump_tex_target(key->sampler[i].target, TRUE)); debug_printf(" .pot = %u %u %u\n", ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nv: Use util_format_name().
Module: Mesa Branch: master Commit: db2df0aa9b49e006de4fcfc4a0bab32ad0a30173 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=db2df0aa9b49e006de4fcfc4a0bab32ad0a30173 Author: José Fonseca Date: Sun Feb 14 13:26:30 2010 + nv: Use util_format_name(). --- src/gallium/drivers/nv30/nv30_fragtex.c|4 +++- src/gallium/drivers/nv30/nv30_vbo.c|5 +++-- src/gallium/drivers/nv40/nv40_fragtex.c|4 +++- src/gallium/drivers/nv40/nv40_vbo.c|5 +++-- src/gallium/drivers/nv50/nv50_state_validate.c |6 -- src/gallium/drivers/nv50/nv50_vbo.c|3 +-- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/nv30/nv30_fragtex.c b/src/gallium/drivers/nv30/nv30_fragtex.c index 0cc3172..9f4a104 100644 --- a/src/gallium/drivers/nv30/nv30_fragtex.c +++ b/src/gallium/drivers/nv30/nv30_fragtex.c @@ -1,3 +1,5 @@ +#include "util/u_format.h" + #include "nv30_context.h" #include "nouveau/nouveau_util.h" @@ -50,7 +52,7 @@ nv30_fragtex_format(uint pipe_format) tf++; } - NOUVEAU_ERR("unknown texture format %s\n", pf_name(pipe_format)); + NOUVEAU_ERR("unknown texture format %s\n", util_format_name(pipe_format)); return NULL; } diff --git a/src/gallium/drivers/nv30/nv30_vbo.c b/src/gallium/drivers/nv30/nv30_vbo.c index f406fa0..e48823a 100644 --- a/src/gallium/drivers/nv30/nv30_vbo.c +++ b/src/gallium/drivers/nv30/nv30_vbo.c @@ -1,6 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" #include "util/u_inlines.h" +#include "util/u_format.h" #include "nv30_context.h" #include "nv30_state.h" @@ -34,7 +35,7 @@ nv30_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, unsigned *ncomp) *fmt = NV34TCL_VTXFMT_TYPE_USHORT; break; default: - NOUVEAU_ERR("Unknown format %s\n", pf_name(pipe)); + NOUVEAU_ERR("Unknown format %s\n", util_format_name(pipe)); return 1; } @@ -60,7 +61,7 @@ nv30_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, unsigned *ncomp) *ncomp = 4; break; default: - NOUVEAU_ERR("Unknown format %s\n", pf_name(pipe)); + NOUVEAU_ERR("Unknown format %s\n", util_format_name(pipe)); return 1; } diff --git a/src/gallium/drivers/nv40/nv40_fragtex.c b/src/gallium/drivers/nv40/nv40_fragtex.c index aad9198..7a28d57 100644 --- a/src/gallium/drivers/nv40/nv40_fragtex.c +++ b/src/gallium/drivers/nv40/nv40_fragtex.c @@ -1,3 +1,5 @@ +#include "util/u_format.h" + #include "nv40_context.h" #define _(m,tf,ts0x,ts0y,ts0z,ts0w,ts1x,ts1y,ts1z,ts1w,sx,sy,sz,sw) \ @@ -53,7 +55,7 @@ nv40_fragtex_format(uint pipe_format) tf++; } - NOUVEAU_ERR("unknown texture format %s\n", pf_name(pipe_format)); + NOUVEAU_ERR("unknown texture format %s\n", util_format_name(pipe_format)); return NULL; } diff --git a/src/gallium/drivers/nv40/nv40_vbo.c b/src/gallium/drivers/nv40/nv40_vbo.c index f2048eb..7812460 100644 --- a/src/gallium/drivers/nv40/nv40_vbo.c +++ b/src/gallium/drivers/nv40/nv40_vbo.c @@ -1,6 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" #include "util/u_inlines.h" +#include "util/u_format.h" #include "nv40_context.h" #include "nv40_state.h" @@ -34,7 +35,7 @@ nv40_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, unsigned *ncomp) *fmt = NV40TCL_VTXFMT_TYPE_USHORT; break; default: - NOUVEAU_ERR("Unknown format %s\n", pf_name(pipe)); + NOUVEAU_ERR("Unknown format %s\n", util_format_name(pipe)); return 1; } @@ -60,7 +61,7 @@ nv40_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, unsigned *ncomp) *ncomp = 4; break; default: - NOUVEAU_ERR("Unknown format %s\n", pf_name(pipe)); + NOUVEAU_ERR("Unknown format %s\n", util_format_name(pipe)); return 1; } diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 0be6abb..efab94c 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -20,6 +20,8 @@ * SOFTWARE. */ +#include "util/u_format.h" + #include "nv50_context.h" #include "nouveau/nouveau_stateobj.h" @@ -79,7 +81,7 @@ nv50_state_validate_fb(struct nv50_context *nv50) NV50_CBUF_FORMAT_CASE(R16G16_UNORM); default: NOUVEAU_ERR("A unknown format %s\n", - pf_name(fb->cbufs[i]->format)); + util_format_name(fb->cbufs[i]->format)); so_data(so, NV50TCL_RT_FORMAT_X8R8G8B8_UNORM); break; } @@
Mesa (master): cell: Use util_format_name().
Module: Mesa Branch: master Commit: 8f2b2d113fd43b0265f47c6ece3f7c52f5861442 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f2b2d113fd43b0265f47c6ece3f7c52f5861442 Author: José Fonseca Date: Sun Feb 14 13:26:46 2010 + cell: Use util_format_name(). --- src/gallium/drivers/cell/ppu/cell_state_emit.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c index 282f05b..a59c782 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_emit.c +++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c @@ -28,6 +28,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_math.h" +#include "util/u_format.h" #include "cell_context.h" #include "cell_gen_fragment.h" #include "cell_state.h" @@ -207,8 +208,8 @@ cell_emit_state(struct cell_context *cell) fb->width = cell->framebuffer.width; fb->height = cell->framebuffer.height; #if 0 - printf("EMIT color format %s\n", pf_name(fb->color_format)); - printf("EMIT depth format %s\n", pf_name(fb->depth_format)); + printf("EMIT color format %s\n", util_format_name(fb->color_format)); + printf("EMIT depth format %s\n", util_format_name(fb->depth_format)); #endif } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): util: Use util_format_name().
Module: Mesa Branch: master Commit: c667a5b95dd971629784b26adf13bd6b211f6f55 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c667a5b95dd971629784b26adf13bd6b211f6f55 Author: José Fonseca Date: Sun Feb 14 13:26:51 2010 + util: Use util_format_name(). --- src/gallium/auxiliary/util/u_debug.c | 119 +- 1 files changed, 1 insertions(+), 118 deletions(-) diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 4821b8a..688083d 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -288,130 +288,13 @@ debug_dump_flags(const struct debug_named_value *names, } -static const struct debug_named_value pipe_format_names[] = { -#ifdef DEBUG - DEBUG_NAMED_VALUE(PIPE_FORMAT_NONE), - DEBUG_NAMED_VALUE(PIPE_FORMAT_A8R8G8B8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_X8R8G8B8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_B8G8R8A8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_B8G8R8X8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_A1R5G5B5_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_A4R4G4B4_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R5G6B5_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_A2B10G10R10_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_L8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_A8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_I8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_A8L8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_L16_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_YCBCR), - DEBUG_NAMED_VALUE(PIPE_FORMAT_YCBCR_REV), - DEBUG_NAMED_VALUE(PIPE_FORMAT_Z16_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_Z32_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_Z32_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_S8Z24_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_Z24S8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_X8Z24_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_Z24X8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_S8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R64_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R64G64_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R64G64B64_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R64G64B64A64_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_FLOAT), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8A8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8X8_UNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8A8_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8X8_USCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8A8_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8X8_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_B6G5R5_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_A8B8G8R8_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_X8B8G8R8_SNORM), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_SSCALED), - DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8_SS
Mesa (master): draw: Use util_format_name().
Module: Mesa Branch: master Commit: 13701aae40d8edb5b38be5fb04739f74c1fc8001 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=13701aae40d8edb5b38be5fb04739f74c1fc8001 Author: José Fonseca Date: Sun Feb 14 13:27:00 2010 + draw: Use util_format_name(). --- src/gallium/auxiliary/draw/draw_pt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index f5ed32d..341353f 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -310,7 +310,7 @@ draw_arrays_instanced(struct draw_context *draw, debug_printf("Elements:\n"); for (i = 0; i < draw->pt.nr_vertex_elements; i++) { debug_printf(" format=%s comps=%u\n", - pf_name(draw->pt.vertex_element[i].src_format), + util_format_name(draw->pt.vertex_element[i].src_format), draw->pt.vertex_element[i].nr_components); } debug_printf("Buffers:\n"); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): gallium: Remove previously forgotten pf_name() prototype.
Module: Mesa Branch: master Commit: fd3237c97d33863f8eb3d1383d26ec79b67f0774 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd3237c97d33863f8eb3d1383d26ec79b67f0774 Author: José Fonseca Date: Sun Feb 14 13:28:17 2010 + gallium: Remove previously forgotten pf_name() prototype. --- src/gallium/include/pipe/p_format.h |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 2894e13..f33b063 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -165,11 +165,6 @@ enum pipe_format { PIPE_FORMAT_COUNT }; -/** - * Builds pipe format name from format token. - */ -extern const char *pf_name( enum pipe_format format ); - enum pipe_video_chroma_format { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Add missing include.
Module: Mesa Branch: master Commit: db18996d3da4009a7a031e3444b5cd688e12dc22 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=db18996d3da4009a7a031e3444b5cd688e12dc22 Author: José Fonseca Date: Sun Feb 14 13:28:29 2010 + mesa: Add missing include. --- src/mesa/state_tracker/st_draw.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index f72f564..4b48c16 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -56,6 +56,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" +#include "util/u_format.h" static GLuint double_types[4] = { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): gallivm: s/debug_dump_/util_dump_/
Module: Mesa Branch: master Commit: da8de038da2c581d98083f8f5f59d17fc1dce25f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=da8de038da2c581d98083f8f5f59d17fc1dce25f Author: José Fonseca Date: Sun Feb 14 15:20:57 2010 + gallivm: s/debug_dump_/util_dump_/ --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 57c2b76..e268862 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -35,7 +35,7 @@ #include "pipe/p_defines.h" #include "pipe/p_state.h" #include "util/u_debug.h" -#include "util/u_debug_dump.h" +#include "util/u_dump.h" #include "util/u_memory.h" #include "util/u_math.h" #include "util/u_format.h" @@ -173,7 +173,7 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld, case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: /* FIXME */ _debug_printf("llvmpipe: failed to translate texture wrap mode %s\n", -debug_dump_tex_wrap(wrap_mode, TRUE)); +util_dump_tex_wrap(wrap_mode, TRUE)); coord = lp_build_max(int_coord_bld, coord, int_coord_bld->zero); coord = lp_build_min(int_coord_bld, coord, length_minus_one); break; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): util: Rename u_debug_dump.[ch] -> u_dump.[ch].
Module: Mesa Branch: master Commit: c16a8e0dd552dc7a5f95169da983e6164fc1492e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c16a8e0dd552dc7a5f95169da983e6164fc1492e Author: José Fonseca Date: Sun Feb 14 15:20:34 2010 + util: Rename u_debug_dump.[ch] -> u_dump.[ch]. I have more plans for this than mere debugging -- it will be an helper to provide human readible representations of all gallium state for the python state tracker. --- src/gallium/auxiliary/Makefile |2 +- src/gallium/auxiliary/SConscript |2 +- .../auxiliary/util/{u_debug_dump.h => u_dump.h}| 17 ++-- .../util/{u_debug_dump.c => u_dump_defines.c} | 93 ++-- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 507ca6e..3f96da6 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -91,9 +91,9 @@ C_SOURCES = \ translate/translate.c \ translate/translate_cache.c \ util/u_debug.c \ - util/u_debug_dump.c \ util/u_debug_symbol.c \ util/u_debug_stack.c \ + util/u_dump_defines.c \ util/u_bitmask.c \ util/u_blit.c \ util/u_blitter.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index 9709344..f226f46 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -131,10 +131,10 @@ source = [ 'util/u_cache.c', 'util/u_cpu_detect.c', 'util/u_debug.c', -'util/u_debug_dump.c', 'util/u_debug_memory.c', 'util/u_debug_stack.c', 'util/u_debug_symbol.c', +'util/u_dump_defines.c', 'util/u_dl.c', 'util/u_draw_quad.c', 'util/u_format.c', diff --git a/src/gallium/auxiliary/util/u_debug_dump.h b/src/gallium/auxiliary/util/u_dump.h similarity index 80% rename from src/gallium/auxiliary/util/u_debug_dump.h rename to src/gallium/auxiliary/util/u_dump.h index 19b130a..ddccc54 100644 --- a/src/gallium/auxiliary/util/u_debug_dump.h +++ b/src/gallium/auxiliary/util/u_dump.h @@ -45,26 +45,29 @@ extern "C" { #endif +#define UTIL_DUMP_INVALID_NAME "" + + const char * -debug_dump_blend_factor(unsigned value, boolean shortened); +util_dump_blend_factor(unsigned value, boolean shortened); const char * -debug_dump_blend_func(unsigned value, boolean shortened); +util_dump_blend_func(unsigned value, boolean shortened); const char * -debug_dump_func(unsigned value, boolean shortened); +util_dump_func(unsigned value, boolean shortened); const char * -debug_dump_tex_target(unsigned value, boolean shortened); +util_dump_tex_target(unsigned value, boolean shortened); const char * -debug_dump_tex_wrap(unsigned value, boolean shortened); +util_dump_tex_wrap(unsigned value, boolean shortened); const char * -debug_dump_tex_mipfilter(unsigned value, boolean shortened); +util_dump_tex_mipfilter(unsigned value, boolean shortened); const char * -debug_dump_tex_filter(unsigned value, boolean shortened); +util_dump_tex_filter(unsigned value, boolean shortened); /* FIXME: Move the other debug_dump_xxx functions out of u_debug.h into here. */ diff --git a/src/gallium/auxiliary/util/u_debug_dump.c b/src/gallium/auxiliary/util/u_dump_defines.c similarity index 69% rename from src/gallium/auxiliary/util/u_debug_dump.c rename to src/gallium/auxiliary/util/u_dump_defines.c index 61624d0..96a2256 100644 --- a/src/gallium/auxiliary/util/u_debug_dump.c +++ b/src/gallium/auxiliary/util/u_dump_defines.c @@ -28,15 +28,12 @@ #include "util/u_memory.h" #include "util/u_debug.h" -#include "util/u_debug_dump.h" - - -#define DEBUG_DUMP_INVALID_NAME "" +#include "util/u_dump.h" #if 0 static const char * -debug_dump_strip_prefix(const char *name, +util_dump_strip_prefix(const char *name, const char *prefix) { const char *stripped; @@ -55,30 +52,30 @@ debug_dump_strip_prefix(const char *name, #endif static const char * -debug_dump_enum_continuous(unsigned value, +util_dump_enum_continuous(unsigned value, unsigned num_names, const char **names) { if (value >= num_names) - return DEBUG_DUMP_INVALID_NAME; + return UTIL_DUMP_INVALID_NAME; return names[value]; } -#define DEFINE_DEBUG_DUMP_CONTINUOUS(_name) \ +#define DEFINE_UTIL_DUMP_CONTINUOUS(_name) \ const char * \ - debug_dump_##_name(unsigned value, boolean shortened) \ + util_dump_##_name(unsigned value, boolean shortened) \ { \ if(shortened) \ - return debug_dump_enum_continuous(value, Elements(debug_dump_##_name##_short_names), debug_dump_##_name##_short_names); \ + return util_dump_enum_continuous(value, Elements(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \ else \ - return debug_dump_enum_continuous(value, Elements(debug_dump_##_name##_n
Mesa (master): llvmpipe: s/debug_dump_/util_dump_/
Module: Mesa Branch: master Commit: abdcdb3db73316c5ebca88bda04b90b6659782e8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=abdcdb3db73316c5ebca88bda04b90b6659782e8 Author: José Fonseca Date: Sun Feb 14 15:21:06 2010 + llvmpipe: s/debug_dump_/util_dump_/ --- src/gallium/drivers/llvmpipe/lp_state_blend.c |2 +- src/gallium/drivers/llvmpipe/lp_state_fs.c| 34 src/gallium/drivers/llvmpipe/lp_test.h|2 +- src/gallium/drivers/llvmpipe/lp_test_blend.c | 24 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index 8bb89f9..4ee2847 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c @@ -33,7 +33,7 @@ #include "util/u_memory.h" #include "util/u_math.h" -#include "util/u_debug_dump.h" +#include "util/u_dump.h" #include "draw/draw_context.h" #include "lp_screen.h" #include "lp_context.h" diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index b7ae426..90dae3f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -65,7 +65,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_format.h" -#include "util/u_debug_dump.h" +#include "util/u_dump.h" #include "os/os_time.h" #include "pipe/p_shader_tokens.h" #include "draw/draw_context.h" @@ -862,23 +862,23 @@ generate_variant(struct llvmpipe_context *lp, tgsi_dump(shader->base.tokens, 0); if(key->depth.enabled) { debug_printf("depth.format = %s\n", util_format_name(key->zsbuf_format)); - debug_printf("depth.func = %s\n", debug_dump_func(key->depth.func, TRUE)); + debug_printf("depth.func = %s\n", util_dump_func(key->depth.func, TRUE)); debug_printf("depth.writemask = %u\n", key->depth.writemask); } if(key->alpha.enabled) { - debug_printf("alpha.func = %s\n", debug_dump_func(key->alpha.func, TRUE)); + debug_printf("alpha.func = %s\n", util_dump_func(key->alpha.func, TRUE)); debug_printf("alpha.ref_value = %f\n", key->alpha.ref_value); } if(key->blend.logicop_enable) { debug_printf("blend.logicop_func = %u\n", key->blend.logicop_func); } else if(key->blend.rt[0].blend_enable) { - debug_printf("blend.rgb_func = %s\n", debug_dump_blend_func (key->blend.rt[0].rgb_func, TRUE)); - debug_printf("rgb_src_factor = %s\n", debug_dump_blend_factor(key->blend.rt[0].rgb_src_factor, TRUE)); - debug_printf("rgb_dst_factor = %s\n", debug_dump_blend_factor(key->blend.rt[0].rgb_dst_factor, TRUE)); - debug_printf("alpha_func = %s\n", debug_dump_blend_func (key->blend.rt[0].alpha_func, TRUE)); - debug_printf("alpha_src_factor = %s\n", debug_dump_blend_factor(key->blend.rt[0].alpha_src_factor, TRUE)); - debug_printf("alpha_dst_factor = %s\n", debug_dump_blend_factor(key->blend.rt[0].alpha_dst_factor, TRUE)); + debug_printf("blend.rgb_func = %s\n", util_dump_blend_func (key->blend.rt[0].rgb_func, TRUE)); + debug_printf("rgb_src_factor = %s\n", util_dump_blend_factor(key->blend.rt[0].rgb_src_factor, TRUE)); + debug_printf("rgb_dst_factor = %s\n", util_dump_blend_factor(key->blend.rt[0].rgb_dst_factor, TRUE)); + debug_printf("alpha_func = %s\n", util_dump_blend_func (key->blend.rt[0].alpha_func, TRUE)); + debug_printf("alpha_src_factor = %s\n", util_dump_blend_factor(key->blend.rt[0].alpha_src_factor, TRUE)); + debug_printf("alpha_dst_factor = %s\n", util_dump_blend_factor(key->blend.rt[0].alpha_dst_factor, TRUE)); } debug_printf("blend.colormask = 0x%x\n", key->blend.rt[0].colormask); for(i = 0; i < PIPE_MAX_SAMPLERS; ++i) { @@ -887,23 +887,23 @@ generate_variant(struct llvmpipe_context *lp, debug_printf(" .format = %s\n", util_format_name(key->sampler[i].format)); debug_printf(" .target = %s\n", - debug_dump_tex_target(key->sampler[i].target, TRUE)); + util_dump_tex_target(key->sampler[i].target, TRUE)); debug_printf(" .pot = %u %u %u\n", key->sampler[i].pot_width, key->sampler[i].pot_height, key->sampler[i].pot_depth); debug_printf(" .wrap = %s %s %s\n", - debug_dump_tex_wrap(key->sampler[i].wrap_s, TRUE), - debug_dump_tex_wrap(key->sampler[i].wrap_t, TRUE), - debug_dump_tex_wrap(key->sampler[i].wrap_r, TRUE)); + util_dump_tex_wrap(key->sampler[i].wrap_s, TRUE), + util_dump_tex_wrap(key->sampler[i]
Mesa (master): scons: Control caching via new SCONS_CACHE_DIR environment variable.
Module: Mesa Branch: master Commit: fe889a89d28293d8f98b2cd730efc58785ceb5d8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fe889a89d28293d8f98b2cd730efc58785ceb5d8 Author: José Fonseca Date: Sun Feb 14 15:34:39 2010 + scons: Control caching via new SCONS_CACHE_DIR environment variable. This serves several purposes: - disable caching in situations were is it useless or undesired - share caches among all trees - simplify purging the cache (when it's a single location) - move the cache out of the tree, since that slows downs IDEs considerably To retain previous behavior just define do export SCONS_CACHE_DIR=$PWD/build/cache before invoking scons. --- scons/gallium.py |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/scons/gallium.py b/scons/gallium.py index 1d5e041..925effc 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -155,7 +155,9 @@ def generate(env): # different scons versions building the same source file env['build'] = build_dir env.SConsignFile(os.path.join(build_dir, '.sconsign')) -env.CacheDir('build/cache') +if 'SCONS_CACHE_DIR' in os.environ: +print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],) +env.CacheDir(os.environ['SCONS_CACHE_DIR']) env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf') env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log') ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300g: fix texture formats: A4R4G4B4_UNORM, A1R5G5B5_UNORM, R5G6B5_UNORM
Module: Mesa Branch: master Commit: 71ac9551c49387813fcf3e6e88778081bf7306fe URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=71ac9551c49387813fcf3e6e88778081bf7306fe Author: Marek Olšák Date: Sun Feb 7 11:36:00 2010 +0100 r300g: fix texture formats: A4R4G4B4_UNORM, A1R5G5B5_UNORM, R5G6B5_UNORM --- src/gallium/drivers/r300/r300_screen.c|6 +++--- src/gallium/drivers/r300/r300_state_inlines.h |8 ++-- src/gallium/drivers/r300/r300_texture.h |8 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 1668cae..8e9f51a 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -216,9 +216,6 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, switch (format) { /* Supported formats. */ /* Colorbuffer */ -case PIPE_FORMAT_A4R4G4B4_UNORM: -case PIPE_FORMAT_R5G6B5_UNORM: -case PIPE_FORMAT_A1R5G5B5_UNORM: case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_L8_UNORM: retval = usage & @@ -242,6 +239,9 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, break; /* Colorbuffer or texture */ +case PIPE_FORMAT_R5G6B5_UNORM: +case PIPE_FORMAT_A1R5G5B5_UNORM: +case PIPE_FORMAT_A4R4G4B4_UNORM: case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_X8R8G8B8_UNORM: case PIPE_FORMAT_R8G8B8A8_UNORM: diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 08d8d2e..b7676e1 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -403,10 +403,14 @@ static INLINE uint32_t r300_translate_zsformat(enum pipe_format format) static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format) { switch (format) { +case PIPE_FORMAT_R5G6B5_UNORM: +/* C_5_6_5 is missing in US_OUT_FMT, but C4_8 works just fine. */ +case PIPE_FORMAT_A1R5G5B5_UNORM: +/* C_1_5_5_5 is missing in US_OUT_FMT, but C4_8 works just fine. */ +case PIPE_FORMAT_A4R4G4B4_UNORM: +/* C4_4 is missing in US_OUT_FMT, but C4_8 works just fine. */ case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_X8R8G8B8_UNORM: -/* XXX */ -case PIPE_FORMAT_Z24S8_UNORM: return R300_US_OUT_FMT_C4_8 | R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A; diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 0c5ac48..1d2382d 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -60,12 +60,20 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format) return R300_EASY_TX_FORMAT(X, X, X, ONE, X8) | R300_TX_FORMAT_GAMMA; /* X16 */ +case PIPE_FORMAT_A4R4G4B4_UNORM: +return R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4); case PIPE_FORMAT_R16_UNORM: case PIPE_FORMAT_Z16_UNORM: return R300_EASY_TX_FORMAT(X, X, X, X, X16); case PIPE_FORMAT_R16_SNORM: return R300_EASY_TX_FORMAT(X, X, X, X, X16) | R300_TX_FORMAT_SIGNED; +/* Z5Y6X5 */ +case PIPE_FORMAT_R5G6B5_UNORM: +return R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); +/* W1Z5Y5X5*/ +case PIPE_FORMAT_A1R5G5B5_UNORM: +return R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5); /* Y8X8 */ case PIPE_FORMAT_A8L8_UNORM: return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/fp: close file (bug 26559)
Module: Mesa Branch: master Commit: e84eec0003d162594c3468dc7774c2b7df9fcae2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e84eec0003d162594c3468dc7774c2b7df9fcae2 Author: Brian Paul Date: Sun Feb 14 09:51:49 2010 -0700 progs/fp: close file (bug 26559) --- progs/fp/fp-tri.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c index 70676d4..e45a799 100644 --- a/progs/fp/fp-tri.c +++ b/progs/fp/fp-tri.c @@ -188,6 +188,7 @@ static void Init( void ) } glClearColor(.1, .3, .5, 0); + fclose(f); } static void Reshape(int width, int height) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/objviewer: close file (bug 26559)
Module: Mesa Branch: master Commit: 291bd19a1a16399300022020c93d4d1b253aefc6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=291bd19a1a16399300022020c93d4d1b253aefc6 Author: Brian Paul Date: Sun Feb 14 10:02:01 2010 -0700 progs/objviewer: close file (bug 26559) --- progs/objviewer/glm.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/progs/objviewer/glm.c b/progs/objviewer/glm.c index 7f36cdf..7c964e4 100644 --- a/progs/objviewer/glm.c +++ b/progs/objviewer/glm.c @@ -421,6 +421,7 @@ _glmReadMTL(GLMmodel* model, char* name) break; } } + fclose(file); } @@ -475,6 +476,7 @@ _glmWriteMTL(GLMmodel* model, char* modelpath, char* mtllibname) fprintf(file, "Ns %f\n", material->shininess); fprintf(file, "\n"); } + fclose(file); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): src/glu/mini: fix mem leak (bug 26559)
Module: Mesa Branch: master Commit: d4d0629fcdcd98208e2badd3987755d9a6a1c9da URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4d0629fcdcd98208e2badd3987755d9a6a1c9da Author: Brian Paul Date: Sun Feb 14 10:02:32 2010 -0700 src/glu/mini: fix mem leak (bug 26559) --- src/glu/mini/mipmap.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/glu/mini/mipmap.c b/src/glu/mini/mipmap.c index a655d21..1cf739a 100644 --- a/src/glu/mini/mipmap.c +++ b/src/glu/mini/mipmap.c @@ -287,7 +287,11 @@ gluScaleImage(GLenum format, } break; default: - return GLU_INVALID_ENUM; + { + free(tempin); + free(tempout); + return GLU_INVALID_ENUM; + } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): src/glu/mesa: fix mem leak (bug 26559)
Module: Mesa Branch: master Commit: 2523172a5e9b60a1075ed0b67b9c6935d8feeeb7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2523172a5e9b60a1075ed0b67b9c6935d8feeeb7 Author: Brian Paul Date: Sun Feb 14 10:02:42 2010 -0700 src/glu/mesa: fix mem leak (bug 26559) --- src/glu/mesa/mipmap.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/glu/mesa/mipmap.c b/src/glu/mesa/mipmap.c index d85ce9b..ad6b6e6 100644 --- a/src/glu/mesa/mipmap.c +++ b/src/glu/mesa/mipmap.c @@ -287,7 +287,11 @@ gluScaleImage(GLenum format, } break; default: - return GLU_INVALID_ENUM; + { + free(tempin); + free(tempout); + return GLU_INVALID_ENUM; + } } @@ -670,6 +674,7 @@ gluBuild1DMipmaps(GLenum target, GLint components, break; default: /* Not implemented */ +free(texture); return GLU_ERROR; } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300g: accelerate blitting for all formats by faking the texture format
Module: Mesa Branch: master Commit: f22ddd8e4743dbbfea2fac6c54837b30cbb1eb0e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f22ddd8e4743dbbfea2fac6c54837b30cbb1eb0e Author: Marek Olšák Date: Sun Feb 14 04:57:03 2010 +0100 r300g: accelerate blitting for all formats by faking the texture format --- src/gallium/drivers/r300/r300_blit.c| 74 --- src/gallium/drivers/r300/r300_texture.c | 14 ++ src/gallium/drivers/r300/r300_texture.h |4 ++ 3 files changed, 85 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index faaf952..eb9b0be 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -22,6 +22,9 @@ #include "r300_blit.h" #include "r300_context.h" +#include "r300_texture.h" + +#include "util/u_format.h" static void r300_blitter_save_states(struct r300_context* r300) { @@ -86,13 +89,13 @@ void r300_clear(struct pipe_context* pipe, buffers, rgba, depth, stencil); } -/* Copy a block of pixels from one surface to another. */ -void r300_surface_copy(struct pipe_context* pipe, - struct pipe_surface* dst, - unsigned dstx, unsigned dsty, - struct pipe_surface* src, - unsigned srcx, unsigned srcy, - unsigned width, unsigned height) +/* Copy a block of pixels from one surface to another using HW. */ +static void r300_hw_copy(struct pipe_context* pipe, + struct pipe_surface* dst, + unsigned dstx, unsigned dsty, + struct pipe_surface* src, + unsigned srcx, unsigned srcy, + unsigned width, unsigned height) { struct r300_context* r300 = r300_context(pipe); @@ -114,6 +117,63 @@ void r300_surface_copy(struct pipe_context* pipe, dst, dstx, dsty, src, srcx, srcy, width, height, TRUE); } +/* Copy a block of pixels from one surface to another. */ +void r300_surface_copy(struct pipe_context* pipe, + struct pipe_surface* dst, + unsigned dstx, unsigned dsty, + struct pipe_surface* src, + unsigned srcx, unsigned srcy, + unsigned width, unsigned height) +{ +enum pipe_format old_format = dst->texture->format; +enum pipe_format new_format = old_format; + +assert(dst->texture->format == src->texture->format); + +if (!pipe->screen->is_format_supported(pipe->screen, + old_format, src->texture->target, + PIPE_TEXTURE_USAGE_RENDER_TARGET | + PIPE_TEXTURE_USAGE_SAMPLER, 0)) { +switch (util_format_get_blocksize(old_format)) { +case 1: +new_format = PIPE_FORMAT_I8_UNORM; +break; +case 2: +new_format = PIPE_FORMAT_A4R4G4B4_UNORM; +break; +case 4: +new_format = PIPE_FORMAT_A8R8G8B8_UNORM; +break; +default: +debug_printf("r300: surface_copy: Unhandled format: %s. Falling back to software.\n" + "r300: surface_copy: Software fallback doesn't work for tiled textures.\n", + util_format_name(old_format)); +} +} + +if (old_format != new_format) { +dst->format = new_format; +src->format = new_format; + +r300_texture_reinterpret_format(pipe->screen, +dst->texture, new_format); +r300_texture_reinterpret_format(pipe->screen, +src->texture, new_format); +} + +r300_hw_copy(pipe, dst, dstx, dsty, src, srcx, srcy, width, height); + +if (old_format != new_format) { +dst->format = old_format; +src->format = old_format; + +r300_texture_reinterpret_format(pipe->screen, +dst->texture, old_format); +r300_texture_reinterpret_format(pipe->screen, +src->texture, old_format); +} +} + /* Fill a region of a surface with a constant value. */ void r300_surface_fill(struct pipe_context* pipe, struct pipe_surface* dst, diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index f228220..f3325be 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -85,6 +85,20 @@ static void r300_setup_texture_state(struct r300_screen* screen, struct r300_tex pt->width0, pt->height0, pt->last_level); } +void r300_texture_reinterpret_format(struct pipe_screen *screen, +
Mesa (master): radeong: flush when changing tiling flags of BO referenced by CS
Module: Mesa Branch: master Commit: f7db96cd8f7977f4ad3591dab92c3c09f7cbc35a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7db96cd8f7977f4ad3591dab92c3c09f7cbc35a Author: Marek Olšák Date: Fri Feb 12 00:48:44 2010 +0100 radeong: flush when changing tiling flags of BO referenced by CS --- src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index 3b1c386..5cbf0dd 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -217,9 +217,10 @@ static void radeon_buffer_set_tiling(struct radeon_winsys *ws, boolean microtiled, boolean macrotiled) { +struct radeon_winsys_priv *priv = ((struct radeon_winsys *)ws)->priv; struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; -uint32_t flags = 0; +uint32_t flags = 0, old_flags, old_pitch; if (microtiled) { flags |= RADEON_BO_FLAGS_MICRO_TILE; @@ -228,7 +229,17 @@ static void radeon_buffer_set_tiling(struct radeon_winsys *ws, flags |= RADEON_BO_FLAGS_MACRO_TILE; } -radeon_bo_set_tiling(radeon_buffer->bo, flags, pitch); +radeon_bo_get_tiling(radeon_buffer->bo, &old_flags, &old_pitch); + +if (flags != old_flags || pitch != old_pitch) { +/* Tiling determines how DRM treats the buffer data. + * We must flush CS when changing it if the buffer is referenced. */ +if (radeon_bo_is_referenced_by_cs(radeon_buffer->bo, priv->cs)) { +priv->flush_cb(priv->flush_data); +} + +radeon_bo_set_tiling(radeon_buffer->bo, flags, pitch); +} } static void radeon_fence_reference(struct pipe_winsys *ws, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300g: add macrotiling support to texture setup
Module: Mesa Branch: master Commit: c608e19328758842d77dc4da3c8109fe0feb8e86 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c608e19328758842d77dc4da3c8109fe0feb8e86 Author: Marek Olšák Date: Mon Feb 8 03:17:24 2010 +0100 r300g: add macrotiling support to texture setup --- src/gallium/drivers/r300/r300_context.h |3 ++ src/gallium/drivers/r300/r300_emit.c|4 +- src/gallium/drivers/r300/r300_texture.c | 48 +- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index ba64b3e..ac2b08b 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -207,6 +207,9 @@ struct r300_texture { /* Size of one zslice or face based on the texture target */ unsigned layer_size[PIPE_MAX_TEXTURE_LEVELS]; +/* Whether the mipmap level is macrotiled. */ +enum r300_buffer_tiling mip_macrotile[PIPE_MAX_TEXTURE_LEVELS]; + /** * If non-zero, override the natural texture layout with * a custom stride (in bytes). diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 5a4196c..88fe166 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -424,7 +424,7 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) OUT_CS_REG_SEQ(R300_RB3D_COLORPITCH0 + (4 * i), 1); OUT_CS_RELOC(tex->buffer, tex->pitch[surf->level] | r300_translate_colorformat(tex->tex.format) | - R300_COLOR_TILE(tex->macrotile) | + R300_COLOR_TILE(tex->mip_macrotile[surf->level]) | R300_COLOR_MICROTILE(tex->microtile), 0, RADEON_GEM_DOMAIN_VRAM, 0); @@ -445,7 +445,7 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) OUT_CS_REG_SEQ(R300_ZB_DEPTHPITCH, 1); OUT_CS_RELOC(tex->buffer, tex->pitch[surf->level] | - R300_DEPTHMACROTILE(tex->macrotile) | + R300_DEPTHMACROTILE(tex->mip_macrotile[surf->level]) | R300_DEPTHMICROTILE(tex->microtile), 0, RADEON_GEM_DOMAIN_VRAM, 0); } diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index f3325be..34a49be 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -123,18 +123,40 @@ unsigned r300_texture_get_offset(struct r300_texture* tex, unsigned level, * Return the width (dim==TILE_WIDTH) or height (dim==TILE_HEIGHT) of one tile * of the given texture. */ -static unsigned r300_texture_get_tile_size(struct r300_texture* tex, int dim) +static unsigned r300_texture_get_tile_size(struct r300_texture* tex, + int dim, boolean macrotile) { unsigned pixsize, tile_size; pixsize = util_format_get_blocksize(tex->tex.format); -tile_size = microblock_table[util_logbase2(pixsize)][tex->microtile][dim] * -(tex->macrotile == R300_BUFFER_TILED ? 8 : 1); +tile_size = microblock_table[util_logbase2(pixsize)][tex->microtile][dim]; + +if (macrotile) { +tile_size *= 8; +} assert(tile_size); return tile_size; } +/* Return true if macrotiling should be enabled on the miplevel. */ +static boolean r300_texture_macro_switch(struct r300_texture *tex, + unsigned level, + boolean rv350_mode) +{ +unsigned tile_width, width; + +tile_width = r300_texture_get_tile_size(tex, TILE_WIDTH, TRUE); +width = u_minify(tex->tex.width0, level); + +/* See TX_FILTER1_n.MACRO_SWITCH. */ +if (rv350_mode) { +return width >= tile_width; +} else { +return width > tile_width; +} +} + /** * Return the stride, in bytes, of the texture images of the given texture * at the given level. @@ -157,8 +179,10 @@ unsigned r300_texture_get_stride(struct r300_screen* screen, width = u_minify(tex->tex.width0, level); if (!util_format_is_compressed(tex->tex.format)) { -tile_width = r300_texture_get_tile_size(tex, TILE_WIDTH); +tile_width = r300_texture_get_tile_size(tex, TILE_WIDTH, +tex->mip_macrotile[level]); width = align(width, tile_width); + return util_format_get_stride(tex->tex.format, width); } else { return align(util_format_get_stride(tex->tex.format, width), 32); @@ -173,7 +197,8 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture* tex, height = u_minify(tex->tex.height0, level); if (!util_format_is_compressed(tex->tex.format)) { -tile_height = r300_texture_get_tile_size(tex, TILE_HEIGHT); +tile_height = r300_texture_get_tile_size(tex, TILE_HEIG
Mesa (master): r300g: set the correct tiling flags for renderbuffers
Module: Mesa Branch: master Commit: 7344e20ce4a333bfd8ab142cfdf98098e16b001d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7344e20ce4a333bfd8ab142cfdf98098e16b001d Author: Marek Olšák Date: Fri Feb 12 02:48:03 2010 +0100 r300g: set the correct tiling flags for renderbuffers MACRO_SWITCH is applied to samplers but not renderbuffers. This commit fixes incorrect rendering to large and small mipmaps where the large ones are macrotiled and the small ones are not and both are emitted in the same CS. Note that this is still disabled by default (rework of texture transfers is next). --- src/gallium/drivers/r300/r300_state.c | 68 + 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 7fc51cd..b4c8ca4 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -38,6 +38,8 @@ #include "r300_fs.h" #include "r300_vs.h" +#include "radeon_winsys.h" + /* r300_state: Functions used to intialize state context by translating * Gallium state objects into semi-native r300 state objects. */ @@ -496,6 +498,69 @@ static void r300_set_stencil_ref(struct pipe_context* pipe, r300->dsa_state.dirty = TRUE; } +/* This switcheroo is needed just because of goddamned MACRO_SWITCH. */ +static void r300_fb_update_tiling_flags(struct r300_context *r300, + const struct pipe_framebuffer_state *old_state, + const struct pipe_framebuffer_state *new_state) +{ +struct r300_texture *tex; +unsigned i, j, level; + +/* Reset tiling flags for old surfaces to default values. */ +for (i = 0; i < old_state->nr_cbufs; i++) { +for (j = 0; j < new_state->nr_cbufs; j++) { +if (old_state->cbufs[i]->texture == new_state->cbufs[j]->texture) { +break; +} +} +/* If not binding the surface again... */ +if (j != new_state->nr_cbufs) { +continue; +} + +tex = (struct r300_texture*)old_state->cbufs[i]->texture; + +if (tex) { +r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, +tex->pitch[0], +tex->microtile != 0, +tex->macrotile != 0); +} +} +if (old_state->zsbuf && +(!new_state->zsbuf || + old_state->zsbuf->texture != new_state->zsbuf->texture)) { +tex = (struct r300_texture*)old_state->zsbuf->texture; + +if (tex) { +r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, +tex->pitch[0], +tex->microtile != 0, +tex->macrotile != 0); +} +} + +/* Set tiling flags for new surfaces. */ +for (i = 0; i < new_state->nr_cbufs; i++) { +tex = (struct r300_texture*)new_state->cbufs[i]->texture; +level = new_state->cbufs[i]->level; + +r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, +tex->pitch[level], +tex->microtile != 0, +tex->mip_macrotile[level] != 0); +} +if (new_state->zsbuf) { +tex = (struct r300_texture*)new_state->zsbuf->texture; +level = new_state->zsbuf->level; + +r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, +tex->pitch[level], +tex->microtile != 0, +tex->mip_macrotile[level] != 0); +} +} + static void r300_set_framebuffer_state(struct pipe_context* pipe, const struct pipe_framebuffer_state* state) @@ -526,6 +591,7 @@ static void return; } + if (r300->draw) { draw_flush(r300->draw); } @@ -534,6 +600,8 @@ static void r300->fb_state.size = (10 * state->nr_cbufs) + (state->zsbuf ? 10 : 0) + 6; +r300_fb_update_tiling_flags(r300, r300->fb_state.state, state); + /* XXX wait what */ r300->blend_state.dirty = TRUE; r300->dsa_state.dirty = TRUE; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Don' t pass paramter to __builtin_clz which would hve undefined result.
Module: Mesa Branch: master Commit: 6e958832afe9544973528bed78dd3a340b8686f3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e958832afe9544973528bed78dd3a340b8686f3 Author: Pauli Nieminen Date: Sun Feb 14 14:16:20 2010 +0200 mesa: Don't pass paramter to __builtin_clz which would hve undefined result. __builtin_clz with parameter 0 has undefined value. When using -O3 optimizing this would result to too large next power of two value. Fix is to check if passed value is 1 and modify formula for that case. --- src/mesa/main/imports.h | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 3843f50..e3d2ac9 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -412,13 +412,19 @@ _mesa_is_pow_two(int x) * Source for the fallback implementation is * Sean Eron Anderson's webpage "Bit Twiddling Hacks" * http://graphics.stanford.edu/~seander/bithacks.html + * + * When using builtin function have to do some work + * for case when passed values 1 to prevent hiting + * undefined result from __builtin_clz. Undefined + * results would be different depending on optimization + * level used for build. */ static INLINE int32_t _mesa_next_pow_two_32(uint32_t x) { #ifdef __GNUC__ - x--; - return 1 << ((__builtin_clz(x) ^ 31) + 1); + uint32_t y = (x != 1); + return (1 + y) << ((__builtin_clz(x - y) ^ 31) ); #else x--; x |= x >> 1; @@ -435,11 +441,11 @@ static INLINE int64_t _mesa_next_pow_two_64(uint64_t x) { #ifdef __GNUC__ - x--; + uint64_t y = (x != 1); if (sizeof(x) == sizeof(long)) - return 1 << ((__builtin_clzl(x) ^ 63) + 1); + return (1 + y) << ((__builtin_clzl(x - y) ^ 63)); else - return 1 << ((__builtin_clzll(x) ^ 63) + 1); + return (1 + y) << ((__builtin_clzll(x - y) ^ 63)); #else x--; x |= x >> 1; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300: add half_float_vertex support
Module: Mesa Branch: master Commit: 558c15995f486d72b959ad19c914a38adbcbe5f7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=558c15995f486d72b959ad19c914a38adbcbe5f7 Author: Marek Olšák Date: Sun Feb 14 21:58:00 2010 +0100 r300: add half_float_vertex support --- src/gallium/drivers/r300/r300_reg.h |3 +++ src/gallium/drivers/r300/r300_state_inlines.h |8 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index 3618138..a049da6 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -244,6 +244,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_DATA_TYPE_SHORT_4 7 # define R300_DATA_TYPE_VECTOR_3_TTT 8 # define R300_DATA_TYPE_VECTOR_3_EET 9 +# define R300_DATA_TYPE_FLOAT_8 10 +# define R300_DATA_TYPE_FLT16_2 11 +# define R300_DATA_TYPE_FLT16_4 12 # define R300_SKIP_DWORDS_SHIFT 4 # define R300_DST_VEC_LOC_SHIFT 8 # define R300_LAST_VEC(1 << 13) diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index b7676e1..6ee6cd0 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -507,6 +507,14 @@ r300_translate_vertex_data_type(enum pipe_format format) { /* Half-floats, floats, doubles */ case UTIL_FORMAT_TYPE_FLOAT: switch (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0)) { +case 16: +/* XXX Supported only on RV350 and later. */ +if (components > 2) { +result = R300_DATA_TYPE_FLT16_4; +} else { +result = R300_DATA_TYPE_FLT16_2; +} +break; case 32: result = R300_DATA_TYPE_FLOAT_1 + (components - 1); break; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): svga: Silence uninitialized variable warning.
Module: Mesa Branch: master Commit: 7e64701263f8158fb4138610ba63df41eefe6594 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e64701263f8158fb4138610ba63df41eefe6594 Author: Vinson Lee Date: Sun Feb 14 13:10:08 2010 -0800 svga: Silence uninitialized variable warning. --- src/gallium/drivers/svga/svga_tgsi_insn.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index be821e9..6debd98 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -525,6 +525,7 @@ static boolean emit_def_const( struct svga_shader_emitter *emit, break; default: assert(0); + opcode = inst_token( SVGA3DOP_NOP ); break; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): llvmpipe: Silence unused value warning.
Module: Mesa Branch: master Commit: 0b58d029b936fb9e3b30f157b554b9bc29f72f6d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b58d029b936fb9e3b30f157b554b9bc29f72f6d Author: Vinson Lee Date: Sun Feb 14 13:23:21 2010 -0800 llvmpipe: Silence unused value warning. --- src/gallium/drivers/llvmpipe/lp_setup.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 538492b..cb87366 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -251,6 +251,7 @@ lp_setup_bind_framebuffer( struct setup_context *setup, set_scene_state( setup, SETUP_FLUSHED ); /* re-get scene pointer, may have a new scene after flushing */ + (void) scene; scene = lp_setup_get_current_scene(setup); util_copy_framebuffer_state(&setup->fb, fb); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glut: Silence uninitialized variable warning.
Module: Mesa Branch: master Commit: e7660a54423c69fe352e21eedd2a082d9c7aeac0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7660a54423c69fe352e21eedd2a082d9c7aeac0 Author: Vinson Lee Date: Sun Feb 14 13:47:58 2010 -0800 glut: Silence uninitialized variable warning. --- src/glut/glx/glut_cmap.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/glut/glx/glut_cmap.c b/src/glut/glx/glut_cmap.c index e8d9e1f..e6cb742 100644 --- a/src/glut/glx/glut_cmap.c +++ b/src/glut/glx/glut_cmap.c @@ -348,7 +348,7 @@ __glutEstablishColormapsProperty(GLUTwindow * window) Window *winlist; Colormap *cmaplist; Status status; - int maxcmaps, num; + int maxcmaps, num, i; assert(!window->parent); maxcmaps = MaxCmapsOfScreen(ScreenOfDisplay(__glutDisplay, @@ -357,6 +357,9 @@ __glutEstablishColormapsProperty(GLUTwindow * window) and cmaplist, but we could. */ winlist = (Window *) malloc(maxcmaps * sizeof(Window)); cmaplist = (Colormap *) malloc(maxcmaps * sizeof(Colormap)); + for (i = 0; i < maxcmaps; i++) { +cmaplist[i] = 0; + } num = findColormaps(window, winlist, cmaplist, 0, maxcmaps); if (num < 2) { /* Property no longer needed; remove it. */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (gallium-sw-api): wip
Module: Mesa Branch: gallium-sw-api Commit: b1cf4eee7f2177fc2611ac0795a9a3ce15287f5d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1cf4eee7f2177fc2611ac0795a9a3ce15287f5d Author: Keith Whitwell Date: Sun Feb 14 21:11:16 2010 + wip --- src/gallium/drivers/llvmpipe/lp_screen.c |7 + src/gallium/drivers/softpipe/sp_context.c |1 - src/gallium/drivers/softpipe/sp_draw_arrays.c |1 - src/gallium/drivers/softpipe/sp_screen.c | 46 ++- src/gallium/drivers/softpipe/sp_screen.h | 19 + src/gallium/drivers/softpipe/sp_screen_buffer.c| 119 ++ src/gallium/drivers/softpipe/sp_texture.c | 20 - src/gallium/drivers/softpipe/sp_winsys.c | 245 --- src/gallium/drivers/softpipe/sp_winsys.h | 20 +- src/gallium/include/state_tracker/xm_winsys.h | 38 ++- src/gallium/state_trackers/egl/x11/native_ximage.c |3 +- src/gallium/state_trackers/egl/x11/sw_winsys.c | 231 --- src/gallium/state_trackers/egl/x11/sw_winsys.h | 40 -- src/gallium/state_trackers/glx/xlib/xm_driver.c| 427 src/gallium/winsys/xlib/xlib_softpipe.c| 371 +- 15 files changed, 642 insertions(+), 946 deletions(-) Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=b1cf4eee7f2177fc2611ac0795a9a3ce15287f5d ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (gallium-sw-api): trace: add missing files
Module: Mesa Branch: gallium-sw-api Commit: b4589471c32468c34243974a2643694ef987ccc0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4589471c32468c34243974a2643694ef987ccc0 Author: Keith Whitwell Date: Sun Feb 14 13:59:56 2010 + trace: add missing files --- src/gallium/drivers/trace/Makefile |2 +- src/gallium/drivers/trace/SConscript |2 +- src/gallium/drivers/trace/tr_xm.c| 118 ++ src/gallium/drivers/trace/tr_xm.h| 35 ++ src/gallium/winsys/xlib/xlib.c |2 +- 5 files changed, 156 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/trace/Makefile b/src/gallium/drivers/trace/Makefile index ab421f0..aa0b2cc 100644 --- a/src/gallium/drivers/trace/Makefile +++ b/src/gallium/drivers/trace/Makefile @@ -12,7 +12,7 @@ C_SOURCES = \ tr_state.c \ tr_rbug.c \ tr_drm.c \ - tr_x11.c \ + tr_xm.c \ tr_texture.c include ../../Makefile.template diff --git a/src/gallium/drivers/trace/SConscript b/src/gallium/drivers/trace/SConscript index f208ae6..9608227 100644 --- a/src/gallium/drivers/trace/SConscript +++ b/src/gallium/drivers/trace/SConscript @@ -8,7 +8,7 @@ trace = env.ConvenienceLibrary( 'tr_buffer.c', 'tr_context.c', 'tr_drm.c', -'tr_x11.c', +'tr_xm.c', 'tr_dump.c', 'tr_dump_state.c', 'tr_screen.c', diff --git a/src/gallium/drivers/trace/tr_xm.c b/src/gallium/drivers/trace/tr_xm.c new file mode 100644 index 000..6fdb3c6 --- /dev/null +++ b/src/gallium/drivers/trace/tr_xm.c @@ -0,0 +1,118 @@ +/** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **/ + +#include "state_tracker/xm_winsys.h" + +#include "util/u_memory.h" +#include "trace/tr_xm.h" +#include "trace/tr_screen.h" +#include "trace/tr_context.h" +#include "trace/tr_buffer.h" +#include "trace/tr_texture.h" + +struct trace_xm_driver +{ + struct xm_driver base; + + struct xm_driver *driver; +}; + +static INLINE struct trace_xm_driver * +trace_xm_driver(struct xm_driver *_driver) +{ + return (struct trace_xm_driver *)_driver; +} + +static struct pipe_screen * +trace_xm_create_screen(struct xm_driver *_driver) +{ + struct trace_xm_driver *tr_driver = trace_xm_driver(_driver); + struct xm_driver *driver = tr_driver->driver; + struct pipe_screen *screen; + + /* TODO trace call */ + + screen = driver->create_screen(driver); + + return trace_screen_create(screen); +} + + +static void +trace_xm_display_surface(struct xm_driver *_driver, +struct xmesa_buffer *buffer, +struct pipe_surface *_surface) +{ + struct trace_xm_driver *tr_driver = trace_xm_driver(_driver); + struct trace_surface *tr_surface = trace_surface(_surface); + struct xm_driver *driver = tr_driver->driver; + struct pipe_surface *surface = tr_surface->surface; + + /* TODO trace call */ + + driver->display_surface(driver, buffer, surface); +} + + +static void +trace_xm_destroy(struct xm_driver *_driver) +{ + struct trace_xm_driver *tr_driver = trace_xm_driver(_driver); + struct xm_driver *driver = tr_driver->driver; + + if (driver->destroy) + driver->destroy(driver); + + free(tr_driver); +} + +struct xm_driver * +trace_xm_create(struct xm_driver *driver) +{ + struct trace_xm_driver *tr_driver; + + if (!driver) + goto error; + + if (!trace_enabled()) + goto error; + + tr_driver = CALLOC_STRUCT(trace_xm_driver); + + if (!tr_driver) + goto error; + + tr_driver->base.create_screen = trace_xm_create_screen; + tr_driver->base.display_surface = trace_xm_display_surface; + tr_driver->base.destroy = t
Mesa (gallium-sw-api): gallium: clarify sw driver api
Module: Mesa Branch: gallium-sw-api Commit: b7ca47665c90c9911c540fb9deff06cd75b2203a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7ca47665c90c9911c540fb9deff06cd75b2203a Author: Keith Whitwell Date: Sun Feb 14 23:22:40 2010 + gallium: clarify sw driver api Seem to be gravitating to a design where a slightly trimmed llvmpipe winsys struct is passed to software drivers at create_screen(). This keeps the existing flow in the software drivers, but differs from the way display targets and textures are associated with each other in the DRI2 world. For the moment at least it seems like we will be creating display target textures in very different ways in software vs. hardware drivers. --- src/gallium/include/state_tracker/xm_winsys.h | 106 + 1 files changed, 91 insertions(+), 15 deletions(-) diff --git a/src/gallium/include/state_tracker/xm_winsys.h b/src/gallium/include/state_tracker/xm_winsys.h index b45c4b3..c928be0 100644 --- a/src/gallium/include/state_tracker/xm_winsys.h +++ b/src/gallium/include/state_tracker/xm_winsys.h @@ -34,30 +34,106 @@ struct pipe_screen; struct pipe_surface; +/* One unusual thing about the way the dri2 driver api works is that + * textures for scanout are not created through the normal + * pipe_screen::create_texture() method, but rather by converting + * existing DRM buffer handles into pipe_textures by a backdoor in the + * driver, exposed through the winsys and drm_api callbacks. + * + * In the software drivers, we would also like the co-state tracker to + * be involved in creating the backing for scanout textures. This + * allows the knowledge of eg. XShm to be collapsed down to a single + * location, and permits a null or at least tiny software rasterizer + * winsys. + * + * The main question is whether to follow the approach of the DRI2 + * state tracker and ask the driver to turn some pre-existing storage + * into a texture, or to stay closer to the lp_winsys approach and + * have the provide the driver with a set of callbacks allowing it to + * request such storage be created - effectively lifting the provision + * of an lp_winsys into the co-state tracker's responsibilities. + * + * In either case, we still want to have an "sw_driver" abstraction, + * permitting multiple software rasterizers to be handled by generic + * code in the state tracker, and removing the need for separate + * handling of softpipe, llvmpipe and perhaps also cell. + */ + +/** + * Opaque pointer. + */ +struct sw_displaytarget; -struct sw_displaytarget { - void *(*map)( struct sw_displaytarget * ); - void (*unmap)( struct sw_displaytarget * ); - void (*release)( struct sw_displaytarget * ); - enum pipe_format format; - unsigned stride; - unsigned width; - unsigned height; +/** + * This is the interface that sw expects any window system + * hosting it to implement. + * + * sw is for the most part a self sufficient driver. The only thing it + * does not know is how to display a surface. + */ +struct sw_callbacks +{ + void + (*destroy)( struct sw_callbacks *ws ); + + /* No need to query what formats are supported. As the +* implementation of this interface is provided by the state +* tracker, it will already know what formats it supports and will +* not try to created scanout textures in other formats. The +* co-state tracker may still need to query what formats the driver +* can render to, but that does not require a callback in this +* struct. +*/ + + /** +* Allocate storage for a render target. +* +* Often surfaces which are meant to be blitted to the front screen (i.e., +* display targets) must be allocated with special characteristics, memory +* pools, or obtained directly from the windowing system. +* +* This callback is invoked by the pipe_screen when creating a texture marked +* with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying +* storage. +*/ + struct sw_displaytarget * + (*displaytarget_create)( struct sw_callbacks *ws, +enum pipe_format format, +unsigned width, unsigned height, +unsigned alignment, +unsigned *stride ); + + void * + (*displaytarget_map)( struct sw_callbacks *ws, + struct sw_displaytarget *dt, + unsigned flags ); + + void + (*displaytarget_unmap)( struct sw_callbacks *ws, + struct sw_displaytarget *dt ); + + void + (*displaytarget_destroy)( struct sw_callbacks *ws, + struct sw_displaytarget *dt ); + + + /* No displaytarget_display callback -- the co state trackers now +* universally override pipe_screen::flush_frontbuffer() with their +* own code, and that call will at some point be turned to a direct +* state-tracker to co-state-tracker interface. +
Mesa (master): os: Make streams abstract.
Module: Mesa Branch: master Commit: 2b4575f16d24a212b9a43cbd4a9966b3668e4b32 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b4575f16d24a212b9a43cbd4a9966b3668e4b32 Author: José Fonseca Date: Sun Feb 14 16:55:04 2010 + os: Make streams abstract. Also replace windows kernel stream with null implementation. It was severely limited and no easy means to test it now. --- src/gallium/auxiliary/Makefile|2 +- src/gallium/auxiliary/SConscript |2 +- src/gallium/auxiliary/os/os_stream.h | 55 ++-- src/gallium/auxiliary/os/os_stream_null.c | 72 + src/gallium/auxiliary/os/os_stream_stdc.c | 71 ++ src/gallium/auxiliary/os/os_stream_wd.c | 222 - 6 files changed, 160 insertions(+), 264 deletions(-) diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 3f96da6..aea2123 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -50,7 +50,7 @@ C_SOURCES = \ indices/u_unfilled_gen.c \ os/os_misc.c \ os/os_stream_stdc.c \ - os/os_stream_wd.c \ + os/os_stream_null.c \ os/os_time.c \ pipebuffer/pb_buffer_malloc.c \ pipebuffer/pb_bufmgr_alt.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index f226f46..c8a3ecf 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -84,7 +84,7 @@ source = [ 'indices/u_unfilled_gen.c', 'os/os_misc.c', 'os/os_stream_stdc.c', -'os/os_stream_wd.c', +'os/os_stream_null.c', 'os/os_time.c', 'pipebuffer/pb_buffer_fenced.c', 'pipebuffer/pb_buffer_malloc.c', diff --git a/src/gallium/auxiliary/os/os_stream.h b/src/gallium/auxiliary/os/os_stream.h index bf30e65..8232b0f 100644 --- a/src/gallium/auxiliary/os/os_stream.h +++ b/src/gallium/auxiliary/os/os_stream.h @@ -37,25 +37,54 @@ #include "pipe/p_compiler.h" -struct os_stream; - - /** - * Create a stream - * @param filename relative or absolute path (necessary for windows) - * @param optional maximum file size (0 for a growable size). + * OS stream (FILE, socket, etc) abstraction. */ +struct os_stream +{ + void + (*close)(struct os_stream *stream); + + boolean + (*write)(struct os_stream *stream, const void *data, size_t size); + + void + (*flush)(struct os_stream *stream); +}; + + +static INLINE void +os_stream_close(struct os_stream *stream) +{ + stream->close(stream); +} + + +static INLINE boolean +os_stream_write(struct os_stream *stream, const void *data, size_t size) +{ + return stream->write(stream, data, size); +} + + +static INLINE void +os_stream_flush(struct os_stream *stream) +{ + stream->flush(stream); +} + + struct os_stream * -os_stream_create(const char *filename, size_t max_size); +os_file_stream_create(const char *filename); + -boolean -os_stream_write(struct os_stream *stream, const void *data, size_t size); +struct os_stream * +os_null_stream_create(void); -void -os_stream_flush(struct os_stream *stream); -void -os_stream_close(struct os_stream *stream); +#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) +#define os_file_stream_create(_filename) os_null_stream_create() +#endif #endif /* _OS_STREAM_H_ */ diff --git a/src/gallium/auxiliary/os/os_stream_null.c b/src/gallium/auxiliary/os/os_stream_null.c new file mode 100644 index 000..b55ce9c --- /dev/null +++ b/src/gallium/auxiliary/os/os_stream_null.c @@ -0,0 +1,72 @@ +/** + * + * Copyright 2008-2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **/ + +/** + * @file + * Stream implementation for the Windows Display driver. + */ + +#include "os_memory.h" +#include "os_
Mesa (master): util: Update for os_stream changes.
Module: Mesa Branch: master Commit: 323c6f8a2e449c46e1d67c55c45fb243445e575c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=323c6f8a2e449c46e1d67c55c45fb243445e575c Author: José Fonseca Date: Sun Feb 14 16:55:25 2010 + util: Update for os_stream changes. --- src/gallium/auxiliary/util/u_debug.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 688083d..858d52c 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -590,7 +590,7 @@ debug_dump_float_rgba_bmp(const char *filename, bmih.biClrUsed = 0; bmih.biClrImportant = 0; - stream = os_stream_create(filename, bmfh.bfSize); + stream = os_file_stream_create(filename); if(!stream) goto error1; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): trace: Update for os_stream changes.
Module: Mesa Branch: master Commit: dbc7b3da3ec7a2202b1d3b1f08a3d77e195cf3b1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbc7b3da3ec7a2202b1d3b1f08a3d77e195cf3b1 Author: José Fonseca Date: Sun Feb 14 16:55:38 2010 + trace: Update for os_stream changes. --- src/gallium/drivers/trace/tr_dump.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c index 8de451c..1affafd 100644 --- a/src/gallium/drivers/trace/tr_dump.c +++ b/src/gallium/drivers/trace/tr_dump.c @@ -250,7 +250,7 @@ boolean trace_dump_trace_begin() if(!stream) { - stream = os_stream_create(filename, 0); + stream = os_file_stream_create(filename); if(!stream) return FALSE; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): os: Fix bad calloc.
Module: Mesa Branch: master Commit: 33682e551036abcef4fb6d55aab15a25a58c5457 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=33682e551036abcef4fb6d55aab15a25a58c5457 Author: José Fonseca Date: Sun Feb 14 23:03:10 2010 + os: Fix bad calloc. --- src/gallium/auxiliary/os/os_stream_stdc.c | 11 +-- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/src/gallium/auxiliary/os/os_stream_stdc.c b/src/gallium/auxiliary/os/os_stream_stdc.c index 9a62799..9e7ed71 100644 --- a/src/gallium/auxiliary/os/os_stream_stdc.c +++ b/src/gallium/auxiliary/os/os_stream_stdc.c @@ -60,9 +60,6 @@ os_stdc_stream_close(struct os_stream *_stream) { struct os_stdc_stream *stream = os_stdc_stream(_stream); - if(!stream) - return; - fclose(stream->file); free(stream); @@ -74,9 +71,6 @@ os_stdc_stream_write(struct os_stream *_stream, const void *data, size_t size) { struct os_stdc_stream *stream = os_stdc_stream(_stream); - if(!stream) - return FALSE; - return fwrite(data, size, 1, stream->file) == size ? TRUE : FALSE; } @@ -86,9 +80,6 @@ os_stdc_stream_flush(struct os_stream *_stream) { struct os_stdc_stream *stream = os_stdc_stream(_stream); - if(!stream) - return; - fflush(stream->file); } @@ -98,7 +89,7 @@ os_file_stream_create(const char *filename) { struct os_stdc_stream *stream; - stream = (struct os_stdc_stream *)calloc(1, sizeof(struct os_stream)); + stream = (struct os_stdc_stream *)calloc(1, sizeof(*stream)); if(!stream) goto no_stream; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): os: Complement/improve stream inline helpers.
Module: Mesa Branch: master Commit: 78200989d353d979dfea584460c5338e35575aea URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=78200989d353d979dfea584460c5338e35575aea Author: José Fonseca Date: Sun Feb 14 23:04:04 2010 + os: Complement/improve stream inline helpers. --- src/gallium/auxiliary/os/os_stream.h | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/os/os_stream.h b/src/gallium/auxiliary/os/os_stream.h index 8232b0f..2ce5b18 100644 --- a/src/gallium/auxiliary/os/os_stream.h +++ b/src/gallium/auxiliary/os/os_stream.h @@ -56,6 +56,9 @@ struct os_stream static INLINE void os_stream_close(struct os_stream *stream) { + if (!stream) + return; + stream->close(stream); } @@ -63,10 +66,24 @@ os_stream_close(struct os_stream *stream) static INLINE boolean os_stream_write(struct os_stream *stream, const void *data, size_t size) { + if (!stream) + return FALSE; return stream->write(stream, data, size); } +static INLINE boolean +os_stream_write_str(struct os_stream *stream, const char *str) +{ + size_t size; + if (!stream) + return FALSE; + for(size = 0; str[size]; ++size) + ; + return stream->write(stream, str, size); +} + + static INLINE void os_stream_flush(struct os_stream *stream) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): os: Add a growable string stream.
Module: Mesa Branch: master Commit: 64606231b8101316e5ec51a0e71294c0a96b005f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=64606231b8101316e5ec51a0e71294c0a96b005f Author: José Fonseca Date: Sun Feb 14 23:07:21 2010 + os: Add a growable string stream. --- src/gallium/auxiliary/Makefile |1 + src/gallium/auxiliary/SConscript |1 + src/gallium/auxiliary/os/os_stream.h | 11 ++ src/gallium/auxiliary/os/os_stream_str.c | 166 ++ 4 files changed, 179 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index aea2123..34f5df7 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -50,6 +50,7 @@ C_SOURCES = \ indices/u_unfilled_gen.c \ os/os_misc.c \ os/os_stream_stdc.c \ + os/os_stream_str.c \ os/os_stream_null.c \ os/os_time.c \ pipebuffer/pb_buffer_malloc.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index c8a3ecf..680c4a1 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -84,6 +84,7 @@ source = [ 'indices/u_unfilled_gen.c', 'os/os_misc.c', 'os/os_stream_stdc.c', +'os/os_stream_str.c', 'os/os_stream_null.c', 'os/os_time.c', 'pipebuffer/pb_buffer_fenced.c', diff --git a/src/gallium/auxiliary/os/os_stream.h b/src/gallium/auxiliary/os/os_stream.h index 2ce5b18..3423b84 100644 --- a/src/gallium/auxiliary/os/os_stream.h +++ b/src/gallium/auxiliary/os/os_stream.h @@ -99,6 +99,17 @@ struct os_stream * os_null_stream_create(void); +struct os_stream * +os_str_stream_create(size_t initial_size); + + +const char * +os_str_stream_get(struct os_stream *stream); + +char * +os_str_stream_get_and_close(struct os_stream *stream); + + #if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) #define os_file_stream_create(_filename) os_null_stream_create() #endif diff --git a/src/gallium/auxiliary/os/os_stream_str.c b/src/gallium/auxiliary/os/os_stream_str.c new file mode 100644 index 000..a288479 --- /dev/null +++ b/src/gallium/auxiliary/os/os_stream_str.c @@ -0,0 +1,166 @@ +/** + * + * Copyright 2008-2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **/ + +/** + * @file + * Stream implementation based on the Standard C Library. + */ + +#include "pipe/p_config.h" + +#include "os_memory.h" +#include "os_stream.h" + + +struct os_str_stream +{ + struct os_stream base; + + char *str; + + size_t size; + size_t written; +}; + + +static INLINE struct os_str_stream * +os_str_stream(struct os_stream *stream) +{ + return (struct os_str_stream *)stream; +} + + +static void +os_str_stream_close(struct os_stream *_stream) +{ + struct os_str_stream *stream = os_str_stream(_stream); + + os_free(stream->str); + + os_free(stream); +} + + +static boolean +os_str_stream_write(struct os_stream *_stream, const void *data, size_t size) +{ + struct os_str_stream *stream = os_str_stream(_stream); + size_t minimum_size; + boolean ret = TRUE; + + minimum_size = stream->written + size + 1; + if (stream->size < minimum_size) { + size_t new_size = stream->size; + char * new_str; + + do { + new_size *= 2; + } while (new_size < minimum_size); + + new_str = os_realloc(stream->str, stream->size, new_size); + if (new_str) { + stream->str = new_str; + stream->size = new_size; + } + else { + size = stream->size - stream->written - 1; + ret = FALSE; + } + } + + memcpy(stream->str + stream->written, data, size); + stream->written += size; + + return ret; +} + + +static void
Mesa (master): python: Pretty-printing of blend state.
Module: Mesa Branch: master Commit: c2b0484e58765eadb7afc676ecffd80ebc1cbe5b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2b0484e58765eadb7afc676ecffd80ebc1cbe5b Author: José Fonseca Date: Sun Feb 14 23:24:08 2010 + python: Pretty-printing of blend state. --- src/gallium/state_trackers/python/gallium.i |4 +++- src/gallium/state_trackers/python/p_state.i | 16 2 files changed, 19 insertions(+), 1 deletions(-) diff --git a/src/gallium/state_trackers/python/gallium.i b/src/gallium/state_trackers/python/gallium.i index d45c8bb..ffb084e 100644 --- a/src/gallium/state_trackers/python/gallium.i +++ b/src/gallium/state_trackers/python/gallium.i @@ -41,13 +41,15 @@ #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_shader_tokens.h" -#include "cso_cache/cso_context.h" +#include "os/os_stream.h" #include "util/u_inlines.h" #include "util/u_draw_quad.h" #include "util/u_tile.h" #include "util/u_math.h" #include "util/u_format.h" +#include "util/u_dump.h" #include "util/u_memory.h" +#include "cso_cache/cso_context.h" #include "tgsi/tgsi_text.h" #include "tgsi/tgsi_dump.h" diff --git a/src/gallium/state_trackers/python/p_state.i b/src/gallium/state_trackers/python/p_state.i index 318fe1c..b80e46b 100644 --- a/src/gallium/state_trackers/python/p_state.i +++ b/src/gallium/state_trackers/python/p_state.i @@ -58,6 +58,22 @@ }; +%extend pipe_blend_state +{ + %cstring_output_allocate_size(char **STRING, int *LENGTH, os_free(*$1)); + void __str__(char **STRING, int *LENGTH) + { + struct os_stream *stream; + + stream = os_str_stream_create(1); + util_dump_blend_state(stream, $self); + + *STRING = os_str_stream_get_and_close(stream); + *LENGTH = strlen(*STRING); + } +}; + + %extend pipe_framebuffer_state { pipe_framebuffer_state(void) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): util: Helper functions to dump all state objects.
Module: Mesa Branch: master Commit: 165b824343e5b416f8dec16f744ffaf39aea URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=165b824343e5b416f8dec16f744ffaf39aea Author: José Fonseca Date: Sun Feb 14 23:20:42 2010 + util: Helper functions to dump all state objects. --- src/gallium/auxiliary/Makefile|1 + src/gallium/auxiliary/SConscript |1 + src/gallium/auxiliary/util/u_dump.h | 88 src/gallium/auxiliary/util/u_dump_state.c | 699 + 4 files changed, 789 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 34f5df7..7e4335f 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -95,6 +95,7 @@ C_SOURCES = \ util/u_debug_symbol.c \ util/u_debug_stack.c \ util/u_dump_defines.c \ + util/u_dump_state.c \ util/u_bitmask.c \ util/u_blit.c \ util/u_blitter.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index 680c4a1..e13ac91 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -136,6 +136,7 @@ source = [ 'util/u_debug_stack.c', 'util/u_debug_symbol.c', 'util/u_dump_defines.c', +'util/u_dump_state.c', 'util/u_dl.c', 'util/u_draw_quad.c', 'util/u_format.c', diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h index ddccc54..cad0b35 100644 --- a/src/gallium/auxiliary/util/u_dump.h +++ b/src/gallium/auxiliary/util/u_dump.h @@ -48,6 +48,17 @@ extern "C" { #define UTIL_DUMP_INVALID_NAME "" +struct os_stream; + + +/* + * p_defines.h + * + * XXX: These functions don't really dump anything -- just translate into + * strings so a verb better than "dump" should be used instead, in order to + * free up the namespace to the true dumper functions. + */ + const char * util_dump_blend_factor(unsigned value, boolean shortened); @@ -70,6 +81,83 @@ const char * util_dump_tex_filter(unsigned value, boolean shortened); +/* + * p_state.h, through an os_stream + */ + +void +util_dump_template(struct os_stream *stream, + const struct pipe_texture *templat); + +void +util_dump_rasterizer_state(struct os_stream *stream, + const struct pipe_rasterizer_state *state); + +void +util_dump_poly_stipple(struct os_stream *stream, + const struct pipe_poly_stipple *state); + +void +util_dump_viewport_state(struct os_stream *stream, + const struct pipe_viewport_state *state); + +void +util_dump_scissor_state(struct os_stream *stream, +const struct pipe_scissor_state *state); + +void +util_dump_clip_state(struct os_stream *stream, + const struct pipe_clip_state *state); + +void +util_dump_shader_state(struct os_stream *stream, + const struct pipe_shader_state *state); + +void +util_dump_depth_stencil_alpha_state(struct os_stream *stream, +const struct pipe_depth_stencil_alpha_state *state); + +void +util_dump_rt_blend_state(struct os_stream *stream, + const struct pipe_rt_blend_state *state); + +void +util_dump_blend_state(struct os_stream *stream, + const struct pipe_blend_state *state); + +void +util_dump_blend_color(struct os_stream *stream, + const struct pipe_blend_color *state); + +void +util_dump_stencil_ref(struct os_stream *stream, + const struct pipe_stencil_ref *state); + +void +util_dump_framebuffer_state(struct os_stream *stream, +const struct pipe_framebuffer_state *state); + +void +util_dump_sampler_state(struct os_stream *stream, +const struct pipe_sampler_state *state); + +void +util_dump_surface(struct os_stream *stream, + const struct pipe_surface *state); + +void +util_dump_transfer(struct os_stream *stream, + const struct pipe_transfer *state); + +void +util_dump_vertex_buffer(struct os_stream *stream, +const struct pipe_vertex_buffer *state); + +void +util_dump_vertex_element(struct os_stream *stream, + const struct pipe_vertex_element *state); + + /* FIXME: Move the other debug_dump_xxx functions out of u_debug.h into here. */ diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c new file mode 100644 index 000..5ba9136 --- /dev/null +++ b/src/gallium/auxiliary/util/u_dump_state.c @@ -0,0 +1,699 @@ +/** + * + * Copyright 2008-2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (t
Mesa (master): trace: No need to dump reference counts.
Module: Mesa Branch: master Commit: d422310498f10bcf59c69faf04d8d4588303efc0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d422310498f10bcf59c69faf04d8d4588303efc0 Author: José Fonseca Date: Sun Feb 14 23:25:01 2010 + trace: No need to dump reference counts. --- src/gallium/drivers/trace/tr_dump_state.c | 13 - 1 files changed, 0 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index 7cbf705..ee6a6e7 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -44,17 +44,6 @@ void trace_dump_format(enum pipe_format format) } -static void trace_dump_reference(const struct pipe_reference *reference) -{ - if (!trace_dumping_enabled_locked()) - return; - - trace_dump_struct_begin("pipe_reference"); - trace_dump_member(int, reference, count); - trace_dump_struct_end(); -} - - void trace_dump_template(const struct pipe_texture *templat) { if (!trace_dumping_enabled_locked()) @@ -447,8 +436,6 @@ void trace_dump_surface(const struct pipe_surface *state) trace_dump_struct_begin("pipe_surface"); - trace_dump_reference(&state->reference); - trace_dump_member(format, state, format); trace_dump_member(uint, state, width); trace_dump_member(uint, state, height); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): util: Avoid dumping masked state. Other minor improvements.
Module: Mesa Branch: master Commit: d70c76907519592b723df915e8a71a7bf88c1197 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d70c76907519592b723df915e8a71a7bf88c1197 Author: José Fonseca Date: Sun Feb 14 23:54:22 2010 + util: Avoid dumping masked state. Other minor improvements. --- src/gallium/auxiliary/util/u_dump.h |5 ++ src/gallium/auxiliary/util/u_dump_state.c | 66 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h index cad0b35..379f18e 100644 --- a/src/gallium/auxiliary/util/u_dump.h +++ b/src/gallium/auxiliary/util/u_dump.h @@ -51,6 +51,11 @@ extern "C" { struct os_stream; +/* Duplicated here for convenience */ +extern struct os_stream * +os_log_stream; + + /* * p_defines.h * diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c index 5ba9136..eaf4ec9 100644 --- a/src/gallium/auxiliary/util/u_dump_state.c +++ b/src/gallium/auxiliary/util/u_dump_state.c @@ -450,8 +450,10 @@ util_dump_depth_stencil_alpha_state(struct os_stream *stream, const struct pipe_ util_dump_member_begin(stream, "depth"); util_dump_struct_begin(stream, "pipe_depth_state"); util_dump_member(stream, bool, &state->depth, enabled); - util_dump_member(stream, bool, &state->depth, writemask); - util_dump_member(stream, uint, &state->depth, func); + if (state->depth.enabled) { + util_dump_member(stream, bool, &state->depth, writemask); + util_dump_member(stream, enum_func, &state->depth, func); + } util_dump_struct_end(stream); util_dump_member_end(stream); @@ -461,12 +463,14 @@ util_dump_depth_stencil_alpha_state(struct os_stream *stream, const struct pipe_ util_dump_elem_begin(stream); util_dump_struct_begin(stream, "pipe_stencil_state"); util_dump_member(stream, bool, &state->stencil[i], enabled); - util_dump_member(stream, enum_func, &state->stencil[i], func); - util_dump_member(stream, uint, &state->stencil[i], fail_op); - util_dump_member(stream, uint, &state->stencil[i], zpass_op); - util_dump_member(stream, uint, &state->stencil[i], zfail_op); - util_dump_member(stream, uint, &state->stencil[i], valuemask); - util_dump_member(stream, uint, &state->stencil[i], writemask); + if (state->stencil[i].enabled) { + util_dump_member(stream, enum_func, &state->stencil[i], func); + util_dump_member(stream, uint, &state->stencil[i], fail_op); + util_dump_member(stream, uint, &state->stencil[i], zpass_op); + util_dump_member(stream, uint, &state->stencil[i], zfail_op); + util_dump_member(stream, uint, &state->stencil[i], valuemask); + util_dump_member(stream, uint, &state->stencil[i], writemask); + } util_dump_struct_end(stream); util_dump_elem_end(stream); } @@ -476,8 +480,10 @@ util_dump_depth_stencil_alpha_state(struct os_stream *stream, const struct pipe_ util_dump_member_begin(stream, "alpha"); util_dump_struct_begin(stream, "pipe_alpha_state"); util_dump_member(stream, bool, &state->alpha, enabled); - util_dump_member(stream, enum_func, &state->alpha, func); - util_dump_member(stream, float, &state->alpha, ref_value); + if (state->alpha.enabled) { + util_dump_member(stream, enum_func, &state->alpha, func); + util_dump_member(stream, float, &state->alpha, ref_value); + } util_dump_struct_end(stream); util_dump_member_end(stream); @@ -490,14 +496,15 @@ util_dump_rt_blend_state(struct os_stream *stream, const struct pipe_rt_blend_st util_dump_struct_begin(stream, "pipe_rt_blend_state"); util_dump_member(stream, uint, state, blend_enable); - - util_dump_member(stream, enum_blend_func, state, rgb_func); - util_dump_member(stream, enum_blend_factor, state, rgb_src_factor); - util_dump_member(stream, enum_blend_factor, state, rgb_dst_factor); - - util_dump_member(stream, enum_blend_func, state, alpha_func); - util_dump_member(stream, enum_blend_factor, state, alpha_src_factor); - util_dump_member(stream, enum_blend_factor, state, alpha_dst_factor); + if (state->blend_enable) { + util_dump_member(stream, enum_blend_func, state, rgb_func); + util_dump_member(stream, enum_blend_factor, state, rgb_src_factor); + util_dump_member(stream, enum_blend_factor, state, rgb_dst_factor); + + util_dump_member(stream, enum_blend_func, state, alpha_func); + util_dump_member(stream, enum_blend_factor, state, alpha_src_factor); + util_dump_member(stream, enum_blend_factor, state, alpha_dst_factor); + } util_dump_member(stream, uint, state, colormask); @@ -519,15 +526,18 @@ util_dump_blend_state(struct os_stream *stream, const struct pipe_blend_state *s util_dump_member(stream, bool, state, dither); util_dump_member(stream, bool, state, logicop_enable); - util_dump_membe
Mesa (master): os: A stream for debug logging.
Module: Mesa Branch: master Commit: 270279ac997e2a7b4e57c122b8ae217195271f72 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=270279ac997e2a7b4e57c122b8ae217195271f72 Author: José Fonseca Date: Sun Feb 14 23:53:42 2010 + os: A stream for debug logging. Just a wrapper around os_log_message. Although it would probably make more sense to be the other way around. Also some comment fixes. --- src/gallium/auxiliary/Makefile|1 + src/gallium/auxiliary/SConscript |1 + src/gallium/auxiliary/os/os_stream.h |4 ++ src/gallium/auxiliary/os/os_stream_log.c | 81 + src/gallium/auxiliary/os/os_stream_null.c |2 +- src/gallium/auxiliary/os/os_stream_str.c |2 +- 6 files changed, 89 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 7e4335f..ff76951 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -49,6 +49,7 @@ C_SOURCES = \ indices/u_indices_gen.c \ indices/u_unfilled_gen.c \ os/os_misc.c \ + os/os_stream_log.c \ os/os_stream_stdc.c \ os/os_stream_str.c \ os/os_stream_null.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index e13ac91..b531ad2 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -83,6 +83,7 @@ source = [ 'indices/u_indices_gen.c', 'indices/u_unfilled_gen.c', 'os/os_misc.c', +'os/os_stream_log.c', 'os/os_stream_stdc.c', 'os/os_stream_str.c', 'os/os_stream_null.c', diff --git a/src/gallium/auxiliary/os/os_stream.h b/src/gallium/auxiliary/os/os_stream.h index 3423b84..693a062 100644 --- a/src/gallium/auxiliary/os/os_stream.h +++ b/src/gallium/auxiliary/os/os_stream.h @@ -99,6 +99,10 @@ struct os_stream * os_null_stream_create(void); +extern struct os_stream * +os_log_stream; + + struct os_stream * os_str_stream_create(size_t initial_size); diff --git a/src/gallium/auxiliary/os/os_stream_log.c b/src/gallium/auxiliary/os/os_stream_log.c new file mode 100644 index 000..7cc2028 --- /dev/null +++ b/src/gallium/auxiliary/os/os_stream_log.c @@ -0,0 +1,81 @@ +/** + * + * Copyright 2008-2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **/ + +/** + * @file + * Debug logging stream implementation. + */ + +#include "os_memory.h" +#include "os_misc.h" +#include "os_stream.h" + + +static void +os_log_stream_close(struct os_stream *stream) +{ + (void)stream; +} + + +static boolean +os_log_stream_write(struct os_stream *stream, const void *data, size_t size) +{ + char *str; + + str = os_malloc(size + 1); + if (!str) + return FALSE; + + memcpy(str, data, size); + str[size] = 0; + + os_log_message(str); + + os_free(str); + + return TRUE; +} + + +static void +os_log_stream_flush(struct os_stream *stream) +{ + (void)stream; +} + + +static struct os_stream +os_log_stream_struct = { + &os_log_stream_close, + &os_log_stream_write, + &os_log_stream_flush +}; + + +struct os_stream * +os_log_stream = &os_log_stream_struct; diff --git a/src/gallium/auxiliary/os/os_stream_null.c b/src/gallium/auxiliary/os/os_stream_null.c index b55ce9c..128c4e8 100644 --- a/src/gallium/auxiliary/os/os_stream_null.c +++ b/src/gallium/auxiliary/os/os_stream_null.c @@ -27,7 +27,7 @@ /** * @file - * Stream implementation for the Windows Display driver. + * Null stream implementation. */ #include "os_memory.h" diff --git a/src/gallium/auxiliary/os/os_stream_str.c b/src/gallium/auxiliary/os/os_stream_str.c index a288479..b5c7270 100644 --- a/src/gallium/auxiliary/os/os_stream_str.c +++ b/src/gallium/
Mesa (master): trace: Fix constant buffer unwrapping.
Module: Mesa Branch: master Commit: 1fc94ab3dffa742ac0197368f0136432954c328f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fc94ab3dffa742ac0197368f0136432954c328f Author: José Fonseca Date: Mon Feb 15 00:19:22 2010 + trace: Fix constant buffer unwrapping. Pointer unwrapping should happen before dump the pointer, so that the real pipe driver pointers are shown, instead of the trace driver's. --- src/gallium/drivers/trace/tr_context.c | 13 - 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 879778b..df40fba 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -835,8 +835,10 @@ trace_context_set_constant_buffer(struct pipe_context *_pipe, struct trace_context *tr_ctx = trace_context(_pipe); struct pipe_context *pipe = tr_ctx->pipe; - if (buffer) + if (buffer) { trace_screen_user_buffer_update(_pipe->screen, buffer); + buffer = trace_buffer_unwrap(tr_ctx, buffer); + } trace_dump_call_begin("pipe_context", "set_constant_buffer"); @@ -845,14 +847,7 @@ trace_context_set_constant_buffer(struct pipe_context *_pipe, trace_dump_arg(uint, index); trace_dump_arg(ptr, buffer); - /* XXX hmm? */ - if (buffer) { - struct pipe_buffer *_buffer; - _buffer = trace_buffer_unwrap(tr_ctx, buffer); - pipe->set_constant_buffer(pipe, shader, index, _buffer); - } else { - pipe->set_constant_buffer(pipe, shader, index, buffer); - } + pipe->set_constant_buffer(pipe, shader, index, buffer); trace_dump_call_end(); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): trace: Dump blend state as a binary blob.
Module: Mesa Branch: master Commit: dcdf94c87c087186f963b6e201b2989c61a76ef0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dcdf94c87c087186f963b6e201b2989c61a76ef0 Author: José Fonseca Date: Mon Feb 15 00:22:29 2010 + trace: Dump blend state as a binary blob. Gallium interfaces are too fluid -- XML or not is just too much work trying to accommodate for differences in traces. SWIG generated bindings are also full of quirks, making unmarshalling the XML from too hard. Finally, this is the first step for faster tracing. --- src/gallium/drivers/trace/tr_dump_state.c | 38 + 1 files changed, 1 insertions(+), 37 deletions(-) diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index ee6a6e7..6da186a 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -292,29 +292,8 @@ void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_ trace_dump_struct_end(); } -static void trace_dump_rt_blend_state(const struct pipe_rt_blend_state *state) -{ - trace_dump_struct_begin("pipe_rt_blend_state"); - - trace_dump_member(uint, state, blend_enable); - - trace_dump_member(uint, state, rgb_func); - trace_dump_member(uint, state, rgb_src_factor); - trace_dump_member(uint, state, rgb_dst_factor); - - trace_dump_member(uint, state, alpha_func); - trace_dump_member(uint, state, alpha_src_factor); - trace_dump_member(uint, state, alpha_dst_factor); - - trace_dump_member(uint, state, colormask); - - trace_dump_struct_end(); -} - void trace_dump_blend_state(const struct pipe_blend_state *state) { - unsigned valid_entries = 1; - if (!trace_dumping_enabled_locked()) return; @@ -323,22 +302,7 @@ void trace_dump_blend_state(const struct pipe_blend_state *state) return; } - trace_dump_struct_begin("pipe_blend_state"); - - trace_dump_member(bool, state, dither); - - trace_dump_member(bool, state, logicop_enable); - trace_dump_member(uint, state, logicop_func); - - trace_dump_member(bool, state, independent_blend_enable); - - trace_dump_member_begin("rt"); - if (state->independent_blend_enable) - valid_entries = PIPE_MAX_COLOR_BUFS; - trace_dump_struct_array(rt_blend_state, state->rt, valid_entries); - trace_dump_member_end(); - - trace_dump_struct_end(); + trace_dump_bytes(state, sizeof *state); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): python: Reconstruct blend state objects from binary blobs.
Module: Mesa Branch: master Commit: e918519fe916da727eb051367f57b26dbd9ec870 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e918519fe916da727eb051367f57b26dbd9ec870 Author: José Fonseca Date: Mon Feb 15 00:22:59 2010 + python: Reconstruct blend state objects from binary blobs. --- src/gallium/state_trackers/python/p_state.i | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/gallium/state_trackers/python/p_state.i b/src/gallium/state_trackers/python/p_state.i index b80e46b..5afe4d4 100644 --- a/src/gallium/state_trackers/python/p_state.i +++ b/src/gallium/state_trackers/python/p_state.i @@ -60,6 +60,23 @@ %extend pipe_blend_state { + pipe_blend_state(void) + { + return CALLOC_STRUCT(pipe_blend_state); + } + + %cstring_input_binary(const char *STRING, unsigned LENGTH); + pipe_blend_state(const char *STRING, unsigned LENGTH) + { + struct pipe_blend_state *state; + state = CALLOC_STRUCT(pipe_framebuffer_state); + if (state) { + LENGTH = MIN2(sizeof *state, LENGTH); + memcpy(state, STRING, LENGTH); + } + return state; + } + %cstring_output_allocate_size(char **STRING, int *LENGTH, os_free(*$1)); void __str__(char **STRING, int *LENGTH) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): python/retrace: Reconstruct blend state from binary blobs.
Module: Mesa Branch: master Commit: 21fe86b036451bb8352ed6aa0774d49f45fcd417 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=21fe86b036451bb8352ed6aa0774d49f45fcd417 Author: José Fonseca Date: Mon Feb 15 00:25:43 2010 + python/retrace: Reconstruct blend state from binary blobs. --- progs/gallium/python/retrace/interpreter.py |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/progs/gallium/python/retrace/interpreter.py b/progs/gallium/python/retrace/interpreter.py index a34122e..2db71a2 100755 --- a/progs/gallium/python/retrace/interpreter.py +++ b/progs/gallium/python/retrace/interpreter.py @@ -376,6 +376,9 @@ class Context(Object): pass def create_blend_state(self, state): +if isinstance(state, str): +state = gallium.Blend(state) +sys.stdout.write('\t%s\n' % state) return state def bind_blend_state(self, state): ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (gallium-sw-api): drm/swrast: Kill
Module: Mesa Branch: gallium-sw-api Commit: 0a03371a0b4c85d1272aeb8a6b680c069395e6d5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a03371a0b4c85d1272aeb8a6b680c069395e6d5 Author: Jakob Bornecrantz Date: Mon Feb 15 01:51:35 2010 + drm/swrast: Kill --- src/gallium/winsys/drm/swrast/Makefile | 12 src/gallium/winsys/drm/swrast/core/Makefile| 10 -- .../winsys/drm/swrast/core/swrast_drm_api.c| 13 - src/gallium/winsys/drm/swrast/egl/Makefile | 12 src/gallium/winsys/drm/swrast/egl/dummy.c |1 - 5 files changed, 0 insertions(+), 48 deletions(-) diff --git a/src/gallium/winsys/drm/swrast/Makefile b/src/gallium/winsys/drm/swrast/Makefile deleted file mode 100644 index 363b895..000 --- a/src/gallium/winsys/drm/swrast/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# src/gallium/winsys/drm/swrast/Makefile -TOP = ../../../../.. -include $(TOP)/configs/current - -SUBDIRS = core $(GALLIUM_STATE_TRACKERS_DIRS) - -default install clean: - @for dir in $(SUBDIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) $@) || exit 1; \ - fi \ - done diff --git a/src/gallium/winsys/drm/swrast/core/Makefile b/src/gallium/winsys/drm/swrast/core/Makefile deleted file mode 100644 index 93931ae..000 --- a/src/gallium/winsys/drm/swrast/core/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# src/gallium/winsys/drm/swrast/core/Makefile - -TOP = ../../../../../.. -include $(TOP)/configs/current - -LIBNAME = swrastdrm - -C_SOURCES = swrast_drm_api.c - -include ../../../../Makefile.template diff --git a/src/gallium/winsys/drm/swrast/core/swrast_drm_api.c b/src/gallium/winsys/drm/swrast/core/swrast_drm_api.c deleted file mode 100644 index 8c9f80e..000 --- a/src/gallium/winsys/drm/swrast/core/swrast_drm_api.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "state_tracker/drm_api.h" - -static struct drm_api swrast_drm_api = -{ - .name = "swrast", -}; - -struct drm_api * -drm_api_create() -{ - (void) swrast_drm_api; - return NULL; -} diff --git a/src/gallium/winsys/drm/swrast/egl/Makefile b/src/gallium/winsys/drm/swrast/egl/Makefile deleted file mode 100644 index 26fe2d2..000 --- a/src/gallium/winsys/drm/swrast/egl/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TOP = ../../../../../.. -include $(TOP)/configs/current - -EGL_DRIVER_NAME = swrast -EGL_DRIVER_SOURCES = dummy.c -EGL_DRIVER_LIBS = - -EGL_DRIVER_PIPES = \ - $(TOP)/src/gallium/winsys/drm/swrast/core/libswrastdrm.a \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a - -include ../../Makefile.egl diff --git a/src/gallium/winsys/drm/swrast/egl/dummy.c b/src/gallium/winsys/drm/swrast/egl/dummy.c deleted file mode 100644 index 4a1bc28..000 --- a/src/gallium/winsys/drm/swrast/egl/dummy.c +++ /dev/null @@ -1 +0,0 @@ -/* mklib expects at least one object file */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (gallium-sw-api): gallium: More comments about the drm api vs software rasterizers
Module: Mesa Branch: gallium-sw-api Commit: 453dbedd61d143dd81b02479fb3e9778e1bace4d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=453dbedd61d143dd81b02479fb3e9778e1bace4d Author: Jakob Bornecrantz Date: Mon Feb 15 02:09:35 2010 + gallium: More comments about the drm api vs software rasterizers --- src/gallium/include/state_tracker/xm_winsys.h | 24 ++-- 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/gallium/include/state_tracker/xm_winsys.h b/src/gallium/include/state_tracker/xm_winsys.h index 5e2b5ee..07e0447 100644 --- a/src/gallium/include/state_tracker/xm_winsys.h +++ b/src/gallium/include/state_tracker/xm_winsys.h @@ -34,19 +34,31 @@ struct pipe_screen; struct pipe_surface; -/* One unusual thing about the way the dri2 driver api works is that - * textures for scanout are not created through the normal - * pipe_screen::create_texture() method, but rather by converting - * existing DRM buffer handles into pipe_textures by a backdoor in the - * driver, exposed through the winsys and drm_api callbacks. +/* The drm driver stack have two different users st/dri and st/xorg. * + * st/xorg produces both scanouts (primary) and shared (displaytarget) + * textures via the normal pipe_screen::create_texture() callback, + * this follows how the lp_winsys works. However the lp_winsys + * does not deal with the difference between scanouts and displaytargets + * something that needs to be added. st/xorg then uses the drm_api to + * access the handles to textures. + * + * st/dri creates texture via the drm api. + * + * + * With all of the above requirements the drm API needs to be aware that + * a software rasterizer has been layered ontop of it. However this code + * can be completely generic and reused for all drm winsys. + */ + +/* * In the software drivers, we would also like the co-state tracker to * be involved in creating the backing for scanout textures. This * allows the knowledge of eg. XShm to be collapsed down to a single * location, and permits a null or at least tiny software rasterizer * winsys. * - * The main question is whether to follow the approach of the DRI2 + * The main question is whether to follow the approach of the st/dri * state tracker and ask the driver to turn some pre-existing storage * into a texture, or to stay closer to the lp_winsys approach and * have the provide the driver with a set of callbacks allowing it to ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (gallium-sw-api): drm/sw: Wip drm winsys
Module: Mesa Branch: gallium-sw-api Commit: 6ad834b39d6c2ae9ead2e2b00908ad2fa6914897 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ad834b39d6c2ae9ead2e2b00908ad2fa6914897 Author: Jakob Bornecrantz Date: Mon Feb 15 01:52:29 2010 + drm/sw: Wip drm winsys This winsys wraps a drm_api in order abstract away the different memory manager. It also needs help from a pipe screen wrapper. That wrapper is included in the same file but could be moved out into a generic file. --- src/gallium/include/state_tracker/xm_winsys.h |8 + src/gallium/winsys/drm/sw/Makefile| 13 ++ src/gallium/winsys/drm/sw/sw_drm_api.c| 287 + 3 files changed, 308 insertions(+), 0 deletions(-) diff --git a/src/gallium/include/state_tracker/xm_winsys.h b/src/gallium/include/state_tracker/xm_winsys.h index c928be0..5e2b5ee 100644 --- a/src/gallium/include/state_tracker/xm_winsys.h +++ b/src/gallium/include/state_tracker/xm_winsys.h @@ -131,6 +131,14 @@ struct sw_driver { struct pipe_screen *(*create_screen)( struct sw_driver *driver, struct sw_callbacks *callbacks ); + struct pipe_texture *(*wrap_displaytarget)( struct sw_driver *driver, + struct pipe_screen *screen, + struct pipe_texture *templ, + struct sw_displaytarget *dt ); + + struct sw_displaytarget *(*get_displaytarget)( struct sw_driver *driver, + struct pipe_texture *tex ); + /* No call to wrap a display target and create a texture. Hope * that the callback mechanism is sufficient for now. */ diff --git a/src/gallium/winsys/drm/sw/Makefile b/src/gallium/winsys/drm/sw/Makefile new file mode 100644 index 000..2add161 --- /dev/null +++ b/src/gallium/winsys/drm/sw/Makefile @@ -0,0 +1,13 @@ +TOP = ../../../../.. +include $(TOP)/configs/current + +LIBNAME = swdrm + +C_SOURCES = \ + sw_drm_api.c + +LIBRARY_INCLUDES = + +LIBRARY_DEFINES = + +include ../../../Makefile.template diff --git a/src/gallium/winsys/drm/sw/sw_drm_api.c b/src/gallium/winsys/drm/sw/sw_drm_api.c new file mode 100644 index 000..21f44a2 --- /dev/null +++ b/src/gallium/winsys/drm/sw/sw_drm_api.c @@ -0,0 +1,287 @@ +/** + * + * Copyright © 2010 Jakob Bornecrantz + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + **/ + + +#include "pipe/p_format.h" +#include "pipe/p_state.h" + +#include "state_tracker/drm_api.h" +#include "state_tracker/xm_winsys.h" + +#include "util/u_memory.h" +#include "util/u_inlines.h" + +#include "trace/tr_drm.h" + +/* + * XXX The sw_pipe_* code is generic and should be move out. + * + * This code wraps a pipe_screen and exposes a sw_callbacks interface + * for use in software resterizers. This code is used by the DRM based + * winsys to allow access to the drm driver. + * + * We must borrow the whole stack because only the pipe screen knows how + * to decode the content of a buffer. Or how to create a buffer that + * can still be used by drivers using real hardware (as the case is + * with software st/xorg but hw st/dri). + */ + +struct sw_pipe_callbacks +{ + struct sw_callbacks base; + struct pipe_screen *screen; +}; + +struct sw_pipe_displatarget +{ + struct pipe_texture *tex; + struct pipe_transfer *transfer; +}; + +static INLINE struct sw_pipe_callbacks * +sw_pipe_callbacks(struct sw_callbacks *swc) +{ + return (struct sw_pipe_callbacks *)swc; +} + +static INLINE struct pipe_texture * +sw_pipe_dt_get_texture(struct sw_displaytarget *dt) +{ + struct sw_pipe_displatarget *swpdt = (struct sw_pipe_displatarget *)dt; + return swpdt->tex; +} + +stat
Mesa (master): r300g: fix the size of constant buffers
Module: Mesa Branch: master Commit: d3d3345cb840bdfb4a0040ca86e8a588e9b68051 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d3d3345cb840bdfb4a0040ca86e8a588e9b68051 Author: Marek Olšák Date: Mon Feb 15 00:04:32 2010 +0100 r300g: fix the size of constant buffers 4 more piglit tests pass, sweet. --- src/gallium/drivers/r300/r300_context.h |3 +-- src/gallium/drivers/r300/r300_screen.c |4 src/gallium/drivers/r300/r300_state.c | 29 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index ac2b08b..1eba8a8 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -155,8 +155,7 @@ struct r300_ztop_state { struct r300_constant_buffer { /* Buffer of constants */ -/* XXX first number should be raised */ -float constants[32][4]; +float constants[256][4]; /* Total number of constants */ unsigned count; }; diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 8e9f51a..b892c08 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -152,6 +152,10 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) } else { return 0; } +case PIPE_CAP_MAX_CONST_BUFFERS: +return 1; +case PIPE_CAP_MAX_CONST_BUFFER_SIZE: +return 256; case PIPE_CAP_INDEP_BLEND_ENABLE: return 0; case PIPE_CAP_INDEP_BLEND_FUNC: diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index b4c8ca4..34bf81c 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1150,7 +1150,9 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, struct pipe_buffer *buf) { struct r300_context* r300 = r300_context(pipe); +struct r300_screen *r300screen = r300_screen(pipe->screen); void *mapped; +int max_size = 0; if (buf == NULL || buf->size == 0 || (mapped = pipe_buffer_map(pipe->screen, buf, PIPE_BUFFER_USAGE_CPU_READ)) == NULL) @@ -1160,6 +1162,33 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, } assert((buf->size % 4 * sizeof(float)) == 0); + +/* Check the size of the constant buffer. */ +switch (shader) { +case PIPE_SHADER_VERTEX: +max_size = 256; +break; +case PIPE_SHADER_FRAGMENT: +if (r300screen->caps->is_r500) { +max_size = 256; +/* XXX Implement emission of r400's extended constant buffer. */ +/*} else if (r300screen->caps->is_r400) { +max_size = 64;*/ +} else { +max_size = 32; +} +break; +default: +assert(0); +} + +/* XXX Subtract immediates and RC_STATE_* variables. */ +if (buf->size > (sizeof(float) * 4 * max_size)) { +debug_printf("r300: Max size of the constant buffer is " + "%i*4 floats.\n", max_size); +abort(); +} + memcpy(r300->shader_constants[shader].constants, mapped, buf->size); r300->shader_constants[shader].count = buf->size / (4 * sizeof(float)); pipe_buffer_unmap(pipe->screen, buf); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r600: Silence uninitialized variable warnings.
Module: Mesa Branch: master Commit: 7851856a604bf379b34f5c1b1886e9dafa634cbd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7851856a604bf379b34f5c1b1886e9dafa634cbd Author: Vinson Lee Date: Sun Feb 14 20:49:09 2010 -0800 r600: Silence uninitialized variable warnings. --- src/mesa/drivers/dri/r600/r700_assembler.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index f67f882..d0059fa 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -830,6 +830,8 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here { //TODO : mini fetch + mega_fetch_count = 0; + is_mega_fetch_flag = 0; } else { @@ -922,6 +924,8 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here { //TODO : mini fetch + mega_fetch_count = 0; + is_mega_fetch_flag = 0; } else { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl: use new program cloning functions
Module: Mesa Branch: master Commit: 7a38d8d9a52a69884e73bc7dc7a43c58453b2c1a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a38d8d9a52a69884e73bc7dc7a43c58453b2c1a Author: Brian Paul Date: Sun Feb 14 18:46:37 2010 -0700 glsl: use new program cloning functions --- src/mesa/shader/slang/slang_link.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index df524ce..75b0022 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -773,7 +773,7 @@ _slang_link(GLcontext *ctx, _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL); if (vertProg) { struct gl_vertex_program *linked_vprog = - vertex_program(_mesa_clone_program(ctx, &vertProg->Base)); + _mesa_clone_vertex_program(ctx, vertProg); shProg->VertexProgram = linked_vprog; /* refcount OK */ /* vertex program ID not significant; just set Id for debugging purposes */ shProg->VertexProgram->Base.Id = shProg->Name; @@ -783,7 +783,7 @@ _slang_link(GLcontext *ctx, _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL); if (fragProg) { struct gl_fragment_program *linked_fprog = - fragment_program(_mesa_clone_program(ctx, &fragProg->Base)); + _mesa_clone_fragment_program(ctx, fragProg); shProg->FragmentProgram = linked_fprog; /* refcount OK */ /* vertex program ID not significant; just set Id for debugging purposes */ shProg->FragmentProgram->Base.Id = shProg->Name; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: added _mesa_clone_vertex/fragment_program()
Module: Mesa Branch: master Commit: 848835a3d8889d716c05985b42fe740e9de81c15 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=848835a3d8889d716c05985b42fe740e9de81c15 Author: Brian Paul Date: Sun Feb 14 19:09:04 2010 -0700 mesa: added _mesa_clone_vertex/fragment_program() To reduce casting elsewhere... --- src/mesa/shader/program.h | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index 0187a2c..af9f417 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -108,6 +108,22 @@ _mesa_reference_fragprog(GLcontext *ctx, extern struct gl_program * _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog); +static INLINE struct gl_vertex_program * +_mesa_clone_vertex_program(GLcontext *ctx, + const struct gl_vertex_program *prog) +{ + return (struct gl_vertex_program *) _mesa_clone_program(ctx, &prog->Base); +} + + +static INLINE struct gl_fragment_program * +_mesa_clone_fragment_program(GLcontext *ctx, + const struct gl_fragment_program *prog) +{ + return (struct gl_fragment_program *) _mesa_clone_program(ctx, &prog->Base); +} + + extern GLboolean _mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r600: use new program cloning functions
Module: Mesa Branch: master Commit: 630b83be84f0bd9ce15cf9f09250a462bac2aa8b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=630b83be84f0bd9ce15cf9f09250a462bac2aa8b Author: Brian Paul Date: Sun Feb 14 18:46:56 2010 -0700 r600: use new program cloning functions --- src/mesa/drivers/dri/r600/r700_vertprog.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 618f7e1..46481cd 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -308,7 +308,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, unsigned int i; vp = _mesa_calloc(sizeof(*vp)); - vp->mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, &mesa_vp->Base); + vp->mesa_program = _mesa_clone_vertex_program(ctx, mesa_vp); if (mesa_vp->IsPositionInvariant) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300: use new program cloning functions
Module: Mesa Branch: master Commit: 79d4954f4f414d4ad047c17e684d566c0cd7442f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=79d4954f4f414d4ad047c17e684d566c0cd7442f Author: Brian Paul Date: Sun Feb 14 18:46:51 2010 -0700 r300: use new program cloning functions --- src/mesa/drivers/dri/r300/r300_vertprog.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index e6fa57d..3a8d5fb 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -234,7 +234,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, struct r300_vertex_program_compiler compiler; vp = _mesa_calloc(sizeof(*vp)); - vp->Base = (struct gl_vertex_program *) _mesa_clone_program(ctx, &mesa_vp->Base); + vp->Base = _mesa_clone_vertex_program(ctx, mesa_vp); _mesa_memcpy(&vp->key, wanted_key, sizeof(vp->key)); rc_init(&compiler.Base); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/mesa: move per-fragment shader fields to local vars
Module: Mesa Branch: master Commit: e90bc2e2ce5b8d835d7dcd069071f71fa032ebe2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e90bc2e2ce5b8d835d7dcd069071f71fa032ebe2 Author: Brian Paul Date: Sun Feb 14 20:47:34 2010 -0700 st/mesa: move per-fragment shader fields to local vars --- src/mesa/state_tracker/st_program.c | 36 ++ src/mesa/state_tracker/st_program.h |3 -- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 6a86cf9..7ce3938 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -278,12 +278,14 @@ st_translate_fragment_program(struct st_context *st, struct pipe_context *pipe = st->pipe; GLuint outputMapping[FRAG_RESULT_MAX]; GLuint inputMapping[FRAG_ATTRIB_MAX]; - GLuint interpMode[16]; /* XXX size? */ + GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */ GLuint attr; enum pipe_error error; const GLbitfield inputsRead = stfp->Base.Base.InputsRead; struct ureg_program *ureg; + ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; + ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; uint fs_num_inputs = 0; ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; @@ -301,28 +303,28 @@ st_translate_fragment_program(struct st_context *st, switch (attr) { case FRAG_ATTRIB_WPOS: -stfp->input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; -stfp->input_semantic_index[slot] = 0; +input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; +input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_LINEAR; break; case FRAG_ATTRIB_COL0: -stfp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; -stfp->input_semantic_index[slot] = 0; +input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; +input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_LINEAR; break; case FRAG_ATTRIB_COL1: -stfp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; -stfp->input_semantic_index[slot] = 1; +input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; +input_semantic_index[slot] = 1; interpMode[slot] = TGSI_INTERPOLATE_LINEAR; break; case FRAG_ATTRIB_FOGC: -stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG; -stfp->input_semantic_index[slot] = 0; +input_semantic_name[slot] = TGSI_SEMANTIC_FOG; +input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; case FRAG_ATTRIB_FACE: -stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FACE; -stfp->input_semantic_index[slot] = 0; +input_semantic_name[slot] = TGSI_SEMANTIC_FACE; +input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; break; case FRAG_ATTRIB_PNTC: @@ -331,8 +333,8 @@ st_translate_fragment_program(struct st_context *st, * shader input is the point coord attribute so that it can set * up the right vertex attribute values. */ -stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; -stfp->input_semantic_index[slot] = 0; +input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; +input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; @@ -365,8 +367,8 @@ st_translate_fragment_program(struct st_context *st, * readability of the generated TGSI. */ assert(attr >= FRAG_ATTRIB_TEX0); -stfp->input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); -stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; +input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); +input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; } @@ -428,8 +430,8 @@ st_translate_fragment_program(struct st_context *st, /* inputs */ fs_num_inputs, inputMapping, -stfp->input_semantic_name, -stfp->input_semantic_index, +input_semantic_name, +input_semantic_index, interpMode, /* outputs */ fs_num_outputs, diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 1fd25bc..1b3f75c 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/s
Mesa (master): st/mesa: use _mesa_clone_fragment_program()
Module: Mesa Branch: master Commit: 33681bcf5672ed7b852c5d88ba3d28a8349d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=33681bcf5672ed7b852c5d88ba3d28a8349d Author: Brian Paul Date: Sun Feb 14 18:50:49 2010 -0700 st/mesa: use _mesa_clone_fragment_program() --- src/mesa/state_tracker/st_cb_drawpixels.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index af2647f..fe28123 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -113,7 +113,7 @@ combined_drawpix_fragment_program(GLcontext *ctx) */ if (is_passthrough_program(&st->fp->Base)) { stfp = (struct st_fragment_program *) -_mesa_clone_program(ctx, &st->pixel_xfer.program->Base.Base); +_mesa_clone_fragment_program(ctx, &st->pixel_xfer.program->Base); } else { #if 0 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/mesa: minor assorted clean-ups
Module: Mesa Branch: master Commit: 08cfe3ab421491644cf1bebaf47e8bc897e495c5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=08cfe3ab421491644cf1bebaf47e8bc897e495c5 Author: Brian Paul Date: Sun Feb 14 21:54:17 2010 -0700 st/mesa: minor assorted clean-ups --- src/mesa/state_tracker/st_cb_drawpixels.c | 20 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 90bcc85..36c0a2b 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -235,8 +235,8 @@ make_fragment_shader_z(struct st_context *st) * vertex position and texcoord (and optionally, color). */ static void * -st_make_passthrough_vertex_shader(struct st_context *st, - GLboolean passColor) +make_passthrough_vertex_shader(struct st_context *st, + GLboolean passColor) { if (!st->drawpix.vert_shaders[passColor]) { struct ureg_program *ureg = @@ -272,8 +272,12 @@ st_make_passthrough_vertex_shader(struct st_context *st, } +/** + * Return a texture internalFormat for drawing/copying an image + * of the given type. + */ static GLenum -_mesa_base_format(GLenum format) +base_format(GLenum format) { switch (format) { case GL_DEPTH_COMPONENT: @@ -308,7 +312,7 @@ make_texture(struct st_context *st, GLenum baseFormat; int ptw, pth; - baseFormat = _mesa_base_format(format); + baseFormat = base_format(format); mformat = st_ChooseTextureFormat(ctx, baseFormat, format, type); assert(mformat); @@ -784,12 +788,12 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, if (format == GL_DEPTH_COMPONENT) { driver_fp = make_fragment_shader_z(st); - driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE); + driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); color = ctx->Current.RasterColor; } else { driver_fp = combined_drawpix_fragment_program(ctx); - driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE); + driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); color = NULL; } @@ -968,14 +972,14 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, rbRead = st_get_color_read_renderbuffer(ctx); color = NULL; driver_fp = combined_drawpix_fragment_program(ctx); - driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE); + driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); } else { assert(type == GL_DEPTH); rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; driver_fp = make_fragment_shader_z(st); - driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE); + driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); } srcFormat = rbRead->texture->format; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/mesa: change some function return types
Module: Mesa Branch: master Commit: f4ded0ea5c156a79a78ea62098fa8f9515adb256 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f4ded0ea5c156a79a78ea62098fa8f9515adb256 Author: Brian Paul Date: Sun Feb 14 21:46:51 2010 -0700 st/mesa: change some function return types --- src/mesa/state_tracker/st_cb_drawpixels.c | 30 ++-- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index fe28123..90bcc85 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -93,8 +93,9 @@ is_passthrough_program(const struct gl_fragment_program *prog) /** * Make fragment shader for glDraw/CopyPixels. This shader is made * by combining the pixel transfer shader with the user-defined shader. + * \return pointer to Gallium driver fragment shader */ -static struct st_fragment_program * +static void * combined_drawpix_fragment_program(GLcontext *ctx) { struct st_context *st = st_context(ctx); @@ -156,7 +157,7 @@ combined_drawpix_fragment_program(GLcontext *ctx) */ st_upload_constants(st, stfp->Base.Base.Parameters, PIPE_SHADER_FRAGMENT); - return stfp; + return stfp->driver_shader; } @@ -164,8 +165,9 @@ combined_drawpix_fragment_program(GLcontext *ctx) * Create fragment shader that does a TEX() instruction to get a Z * value, then writes to FRAG_RESULT_DEPTH. * Pass fragment color through as-is. + * \return pointer to the Gallium driver fragment shader */ -static struct st_fragment_program * +static void * make_fragment_shader_z(struct st_context *st) { GLcontext *ctx = st->ctx; @@ -173,7 +175,7 @@ make_fragment_shader_z(struct st_context *st) GLuint ic = 0; if (st->drawpix.z_shader) { - return st->drawpix.z_shader; + return st->drawpix.z_shader->driver_shader; } /* @@ -223,7 +225,7 @@ make_fragment_shader_z(struct st_context *st) st->drawpix.z_shader = (struct st_fragment_program *) p; st_translate_fragment_program(st, st->drawpix.z_shader); - return st->drawpix.z_shader; + return st->drawpix.z_shader->driver_shader; } @@ -764,8 +766,7 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels) { - struct st_fragment_program *stfp; - void *driver_vp; + void *driver_vp, *driver_fp; struct st_context *st = st_context(ctx); const GLfloat *color; @@ -782,12 +783,12 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, st_validate_state(st); if (format == GL_DEPTH_COMPONENT) { - stfp = make_fragment_shader_z(st); + driver_fp = make_fragment_shader_z(st); driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE); color = ctx->Current.RasterColor; } else { - stfp = combined_drawpix_fragment_program(ctx); + driver_fp = combined_drawpix_fragment_program(ctx); driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE); color = NULL; } @@ -801,7 +802,7 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, pt, driver_vp, -stfp->driver_shader, +driver_fp, color, GL_FALSE); pipe_texture_reference(&pt, NULL); } @@ -919,8 +920,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; struct st_renderbuffer *rbRead; - void *driver_vp; - struct st_fragment_program *stfp; + void *driver_vp, *driver_fp; struct pipe_texture *pt; GLfloat *color; enum pipe_format srcFormat, texFormat; @@ -967,14 +967,14 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (type == GL_COLOR) { rbRead = st_get_color_read_renderbuffer(ctx); color = NULL; - stfp = combined_drawpix_fragment_program(ctx); + driver_fp = combined_drawpix_fragment_program(ctx); driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE); } else { assert(type == GL_DEPTH); rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - stfp = make_fragment_shader_z(st); + driver_fp = make_fragment_shader_z(st); driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE); } @@ -1109,7 +1109,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, pt, driver_vp, - stfp->driver_shader, +
Mesa (master): glx: Silence uninitialized variable warning.
Module: Mesa Branch: master Commit: 86d98fa4a2dfdae75e6ecd9a7e6e73d4183075a0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=86d98fa4a2dfdae75e6ecd9a7e6e73d4183075a0 Author: Vinson Lee Date: Sun Feb 14 21:02:18 2010 -0800 glx: Silence uninitialized variable warning. --- src/glx/dri_glx.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 0ff53c3..f9fe9a2 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -323,6 +323,7 @@ CallCreateNewScreen(Display * dpy, int scrn, __GLXscreenConfigs * psc, framebuffer.base = MAP_FAILED; framebuffer.dev_priv = NULL; + framebuffer.size = 0; if (!XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) { ErrorMessageF("XF86DRIOpenConnection failed\n"); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glu/sgi: Initialize member of class Pool.
Module: Mesa Branch: master Commit: 9867b6eaad0f67f74b3bb98e2c120312117208ba URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9867b6eaad0f67f74b3bb98e2c120312117208ba Author: Vinson Lee Date: Sun Feb 14 21:45:01 2010 -0800 glu/sgi: Initialize member of class Pool. --- src/glu/sgi/libnurbs/internals/bufpool.cc |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/glu/sgi/libnurbs/internals/bufpool.cc b/src/glu/sgi/libnurbs/internals/bufpool.cc index 8cc847a..53ac1a5 100644 --- a/src/glu/sgi/libnurbs/internals/bufpool.cc +++ b/src/glu/sgi/libnurbs/internals/bufpool.cc @@ -60,6 +60,9 @@ Pool::Pool( int _buffersize, int initpoolsize, const char *n ) curblock = 0; freelist = 0; nextfree = 0; +for (int i = 0; i < NBLOCKS; i++) { +blocklist[i] = 0; +} } /*- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glu/sgi: Initialize members of class Curve.
Module: Mesa Branch: master Commit: 53d448657bd300ab68b2869b2fba76a627699baf URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=53d448657bd300ab68b2869b2fba76a627699baf Author: Vinson Lee Date: Sun Feb 14 22:04:59 2010 -0800 glu/sgi: Initialize members of class Curve. --- src/glu/sgi/libnurbs/internals/curve.cc |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/glu/sgi/libnurbs/internals/curve.cc b/src/glu/sgi/libnurbs/internals/curve.cc index 33e2752..27e9e3c 100644 --- a/src/glu/sgi/libnurbs/internals/curve.cc +++ b/src/glu/sgi/libnurbs/internals/curve.cc @@ -85,6 +85,14 @@ Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c ) if( range[1] != ptb ) { Curve lower( *this, ptb, 0 ); } + +for( int i = 0; i < MAXORDER * MAXCOORDS; i++ ) { +cpts[i] = 0; +spts[i] = 0; +} + +stepsize = 0; +minstepsize = 0; } /*-- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glu/sgi: Initialize members of class Curvelist.
Module: Mesa Branch: master Commit: 4bbcc11f4307d2da64d34f6926134b71e1d2c73f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4bbcc11f4307d2da64d34f6926134b71e1d2c73f Author: Vinson Lee Date: Sun Feb 14 22:18:41 2010 -0800 glu/sgi: Initialize members of class Curvelist. --- src/glu/sgi/libnurbs/internals/curvelist.cc |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/glu/sgi/libnurbs/internals/curvelist.cc b/src/glu/sgi/libnurbs/internals/curvelist.cc index da04eff..8f2ee46 100644 --- a/src/glu/sgi/libnurbs/internals/curvelist.cc +++ b/src/glu/sgi/libnurbs/internals/curvelist.cc @@ -59,16 +59,17 @@ Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb ) Curvelist::Curvelist( Curvelist &upper, REAL value ) { -Curvelist &lower = *this; curve = 0; for( Curve *c = upper.curve; c; c = c->next ) curve = new Curve( *c, value, curve ); -lower.range[0] = upper.range[0]; -lower.range[1] = value; -lower.range[2] = value - upper.range[0]; +range[0] = upper.range[0]; +range[1] = value; +range[2] = value - upper.range[0]; upper.range[0] = value; upper.range[2] = upper.range[1] - value; +needsSubdivision = 0; +stepsize = 0; } Curvelist::~Curvelist() ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glu/sgi: Move initialization of members to top of Curve constructor.
Module: Mesa Branch: master Commit: 026d4b5b9129beb463d5ffa4d2ab6b0f73506627 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=026d4b5b9129beb463d5ffa4d2ab6b0f73506627 Author: Vinson Lee Date: Sun Feb 14 22:26:30 2010 -0800 glu/sgi: Move initialization of members to top of Curve constructor. This is a modification of commit 53d448657bd300ab68b2869b2fba76a627699baf. The members cpts and spts are possibly used as arguments later in the constructor. --- src/glu/sgi/libnurbs/internals/curve.cc | 14 ++ 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/glu/sgi/libnurbs/internals/curve.cc b/src/glu/sgi/libnurbs/internals/curve.cc index 27e9e3c..b7c4d4a 100644 --- a/src/glu/sgi/libnurbs/internals/curve.cc +++ b/src/glu/sgi/libnurbs/internals/curve.cc @@ -60,6 +60,12 @@ Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c ) cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT; order = geo->qspec[0].order; stride = MAXCOORDS; +for( int i = 0; i < MAXORDER * MAXCOORDS; i++ ) { +cpts[i] = 0; +spts[i] = 0; +} +stepsize = 0; +minstepsize = 0; REAL *ps = geo->cpts; Quiltspec_ptr qs = geo->qspec; @@ -85,14 +91,6 @@ Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c ) if( range[1] != ptb ) { Curve lower( *this, ptb, 0 ); } - -for( int i = 0; i < MAXORDER * MAXCOORDS; i++ ) { -cpts[i] = 0; -spts[i] = 0; -} - -stepsize = 0; -minstepsize = 0; } /*-- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): draw: Add assert to check input of memcpy.
Module: Mesa Branch: master Commit: 6536cdf1836a302d334f7380d1723e8f0bc396be URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6536cdf1836a302d334f7380d1723e8f0bc396be Author: Vinson Lee Date: Sun Feb 14 22:58:26 2010 -0800 draw: Add assert to check input of memcpy. --- src/gallium/auxiliary/draw/draw_vs.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index 6bdd612..9085838 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -61,6 +61,7 @@ draw_vs_set_constants(struct draw_context *draw, } draw->vs.aligned_constant_storage[slot] = align_malloc(size, 16); } + assert(constants); memcpy((void *)draw->vs.aligned_constant_storage[slot], constants, size); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit