aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/drivers')
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c6
-rw-r--r--mesalib/src/mesa/drivers/common/meta_blit.c2
-rw-r--r--mesalib/src/mesa/drivers/common/meta_generate_mipmap.c12
-rw-r--r--mesalib/src/mesa/drivers/dri/Android.mk1
-rw-r--r--mesalib/src/mesa/drivers/dri/common/Android.mk17
-rw-r--r--mesalib/src/mesa/drivers/dri/common/Makefile.am2
-rw-r--r--mesalib/src/mesa/drivers/dri/common/Makefile.sources3
7 files changed, 39 insertions, 4 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index fec0d2be5..1a2e45320 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -801,7 +801,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
int buf, real_color_buffers = 0;
memset(save->ColorDrawBuffers, 0, sizeof(save->ColorDrawBuffers));
- for (buf = 0; buf < MAX_DRAW_BUFFERS; buf++) {
+ for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) {
int buf_index = ctx->DrawBuffer->_ColorDrawBufferIndexes[buf];
if (buf_index == -1)
continue;
@@ -1213,7 +1213,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_BindRenderbuffer(GL_RENDERBUFFER, save->RenderbufferName);
if (state & MESA_META_DRAW_BUFFERS) {
- _mesa_DrawBuffers(MAX_DRAW_BUFFERS, save->ColorDrawBuffers);
+ _mesa_DrawBuffers(ctx->Const.MaxDrawBuffers, save->ColorDrawBuffers);
}
ctx->Meta->SaveStackDepth--;
@@ -1569,6 +1569,7 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
_mesa_AttachShader(clear->ShaderProg, vs);
_mesa_DeleteShader(vs);
_mesa_BindAttribLocation(clear->ShaderProg, 0, "position");
+ _mesa_ObjectLabel(GL_PROGRAM, clear->ShaderProg, -1, "meta clear");
_mesa_LinkProgram(clear->ShaderProg);
clear->ColorLocation = _mesa_GetUniformLocation(clear->ShaderProg,
@@ -2613,6 +2614,7 @@ _mesa_meta_setup_texture_coords(GLenum faceTarget,
break;
default:
assert(0);
+ unreachable();
}
coord[3] = (float) (slice / 6);
diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c
index f26ef93c1..bbf0c3c45 100644
--- a/mesalib/src/mesa/drivers/common/meta_blit.c
+++ b/mesalib/src/mesa/drivers/common/meta_blit.c
@@ -407,7 +407,7 @@ blitframebuffer_texture(struct gl_context *ctx,
}
} else {
GLenum tex_base_format;
- int srcW = abs(srcY1 - srcY0);
+ int srcW = abs(srcX1 - srcX0);
int srcH = abs(srcY1 - srcY0);
/* Fall back to doing a CopyTexSubImage to get the destination
* renderbuffer into a texture.
diff --git a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
index d12806c3d..4b1718df9 100644
--- a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
+++ b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
@@ -43,6 +43,7 @@
#include "main/varray.h"
#include "main/viewport.h"
#include "drivers/common/meta.h"
+#include "program/prog_instruction.h"
/**
@@ -168,6 +169,8 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
GLenum faceTarget;
GLuint dstLevel;
GLuint samplerSave;
+ GLint swizzle[4];
+ GLboolean swizzleSaved = GL_FALSE;
if (fallback_required(ctx, target, texObj)) {
_mesa_generate_mipmap(ctx, target, texObj);
@@ -231,6 +234,13 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE);
+ if (texObj->_Swizzle != SWIZZLE_NOOP) {
+ static const GLint swizzleNoop[4] = { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA };
+ memcpy(swizzle, texObj->Swizzle, sizeof(swizzle));
+ swizzleSaved = GL_TRUE;
+ _mesa_TexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, swizzleNoop);
+ }
+
/* Silence valgrind warnings about reading uninitialized stack. */
memset(verts, 0, sizeof(verts));
@@ -347,4 +357,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave);
if (genMipmapSave)
_mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave);
+ if (swizzleSaved)
+ _mesa_TexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
}
diff --git a/mesalib/src/mesa/drivers/dri/Android.mk b/mesalib/src/mesa/drivers/dri/Android.mk
index 9adf0b386..e0cf51c58 100644
--- a/mesalib/src/mesa/drivers/dri/Android.mk
+++ b/mesalib/src/mesa/drivers/dri/Android.mk
@@ -43,6 +43,7 @@ MESA_DRI_C_INCLUDES := \
MESA_DRI_WHOLE_STATIC_LIBRARIES := \
libmesa_glsl \
+ libmegadriver_stub \
libmesa_dri_common \
libmesa_dricore
diff --git a/mesalib/src/mesa/drivers/dri/common/Android.mk b/mesalib/src/mesa/drivers/dri/common/Android.mk
index 0489a32de..a172a0bc6 100644
--- a/mesalib/src/mesa/drivers/dri/common/Android.mk
+++ b/mesalib/src/mesa/drivers/dri/common/Android.mk
@@ -86,3 +86,20 @@ $(intermediates)/xmlpool/options.h: $$(PRIVATE_SCRIPT) $$(PRIVATE_TEMPLATE_HEADE
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
+
+#
+# Build libmegadriver_stub
+#
+
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/Makefile.sources
+
+LOCAL_MODULE := libmegadriver_stub
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_C_INCLUDES := \
+ $(MESA_DRI_C_INCLUDES)
+
+LOCAL_SRC_FILES := $(megadriver_stub_FILES)
+
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/mesalib/src/mesa/drivers/dri/common/Makefile.am b/mesalib/src/mesa/drivers/dri/common/Makefile.am
index c98ccf7b8..7222a96c6 100644
--- a/mesalib/src/mesa/drivers/dri/common/Makefile.am
+++ b/mesalib/src/mesa/drivers/dri/common/Makefile.am
@@ -42,7 +42,7 @@ libdricommon_la_SOURCES = $(DRI_COMMON_FILES)
libdri_test_stubs_la_SOURCES = $(test_stubs_FILES)
libdri_test_stubs_la_CFLAGS = $(AM_CFLAGS) -DNO_MAIN
-libmegadriver_stub_la_SOURCES = megadriver_stub.c
+libmegadriver_stub_la_SOURCES = $(megadriver_stub_FILES)
sysconf_DATA = drirc
diff --git a/mesalib/src/mesa/drivers/dri/common/Makefile.sources b/mesalib/src/mesa/drivers/dri/common/Makefile.sources
index 8469b4950..43b289e90 100644
--- a/mesalib/src/mesa/drivers/dri/common/Makefile.sources
+++ b/mesalib/src/mesa/drivers/dri/common/Makefile.sources
@@ -14,3 +14,6 @@ mesa_dri_common_INCLUDES := \
test_stubs_FILES := \
dri_test.c
+
+megadriver_stub_FILES := \
+ megadriver_stub.c