diff options
author | Brian Paul <[email protected]> | 2010-03-22 09:07:46 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-03-22 09:07:46 -0600 |
commit | 182c42c8da6edfa66819eef02f4dea310c1f68d7 (patch) | |
tree | f49df694eae81c9db3c8fe2123bb30ef5a556891 | |
parent | 5cb4a3524b54480418b4c4717c4a0f0a8669939c (diff) | |
parent | ca97f8b9bab80844be613a9253643b7da8e738c7 (diff) |
Merge branch '7.8'
Conflicts:
src/gallium/drivers/cell/ppu/cell_screen.c
src/mesa/state_tracker/st_cb_drawpixels.c
-rw-r--r-- | docs/shading.html | 4 | ||||
-rw-r--r-- | progs/tests/Makefile | 1 | ||||
-rw-r--r-- | progs/tests/SConscript | 1 | ||||
-rw-r--r-- | progs/tests/cva_huge.c | 232 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_screen.c | 21 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_tris.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_reg.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_cmdbuf.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_tcl.c | 56 | ||||
-rw-r--r-- | src/mesa/drivers/glslcompiler/Makefile | 3 | ||||
-rw-r--r-- | src/mesa/drivers/x11/glxapi.c | 15 | ||||
-rw-r--r-- | src/mesa/glapi/gen/gl_x86_asm.py | 6 | ||||
-rw-r--r-- | src/mesa/main/matrix.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 11 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_split_copy.c | 2 | ||||
-rw-r--r-- | src/mesa/x86/glapi_x86.S | 66 |
16 files changed, 311 insertions, 120 deletions
diff --git a/docs/shading.html b/docs/shading.html index bd02335a803..750884cf36c 100644 --- a/docs/shading.html +++ b/docs/shading.html @@ -15,10 +15,6 @@ OpenGL Shading Language</a>. </p> <p> -Last updated on 15 December 2008. -</p> - -<p> Contents </p> <ul> diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 67efc3b7a9c..6bb0249e171 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -41,6 +41,7 @@ SOURCES = \ copypixrate.c \ crossbar.c \ cva.c \ + cva_huge.c \ cylwrap.c \ drawbuffers.c \ drawbuffers2.c \ diff --git a/progs/tests/SConscript b/progs/tests/SConscript index 3580ba914db..b1c7c99a7b6 100644 --- a/progs/tests/SConscript +++ b/progs/tests/SConscript @@ -45,6 +45,7 @@ progs = [ 'copypixrate', 'crossbar', 'cva', + 'cva_huge', 'cylwrap', 'drawbuffers', 'drawbuffers2', diff --git a/progs/tests/cva_huge.c b/progs/tests/cva_huge.c new file mode 100644 index 00000000000..88ec2af2a84 --- /dev/null +++ b/progs/tests/cva_huge.c @@ -0,0 +1,232 @@ +/* + * Copyright © 2010 Pauli Nieminen + * + * 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. + */ + + +/* + * Test case for huge cva arrays. Mesa code has to split this to multiple VBOs + * which had memory access error. + * This test case doesn't render incorrectly but valgrind showed the memory + * access error. + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <stddef.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ +#ifdef _WIN32 +#include <windows.h> +#endif +#define GL_GLEXT_LEGACY +#include <GL/glut.h> + +GLfloat *verts; + +GLubyte *color; + +GLuint *indices; + +#define rows 1000 /* Create 1000x1000 vertex grid */ +#define row_width 5000.0 +#define grid_depth -50.0 +GLuint nr_verts_in_row = rows; +GLuint nr_indices_in_strip = rows * 2; + +GLboolean double_buffer; +GLboolean compiled = GL_TRUE; + +static void generate_verts( void ) +{ + unsigned x, y; + GLfloat step = row_width /(GLfloat)(nr_verts_in_row - 1); + verts = malloc(sizeof(verts[0]) * 4 * nr_verts_in_row * nr_verts_in_row); + + for (y = 0; y < nr_verts_in_row; ++y) { + for (x = 0; x < nr_verts_in_row; ++x) { + unsigned idx = 4*(x + y * nr_verts_in_row); + verts[idx + 0] = step * x - row_width/2.0; + verts[idx + 1] = step * y - row_width/2.0; + /* deep enough not to be vissible */ + verts[idx + 2] = grid_depth; + verts[idx + 3] = 0.0; + } + } + glVertexPointer( 3, GL_FLOAT, sizeof(verts[0])*4, verts ); +} + +static void generate_colors( void ) +{ + unsigned x, y; + GLfloat step = 255.0/(GLfloat)(nr_verts_in_row - 1); + color = malloc(sizeof(color[0]) * 4 * nr_verts_in_row * nr_verts_in_row); + + for (y = 0; y < nr_verts_in_row; ++y) { + for (x = 0; x < nr_verts_in_row; ++x) { + unsigned idx = 4*(x + y * nr_verts_in_row); + color[idx + 0] = (GLubyte)(step * x); + color[idx + 1] = 0x00; + color[idx + 2] = (GLubyte)(step * y); + color[idx + 3] = 0x00; + } + } + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color ); +} + +static void generate_indices( void ) +{ + unsigned strip, i; + + /* indice size * number of strips * number of indices in strip */ + indices = malloc(sizeof(indices[0]) * (nr_verts_in_row - 1) * + (nr_indices_in_strip)); + + for (strip = 0; strip < nr_verts_in_row - 1; strip += 2) { + for (i = 0; i < nr_indices_in_strip; i+=2) { + unsigned idx = i + strip * nr_indices_in_strip; + unsigned idx2 = (nr_indices_in_strip - i - 2) + (strip + + 1) * (nr_indices_in_strip); + indices[idx + 1] = i/2 + strip*nr_verts_in_row; + indices[idx] = i/2 + (strip + 1)*nr_verts_in_row; + if (strip + 1 < nr_verts_in_row - 1) { + indices[idx2] = i/2 + (strip + 1)*nr_verts_in_row; + indices[idx2 + 1] = i/2 + (strip + 2)*nr_verts_in_row; + } + } + } +} + +static void init( void ) +{ + + + generate_verts(); + generate_colors(); + generate_indices(); + + glClearColor( 0.0, 0.0, 0.0, 0.0 ); + glShadeModel( GL_SMOOTH ); + + glEnableClientState( GL_VERTEX_ARRAY ); + glEnableClientState( GL_COLOR_ARRAY ); + + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + glFrustum( -100.0, 100.0, -100.0, 100.0, 1.0, 100.0 ); + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + +#ifdef GL_EXT_compiled_vertex_array + if ( compiled ) { + glLockArraysEXT( 0, rows * rows ); + } +#endif +} + +static void display( void ) +{ + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + + glDrawElements( GL_TRIANGLE_STRIP, nr_indices_in_strip * (nr_verts_in_row - 1) , GL_UNSIGNED_INT, indices ); + + if ( double_buffer ) + glutSwapBuffers(); + else + glFlush(); +} + +static void keyboard( unsigned char key, int x, int y ) +{ + switch ( key ) { + case 27: + exit( 0 ); + break; + } + + glutPostRedisplay(); +} + +static GLboolean args( int argc, char **argv ) +{ + GLint i; + + double_buffer = GL_TRUE; + + for ( i = 1 ; i < argc ; i++ ) { + if ( strcmp( argv[i], "-sb" ) == 0 ) { + double_buffer = GL_FALSE; + } else if ( strcmp( argv[i], "-db" ) == 0 ) { + double_buffer = GL_TRUE; + } else { + fprintf( stderr, "%s (Bad option).\n", argv[i] ); + return GL_FALSE; + } + } + return GL_TRUE; +} + +int main( int argc, char **argv ) +{ + GLenum type; + char *string; + double version; + + glutInit( &argc, argv ); + + if ( args( argc, argv ) == GL_FALSE ) { + exit( 1 ); + } + + type = GLUT_RGB | GLUT_DEPTH; + type |= ( double_buffer ) ? GLUT_DOUBLE : GLUT_SINGLE; + + glutInitDisplayMode( type ); + glutInitWindowSize( 250, 250 ); + glutInitWindowPosition( 100, 100 ); + glutCreateWindow( "CVA Test" ); + + /* Make sure the server supports GL 1.2 vertex arrays. + */ + string = (char *) glGetString( GL_VERSION ); + + version = atof(string); + if ( version < 1.2 ) { + fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" ); + exit( -1 ); + } + + /* See if the server supports compiled vertex arrays. + */ + string = (char *) glGetString( GL_EXTENSIONS ); + + if ( !strstr( string, "GL_EXT_compiled_vertex_array" ) ) { + fprintf( stderr, "Compiled vertex arrays not supported by this renderer.\n" ); + compiled = GL_FALSE; + } + + init(); + + glutDisplayFunc( display ); + glutKeyboardFunc( keyboard ); + glutMainLoop(); + + return 0; +} diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index f5528a7ec6b..42045744060 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -97,6 +97,8 @@ cell_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: return 0; + case PIPE_CAP_BLEND_EQUATION_SEPARATE: + return 1; default: return 0; } @@ -136,12 +138,6 @@ cell_is_format_supported( struct pipe_screen *screen, unsigned tex_usage, unsigned geom_flags ) { - struct sw_winsys *winsys = cell_screen(screen)->winsys; - - if (format == PIPE_FORMAT_DXT5_RGBA || - format == PIPE_FORMAT_A8B8G8R8_SRGB) - return FALSE; - if (tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | PIPE_TEXTURE_USAGE_SCANOUT | PIPE_TEXTURE_USAGE_SHARED)) { @@ -149,9 +145,16 @@ cell_is_format_supported( struct pipe_screen *screen, return FALSE; } - /* This is often a lie. Pull in logic from llvmpipe to fix. - */ - return TRUE; + /* only a few formats are known to work at this time */ + switch (format) { + case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_I8_UNORM: + return TRUE; + default: + return FALSE; + } } diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index fb191fe346f..81c4adeaf34 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -251,7 +251,7 @@ void intel_flush_prim(struct intel_context *intel) BEGIN_BATCH(5); OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(0) | I1_LOAD_S(1) | 1); - assert((offset & !S0_VB_OFFSET_MASK) == 0); + assert((offset & ~S0_VB_OFFSET_MASK) == 0); OUT_RELOC(vb_bo, I915_GEM_DOMAIN_VERTEX, 0, offset); OUT_BATCH((intel->vertex_size << S1_VERTEX_WIDTH_SHIFT) | (intel->vertex_size << S1_VERTEX_PITCH_SHIFT)); @@ -270,7 +270,7 @@ void intel_flush_prim(struct intel_context *intel) OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(0) | I1_LOAD_S(2) | 1); /* S0 */ - assert((offset & !S0_VB_OFFSET_MASK_830) == 0); + assert((offset & ~S0_VB_OFFSET_MASK_830) == 0); OUT_RELOC(vb_bo, I915_GEM_DOMAIN_VERTEX, 0, offset | (intel->vertex_size << S0_VB_PITCH_SHIFT_830) | S0_VB_ENABLE_830); diff --git a/src/mesa/drivers/dri/intel/intel_reg.h b/src/mesa/drivers/dri/intel/intel_reg.h index d19f1bae34c..36d8180598e 100644 --- a/src/mesa/drivers/dri/intel/intel_reg.h +++ b/src/mesa/drivers/dri/intel/intel_reg.h @@ -70,8 +70,10 @@ /** @{ * 915 definitions + * + * 915 documents say that bits 31:28 and 1 are "undefined, must be zero." */ -#define S0_VB_OFFSET_MASK 0xffffffc0 +#define S0_VB_OFFSET_MASK 0x0ffffffc #define S0_AUTO_CACHE_INV_DISABLE (1<<0) /** @} */ diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c index 2f2b8d94dca..ad43a8ca920 100644 --- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c +++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c @@ -189,7 +189,8 @@ void r200FlushElts(GLcontext *ctx) if (R200_ELT_BUF_SZ > elt_used) radeonReturnDmaRegion(&rmesa->radeon, R200_ELT_BUF_SZ - elt_used); - if (radeon_is_debug_enabled(RADEON_SYNC, RADEON_CRITICAL)) { + if (radeon_is_debug_enabled(RADEON_SYNC, RADEON_CRITICAL) + && !rmesa->radeon.radeonScreen->kernel_mm) { radeon_print(RADEON_SYNC, RADEON_NORMAL, "%s: Syncing\n", __FUNCTION__); radeonFinish( rmesa->radeon.glCtx ); } diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index f3f558b7def..d43e14581e9 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -404,8 +404,9 @@ static GLuint r200EnsureEmitSize( GLcontext * ctx , GLubyte* vimap_rev ) rendering code may decide convert to elts. In that case we have to make pessimistic prediction. and use larger of 2 paths. */ - const GLuint elts = ELTS_BUFSZ(nr_aos); - const GLuint index = INDEX_BUFSZ; + const GLuint elt_count =(VB->Primitive[i].count/GET_MAX_HW_ELTS() + 1); + const GLuint elts = ELTS_BUFSZ(nr_aos) * elt_count; + const GLuint index = INDEX_BUFSZ * elt_count; const GLuint vbuf = VBUF_BUFSZ; if ( (!VB->Elts && VB->Primitive[i].count >= MAX_CONVERSION_SIZE) || vbuf > index + elts) @@ -687,25 +688,34 @@ static char *getFallbackString(GLuint bit) void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) { - r200ContextPtr rmesa = R200_CONTEXT(ctx); - GLuint oldfallback = rmesa->radeon.TclFallback; - - if (mode) { - rmesa->radeon.TclFallback |= bit; - if (oldfallback == 0) { - if (R200_DEBUG & RADEON_FALLBACKS) - fprintf(stderr, "R200 begin tcl fallback %s\n", - getFallbackString( bit )); - transition_to_swtnl( ctx ); - } - } - else { - rmesa->radeon.TclFallback &= ~bit; - if (oldfallback == bit) { - if (R200_DEBUG & RADEON_FALLBACKS) - fprintf(stderr, "R200 end tcl fallback %s\n", - getFallbackString( bit )); - transition_to_hwtnl( ctx ); - } - } + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLuint oldfallback = rmesa->radeon.TclFallback; + + if (mode) { + if (oldfallback == 0) { + /* We have to flush before transition */ + if ( rmesa->radeon.dma.flush ) + rmesa->radeon.dma.flush( rmesa->radeon.glCtx ); + + if (R200_DEBUG & RADEON_FALLBACKS) + fprintf(stderr, "R200 begin tcl fallback %s\n", + getFallbackString( bit )); + rmesa->radeon.TclFallback |= bit; + transition_to_swtnl( ctx ); + } else + rmesa->radeon.TclFallback |= bit; + } else { + if (oldfallback == bit) { + /* We have to flush before transition */ + if ( rmesa->radeon.dma.flush ) + rmesa->radeon.dma.flush( rmesa->radeon.glCtx ); + + if (R200_DEBUG & RADEON_FALLBACKS) + fprintf(stderr, "R200 end tcl fallback %s\n", + getFallbackString( bit )); + rmesa->radeon.TclFallback &= ~bit; + transition_to_hwtnl( ctx ); + } else + rmesa->radeon.TclFallback &= ~bit; + } } diff --git a/src/mesa/drivers/glslcompiler/Makefile b/src/mesa/drivers/glslcompiler/Makefile index 080fe475c16..d3404988d52 100644 --- a/src/mesa/drivers/glslcompiler/Makefile +++ b/src/mesa/drivers/glslcompiler/Makefile @@ -10,9 +10,10 @@ PROGRAM = glslcompiler OBJECTS = \ glslcompiler.o \ ../../glapi/glapi.o \ + ../../glapi/glapi_getproc.o \ + ../../glapi/glapi_dispatch.o \ ../../glapi/glapi_nop.o \ ../../glapi/glthread.o \ - ../../main/dispatch.o \ ../common/driverfuncs.o \ ../../libmesa.a diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index e11aff1a849..955eba4e944 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1113,7 +1113,7 @@ glXGetAGPOffsetMESA( const GLvoid *pointer ) /*** GLX_MESA_allocate_memory */ -void * +void PUBLIC * glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority) { @@ -1121,14 +1121,14 @@ glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, return NULL; } -void +void PUBLIC glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer) { /* dummy */ } -GLuint +GLuint PUBLIC glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer) { /* dummy */ @@ -1138,7 +1138,7 @@ glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer) /*** GLX_EXT_texture_from_pixmap */ -void +void PUBLIC glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list) { @@ -1148,7 +1148,7 @@ glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, t->BindTexImageEXT(dpy, drawable, buffer, attrib_list); } -void +void PUBLIC glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer) { struct _glxapi_table *t; @@ -1426,7 +1426,7 @@ _glxapi_get_proc_address(const char *funcName) * This function does not get dispatched through the dispatch table * since it's really a "meta" function. */ -__GLXextFuncPtr +__GLXextFuncPtr PUBLIC glXGetProcAddressARB(const GLubyte *procName) { __GLXextFuncPtr f; @@ -1442,7 +1442,8 @@ glXGetProcAddressARB(const GLubyte *procName) /* GLX 1.4 */ -void (*glXGetProcAddress(const GLubyte *procName))() +void PUBLIC +(*glXGetProcAddress(const GLubyte *procName))() { return glXGetProcAddressARB(procName); } diff --git a/src/mesa/glapi/gen/gl_x86_asm.py b/src/mesa/glapi/gen/gl_x86_asm.py index a48724ee615..10dfa1ddb34 100644 --- a/src/mesa/glapi/gen/gl_x86_asm.py +++ b/src/mesa/glapi/gen/gl_x86_asm.py @@ -226,11 +226,11 @@ class PrintGenericStubs(gl_XML.gl_print_base): stack = self.get_stack_size(f) alt = "%s@%u" % (name, stack) - if f.is_static_entry_point(f.name): - for n in f.entry_points: + for n in f.entry_points: + if f.is_static_entry_point(n): if n != f.name: alt2 = "%s@%u" % (n, stack) - text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt) + text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, name, alt) if f.has_different_protocol(n): print '#ifndef GLX_INDIRECT_RENDERING' diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 5c863f6f32a..4b8c00b5b63 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -322,7 +322,7 @@ _mesa_LoadIdentity( void ) ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glLoadIdentity()"); + _mesa_debug(ctx, "glLoadIdentity()\n"); _math_matrix_set_identity( ctx->CurrentStack->Top ); ctx->NewState |= ctx->CurrentStack->DirtyFlag; diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 07529ab6af7..c9d1e9c6c4b 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -968,7 +968,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, enum pipe_format srcFormat, texFormat; GLboolean invertTex = GL_FALSE; GLint readX, readY, readW, readH; - struct gl_pixelstore_attrib unpack = ctx->DefaultPacking; + struct gl_pixelstore_attrib pack = ctx->DefaultPacking; pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL); @@ -1032,7 +1032,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, readY = srcy; readW = width; readH = height; - _mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &unpack); + _mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack); readW = MAX2(0, readW); readH = MAX2(0, readH); @@ -1056,9 +1056,10 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, PIPE_BUFFER_USAGE_GPU_READ); struct pipe_surface *psTex = screen->get_tex_surface(screen, pt, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE ); + pipe->surface_copy(pipe, psTex, /* dest surf */ - unpack.SkipPixels, unpack.SkipRows, /* dest pos */ + pack.SkipPixels, pack.SkipRows, /* dest pos */ psRead, /* src surf */ readX, readY, readW, readH); /* src region */ @@ -1096,7 +1097,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, /* alternate path using get/put_tile() */ GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(pipe, ptRead, readX, readY, readW, readH, buf); - pipe_put_tile_rgba(pipe, ptTex, unpack.SkipPixels, unpack.SkipRows, + pipe_put_tile_rgba(pipe, ptTex, pack.SkipPixels, pack.SkipRows, readW, readH, buf); free(buf); } @@ -1104,7 +1105,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, /* GL_DEPTH */ GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); pipe_get_tile_z(pipe, ptRead, readX, readY, readW, readH, buf); - pipe_put_tile_z(pipe, ptTex, unpack.SkipPixels, unpack.SkipRows, + pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows, readW, readH, buf); free(buf); } diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index bce401744da..2ec7d9b0fe3 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -196,7 +196,7 @@ flush( struct copy_context *copy ) ©->dstib, GL_TRUE, 0, - copy->dstbuf_nr ); + copy->dstbuf_nr - 1 ); /* Reset all pointers: */ diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index a7dd8d72186..b1730d25a0d 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -1022,74 +1022,16 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(BlendColorEXT, _gloffset_BlendColor, BlendColorEXT@16, BlendColor, BlendColor@16) GL_STUB_ALIAS(BlendEquationEXT, _gloffset_BlendEquation, BlendEquationEXT@4, BlendEquation, BlendEquation@4) GL_STUB_ALIAS(DrawRangeElementsEXT, _gloffset_DrawRangeElements, DrawRangeElementsEXT@24, DrawRangeElements, DrawRangeElements@24) - GL_STUB_ALIAS(ColorTableSGI, _gloffset_ColorTable, ColorTableSGI@24, ColorTable, ColorTable@24) GL_STUB_ALIAS(ColorTableEXT, _gloffset_ColorTable, ColorTableEXT@24, ColorTable, ColorTable@24) - GL_STUB_ALIAS(ColorTableParameterfvSGI, _gloffset_ColorTableParameterfv, ColorTableParameterfvSGI@12, ColorTableParameterfv, ColorTableParameterfv@12) - GL_STUB_ALIAS(ColorTableParameterivSGI, _gloffset_ColorTableParameteriv, ColorTableParameterivSGI@12, ColorTableParameteriv, ColorTableParameteriv@12) - GL_STUB_ALIAS(CopyColorTableSGI, _gloffset_CopyColorTable, CopyColorTableSGI@20, CopyColorTable, CopyColorTable@20) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableSGI, _gloffset_GetColorTable, GetColorTableSGI@16, GetColorTable, GetColorTable@16) -#endif #ifndef GLX_INDIRECT_RENDERING GL_STUB_ALIAS(GetColorTableEXT, _gloffset_GetColorTable, GetColorTableEXT@16, GetColorTable, GetColorTable@16) #endif #ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvSGI@12, GetColorTableParameterfv, GetColorTableParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING GL_STUB_ALIAS(GetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvEXT@12, GetColorTableParameterfv, GetColorTableParameterfv@12) #endif #ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableParameterivSGI, _gloffset_GetColorTableParameteriv, GetColorTableParameterivSGI@12, GetColorTableParameteriv, GetColorTableParameteriv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING GL_STUB_ALIAS(GetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv, GetColorTableParameterivEXT@12, GetColorTableParameteriv, GetColorTableParameteriv@12) #endif - GL_STUB_ALIAS(ColorSubTableEXT, _gloffset_ColorSubTable, ColorSubTableEXT@24, ColorSubTable, ColorSubTable@24) - GL_STUB_ALIAS(CopyColorSubTableEXT, _gloffset_CopyColorSubTable, CopyColorSubTableEXT@20, CopyColorSubTable, CopyColorSubTable@20) - GL_STUB_ALIAS(ConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D, ConvolutionFilter1DEXT@24, ConvolutionFilter1D, ConvolutionFilter1D@24) - GL_STUB_ALIAS(ConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D, ConvolutionFilter2DEXT@28, ConvolutionFilter2D, ConvolutionFilter2D@28) - GL_STUB_ALIAS(ConvolutionParameterfEXT, _gloffset_ConvolutionParameterf, ConvolutionParameterfEXT@12, ConvolutionParameterf, ConvolutionParameterf@12) - GL_STUB_ALIAS(ConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv, ConvolutionParameterfvEXT@12, ConvolutionParameterfv, ConvolutionParameterfv@12) - GL_STUB_ALIAS(ConvolutionParameteriEXT, _gloffset_ConvolutionParameteri, ConvolutionParameteriEXT@12, ConvolutionParameteri, ConvolutionParameteri@12) - GL_STUB_ALIAS(ConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv, ConvolutionParameterivEXT@12, ConvolutionParameteriv, ConvolutionParameteriv@12) - GL_STUB_ALIAS(CopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D, CopyConvolutionFilter1DEXT@20, CopyConvolutionFilter1D, CopyConvolutionFilter1D@20) - GL_STUB_ALIAS(CopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D, CopyConvolutionFilter2DEXT@24, CopyConvolutionFilter2D, CopyConvolutionFilter2D@24) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetConvolutionFilterEXT, _gloffset_GetConvolutionFilter, GetConvolutionFilterEXT@16, GetConvolutionFilter, GetConvolutionFilter@16) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfv, GetConvolutionParameterfvEXT@12, GetConvolutionParameterfv, GetConvolutionParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetConvolutionParameterivEXT, _gloffset_GetConvolutionParameteriv, GetConvolutionParameterivEXT@12, GetConvolutionParameteriv, GetConvolutionParameteriv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetSeparableFilterEXT, _gloffset_GetSeparableFilter, GetSeparableFilterEXT@24, GetSeparableFilter, GetSeparableFilter@24) -#endif - GL_STUB_ALIAS(SeparableFilter2DEXT, _gloffset_SeparableFilter2D, SeparableFilter2DEXT@32, SeparableFilter2D, SeparableFilter2D@32) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetHistogramEXT, _gloffset_GetHistogram, GetHistogramEXT@20, GetHistogram, GetHistogram@20) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfv, GetHistogramParameterfvEXT@12, GetHistogramParameterfv, GetHistogramParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetHistogramParameterivEXT, _gloffset_GetHistogramParameteriv, GetHistogramParameterivEXT@12, GetHistogramParameteriv, GetHistogramParameteriv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetMinmaxEXT, _gloffset_GetMinmax, GetMinmaxEXT@20, GetMinmax, GetMinmax@20) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfv, GetMinmaxParameterfvEXT@12, GetMinmaxParameterfv, GetMinmaxParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetMinmaxParameterivEXT, _gloffset_GetMinmaxParameteriv, GetMinmaxParameterivEXT@12, GetMinmaxParameteriv, GetMinmaxParameteriv@12) -#endif - GL_STUB_ALIAS(HistogramEXT, _gloffset_Histogram, HistogramEXT@16, Histogram, Histogram@16) - GL_STUB_ALIAS(MinmaxEXT, _gloffset_Minmax, MinmaxEXT@12, Minmax, Minmax@12) - GL_STUB_ALIAS(ResetHistogramEXT, _gloffset_ResetHistogram, ResetHistogramEXT@4, ResetHistogram, ResetHistogram@4) - GL_STUB_ALIAS(ResetMinmaxEXT, _gloffset_ResetMinmax, ResetMinmaxEXT@4, ResetMinmax, ResetMinmax@4) GL_STUB_ALIAS(TexImage3DEXT, _gloffset_TexImage3D, TexImage3DEXT@40, TexImage3D, TexImage3D@40) GL_STUB_ALIAS(TexSubImage3DEXT, _gloffset_TexSubImage3D, TexSubImage3DEXT@44, TexSubImage3D, TexSubImage3D@44) GL_STUB_ALIAS(CopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D, CopyTexSubImage3DEXT@36, CopyTexSubImage3D, CopyTexSubImage3D@36) @@ -1127,7 +1069,6 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(MultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4iv@8, MultiTexCoord4ivARB, MultiTexCoord4ivARB@8) GL_STUB_ALIAS(MultiTexCoord4s, _gloffset_MultiTexCoord4sARB, MultiTexCoord4s@20, MultiTexCoord4sARB, MultiTexCoord4sARB@20) GL_STUB_ALIAS(MultiTexCoord4sv, _gloffset_MultiTexCoord4svARB, MultiTexCoord4sv@8, MultiTexCoord4svARB, MultiTexCoord4svARB@8) - GL_STUB_ALIAS(StencilOpSeparateATI, _gloffset_StencilOpSeparate, StencilOpSeparateATI@16, StencilOpSeparate, StencilOpSeparate@16) GL_STUB_ALIAS(LoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixd@4, LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4) GL_STUB_ALIAS(LoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixf@4, LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4) GL_STUB_ALIAS(MultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixd@4, MultTransposeMatrixdARB, MultTransposeMatrixdARB@4) @@ -1242,10 +1183,8 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(RenderbufferStorageMultisampleEXT, _gloffset_RenderbufferStorageMultisample, RenderbufferStorageMultisampleEXT@20, RenderbufferStorageMultisample, RenderbufferStorageMultisample@20) GL_STUB_ALIAS(PointParameterf, _gloffset_PointParameterfEXT, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8) GL_STUB_ALIAS(PointParameterfARB, _gloffset_PointParameterfEXT, PointParameterfARB@8, PointParameterfEXT, PointParameterfEXT@8) - GL_STUB_ALIAS(PointParameterfSGIS, _gloffset_PointParameterfEXT, PointParameterfSGIS@8, PointParameterfEXT, PointParameterfEXT@8) GL_STUB_ALIAS(PointParameterfv, _gloffset_PointParameterfvEXT, PointParameterfv@8, PointParameterfvEXT, PointParameterfvEXT@8) GL_STUB_ALIAS(PointParameterfvARB, _gloffset_PointParameterfvEXT, PointParameterfvARB@8, PointParameterfvEXT, PointParameterfvEXT@8) - GL_STUB_ALIAS(PointParameterfvSGIS, _gloffset_PointParameterfvEXT, PointParameterfvSGIS@8, PointParameterfvEXT, PointParameterfvEXT@8) GL_STUB_ALIAS(SecondaryColor3b, _gloffset_SecondaryColor3bEXT, SecondaryColor3b@12, SecondaryColor3bEXT, SecondaryColor3bEXT@12) GL_STUB_ALIAS(SecondaryColor3bv, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bv@4, SecondaryColor3bvEXT, SecondaryColor3bvEXT@4) GL_STUB_ALIAS(SecondaryColor3d, _gloffset_SecondaryColor3dEXT, SecondaryColor3d@24, SecondaryColor3dEXT, SecondaryColor3dEXT@24) @@ -1271,7 +1210,6 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(FogCoordf, _gloffset_FogCoordfEXT, FogCoordf@4, FogCoordfEXT, FogCoordfEXT@4) GL_STUB_ALIAS(FogCoordfv, _gloffset_FogCoordfvEXT, FogCoordfv@4, FogCoordfvEXT, FogCoordfvEXT@4) GL_STUB_ALIAS(BlendFuncSeparate, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparate@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) - GL_STUB_ALIAS(BlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateINGR@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) GL_STUB_ALIAS(WindowPos2d, _gloffset_WindowPos2dMESA, WindowPos2d@16, WindowPos2dMESA, WindowPos2dMESA@16) GL_STUB_ALIAS(WindowPos2dARB, _gloffset_WindowPos2dMESA, WindowPos2dARB@16, WindowPos2dMESA, WindowPos2dMESA@16) GL_STUB_ALIAS(WindowPos2dv, _gloffset_WindowPos2dvMESA, WindowPos2dv@4, WindowPos2dvMESA, WindowPos2dvMESA@4) @@ -1312,6 +1250,9 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(IsProgramARB, _gloffset_IsProgramNV, IsProgramARB@4, IsProgramNV, IsProgramNV@4) GL_STUB_ALIAS(PointParameteri, _gloffset_PointParameteriNV, PointParameteri@8, PointParameteriNV, PointParameteriNV@8) GL_STUB_ALIAS(PointParameteriv, _gloffset_PointParameterivNV, PointParameteriv@8, PointParameterivNV, PointParameterivNV@8) + GL_STUB_ALIAS(DeleteVertexArrays, _gloffset_DeleteVertexArraysAPPLE, DeleteVertexArrays@8, _dispatch_stub_755, _dispatch_stub_755@8) + GL_STUB_ALIAS(IsVertexArray, _gloffset_IsVertexArrayAPPLE, IsVertexArray@4, _dispatch_stub_757, _dispatch_stub_757@4) + GL_STUB_ALIAS(BlendEquationSeparate, _gloffset_BlendEquationSeparateEXT, BlendEquationSeparate@8, _dispatch_stub_765, _dispatch_stub_765@8) GL_STUB_ALIAS(BindFramebuffer, _gloffset_BindFramebufferEXT, BindFramebuffer@8, BindFramebufferEXT, BindFramebufferEXT@8) GL_STUB_ALIAS(BindRenderbuffer, _gloffset_BindRenderbufferEXT, BindRenderbuffer@8, BindRenderbufferEXT, BindRenderbufferEXT@8) GL_STUB_ALIAS(CheckFramebufferStatus, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatus@4, CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4) @@ -1329,6 +1270,7 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(IsFramebuffer, _gloffset_IsFramebufferEXT, IsFramebuffer@4, IsFramebufferEXT, IsFramebufferEXT@4) GL_STUB_ALIAS(IsRenderbuffer, _gloffset_IsRenderbufferEXT, IsRenderbuffer@4, IsRenderbufferEXT, IsRenderbufferEXT@4) GL_STUB_ALIAS(RenderbufferStorage, _gloffset_RenderbufferStorageEXT, RenderbufferStorage@16, RenderbufferStorageEXT, RenderbufferStorageEXT@16) + GL_STUB_ALIAS(BlitFramebuffer, _gloffset_BlitFramebufferEXT, BlitFramebuffer@40, _dispatch_stub_783, _dispatch_stub_783@40) GL_STUB_ALIAS(FramebufferTextureLayer, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayer@20, FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) GL_STUB_ALIAS(ProvokingVertex, _gloffset_ProvokingVertexEXT, ProvokingVertex@4, ProvokingVertexEXT, ProvokingVertexEXT@4) |