diff options
Diffstat (limited to 'mesalib/src')
21 files changed, 80 insertions, 62 deletions
diff --git a/mesalib/src/glsl/Android.gen.mk b/mesalib/src/glsl/Android.gen.mk index e4ccb7291..2ed9fa64b 100644 --- a/mesalib/src/glsl/Android.gen.mk +++ b/mesalib/src/glsl/Android.gen.mk @@ -52,10 +52,10 @@ define local-l-or-ll-to-c-or-cpp $(hide) $(LEX) --nounistd -o$@ $< endef -define local-y-to-c-and-h +define glsl_local-y-to-c-and-h @mkdir -p $(dir $@) @echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<" - $(hide) $(YACC) -o $@ $< + $(hide) $(YACC) -o $@ -p "glcpp_parser_" $< endef define local-yy-to-cpp-and-h @@ -80,7 +80,7 @@ $(intermediates)/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glcpp/glcpp-lex.l $(call local-l-or-ll-to-c-or-cpp) $(intermediates)/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glcpp/glcpp-parse.y - $(call local-y-to-c-and-h) + $(call glsl_local-y-to-c-and-h) BUILTIN_COMPILER := $(BUILD_OUT_EXECUTABLES)/mesa_builtin_compiler$(BUILD_EXECUTABLE_SUFFIX) diff --git a/mesalib/src/glsl/Makefile.am b/mesalib/src/glsl/Makefile.am index 20639c93d..1ecc0036c 100644 --- a/mesalib/src/glsl/Makefile.am +++ b/mesalib/src/glsl/Makefile.am @@ -23,7 +23,7 @@ # builtin_compiler is built before libglsl to generate builtin_function.cpp for libglsl. # For this to work, a dummy version of builtin_function.cpp, builtin_stubs.cpp, is used. -AM_CFLAGS = \ +AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/src/mesa/ \ @@ -31,8 +31,8 @@ AM_CFLAGS = \ $(DEFINES) \ $(LIBRARY_DEFINES) \ $(API_DEFINES) - -AM_CXXFLAGS = $(AM_CFLAGS) +AM_CFLAGS = $(VISIBILITY_CFLAGS) +AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS) AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c diff --git a/mesalib/src/mapi/glapi/gen/es_EXT.xml b/mesalib/src/mapi/glapi/gen/es_EXT.xml index c38e65a24..9e735834d 100644 --- a/mesalib/src/mapi/glapi/gen/es_EXT.xml +++ b/mesalib/src/mapi/glapi/gen/es_EXT.xml @@ -731,4 +731,10 @@ <enum name="RG8_EXT" value="0x822B"/> </category> +<!-- 111. GL_ANGLE_texture_compression_dxt --> +<category name="ANGLE_texture_compression_dxt" number="111"> + <enum name="COMPRESSED_RGBA_S3TC_DXT3_ANGLE" value="0x83F2"/> + <enum name="COMPRESSED_RGBA_S3TC_DXT5_ANGLE" value="0x83F3"/> +</category> + </OpenGLAPI> diff --git a/mesalib/src/mapi/glapi/gen/gl_SPARC_asm.py b/mesalib/src/mapi/glapi/gen/gl_SPARC_asm.py index 400e684da..553959687 100644 --- a/mesalib/src/mapi/glapi/gen/gl_SPARC_asm.py +++ b/mesalib/src/mapi/glapi/gen/gl_SPARC_asm.py @@ -120,7 +120,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\t sethi\tGL_OFF(off), %g3;\t\t\t\\' print '\t.size\tfn,.-fn;' print '' - print '#elif defined(PTHREADS)' + print '#elif defined(HAVE_PTHREAD)' print '' print '\t/* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */' print '\t/* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */' diff --git a/mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py b/mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py index 3ef5e08a9..9a085eaec 100644 --- a/mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py +++ b/mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py @@ -138,7 +138,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' print '# endif' print '' - print '#if defined(PTHREADS) || defined(_WIN32)' + print '#if defined(HAVE_PTHREAD) || defined(_WIN32)' print '# define THREADS' print '#endif' print '' @@ -158,7 +158,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tret' print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch' print '' - print '#elif defined(PTHREADS)' + print '#elif defined(HAVE_PTHREAD)' print '' print '\t.extern\t_glapi_Dispatch' print '\t.extern\t_gl_DispatchTSD' @@ -251,7 +251,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tcall\t_x86_64_get_dispatch@PLT' print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) print '\tjmp\t*%r11' - print '#elif defined(PTHREADS)' + print '#elif defined(HAVE_PTHREAD)' save_all_regs(registers) print '\tcall\t_x86_64_get_dispatch@PLT' diff --git a/mesalib/src/mapi/glapi/gen/gl_x86_asm.py b/mesalib/src/mapi/glapi/gen/gl_x86_asm.py index 095edcdc0..5eaa340f7 100644 --- a/mesalib/src/mapi/glapi/gen/gl_x86_asm.py +++ b/mesalib/src/mapi/glapi/gen/gl_x86_asm.py @@ -78,7 +78,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '#define GLOBL_FN(x) GLOBL x' print '#endif' print '' - print '#if defined(PTHREADS) || defined(_WIN32)' + print '#if defined(HAVE_PTHREAD) || defined(_WIN32)' print '# define THREADS' print '#endif' print '' @@ -98,7 +98,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tCTX_INSNS ; \\' print '\tJMP(GL_OFFSET(off))' print '' - print '#elif defined(PTHREADS)' + print '#elif defined(HAVE_PTHREAD)' print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' print 'ALIGNTEXT16;\t\t\t\t\t\t\\' print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' @@ -152,7 +152,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax' print '\tret' print '' - print '#elif defined(PTHREADS)' + print '#elif defined(HAVE_PTHREAD)' print 'EXTERN GLNAME(_glapi_Dispatch)' print 'EXTERN GLNAME(_gl_DispatchTSD)' print 'EXTERN GLNAME(pthread_getspecific)' diff --git a/mesalib/src/mapi/glapi/glapi_entrypoint.c b/mesalib/src/mapi/glapi/glapi_entrypoint.c index 993ccb94c..7a0eb3537 100644 --- a/mesalib/src/mapi/glapi/glapi_entrypoint.c +++ b/mesalib/src/mapi/glapi/glapi_entrypoint.c @@ -136,7 +136,7 @@ extern void __glapi_sparc_icache_flush(unsigned int *); static void init_glapi_relocs( void ) { -#if defined(PTHREADS) || defined(GLX_USE_TLS) +#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS) static const unsigned int template[] = { #ifdef GLX_USE_TLS 0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */ @@ -266,7 +266,7 @@ init_glapi_relocs( void ) _glapi_proc generate_entrypoint(GLuint functionOffset) { -#if defined(PTHREADS) || defined(GLX_USE_TLS) +#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS) static const unsigned int template[] = { 0x07000000, /* sethi %hi(0), %g3 */ 0x8210000f, /* mov %o7, %g1 */ @@ -337,7 +337,7 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) void init_glapi_relocs_once( void ) { -#if defined(PTHREADS) || defined(GLX_USE_TLS) +#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS) static pthread_once_t once_control = PTHREAD_ONCE_INIT; pthread_once( & once_control, init_glapi_relocs ); #endif diff --git a/mesalib/src/mapi/mapi/stub.c b/mesalib/src/mapi/mapi/stub.c index 99b475a3b..6fb8556d1 100644 --- a/mesalib/src/mapi/mapi/stub.c +++ b/mesalib/src/mapi/mapi/stub.c @@ -55,7 +55,7 @@ static int next_dynamic_slot = MAPI_TABLE_NUM_STATIC; void stub_init_once(void) { -#ifdef PTHREADS +#ifdef HAVE_PTHREAD static pthread_once_t once = PTHREAD_ONCE_INIT; pthread_once(&once, entry_patch_public); #else diff --git a/mesalib/src/mapi/mapi/u_thread.h b/mesalib/src/mapi/mapi/u_thread.h index e53f872c9..a5e504370 100644 --- a/mesalib/src/mapi/mapi/u_thread.h +++ b/mesalib/src/mapi/mapi/u_thread.h @@ -46,14 +46,14 @@ #include <stdlib.h> #include "u_compiler.h" -#if defined(PTHREADS) +#if defined(HAVE_PTHREAD) #include <pthread.h> /* POSIX threads headers */ #endif #ifdef _WIN32 #include <windows.h> #endif -#if defined(PTHREADS) || defined(_WIN32) +#if defined(HAVE_PTHREAD) || defined(_WIN32) #ifndef THREADS #define THREADS #endif @@ -88,7 +88,7 @@ extern "C" { * compiler flag. On Solaris with gcc, use -D_REENTRANT to enable * proper compiling for MT-safe libc etc. */ -#if defined(PTHREADS) +#if defined(HAVE_PTHREAD) struct u_tsd { pthread_key_t key; @@ -145,7 +145,7 @@ u_tsd_set(struct u_tsd *tsd, void *ptr) } } -#endif /* PTHREADS */ +#endif /* HAVE_PTHREAD */ /* diff --git a/mesalib/src/mesa/Android.gen.mk b/mesalib/src/mesa/Android.gen.mk index f5e63234a..c17df1a1e 100644 --- a/mesalib/src/mesa/Android.gen.mk +++ b/mesalib/src/mesa/Android.gen.mk @@ -75,10 +75,10 @@ define local-l-to-c $(hide) $(LEX) -o$@ $< endef -define local-y-to-c-and-h +define mesa_local-y-to-c-and-h @mkdir -p $(dir $@) @echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<" - $(hide) $(YACC) -o $@ $< + $(hide) $(YACC) -o $@ -p "_mesa_program_" $< endef define es-gen @@ -104,7 +104,7 @@ $(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) + $(mesa_local-y-to-c-and-h) $(intermediates)/program/lex.yy.c: $(LOCAL_PATH)/program/program_lexer.l $(local-l-to-c) diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am index 8e4530da3..feec1070d 100644 --- a/mesalib/src/mesa/Makefile.am +++ b/mesalib/src/mesa/Makefile.am @@ -19,7 +19,11 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -SUBDIRS = x86 x86-64 . libdricore drivers +if NEED_LIBDRICORE +DRICORE_SUBDIR = libdricore +endif + +SUBDIRS = x86 x86-64 . $(DRICORE_SUBDIR) drivers gldir = $(includedir)/GL gl_HEADERS = $(top_srcdir)/include/GL/*.h @@ -94,8 +98,8 @@ BUILDDIR = $(top_builddir)/src/mesa/ include sources.mak AM_CPPFLAGS = $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS) -AM_CFLAGS = $(LLVM_CFLAGS) -AM_CXXFLAGS = $(LLVM_CFLAGS) +AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS) +AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CXXFLAGS) # cannot just add $(MESA_ASM_FILES) to libmesa_la_SOURCES as it contains a configure substitution MESA_ASM_FILES_FOR_ARCH = diff --git a/mesalib/src/mesa/drivers/dri/common/Makefile.am b/mesalib/src/mesa/drivers/dri/common/Makefile.am index 6e9d738fa..a662919b5 100644 --- a/mesalib/src/mesa/drivers/dri/common/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/common/Makefile.am @@ -26,7 +26,8 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/mesa/ \ $(DEFINES) \ $(API_DEFINES) \ - $(LIBDRM_CFLAGS) + $(LIBDRM_CFLAGS) \ + $(VISIBILITY_CFLAGS) noinst_LTLIBRARIES = \ libdricommon.la \ diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am index 16a34413b..244aa8b27 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am @@ -34,7 +34,8 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mesa/drivers/dri/common \ $(DEFINES) \ - $(API_DEFINES) + $(API_DEFINES) \ + $(VISIBILITY_CFLAGS) dridir = $(DRI_DRIVER_INSTALL_DIR) diff --git a/mesalib/src/mesa/main/APIspec.xml b/mesalib/src/mesa/main/APIspec.xml index a65c5c529..c3969526f 100644 --- a/mesalib/src/mesa/main/APIspec.xml +++ b/mesalib/src/mesa/main/APIspec.xml @@ -2172,6 +2172,9 @@ <category name="NV_draw_buffers"/> <category name="NV_read_buffer"/> + <!-- GL_ANGLE_texture_compression_dxt --> + <category name="ANGLE_texture_compression_dxt"/> + <function name="DrawBuffersNV" template="DrawBuffers"/> <function name="ReadBufferNV" template="ReadBuffer"/> diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index bd7c7baf9..4971ebc93 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -195,6 +195,8 @@ static const struct extension extension_table[] = { { "GL_EXT_texture3D", o(EXT_texture3D), GLL, 1996 }, { "GL_EXT_texture_array", o(EXT_texture_array), GL, 2006 }, { "GL_EXT_texture_compression_dxt1", o(EXT_texture_compression_s3tc), GL | ES1 | ES2, 2004 }, + { "GL_ANGLE_texture_compression_dxt3", o(ANGLE_texture_compression_dxt), ES2, 2011 }, + { "GL_ANGLE_texture_compression_dxt5", o(ANGLE_texture_compression_dxt), ES2, 2011 }, { "GL_EXT_texture_compression_latc", o(EXT_texture_compression_latc), GL, 2006 }, { "GL_EXT_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 }, { "GL_EXT_texture_compression_s3tc", o(EXT_texture_compression_s3tc), GL, 2000 }, @@ -480,6 +482,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); if (ctx->Mesa_DXTn) { + ctx->Extensions.ANGLE_texture_compression_dxt = GL_TRUE; _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); _mesa_enable_extension(ctx, "GL_S3_s3tc"); } diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index 04029c07c..ccdf56b4f 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -791,8 +791,10 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) return ctx->Extensions.EXT_texture_compression_s3tc; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return _mesa_is_desktop_gl(ctx) - && ctx->Extensions.EXT_texture_compression_s3tc; + return (_mesa_is_desktop_gl(ctx) && + ctx->Extensions.EXT_texture_compression_s3tc) || + (ctx->API == API_OPENGLES2 && + ctx->Extensions.ANGLE_texture_compression_dxt); case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_RGBA_S3TC: diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index ba43e574d..e790e18c4 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -2946,6 +2946,7 @@ struct gl_extensions GLboolean dummy; /* don't remove this! */ GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */ GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */ + GLboolean ANGLE_texture_compression_dxt; GLboolean ARB_ES2_compatibility; GLboolean ARB_base_instance; GLboolean ARB_blend_func_extended; diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c index 17270ba92..f0bc7fdb9 100644 --- a/mesalib/src/mesa/main/texformat.c +++ b/mesalib/src/mesa/main/texformat.c @@ -302,7 +302,9 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, } } - if (ctx->Extensions.EXT_texture_compression_s3tc) { + if (ctx->Extensions.EXT_texture_compression_s3tc || + (ctx->API == API_OPENGLES2 && + ctx->Extensions.ANGLE_texture_compression_dxt)) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1); @@ -604,12 +606,16 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - if (ctx->Extensions.EXT_texture_compression_s3tc) + if (ctx->Extensions.EXT_texture_compression_s3tc || + (ctx->API == API_OPENGLES2 && + ctx->Extensions.ANGLE_texture_compression_dxt)) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - if (ctx->Extensions.EXT_texture_compression_s3tc) + if (ctx->Extensions.EXT_texture_compression_s3tc || + (ctx->API == API_OPENGLES2 && + ctx->Extensions.ANGLE_texture_compression_dxt)) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT5); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index afda0eaaf..019516f00 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -203,6 +203,18 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) } } + /* GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE && GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE */ + if (ctx->API == API_OPENGLES2 && + ctx->Extensions.ANGLE_texture_compression_dxt) { + switch (internalFormat) { + case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: + return GL_RGBA; + default: + ; /* fallthrough */ + } + } + if (ctx->Extensions.S3_s3tc) { switch (internalFormat) { case GL_RGB_S3TC: @@ -2043,28 +2055,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions, goto error; } - /* check image size against compression block size */ - /* XXX possibly move this into the _mesa_legal_texture_dimensions() func */ - { - gl_format texFormat = - ctx->Driver.ChooseTextureFormat(ctx, target, proxy_format, - choose_format, choose_type); - GLuint bw, bh; - - _mesa_get_format_block_size(texFormat, &bw, &bh); - if ((width > bw && width % bw > 0) || - (height > bh && height % bh > 0)) { - /* - * Per GL_ARB_texture_compression: GL_INVALID_OPERATION is - * generated [...] if any parameter combinations are not - * supported by the specific compressed internal format. - */ - reason = "invalid width or height for compression format"; - error = GL_INVALID_OPERATION; - goto error; - } - } - /* check image size in bytes */ if (expectedSize != imageSize) { /* Per GL_ARB_texture_compression: GL_INVALID_VALUE is generated [...] diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index e2598a1dc..e6914553c 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -4476,12 +4476,6 @@ _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims, _mesa_get_format_block_size(texFormat, &bw, &bh); - /* these should have been caught sooner */ - ASSERT((width % bw) == 0 || width < bw); - ASSERT((height % bh) == 0 || height < bh); - ASSERT((xoffset % bw) == 0); - ASSERT((yoffset % bh) == 0); - /* get pointer to src pixels (may be in a pbo which we'll map here) */ data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, &ctx->Unpack, diff --git a/mesalib/src/mesa/program/register_allocate.c b/mesalib/src/mesa/program/register_allocate.c index 97d4e331c..88793dbdc 100644 --- a/mesalib/src/mesa/program/register_allocate.c +++ b/mesalib/src/mesa/program/register_allocate.c @@ -555,6 +555,13 @@ ra_get_best_spill_node(struct ra_graph *g) if (cost <= 0.0) continue; + /* Only consider registers for spilling if they are still in the + * interference graph (those on the stack have already been proven to be + * allocatable without spilling). + */ + if (g->nodes[n].in_stack) + continue; + benefit = ra_get_spill_benefit(g, n); if (benefit / cost > best_benefit) { |