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.mk45
-rw-r--r--mesalib/src/mesa/Makefile17
-rw-r--r--mesalib/src/mesa/main/bufferobj.c10
-rw-r--r--mesalib/src/mesa/main/dlist.c3
-rw-r--r--mesalib/src/mesa/sources.mak2
5 files changed, 48 insertions, 29 deletions
diff --git a/mesalib/src/mesa/Android.gen.mk b/mesalib/src/mesa/Android.gen.mk
index 2a08184ae..2ea8cc433 100644
--- a/mesalib/src/mesa/Android.gen.mk
+++ b/mesalib/src/mesa/Android.gen.mk
@@ -28,16 +28,13 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
endif
intermediates := $(call local-intermediates-dir)
+mydir := $(call my-dir)
sources := \
- main/api_exec_es1.c \
main/api_exec_es1_dispatch.h \
main/api_exec_es1_remap_helper.h \
- main/api_exec_es2.c \
main/api_exec_es2_dispatch.h \
- main/api_exec_es2_remap_helper.h \
- program/lex.yy.c \
- program/program_parse.tab.c
+ main/api_exec_es2_remap_helper.h
LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES))
@@ -53,6 +50,7 @@ endif
sources += main/git_sha1.h
sources := $(addprefix $(intermediates)/, $(sources))
+
LOCAL_GENERATED_SOURCES += $(sources)
glapi := $(MESA_TOP)/src/mapi/glapi/gen
@@ -73,43 +71,31 @@ define es-gen
$(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@
endef
-define local-l-to-c
- @mkdir -p $(dir $@)
- @echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
- $(hide) $(LEX) -o$@ $<
-endef
-
-define local-y-to-c-and-h
- @mkdir -p $(dir $@)
- @echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<"
- $(hide) $(YACC) -o $@ $<
+define generate-local
+ @echo "generate local sources"
+ $(hide) $(MESA_PYTHON2) $(glapi)/gl_enums.py -f $(glapi)/gl_and_es_API.xml > $(mydir)/main/enums.c
+ $(hide) $(MESA_PYTHON2) $(glapi)/gl_table.py -m remap_table -f $(glapi)/gl_and_es_API.xml > $(mydir)/main/dispatch.h
+ $(hide) $(MESA_PYTHON2) $(glapi)/remap_helper.py -f $(glapi)/gl_API.xml > $(mydir)/main/remap_helper.h
+ $(hide) $(MESA_PYTHON2) $(mydir)/main/es_generator.py -V GLES1.1 -S $(mydir)/main/APIspec.xml > $(mydir)/main/api_exec_es1.c
+ $(hide) $(MESA_PYTHON2) $(mydir)/main/es_generator.py -V GLES2.0 -S $(mydir)/main/APIspec.xml > $(mydir)/main/api_exec_es2.c
+
+ @echo "Mesa Lex : $(PRIVATE_MODULE)"
+ $(hide) $(LEX) -o $(mydir)/program/lex.yy.c $(mydir)/program/program_lexer.l
+ @echo "Mesa Yacc: $(PRIVATE_MODULE)"
+ $(hide) $(YACC) -d -o $(mydir)/program/program_parse.tab.c $(mydir)/program/program_parse.y
endef
-$(intermediates)/main/api_exec_%.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/main/es_generator.py
-$(intermediates)/main/api_exec_%.c: PRIVATE_XML := -S $(LOCAL_PATH)/main/APIspec.xml
$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/remap_helper.py
$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
-$(intermediates)/main/api_exec_es1.c: $(es_src_deps)
- $(call es-gen,-V GLES1.1)
-
-$(intermediates)/main/api_exec_es2.c: $(es_src_deps)
- $(call es-gen,-V GLES2.0)
-
$(intermediates)/main/api_exec_%_dispatch.h: $(es_hdr_deps)
$(call es-gen, -c $* -m remap_table)
$(intermediates)/main/api_exec_%_remap_helper.h: $(es_hdr_deps)
$(call es-gen, -c $*)
-$(intermediates)/program/program_parse.tab.c: $(LOCAL_PATH)/program/program_parse.y
- $(local-y-to-c-and-h)
-
-$(intermediates)/program/lex.yy.c: $(LOCAL_PATH)/program/program_lexer.l
- $(local-l-to-c)
-
$(intermediates)/main/git_sha1.h:
@mkdir -p $(dir $@)
@echo "GIT-SHA1: $(PRIVATE_MODULE) <= git"
@@ -129,3 +115,4 @@ $(intermediates)/x86/matypes.h: $(matypes_deps)
@mkdir -p $(dir $@)
@echo "MATYPES: $(PRIVATE_MODULE) <= $(notdir $@)"
$(hide) $< > $@
+ $(call generate-local)
diff --git a/mesalib/src/mesa/Makefile b/mesalib/src/mesa/Makefile
index 05aea8d93..845b524e6 100644
--- a/mesalib/src/mesa/Makefile
+++ b/mesalib/src/mesa/Makefile
@@ -36,6 +36,23 @@ MESA_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS)
# then convenience libs (.a) and finally the device drivers:
default: $(DEPENDS) asm_subdirs $(MESA_LIBS) driver_subdirs
+.PHONY: main/git_sha1.h.tmp
+main/git_sha1.h.tmp:
+ @touch main/git_sha1.h.tmp
+ @if test -d ../../.git; then \
+ if which git > /dev/null; then \
+ git log -n 1 --oneline | \
+ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
+ > main/git_sha1.h.tmp ; \
+ fi \
+ fi
+
+main/git_sha1.h: main/git_sha1.h.tmp
+ @echo "updating main/git_sha1.h"
+ @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
+ mv main/git_sha1.h.tmp main/git_sha1.h ;\
+ fi
+
# include glapi_gen.mk for generating glapi headers for GLES
GLAPI := $(TOP)/src/mapi/glapi/gen
include $(GLAPI)/glapi_gen.mk
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index a6a269330..3f7db8605 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -848,6 +848,10 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
_mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 );
}
+ if (ctx->Texture.BufferObject == bufObj) {
+ _mesa_BindBufferARB( GL_TEXTURE_BUFFER, 0 );
+ }
+
/* The ID is immediately freed for re-use */
_mesa_HashRemove(ctx->Shared->BufferObjects, ids[i]);
/* Make sure we do not run into the classic ABA problem on bind.
@@ -1360,6 +1364,12 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
return;
}
+ if (size < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyBufferSubData(writeOffset = %d)", (int) size);
+ return;
+ }
+
if (readOffset + size > src->Size) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glCopyBufferSubData(readOffset + size = %d)",
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index c1c65ea25..e04f7ae6b 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -10445,6 +10445,9 @@ _mesa_create_save_table(void)
/* GL_ARB_debug_output (no dlist support) */
_mesa_init_errors_dispatch(table);
+ /* GL_NV_primitive_restart */
+ SET_PrimitiveRestartIndexNV(table, _mesa_PrimitiveRestartIndex);
+
return table;
}
diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak
index 63fbf58c6..608aa79ab 100644
--- a/mesalib/src/mesa/sources.mak
+++ b/mesalib/src/mesa/sources.mak
@@ -1,5 +1,7 @@
### Lists of source files, included by Makefiles
+SRCDIR ?= .
+
# this is part of MAIN_FILES
MAIN_ES_FILES = \
$(SRCDIR)/main/api_exec_es1.c \