aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r--mesalib/src/mesa/Android.gen.mk9
-rw-r--r--mesalib/src/mesa/Android.libmesa_dricore.mk3
-rw-r--r--mesalib/src/mesa/Android.libmesa_glsl_utils.mk4
-rw-r--r--mesalib/src/mesa/Android.libmesa_st_mesa.mk3
-rwxr-xr-x[-rw-r--r--]mesalib/src/mesa/drivers/common/meta_blit.c15
-rw-r--r--mesalib/src/mesa/main/api_validate.c5
-rw-r--r--mesalib/src/mesa/main/context.c38
-rw-r--r--mesalib/src/mesa/main/texgetimage.c9
-rw-r--r--mesalib/src/mesa/main/teximage.c2
-rw-r--r--mesalib/src/mesa/main/varray.c6
-rw-r--r--mesalib/src/mesa/program/Android.mk3
11 files changed, 77 insertions, 20 deletions
diff --git a/mesalib/src/mesa/Android.gen.mk b/mesalib/src/mesa/Android.gen.mk
index c6280f5cb..c7b7f7edf 100644
--- a/mesalib/src/mesa/Android.gen.mk
+++ b/mesalib/src/mesa/Android.gen.mk
@@ -115,3 +115,12 @@ GET_HASH_GEN := $(LOCAL_PATH)/main/get_hash_generator.py
$(intermediates)/main/get_hash.h: $(glapi)/gl_and_es_API.xml \
$(LOCAL_PATH)/main/get_hash_params.py $(GET_HASH_GEN)
@$(MESA_PYTHON2) $(GET_HASH_GEN) -f $< > $@
+
+FORMAT_INFO := $(LOCAL_PATH)/main/format_info.py
+format_info_deps := \
+ $(LOCAL_PATH)/main/formats.csv \
+ $(LOCAL_PATH)/main/format_parser.py \
+ $(FORMAT_INFO)
+
+$(intermediates)/main/format_info.c: $(format_info_deps)
+ @$(MESA_PYTHON2) $(FORMAT_INFO) $< > $@
diff --git a/mesalib/src/mesa/Android.libmesa_dricore.mk b/mesalib/src/mesa/Android.libmesa_dricore.mk
index 28d6feb35..1e6d94872 100644
--- a/mesalib/src/mesa/Android.libmesa_dricore.mk
+++ b/mesalib/src/mesa/Android.libmesa_dricore.mk
@@ -32,6 +32,8 @@ LOCAL_PATH := $(call my-dir)
# MESA_FILES
# X86_FILES
include $(LOCAL_PATH)/Makefile.sources
+SRCDIR :=
+BUILDDIR :=
include $(CLEAR_VARS)
@@ -55,6 +57,7 @@ endif
LOCAL_C_INCLUDES := \
$(call intermediates-dir-for STATIC_LIBRARIES,libmesa_program,,) \
+ $(MESA_TOP)/src \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/glsl \
$(MESA_TOP)/src/gallium/auxiliary
diff --git a/mesalib/src/mesa/Android.libmesa_glsl_utils.mk b/mesalib/src/mesa/Android.libmesa_glsl_utils.mk
index e93891f07..a9f6ff59a 100644
--- a/mesalib/src/mesa/Android.libmesa_glsl_utils.mk
+++ b/mesalib/src/mesa/Android.libmesa_glsl_utils.mk
@@ -36,11 +36,11 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libmesa_glsl_utils
LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src \
$(MESA_TOP)/src/glsl \
$(MESA_TOP)/src/mapi
LOCAL_SRC_FILES := \
- main/hash_table.c \
main/imports.c \
program/prog_hash_table.c \
program/symbol_table.c
@@ -59,11 +59,11 @@ LOCAL_IS_HOST_MODULE := true
LOCAL_CFLAGS := -D_POSIX_C_SOURCE=199309L
LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src \
$(MESA_TOP)/src/glsl \
$(MESA_TOP)/src/mapi
LOCAL_SRC_FILES := \
- main/hash_table.c \
main/imports.c \
program/prog_hash_table.c \
program/symbol_table.c
diff --git a/mesalib/src/mesa/Android.libmesa_st_mesa.mk b/mesalib/src/mesa/Android.libmesa_st_mesa.mk
index e6374a6d8..8b8d652a3 100644
--- a/mesalib/src/mesa/Android.libmesa_st_mesa.mk
+++ b/mesalib/src/mesa/Android.libmesa_st_mesa.mk
@@ -32,6 +32,8 @@ LOCAL_PATH := $(call my-dir)
# MESA_GALLIUM_FILES.
# X86_FILES
include $(LOCAL_PATH)/Makefile.sources
+SRCDIR :=
+BUILDDIR :=
include $(CLEAR_VARS)
@@ -50,6 +52,7 @@ LOCAL_C_INCLUDES := \
$(call intermediates-dir-for STATIC_LIBRARIES,libmesa_program,,) \
$(MESA_TOP)/src/gallium/auxiliary \
$(MESA_TOP)/src/gallium/include \
+ $(MESA_TOP)/src \
$(MESA_TOP)/src/glsl \
$(MESA_TOP)/src/mapi
diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c
index 4ac75e74b..c6616d93d 100644..100755
--- a/mesalib/src/mesa/drivers/common/meta_blit.c
+++ b/mesalib/src/mesa/drivers/common/meta_blit.c
@@ -45,6 +45,7 @@
#include "main/texenv.h"
#include "main/teximage.h"
#include "main/texparam.h"
+#include "main/uniforms.h"
#include "main/varray.h"
#include "main/viewport.h"
#include "swrast/swrast.h"
@@ -69,7 +70,7 @@ setup_glsl_msaa_blit_scaled_shader(struct gl_context *ctx,
const uint8_t *sample_map;
char *sample_map_str = rzalloc_size(mem_ctx, 1);
char *sample_map_expr = rzalloc_size(mem_ctx, 1);
- char *texel_fetch_macro = rzalloc_size(mem_ctx, 1);;
+ char *texel_fetch_macro = rzalloc_size(mem_ctx, 1);
const char *vs_source;
const char *sampler_array_suffix = "";
const char *texcoord_type = "vec2";
@@ -105,11 +106,11 @@ setup_glsl_msaa_blit_scaled_shader(struct gl_context *ctx,
_mesa_UseProgram(blit->msaa_shaders[shader_index]);
/* Update the uniform values. */
loc_src_width =
- _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_width");
+ _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_width");
loc_src_height =
- _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_height");
- _mesa_Uniform1f(loc_src_width, src_rb->Width);
- _mesa_Uniform1f(loc_src_height, src_rb->Height);
+ _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_height");
+ _mesa_Uniform1f(loc_src_width, src_rb->Width);
+ _mesa_Uniform1f(loc_src_height, src_rb->Height);
return;
}
@@ -218,9 +219,9 @@ setup_glsl_msaa_blit_scaled_shader(struct gl_context *ctx,
_mesa_meta_compile_and_link_program(ctx, vs_source, fs_source, name,
&blit->msaa_shaders[shader_index]);
loc_src_width =
- _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_width");
+ _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_width");
loc_src_height =
- _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_height");
+ _mesa_GetUniformLocation(blit->msaa_shaders[shader_index], "src_height");
_mesa_Uniform1f(loc_src_width, src_rb->Width);
_mesa_Uniform1f(loc_src_height, src_rb->Height);
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index 51a3d1f01..9b80600de 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/src/mesa/main/api_validate.c
@@ -112,9 +112,8 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
switch (ctx->API) {
case API_OPENGLES2:
- /* For ES2, we can draw if any vertex array is enabled (and we
- * should always have a vertex program/shader). */
- if (ctx->Array.VAO->_Enabled == 0x0 || !ctx->VertexProgram._Current)
+ /* For ES2, we can draw if we have a vertex program/shader). */
+ if (!ctx->VertexProgram._Current)
return GL_FALSE;
break;
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index 0edd66d6f..5a8f7184a 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -891,10 +891,24 @@ _mesa_generic_nop(void)
/**
- * Allocate and initialize a new dispatch table.
+ * Special no-op glFlush, see below.
+ */
+#if defined(_WIN32)
+static void GLAPIENTRY
+nop_glFlush(void)
+{
+ /* don't record an error like we do in _mesa_generic_nop() */
+}
+#endif
+
+
+/**
+ * Allocate and initialize a new dispatch table. All the dispatch
+ * function pointers will point at the _mesa_generic_nop() function
+ * which raises GL_INVALID_OPERATION.
*/
struct _glapi_table *
-_mesa_alloc_dispatch_table()
+_mesa_alloc_dispatch_table(void)
{
/* Find the larger of Mesa's dispatch table and libGL's dispatch table.
* In practice, this'll be the same for stand-alone Mesa. But for DRI
@@ -911,6 +925,26 @@ _mesa_alloc_dispatch_table()
for (i = 0; i < numEntries; i++) {
entry[i] = (_glapi_proc) _mesa_generic_nop;
}
+
+#if defined(_WIN32)
+ /* This is a special case for Windows in the event that
+ * wglGetProcAddress is called between glBegin/End().
+ *
+ * The MS opengl32.dll library apparently calls glFlush from
+ * wglGetProcAddress(). If we're inside glBegin/End(), glFlush
+ * will dispatch to _mesa_generic_nop() and we'll generate a
+ * GL_INVALID_OPERATION error.
+ *
+ * The specific case which hits this is piglit's primitive-restart
+ * test which calls glPrimitiveRestartNV() inside glBegin/End. The
+ * first time we call glPrimitiveRestartNV() Piglit's API dispatch
+ * code will try to resolve the function by calling wglGetProcAddress.
+ * This raises GL_INVALID_OPERATION and an assert(glGetError()==0)
+ * will fail causing the test to fail. By suppressing the error, the
+ * assertion passes and the test continues.
+ */
+ SET_Flush(table, nop_glFlush);
+#endif
}
return table;
}
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index 2c54e4a35..cb5f7936c 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -78,8 +78,8 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions,
struct gl_texture_image *texImage)
{
const GLint width = texImage->Width;
- const GLint height = texImage->Height;
- const GLint depth = texImage->Depth;
+ GLint height = texImage->Height;
+ GLint depth = texImage->Depth;
GLint img, row;
GLfloat *depthRow = malloc(width * sizeof(GLfloat));
@@ -88,6 +88,11 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions,
return;
}
+ if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
+ depth = height;
+ height = 1;
+ }
+
for (img = 0; img < depth; img++) {
GLubyte *srcMap;
GLint srcRowStride;
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 647d28ab3..c0298af8e 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -2449,7 +2449,7 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions,
/* level check */
if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(level=%d)",
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%uD(level=%d)",
dimensions, level);
return GL_TRUE;
}
diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c
index 09bf52c42..96c2b26f7 100644
--- a/mesalib/src/mesa/main/varray.c
+++ b/mesalib/src/mesa/main/varray.c
@@ -1907,10 +1907,10 @@ static void
print_array(const char *name, GLint index, const struct gl_client_array *array)
{
if (index >= 0)
- printf(" %s[%d]: ", name, index);
+ fprintf(stderr, " %s[%d]: ", name, index);
else
- printf(" %s: ", name);
- printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %lu)\n",
+ fprintf(stderr, " %s: ", name);
+ fprintf(stderr, "Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %lu)\n",
array->Ptr, array->Type, array->Size,
array->_ElementSize, array->StrideB,
array->BufferObj->Name, (unsigned long) array->BufferObj->Size);
diff --git a/mesalib/src/mesa/program/Android.mk b/mesalib/src/mesa/program/Android.mk
index e85afe672..19c4be0fe 100644
--- a/mesalib/src/mesa/program/Android.mk
+++ b/mesalib/src/mesa/program/Android.mk
@@ -39,6 +39,8 @@ endef
# Import the following variables:
# PROGRAM_FILES
include $(MESA_TOP)/src/mesa/Makefile.sources
+SRCDIR :=
+BUILDDIR :=
include $(CLEAR_VARS)
@@ -71,6 +73,7 @@ $(intermediates)/program/lex.yy.c: $(LOCAL_PATH)/program_lexer.l
LOCAL_C_INCLUDES := \
$(intermediates) \
+ $(MESA_TOP)/src \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa \
$(MESA_TOP)/src/glsl