GL: Upgrade to Mesa 9.1.1

* Somefix-ups and repairs for
  changes to how Mesa works internally
* _Flush and _Error need additional
  work as DriverCtx was removed
* Tested working
This commit is contained in:
Alexander von Gluck IV
2013-03-20 01:38:43 -05:00
parent 3764bc554c
commit 5d8d472d1a
4 changed files with 24 additions and 9 deletions
+1 -1
View File
@@ -344,7 +344,7 @@ if $(TARGET_ARCH) = x86 {
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
local zipFile ; local zipFile ;
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_MESA_FILE = mesa-9.0.2-x86-gcc4-2013-02-17.zip ; HAIKU_MESA_FILE = mesa-9.1.1-x86-gcc4-2013-03-20.zip ;
} else { } else {
HAIKU_MESA_FILE = mesa-7.8.2-x86-gcc2-2013-02-17.zip ; HAIKU_MESA_FILE = mesa-7.8.2-x86-gcc2-2013-02-17.zip ;
} }
@@ -23,12 +23,15 @@ extern "C" {
#include "extensions.h" #include "extensions.h"
#include "drivers/common/driverfuncs.h" #include "drivers/common/driverfuncs.h"
#include "drivers/common/meta.h" #include "drivers/common/meta.h"
#include "main/api_exec.h"
#include "main/colormac.h" #include "main/colormac.h"
#include "main/cpuinfo.h" #include "main/cpuinfo.h"
#include "main/buffers.h" #include "main/buffers.h"
#include "main/formats.h" #include "main/formats.h"
#include "main/framebuffer.h" #include "main/framebuffer.h"
#include "main/renderbuffer.h" #include "main/renderbuffer.h"
#include "main/version.h"
#include "main/vtxfmt.h"
#include "swrast/swrast.h" #include "swrast/swrast.h"
#include "swrast/s_renderbuffer.h" #include "swrast/s_renderbuffer.h"
#include "swrast_setup/swrast_setup.h" #include "swrast_setup/swrast_setup.h"
@@ -113,8 +116,8 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options,
functions.Flush = _Flush; functions.Flush = _Flush;
// create core context // create core context
fContext = _mesa_create_context(API_OPENGL, fVisual, NULL, fContext = _mesa_create_context(API_OPENGL_COMPAT, fVisual, NULL,
&functions, this); &functions);
if (!fContext) { if (!fContext) {
ERROR("%s: Failed to create Mesa context!\n", __func__); ERROR("%s: Failed to create Mesa context!\n", __func__);
@@ -140,6 +143,11 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options,
_mesa_enable_2_0_extensions(fContext); _mesa_enable_2_0_extensions(fContext);
_mesa_enable_2_1_extensions(fContext); _mesa_enable_2_1_extensions(fContext);
_mesa_compute_version(fContext);
_mesa_initialize_dispatch_tables(fContext);
_mesa_initialize_vbo_vtxfmt(fContext);
// create core framebuffer // create core framebuffer
fFrameBuffer = _mesa_create_framebuffer(fVisual); fFrameBuffer = _mesa_create_framebuffer(fVisual);
if (fFrameBuffer == NULL) { if (fFrameBuffer == NULL) {
@@ -460,9 +468,13 @@ MesaSoftwareRenderer::_AllocateBitmap()
void void
MesaSoftwareRenderer::_Error(gl_context* ctx) MesaSoftwareRenderer::_Error(gl_context* ctx)
{ {
CALLED();
#if 0
// TODO: err. Mesa dropped DriverCtx
MesaSoftwareRenderer* mr = (MesaSoftwareRenderer*)ctx->DriverCtx; MesaSoftwareRenderer* mr = (MesaSoftwareRenderer*)ctx->DriverCtx;
if (mr && mr->GLView()) if (mr && mr->GLView())
mr->GLView()->ErrorCallback((unsigned long)ctx->ErrorValue); mr->GLView()->ErrorCallback((unsigned long)ctx->ErrorValue);
#endif
} }
@@ -552,13 +564,15 @@ void
MesaSoftwareRenderer::_Flush(gl_context* ctx) MesaSoftwareRenderer::_Flush(gl_context* ctx)
{ {
CALLED(); CALLED();
MesaSoftwareRenderer* mr = (MesaSoftwareRenderer*)ctx->DriverCtx; #if 0
if ((mr->fOptions & BGL_DOUBLE) == 0) { // TODO: err. Mesa dropped DriverCtx
if ((fOptions & BGL_DOUBLE) == 0) {
// TODO: SwapBuffers() can call _CopyToDirect(), which should // TODO: SwapBuffers() can call _CopyToDirect(), which should
// be always called with with the BGLView drawlocked. // be always called with with the BGLView drawlocked.
// This is not always the case if called from here. // This is not always the case if called from here.
mr->SwapBuffers(); SwapBuffers();
} }
#endif
} }
@@ -660,7 +674,8 @@ MesaSoftwareRenderer::_RenderBufferMap(gl_context *ctx,
void void
MesaSoftwareRenderer::_RenderBufferDelete(struct gl_renderbuffer* rb) MesaSoftwareRenderer::_RenderBufferDelete(struct gl_context *ctx,
struct gl_renderbuffer* rb)
{ {
CALLED(); CALLED();
if (rb != NULL) { if (rb != NULL) {
@@ -55,7 +55,8 @@ private:
color_space colorSpace); color_space colorSpace);
/* Mesa callbacks */ /* Mesa callbacks */
static void _RenderBufferDelete(struct gl_renderbuffer* rb); static void _RenderBufferDelete(struct gl_context *ctx,
struct gl_renderbuffer* rb);
static GLboolean _RenderBufferStorage(gl_context* ctx, static GLboolean _RenderBufferStorage(gl_context* ctx,
struct gl_renderbuffer* render, struct gl_renderbuffer* render,
GLenum internalFormat, GLenum internalFormat,
-1
View File
@@ -14,7 +14,6 @@ extern "C" {
#if __GNUC__ > 2 #if __GNUC__ > 2
// New Mesa // New Mesa
#include "glapi_priv.h" #include "glapi_priv.h"
#include "glapitable.h"
#endif #endif