diff options
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r-- | mesalib/src/mesa/drivers/windows/gdi/wmesa.c | 474 | ||||
-rw-r--r-- | mesalib/src/mesa/main/api_exec.c | 34 | ||||
-rw-r--r-- | mesalib/src/mesa/main/enums.h | 12 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mfeatures.h | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_msaa.c | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_texture.c | 8 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_extensions.c | 3 |
7 files changed, 11 insertions, 527 deletions
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c index 1580e5727..5728d3aa4 100644 --- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c +++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c @@ -417,480 +417,6 @@ static void clear(struct gl_context *ctx, GLbitfield mask) } -/**********************************************************************/ -/***** PIXEL Functions *****/ -/**********************************************************************/ - -#define FLIP(Y) (rb->Height - (Y) - 1) - - -/** - ** Front Buffer reading/writing - ** These are slow, but work with all non-indexed visual types. - **/ - -/* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - WMesaContext pwc = wmesa_context(ctx); - WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(pwc->hDC); - HBITMAP bmp=0; - HDC mdc=0; - typedef union - { - unsigned i; - struct { - unsigned b:8, g:8, r:8, a:8; - }; - } BGRA; - BGRA *bgra, c; - GLuint i; - - if (n < 16) { // the value 16 is just guessed - y=FLIP(y); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - SetPixel(pwc->hDC, x+i, y, - RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); - } - else { - for (i=0; i<n; i++) - SetPixel(pwc->hDC, x+i, y, - RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); - } - } - else { - if (!pwfb) { - _mesa_problem(NULL, "wmesa: write_rgba_span_front on unknown hdc"); - return; - } - bgra=malloc(n*sizeof(BGRA)); - if (!bgra) { - _mesa_problem(NULL, "wmesa: write_rgba_span_front: out of memory"); - return; - } - c.a=0; - if (mask) { - for (i=0; i<n; i++) { - if (mask[i]) { - c.r=rgba[i][RCOMP]; - c.g=rgba[i][GCOMP]; - c.b=rgba[i][BCOMP]; - c.a=rgba[i][ACOMP]; - bgra[i]=c; - } - else - bgra[i].i=0; - } - } - else { - for (i=0; i<n; i++) { - c.r=rgba[i][RCOMP]; - c.g=rgba[i][GCOMP]; - c.b=rgba[i][BCOMP]; - c.a=rgba[i][ACOMP]; - bgra[i]=c; - } - } - bmp=CreateBitmap(n, 1, 1, 32, bgra); - mdc=CreateCompatibleDC(pwfb->hDC); - SelectObject(mdc, bmp); - y=FLIP(y); - BitBlt(pwfb->hDC, x, y, n, 1, mdc, 0, 0, SRCCOPY); - SelectObject(mdc, 0); - DeleteObject(bmp); - DeleteDC(mdc); - free(bgra); - } -} - - -/* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - GLuint i; - WMesaContext pwc = wmesa_context(ctx); - (void) ctx; - for (i=0; i<n; i++) - if (mask[i]) - SetPixel(pwc->hDC, x[i], FLIP(y[i]), - RGB(rgba[i][RCOMP], rgba[i][GCOMP], - rgba[i][BCOMP])); -} - - - -/* Read a horizontal span of color pixels. */ -static void read_rgba_span_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - WMesaContext pwc = wmesa_context(ctx); - GLuint i; - COLORREF Color; - y = FLIP(y); - for (i=0; i<n; i++) { - Color = GetPixel(pwc->hDC, x+i, y); - rgba[i][RCOMP] = GetRValue(Color); - rgba[i][GCOMP] = GetGValue(Color); - rgba[i][BCOMP] = GetBValue(Color); - rgba[i][ACOMP] = 255; - } -} - - -/* Read an array of color pixels. */ -static void read_rgba_pixels_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - WMesaContext pwc = wmesa_context(ctx); - GLuint i; - COLORREF Color; - for (i=0; i<n; i++) { - GLint y2 = FLIP(y[i]); - Color = GetPixel(pwc->hDC, x[i], y2); - rgba[i][RCOMP] = GetRValue(Color); - rgba[i][GCOMP] = GetGValue(Color); - rgba[i][BCOMP] = GetBValue(Color); - rgba[i][ACOMP] = 255; - } -} - -/*********************************************************************/ - -/* DOUBLE BUFFER 32-bit */ - -#define WMSETPIXEL32(pwc, y, x, r, g, b) { \ -LPDWORD lpdw = ((LPDWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \ -*lpdw = BGR32((r),(g),(b)); } - - - -/* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - GLuint i; - LPDWORD lpdw; - - (void) ctx; - - y=FLIP(y); - lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpdw[i] = BGR32(rgba[i][RCOMP], rgba[i][GCOMP], - rgba[i][BCOMP]); - } - else { - for (i=0; i<n; i++) - *lpdw++ = BGR32(rgba[i][RCOMP], rgba[i][GCOMP], - rgba[i][BCOMP]); - } -} - - -/* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL32(pwfb, FLIP(y[i]), x[i], - rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); -} - - -/* Read a horizontal span of color pixels. */ -static void read_rgba_span_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - GLuint i; - DWORD pixel; - LPDWORD lpdw; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - - y = FLIP(y); - lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - for (i=0; i<n; i++) { - pixel = lpdw[i]; - rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16); - rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8); - rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff); - rgba[i][ACOMP] = 255; - } -} - - -/* Read an array of color pixels. */ -static void read_rgba_pixels_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - GLuint i; - DWORD pixel; - LPDWORD lpdw; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - - for (i=0; i<n; i++) { - GLint y2 = FLIP(y[i]); - lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i]; - pixel = *lpdw; - rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16); - rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8); - rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff); - rgba[i][ACOMP] = 255; - } -} - - -/*********************************************************************/ - -/* DOUBLE BUFFER 24-bit */ - -#define WMSETPIXEL24(pwc, y, x, r, g, b) { \ -LPBYTE lpb = ((LPBYTE)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (3 * x)); \ -lpb[0] = (b); \ -lpb[1] = (g); \ -lpb[2] = (r); } - -/* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - GLuint i; - LPBYTE lpb; - - (void) ctx; - - y=FLIP(y); - lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) { - lpb[3*i] = rgba[i][BCOMP]; - lpb[3*i+1] = rgba[i][GCOMP]; - lpb[3*i+2] = rgba[i][RCOMP]; - } - } - else { - for (i=0; i<n; i++) { - *lpb++ = rgba[i][BCOMP]; - *lpb++ = rgba[i][GCOMP]; - *lpb++ = rgba[i][RCOMP]; - } - } -} - - -/* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL24(pwfb, FLIP(y[i]), x[i], - rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); -} - - -/* Read a horizontal span of color pixels. */ -static void read_rgba_span_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - GLuint i; - LPBYTE lpb; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - - y = FLIP(y); - lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); - for (i=0; i<n; i++) { - rgba[i][RCOMP] = lpb[3*i+2]; - rgba[i][GCOMP] = lpb[3*i+1]; - rgba[i][BCOMP] = lpb[3*i]; - rgba[i][ACOMP] = 255; - } -} - - -/* Read an array of color pixels. */ -static void read_rgba_pixels_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - GLuint i; - LPBYTE lpb; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - - for (i=0; i<n; i++) { - GLint y2 = FLIP(y[i]); - lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + (3 * x[i]); - rgba[i][RCOMP] = lpb[3*i+2]; - rgba[i][GCOMP] = lpb[3*i+1]; - rgba[i][BCOMP] = lpb[3*i]; - rgba[i][ACOMP] = 255; - } -} - - -/*********************************************************************/ - -/* DOUBLE BUFFER 16-bit */ - -#define WMSETPIXEL16(pwc, y, x, r, g, b) { \ -LPWORD lpw = ((LPWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \ -*lpw = BGR16((r),(g),(b)); } - - - -/* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - GLuint i; - LPWORD lpw; - - (void) ctx; - - y=FLIP(y); - lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpw[i] = BGR16(rgba[i][RCOMP], rgba[i][GCOMP], - rgba[i][BCOMP]); - } - else { - for (i=0; i<n; i++) - *lpw++ = BGR16(rgba[i][RCOMP], rgba[i][GCOMP], - rgba[i][BCOMP]); - } -} - - - -/* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - (void) ctx; - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL16(pwfb, FLIP(y[i]), x[i], - rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); -} - - -/* Read a horizontal span of color pixels. */ -static void read_rgba_span_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - GLuint i, pixel; - LPWORD lpw; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - - y = FLIP(y); - lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - for (i=0; i<n; i++) { - pixel = lpw[i]; - /* Windows uses 5,5,5 for 16-bit */ - rgba[i][RCOMP] = (pixel & 0x7c00) >> 7; - rgba[i][GCOMP] = (pixel & 0x03e0) >> 2; - rgba[i][BCOMP] = (pixel & 0x001f) << 3; - rgba[i][ACOMP] = 255; - } -} - - -/* Read an array of color pixels. */ -static void read_rgba_pixels_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - void *values) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4])values; - GLuint i, pixel; - LPWORD lpw; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - - for (i=0; i<n; i++) { - GLint y2 = FLIP(y[i]); - lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i]; - pixel = *lpw; - /* Windows uses 5,5,5 for 16-bit */ - rgba[i][RCOMP] = (pixel & 0x7c00) >> 7; - rgba[i][GCOMP] = (pixel & 0x03e0) >> 2; - rgba[i][BCOMP] = (pixel & 0x001f) << 3; - rgba[i][ACOMP] = 255; - } -} - - - /**********************************************************************/ /***** BUFFER Functions *****/ diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c index a5e5f26d2..d2f14ce1a 100644 --- a/mesalib/src/mesa/main/api_exec.c +++ b/mesalib/src/mesa/main/api_exec.c @@ -112,9 +112,7 @@ _mesa_create_exec_table(struct gl_context *ctx) if (exec == NULL) return NULL; -#if _HAVE_FULL_GL _mesa_loopback_init_api_table(ctx, exec); -#endif /* load the dispatch slots we understand */ if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { @@ -306,7 +304,6 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_BindTexture(exec, _mesa_BindTexture); SET_DeleteTextures(exec, _mesa_DeleteTextures); SET_GenTextures(exec, _mesa_GenTextures); -#if _HAVE_FULL_GL if (ctx->API == API_OPENGL) { SET_AreTexturesResident(exec, _mesa_AreTexturesResident); SET_ColorPointer(exec, _mesa_ColorPointer); @@ -336,14 +333,11 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_TexCoordPointer(exec, _mesa_TexCoordPointer); SET_VertexPointer(exec, _mesa_VertexPointer); } -#endif /* 1.2 */ -#if _HAVE_FULL_GL SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D); SET_TexImage3D(exec, _mesa_TexImage3D); SET_TexSubImage3D(exec, _mesa_TexSubImage3D); -#endif /* OpenGL 1.2 GL_ARB_imaging */ SET_BlendColor(exec, _mesa_BlendColor); @@ -370,11 +364,9 @@ _mesa_create_exec_table(struct gl_context *ctx) #endif /* 3. GL_EXT_polygon_offset */ -#if _HAVE_FULL_GL if (ctx->API == API_OPENGL) { SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT); } -#endif /* 6. GL_EXT_texture3d */ #if 0 @@ -407,7 +399,6 @@ _mesa_create_exec_table(struct gl_context *ctx) #endif /* 30. GL_EXT_vertex_array */ -#if _HAVE_FULL_GL if (ctx->API == API_OPENGL) { SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT); SET_EdgeFlagPointerEXT(exec, _mesa_EdgeFlagPointerEXT); @@ -416,7 +407,6 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_TexCoordPointerEXT(exec, _mesa_TexCoordPointerEXT); SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT); } -#endif /* 37. GL_EXT_blend_minmax */ #if 0 @@ -424,52 +414,40 @@ _mesa_create_exec_table(struct gl_context *ctx) #endif /* 54. GL_EXT_point_parameters */ -#if _HAVE_FULL_GL if (ctx->API != API_OPENGLES2) { SET_PointParameterfEXT(exec, _mesa_PointParameterf); SET_PointParameterfvEXT(exec, _mesa_PointParameterfv); } -#endif /* 95. GL_ARB_ES2_compatibility */ SET_ClearDepthf(exec, _mesa_ClearDepthf); SET_DepthRangef(exec, _mesa_DepthRangef); /* 97. GL_EXT_compiled_vertex_array */ -#if _HAVE_FULL_GL if (ctx->API == API_OPENGL) { SET_LockArraysEXT(exec, _mesa_LockArraysEXT); SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT); } -#endif /* 148. GL_EXT_multi_draw_arrays */ -#if _HAVE_FULL_GL SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT); -#endif /* 173. GL_INGR_blend_func_separate */ -#if _HAVE_FULL_GL SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT); -#endif /* 196. GL_MESA_resize_buffers */ -#if _HAVE_FULL_GL if (_mesa_is_desktop_gl(ctx)) { SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA); } -#endif /* 197. GL_MESA_window_pos */ /* part of _mesa_init_rastpos_dispatch(exec); */ /* 200. GL_IBM_multimode_draw_arrays */ -#if _HAVE_FULL_GL if (ctx->API != API_OPENGLES2) { SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM); SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM); } -#endif /* 233. GL_NV_vertex_program */ if (ctx->API == API_OPENGL) { @@ -490,19 +468,15 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE); /* 262. GL_NV_point_sprite */ -#if _HAVE_FULL_GL if (_mesa_is_desktop_gl(ctx)) { SET_PointParameteriNV(exec, _mesa_PointParameteri); SET_PointParameterivNV(exec, _mesa_PointParameteriv); } -#endif /* 268. GL_EXT_stencil_two_side */ -#if _HAVE_FULL_GL if (ctx->API == API_OPENGL) { SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT); } -#endif /* 285. GL_NV_primitive_restart */ if (ctx->API != API_OPENGLES2) { @@ -526,30 +500,23 @@ _mesa_create_exec_table(struct gl_context *ctx) } /* ARB 1. GL_ARB_multitexture */ -#if _HAVE_FULL_GL SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB); if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { SET_ClientActiveTextureARB(exec, _mesa_ClientActiveTextureARB); } -#endif /* ARB 3. GL_ARB_transpose_matrix */ -#if _HAVE_FULL_GL if (ctx->API == API_OPENGL) { SET_LoadTransposeMatrixdARB(exec, _mesa_LoadTransposeMatrixdARB); SET_LoadTransposeMatrixfARB(exec, _mesa_LoadTransposeMatrixfARB); SET_MultTransposeMatrixdARB(exec, _mesa_MultTransposeMatrixdARB); SET_MultTransposeMatrixfARB(exec, _mesa_MultTransposeMatrixfARB); } -#endif /* ARB 5. GL_ARB_multisample */ -#if _HAVE_FULL_GL SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB); -#endif /* ARB 12. GL_ARB_texture_compression */ -#if _HAVE_FULL_GL if (ctx->API != API_OPENGLES2) { SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB); SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB); @@ -565,7 +532,6 @@ _mesa_create_exec_table(struct gl_context *ctx) if (ctx->API != API_OPENGLES2) { SET_GetnCompressedTexImageARB(exec, _mesa_GetnCompressedTexImageARB); } -#endif /* ARB 14. GL_ARB_point_parameters */ /* reuse EXT_point_parameters functions */ diff --git a/mesalib/src/mesa/main/enums.h b/mesalib/src/mesa/main/enums.h index 7733df22f..8f4069426 100644 --- a/mesalib/src/mesa/main/enums.h +++ b/mesalib/src/mesa/main/enums.h @@ -38,8 +38,6 @@ #include "mfeatures.h" -#if defined(_HAVE_FULL_GL) && _HAVE_FULL_GL - extern const char *_mesa_lookup_enum_by_nr( int nr ); /* Get the name of an enum given that it is a primitive type. Avoids @@ -49,14 +47,4 @@ const char *_mesa_lookup_prim_by_nr( unsigned nr ); extern int _mesa_lookup_enum_by_name( const char *symbol ); -#else - -/** No-op */ -#define _mesa_lookup_enum_by_name( s ) 0 - -/** No-op */ -#define _mesa_lookup_enum_by_nr( n ) "unknown" - -#endif - #endif diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h index 829c0563b..55e9cf9c4 100644 --- a/mesalib/src/mesa/main/mfeatures.h +++ b/mesalib/src/mesa/main/mfeatures.h @@ -31,10 +31,6 @@ #ifndef FEATURES_H #define FEATURES_H -#ifndef _HAVE_FULL_GL -#define _HAVE_FULL_GL 1 -#endif - #ifndef FEATURE_ES1 #define FEATURE_ES1 0 #endif diff --git a/mesalib/src/mesa/state_tracker/st_atom_msaa.c b/mesalib/src/mesa/state_tracker/st_atom_msaa.c index ea9eb9a6d..9baa4fcf2 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_msaa.c +++ b/mesalib/src/mesa/state_tracker/st_atom_msaa.c @@ -51,7 +51,8 @@ static void update_sample_mask( struct st_context *st ) /* unlike in gallium/d3d10 the mask is only active if msaa is enabled */ if (st->ctx->Multisample.SampleCoverage) { unsigned nr_bits; - nr_bits = st->ctx->Multisample.SampleCoverageValue * (float)sample_count; + nr_bits = (unsigned) + (st->ctx->Multisample.SampleCoverageValue * (float)sample_count); /* there's lot of ways how to do this. We just use first few bits, since we have no knowledge of sample positions here. When app-supplied mask though is used too might need to be smarter. diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c index 5bf3dc699..b19dc67bf 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_texture.c +++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c @@ -375,6 +375,8 @@ guess_and_alloc_texture(struct st_context *st, */ if ((stObj->base.Sampler.MinFilter == GL_NEAREST || stObj->base.Sampler.MinFilter == GL_LINEAR || + (stObj->base.BaseLevel == 0 && + stObj->base.MaxLevel == 0) || stImage->base._BaseFormat == GL_DEPTH_COMPONENT || stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) && !stObj->base.GenerateMipmap && @@ -1111,11 +1113,15 @@ copy_image_data_to_texture(struct st_context *st, /* Copy potentially with the blitter: */ GLuint src_level; - if (stImage->pt != stObj->pt) + if (stImage->pt->last_level == 0) src_level = 0; else src_level = stImage->base.Level; + assert(src_level <= stImage->pt->last_level); + assert(u_minify(stImage->pt->width0, src_level) == stImage->base.Width); + assert(u_minify(stImage->pt->height0, src_level) == stImage->base.Height); + st_texture_image_copy(st->pipe, stObj->pt, dstLevel, /* dest texture, level */ stImage->pt, src_level, /* src texture, level */ diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 08a41c3e2..0560f3a8a 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -298,7 +298,8 @@ static void init_format_extensions(struct st_context *st, { struct pipe_screen *screen = st->pipe->screen; GLboolean *extensions = (GLboolean *) &st->ctx->Extensions; - int i, j; + unsigned i; + int j; int num_formats = Elements(mapping->format); int num_ext = Elements(mapping->extension_offset); |