From 4ed1de8b84b587d2be0c0e4ecb6b5f421195f562 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 7 Jul 2009 17:56:12 +0100 Subject: mesa: Report the true face number when flushing. --- src/mesa/state_tracker/st_cb_texture.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 909189f9d3..22685bd5d9 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -950,8 +950,9 @@ st_get_tex_image(GLcontext * ctx, GLenum target, GLint level, /* Image is stored in hardware format in a buffer managed by the * kernel. Need to explicitly map and unmap it. */ + unsigned face = _mesa_tex_target_to_face(target); - st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level, + st_teximage_flush_before_map(ctx->st, stImage->pt, face, level, PIPE_TRANSFER_READ); texImage->Data = st_texture_image_map(ctx->st, stImage, 0, @@ -1080,13 +1081,15 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, * from uploading the buffer under us. */ if (stImage->pt) { + unsigned face = _mesa_tex_target_to_face(target); + if (format == GL_DEPTH_COMPONENT && pf_is_depth_and_stencil(stImage->pt->format)) transfer_usage = PIPE_TRANSFER_READ_WRITE; else transfer_usage = PIPE_TRANSFER_WRITE; - st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level, + st_teximage_flush_before_map(ctx->st, stImage->pt, face, level, transfer_usage); texImage->Data = st_texture_image_map(ctx->st, stImage, zoffset, transfer_usage, @@ -1213,7 +1216,9 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, int y; if (stImage->pt) { - st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level, + unsigned face = _mesa_tex_target_to_face(target); + + st_teximage_flush_before_map(ctx->st, stImage->pt, face, level, PIPE_TRANSFER_WRITE); texImage->Data = st_texture_image_map(ctx->st, stImage, 0, PIPE_TRANSFER_WRITE, -- cgit v1.2.3 From 6ec955efafda961bc7789c22dbde9d3430fc270f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Jul 2009 07:58:22 -0600 Subject: mesa: regenerated enums.c file --- src/mesa/main/enums.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 417cee8fb2..dff5544086 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -948,8 +948,8 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0" "GL_MAX_VARYING_FLOATS\0" "GL_MAX_VARYING_FLOATS_ARB\0" - "GL_MAX_VERTEX_GENERIC_ATTRIBS\0" - "GL_MAX_VERTEX_GENERIC_ATTRIBS_ARB\0" + "GL_MAX_VERTEX_ATTRIBS\0" + "GL_MAX_VERTEX_ATTRIBS_ARB\0" "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0" "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0" "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0" @@ -2772,8 +2772,8 @@ static const enum_elt all_enums[1820] = { 19417, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ { 19452, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ { 19474, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 19500, 0x00008869 }, /* GL_MAX_VERTEX_GENERIC_ATTRIBS */ - { 19522, 0x00008869 }, /* GL_MAX_VERTEX_GENERIC_ATTRIBS_ARB */ + { 19500, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 19522, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ { 19548, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ { 19582, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ { 19620, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ @@ -4733,7 +4733,7 @@ static const unsigned reduced_enums[1319] = 317, /* GL_CURRENT_QUERY */ 1259, /* GL_QUERY_RESULT */ 1261, /* GL_QUERY_RESULT_AVAILABLE */ - 912, /* GL_MAX_VERTEX_GENERIC_ATTRIBS */ + 912, /* GL_MAX_VERTEX_ATTRIBS */ 1778, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ 368, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ 367, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ @@ -5081,6 +5081,7 @@ const char *_mesa_lookup_prim_by_nr( int nr ) } + int _mesa_lookup_enum_by_name( const char *symbol ) { enum_elt * f = NULL; -- cgit v1.2.3 From 9aca6769dfb934e15e848f938b7fb31345a8b3b2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Jul 2009 14:26:42 -0600 Subject: mesa: fix texture border color code for glPopAttrib() The texture object's border color used to be stored as GLchan but it's been GLfloat for a while now. --- src/mesa/main/attrib.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index a609199504..4d85d54bb9 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -849,7 +849,6 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate) /* Restore texture object state for each target */ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { const struct gl_texture_object *obj = NULL; - GLfloat bordColor[4]; GLenum target; obj = &texstate->SavedObj[u][tgt]; @@ -875,12 +874,7 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate) _mesa_BindTexture(target, obj->Name); - bordColor[0] = CHAN_TO_FLOAT(obj->BorderColor[0]); - bordColor[1] = CHAN_TO_FLOAT(obj->BorderColor[1]); - bordColor[2] = CHAN_TO_FLOAT(obj->BorderColor[2]); - bordColor[3] = CHAN_TO_FLOAT(obj->BorderColor[3]); - - _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, bordColor); + _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, obj->BorderColor); _mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, obj->WrapS); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, obj->WrapT); -- cgit v1.2.3 From 6c9d8a6f24db3c947928d72521d5fd544841366e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 14 Jul 2009 16:23:04 +0100 Subject: mesa: don't call getenv every time _mesa_error is called Buggy apps can generate thousands of mesa_error calls. Don't need to keep calling getenv to retreive the same MESA_DEBUG string each time. --- src/mesa/main/imports.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 3fb67083a2..b0e7d9d483 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1081,22 +1081,25 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) void _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) { - const char *debugEnv; - GLboolean debug; + static GLint debug = -1; - debugEnv = _mesa_getenv("MESA_DEBUG"); + /* Check debug environment variable only once: + */ + if (debug == -1) { + const char *debugEnv = _mesa_getenv("MESA_DEBUG"); #ifdef DEBUG - if (debugEnv && _mesa_strstr(debugEnv, "silent")) - debug = GL_FALSE; - else - debug = GL_TRUE; + if (debugEnv && _mesa_strstr(debugEnv, "silent")) + debug = GL_FALSE; + else + debug = GL_TRUE; #else - if (debugEnv) - debug = GL_TRUE; - else - debug = GL_FALSE; + if (debugEnv) + debug = GL_TRUE; + else + debug = GL_FALSE; #endif + } if (debug) { va_list args; -- cgit v1.2.3 From df5f7a676182dc9d1d8c9c995a009b49bac971e8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 14 Jul 2009 16:25:59 +0100 Subject: mesa: remove dead code in _mesa_error Remove early and unused snprintf and where[] string. --- src/mesa/main/imports.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index b0e7d9d483..c35dcf5bd2 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1102,14 +1102,8 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) } if (debug) { - va_list args; - char where[MAXSTRING]; const char *errstr; - va_start( args, fmtString ); - vsnprintf( where, MAXSTRING, fmtString, args ); - va_end( args ); - switch (error) { case GL_NO_ERROR: errstr = "GL_NO_ERROR"; -- cgit v1.2.3 From 59de430de70c38a2fbe30208190f725a2901613c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 14 Jul 2009 16:28:08 +0100 Subject: mesa: split out errorstring switch from _mesa_error Move a chunk of code out of _mesa_error() --- src/mesa/main/imports.c | 62 +++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index c35dcf5bd2..3916c62eda 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1065,6 +1065,31 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) fprintf(stderr, "Please report at bugzilla.freedesktop.org\n"); } +static const char *error_string( GLenum error ) +{ + switch (error) { + case GL_NO_ERROR: + return "GL_NO_ERROR"; + case GL_INVALID_VALUE: + return "GL_INVALID_VALUE"; + case GL_INVALID_ENUM: + return "GL_INVALID_ENUM"; + case GL_INVALID_OPERATION: + return "GL_INVALID_OPERATION"; + case GL_STACK_OVERFLOW: + return "GL_STACK_OVERFLOW"; + case GL_STACK_UNDERFLOW: + return "GL_STACK_UNDERFLOW"; + case GL_OUT_OF_MEMORY: + return "GL_OUT_OF_MEMORY"; + case GL_TABLE_TOO_LARGE: + return "GL_TABLE_TOO_LARGE"; + case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: + return "GL_INVALID_FRAMEBUFFER_OPERATION"; + default: + return "unknown"; + } +} /** * Record an OpenGL state error. These usually occur when the user @@ -1102,41 +1127,6 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) } if (debug) { - const char *errstr; - - switch (error) { - case GL_NO_ERROR: - errstr = "GL_NO_ERROR"; - break; - case GL_INVALID_VALUE: - errstr = "GL_INVALID_VALUE"; - break; - case GL_INVALID_ENUM: - errstr = "GL_INVALID_ENUM"; - break; - case GL_INVALID_OPERATION: - errstr = "GL_INVALID_OPERATION"; - break; - case GL_STACK_OVERFLOW: - errstr = "GL_STACK_OVERFLOW"; - break; - case GL_STACK_UNDERFLOW: - errstr = "GL_STACK_UNDERFLOW"; - break; - case GL_OUT_OF_MEMORY: - errstr = "GL_OUT_OF_MEMORY"; - break; - case GL_TABLE_TOO_LARGE: - errstr = "GL_TABLE_TOO_LARGE"; - break; - case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: - errstr = "GL_INVALID_FRAMEBUFFER_OPERATION"; - break; - default: - errstr = "unknown"; - break; - } - { char s[MAXSTRING], s2[MAXSTRING]; va_list args; @@ -1144,7 +1134,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); - _mesa_snprintf(s2, MAXSTRING, "%s in %s", errstr, s); + _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); } } -- cgit v1.2.3 From fdeb77899052302053459b8a840a747346e30468 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 15 Jul 2009 13:29:58 +0100 Subject: mesa: recognize and eliminate repeated error messages --- src/mesa/main/imports.c | 34 +++++++++++++++++++++++++++++++--- src/mesa/main/mtypes.h | 7 +++++++ 2 files changed, 38 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 3916c62eda..1722579e82 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1021,6 +1021,22 @@ output_if_debug(const char *prefixString, const char *outputString, } } +static const char *error_string( GLenum error ); + +static void flush_delayed_errors( GLcontext *ctx ) +{ + char s2[MAXSTRING]; + + if (ctx->ErrorDebugCount) { + _mesa_snprintf(s2, MAXSTRING, "%d similar %s errors", + ctx->ErrorDebugCount, + error_string(ctx->ErrorValue)); + + output_if_debug("Mesa: ", s2, GL_TRUE); + + ctx->ErrorDebugCount = 0; + } +} /** * Report a warning (a recoverable error condition) to stderr if @@ -1034,10 +1050,12 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... ) { char str[MAXSTRING]; va_list args; - (void) ctx; va_start( args, fmtString ); (void) vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); + + if (ctx) + flush_delayed_errors( ctx ); output_if_debug("Mesa warning", str, GL_TRUE); } @@ -1126,16 +1144,26 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) #endif } - if (debug) { - { + if (debug) { + if (ctx->ErrorValue == error && + ctx->ErrorDebugFmtString == fmtString) { + ctx->ErrorDebugCount++; + } + else { char s[MAXSTRING], s2[MAXSTRING]; va_list args; + + flush_delayed_errors( ctx ); + va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); + + ctx->ErrorDebugFmtString = fmtString; + ctx->ErrorDebugCount = 0; } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index bdaa4977b7..3b0ebcb7ae 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2955,6 +2955,13 @@ struct __GLcontextRec #endif GLenum ErrorValue; /**< Last error code */ + + /** + * Recognize and silence repeated error debug messages in buggy apps. + */ + const char *ErrorDebugFmtString; + GLuint ErrorDebugCount; + GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ GLbitfield NewState; /**< bitwise-or of _NEW_* flags */ -- cgit v1.2.3 From c68f659be3850c5e099311be7c58f8930954631d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 15 Jul 2009 15:37:04 +0100 Subject: python/samples: Use PIPE_FORMAT_Z16_UNORM instead of PIPE_FORMAT_Z32_UNORM. More common. True fix would be to use whatever the screen supports though. --- src/gallium/state_trackers/python/samples/tri.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/samples/tri.py b/src/gallium/state_trackers/python/samples/tri.py index 4b9659861d..b721e0b575 100644 --- a/src/gallium/state_trackers/python/samples/tri.py +++ b/src/gallium/state_trackers/python/samples/tri.py @@ -139,7 +139,7 @@ def test(dev): tex_usage=PIPE_TEXTURE_USAGE_DISPLAY_TARGET, ).get_surface() zbuf = dev.texture_create( - PIPE_FORMAT_Z32_UNORM, + PIPE_FORMAT_Z16_UNORM, width, height, tex_usage=PIPE_TEXTURE_USAGE_DEPTH_STENCIL, ).get_surface() -- cgit v1.2.3 From 0474b5cb2ac4cefa12e7080aba397013325fb9a6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 15 Jul 2009 15:37:27 +0100 Subject: python/retrace: Interpret surface_copy. --- src/gallium/state_trackers/python/retrace/interpreter.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py index 5885e162c2..e018a6e96b 100755 --- a/src/gallium/state_trackers/python/retrace/interpreter.py +++ b/src/gallium/state_trackers/python/retrace/interpreter.py @@ -591,6 +591,10 @@ class Context(Object): self.real.draw_range_elements(indexBuffer, indexSize, minIndex, maxIndex, mode, start, count) self._set_dirty() + def surface_copy(self, dest, destx, desty, src, srcx, srcy, width, height): + if dest is not None and src is not None: + self.real.surface_copy(dest, destx, desty, src, srcx, srcy, width, height) + def is_texture_referenced(self, texture, face, level): #return self.real.is_texture_referenced(format, texture, face, level) pass -- cgit v1.2.3 From d970313b66b3aab3e3d12c65882febcc7c9091a8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 15 Jul 2009 11:12:05 -0600 Subject: Fix state flag dependencies for fixed function fragment program updates. I started looking into why _NEW_ARRAY punishes us, and while annotating dependencies noticed that a bunch of dependencies were missing. (cherry picked from master, commit e5f63c403b767f9974e8eb5d412c012b8a69287f) --- src/mesa/main/state.c | 2 +- src/mesa/main/texenvprogram.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 94e37e3dab..1d3758a302 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -502,7 +502,7 @@ _mesa_update_state_locked( GLcontext *ctx ) /* Determine which state flags effect vertex/fragment program state */ if (ctx->FragmentProgram._MaintainTexEnvProgram) { prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR | - _NEW_ARRAY); + _NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE); } if (ctx->VertexProgram._MaintainTnlProgram) { prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index b92ba2542d..a3f1246c98 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -261,6 +261,7 @@ static GLuint translate_tex_src_bit( GLbitfield bit ) */ static GLbitfield get_fp_input_mask( GLcontext *ctx ) { + /* _NEW_PROGRAM */ const GLboolean vertexShader = (ctx->Shader.CurrentProgram && ctx->Shader.CurrentProgram->VertexProgram); const GLboolean vertexProgram = ctx->VertexProgram._Enabled; @@ -274,22 +275,26 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) fp_inputs = ~0; } else if (ctx->RenderMode == GL_FEEDBACK) { + /* _NEW_RENDERMODE */ fp_inputs = (FRAG_BIT_COL0 | FRAG_BIT_TEX0); } else if (!(vertexProgram || vertexShader) || !ctx->VertexProgram._Current) { /* Fixed function vertex logic */ + /* _NEW_ARRAY */ GLbitfield varying_inputs = ctx->varying_vp_inputs; /* These get generated in the setup routine regardless of the * vertex program: */ + /* _NEW_POINT */ if (ctx->Point.PointSprite) varying_inputs |= FRAG_BITS_TEX_ANY; /* First look at what values may be computed by the generated * vertex program: */ + /* _NEW_LIGHT */ if (ctx->Light.Enabled) { fp_inputs |= FRAG_BIT_COL0; @@ -297,6 +302,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) fp_inputs |= FRAG_BIT_COL1; } + /* _NEW_TEXTURE */ fp_inputs |= (ctx->Texture._TexGenEnabled | ctx->Texture._TexMatEnabled) << FRAG_ATTRIB_TEX0; @@ -329,6 +335,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) /* These get generated in the setup routine regardless of the * vertex program: */ + /* _NEW_POINT */ if (ctx->Point.PointSprite) vp_outputs |= FRAG_BITS_TEX_ANY; @@ -355,6 +362,7 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) memset(key, 0, sizeof(*key)); + /* _NEW_TEXTURE */ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; GLenum format; @@ -408,11 +416,13 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) } } + /* _DD_NEW_SEPARATE_SPECULAR */ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { key->separate_specular = 1; inputs_referenced |= FRAG_BIT_COL1; } + /* _NEW_FOG */ if (ctx->Fog.Enabled) { key->fog_enabled = 1; key->fog_mode = translate_fog_mode(ctx->Fog.Mode); -- cgit v1.2.3 From 6b7b13b5ebcebdca38264d165a95fd22887b90c7 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Wed, 15 Jul 2009 11:34:36 -0600 Subject: softpipe: limit blend results to [0,1] --- src/gallium/drivers/softpipe/sp_quad_blend.c | 42 ++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c index e134e44337..b1e18805c7 100644 --- a/src/gallium/drivers/softpipe/sp_quad_blend.c +++ b/src/gallium/drivers/softpipe/sp_quad_blend.c @@ -72,6 +72,24 @@ do { \ R[3] = A[3] - B[3]; \ } while (0) +/** Add and limit result to ceiling of 1.0 */ +#define VEC4_ADD_SAT(R, A, B) \ +do { \ + R[0] = A[0] + B[0]; if (R[0] > 1.0f) R[0] = 1.0f; \ + R[1] = A[1] + B[1]; if (R[1] > 1.0f) R[1] = 1.0f; \ + R[2] = A[2] + B[2]; if (R[2] > 1.0f) R[2] = 1.0f; \ + R[3] = A[3] + B[3]; if (R[3] > 1.0f) R[3] = 1.0f; \ +} while (0) + +/** Subtract and limit result to floor of 0.0 */ +#define VEC4_SUB_SAT(R, A, B) \ +do { \ + R[0] = A[0] - B[0]; if (R[0] < 0.0f) R[0] = 0.0f; \ + R[1] = A[1] - B[1]; if (R[1] < 0.0f) R[1] = 0.0f; \ + R[2] = A[2] - B[2]; if (R[2] < 0.0f) R[2] = 0.0f; \ + R[3] = A[3] - B[3]; if (R[3] < 0.0f) R[3] = 0.0f; \ +} while (0) + #define VEC4_MUL(R, A, B) \ do { \ R[0] = A[0] * B[0]; \ @@ -676,19 +694,19 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad) */ switch (softpipe->blend->rgb_func) { case PIPE_BLEND_ADD: - VEC4_ADD(quadColor[0], source[0], dest[0]); /* R */ - VEC4_ADD(quadColor[1], source[1], dest[1]); /* G */ - VEC4_ADD(quadColor[2], source[2], dest[2]); /* B */ + VEC4_ADD_SAT(quadColor[0], source[0], dest[0]); /* R */ + VEC4_ADD_SAT(quadColor[1], source[1], dest[1]); /* G */ + VEC4_ADD_SAT(quadColor[2], source[2], dest[2]); /* B */ break; case PIPE_BLEND_SUBTRACT: - VEC4_SUB(quadColor[0], source[0], dest[0]); /* R */ - VEC4_SUB(quadColor[1], source[1], dest[1]); /* G */ - VEC4_SUB(quadColor[2], source[2], dest[2]); /* B */ + VEC4_SUB_SAT(quadColor[0], source[0], dest[0]); /* R */ + VEC4_SUB_SAT(quadColor[1], source[1], dest[1]); /* G */ + VEC4_SUB_SAT(quadColor[2], source[2], dest[2]); /* B */ break; case PIPE_BLEND_REVERSE_SUBTRACT: - VEC4_SUB(quadColor[0], dest[0], source[0]); /* R */ - VEC4_SUB(quadColor[1], dest[1], source[1]); /* G */ - VEC4_SUB(quadColor[2], dest[2], source[2]); /* B */ + VEC4_SUB_SAT(quadColor[0], dest[0], source[0]); /* R */ + VEC4_SUB_SAT(quadColor[1], dest[1], source[1]); /* G */ + VEC4_SUB_SAT(quadColor[2], dest[2], source[2]); /* B */ break; case PIPE_BLEND_MIN: VEC4_MIN(quadColor[0], source[0], dest[0]); /* R */ @@ -709,13 +727,13 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad) */ switch (softpipe->blend->alpha_func) { case PIPE_BLEND_ADD: - VEC4_ADD(quadColor[3], source[3], dest[3]); /* A */ + VEC4_ADD_SAT(quadColor[3], source[3], dest[3]); /* A */ break; case PIPE_BLEND_SUBTRACT: - VEC4_SUB(quadColor[3], source[3], dest[3]); /* A */ + VEC4_SUB_SAT(quadColor[3], source[3], dest[3]); /* A */ break; case PIPE_BLEND_REVERSE_SUBTRACT: - VEC4_SUB(quadColor[3], dest[3], source[3]); /* A */ + VEC4_SUB_SAT(quadColor[3], dest[3], source[3]); /* A */ break; case PIPE_BLEND_MIN: VEC4_MIN(quadColor[3], source[3], dest[3]); /* A */ -- cgit v1.2.3 From 3ab3209a1f1af7bfd8e09598fbc3586f35169fb2 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 16 Jul 2009 11:19:06 +0100 Subject: python: Obtain pipe_screen/pipe_context from the system's OpenGL driver. --- src/gallium/state_trackers/python/SConscript | 13 ++ .../state_trackers/python/st_hardpipe_winsys.c | 181 ++++++++++++++++++++- 2 files changed, 191 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/SConscript b/src/gallium/state_trackers/python/SConscript index 1581182aec..ec385e7c44 100644 --- a/src/gallium/state_trackers/python/SConscript +++ b/src/gallium/state_trackers/python/SConscript @@ -15,6 +15,19 @@ if 'python' in env['statetrackers']: env.Append(CPPPATH = '.') + if env['platform'] == 'windows': + env.Append(LIBS = [ + 'opengl32', + 'gdi32', + 'user32', + 'kernel32', + ]) + else: + env.Append(LIBS = [ + 'GL', + 'X11', + ]) + pyst = env.ConvenienceLibrary( target = 'pyst', source = [ diff --git a/src/gallium/state_trackers/python/st_hardpipe_winsys.c b/src/gallium/state_trackers/python/st_hardpipe_winsys.c index 8b33c70fd7..43aaaabf2a 100644 --- a/src/gallium/state_trackers/python/st_hardpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_hardpipe_winsys.c @@ -28,31 +28,206 @@ /** * @file - * Stub for hardware pipe driver support. + * Get a hardware accelerated Gallium screen/context from the OpenGL driver. */ #include "pipe/p_compiler.h" +#ifdef PIPE_OS_WINDOWS +#include +#include +#else +#include +#include +#include +#include +#endif + #include "st_winsys.h" +typedef struct pipe_screen * (GLAPIENTRY *PFNGETGALLIUMSCREENMESAPROC) (void); +typedef struct pipe_context * (GLAPIENTRY* PFNCREATEGALLIUMCONTEXTMESAPROC) (void); + +static PFNGETGALLIUMSCREENMESAPROC pfnGetGalliumScreenMESA = NULL; +static PFNCREATEGALLIUMCONTEXTMESAPROC pfnCreateGalliumContextMESA = NULL; + + /* XXX: Force init_gallium symbol to be linked */ extern void init_gallium(void); void (*force_init_gallium_linkage)(void) = &init_gallium; +#ifdef PIPE_OS_WINDOWS + +static INLINE boolean +st_hardpipe_load(void) +{ + WNDCLASS wc; + HWND hwnd; + HGLRC hglrc; + HDC hdc; + PIXELFORMATDESCRIPTOR pfd; + int iPixelFormat; + + if(pfnGetGalliumScreenMESA && pfnCreateGalliumContextMESA) + return TRUE; + + memset(&wc, 0, sizeof wc); + wc.lpfnWndProc = DefWindowProc; + wc.lpszClassName = "gallium"; + wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; + RegisterClass(&wc); + + hwnd = CreateWindow(wc.lpszClassName, "gallium", 0, 0, 0, 0, 0, NULL, 0, wc.hInstance, NULL); + if (!hwnd) + return FALSE; + + hdc = GetDC(hwnd); + if (!hdc) + return FALSE; + + pfd.cColorBits = 3; + pfd.cRedBits = 1; + pfd.cGreenBits = 1; + pfd.cBlueBits = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + pfd.iLayerType = PFD_MAIN_PLANE; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.nSize = sizeof(pfd); + pfd.nVersion = 1; + + iPixelFormat = ChoosePixelFormat(hdc, &pfd); + if (!iPixelFormat) { + pfd.dwFlags |= PFD_DOUBLEBUFFER; + iPixelFormat = ChoosePixelFormat(hdc, &pfd); + } + if (!iPixelFormat) + return FALSE; + + SetPixelFormat(hdc, iPixelFormat, &pfd); + hglrc = wglCreateContext(hdc); + if (!hglrc) + return FALSE; + + if (!wglMakeCurrent(hdc, hglrc)) + return FALSE; + + pfnGetGalliumScreenMESA = (PFNGETGALLIUMSCREENMESAPROC)wglGetProcAddress("wglGetGalliumScreenMESA"); + if(!pfnGetGalliumScreenMESA) + return FALSE; + + pfnCreateGalliumContextMESA = (PFNCREATEGALLIUMCONTEXTMESAPROC)wglGetProcAddress("wglCreateGalliumContextMESA"); + if(!pfnCreateGalliumContextMESA) + return FALSE; + + DestroyWindow(hwnd); + + return TRUE; +} + +#else + +static INLINE boolean +st_hardpipe_load(void) +{ + Display *dpy; + int scrnum; + Window root; + int attribSingle[] = { + GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + None }; + int attribDouble[] = { + GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DOUBLEBUFFER, + None }; + XVisualInfo *visinfo; + GLXContext ctx = NULL; + XSetWindowAttributes attr; + unsigned long mask; + int width = 100, height = 100; + Window win; + + dpy = XOpenDisplay(NULL); + if (!dpy) + return FALSE; + + scrnum = 0; + + root = RootWindow(dpy, scrnum); + + visinfo = glXChooseVisual(dpy, scrnum, attribSingle); + if (!visinfo) + visinfo = glXChooseVisual(dpy, scrnum, attribDouble); + if (!visinfo) + return FALSE; + + ctx = glXCreateContext( dpy, visinfo, NULL, True ); + + if (!ctx) + return FALSE; + + attr.background_pixel = 0; + attr.border_pixel = 0; + attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); + attr.event_mask = StructureNotifyMask | ExposureMask; + + mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; + + win = XCreateWindow(dpy, root, 0, 0, width, height, + 0, visinfo->depth, InputOutput, + visinfo->visual, mask, &attr); + + if (!glXMakeCurrent(dpy, win, ctx)) + return FALSE; + + pfnGetGalliumScreenMESA = (PFNGETGALLIUMSCREENMESAPROC)glXGetProcAddressARB((const GLubyte *)"glXGetGalliumScreenMESA"); + if(!pfnGetGalliumScreenMESA) + return FALSE; + + pfnCreateGalliumContextMESA = (PFNCREATEGALLIUMCONTEXTMESAPROC)glXGetProcAddressARB((const GLubyte *)"glXCreateGalliumContextMESA"); + if(!pfnCreateGalliumContextMESA) + return FALSE; + + glXDestroyContext(dpy, ctx); + XFree(visinfo); + XDestroyWindow(dpy, win); + XCloseDisplay(dpy); + + return TRUE; +} + +#endif + + static struct pipe_screen * st_hardpipe_screen_create(void) { - return st_softpipe_winsys.screen_create(); + if(st_hardpipe_load()) + return pfnGetGalliumScreenMESA(); + else + return st_softpipe_winsys.screen_create(); } static struct pipe_context * st_hardpipe_context_create(struct pipe_screen *screen) { - return st_softpipe_winsys.context_create(screen); + if(st_hardpipe_load()) { + if(screen == pfnGetGalliumScreenMESA()) + return pfnCreateGalliumContextMESA(); + else + return NULL; + } + else + return st_softpipe_winsys.context_create(screen); } -- cgit v1.2.3 From 4e1e18a772061fe3573f2ee2bf6afe447ee66fd6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 16 Jul 2009 11:20:12 +0100 Subject: wgl: Expose pipe_screen/pipe_context via an extension. --- src/gallium/state_trackers/wgl/SConscript | 1 + .../state_trackers/wgl/shared/stw_extgallium.c | 79 ++++++++++++++++++++++ .../state_trackers/wgl/shared/stw_extgallium.h | 47 +++++++++++++ .../state_trackers/wgl/shared/stw_getprocaddress.c | 7 +- 4 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 src/gallium/state_trackers/wgl/shared/stw_extgallium.c create mode 100644 src/gallium/state_trackers/wgl/shared/stw_extgallium.h (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/SConscript b/src/gallium/state_trackers/wgl/SConscript index a086657487..69b88618ec 100644 --- a/src/gallium/state_trackers/wgl/SConscript +++ b/src/gallium/state_trackers/wgl/SConscript @@ -29,6 +29,7 @@ if env['platform'] in ['windows']: 'shared/stw_extensionsstring.c', 'shared/stw_extswapinterval.c', 'shared/stw_getprocaddress.c', + 'shared/stw_extgallium.c', 'shared/stw_arbpixelformat.c', 'shared/stw_tls.c', ] diff --git a/src/gallium/state_trackers/wgl/shared/stw_extgallium.c b/src/gallium/state_trackers/wgl/shared/stw_extgallium.c new file mode 100644 index 0000000000..fc22737d7e --- /dev/null +++ b/src/gallium/state_trackers/wgl/shared/stw_extgallium.c @@ -0,0 +1,79 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * 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. + * + **************************************************************************/ + + +#include "pipe/p_screen.h" +#include "stw_public.h" +#include "stw_device.h" +#include "stw_winsys.h" + +#ifdef DEBUG +#include "trace/tr_screen.h" +#include "trace/tr_context.h" +#endif + + +struct pipe_screen * APIENTRY +wglGetGalliumScreenMESA(void) +{ + return stw_dev ? stw_dev->screen : NULL; +} + + +/* XXX: Unify with stw_create_layer_context */ +struct pipe_context * APIENTRY +wglCreateGalliumContextMESA(void) +{ + struct pipe_screen *screen = NULL; + struct pipe_context *pipe = NULL; + + if(!stw_dev) + return NULL; + + screen = stw_dev->screen; + +#ifdef DEBUG + /* Unwrap screen */ + if(stw_dev->trace_running) + screen = trace_screen(screen)->screen; +#endif + + pipe = stw_dev->stw_winsys->create_context( screen ); + if (pipe == NULL) + goto no_pipe; + +#ifdef DEBUG + /* Wrap context */ + if(stw_dev->trace_running) + pipe = trace_context_create(stw_dev->screen, pipe); +#endif + + return pipe; + +no_pipe: + return NULL; +} diff --git a/src/gallium/state_trackers/wgl/shared/stw_extgallium.h b/src/gallium/state_trackers/wgl/shared/stw_extgallium.h new file mode 100644 index 0000000000..cc35f2bb7f --- /dev/null +++ b/src/gallium/state_trackers/wgl/shared/stw_extgallium.h @@ -0,0 +1,47 @@ +/************************************************************************** + * + * 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. + * + **************************************************************************/ + +#ifndef STW_EXTGALLIUM_H_ +#define STW_EXTGALLIUM_H_ + + +#include + + +struct pipe_screen; +struct pipe_context; + + +struct pipe_screen * APIENTRY +wglGetGalliumScreenMESA(void); + + +struct pipe_context * APIENTRY +wglCreateGalliumContextMESA(void); + + +#endif /* STW_EXTGALLIUM_H_ */ diff --git a/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c b/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c index 54cc038905..879ced925a 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c +++ b/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c @@ -34,6 +34,7 @@ #include "glapi/glapi.h" #include "stw_public.h" +#include "stw_extgallium.h" struct stw_extension_entry { @@ -60,6 +61,10 @@ static const struct stw_extension_entry stw_extension_entries[] = { STW_EXTENSION_ENTRY( wglGetSwapIntervalEXT ), STW_EXTENSION_ENTRY( wglSwapIntervalEXT ), + /* WGL_EXT_gallium ? */ + STW_EXTENSION_ENTRY( wglGetGalliumScreenMESA ), + STW_EXTENSION_ENTRY( wglCreateGalliumContextMESA ), + { NULL, NULL } }; @@ -75,7 +80,7 @@ stw_get_proc_address( return entry->proc; if (lpszProc[0] == 'g' && lpszProc[1] == 'l') - return (PROC) _glapi_get_proc_address( lpszProc ); + return (PROC) _glapi_get_proc_address( lpszProc ); return NULL; } -- cgit v1.2.3 From 0c4350790ac0639996cbefcf2556ca5748d39454 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 16 Jul 2009 11:21:12 +0100 Subject: python: Hack to prevent segmentation faults when python exits. --- src/gallium/state_trackers/python/st_device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index 8246b378ce..ea7d18738f 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -44,8 +44,14 @@ static void st_device_really_destroy(struct st_device *st_dev) { - if(st_dev->screen) + if(st_dev->screen) { + /* FIXME: Don't really destroy until we keep track of every single + * reference or we end up causing a segmentation fault every time + * python exits. */ +#if 0 st_dev->screen->destroy(st_dev->screen); +#endif + } FREE(st_dev); } -- cgit v1.2.3 From d4e6df9ab6e7b707278e3739abee776418c6f527 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 16 Jul 2009 19:20:25 +0100 Subject: mesa: Fix logbase2. It was providing 1 too many for non power two values. --- src/mesa/state_tracker/st_cb_texture.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 22685bd5d9..15f84b6638 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -237,14 +237,12 @@ do_memcpy(void *dest, const void *src, size_t n) } -static int -logbase2(int n) +static INLINE unsigned +logbase2(unsigned n) { - GLint i = 1, log2 = 0; - while (n > i) { - i *= 2; - log2++; - } + unsigned log2 = 0; + while (n >>= 1) + ++log2; return log2; } -- cgit v1.2.3 From 5807ccb41b14890a1cdab4cc06806a9cf6c11ecc Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 16 Jul 2009 19:31:36 +0100 Subject: python/retrace: Flush stdout before calling the pipe driver. So that messages are in sync with stderr. --- src/gallium/state_trackers/python/retrace/interpreter.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py index e018a6e96b..69515da218 100755 --- a/src/gallium/state_trackers/python/retrace/interpreter.py +++ b/src/gallium/state_trackers/python/retrace/interpreter.py @@ -456,6 +456,7 @@ class Context(Object): x, y, z, w = unpack_from(format, data, offset) sys.stdout.write('\tCONST[%2u] = {%10.4f, %10.4f, %10.4f, %10.4f}\n' % (index, x, y, z, w)) index += 1 + sys.stdout.flush() def set_constant_buffer(self, shader, index, buffer): if buffer is not None: @@ -537,6 +538,7 @@ class Context(Object): sys.stdout.write('\t\t{' + ', '.join(map(str, values)) + '},\n') assert len(values) == velem.nr_components sys.stdout.write('\t},\n') + sys.stdout.flush() def dump_indices(self, ibuf, isize, start, count): if not self.interpreter.verbosity(2): @@ -564,6 +566,7 @@ class Context(Object): minindex = min(minindex, index) maxindex = max(maxindex, index) sys.stdout.write('\t},\n') + sys.stdout.flush() return minindex, maxindex @@ -674,6 +677,7 @@ class Interpreter(parser.TraceDumper): if self.verbosity(1): parser.TraceDumper.handle_call(self, call) + sys.stdout.flush() args = [(str(name), self.interpret_arg(arg)) for name, arg in call.args] -- cgit v1.2.3 From cf7e8fbc2ea2739f1955d83751b631c5444a3c91 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 16 Jul 2009 19:32:40 +0100 Subject: python/retrace: Dump the surface copy contents. --- src/gallium/state_trackers/python/retrace/interpreter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py index 69515da218..bc06429b77 100755 --- a/src/gallium/state_trackers/python/retrace/interpreter.py +++ b/src/gallium/state_trackers/python/retrace/interpreter.py @@ -596,7 +596,17 @@ class Context(Object): def surface_copy(self, dest, destx, desty, src, srcx, srcy, width, height): if dest is not None and src is not None: + if self.interpreter.options.all: + self.interpreter.present(src, 'surface_copy_src', srcx, srcy, width, height) self.real.surface_copy(dest, destx, desty, src, srcx, srcy, width, height) + if dest in self.cbufs: + self._set_dirty() + flags = gallium.PIPE_FLUSH_FRAME + else: + flags = 0 + self.flush(flags) + if self.interpreter.options.all: + self.interpreter.present(dest, 'surface_copy_dest', destx, desty, width, height) def is_texture_referenced(self, texture, face, level): #return self.real.is_texture_referenced(format, texture, face, level) -- cgit v1.2.3 From 2ba98efdf6653a4cb885d576d2e6f349c69679d4 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 16 Jul 2009 19:34:44 +0100 Subject: python/retrace: Process the call no passed to --to option inclusively. --- src/gallium/state_trackers/python/retrace/interpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py index bc06429b77..6f0bd6ae52 100755 --- a/src/gallium/state_trackers/python/retrace/interpreter.py +++ b/src/gallium/state_trackers/python/retrace/interpreter.py @@ -677,7 +677,7 @@ class Interpreter(parser.TraceDumper): self.interpret_call(call) def handle_call(self, call): - if self.options.stop and call.no >= self.options.stop: + if self.options.stop and call.no > self.options.stop: sys.exit(0) if (call.klass, call.method) in self.ignore_calls: -- cgit v1.2.3 From 71b9e102913753bc5af23c774641d6a6dda184d9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Jul 2009 12:40:44 -0600 Subject: mesa: set version to 7.5 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 52ee324d17..ba027465d4 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -31,7 +31,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 5 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.5-rc4" +#define MESA_VERSION_STRING "7.5" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3