diff options
Diffstat (limited to 'mesalib/src/mesa')
447 files changed, 4981 insertions, 4373 deletions
diff --git a/mesalib/src/mesa/Android.gen.mk b/mesalib/src/mesa/Android.gen.mk index 35f00da09..c6280f5cb 100644 --- a/mesalib/src/mesa/Android.gen.mk +++ b/mesalib/src/mesa/Android.gen.mk @@ -111,8 +111,7 @@ $(intermediates)/main/api_exec.c: $(dispatch_deps) $(call es-gen) GET_HASH_GEN := $(LOCAL_PATH)/main/get_hash_generator.py -GET_HASH_GEN_FLAGS := $(patsubst %,-a %,$(MESA_ENABLED_APIS)) $(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) $(GET_HASH_GEN_FLAGS) -f $< > $@ + @$(MESA_PYTHON2) $(GET_HASH_GEN) -f $< > $@ diff --git a/mesalib/src/mesa/Android.libmesa_dricore.mk b/mesalib/src/mesa/Android.libmesa_dricore.mk index 093d7a189..00c06943c 100644 --- a/mesalib/src/mesa/Android.libmesa_dricore.mk +++ b/mesalib/src/mesa/Android.libmesa_dricore.mk @@ -31,7 +31,7 @@ LOCAL_PATH := $(call my-dir) # Import the following variables: # MESA_FILES # X86_FILES -include $(LOCAL_PATH)/sources.mak +include $(LOCAL_PATH)/Makefile.sources include $(CLEAR_VARS) diff --git a/mesalib/src/mesa/Android.libmesa_st_mesa.mk b/mesalib/src/mesa/Android.libmesa_st_mesa.mk index 79914caf1..e7203c41d 100644 --- a/mesalib/src/mesa/Android.libmesa_st_mesa.mk +++ b/mesalib/src/mesa/Android.libmesa_st_mesa.mk @@ -31,7 +31,7 @@ LOCAL_PATH := $(call my-dir) # Import variables: # MESA_GALLIUM_FILES. # X86_FILES -include $(LOCAL_PATH)/sources.mak +include $(LOCAL_PATH)/Makefile.sources include $(CLEAR_VARS) diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am index c341c48e7..d5f5f5b86 100644 --- a/mesalib/src/mesa/Makefile.am +++ b/mesalib/src/mesa/Makefile.am @@ -23,7 +23,19 @@ if NEED_LIBDRICORE DRICORE_SUBDIR = libdricore endif -SUBDIRS = program x86 x86-64 . $(DRICORE_SUBDIR) drivers +SUBDIRS = program x86 x86-64 . $(DRICORE_SUBDIR) + +if HAVE_X11_DRIVER +SUBDIRS += drivers/x11 +endif + +if HAVE_DRI +SUBDIRS += drivers/dri +endif + +if HAVE_OSMESA +SUBDIRS += drivers/osmesa +endif gldir = $(includedir)/GL gl_HEADERS = $(top_srcdir)/include/GL/*.h @@ -59,14 +71,12 @@ CLEANFILES = \ git_sha1.h.tmp GET_HASH_GEN = main/get_hash_generator.py -GET_HASH_GEN_FLAGS := $(patsubst -DFEATURE_%=1,-a %, \ - $(patsubst -DFEATURE_%=0,,$(API_DEFINES))) main/get_hash.h: $(GLAPI)/gl_and_es_API.xml main/get_hash_params.py \ $(GET_HASH_GEN) Makefile $(AM_V_GEN)set -e; \ - $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \ - $(GET_HASH_GEN_FLAGS) -f $< > $@.tmp; \ + $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \ + -f $< > $@.tmp; \ mv $@.tmp $@; noinst_LTLIBRARIES = @@ -81,9 +91,9 @@ endif SRCDIR = $(top_srcdir)/src/mesa/ BUILDDIR = $(top_builddir)/src/mesa/ -include sources.mak +include Makefile.sources -AM_CPPFLAGS = $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS) +AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS) AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS) AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CXXFLAGS) diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/Makefile.sources index 3c881082c..a5c1f5dea 100644 --- a/mesalib/src/mesa/sources.mak +++ b/mesalib/src/mesa/Makefile.sources @@ -224,6 +224,7 @@ STATETRACKER_FILES = \ $(SRCDIR)state_tracker/st_cb_eglimage.c \ $(SRCDIR)state_tracker/st_cb_fbo.c \ $(SRCDIR)state_tracker/st_cb_feedback.c \ + $(SRCDIR)state_tracker/st_cb_msaa.c \ $(SRCDIR)state_tracker/st_cb_program.c \ $(SRCDIR)state_tracker/st_cb_queryobj.c \ $(SRCDIR)state_tracker/st_cb_rasterpos.c \ diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript index ca9b70bad..0f1543802 100644 --- a/mesalib/src/mesa/SConscript +++ b/mesalib/src/mesa/SConscript @@ -31,7 +31,6 @@ if env['platform'] == 'windows': env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS']) else: env.Append(CPPDEFINES = [ - 'IN_DRI_DRIVER', # enable the remap table (for DRI drivers) ('HAVE_DLOPEN', '1'), ]) @@ -263,6 +262,7 @@ statetracker_sources = [ 'state_tracker/st_cb_eglimage.c', 'state_tracker/st_cb_fbo.c', 'state_tracker/st_cb_feedback.c', + 'state_tracker/st_cb_msaa.c', 'state_tracker/st_cb_program.c', 'state_tracker/st_cb_queryobj.c', 'state_tracker/st_cb_rasterpos.c', @@ -340,22 +340,18 @@ if env['gles']: enabled_apis += ['ES1', 'ES2'] -env.Append(CPPDEFINES = ["FEATURE_%s=1" % api for api in enabled_apis]) - -get_hash_gen_opts = ' '.join(["-a %s" % api for api in enabled_apis]) - get_hash_header = env.CodeGenerate( target = 'main/get_hash.h', script = 'main/get_hash_generator.py', source = GLAPI + 'gen/gl_and_es_API.xml', - command = python_cmd + ' $SCRIPT ' + get_hash_gen_opts + - ' -f $SOURCE > $TARGET' + command = python_cmd + ' $SCRIPT ' + ' -f $SOURCE > $TARGET' ) # # Assembly sources # -if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows', 'haiku'): +if (env['gcc'] or env['clang']) and \ + env['platform'] not in ('cygwin', 'darwin', 'windows', 'haiku'): if env['machine'] == 'x86': env.Append(CPPDEFINES = [ 'USE_X86_ASM', diff --git a/mesalib/src/mesa/drivers/Makefile.am b/mesalib/src/mesa/drivers/Makefile.am deleted file mode 100644 index 1bc74eadf..000000000 --- a/mesalib/src/mesa/drivers/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright © 2012 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -SUBDIRS = $(DRIVER_DIRS) diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c index a98dfc607..4f7696c4c 100644 --- a/mesalib/src/mesa/drivers/common/driverfuncs.c +++ b/mesalib/src/mesa/drivers/common/driverfuncs.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -40,6 +41,7 @@ #include "main/texgetimage.h" #include "main/teximage.h" #include "main/texobj.h" +#include "main/texstorage.h" #include "main/texstore.h" #include "main/bufferobj.h" #include "main/fbobject.h" @@ -209,7 +211,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->EndCallList = NULL; /* GL_ARB_texture_storage */ - driver->AllocTextureStorage = _swrast_AllocTextureStorage; + driver->AllocTextureStorage = _mesa_alloc_texture_storage; /* GL_ARB_texture_multisample */ driver->GetSamplePosition = NULL; diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.h b/mesalib/src/mesa/drivers/common/driverfuncs.h index 212f30742..806c8b0af 100644 --- a/mesalib/src/mesa/drivers/common/driverfuncs.h +++ b/mesalib/src/mesa/drivers/common/driverfuncs.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index e3ab82bfe..1250bd35c 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -3048,16 +3049,33 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target, GLenum status; /* check for fallbacks */ - if (!ctx->Extensions.EXT_framebuffer_object || - target == GL_TEXTURE_3D || + if (!ctx->Extensions.EXT_framebuffer_object) { + _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH, + "glGenerateMipmap() without FBOs\n"); + return GL_TRUE; + } + + if (target == GL_TEXTURE_3D || target == GL_TEXTURE_1D_ARRAY || target == GL_TEXTURE_2D_ARRAY) { + _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH, + "glGenerateMipmap() to %s target\n", + _mesa_lookup_enum_by_nr(target)); return GL_TRUE; } srcLevel = texObj->BaseLevel; baseImage = _mesa_select_tex_image(ctx, texObj, target, srcLevel); - if (!baseImage || _mesa_is_format_compressed(baseImage->TexFormat)) { + if (!baseImage) { + _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH, + "glGenerateMipmap() couldn't find base teximage\n"); + return GL_TRUE; + } + + if (_mesa_is_format_compressed(baseImage->TexFormat)) { + _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH, + "glGenerateMipmap() with %s format\n", + _mesa_get_format_name(baseImage->TexFormat)); return GL_TRUE; } @@ -3067,6 +3085,9 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target, * texture sample conversion. So we won't be able to generate the * right colors when rendering. Need to use a fallback. */ + _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH, + "glGenerateMipmap() of sRGB texture without " + "sRGB decode\n"); return GL_TRUE; } @@ -3103,6 +3124,8 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target, _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, fboSave); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH, + "glGenerateMipmap() got incomplete FBO\n"); return GL_TRUE; } @@ -3374,6 +3397,8 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, sizeof(struct vertex), OFFSET(x)); _mesa_VertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(struct vertex), OFFSET(tex)); + _mesa_EnableVertexAttribArray(0); + _mesa_EnableVertexAttribArray(1); } /* Generate a fragment shader program appropriate for the texture target */ @@ -3445,8 +3470,6 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, _mesa_DeleteObjectARB(vs); _mesa_BindAttribLocation(mipmap->ShaderProg, 0, "position"); _mesa_BindAttribLocation(mipmap->ShaderProg, 1, "texcoords"); - _mesa_EnableVertexAttribArray(0); - _mesa_EnableVertexAttribArray(1); link_program_with_debug(ctx, mipmap->ShaderProg); sampler->shader_prog = mipmap->ShaderProg; ralloc_free(mem_ctx); @@ -3741,10 +3764,20 @@ get_temp_image_type(struct gl_context *ctx, gl_format format) return datatype; return GL_FLOAT; } - case GL_DEPTH_COMPONENT: - return GL_UNSIGNED_INT; - case GL_DEPTH_STENCIL: - return GL_UNSIGNED_INT_24_8; + case GL_DEPTH_COMPONENT: { + GLenum datatype = _mesa_get_format_datatype(format); + if (datatype == GL_FLOAT) + return GL_FLOAT; + else + return GL_UNSIGNED_INT; + } + case GL_DEPTH_STENCIL: { + GLenum datatype = _mesa_get_format_datatype(format); + if (datatype == GL_FLOAT) + return GL_FLOAT_32_UNSIGNED_INT_24_8_REV; + else + return GL_UNSIGNED_INT_24_8; + } default: _mesa_problem(ctx, "Unexpected format %d in get_temp_image_type()", baseFormat); diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h index a6bdd3947..823be14c7 100644 --- a/mesalib/src/mesa/drivers/common/meta.h +++ b/mesalib/src/mesa/drivers/common/meta.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/drivers/dri/common/Makefile.am b/mesalib/src/mesa/drivers/dri/common/Makefile.am index dfc8f3b7a..ce4119d0f 100644 --- a/mesalib/src/mesa/drivers/dri/common/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/common/Makefile.am @@ -27,7 +27,6 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/src/mesa/ \ $(DEFINES) \ - $(API_DEFINES) \ $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) diff --git a/mesalib/src/mesa/drivers/dri/common/drisw_util.c b/mesalib/src/mesa/drivers/dri/common/drisw_util.c index 6af101c31..89f03c310 100644 --- a/mesalib/src/mesa/drivers/dri/common/drisw_util.c +++ b/mesalib/src/mesa/drivers/dri/common/drisw_util.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool.h b/mesalib/src/mesa/drivers/dri/common/xmlpool.h index ffea43002..ebd4e7c86 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool.h +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool.h @@ -60,6 +60,13 @@ #define DRI_CONF_OPT_BEGIN(name,type,def) \ "<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n" +/** + * \brief Begin a boolean option definition, with the default value passed in + * as a string + */ +#define DRI_CONF_OPT_BEGIN_B(name,def) \ +"<option name=\""#name"\" type=\"bool\" default="#def">\n" + /** \brief Begin an option definition with quoted default value */ #define DRI_CONF_OPT_BEGIN_Q(name,type,def) \ "<option name=\""#name"\" type=\""#type"\" default="#def">\n" diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h b/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h index 7b441c68f..ca4772003 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h @@ -56,42 +56,42 @@ DRI_CONF_SECTION_BEGIN \ DRI_CONF_DESC(en,gettext("Debugging")) #define DRI_CONF_NO_RAST(def) \ -DRI_CONF_OPT_BEGIN(no_rast,bool,def) \ +DRI_CONF_OPT_BEGIN_B(no_rast, def) \ DRI_CONF_DESC(en,gettext("Disable 3D acceleration")) \ DRI_CONF_OPT_END #define DRI_CONF_PERFORMANCE_BOXES(def) \ -DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \ +DRI_CONF_OPT_BEGIN_B(performance_boxes, def) \ DRI_CONF_DESC(en,gettext("Show performance boxes")) \ DRI_CONF_OPT_END #define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \ -DRI_CONF_OPT_BEGIN(always_flush_batch,bool,def) \ +DRI_CONF_OPT_BEGIN_B(always_flush_batch, def) \ DRI_CONF_DESC(en,gettext("Enable flushing batchbuffer after each draw call")) \ DRI_CONF_OPT_END #define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \ -DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \ +DRI_CONF_OPT_BEGIN_B(always_flush_cache, def) \ DRI_CONF_DESC(en,gettext("Enable flushing GPU caches with each draw call")) \ DRI_CONF_OPT_END #define DRI_CONF_DISABLE_THROTTLING(def) \ -DRI_CONF_OPT_BEGIN(disable_throttling,bool,def) \ +DRI_CONF_OPT_BEGIN_B(disable_throttling, def) \ DRI_CONF_DESC(en,gettext("Disable throttling on first batch after flush")) \ DRI_CONF_OPT_END #define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \ -DRI_CONF_OPT_BEGIN(force_glsl_extensions_warn,bool,def) \ +DRI_CONF_OPT_BEGIN_B(force_glsl_extensions_warn, def) \ DRI_CONF_DESC(en,gettext("Force GLSL extension default behavior to 'warn'")) \ DRI_CONF_OPT_END #define DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(def) \ -DRI_CONF_OPT_BEGIN(disable_blend_func_extended,bool,def) \ +DRI_CONF_OPT_BEGIN_B(disable_blend_func_extended, def) \ DRI_CONF_DESC(en,gettext("Disable dual source blending")) \ DRI_CONF_OPT_END #define DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(def) \ -DRI_CONF_OPT_BEGIN(disable_glsl_line_continuations,bool,def) \ +DRI_CONF_OPT_BEGIN_B(disable_glsl_line_continuations, def) \ DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \ DRI_CONF_OPT_END @@ -105,7 +105,7 @@ DRI_CONF_SECTION_BEGIN \ DRI_CONF_DESC(en,gettext("Image Quality")) #define DRI_CONF_EXCESS_MIPMAP(def) \ -DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \ +DRI_CONF_OPT_BEGIN_B(excess_mipmap, def) \ DRI_CONF_DESC(en,"Enable extra mipmap level") \ DRI_CONF_OPT_END @@ -129,12 +129,12 @@ DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \ DRI_CONF_OPT_END #define DRI_CONF_NO_NEG_LOD_BIAS(def) \ -DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \ +DRI_CONF_OPT_BEGIN_B(no_neg_lod_bias, def) \ DRI_CONF_DESC(en,gettext("Forbid negative texture LOD bias")) \ DRI_CONF_OPT_END #define DRI_CONF_FORCE_S3TC_ENABLE(def) \ -DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \ +DRI_CONF_OPT_BEGIN_B(force_s3tc_enable, def) \ DRI_CONF_DESC(en,gettext("Enable S3TC texture compression even if software support is not available")) \ DRI_CONF_OPT_END @@ -171,7 +171,7 @@ DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \ DRI_CONF_OPT_END #define DRI_CONF_FLOAT_DEPTH(def) \ -DRI_CONF_OPT_BEGIN(float_depth,bool,def) \ +DRI_CONF_OPT_BEGIN_B(float_depth, def) \ DRI_CONF_DESC(en,gettext("Floating point depth buffer")) \ DRI_CONF_OPT_END @@ -257,7 +257,7 @@ DRI_CONF_OPT_END #define DRI_CONF_HYPERZ_DISABLED 0 #define DRI_CONF_HYPERZ_ENABLED 1 #define DRI_CONF_HYPERZ(def) \ -DRI_CONF_OPT_BEGIN(hyperz,bool,def) \ +DRI_CONF_OPT_BEGIN_B(hyperz, def) \ DRI_CONF_DESC(en,gettext("Use HyperZ to boost performance")) \ DRI_CONF_OPT_END @@ -303,7 +303,7 @@ DRI_CONF_SECTION_BEGIN \ DRI_CONF_DESC(en,gettext("Features that are not hardware-accelerated")) #define DRI_CONF_ARB_VERTEX_PROGRAM(def) \ -DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \ +DRI_CONF_OPT_BEGIN_B(arb_vertex_program, def) \ DRI_CONF_DESC(en,gettext("Enable extension GL_ARB_vertex_program")) \ DRI_CONF_OPT_END @@ -317,6 +317,6 @@ DRI_CONF_SECTION_BEGIN \ DRI_CONF_DESC(en,gettext("Miscellaneous")) #define DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(def) \ -DRI_CONF_OPT_BEGIN(always_have_depth_buffer, bool, def) \ +DRI_CONF_OPT_BEGIN_B(always_have_depth_buffer, def) \ DRI_CONF_DESC(en,gettext("Create all visuals with a depth buffer")) \ DRI_CONF_OPT_END diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am index 3e539073c..d3da19651 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am @@ -31,7 +31,6 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mesa/drivers/dri/common \ $(DEFINES) \ - $(API_DEFINES) \ $(VISIBILITY_CFLAGS) dridir = $(DRI_DRIVER_INSTALL_DIR) diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index b380de307..91bcc5944 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -14,9 +14,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h b/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h index b25de931a..b51993c94 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/accum.c b/mesalib/src/mesa/main/accum.c index f5888017f..b4677397b 100644 --- a/mesalib/src/mesa/main/accum.c +++ b/mesalib/src/mesa/main/accum.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "glheader.h" @@ -30,7 +31,6 @@ #include "format_pack.h" #include "imports.h" #include "macros.h" -#include "mfeatures.h" #include "state.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/mesalib/src/mesa/main/accum.h b/mesalib/src/mesa/main/accum.h index 00c24b2db..7e4d9f6b9 100644 --- a/mesalib/src/mesa/main/accum.h +++ b/mesalib/src/mesa/main/accum.h @@ -27,9 +27,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -38,7 +39,6 @@ #define ACCUM_H #include "main/glheader.h" -#include "main/mfeatures.h" struct _glapi_table; struct gl_context; diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c index ea3361488..8e581c8d9 100644 --- a/mesalib/src/mesa/main/api_arrayelt.c +++ b/mesalib/src/mesa/main/api_arrayelt.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -40,7 +41,6 @@ #include "context.h" #include "imports.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" @@ -64,13 +64,19 @@ typedef struct { AEattrib attribs[VERT_ATTRIB_MAX + 1]; GLuint NewState; + /* List of VBOs we need to map before executing ArrayElements */ struct gl_buffer_object *vbo[VERT_ATTRIB_MAX]; GLuint nr_vbos; - GLboolean mapped_vbos; - + GLboolean mapped_vbos; /**< Any currently mapped VBOs? */ } AEcontext; -#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context) + +/** Cast wrapper */ +static INLINE AEcontext * +AE_CONTEXT(struct gl_context *ctx) +{ + return (AEcontext *) ctx->aelt_context; +} /* @@ -78,7 +84,12 @@ typedef struct { * in the range [0, 7]. Luckily these type tokens are sequentially * numbered in gl.h, except for GL_DOUBLE. */ -#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) +static INLINE int +TYPE_IDX(GLenum t) +{ + return t == GL_DOUBLE ? 7 : t & 7; +} + #define NUM_TYPES 8 @@ -1245,8 +1256,6 @@ VertexAttribI4uiv(GLuint index, const GLuint *v) } - - /* * Array [unnormalized/normalized/integer][size][type] of VertexAttrib * functions @@ -1396,10 +1405,9 @@ static attrib_func AttribFuncsARB[3][4][NUM_TYPES] = { } }; -/**********************************************************************/ - -GLboolean _ae_create_context( struct gl_context *ctx ) +GLboolean +_ae_create_context(struct gl_context *ctx) { if (ctx->aelt_context) return GL_TRUE; @@ -1432,22 +1440,29 @@ GLboolean _ae_create_context( struct gl_context *ctx ) } -void _ae_destroy_context( struct gl_context *ctx ) +void +_ae_destroy_context(struct gl_context *ctx) { - if ( AE_CONTEXT( ctx ) ) { + if (AE_CONTEXT(ctx)) { free(ctx->aelt_context); ctx->aelt_context = NULL; } } -static void check_vbo( AEcontext *actx, - struct gl_buffer_object *vbo ) + +/** + * Check if the given vertex buffer object exists and is not mapped. + * If so, add it to the list of buffers we must map before executing + * an glArrayElement call. + */ +static void +check_vbo(AEcontext *actx, struct gl_buffer_object *vbo) { if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo)) { GLuint i; for (i = 0; i < actx->nr_vbos; i++) - if (actx->vbo[i] == vbo) - return; + if (actx->vbo[i] == vbo) + return; /* already in the list, we're done */ assert(actx->nr_vbos < VERT_ATTRIB_MAX); actx->vbo[actx->nr_vbos++] = vbo; } @@ -1460,11 +1475,12 @@ static void check_vbo( AEcontext *actx, * etc). * Note: this may be called during display list construction. */ -static void _ae_update_state( struct gl_context *ctx ) +static void +_ae_update_state(struct gl_context *ctx) { AEcontext *actx = AE_CONTEXT(ctx); - AEarray *aa = actx->arrays; - AEattrib *at = actx->attribs; + AEarray *aa = actx->arrays; /* non-indexed arrays (ex: glNormal) */ + AEattrib *at = actx->attribs; /* indexed arrays (ex: glMultiTexCoord) */ GLuint i; struct gl_array_object *arrayObj = ctx->Array.ArrayObj; @@ -1508,7 +1524,8 @@ static void _ae_update_state( struct gl_context *ctx ) aa++; } for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - struct gl_client_array *attribArray = &arrayObj->VertexAttrib[VERT_ATTRIB_TEX(i)]; + struct gl_client_array *attribArray = + &arrayObj->VertexAttrib[VERT_ATTRIB_TEX(i)]; if (attribArray->Enabled) { /* NOTE: we use generic glVertexAttribNV functions here. * If we ever remove GL_NV_vertex_program this will have to change. @@ -1524,9 +1541,10 @@ static void _ae_update_state( struct gl_context *ctx ) } } - /* generic vertex attribute arrays */ + /* generic vertex attribute arrays */ for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */ - struct gl_client_array *attribArray = &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(i)]; + struct gl_client_array *attribArray = + &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(i)]; if (attribArray->Enabled) { GLint intOrNorm; at->array = attribArray; @@ -1580,11 +1598,17 @@ static void _ae_update_state( struct gl_context *ctx ) actx->NewState = 0; } -void _ae_map_vbos( struct gl_context *ctx ) + +/** + * Before replaying glArrayElements calls we need to map (for reading) any + * VBOs referenced by the enabled vertex arrays. + */ +void +_ae_map_vbos(struct gl_context *ctx) { AEcontext *actx = AE_CONTEXT(ctx); GLuint i; - + if (actx->mapped_vbos) return; @@ -1601,7 +1625,12 @@ void _ae_map_vbos( struct gl_context *ctx ) actx->mapped_vbos = GL_TRUE; } -void _ae_unmap_vbos( struct gl_context *ctx ) + +/** + * Unmap VBOs + */ +void +_ae_unmap_vbos(struct gl_context *ctx) { AEcontext *actx = AE_CONTEXT(ctx); GLuint i; @@ -1624,7 +1653,8 @@ void _ae_unmap_vbos( struct gl_context *ctx ) * for all enabled vertex arrays (for elt-th element). * Note: this may be called during display list construction. */ -void GLAPIENTRY _ae_ArrayElement( GLint elt ) +void GLAPIENTRY +_ae_ArrayElement(GLint elt) { GET_CURRENT_CONTEXT(ctx); const AEcontext *actx = AE_CONTEXT(ctx); @@ -1636,14 +1666,14 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt ) /* If PrimitiveRestart is enabled and the index is the RestartIndex * then we call PrimitiveRestartNV and return. */ - if (ctx->Array._PrimitiveRestart && (elt == ctx->Array._RestartIndex)) { + if (ctx->Array.PrimitiveRestart && (elt == ctx->Array.RestartIndex)) { CALL_PrimitiveRestartNV((struct _glapi_table *)disp, ()); return; } if (actx->NewState) { assert(!actx->mapped_vbos); - _ae_update_state( ctx ); + _ae_update_state(ctx); } /* Determine if we need to map/unmap VBOs */ @@ -1651,13 +1681,13 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt ) if (do_map) _ae_map_vbos(ctx); - + /* emit generic attribute elements */ for (at = actx->attribs; at->func; at++) { const GLubyte *src = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr) + elt * at->array->StrideB; - at->func( at->index, src ); + at->func(at->index, src); } /* emit conventional arrays elements */ @@ -1665,8 +1695,7 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt ) const GLubyte *src = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr) + elt * aa->array->StrideB; - CALL_by_offset( disp, (array_func), aa->offset, - ((const void *) src) ); + CALL_by_offset(disp, (array_func), aa->offset, ((const void *) src)); } if (do_map) @@ -1674,16 +1703,16 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt ) } -void _ae_invalidate_state( struct gl_context *ctx, GLuint new_state ) +void +_ae_invalidate_state(struct gl_context *ctx, GLuint new_state) { AEcontext *actx = AE_CONTEXT(ctx); - /* Only interested in this subset of mesa state. Need to prune * this down as both tnl/ and the drivers can raise statechanges * for arcane reasons in the middle of seemingly atomic operations * like DrawElements, over which we'd like to keep a known set of - * arrays and vbo's mapped. + * arrays and vbo's mapped. * * Luckily, neither the drivers nor tnl muck with the state that * concerns us here: @@ -1696,8 +1725,9 @@ void _ae_invalidate_state( struct gl_context *ctx, GLuint new_state ) } -void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt) +void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) { SET_ArrayElement(disp, vfmt->ArrayElement); } diff --git a/mesalib/src/mesa/main/api_arrayelt.h b/mesalib/src/mesa/main/api_arrayelt.h index 988703259..e250cb4c8 100644 --- a/mesalib/src/mesa/main/api_arrayelt.h +++ b/mesalib/src/mesa/main/api_arrayelt.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -28,13 +29,8 @@ #define API_ARRAYELT_H -#include "main/mfeatures.h" #include "main/mtypes.h" -#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \ - do { \ - (vfmt)->ArrayElement = impl ## ArrayElement; \ - } while (0) extern GLboolean _ae_create_context( struct gl_context *ctx ); extern void _ae_destroy_context( struct gl_context *ctx ); diff --git a/mesalib/src/mesa/main/api_exec.h b/mesalib/src/mesa/main/api_exec.h index 94f7f41c1..bcf461163 100644 --- a/mesalib/src/mesa/main/api_exec.h +++ b/mesalib/src/mesa/main/api_exec.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/api_loopback.c b/mesalib/src/mesa/main/api_loopback.c index 59d399b42..938e9b5c0 100644 --- a/mesalib/src/mesa/main/api_loopback.c +++ b/mesalib/src/mesa/main/api_loopback.c @@ -23,9 +23,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -36,7 +37,6 @@ #include "glapi/glapi.h" #include "glapi/glthread.h" #include "main/dispatch.h" -#include "mfeatures.h" #include "main/context.h" /* KW: A set of functions to convert unusual Color/Normal/Vertex/etc diff --git a/mesalib/src/mesa/main/api_loopback.h b/mesalib/src/mesa/main/api_loopback.h index c35d57bff..af6572d1b 100644 --- a/mesalib/src/mesa/main/api_loopback.h +++ b/mesalib/src/mesa/main/api_loopback.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -28,14 +29,12 @@ #define API_LOOPBACK_H #include "main/compiler.h" -#include "main/mfeatures.h" #include "main/glheader.h" // ? #include "main/macros.h" // ? #include "main/mtypes.h" // ? #include "glapi/glapi.h" // ? #include "glapi/glthread.h" // ? #include "main/dispatch.h" // ? -#include "main/mfeatures.h" // ? #include "main/context.h" // ? struct _glapi_table; diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c index 53b00211b..30a195350 100644 --- a/mesalib/src/mesa/main/api_validate.c +++ b/mesalib/src/mesa/main/api_validate.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include <stdbool.h> @@ -28,7 +29,6 @@ #include "bufferobj.h" #include "context.h" #include "imports.h" -#include "mfeatures.h" #include "mtypes.h" #include "enums.h" #include "vbo/vbo.h" @@ -201,12 +201,11 @@ check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type, * Is 'mode' a valid value for glBegin(), glDrawArrays(), glDrawElements(), * etc? The set of legal values depends on whether geometry shaders/programs * are supported. + * Note: This may be called during display list compilation. */ -GLboolean -_mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name) +bool +_mesa_is_valid_prim_mode(struct gl_context *ctx, GLenum mode) { - bool valid_enum; - switch (mode) { case GL_POINTS: case GL_LINES: @@ -215,24 +214,32 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name) case GL_TRIANGLES: case GL_TRIANGLE_STRIP: case GL_TRIANGLE_FAN: - valid_enum = true; - break; + return true; case GL_QUADS: case GL_QUAD_STRIP: case GL_POLYGON: - valid_enum = (ctx->API == API_OPENGL_COMPAT); - break; + return (ctx->API == API_OPENGL_COMPAT); case GL_LINES_ADJACENCY: case GL_LINE_STRIP_ADJACENCY: case GL_TRIANGLES_ADJACENCY: case GL_TRIANGLE_STRIP_ADJACENCY: - valid_enum = _mesa_is_desktop_gl(ctx) - && ctx->Extensions.ARB_geometry_shader4; - break; + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_geometry_shader4; default: - valid_enum = false; - break; + return false; } +} + + +/** + * Is 'mode' a valid value for glBegin(), glDrawArrays(), glDrawElements(), + * etc? Also, do additional checking related to transformation feedback. + * Note: this function cannot be called during glNewList(GL_COMPILE) because + * this code depends on current transform feedback state. + */ +GLboolean +_mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name) +{ + bool valid_enum = _mesa_is_valid_prim_mode(ctx, mode); if (!valid_enum) { _mesa_error(ctx, GL_INVALID_ENUM, "%s(mode=%x)", name, mode); diff --git a/mesalib/src/mesa/main/api_validate.h b/mesalib/src/mesa/main/api_validate.h index 0ca9c90d9..a5004b8a3 100644 --- a/mesalib/src/mesa/main/api_validate.h +++ b/mesalib/src/mesa/main/api_validate.h @@ -18,18 +18,18 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef API_VALIDATE_H #define API_VALIDATE_H - +#include <stdbool.h> #include "glheader.h" -#include "mfeatures.h" struct gl_buffer_object; struct gl_context; @@ -42,6 +42,9 @@ _mesa_max_buffer_index(struct gl_context *ctx, GLuint count, GLenum type, struct gl_buffer_object *elementBuf); +extern bool +_mesa_is_valid_prim_mode(struct gl_context *ctx, GLenum mode); + extern GLboolean _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name); diff --git a/mesalib/src/mesa/main/arbprogram.c b/mesalib/src/mesa/main/arbprogram.c index 5730ea495..327f582cb 100644 --- a/mesalib/src/mesa/main/arbprogram.c +++ b/mesalib/src/mesa/main/arbprogram.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/main/arbprogram.h b/mesalib/src/mesa/main/arbprogram.h index 4f40a70c5..2b31b9984 100644 --- a/mesalib/src/mesa/main/arbprogram.h +++ b/mesalib/src/mesa/main/arbprogram.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c index ac3e7e666..34d50955f 100644 --- a/mesalib/src/mesa/main/arrayobj.c +++ b/mesalib/src/mesa/main/arrayobj.c @@ -19,10 +19,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -44,7 +44,6 @@ #include "image.h" #include "imports.h" #include "context.h" -#include "mfeatures.h" #include "bufferobj.h" #include "arrayobj.h" #include "macros.h" diff --git a/mesalib/src/mesa/main/arrayobj.h b/mesalib/src/mesa/main/arrayobj.h index 0d58bb75a..d7ff35a56 100644 --- a/mesalib/src/mesa/main/arrayobj.h +++ b/mesalib/src/mesa/main/arrayobj.h @@ -19,10 +19,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef ARRAYOBJ_H diff --git a/mesalib/src/mesa/main/atifragshader.c b/mesalib/src/mesa/main/atifragshader.c index 2a0790862..7077c96f1 100644 --- a/mesalib/src/mesa/main/atifragshader.c +++ b/mesalib/src/mesa/main/atifragshader.c @@ -26,7 +26,6 @@ #include "main/hash.h" #include "main/imports.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/enums.h" #include "main/mtypes.h" #include "main/dispatch.h" diff --git a/mesalib/src/mesa/main/atifragshader.h b/mesalib/src/mesa/main/atifragshader.h index c47a7d56e..afaea009d 100644 --- a/mesalib/src/mesa/main/atifragshader.h +++ b/mesalib/src/mesa/main/atifragshader.h @@ -10,7 +10,6 @@ #include "compiler.h" #include "glheader.h" -#include "mfeatures.h" struct _glapi_table; struct gl_context; diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index a672845bf..249e88a4a 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "glheader.h" @@ -43,7 +44,6 @@ #include "lines.h" #include "macros.h" #include "matrix.h" -#include "mfeatures.h" #include "multisample.h" #include "points.h" #include "polygon.h" @@ -1399,7 +1399,6 @@ copy_array_attrib(struct gl_context *ctx, dest->PrimitiveRestartFixedIndex = src->PrimitiveRestartFixedIndex; dest->_PrimitiveRestart = src->_PrimitiveRestart; dest->RestartIndex = src->RestartIndex; - dest->_RestartIndex = src->_RestartIndex; /* skip NewState */ /* skip RebindArrays */ @@ -1578,7 +1577,6 @@ _mesa_PopClientAttrib(void) copy_pixelstore(ctx, &ctx->Pack, store); _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); } - ctx->NewState |= _NEW_PACKUNPACK; break; case GL_CLIENT_UNPACK_BIT: { @@ -1587,7 +1585,6 @@ _mesa_PopClientAttrib(void) copy_pixelstore(ctx, &ctx->Unpack, store); _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); } - ctx->NewState |= _NEW_PACKUNPACK; break; case GL_CLIENT_VERTEX_ARRAY_BIT: { struct gl_array_attrib * attr = diff --git a/mesalib/src/mesa/main/attrib.h b/mesalib/src/mesa/main/attrib.h index 1ecf3a591..bb9fc5a94 100644 --- a/mesalib/src/mesa/main/attrib.h +++ b/mesalib/src/mesa/main/attrib.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef ATTRIB_H @@ -28,7 +29,6 @@ #include "compiler.h" #include "glheader.h" -#include "mfeatures.h" struct _glapi_table; struct gl_context; diff --git a/mesalib/src/mesa/main/bitset.h b/mesalib/src/mesa/main/bitset.h index 28b3c127e..aceaa0d4d 100644 --- a/mesalib/src/mesa/main/bitset.h +++ b/mesalib/src/mesa/main/bitset.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -42,8 +43,8 @@ /* bitset declarations */ -#define BITSET_DECLARE(name, size) \ - BITSET_WORD name[((size) + BITSET_WORDBITS - 1) / BITSET_WORDBITS] +#define BITSET_WORDS(bits) (ALIGN(bits, BITSET_WORDBITS) / BITSET_WORDBITS) +#define BITSET_DECLARE(name, bits) BITSET_WORD name[BITSET_WORDS(bits)] /* bitset operations */ diff --git a/mesalib/src/mesa/main/blend.c b/mesalib/src/mesa/main/blend.c index 09a1c9ae8..0c28352b2 100644 --- a/mesalib/src/mesa/main/blend.c +++ b/mesalib/src/mesa/main/blend.c @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -783,7 +784,6 @@ _mesa_ClampColor(GLenum target, GLenum clamp) _mesa_update_clamp_fragment_color(ctx); break; case GL_CLAMP_READ_COLOR_ARB: - FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.ClampReadColor = clamp; break; default: @@ -856,6 +856,23 @@ _mesa_update_clamp_vertex_color(struct gl_context *ctx) ctx->Light._ClampVertexColor = _mesa_get_clamp_vertex_color(ctx); } +/** + * Returns an appropriate gl_format for color rendering based on the + * GL_FRAMEBUFFER_SRGB state. + * + * Some drivers implement GL_FRAMEBUFFER_SRGB using a flag on the blend state + * (which GL_FRAMEBUFFER_SRGB maps to reasonably), but some have to do so by + * overriding the format of the surface. This is a helper for doing the + * surface format override variant. + */ +gl_format +_mesa_get_render_format(const struct gl_context *ctx, gl_format format) +{ + if (ctx->Color.sRGBEnabled) + return format; + else + return _mesa_get_srgb_format_linear(format); +} /**********************************************************************/ /** \name Initialization */ diff --git a/mesalib/src/mesa/main/blend.h b/mesalib/src/mesa/main/blend.h index 621311d55..b43b3ccb3 100644 --- a/mesalib/src/mesa/main/blend.h +++ b/mesalib/src/mesa/main/blend.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -34,6 +35,7 @@ #include "glheader.h" +#include "formats.h" struct gl_context; @@ -114,6 +116,9 @@ _mesa_update_clamp_fragment_color(struct gl_context *ctx); extern void _mesa_update_clamp_vertex_color(struct gl_context *ctx); +extern gl_format +_mesa_get_render_format(const struct gl_context *ctx, gl_format format); + extern void _mesa_init_color( struct gl_context * ctx ); diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index b82ba7b4c..ffb67b9b3 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -39,7 +40,6 @@ #include "context.h" #include "bufferobj.h" #include "fbobject.h" -#include "mfeatures.h" #include "mtypes.h" #include "texobj.h" #include "transformfeedback.h" @@ -619,13 +619,10 @@ _mesa_init_buffer_objects( struct gl_context *ctx ) _mesa_reference_buffer_object(ctx, &ctx->CopyWriteBuffer, ctx->Shared->NullBufferObj); - ctx->UniformBufferBindings = calloc(ctx->Const.MaxUniformBufferBindings, - sizeof(*ctx->UniformBufferBindings)); - _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, ctx->Shared->NullBufferObj); - for (i = 0; i < ctx->Const.MaxUniformBufferBindings; i++) { + for (i = 0; i < MAX_COMBINED_UNIFORM_BUFFERS; i++) { _mesa_reference_buffer_object(ctx, &ctx->UniformBufferBindings[i].BufferObject, ctx->Shared->NullBufferObj); @@ -647,14 +644,11 @@ _mesa_free_buffer_objects( struct gl_context *ctx ) _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, NULL); - for (i = 0; i < ctx->Const.MaxUniformBufferBindings; i++) { + for (i = 0; i < MAX_COMBINED_UNIFORM_BUFFERS; i++) { _mesa_reference_buffer_object(ctx, &ctx->UniformBufferBindings[i].BufferObject, NULL); } - - free(ctx->UniformBufferBindings); - ctx->UniformBufferBindings = NULL; } static bool @@ -2060,7 +2054,8 @@ set_ubo_binding(struct gl_context *ctx, return; } - FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT); + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer; _mesa_reference_buffer_object(ctx, &binding->BufferObject, bufObj); binding->Offset = offset; diff --git a/mesalib/src/mesa/main/bufferobj.h b/mesalib/src/mesa/main/bufferobj.h index e98e47670..249178a7a 100644 --- a/mesalib/src/mesa/main/bufferobj.h +++ b/mesalib/src/mesa/main/bufferobj.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #define BUFFEROBJ_H -#include "mfeatures.h" #include "mtypes.h" diff --git a/mesalib/src/mesa/main/buffers.c b/mesalib/src/mesa/main/buffers.c index 3f5cbcda7..12e636b17 100644 --- a/mesalib/src/mesa/main/buffers.c +++ b/mesalib/src/mesa/main/buffers.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -226,8 +227,8 @@ read_buffer_enum_to_index(GLenum buffer) * \param buffer buffer token such as GL_LEFT or GL_FRONT_AND_BACK, etc. * * Note that the behaviour of this function depends on whether the - * current ctx->DrawBuffer is a window-system framebuffer (Name=0) or - * a user-created framebuffer object (Name!=0). + * current ctx->DrawBuffer is a window-system framebuffer or a user-created + * framebuffer object. * In the former case, we update the per-context ctx->Color.DrawBuffer * state var _and_ the FB's ColorDrawBuffer state. * In the later case, we update the FB's ColorDrawBuffer state only. @@ -645,7 +646,6 @@ _mesa_ReadBuffer(GLenum buffer) /* OK, all error checking has been completed now */ _mesa_readbuffer(ctx, buffer, srcBuffer); - ctx->NewState |= _NEW_BUFFERS; /* * Call device driver function. diff --git a/mesalib/src/mesa/main/buffers.h b/mesalib/src/mesa/main/buffers.h index e9768f944..59fce4b05 100644 --- a/mesalib/src/mesa/main/buffers.h +++ b/mesalib/src/mesa/main/buffers.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c index af9433306..fb3e576e6 100644 --- a/mesalib/src/mesa/main/clear.c +++ b/mesalib/src/mesa/main/clear.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -46,10 +47,6 @@ _mesa_ClearIndex( GLfloat c ) { GET_CURRENT_CONTEXT(ctx); - if (ctx->Color.ClearIndex == (GLuint) c) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.ClearIndex = (GLuint) c; } @@ -71,19 +68,12 @@ _mesa_ClearIndex( GLfloat c ) void GLAPIENTRY _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) { - GLfloat tmp[4]; GET_CURRENT_CONTEXT(ctx); - tmp[0] = red; - tmp[1] = green; - tmp[2] = blue; - tmp[3] = alpha; - - if (TEST_EQ_4V(tmp, ctx->Color.ClearColor.f)) - return; /* no change */ - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4V(ctx->Color.ClearColor.f, tmp); + ctx->Color.ClearColor.f[0] = red; + ctx->Color.ClearColor.f[1] = green; + ctx->Color.ClearColor.f[2] = blue; + ctx->Color.ClearColor.f[3] = alpha; } @@ -93,19 +83,12 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) void GLAPIENTRY _mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a) { - GLint tmp[4]; GET_CURRENT_CONTEXT(ctx); - tmp[0] = r; - tmp[1] = g; - tmp[2] = b; - tmp[3] = a; - - if (TEST_EQ_4V(tmp, ctx->Color.ClearColor.i)) - return; /* no change */ - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4V(ctx->Color.ClearColor.i, tmp); + ctx->Color.ClearColor.i[0] = r; + ctx->Color.ClearColor.i[1] = g; + ctx->Color.ClearColor.i[2] = b; + ctx->Color.ClearColor.i[3] = a; } @@ -115,19 +98,12 @@ _mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a) void GLAPIENTRY _mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a) { - GLuint tmp[4]; GET_CURRENT_CONTEXT(ctx); - tmp[0] = r; - tmp[1] = g; - tmp[2] = b; - tmp[3] = a; - - if (TEST_EQ_4V(tmp, ctx->Color.ClearColor.ui)) - return; /* no change */ - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4V(ctx->Color.ClearColor.ui, tmp); + ctx->Color.ClearColor.ui[0] = r; + ctx->Color.ClearColor.ui[1] = g; + ctx->Color.ClearColor.ui[2] = b; + ctx->Color.ClearColor.ui[3] = a; } diff --git a/mesalib/src/mesa/main/clear.h b/mesalib/src/mesa/main/clear.h index 783271920..e410ee6f1 100644 --- a/mesalib/src/mesa/main/clear.h +++ b/mesalib/src/mesa/main/clear.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/clip.c b/mesalib/src/mesa/main/clip.c index b01dd3c97..ebca202be 100644 --- a/mesalib/src/mesa/main/clip.c +++ b/mesalib/src/mesa/main/clip.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/clip.h b/mesalib/src/mesa/main/clip.h index a8e6d7687..dc65cf36c 100644 --- a/mesalib/src/mesa/main/clip.h +++ b/mesalib/src/mesa/main/clip.h @@ -21,9 +21,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/colormac.h b/mesalib/src/mesa/main/colormac.h index 4294f3239..16c245225 100644 --- a/mesalib/src/mesa/main/colormac.h +++ b/mesalib/src/mesa/main/colormac.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/colortab.c b/mesalib/src/mesa/main/colortab.c index c201a27cb..18f993adf 100644 --- a/mesalib/src/mesa/main/colortab.c +++ b/mesalib/src/mesa/main/colortab.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "context.h" #include "image.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "pack.h" #include "pbo.h" diff --git a/mesalib/src/mesa/main/colortab.h b/mesalib/src/mesa/main/colortab.h index f25fbe8a5..1c1854868 100644 --- a/mesalib/src/mesa/main/colortab.h +++ b/mesalib/src/mesa/main/colortab.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "compiler.h" #include "glheader.h" -#include "mfeatures.h" struct _glapi_table; diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h index 8431534c3..1e10f2749 100644 --- a/mesalib/src/mesa/main/compiler.h +++ b/mesalib/src/mesa/main/compiler.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h index 99910d7f3..4a4fdc98c 100644 --- a/mesalib/src/mesa/main/config.h +++ b/mesalib/src/mesa/main/config.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -90,9 +91,6 @@ /** Line width granularity */ #define LINE_WIDTH_GRANULARITY 0.1 -/** Max texture palette / color table size */ -#define MAX_COLOR_TABLE_SIZE 256 - /** Max memory to allow for a single texture image (in megabytes) */ #define MAX_TEXTURE_MBYTES 1024 @@ -170,6 +168,9 @@ /*@{*/ #define MAX_PROGRAM_LOCAL_PARAMS 4096 #define MAX_UNIFORMS 4096 +#define MAX_UNIFORM_BUFFERS 15 /* + 1 default uniform buffer */ +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_UNIFORM_BUFFERS (MAX_UNIFORM_BUFFERS * 6) /*@}*/ /** @@ -218,9 +219,8 @@ /** For GL_ARB_vertex_shader */ /*@{*/ #define MAX_VERTEX_GENERIC_ATTRIBS 16 -#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS -#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_VERTEX_TEXTURE_IMAGE_UNITS + \ - MAX_TEXTURE_IMAGE_UNITS) +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS * 6) /*@}*/ @@ -245,9 +245,6 @@ /** For GL_ARB_geometry_shader4 */ /*@{*/ -#define MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 8 -#define MAX_GEOMETRY_VARYING_COMPONENTS 32 -#define MAX_VERTEX_VARYING_COMPONENTS 32 #define MAX_GEOMETRY_UNIFORM_COMPONENTS 512 #define MAX_GEOMETRY_OUTPUT_VERTICES 256 #define MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 1024 diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 053993421..0053525e8 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -77,7 +78,6 @@ #include "glheader.h" -#include "mfeatures.h" #include "imports.h" #include "accum.h" #include "api_exec.h" @@ -552,9 +552,9 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE; ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS; ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS; - ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; + ctx->Const.FragmentProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, - ctx->Const.MaxTextureImageUnits); + ctx->Const.FragmentProgram.MaxTextureImageUnits); ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY; ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS; ctx->Const.MaxTextureBufferSize = 65536; @@ -571,7 +571,6 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH; ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH; ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY; - ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE; ctx->Const.MaxClipPlanes = 6; ctx->Const.MaxLights = MAX_LIGHTS; ctx->Const.MaxShininess = 128.0; @@ -601,12 +600,10 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE; - ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; + ctx->Const.VertexProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS; ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */ - ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS; - ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS; - ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS; + ctx->Const.GeometryProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES; ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS; @@ -676,27 +673,25 @@ check_context_limits(struct gl_context *ctx) assert(VARYING_SLOT_MAX <= (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead))); - assert(MAX_COMBINED_TEXTURE_IMAGE_UNITS <= 8 * sizeof(GLbitfield)); - /* shader-related checks */ assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); /* Texture unit checks */ - assert(ctx->Const.MaxTextureImageUnits > 0); - assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS); + assert(ctx->Const.FragmentProgram.MaxTextureImageUnits > 0); + assert(ctx->Const.FragmentProgram.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureCoordUnits > 0); assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS); assert(ctx->Const.MaxTextureUnits > 0); assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS); - assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits, + assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.FragmentProgram.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits)); assert(ctx->Const.MaxCombinedTextureImageUnits > 0); assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS); /* number of coord units cannot be greater than number of image units */ - assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits); + assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.FragmentProgram.MaxTextureImageUnits); /* Texture size checks */ @@ -924,7 +919,6 @@ create_beginend_table(const struct gl_context *ctx) COPY_DISPATCH(MapBuffer); COPY_DISPATCH(UnmapBuffer); COPY_DISPATCH(MapBufferRange); - COPY_DISPATCH(MapBufferRange); COPY_DISPATCH(ObjectPurgeableAPPLE); COPY_DISPATCH(ObjectUnpurgeableAPPLE); @@ -1080,6 +1074,7 @@ _mesa_initialize_context(struct gl_context *ctx, return GL_TRUE; fail: + _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); free(ctx->BeginEnd); free(ctx->Exec); free(ctx->Save); @@ -1180,6 +1175,7 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); /* free dispatch tables */ + free(ctx->BeginEnd); free(ctx->Exec); free(ctx->Save); @@ -1724,18 +1720,6 @@ _mesa_Flush(void) } -/** - * Set mvp_with_dp4 flag. If a driver has a preference for DP4 over - * MUL/MAD, or vice versa, call this function to register that. - * Otherwise we default to MUL/MAD. - */ -void -_mesa_set_mvp_with_dp4( struct gl_context *ctx, - GLboolean flag ) -{ - ctx->mvp_with_dp4 = flag; -} - /* * ARB_blend_func_extended - ERRORS section * "The error INVALID_OPERATION is generated by Begin or any procedure that diff --git a/mesalib/src/mesa/main/context.h b/mesalib/src/mesa/main/context.h index 1b881f3f3..0118e5f6a 100644 --- a/mesalib/src/mesa/main/context.h +++ b/mesalib/src/mesa/main/context.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -154,11 +155,6 @@ extern struct _glapi_table * _mesa_get_dispatch(struct gl_context *ctx); -void -_mesa_set_mvp_with_dp4( struct gl_context *ctx, - GLboolean flag ); - - extern GLboolean _mesa_valid_to_render(struct gl_context *ctx, const char *where); @@ -190,6 +186,28 @@ _mesa_Flush( void ); /** + * Are we currently between glBegin and glEnd? + * During execution, not display list compilation. + */ +static inline GLboolean +_mesa_inside_begin_end(const struct gl_context *ctx) +{ + return ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END; +} + + +/** + * Are we currently between glBegin and glEnd in a display list? + */ +static inline GLboolean +_mesa_inside_dlist_begin_end(const struct gl_context *ctx) +{ + return ctx->Driver.CurrentSavePrimitive <= PRIM_MAX; +} + + + +/** * \name Macros for flushing buffered rendering commands before state changes, * checking if inside glBegin/glEnd, etc. */ @@ -242,7 +260,7 @@ do { \ */ #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \ do { \ - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \ + if (_mesa_inside_begin_end(ctx)) { \ _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \ return retval; \ } \ @@ -256,7 +274,7 @@ do { \ */ #define ASSERT_OUTSIDE_BEGIN_END(ctx) \ do { \ - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \ + if (_mesa_inside_begin_end(ctx)) { \ _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \ return; \ } \ diff --git a/mesalib/src/mesa/main/convolve.c b/mesalib/src/mesa/main/convolve.c index dfc1b9465..5f1e85b6b 100644 --- a/mesalib/src/mesa/main/convolve.c +++ b/mesalib/src/mesa/main/convolve.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -36,7 +37,6 @@ #include "colormac.h" #include "convolve.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/mesalib/src/mesa/main/convolve.h b/mesalib/src/mesa/main/convolve.h index 812debd61..3d4c999d9 100644 --- a/mesalib/src/mesa/main/convolve.h +++ b/mesalib/src/mesa/main/convolve.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "compiler.h" -#include "mfeatures.h" struct _glapi_table; diff --git a/mesalib/src/mesa/main/cpuinfo.c b/mesalib/src/mesa/main/cpuinfo.c index 41505f637..3b4ff8cd1 100644 --- a/mesalib/src/mesa/main/cpuinfo.c +++ b/mesalib/src/mesa/main/cpuinfo.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/cpuinfo.h b/mesalib/src/mesa/main/cpuinfo.h index bf846ef40..31de9b2e4 100644 --- a/mesalib/src/mesa/main/cpuinfo.h +++ b/mesalib/src/mesa/main/cpuinfo.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index 8f3cd3d6b..13c7a83d4 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -354,7 +355,9 @@ struct dd_function_table { * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and * GL_MAP_INVALIDATE_RANGE_BIT (if writing) * \param mapOut returns start of mapping of region of interest - * \param rowStrideOut returns row stride (in bytes) + * \param rowStrideOut returns row stride (in bytes). In the case of a + * compressed texture, this is the byte stride between one row of blocks + * and another. */ void (*MapTextureImage)(struct gl_context *ctx, struct gl_texture_image *texImage, @@ -622,7 +625,7 @@ struct dd_function_table { struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att); void (*FinishRenderTexture)(struct gl_context *ctx, - struct gl_renderbuffer_attachment *att); + struct gl_renderbuffer *rb); void (*ValidateFramebuffer)(struct gl_context *ctx, struct gl_framebuffer *fb); /*@}*/ @@ -682,10 +685,9 @@ struct dd_function_table { GLuint CurrentExecPrimitive; /** - * Current state of an in-progress compilation. - * - * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END, - * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above. + * Current glBegin state of an in-progress compilation. May be + * GL_POINTS, GL_TRIANGLE_STRIP, etc. or PRIM_OUTSIDE_BEGIN_END + * or PRIM_UNKNOWN. */ GLuint CurrentSavePrimitive; @@ -694,15 +696,16 @@ struct dd_function_table { #define FLUSH_UPDATE_CURRENT 0x2 /** * Set by the driver-supplied T&L engine whenever vertices are buffered - * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not - * updated. + * between glBegin()/glEnd() objects or __struct gl_contextRec::Current + * is not updated. A bitmask of the FLUSH_x values above. * * The dd_function_table::FlushVertices call below may be used to resolve * these conditions. */ - GLuint NeedFlush; - GLuint SaveNeedFlush; + GLbitfield NeedFlush; + /** Need to call SaveFlushVertices() upon state change? */ + GLboolean SaveNeedFlush; /* Called prior to any of the GLvertexformat functions being * called. Paired with Driver.FlushVertices(). @@ -848,28 +851,17 @@ struct dd_function_table { /** - * Transform/Clip/Lighting interface - * - * Drivers present a reduced set of the functions possible in - * glBegin()/glEnd() objects. Core mesa provides translation stubs for the - * remaining functions to map down to these entry points. + * Per-vertex functions. * - * These are the initial values to be installed into dispatch by - * mesa. If the T&L driver wants to modify the dispatch table - * while installed, it must do so itself. It would be possible for - * the vertexformat to install its own initial values for these - * functions, but this way there is an obvious list of what is - * expected of the driver. + * These are the functions which can appear between glBegin and glEnd. + * Depending on whether we're inside or outside a glBegin/End pair + * and whether we're in immediate mode or building a display list, these + * functions behave differently. This structure allows us to switch + * between those modes more easily. * - * If the driver wants to hook in entry points other than those - * listed, it must restore them to their original values in - * the disable() callback, below. + * Generally, these pointers point to functions in the VBO module. */ typedef struct { - /** - * \name Vertex - */ - /*@{*/ void (GLAPIENTRYP ArrayElement)( GLint ); void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat ); void (GLAPIENTRYP Color3fv)( const GLfloat * ); @@ -1017,84 +1009,6 @@ typedef struct { void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type, GLboolean normalized, const GLuint *value); - - /*@}*/ - - void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat ); - - /** - * \name Array - */ - /*@{*/ - void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count ); - void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices ); - void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start, - GLuint end, GLsizei count, - GLenum type, const GLvoid *indices ); - void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count, - GLenum type, - const GLvoid **indices, - GLsizei primcount); - void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count, - GLenum type, - const GLvoid *indices, - GLint basevertex ); - void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start, - GLuint end, GLsizei count, - GLenum type, - const GLvoid *indices, - GLint basevertex); - void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode, - const GLsizei *count, - GLenum type, - const GLvoid * const *indices, - GLsizei primcount, - const GLint *basevertex); - void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first, - GLsizei count, GLsizei primcount); - void (GLAPIENTRYP DrawArraysInstancedBaseInstance)(GLenum mode, GLint first, - GLsizei count, GLsizei primcount, - GLuint baseinstance); - void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices, - GLsizei primcount); - void (GLAPIENTRYP DrawElementsInstancedBaseInstance)(GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices, - GLsizei primcount, GLuint baseinstance); - void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices, - GLsizei primcount, GLint basevertex); - void (GLAPIENTRYP DrawElementsInstancedBaseVertexBaseInstance)(GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices, - GLsizei primcount, GLint basevertex, - GLuint baseinstance); - void (GLAPIENTRYP DrawTransformFeedback)(GLenum mode, GLuint name); - void (GLAPIENTRYP DrawTransformFeedbackStream)(GLenum mode, GLuint name, - GLuint stream); - void (GLAPIENTRYP DrawTransformFeedbackInstanced)(GLenum mode, GLuint name, - GLsizei primcount); - void (GLAPIENTRYP DrawTransformFeedbackStreamInstanced)(GLenum mode, - GLuint name, - GLuint stream, - GLsizei primcount); - /*@}*/ - - /** - * \name Eval - * - * If you don't support eval, fallback to the default vertex format - * on receiving an eval call and use the pipeline mechanism to - * provide partial T&L acceleration. - * - * Mesa will provide a set of helper functions to do eval within - * accelerated vertex formats, eventually... - */ - /*@{*/ - void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 ); - void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - /*@}*/ - } GLvertexformat; diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c index aee8ae2dc..bd75e4158 100644 --- a/mesalib/src/mesa/main/debug.c +++ b/mesalib/src/mesa/main/debug.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "mtypes.h" @@ -66,7 +67,7 @@ void _mesa_print_state( const char *msg, GLuint state ) { _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", msg, state, (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "", @@ -88,7 +89,6 @@ _mesa_print_state( const char *msg, GLuint state ) (state & _NEW_TEXTURE) ? "ctx->Texture, " : "", (state & _NEW_TRANSFORM) ? "ctx->Transform, " : "", (state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "", - (state & _NEW_PACKUNPACK) ? "ctx->Pack/Unpack, " : "", (state & _NEW_ARRAY) ? "ctx->Array, " : "", (state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "", (state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : ""); @@ -96,27 +96,6 @@ _mesa_print_state( const char *msg, GLuint state ) -void -_mesa_print_tri_caps( const char *name, GLuint flags ) -{ - _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s\n", - name, - flags, - (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "", - (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "", - (flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "", - (flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "", - (flags & DD_TRI_OFFSET) ? "tri-offset, " : "", - (flags & DD_TRI_SMOOTH) ? "tri-smooth, " : "", - (flags & DD_LINE_SMOOTH) ? "line-smooth, " : "", - (flags & DD_LINE_STIPPLE) ? "line-stipple, " : "", - (flags & DD_POINT_SMOOTH) ? "point-smooth, " : "", - (flags & DD_POINT_ATTEN) ? "point-atten, " : "" - ); -} - - /** * Print information about this Mesa version and build options. */ diff --git a/mesalib/src/mesa/main/debug.h b/mesalib/src/mesa/main/debug.h index 6bc536591..919a6f3a1 100644 --- a/mesalib/src/mesa/main/debug.h +++ b/mesalib/src/mesa/main/debug.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -37,12 +38,10 @@ #define _DEBUG_H #include "glheader.h" -#include "mfeatures.h" struct gl_context; struct gl_texture_image; -extern void _mesa_print_tri_caps( const char *name, GLuint flags ); extern void _mesa_print_enable_flags( const char *msg, GLuint flags ); extern void _mesa_print_state( const char *msg, GLuint state ); extern void _mesa_print_info( void ); diff --git a/mesalib/src/mesa/main/depth.c b/mesalib/src/mesa/main/depth.c index 8aec94a2d..68ad56184 100644 --- a/mesalib/src/mesa/main/depth.c +++ b/mesalib/src/mesa/main/depth.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -46,13 +47,7 @@ _mesa_ClearDepth( GLclampd depth ) if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glClearDepth(%f)\n", depth); - depth = CLAMP( depth, 0.0, 1.0 ); - - if (ctx->Depth.Clear == depth) - return; - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.Clear = depth; + ctx->Depth.Clear = CLAMP( depth, 0.0, 1.0 ); } diff --git a/mesalib/src/mesa/main/depth.h b/mesalib/src/mesa/main/depth.h index fe6b33f36..80e753837 100644 --- a/mesalib/src/mesa/main/depth.h +++ b/mesalib/src/mesa/main/depth.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -33,7 +34,6 @@ #include "glheader.h" -#include "mfeatures.h" struct gl_context; diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index 4b20d890d..18e3eb760 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -37,7 +38,6 @@ #include "api_validate.h" #include "atifragshader.h" #include "config.h" -#include "mfeatures.h" #include "bufferobj.h" #include "arrayobj.h" #include "context.h" @@ -69,6 +69,8 @@ #include "main/dispatch.h" +#include "vbo/vbo.h" + /** @@ -122,8 +124,7 @@ do { \ */ #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \ do { \ - if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \ - ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \ + if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \ return retval; \ } \ @@ -137,8 +138,7 @@ do { \ */ #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \ do { \ - if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \ - ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \ + if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \ return; \ } \ @@ -1356,7 +1356,14 @@ save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode, "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile"); } -static void invalidate_saved_current_state( struct gl_context *ctx ) + +/** + * While building a display list we cache some OpenGL state. + * Under some circumstances we need to invalidate that state (immediately + * when we start compiling a list, or after glCallList(s)). + */ +static void +invalidate_saved_current_state(struct gl_context *ctx) { GLint i; @@ -1371,6 +1378,7 @@ static void invalidate_saved_current_state( struct gl_context *ctx ) ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; } + static void GLAPIENTRY save_CallList(GLuint list) { @@ -3771,15 +3779,16 @@ save_ShadeModel(GLenum mode) CALL_ShadeModel(ctx->Exec, (mode)); } + /* Don't compile this call if it's a no-op. + * By avoiding this state change we have a better chance of + * coalescing subsequent drawing commands into one batch. + */ if (ctx->ListState.Current.ShadeModel == mode) return; SAVE_FLUSH_VERTICES(ctx); - /* Only save the value if we know the statechange will take effect: - */ - if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) - ctx->ListState.Current.ShadeModel = mode; + ctx->ListState.Current.ShadeModel = mode; n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1); if (n) { @@ -5645,28 +5654,20 @@ static void GLAPIENTRY save_Begin(GLenum mode) { GET_CURRENT_CONTEXT(ctx); - Node *n; - GLboolean error = GL_FALSE; - if (ctx->ExecuteFlag && !_mesa_valid_prim_mode(ctx, mode, "glBegin")) { - error = GL_TRUE; + if (!_mesa_is_valid_prim_mode(ctx, mode)) { + /* compile this error into the display list */ + _mesa_compile_error(ctx, GL_INVALID_ENUM, "glBegin(mode)"); } - else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) { - /* Typically the first begin. This may raise an error on - * playback, depending on whether CallList is issued from inside - * a begin/end or not. - */ - ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM; - } - else if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) { - ctx->Driver.CurrentSavePrimitive = mode; + else if (_mesa_inside_dlist_begin_end(ctx)) { + /* compile this error into the display list */ + _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive glBegin"); } else { - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive begin"); - error = GL_TRUE; - } + Node *n; + + ctx->Driver.CurrentSavePrimitive = mode; - if (!error) { /* Give the driver an opportunity to hook in an optimized * display list compiler. */ @@ -5678,10 +5679,10 @@ save_Begin(GLenum mode) if (n) { n[1].e = mode; } - } - if (ctx->ExecuteFlag) { - CALL_Begin(ctx->Exec, (mode)); + if (ctx->ExecuteFlag) { + CALL_Begin(ctx->Exec, (mode)); + } } } @@ -5702,7 +5703,7 @@ save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d) { GET_CURRENT_CONTEXT(ctx); Node *n; - SAVE_FLUSH_VERTICES(ctx); + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); n = alloc_instruction(ctx, OPCODE_RECTF, 4); if (n) { n[1].f = a; @@ -7055,7 +7056,10 @@ save_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params) static void GLAPIENTRY save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) { - save_SamplerParameterfv(sampler, pname, ¶m); + GLfloat parray[4]; + parray[0] = param; + parray[1] = parray[2] = parray[3] = 0.0F; + save_SamplerParameterfv(sampler, pname, parray); } static void GLAPIENTRY @@ -8631,8 +8635,7 @@ _mesa_NewList(GLuint name, GLenum mode) ctx->CompileFlag = GL_TRUE; ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE); - /* Reset acumulated list state: - */ + /* Reset accumulated list state */ invalidate_saved_current_state( ctx ); /* Allocate new display list */ @@ -8660,6 +8663,11 @@ _mesa_EndList(void) if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glEndList\n"); + if (ctx->ExecuteFlag && _mesa_inside_dlist_begin_end(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glEndList() called inside glBegin/End"); + } + /* Check that a list is under construction */ if (!ctx->ListState.CurrentList) { _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList"); @@ -8817,6 +8825,9 @@ _mesa_initialize_save_table(const struct gl_context *ctx) _mesa_loopback_init_api_table(ctx, table); + /* VBO functions */ + vbo_initialize_save_dispatch(ctx, table); + /* GL 1.0 */ SET_Accum(table, save_Accum); SET_AlphaFunc(table, save_AlphaFunc); @@ -8927,6 +8938,7 @@ _mesa_initialize_save_table(const struct gl_context *ctx) SET_RasterPos4s(table, save_RasterPos4s); SET_RasterPos4sv(table, save_RasterPos4sv); SET_ReadBuffer(table, save_ReadBuffer); + SET_Rectf(table, save_Rectf); SET_Rotated(table, save_Rotated); SET_Rotatef(table, save_Rotatef); SET_Scaled(table, save_Scaled); @@ -9256,6 +9268,18 @@ _mesa_initialize_save_table(const struct gl_context *ctx) /* GL_ARB_uniform_buffer_object */ SET_UniformBlockBinding(table, save_UniformBlockBinding); + + /* GL_ARB_draw_instanced */ + SET_DrawArraysInstancedARB(table, save_DrawArraysInstancedARB); + SET_DrawElementsInstancedARB(table, save_DrawElementsInstancedARB); + + /* GL_ARB_draw_elements_base_vertex */ + SET_DrawElementsInstancedBaseVertex(table, save_DrawElementsInstancedBaseVertexARB); + + /* GL_ARB_base_instance */ + SET_DrawArraysInstancedBaseInstance(table, save_DrawArraysInstancedBaseInstance); + SET_DrawElementsInstancedBaseInstance(table, save_DrawElementsInstancedBaseInstance); + SET_DrawElementsInstancedBaseVertexBaseInstance(table, save_DrawElementsInstancedBaseVertexBaseInstance); } @@ -9548,14 +9572,15 @@ mesa_print_display_list(GLuint list) /***** Initialization *****/ /**********************************************************************/ -void -_mesa_save_vtxfmt_init(GLvertexformat * vfmt) +static void +save_vtxfmt_init(GLvertexformat * vfmt) { - _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->ArrayElement = _ae_ArrayElement; vfmt->Begin = save_Begin; - _MESA_INIT_DLIST_VTXFMT(vfmt, save_); + vfmt->CallList = save_CallList; + vfmt->CallLists = save_CallLists; vfmt->Color3f = save_Color3f; vfmt->Color3fv = save_Color3fv; @@ -9564,7 +9589,12 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->EdgeFlag = save_EdgeFlag; vfmt->End = save_End; - _MESA_INIT_EVAL_VTXFMT(vfmt, save_); + vfmt->EvalCoord1f = save_EvalCoord1f; + vfmt->EvalCoord1fv = save_EvalCoord1fv; + vfmt->EvalCoord2f = save_EvalCoord2f; + vfmt->EvalCoord2fv = save_EvalCoord2fv; + vfmt->EvalPoint1 = save_EvalPoint1; + vfmt->EvalPoint2 = save_EvalPoint2; vfmt->FogCoordfEXT = save_FogCoordfEXT; vfmt->FogCoordfvEXT = save_FogCoordfvEXT; @@ -9605,36 +9635,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->VertexAttrib3fvARB = save_VertexAttrib3fvARB; vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB; vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB; - - vfmt->Rectf = save_Rectf; - - /* GL_ARB_draw_instanced */ - vfmt->DrawArraysInstanced = save_DrawArraysInstancedARB; - vfmt->DrawElementsInstanced = save_DrawElementsInstancedARB; - - /* GL_ARB_draw_elements_base_vertex */ - vfmt->DrawElementsInstancedBaseVertex = save_DrawElementsInstancedBaseVertexARB; - - /* GL_ARB_base_instance */ - vfmt->DrawArraysInstancedBaseInstance = save_DrawArraysInstancedBaseInstance; - vfmt->DrawElementsInstancedBaseInstance = save_DrawElementsInstancedBaseInstance; - vfmt->DrawElementsInstancedBaseVertexBaseInstance = save_DrawElementsInstancedBaseVertexBaseInstance; - - /* The driver is required to implement these as - * 1) They can probably do a better job. - * 2) A lot of new mechanisms would have to be added to this module - * to support it. That code would probably never get used, - * because of (1). - */ -#if 0 - vfmt->DrawArrays = 0; - vfmt->DrawElements = 0; - vfmt->DrawRangeElements = 0; - vfmt->MultiDrawElemementsEXT = 0; - vfmt->DrawElementsBaseVertex = 0; - vfmt->DrawRangeElementsBaseVertex = 0; - vfmt->MultiDrawElemementsBaseVertex = 0; -#endif } @@ -9674,7 +9674,7 @@ _mesa_init_display_list(struct gl_context *ctx) /* Display List group */ ctx->List.ListBase = 0; - _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); + save_vtxfmt_init(&ctx->ListState.ListVtxfmt); } diff --git a/mesalib/src/mesa/main/dlist.h b/mesalib/src/mesa/main/dlist.h index e049476c1..4672d3e60 100644 --- a/mesalib/src/mesa/main/dlist.h +++ b/mesalib/src/mesa/main/dlist.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -33,16 +34,9 @@ #define DLIST_H -#include "main/mfeatures.h" #include "main/mtypes.h" -#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \ - do { \ - (vfmt)->CallList = impl ## CallList; \ - (vfmt)->CallLists = impl ## CallLists; \ - } while (0) - GLboolean GLAPIENTRY _mesa_IsList(GLuint list); void GLAPIENTRY @@ -72,8 +66,6 @@ extern GLint _mesa_dlist_alloc_opcode( struct gl_context *ctx, GLuint sz, extern void _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist); -extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); - extern void _mesa_initialize_save_table(const struct gl_context *); extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, diff --git a/mesalib/src/mesa/main/dlopen.h b/mesalib/src/mesa/main/dlopen.h index a5366a14e..55a56f0d7 100644 --- a/mesalib/src/mesa/main/dlopen.h +++ b/mesalib/src/mesa/main/dlopen.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/drawpix.c b/mesalib/src/mesa/main/drawpix.c index d9f55d3af..e69113bb1 100644 --- a/mesalib/src/mesa/main/drawpix.c +++ b/mesalib/src/mesa/main/drawpix.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "glheader.h" @@ -31,7 +32,6 @@ #include "feedback.h" #include "framebuffer.h" #include "image.h" -#include "mfeatures.h" #include "pbo.h" #include "state.h" #include "dispatch.h" diff --git a/mesalib/src/mesa/main/drawpix.h b/mesalib/src/mesa/main/drawpix.h index 087b3a8c9..57accbf0a 100644 --- a/mesalib/src/mesa/main/drawpix.h +++ b/mesalib/src/mesa/main/drawpix.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef DRAWPIX_H @@ -27,7 +28,6 @@ #include "compiler.h" -#include "mfeatures.h" struct _glapi_table; diff --git a/mesalib/src/mesa/main/drawtex.c b/mesalib/src/mesa/main/drawtex.c index 7285805c8..7c0ec832b 100644 --- a/mesalib/src/mesa/main/drawtex.c +++ b/mesalib/src/mesa/main/drawtex.c @@ -24,7 +24,6 @@ #include "main/drawtex.h" #include "main/state.h" #include "main/imports.h" -#include "main/mfeatures.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/main/drawtex.h b/mesalib/src/mesa/main/drawtex.h index b916150b7..28e2435c8 100644 --- a/mesalib/src/mesa/main/drawtex.h +++ b/mesalib/src/mesa/main/drawtex.h @@ -26,7 +26,6 @@ #include "glheader.h" -#include "mfeatures.h" extern void GLAPIENTRY diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index b688f050b..fdde24e36 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -21,9 +21,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -33,7 +34,6 @@ #include "enable.h" #include "light.h" #include "simple_list.h" -#include "mfeatures.h" #include "mtypes.h" #include "enums.h" #include "api_arrayelt.h" @@ -53,11 +53,6 @@ update_derived_primitive_restart_state(struct gl_context *ctx) { /* Update derived primitive restart state. */ - if (ctx->Array.PrimitiveRestart) - ctx->Array._RestartIndex = ctx->Array.RestartIndex; - else - ctx->Array._RestartIndex = ~0; - ctx->Array._PrimitiveRestart = ctx->Array.PrimitiveRestart || ctx->Array.PrimitiveRestartFixedIndex; } @@ -140,8 +135,6 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) else arrayObj->_Enabled &= ~flag; - arrayObj->NewArrays |= flag; - if (ctx->Driver.Enable) { ctx->Driver.Enable( ctx, cap, state ); } @@ -419,10 +412,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); ctx->Light.Enabled = state; - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) - ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - else - ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; break; case GL_LINE_SMOOTH: if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES) @@ -431,7 +420,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_LINE); ctx->Line.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_LINE_SMOOTH; break; case GL_LINE_STIPPLE: if (ctx->API != API_OPENGL_COMPAT) @@ -440,7 +428,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_LINE); ctx->Line.StippleFlag = state; - ctx->_TriangleCaps ^= DD_LINE_STIPPLE; break; case GL_INDEX_LOGIC_OP: if (ctx->API != API_OPENGL_COMPAT) @@ -617,7 +604,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_POINT); ctx->Point.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_POINT_SMOOTH; break; case GL_POLYGON_SMOOTH: if (!_mesa_is_desktop_gl(ctx)) @@ -626,7 +612,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_POLYGON); ctx->Polygon.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_TRI_SMOOTH; break; case GL_POLYGON_STIPPLE: if (ctx->API != API_OPENGL_COMPAT) @@ -635,7 +620,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_POLYGON); ctx->Polygon.StippleFlag = state; - ctx->_TriangleCaps ^= DD_TRI_STIPPLE; break; case GL_POLYGON_OFFSET_POINT: if (!_mesa_is_desktop_gl(ctx)) @@ -966,7 +950,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; CHECK_EXTENSION(EXT_transform_feedback, cap); if (ctx->RasterDiscard != state) { - FLUSH_VERTICES(ctx, _NEW_RASTERIZER_DISCARD); + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewRasterizerDiscard; ctx->RasterDiscard = state; } break; diff --git a/mesalib/src/mesa/main/enable.h b/mesalib/src/mesa/main/enable.h index 5b2515d59..060da5656 100644 --- a/mesalib/src/mesa/main/enable.h +++ b/mesalib/src/mesa/main/enable.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/enums.h b/mesalib/src/mesa/main/enums.h index 8f4069426..b2f373a4c 100644 --- a/mesalib/src/mesa/main/enums.h +++ b/mesalib/src/mesa/main/enums.h @@ -27,16 +27,16 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _ENUMS_H_ #define _ENUMS_H_ -#include "mfeatures.h" extern const char *_mesa_lookup_enum_by_nr( int nr ); diff --git a/mesalib/src/mesa/main/errors.c b/mesalib/src/mesa/main/errors.c index 5c6a393e4..0ee3daef3 100644 --- a/mesalib/src/mesa/main/errors.c +++ b/mesalib/src/mesa/main/errors.c @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/errors.h b/mesalib/src/mesa/main/errors.h index 7d8be5aca..b21a44c98 100644 --- a/mesalib/src/mesa/main/errors.h +++ b/mesalib/src/mesa/main/errors.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -73,6 +74,16 @@ _mesa_gl_debug(struct gl_context *ctx, enum mesa_debug_severity severity, const char *fmtString, ...) PRINTFLIKE(5, 6); +#define _mesa_perf_debug(ctx, sev, ...) do { \ + static GLuint msg_id = 0; \ + if (unlikely(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) { \ + _mesa_gl_debug(ctx, &msg_id, \ + MESA_DEBUG_TYPE_PERFORMANCE, \ + sev, \ + __VA_ARGS__); \ + } \ +} while (0) + extern void _mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id, const char *msg, int len); diff --git a/mesalib/src/mesa/main/es1_conversion.c b/mesalib/src/mesa/main/es1_conversion.c index cd527dd78..60a60e287 100644 --- a/mesalib/src/mesa/main/es1_conversion.c +++ b/mesalib/src/mesa/main/es1_conversion.c @@ -1,5 +1,4 @@ #include <stdbool.h> -#include "main/mfeatures.h" #include "api_loopback.h" #include "api_exec.h" diff --git a/mesalib/src/mesa/main/eval.c b/mesalib/src/mesa/main/eval.c index b3c284175..349331f00 100644 --- a/mesalib/src/mesa/main/eval.c +++ b/mesalib/src/mesa/main/eval.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -43,7 +44,6 @@ #include "context.h" #include "eval.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" @@ -824,8 +824,7 @@ _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, void _mesa_install_eval_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt, - bool beginend) + const GLvertexformat *vfmt) { SET_EvalCoord1f(disp, vfmt->EvalCoord1f); SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv); @@ -833,13 +832,6 @@ _mesa_install_eval_vtxfmt(struct _glapi_table *disp, SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv); SET_EvalPoint1(disp, vfmt->EvalPoint1); SET_EvalPoint2(disp, vfmt->EvalPoint2); - - /* glEvalMesh1 and glEvalMesh2 are not allowed between glBegin and glEnd. - */ - if (!beginend) { - SET_EvalMesh1(disp, vfmt->EvalMesh1); - SET_EvalMesh2(disp, vfmt->EvalMesh2); - } } diff --git a/mesalib/src/mesa/main/eval.h b/mesalib/src/mesa/main/eval.h index cfde53fd6..33240f00d 100644 --- a/mesalib/src/mesa/main/eval.h +++ b/mesalib/src/mesa/main/eval.h @@ -27,9 +27,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -37,23 +38,10 @@ #define EVAL_H -#include "main/mfeatures.h" #include "main/mtypes.h" #include <stdbool.h> -#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ - do { \ - (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \ - (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \ - (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \ - (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \ - (vfmt)->EvalPoint1 = impl ## EvalPoint1; \ - (vfmt)->EvalPoint2 = impl ## EvalPoint2; \ - (vfmt)->EvalMesh1 = impl ## EvalMesh1; \ - (vfmt)->EvalMesh2 = impl ## EvalMesh2; \ - } while (0) - extern GLuint _mesa_evaluator_components( GLenum target ); @@ -77,8 +65,7 @@ extern GLfloat *_mesa_copy_map_points2d(GLenum target, extern void _mesa_install_eval_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt, - bool beginend); + const GLvertexformat *vfmt); extern void _mesa_init_eval( struct gl_context *ctx ); extern void _mesa_free_eval_data( struct gl_context *ctx ); diff --git a/mesalib/src/mesa/main/execmem.c b/mesalib/src/mesa/main/execmem.c index ccd6ab43f..5f319661e 100644 --- a/mesalib/src/mesa/main/execmem.c +++ b/mesalib/src/mesa/main/execmem.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -36,7 +37,7 @@ -#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) +#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) || defined(__HAIKU__) /* * Allocate a large block of memory which can hold code then dole it out diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index c7f038b88..39aaad48a 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -35,7 +36,6 @@ #include "context.h" #include "extensions.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" enum { @@ -102,6 +102,7 @@ static const struct extension extension_table[] = { { "GL_ARB_framebuffer_object", o(ARB_framebuffer_object), GL, 2005 }, { "GL_ARB_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 }, { "GL_ARB_get_program_binary", o(ARB_shader_objects), GL, 2010 }, + { "GL_ARB_gpu_shader5", o(ARB_gpu_shader5), GL, 2010 }, { "GL_ARB_half_float_pixel", o(ARB_half_float_pixel), GL, 2003 }, { "GL_ARB_half_float_vertex", o(ARB_half_float_vertex), GL, 2008 }, { "GL_ARB_instanced_arrays", o(ARB_instanced_arrays), GL, 2008 }, @@ -183,6 +184,7 @@ static const struct extension extension_table[] = { { "GL_EXT_fog_coord", o(EXT_fog_coord), GLL, 1999 }, { "GL_EXT_framebuffer_blit", o(EXT_framebuffer_blit), GL, 2005 }, { "GL_EXT_framebuffer_multisample", o(EXT_framebuffer_multisample), GL, 2005 }, + { "GL_EXT_framebuffer_multisample_blit_scaled", o(EXT_framebuffer_multisample_blit_scaled), GL, 2011 }, { "GL_EXT_framebuffer_object", o(EXT_framebuffer_object), GL, 2000 }, { "GL_EXT_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 }, { "GL_EXT_gpu_program_parameters", o(EXT_gpu_program_parameters), GLL, 2006 }, @@ -278,7 +280,7 @@ static const struct extension extension_table[] = { { "GL_OES_texture_cube_map", o(ARB_texture_cube_map), ES1, 2007 }, { "GL_OES_texture_env_crossbar", o(ARB_texture_env_crossbar), ES1, 2005 }, { "GL_OES_texture_mirrored_repeat", o(dummy_true), ES1, 2005 }, - { "GL_OES_texture_npot", o(ARB_texture_non_power_of_two), ES2, 2005 }, + { "GL_OES_texture_npot", o(ARB_texture_non_power_of_two), ES1 | ES2, 2005 }, { "GL_OES_vertex_array_object", o(dummy_true), ES1 | ES2, 2010 }, /* Vendor extensions */ @@ -287,6 +289,7 @@ static const struct extension extension_table[] = { { "GL_AMD_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 }, { "GL_AMD_seamless_cubemap_per_texture", o(AMD_seamless_cubemap_per_texture), GL, 2009 }, { "GL_AMD_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 }, + { "GL_AMD_vertex_shader_layer", o(AMD_vertex_shader_layer), GL, 2012 }, { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), GL, 2006 }, { "GL_APPLE_packed_pixels", o(dummy_true), GLL, 2002 }, { "GL_APPLE_texture_max_level", o(dummy_true), ES1 | ES2, 2009 }, @@ -398,7 +401,9 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.ARB_texture_env_combine = GL_TRUE; ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; - /*ctx->Extensions.ARB_texture_float = GL_TRUE;*/ +#ifdef TEXTURE_FLOAT_ENABLED + ctx->Extensions.ARB_texture_float = GL_TRUE; +#endif ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; ctx->Extensions.ARB_texture_rg = GL_TRUE; ctx->Extensions.ARB_texture_compression_rgtc = GL_TRUE; diff --git a/mesalib/src/mesa/main/extensions.h b/mesalib/src/mesa/main/extensions.h index 8acbd4b68..6e99116da 100644 --- a/mesalib/src/mesa/main/extensions.h +++ b/mesalib/src/mesa/main/extensions.h @@ -27,9 +27,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -37,7 +38,6 @@ #define _EXTENSIONS_H_ #include "glheader.h" -#include "mfeatures.h" struct gl_context; diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index fc2b2620b..39fa242f7 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -42,7 +43,6 @@ #include "glformats.h" #include "hash.h" #include "macros.h" -#include "mfeatures.h" #include "multisample.h" #include "mtypes.h" #include "renderbuffer.h" @@ -323,12 +323,14 @@ void _mesa_remove_attachment(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) { + struct gl_renderbuffer *rb = att->Renderbuffer; + + /* tell driver that we're done rendering to this texture. */ + if (rb && rb->NeedsFinishRenderTexture) + ctx->Driver.FinishRenderTexture(ctx, rb); + if (att->Type == GL_TEXTURE) { ASSERT(att->Texture); - if (ctx->Driver.FinishRenderTexture) { - /* tell driver that we're done rendering to this texture. */ - ctx->Driver.FinishRenderTexture(ctx, att); - } _mesa_reference_texobj(&att->Texture, NULL); /* unbind */ ASSERT(!att->Texture); } @@ -341,6 +343,57 @@ _mesa_remove_attachment(struct gl_context *ctx, att->Complete = GL_TRUE; } +/** + * Create a renderbuffer which will be set up by the driver to wrap the + * texture image slice. + * + * By using a gl_renderbuffer (like user-allocated renderbuffers), drivers get + * to share most of their framebuffer rendering code between winsys, + * renderbuffer, and texture attachments. + * + * The allocated renderbuffer uses a non-zero Name so that drivers can check + * it for determining vertical orientation, but we use ~0 to make it fairly + * unambiguous with actual user (non-texture) renderbuffers. + */ +void +_mesa_update_texture_renderbuffer(struct gl_context *ctx, + struct gl_framebuffer *fb, + struct gl_renderbuffer_attachment *att) +{ + struct gl_texture_image *texImage; + struct gl_renderbuffer *rb; + + texImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; + if (!texImage) + return; + + rb = att->Renderbuffer; + if (!rb) { + rb = ctx->Driver.NewRenderbuffer(ctx, ~0); + if (!rb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture()"); + return; + } + _mesa_reference_renderbuffer(&att->Renderbuffer, rb); + + /* This can't get called on a texture renderbuffer, so set it to NULL + * for clarity compared to user renderbuffers. + */ + rb->AllocStorage = NULL; + + rb->NeedsFinishRenderTexture = ctx->Driver.FinishRenderTexture != NULL; + } + + rb->_BaseFormat = texImage->_BaseFormat; + rb->Format = texImage->TexFormat; + rb->InternalFormat = texImage->InternalFormat; + rb->Width = texImage->Width2; + rb->Height = texImage->Height2; + rb->NumSamples = texImage->NumSamples; + rb->TexImage = texImage; + + ctx->Driver.RenderTexture(ctx, fb, att); +} /** * Bind a texture object to an attachment point. @@ -351,35 +404,35 @@ _mesa_set_texture_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att, struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset) + GLenum texTarget, GLuint level, GLuint zoffset, + GLboolean layered) { + struct gl_renderbuffer *rb = att->Renderbuffer; + + if (rb && rb->NeedsFinishRenderTexture) + ctx->Driver.FinishRenderTexture(ctx, rb); + if (att->Texture == texObj) { /* re-attaching same texture */ ASSERT(att->Type == GL_TEXTURE); - if (ctx->Driver.FinishRenderTexture) - ctx->Driver.FinishRenderTexture(ctx, att); } else { /* new attachment */ - if (ctx->Driver.FinishRenderTexture && att->Texture) - ctx->Driver.FinishRenderTexture(ctx, att); _mesa_remove_attachment(ctx, att); att->Type = GL_TEXTURE; assert(!att->Texture); _mesa_reference_texobj(&att->Texture, texObj); } + invalidate_framebuffer(fb); /* always update these fields */ att->TextureLevel = level; att->CubeMapFace = _mesa_tex_target_to_face(texTarget); att->Zoffset = zoffset; + att->Layered = layered; att->Complete = GL_FALSE; - if (_mesa_get_attachment_teximage(att)) { - ctx->Driver.RenderTexture(ctx, fb, att); - } - - invalidate_framebuffer(fb); + _mesa_update_texture_renderbuffer(ctx, fb, att); } @@ -775,6 +828,8 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, GLint fixedSampleLocations = -1; GLint i; GLuint j; + bool layer_count_valid = false; + GLuint layer_count = 0, att_layer_count; assert(_mesa_is_user_fbo(fb)); @@ -835,8 +890,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, /* get width, height, format of the renderbuffer/texture */ if (att->Type == GL_TEXTURE) { - const struct gl_texture_image *texImg = - _mesa_get_attachment_teximage(att); + const struct gl_texture_image *texImg = att->Renderbuffer->TexImage; minWidth = MIN2(minWidth, texImg->Width); maxWidth = MAX2(maxWidth, texImg->Width); minHeight = MIN2(minHeight, texImg->Height); @@ -947,8 +1001,26 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, fbo_incomplete("unsupported renderbuffer format", i); return; } + + /* Check that layered rendering is consistent. */ + att_layer_count = att->Layered ? att->Renderbuffer->Depth : 0; + if (!layer_count_valid) { + layer_count = att_layer_count; + layer_count_valid = true; + } else if (layer_count != att_layer_count) { + if (layer_count == 0 || att_layer_count == 0) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS; + fbo_incomplete("framebuffer attachment layer mode is inconsistent", i); + } else { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB; + fbo_incomplete("framebuffer attachment layer count is inconsistent", i); + } + return; + } } + fb->Layered = layer_count > 0; + if (_mesa_is_desktop_gl(ctx) && !ctx->Extensions.ARB_ES2_compatibility) { /* Check that all DrawBuffers are present */ for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) { @@ -1790,7 +1862,7 @@ check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb) for (i = 0; i < BUFFER_COUNT; i++) { struct gl_renderbuffer_attachment *att = fb->Attachment + i; - if (att->Texture && _mesa_get_attachment_teximage(att)) { + if (att->Texture && att->Renderbuffer->TexImage) { ctx->Driver.RenderTexture(ctx, fb, att); } } @@ -1812,8 +1884,9 @@ check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb) GLuint i; for (i = 0; i < BUFFER_COUNT; i++) { struct gl_renderbuffer_attachment *att = fb->Attachment + i; - if (att->Texture && att->Renderbuffer) { - ctx->Driver.FinishRenderTexture(ctx, att); + struct gl_renderbuffer *rb = att->Renderbuffer; + if (rb && rb->NeedsFinishRenderTexture) { + ctx->Driver.FinishRenderTexture(ctx, rb); } } } @@ -2103,7 +2176,7 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb, static void framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, - GLint level, GLint zoffset) + GLint level, GLint zoffset, GLboolean layered) { struct gl_renderbuffer_attachment *att; struct gl_texture_object *texObj = NULL; @@ -2230,7 +2303,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, BUFFER_DEPTH); } else { _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget, - level, zoffset); + level, zoffset, layered); if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { /* Above we created a new renderbuffer and attached it to the * depth attachment point. Now attach it to the stencil attachment @@ -2296,7 +2369,7 @@ _mesa_FramebufferTexture1D(GLenum target, GLenum attachment, } framebuffer_texture(ctx, "1D", target, attachment, textarget, texture, - level, 0); + level, 0, GL_FALSE); } @@ -2347,7 +2420,7 @@ _mesa_FramebufferTexture2D(GLenum target, GLenum attachment, } framebuffer_texture(ctx, "2D", target, attachment, textarget, texture, - level, 0); + level, 0, GL_FALSE); } @@ -2365,7 +2438,7 @@ _mesa_FramebufferTexture3D(GLenum target, GLenum attachment, } framebuffer_texture(ctx, "3D", target, attachment, textarget, texture, - level, zoffset); + level, zoffset, GL_FALSE); } @@ -2376,7 +2449,23 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment, GET_CURRENT_CONTEXT(ctx); framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, - level, layer); + level, layer, GL_FALSE); +} + + +void GLAPIENTRY +_mesa_FramebufferTexture(GLenum target, GLenum attachment, + GLuint texture, GLint level) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4) { + framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, + level, 0, GL_TRUE); + } else { + _mesa_error(ctx, GL_INVALID_OPERATION, + "unsupported function (glFramebufferTexture) called"); + } } @@ -2725,7 +2814,7 @@ _mesa_GenerateMipmap(GLenum target) GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + FLUSH_VERTICES(ctx, 0); switch (target) { case GL_TEXTURE_1D: @@ -2891,6 +2980,20 @@ compatible_resolve_formats(const struct gl_renderbuffer *readRb, return GL_FALSE; } +static GLboolean +is_valid_blit_filter(const struct gl_context *ctx, GLenum filter) +{ + switch (filter) { + case GL_NEAREST: + case GL_LINEAR: + return true; + case GL_SCALED_RESOLVE_FASTEST_EXT: + case GL_SCALED_RESOLVE_NICEST_EXT: + return ctx->Extensions.EXT_framebuffer_multisample_blit_scaled; + default: + return false; + } +} /** * Blit rectangular region, optionally from one framebuffer to another. @@ -2909,7 +3012,7 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, const struct gl_framebuffer *readFb, *drawFb; GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + FLUSH_VERTICES(ctx, 0); if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, @@ -2940,8 +3043,17 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, return; } - if (filter != GL_NEAREST && filter != GL_LINEAR) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)"); + if (!is_valid_blit_filter(ctx, filter)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(%s)", + _mesa_lookup_enum_by_nr(filter)); + return; + } + + if ((filter == GL_SCALED_RESOLVE_FASTEST_EXT || + filter == GL_SCALED_RESOLVE_NICEST_EXT) && + (readFb->Visual.samples == 0 || drawFb->Visual.samples > 0)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(%s)", + _mesa_lookup_enum_by_nr(filter)); return; } @@ -3013,10 +3125,10 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, } } } - if (filter == GL_LINEAR) { - /* 3.1 spec, page 199: + if (filter != GL_NEAREST) { + /* From EXT_framebuffer_multisample_blit_scaled specification: * "Calling BlitFramebuffer will result in an INVALID_OPERATION error - * if filter is LINEAR and read buffer contains integer data." + * if filter is not NEAREST and read buffer contains integer data." */ GLenum type = _mesa_get_format_datatype(colorReadRb->Format); if (type == GL_INT || type == GL_UNSIGNED_INT) { @@ -3174,7 +3286,8 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, } /* extra checks for multisample copies... */ - if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) { + if ((readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) && + (filter == GL_NEAREST || filter == GL_LINEAR)) { /* src and dest region sizes must be the same */ if (abs(srcX1 - srcX0) != abs(dstX1 - dstX0) || abs(srcY1 - srcY0) != abs(dstY1 - dstY0)) { diff --git a/mesalib/src/mesa/main/fbobject.h b/mesalib/src/mesa/main/fbobject.h index 0358864d7..dfd795a3a 100644 --- a/mesalib/src/mesa/main/fbobject.h +++ b/mesalib/src/mesa/main/fbobject.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -70,25 +71,6 @@ extern struct gl_renderbuffer_attachment * _mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, GLenum attachment); - -/** Return the texture image for a renderbuffer attachment */ -static inline struct gl_texture_image * -_mesa_get_attachment_teximage(struct gl_renderbuffer_attachment *att) -{ - assert(att->Type == GL_TEXTURE); - return att->Texture->Image[att->CubeMapFace][att->TextureLevel]; -} - - -/** Return the (const) texture image for a renderbuffer attachment */ -static inline const struct gl_texture_image * -_mesa_get_attachment_teximage_const(const struct gl_renderbuffer_attachment *att) -{ - assert(att->Type == GL_TEXTURE); - return att->Texture->Image[att->CubeMapFace][att->TextureLevel]; -} - - extern void _mesa_remove_attachment(struct gl_context *ctx, struct gl_renderbuffer_attachment *att); @@ -98,13 +80,19 @@ _mesa_set_texture_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att, struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset); + GLenum texTarget, GLuint level, GLuint zoffset, + GLboolean layered); extern void _mesa_set_renderbuffer_attachment(struct gl_context *ctx, struct gl_renderbuffer_attachment *att, struct gl_renderbuffer *rb); +void +_mesa_update_texture_renderbuffer(struct gl_context *ctx, + struct gl_framebuffer *fb, + struct gl_renderbuffer_attachment *att); + extern void _mesa_framebuffer_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb, @@ -191,6 +179,10 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); extern void GLAPIENTRY +_mesa_FramebufferTexture(GLenum target, GLenum attachment, + GLuint texture, GLint level); + +extern void GLAPIENTRY _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); diff --git a/mesalib/src/mesa/main/feedback.c b/mesalib/src/mesa/main/feedback.c index 5d4c6e40d..990d1da6c 100644 --- a/mesalib/src/mesa/main/feedback.c +++ b/mesalib/src/mesa/main/feedback.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -35,7 +36,6 @@ #include "enums.h" #include "feedback.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/mesalib/src/mesa/main/feedback.h b/mesalib/src/mesa/main/feedback.h index a697dc0d2..48c0efc7d 100644 --- a/mesalib/src/mesa/main/feedback.h +++ b/mesalib/src/mesa/main/feedback.h @@ -18,16 +18,16 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef FEEDBACK_H #define FEEDBACK_H -#include "main/mfeatures.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp index 01a4542d7..91c425be6 100644 --- a/mesalib/src/mesa/main/ff_fragment_shader.cpp +++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp @@ -1336,7 +1336,10 @@ create_new_program(struct gl_context *ctx, struct state_key *key) validate_ir_tree(p.shader->ir); - while (do_common_optimization(p.shader->ir, false, false, 32)) + const struct gl_shader_compiler_options *options = + &ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT]; + + while (do_common_optimization(p.shader->ir, false, false, 32, options)) ; reparent_ir(p.shader->ir, p.shader->ir); diff --git a/mesalib/src/mesa/main/ffvertex_prog.c b/mesalib/src/mesa/main/ffvertex_prog.c index 093bc6651..be6ac0f2a 100644 --- a/mesalib/src/mesa/main/ffvertex_prog.c +++ b/mesalib/src/mesa/main/ffvertex_prog.c @@ -36,7 +36,6 @@ #include "main/glheader.h" #include "main/mtypes.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/enums.h" #include "main/ffvertex_prog.h" #include "program/program.h" @@ -608,7 +607,6 @@ static void emit_op3fn(struct tnl_program *p, inst = &p->program->Base.Instructions[nr]; inst->Opcode = (enum prog_opcode) op; - inst->Data = 0; emit_arg( &inst->SrcReg[0], src0 ); emit_arg( &inst->SrcReg[1], src1 ); @@ -700,16 +698,11 @@ static void emit_normalize_vec3( struct tnl_program *p, struct ureg dest, struct ureg src ) { -#if 0 - /* XXX use this when drivers are ready for NRM3 */ - emit_op1(p, OPCODE_NRM3, dest, WRITEMASK_XYZ, src); -#else struct ureg tmp = get_temp(p); emit_op2(p, OPCODE_DP3, tmp, WRITEMASK_X, src, src); emit_op1(p, OPCODE_RSQ, tmp, WRITEMASK_X, tmp); emit_op2(p, OPCODE_MUL, dest, 0, src, swizzle1(tmp, X)); release_temp(p, tmp); -#endif } @@ -1681,7 +1674,7 @@ _mesa_get_fixed_func_vertex_program(struct gl_context *ctx) return NULL; create_new_program( &key, prog, - ctx->mvp_with_dp4, + ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4, ctx->Const.VertexProgram.MaxTemps ); #if 0 diff --git a/mesalib/src/mesa/main/fog.c b/mesalib/src/mesa/main/fog.c index 3c5228ad5..7601651c3 100644 --- a/mesalib/src/mesa/main/fog.c +++ b/mesalib/src/mesa/main/fog.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/fog.h b/mesalib/src/mesa/main/fog.h index 20a75e96b..6bd1cc5ad 100644 --- a/mesalib/src/mesa/main/fog.h +++ b/mesalib/src/mesa/main/fog.h @@ -27,9 +27,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -38,7 +39,6 @@ #include "glheader.h" -#include "mfeatures.h" struct gl_context; diff --git a/mesalib/src/mesa/main/format_pack.c b/mesalib/src/mesa/main/format_pack.c index 1a14b98b7..826fc10a6 100644 --- a/mesalib/src/mesa/main/format_pack.c +++ b/mesalib/src/mesa/main/format_pack.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/format_pack.h b/mesalib/src/mesa/main/format_pack.h index 20b2ad8a5..ebd103d03 100644 --- a/mesalib/src/mesa/main/format_pack.h +++ b/mesalib/src/mesa/main/format_pack.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/format_unpack.c b/mesalib/src/mesa/main/format_unpack.c index 0933b4e87..0a8b8b183 100644 --- a/mesalib/src/mesa/main/format_unpack.c +++ b/mesalib/src/mesa/main/format_unpack.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -610,6 +611,20 @@ unpack_ARGB2101010(const void *src, GLfloat dst[][4], GLuint n) static void +unpack_ARGB2101010_UINT(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat)((s[i] >> 20) & 0x3ff); + dst[i][GCOMP] = (GLfloat)((s[i] >> 10) & 0x3ff); + dst[i][BCOMP] = (GLfloat)((s[i] >> 0) & 0x3ff); + dst[i][ACOMP] = (GLfloat)((s[i] >> 30) & 0x03); + } +} + + +static void unpack_ABGR2101010_UINT(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = ((const GLuint *) src); @@ -1060,6 +1075,344 @@ unpack_RG_FLOAT16(const void *src, GLfloat dst[][4], GLuint n) } } +static void +unpack_ALPHA_UINT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLubyte *s = (const GLubyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_ALPHA_UINT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = (const GLushort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_ALPHA_UINT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_ALPHA_INT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLbyte *s = (const GLbyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_ALPHA_INT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLshort *s = (const GLshort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_ALPHA_INT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLint *s = (const GLint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_INTENSITY_UINT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLubyte *s = (const GLubyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_INTENSITY_UINT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = (const GLushort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_INTENSITY_UINT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_INTENSITY_INT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLbyte *s = (const GLbyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_INTENSITY_INT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLshort *s = (const GLshort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_INTENSITY_INT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLint *s = (const GLint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = + dst[i][ACOMP] = (GLfloat) s[i]; + } +} + +static void +unpack_LUMINANCE_UINT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLubyte *s = (const GLubyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = dst[i][GCOMP] = dst[i][BCOMP] = (GLfloat) s[i]; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_LUMINANCE_UINT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = (const GLushort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = dst[i][GCOMP] = dst[i][BCOMP] = (GLfloat) s[i]; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_LUMINANCE_UINT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = dst[i][GCOMP] = dst[i][BCOMP] = (GLfloat) s[i]; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_LUMINANCE_INT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLbyte *s = (const GLbyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = dst[i][GCOMP] = dst[i][BCOMP] = (GLfloat) s[i]; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_LUMINANCE_INT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLshort *s = (const GLshort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = dst[i][GCOMP] = dst[i][BCOMP] = (GLfloat) s[i]; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_LUMINANCE_INT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLint *s = (const GLint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = dst[i][GCOMP] = dst[i][BCOMP] = (GLfloat) s[i]; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_LUMINANCE_ALPHA_UINT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLubyte *s = (const GLubyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = (GLfloat) s[2*i+0]; + dst[i][ACOMP] = (GLfloat) s[2*i+1]; + } +} + +static void +unpack_LUMINANCE_ALPHA_UINT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = (const GLushort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = (GLfloat) s[2*i+0]; + dst[i][ACOMP] = (GLfloat) s[2*i+1]; + } +} + +static void +unpack_LUMINANCE_ALPHA_UINT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = (GLfloat) s[2*i+0]; + dst[i][ACOMP] = (GLfloat) s[2*i+1]; + } +} + +static void +unpack_LUMINANCE_ALPHA_INT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLbyte *s = (const GLbyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = (GLfloat) s[2*i+0]; + dst[i][ACOMP] = (GLfloat) s[2*i+1]; + } +} + +static void +unpack_LUMINANCE_ALPHA_INT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLshort *s = (const GLshort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = (GLfloat) s[2*i+0]; + dst[i][ACOMP] = (GLfloat) s[2*i+1]; + } +} + +static void +unpack_LUMINANCE_ALPHA_INT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLint *s = (const GLint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = (GLfloat) s[2*i+0]; + dst[i][ACOMP] = (GLfloat) s[2*i+1]; + } +} + +static void +unpack_R_INT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLbyte *s = (const GLbyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i]; + dst[i][GCOMP] = 0.0; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RG_INT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLbyte *s = (const GLbyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*2+0]; + dst[i][GCOMP] = (GLfloat) s[i*2+1]; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RGB_INT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLbyte *s = (const GLbyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*3+0]; + dst[i][GCOMP] = (GLfloat) s[i*3+1]; + dst[i][BCOMP] = (GLfloat) s[i*3+2]; + dst[i][ACOMP] = 1.0; + } +} static void unpack_RGBA_INT8(const void *src, GLfloat dst[][4], GLuint n) @@ -1075,6 +1428,45 @@ unpack_RGBA_INT8(const void *src, GLfloat dst[][4], GLuint n) } static void +unpack_R_INT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLshort *s = (const GLshort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i]; + dst[i][GCOMP] = 0.0; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RG_INT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLshort *s = (const GLshort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*2+0]; + dst[i][GCOMP] = (GLfloat) s[i*2+1]; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RGB_INT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLshort *s = (const GLshort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*3+0]; + dst[i][GCOMP] = (GLfloat) s[i*3+1]; + dst[i][BCOMP] = (GLfloat) s[i*3+2]; + dst[i][ACOMP] = 1.0; + } +} + +static void unpack_RGBA_INT16(const void *src, GLfloat dst[][4], GLuint n) { const GLshort *s = (const GLshort *) src; @@ -1088,6 +1480,46 @@ unpack_RGBA_INT16(const void *src, GLfloat dst[][4], GLuint n) } static void +unpack_R_INT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLint *s = (const GLint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i]; + dst[i][GCOMP] = 0.0; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RG_INT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLint *s = (const GLint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*2+0]; + dst[i][GCOMP] = (GLfloat) s[i*2+1]; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RGB_INT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLint *s = (const GLint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*3+0]; + dst[i][GCOMP] = (GLfloat) s[i*3+1]; + dst[i][BCOMP] = (GLfloat) s[i*3+2]; + dst[i][ACOMP] = 1.0; + } +} + + +static void unpack_RGBA_INT32(const void *src, GLfloat dst[][4], GLuint n) { const GLint *s = (const GLint *) src; @@ -1101,6 +1533,45 @@ unpack_RGBA_INT32(const void *src, GLfloat dst[][4], GLuint n) } static void +unpack_R_UINT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLubyte *s = (const GLubyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i]; + dst[i][GCOMP] = 0.0; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RG_UINT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLubyte *s = (const GLubyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*2+0]; + dst[i][GCOMP] = (GLfloat) s[i*2+1]; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RGB_UINT8(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLubyte *s = (const GLubyte *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*3+0]; + dst[i][GCOMP] = (GLfloat) s[i*3+1]; + dst[i][BCOMP] = (GLfloat) s[i*3+2]; + dst[i][ACOMP] = 1.0; + } +} + +static void unpack_RGBA_UINT8(const void *src, GLfloat dst[][4], GLuint n) { const GLubyte *s = (const GLubyte *) src; @@ -1114,6 +1585,45 @@ unpack_RGBA_UINT8(const void *src, GLfloat dst[][4], GLuint n) } static void +unpack_R_UINT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = (const GLushort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i]; + dst[i][GCOMP] = 0.0; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RG_UINT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = (const GLushort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*2+0]; + dst[i][GCOMP] = (GLfloat) s[i*2+1]; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RGB_UINT16(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = (const GLushort *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*3+0]; + dst[i][GCOMP] = (GLfloat) s[i*3+1]; + dst[i][BCOMP] = (GLfloat) s[i*3+2]; + dst[i][ACOMP] = 1.0; + } +} + +static void unpack_RGBA_UINT16(const void *src, GLfloat dst[][4], GLuint n) { const GLushort *s = (const GLushort *) src; @@ -1127,6 +1637,45 @@ unpack_RGBA_UINT16(const void *src, GLfloat dst[][4], GLuint n) } static void +unpack_R_UINT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i]; + dst[i][GCOMP] = 0.0; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RG_UINT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*2+0]; + dst[i][GCOMP] = (GLfloat) s[i*2+1]; + dst[i][BCOMP] = 0.0; + dst[i][ACOMP] = 1.0; + } +} + +static void +unpack_RGB_UINT32(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = (const GLuint *) src; + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = (GLfloat) s[i*3+0]; + dst[i][GCOMP] = (GLfloat) s[i*3+1]; + dst[i][BCOMP] = (GLfloat) s[i*3+2]; + dst[i][ACOMP] = 1.0; + } +} + +static void unpack_RGBA_UINT32(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = (const GLuint *) src; @@ -1770,6 +2319,7 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_GR1616] = unpack_GR1616; table[MESA_FORMAT_RG1616] = unpack_RG1616; table[MESA_FORMAT_ARGB2101010] = unpack_ARGB2101010; + table[MESA_FORMAT_ARGB2101010_UINT] = unpack_ARGB2101010_UINT; table[MESA_FORMAT_ABGR2101010_UINT] = unpack_ABGR2101010_UINT; table[MESA_FORMAT_Z24_S8] = unpack_Z24_S8; table[MESA_FORMAT_S8_Z24] = unpack_S8_Z24; @@ -1812,11 +2362,57 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_RG_FLOAT32] = unpack_RG_FLOAT32; table[MESA_FORMAT_RG_FLOAT16] = unpack_RG_FLOAT16; + table[MESA_FORMAT_ALPHA_UINT8] = unpack_ALPHA_UINT8; + table[MESA_FORMAT_ALPHA_UINT16] = unpack_ALPHA_UINT16; + table[MESA_FORMAT_ALPHA_UINT32] = unpack_ALPHA_UINT32; + table[MESA_FORMAT_ALPHA_INT8] = unpack_ALPHA_INT8; + table[MESA_FORMAT_ALPHA_INT16] = unpack_ALPHA_INT16; + table[MESA_FORMAT_ALPHA_INT32] = unpack_ALPHA_INT32; + + table[MESA_FORMAT_INTENSITY_UINT8] = unpack_INTENSITY_UINT8; + table[MESA_FORMAT_INTENSITY_UINT16] = unpack_INTENSITY_UINT16; + table[MESA_FORMAT_INTENSITY_UINT32] = unpack_INTENSITY_UINT32; + table[MESA_FORMAT_INTENSITY_INT8] = unpack_INTENSITY_INT8; + table[MESA_FORMAT_INTENSITY_INT16] = unpack_INTENSITY_INT16; + table[MESA_FORMAT_INTENSITY_INT32] = unpack_INTENSITY_INT32; + + table[MESA_FORMAT_LUMINANCE_UINT8] = unpack_LUMINANCE_UINT8; + table[MESA_FORMAT_LUMINANCE_UINT16] = unpack_LUMINANCE_UINT16; + table[MESA_FORMAT_LUMINANCE_UINT32] = unpack_LUMINANCE_UINT32; + table[MESA_FORMAT_LUMINANCE_INT8] = unpack_LUMINANCE_INT8; + table[MESA_FORMAT_LUMINANCE_INT16] = unpack_LUMINANCE_INT16; + table[MESA_FORMAT_LUMINANCE_INT32] = unpack_LUMINANCE_INT32; + + table[MESA_FORMAT_LUMINANCE_ALPHA_UINT8] = unpack_LUMINANCE_ALPHA_UINT8; + table[MESA_FORMAT_LUMINANCE_ALPHA_UINT16] = unpack_LUMINANCE_ALPHA_UINT16; + table[MESA_FORMAT_LUMINANCE_ALPHA_UINT32] = unpack_LUMINANCE_ALPHA_UINT32; + table[MESA_FORMAT_LUMINANCE_ALPHA_INT8] = unpack_LUMINANCE_ALPHA_INT8; + table[MESA_FORMAT_LUMINANCE_ALPHA_INT16] = unpack_LUMINANCE_ALPHA_INT16; + table[MESA_FORMAT_LUMINANCE_ALPHA_INT32] = unpack_LUMINANCE_ALPHA_INT32; + + table[MESA_FORMAT_R_INT8] = unpack_R_INT8; + table[MESA_FORMAT_RG_INT8] = unpack_RG_INT8; + table[MESA_FORMAT_RGB_INT8] = unpack_RGB_INT8; table[MESA_FORMAT_RGBA_INT8] = unpack_RGBA_INT8; + table[MESA_FORMAT_R_INT16] = unpack_R_INT16; + table[MESA_FORMAT_RG_INT16] = unpack_RG_INT16; + table[MESA_FORMAT_RGB_INT16] = unpack_RGB_INT16; table[MESA_FORMAT_RGBA_INT16] = unpack_RGBA_INT16; + table[MESA_FORMAT_R_INT32] = unpack_R_INT32; + table[MESA_FORMAT_RG_INT32] = unpack_RG_INT32; + table[MESA_FORMAT_RGB_INT32] = unpack_RGB_INT32; table[MESA_FORMAT_RGBA_INT32] = unpack_RGBA_INT32; + table[MESA_FORMAT_R_UINT8] = unpack_R_UINT8; + table[MESA_FORMAT_RG_UINT8] = unpack_RG_UINT8; + table[MESA_FORMAT_RGB_UINT8] = unpack_RGB_UINT8; table[MESA_FORMAT_RGBA_UINT8] = unpack_RGBA_UINT8; + table[MESA_FORMAT_R_UINT16] = unpack_R_UINT16; + table[MESA_FORMAT_RG_UINT16] = unpack_RG_UINT16; + table[MESA_FORMAT_RGB_UINT16] = unpack_RGB_UINT16; table[MESA_FORMAT_RGBA_UINT16] = unpack_RGBA_UINT16; + table[MESA_FORMAT_R_UINT32] = unpack_R_UINT32; + table[MESA_FORMAT_RG_UINT32] = unpack_RG_UINT32; + table[MESA_FORMAT_RGB_UINT32] = unpack_RGB_UINT32; table[MESA_FORMAT_RGBA_UINT32] = unpack_RGBA_UINT32; table[MESA_FORMAT_DUDV8] = unpack_DUDV8; @@ -1852,7 +2448,7 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_ETC2_SIGNED_RG11_EAC] = unpack_ETC2_SIGNED_RG11_EAC; table[MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1] = unpack_ETC2_RGB8_PUNCHTHROUGH_ALPHA1; - table[MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1] = + table[MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1] = unpack_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1; table[MESA_FORMAT_SIGNED_A8] = unpack_SIGNED_A8; table[MESA_FORMAT_SIGNED_L8] = unpack_SIGNED_L8; diff --git a/mesalib/src/mesa/main/format_unpack.h b/mesalib/src/mesa/main/format_unpack.h index 29c526319..1da03caa8 100644 --- a/mesalib/src/mesa/main/format_unpack.h +++ b/mesalib/src/mesa/main/format_unpack.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef FORMAT_UNPACK_H diff --git a/mesalib/src/mesa/main/formatquery.c b/mesalib/src/mesa/main/formatquery.c index e45dc8680..40eca8711 100644 --- a/mesalib/src/mesa/main/formatquery.c +++ b/mesalib/src/mesa/main/formatquery.c @@ -25,7 +25,6 @@ #include "context.h" #include "glformats.h" #include "macros.h" -#include "mfeatures.h" #include "enums.h" #include "fbobject.h" #include "formatquery.h" diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c index 68ce98430..fee52c1ea 100644 --- a/mesalib/src/mesa/main/formats.c +++ b/mesalib/src/mesa/main/formats.c @@ -18,15 +18,15 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "imports.h" #include "formats.h" -#include "mfeatures.h" #include "macros.h" #include "glformats.h" diff --git a/mesalib/src/mesa/main/formats.h b/mesalib/src/mesa/main/formats.h index 2961ffa9f..8dd71a086 100644 --- a/mesalib/src/mesa/main/formats.h +++ b/mesalib/src/mesa/main/formats.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* @@ -288,21 +289,21 @@ typedef enum MESA_FORMAT_ARGB2101010_UINT, MESA_FORMAT_ABGR2101010_UINT, - MESA_FORMAT_XRGB4444_UNORM, - MESA_FORMAT_XRGB1555_UNORM, - MESA_FORMAT_XBGR8888_SNORM, - MESA_FORMAT_XBGR8888_SRGB, - MESA_FORMAT_XBGR8888_UINT, - MESA_FORMAT_XBGR8888_SINT, - MESA_FORMAT_XRGB2101010_UNORM, - MESA_FORMAT_XBGR16161616_UNORM, - MESA_FORMAT_XBGR16161616_SNORM, - MESA_FORMAT_XBGR16161616_FLOAT, - MESA_FORMAT_XBGR16161616_UINT, - MESA_FORMAT_XBGR16161616_SINT, - MESA_FORMAT_XBGR32323232_FLOAT, - MESA_FORMAT_XBGR32323232_UINT, - MESA_FORMAT_XBGR32323232_SINT, + MESA_FORMAT_XRGB4444_UNORM, /* xxxx RRRR GGGG BBBB */ + MESA_FORMAT_XRGB1555_UNORM, /* xRRR RRGG GGGB BBBB */ + MESA_FORMAT_XBGR8888_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_XBGR8888_SRGB, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_XBGR8888_UINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_XBGR8888_SINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_XRGB2101010_UNORM, /* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ + MESA_FORMAT_XBGR16161616_UNORM,/* ushort[3]=x, [2]=B, [1]=G, [0]=R */ + MESA_FORMAT_XBGR16161616_SNORM,/* ... */ + MESA_FORMAT_XBGR16161616_FLOAT,/* ... */ + MESA_FORMAT_XBGR16161616_UINT, /* ... */ + MESA_FORMAT_XBGR16161616_SINT, /* ... */ + MESA_FORMAT_XBGR32323232_FLOAT,/* float[3]=x, [2]=B, [1]=G, [0]=R */ + MESA_FORMAT_XBGR32323232_UINT, /* ... */ + MESA_FORMAT_XBGR32323232_SINT, /* ... */ MESA_FORMAT_COUNT } gl_format; diff --git a/mesalib/src/mesa/main/framebuffer.c b/mesalib/src/mesa/main/framebuffer.c index 6c6977431..0337b8b08 100644 --- a/mesalib/src/mesa/main/framebuffer.c +++ b/mesalib/src/mesa/main/framebuffer.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -877,18 +878,29 @@ _mesa_dest_buffer_exists(struct gl_context *ctx, GLenum format) GLenum _mesa_get_color_read_format(struct gl_context *ctx) { - const GLenum data_type = _mesa_get_format_datatype( - ctx->ReadBuffer->_ColorReadBuffer->Format); - - switch (ctx->ReadBuffer->_ColorReadBuffer->Format) { - case MESA_FORMAT_ARGB8888: - return GL_BGRA; - case MESA_FORMAT_RGB565: - return GL_BGR; - default: - if (data_type == GL_UNSIGNED_INT || data_type == GL_INT) { + if (!ctx->ReadBuffer || !ctx->ReadBuffer->_ColorReadBuffer) { + /* The spec is unclear how to handle this case, but NVIDIA's + * driver generates GL_INVALID_OPERATION. + */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT: " + "no GL_READ_BUFFER)"); + return GL_NONE; + } + else { + const GLenum format = ctx->ReadBuffer->_ColorReadBuffer->Format; + const GLenum data_type = _mesa_get_format_datatype(format); + + if (format == MESA_FORMAT_ARGB8888) + return GL_BGRA; + else if (format == MESA_FORMAT_RGB565) + return GL_BGR; + + switch (data_type) { + case GL_UNSIGNED_INT: + case GL_INT: return GL_RGBA_INTEGER; - } else { + default: return GL_RGBA; } } @@ -901,26 +913,33 @@ _mesa_get_color_read_format(struct gl_context *ctx) GLenum _mesa_get_color_read_type(struct gl_context *ctx) { - const GLenum data_type = _mesa_get_format_datatype( - ctx->ReadBuffer->_ColorReadBuffer->Format); - - switch (ctx->ReadBuffer->_ColorReadBuffer->Format) { - case MESA_FORMAT_RGB565: - return GL_UNSIGNED_SHORT_5_6_5_REV; - default: - break; + if (!ctx->ReadBuffer || !ctx->ReadBuffer->_ColorReadBuffer) { + /* The spec is unclear how to handle this case, but NVIDIA's + * driver generates GL_INVALID_OPERATION. + */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE: " + "no GL_READ_BUFFER)"); + return GL_NONE; } - - switch (data_type) { - case GL_SIGNED_NORMALIZED: - return GL_BYTE; - case GL_UNSIGNED_INT: - case GL_INT: - case GL_FLOAT: - return data_type; - case GL_UNSIGNED_NORMALIZED: - default: - return GL_UNSIGNED_BYTE; + else { + const GLenum format = ctx->ReadBuffer->_ColorReadBuffer->Format; + const GLenum data_type = _mesa_get_format_datatype(format); + + if (format == MESA_FORMAT_RGB565) + return GL_UNSIGNED_SHORT_5_6_5_REV; + + switch (data_type) { + case GL_SIGNED_NORMALIZED: + return GL_BYTE; + case GL_UNSIGNED_INT: + case GL_INT: + case GL_FLOAT: + return data_type; + case GL_UNSIGNED_NORMALIZED: + default: + return GL_UNSIGNED_BYTE; + } } } @@ -961,8 +980,7 @@ _mesa_print_framebuffer(const struct gl_framebuffer *fb) for (i = 0; i < BUFFER_COUNT; i++) { const struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; if (att->Type == GL_TEXTURE) { - const struct gl_texture_image *texImage = - _mesa_get_attachment_teximage_const(att); + const struct gl_texture_image *texImage = att->Renderbuffer->TexImage; fprintf(stderr, " %2d: Texture %u, level %u, face %u, slice %u, complete %d\n", i, att->Texture->Name, att->TextureLevel, att->CubeMapFace, diff --git a/mesalib/src/mesa/main/framebuffer.h b/mesalib/src/mesa/main/framebuffer.h index 9b94452d6..962f2a4e2 100644 --- a/mesalib/src/mesa/main/framebuffer.h +++ b/mesalib/src/mesa/main/framebuffer.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 2ba868c0d..593c75be2 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -15,9 +15,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Author: Kristian Høgsberg <krh@bitplanet.net> */ @@ -30,12 +31,12 @@ #include "extensions.h" #include "get.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "state.h" #include "texcompress.h" #include "framebuffer.h" #include "samplerobj.h" +#include "stencil.h" /* This is a table driven implemetation of the glGet*v() functions. * The basic idea is that most getters just look up an int somewhere @@ -141,6 +142,7 @@ enum value_extra { EXTRA_VALID_CLIP_DISTANCE, EXTRA_FLUSH_CURRENT, EXTRA_GLSL_130, + EXTRA_EXT_UBO_GS4, }; #define NO_EXTRA NULL @@ -226,7 +228,13 @@ union value { * extensions or specific gl versions) or actions (flush current, new * buffers) that we need to do before looking up an enum. We need to * declare them all up front so we can refer to them in the value_desc - * structs below. */ + * structs below. + * + * Each EXTRA_ will be executed. For EXTRA_* enums of extensions and API + * versions, listing multiple ones in an array means an error will be thrown + * only if none of them are available. If you need to check for "AND" + * behavior, you would need to make a custom EXTRA_ enum. + */ static const int extra_new_buffers[] = { EXTRA_NEW_BUFFERS, @@ -281,6 +289,12 @@ static const int extra_EXT_texture_integer[] = { EXTRA_END }; +static const int extra_EXT_texture_integer_and_new_buffers[] = { + EXT(EXT_texture_integer), + EXTRA_NEW_BUFFERS, + EXTRA_END +}; + static const int extra_GLSL_130[] = { EXTRA_GLSL_130, EXTRA_END @@ -300,8 +314,7 @@ static const int extra_ARB_transform_feedback2_api_es3[] = { }; static const int extra_ARB_uniform_buffer_object_and_geometry_shader[] = { - EXT(ARB_uniform_buffer_object), - EXT(ARB_geometry_shader4), + EXTRA_EXT_UBO_GS4, EXTRA_END }; @@ -317,6 +330,12 @@ static const int extra_ARB_ES3_compatibility_api_es3[] = { EXTRA_END }; +static const int extra_EXT_framebuffer_sRGB_and_new_buffers[] = { + EXT(EXT_framebuffer_sRGB), + EXTRA_NEW_BUFFERS, + EXTRA_END +}; + EXTRA_EXT(ARB_texture_cube_map); EXTRA_EXT(MESA_texture_array); EXTRA_EXT2(EXT_secondary_color, ARB_vertex_program); @@ -397,6 +416,13 @@ extra_NV_read_buffer_api_gl[] = { EXTRA_END }; +static const int extra_core_ARB_color_buffer_float_and_new_buffers[] = { + EXTRA_API_GL_CORE, + EXT(ARB_color_buffer_float), + EXTRA_NEW_BUFFERS, + EXTRA_END +}; + /* This is the big table describing all the enums we accept in * glGet*v(). The table is partitioned into six parts: enums * understood by all GL APIs (OpenGL, GLES and GLES2), enums shared @@ -404,8 +430,7 @@ extra_NV_read_buffer_api_gl[] = { * remaining combinations. To look up the enums valid in a given API * we will use a hash table specific to that API. These tables are in * turn generated at build time and included through get_hash.h. - * The different sections are guarded by #if FEATURE_GL etc to make - * sure we only compile in the enums we may need. */ + */ #include "get_hash.h" @@ -651,7 +676,10 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_enum = ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]; break; case GL_STENCIL_REF: - v->value_int = ctx->Stencil.Ref[ctx->Stencil.ActiveFace]; + v->value_int = _mesa_get_stencil_ref(ctx, ctx->Stencil.ActiveFace); + break; + case GL_STENCIL_BACK_REF: + v->value_int = _mesa_get_stencil_ref(ctx, 1); break; case GL_STENCIL_VALUE_MASK: v->value_int = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]; @@ -883,58 +911,50 @@ static GLboolean check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d) { const GLuint version = ctx->Version; - int total, enabled; + GLboolean api_check = GL_FALSE; + GLboolean api_found = GL_FALSE; const int *e; - total = 0; - enabled = 0; - for (e = d->extra; *e != EXTRA_END; e++) + for (e = d->extra; *e != EXTRA_END; e++) { switch (*e) { case EXTRA_VERSION_30: - if (version >= 30) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (version >= 30) + api_found = GL_TRUE; break; case EXTRA_VERSION_31: - if (version >= 31) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (version >= 31) + api_found = GL_TRUE; break; case EXTRA_VERSION_32: - if (version >= 32) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (version >= 32) + api_found = GL_TRUE; break; case EXTRA_NEW_FRAG_CLAMP: if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP)) _mesa_update_state(ctx); break; case EXTRA_API_ES2: - if (ctx->API == API_OPENGLES2) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (ctx->API == API_OPENGLES2) + api_found = GL_TRUE; break; case EXTRA_API_ES3: - if (_mesa_is_gles3(ctx)) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (_mesa_is_gles3(ctx)) + api_found = GL_TRUE; break; case EXTRA_API_GL: - if (_mesa_is_desktop_gl(ctx)) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (_mesa_is_desktop_gl(ctx)) + api_found = GL_TRUE; break; case EXTRA_API_GL_CORE: - if (ctx->API == API_OPENGL_CORE) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (ctx->API == API_OPENGL_CORE) + api_found = GL_TRUE; break; case EXTRA_NEW_BUFFERS: if (ctx->NewState & _NEW_BUFFERS) @@ -965,21 +985,26 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d } break; case EXTRA_GLSL_130: - if (ctx->Const.GLSLVersion >= 130) { - total++; - enabled++; - } + api_check = GL_TRUE; + if (ctx->Const.GLSLVersion >= 130) + api_found = GL_TRUE; break; + case EXTRA_EXT_UBO_GS4: + api_check = GL_TRUE; + api_found = (ctx->Extensions.ARB_uniform_buffer_object && + ctx->Extensions.ARB_geometry_shader4); + break; case EXTRA_END: break; default: /* *e is a offset into the extension struct */ - total++; + api_check = GL_TRUE; if (*(GLboolean *) ((char *) &ctx->Extensions + *e)) - enabled++; + api_found = GL_TRUE; break; } + } - if (total > 0 && enabled == 0) { + if (api_check && !api_found) { _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func, _mesa_lookup_enum_by_nr(d->pname)); return GL_FALSE; diff --git a/mesalib/src/mesa/main/get.h b/mesalib/src/mesa/main/get.h index 6b0158f37..f58bb9409 100644 --- a/mesalib/src/mesa/main/get.h +++ b/mesalib/src/mesa/main/get.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/get_hash_generator.py b/mesalib/src/mesa/main/get_hash_generator.py index 04bf9ffe6..96bc49587 100644 --- a/mesalib/src/mesa/main/get_hash_generator.py +++ b/mesalib/src/mesa/main/get_hash_generator.py @@ -179,54 +179,34 @@ def generate_hash_tables(enum_list, enabled_apis, param_descriptors): return params, merge_tables(sorted_tables) -def opt_to_apis(feature): - _map = {"ES1": "GLES", "ES2": "GLES2", "GL": "GL"} - if feature not in _map: - return None - - apis = set([_map[feature]]) - if "GL" in apis: - apis.add("GL_CORE") - if "GLES2" in apis: - apis.add("GLES3") - - return apis def show_usage(): sys.stderr.write( """Usage: %s [OPTIONS] -f <file> specify GL API XML file - -a [GL|ES1|ES2] specify APIs to generate hash tables for """ % (program)) exit(1) if __name__ == '__main__': try: - (opts, args) = getopt.getopt(sys.argv[1:], "f:a:") + (opts, args) = getopt.getopt(sys.argv[1:], "f:") except Exception,e: show_usage() if len(args) != 0: show_usage() - enabled_apis = set([]) api_desc_file = "" for opt_name, opt_val in opts: if opt_name == "-f": api_desc_file = opt_val - if opt_name == "-a": - apis = opt_to_apis(opt_val.upper()) - if not apis: - die("invalid API %s\n" % opt_val) - - enabled_apis |= apis if not api_desc_file: die("missing descriptor file (-f)\n") - if len(enabled_apis) == 0: - die("need at least a single enabled API\n") + # generate the code for all APIs + enabled_apis = set(["GLES", "GLES2", "GLES3", "GL", "GL_CORE"]) try: api_desc = gl_XML.parse_GL_API(api_desc_file) diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index 4ef23247b..ef1ab02e1 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -8,7 +8,7 @@ descriptor=[ [ "COLOR_WRITEMASK", "LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA" ], [ "CULL_FACE", "CONTEXT_BOOL(Polygon.CullFlag), NO_EXTRA" ], [ "CULL_FACE_MODE", "CONTEXT_ENUM(Polygon.CullFaceMode), NO_EXTRA" ], - [ "DEPTH_BITS", "BUFFER_INT(Visual.depthBits), NO_EXTRA" ], + [ "DEPTH_BITS", "BUFFER_INT(Visual.depthBits), extra_new_buffers" ], [ "DEPTH_CLEAR_VALUE", "CONTEXT_FIELD(Depth.Clear, TYPE_DOUBLEN), NO_EXTRA" ], [ "DEPTH_FUNC", "CONTEXT_ENUM(Depth.Func), NO_EXTRA" ], [ "DEPTH_RANGE", "CONTEXT_FIELD(Viewport.Near, TYPE_FLOATN_2), NO_EXTRA" ], @@ -31,7 +31,7 @@ descriptor=[ [ "RED_BITS", "BUFFER_INT(Visual.redBits), extra_new_buffers" ], [ "SCISSOR_BOX", "LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA" ], [ "SCISSOR_TEST", "CONTEXT_BOOL(Scissor.Enabled), NO_EXTRA" ], - [ "STENCIL_BITS", "BUFFER_INT(Visual.stencilBits), NO_EXTRA" ], + [ "STENCIL_BITS", "BUFFER_INT(Visual.stencilBits), extra_new_buffers" ], [ "STENCIL_CLEAR_VALUE", "CONTEXT_INT(Stencil.Clear), NO_EXTRA" ], [ "STENCIL_FAIL", "LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA" ], [ "STENCIL_FUNC", "LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA" ], @@ -80,8 +80,8 @@ descriptor=[ [ "SAMPLE_COVERAGE_ARB", "CONTEXT_BOOL(Multisample.SampleCoverage), NO_EXTRA" ], [ "SAMPLE_COVERAGE_VALUE_ARB", "CONTEXT_FLOAT(Multisample.SampleCoverageValue), NO_EXTRA" ], [ "SAMPLE_COVERAGE_INVERT_ARB", "CONTEXT_BOOL(Multisample.SampleCoverageInvert), NO_EXTRA" ], - [ "SAMPLE_BUFFERS_ARB", "BUFFER_INT(Visual.sampleBuffers), NO_EXTRA" ], - [ "SAMPLES_ARB", "BUFFER_INT(Visual.samples), NO_EXTRA" ], + [ "SAMPLE_BUFFERS_ARB", "BUFFER_INT(Visual.sampleBuffers), extra_new_buffers" ], + [ "SAMPLES_ARB", "BUFFER_INT(Visual.samples), extra_new_buffers" ], # GL_SGIS_generate_mipmap [ "GENERATE_MIPMAP_HINT_SGIS", "CONTEXT_ENUM(Hint.GenerateMipmap), NO_EXTRA" ], @@ -273,8 +273,8 @@ descriptor=[ # GL_ARB_fragment_program # == GL_MAX_TEXTURE_IMAGE_UNITS_NV - [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxTextureImageUnits), extra_ARB_fragment_program" ], - [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxVertexTextureImageUnits), extra_ARB_vertex_shader" ], + [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.FragmentProgram.MaxTextureImageUnits), extra_ARB_fragment_program" ], + [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxTextureImageUnits), extra_ARB_vertex_shader" ], [ "MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxCombinedTextureImageUnits), extra_ARB_vertex_shader" ], # GL_ARB_shader_objects @@ -286,7 +286,7 @@ descriptor=[ [ "STENCIL_BACK_FUNC", "CONTEXT_ENUM(Stencil.Function[1]), NO_EXTRA" ], [ "STENCIL_BACK_VALUE_MASK", "CONTEXT_INT(Stencil.ValueMask[1]), NO_EXTRA" ], [ "STENCIL_BACK_WRITEMASK", "CONTEXT_INT(Stencil.WriteMask[1]), NO_EXTRA" ], - [ "STENCIL_BACK_REF", "CONTEXT_INT(Stencil.Ref[1]), NO_EXTRA" ], + [ "STENCIL_BACK_REF", "LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA" ], [ "STENCIL_BACK_FAIL", "CONTEXT_ENUM(Stencil.FailFunc[1]), NO_EXTRA" ], [ "STENCIL_BACK_PASS_DEPTH_FAIL", "CONTEXT_ENUM(Stencil.ZFailFunc[1]), NO_EXTRA" ], [ "STENCIL_BACK_PASS_DEPTH_PASS", "CONTEXT_ENUM(Stencil.ZPassFunc[1]), NO_EXTRA" ], @@ -630,22 +630,22 @@ descriptor=[ [ "TEXTURE_CUBE_MAP_SEAMLESS", "CONTEXT_BOOL(Texture.CubeMapSeamless), extra_ARB_seamless_cube_map" ], # GL_EXT_texture_integer - [ "RGBA_INTEGER_MODE_EXT", "BUFFER_BOOL(_IntegerColor), extra_EXT_texture_integer" ], + [ "RGBA_INTEGER_MODE_EXT", "BUFFER_BOOL(_IntegerColor), extra_EXT_texture_integer_and_new_buffers" ], # GL_ARB_transform_feedback3 [ "MAX_TRANSFORM_FEEDBACK_BUFFERS", "CONTEXT_INT(Const.MaxTransformFeedbackBuffers), extra_ARB_transform_feedback3" ], [ "MAX_VERTEX_STREAMS", "CONTEXT_INT(Const.MaxVertexStreams), extra_ARB_transform_feedback3" ], # GL_ARB_geometry_shader4 - [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxGeometryTextureImageUnits), extra_ARB_geometry_shader4" ], + [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxTextureImageUnits), extra_ARB_geometry_shader4" ], [ "MAX_GEOMETRY_OUTPUT_VERTICES_ARB", "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_ARB_geometry_shader4" ], [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents), extra_ARB_geometry_shader4" ], [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents), extra_ARB_geometry_shader4" ], - [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryVaryingComponents), extra_ARB_geometry_shader4" ], - [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxVertexVaryingComponents), extra_ARB_geometry_shader4" ], + [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxVaryingComponents), extra_ARB_geometry_shader4" ], + [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxVaryingComponents), extra_ARB_geometry_shader4" ], # GL_ARB_color_buffer_float - [ "RGBA_FLOAT_MODE_ARB", "BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), 0" ], + [ "RGBA_FLOAT_MODE_ARB", "BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), extra_core_ARB_color_buffer_float_and_new_buffers" ], # GL_EXT_gpu_shader4 / GLSL 1.30 [ "MIN_PROGRAM_TEXEL_OFFSET", "CONTEXT_INT(Const.MinProgramTexelOffset), extra_GLSL_130" ], @@ -676,7 +676,7 @@ descriptor=[ # GL3.0 / GL_EXT_framebuffer_sRGB [ "FRAMEBUFFER_SRGB_EXT", "CONTEXT_BOOL(Color.sRGBEnabled), extra_EXT_framebuffer_sRGB" ], - [ "FRAMEBUFFER_SRGB_CAPABLE_EXT", "BUFFER_INT(Visual.sRGBCapable), extra_EXT_framebuffer_sRGB" ], + [ "FRAMEBUFFER_SRGB_CAPABLE_EXT", "BUFFER_INT(Visual.sRGBCapable), extra_EXT_framebuffer_sRGB_and_new_buffers" ], # GL 3.1 # NOTE: different enum values for GL_PRIMITIVE_RESTART_NV diff --git a/mesalib/src/mesa/main/getstring.c b/mesalib/src/mesa/main/getstring.c index 5280b4dd3..52985f148 100644 --- a/mesalib/src/mesa/main/getstring.c +++ b/mesalib/src/mesa/main/getstring.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "get.h" #include "enums.h" #include "extensions.h" -#include "mfeatures.h" #include "mtypes.h" diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index c1e16587a..dfee6f196 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/glformats.h b/mesalib/src/mesa/main/glformats.h index cdd2b9427..af1089931 100644 --- a/mesalib/src/mesa/main/glformats.h +++ b/mesalib/src/mesa/main/glformats.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef GLFORMATS_H diff --git a/mesalib/src/mesa/main/glheader.h b/mesalib/src/mesa/main/glheader.h index e93ca30e7..fd6985118 100644 --- a/mesalib/src/mesa/main/glheader.h +++ b/mesalib/src/mesa/main/glheader.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/hash.c b/mesalib/src/mesa/main/hash.c index 8c763e20a..e38158c75 100644 --- a/mesalib/src/mesa/main/hash.c +++ b/mesalib/src/mesa/main/hash.c @@ -29,9 +29,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "glheader.h" @@ -114,9 +115,9 @@ _mesa_NewHashTable(void) { struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable); - table->ht = _mesa_hash_table_create(NULL, uint_key_compare); - _mesa_hash_table_set_deleted_key(table->ht, uint_key(DELETED_KEY_VALUE)); if (table) { + table->ht = _mesa_hash_table_create(NULL, uint_key_compare); + _mesa_hash_table_set_deleted_key(table->ht, uint_key(DELETED_KEY_VALUE)); _glthread_INIT_MUTEX(table->Mutex); _glthread_INIT_MUTEX(table->WalkMutex); } diff --git a/mesalib/src/mesa/main/hash.h b/mesalib/src/mesa/main/hash.h index cdaa7669a..a3171df6b 100644 --- a/mesalib/src/mesa/main/hash.h +++ b/mesalib/src/mesa/main/hash.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/hint.c b/mesalib/src/mesa/main/hint.c index c2560192a..ed0394bc8 100644 --- a/mesalib/src/mesa/main/hint.c +++ b/mesalib/src/mesa/main/hint.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/hint.h b/mesalib/src/mesa/main/hint.h index ca9659d58..f702fbf51 100644 --- a/mesalib/src/mesa/main/hint.h +++ b/mesalib/src/mesa/main/hint.h @@ -27,9 +27,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -37,7 +38,6 @@ #define HINT_H #include "glheader.h" -#include "mfeatures.h" struct gl_context; diff --git a/mesalib/src/mesa/main/histogram.c b/mesalib/src/mesa/main/histogram.c index fe454bcfb..88440ad71 100644 --- a/mesalib/src/mesa/main/histogram.c +++ b/mesalib/src/mesa/main/histogram.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -28,7 +29,6 @@ #include "colormac.h" #include "histogram.h" #include "macros.h" -#include "mfeatures.h" #include "main/dispatch.h" diff --git a/mesalib/src/mesa/main/histogram.h b/mesalib/src/mesa/main/histogram.h index 06781e732..a1ec5185b 100644 --- a/mesalib/src/mesa/main/histogram.h +++ b/mesalib/src/mesa/main/histogram.h @@ -27,9 +27,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -37,7 +38,6 @@ #define HISTOGRAM_H #include "compiler.h" -#include "mfeatures.h" struct _glapi_table; diff --git a/mesalib/src/mesa/main/image.c b/mesalib/src/mesa/main/image.c index 52804bd8b..42fec10e1 100644 --- a/mesalib/src/mesa/main/image.c +++ b/mesalib/src/mesa/main/image.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -36,7 +37,6 @@ #include "image.h" #include "imports.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" diff --git a/mesalib/src/mesa/main/image.h b/mesalib/src/mesa/main/image.h index 7e92790b7..5515be630 100644 --- a/mesalib/src/mesa/main/image.h +++ b/mesalib/src/mesa/main/image.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c index e6f754254..ba30d8e84 100644 --- a/mesalib/src/mesa/main/imports.c +++ b/mesalib/src/mesa/main/imports.c @@ -37,9 +37,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h index c4110ef10..1678f71b2 100644 --- a/mesalib/src/mesa/main/imports.h +++ b/mesalib/src/mesa/main/imports.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/light.c b/mesalib/src/mesa/main/light.c index c694bebe6..a3a576efd 100644 --- a/mesalib/src/mesa/main/light.c +++ b/mesalib/src/mesa/main/light.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -474,10 +475,6 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params ) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); ctx->Light.Model.TwoSide = newbool; - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) - ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - else - ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; break; case GL_LIGHT_MODEL_COLOR_CONTROL: if (ctx->API != API_OPENGL_COMPAT) diff --git a/mesalib/src/mesa/main/light.h b/mesalib/src/mesa/main/light.h index e25dbf226..2247a7494 100644 --- a/mesalib/src/mesa/main/light.h +++ b/mesalib/src/mesa/main/light.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "glheader.h" -#include "mfeatures.h" struct gl_context; struct gl_light; diff --git a/mesalib/src/mesa/main/lines.c b/mesalib/src/mesa/main/lines.c index a01219c42..30eb21880 100644 --- a/mesalib/src/mesa/main/lines.c +++ b/mesalib/src/mesa/main/lines.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/lines.h b/mesalib/src/mesa/main/lines.h index 8e8b3f8d6..a6a610e71 100644 --- a/mesalib/src/mesa/main/lines.h +++ b/mesalib/src/mesa/main/lines.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h index f6d38fb64..ac2467209 100644 --- a/mesalib/src/mesa/main/macros.h +++ b/mesalib/src/mesa/main/macros.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -656,6 +657,12 @@ INTERP_4F(GLfloat t, GLfloat dst[4], const GLfloat out[4], const GLfloat in[4]) #define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C)) #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C)) +static inline unsigned +minify(unsigned value, unsigned levels) +{ + return MAX2(1, value >> levels); +} + /** * Align a value up to an alignment value * diff --git a/mesalib/src/mesa/main/matrix.c b/mesalib/src/mesa/main/matrix.c index f2fd56787..0ba7e9357 100644 --- a/mesalib/src/mesa/main/matrix.c +++ b/mesalib/src/mesa/main/matrix.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -40,7 +41,6 @@ #include "context.h" #include "enums.h" #include "macros.h" -#include "mfeatures.h" #include "matrix.h" #include "mtypes.h" #include "math/m_matrix.h" diff --git a/mesalib/src/mesa/main/matrix.h b/mesalib/src/mesa/main/matrix.h index 185a5c04b..74e7d6183 100644 --- a/mesalib/src/mesa/main/matrix.h +++ b/mesalib/src/mesa/main/matrix.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h deleted file mode 100644 index 55e9cf9c4..000000000 --- a/mesalib/src/mesa/main/mfeatures.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -/** - * \file mfeatures.h - * Flags to enable/disable specific parts of the API. - */ - -#ifndef FEATURES_H -#define FEATURES_H - -#ifndef FEATURE_ES1 -#define FEATURE_ES1 0 -#endif -#ifndef FEATURE_ES2 -#define FEATURE_ES2 0 -#endif - -#define FEATURE_ES (FEATURE_ES1 || FEATURE_ES2) - -#ifndef FEATURE_GL -#define FEATURE_GL !FEATURE_ES -#endif - -#if defined(IN_DRI_DRIVER) || (FEATURE_GL + FEATURE_ES1 + FEATURE_ES2 > 1) -#define FEATURE_remap_table 1 -#else -#define FEATURE_remap_table 0 -#endif - -#endif /* FEATURES_H */ diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c index a2f3767a3..e9741f3e0 100644 --- a/mesalib/src/mesa/main/mipmap.c +++ b/mesalib/src/mesa/main/mipmap.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/mipmap.h b/mesalib/src/mesa/main/mipmap.h index 072794cb6..6e26d5ba0 100644 --- a/mesalib/src/mesa/main/mipmap.h +++ b/mesalib/src/mesa/main/mipmap.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 008f68bda..186f8a03b 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -36,7 +37,6 @@ #include "main/glheader.h" #include "main/config.h" -#include "main/mfeatures.h" #include "glapi/glapi.h" #include "math/m_matrix.h" /* GLmatrix */ #include "main/simple_list.h" /* struct simple_node */ @@ -85,9 +85,9 @@ struct set_entry; /** Extra draw modes beyond GL_POINTS, GL_TRIANGLE_FAN, etc */ -#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1) -#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2) -#define PRIM_UNKNOWN (GL_POLYGON+3) +#define PRIM_MAX GL_TRIANGLE_STRIP_ADJACENCY +#define PRIM_OUTSIDE_BEGIN_END (PRIM_MAX + 1) +#define PRIM_UNKNOWN (PRIM_MAX + 2) @@ -231,7 +231,7 @@ typedef enum VARYING_SLOT_CLIP_DIST0, VARYING_SLOT_CLIP_DIST1, VARYING_SLOT_PRIMITIVE_ID, /* Does not appear in VS */ - VARYING_SLOT_LAYER, /* Appears only as GS output */ + VARYING_SLOT_LAYER, /* Appears as VS or GS output */ VARYING_SLOT_FACE, /* FS only */ VARYING_SLOT_PNTC, /* FS only */ VARYING_SLOT_VAR0, /* First generic varying slot */ @@ -1502,9 +1502,6 @@ struct gl_array_object /** Mask of VERT_BIT_* values indicating which arrays are enabled */ GLbitfield64 _Enabled; - /** Mask of VERT_BIT_* values indicating changed/dirty arrays */ - GLbitfield64 NewArrays; - /** * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs * we can determine the max legal (in bounds) glDrawElements array index. @@ -1537,15 +1534,13 @@ struct gl_array_attrib * \name Primitive restart controls * * Primitive restart is enabled if either \c PrimitiveRestart or - * \c PrimitiveRestart is set. If \c PrimitiveRestart is set, then - * \c RestartIndex is used as the cut vertex. Otherwise ~0 is used. + * \c PrimitiveRestartFixedIndex is set. */ /*@{*/ GLboolean PrimitiveRestart; GLboolean PrimitiveRestartFixedIndex; GLboolean _PrimitiveRestart; GLuint RestartIndex; - GLuint _RestartIndex; /*@}*/ /* GL_ARB_vertex_buffer_object */ @@ -1829,7 +1824,8 @@ enum glsl_interp_qualifier INTERP_QUALIFIER_NONE = 0, INTERP_QUALIFIER_SMOOTH, INTERP_QUALIFIER_FLAT, - INTERP_QUALIFIER_NOPERSPECTIVE + INTERP_QUALIFIER_NOPERSPECTIVE, + INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */ }; @@ -2134,6 +2130,17 @@ struct gl_shader /*@}*/ /** + * Map from sampler unit to texture unit (set by glUniform1i()) + * + * A sampler unit is associated with each sampler uniform by the linker. + * The sampler unit associated with each uniform is stored in the + * \c gl_uniform_storage::sampler field. + */ + GLubyte SamplerUnits[MAX_SAMPLERS]; + /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ + gl_texture_index SamplerTargets[MAX_SAMPLERS]; + + /** * Number of uniform components used by this shader. * * This field is only set post-linking. @@ -2337,17 +2344,6 @@ struct gl_shader_program */ struct string_to_uint_map *UniformHash; - /** - * Map from sampler unit to texture unit (set by glUniform1i()) - * - * A sampler unit is associated with each sampler uniform by the linker. - * The sampler unit associated with each uniform is stored in the - * \c gl_uniform_storage::sampler field. - */ - GLubyte SamplerUnits[MAX_SAMPLERS]; - /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ - gl_texture_index SamplerTargets[MAX_SAMPLERS]; - GLboolean LinkStatus; /**< GL_LINK_STATUS */ GLboolean Validated; GLboolean _Used; /**< Ever used for drawing? */ @@ -2435,6 +2431,12 @@ struct gl_shader_compiler_options GLuint MaxIfDepth; /**< Maximum nested IF blocks */ GLuint MaxUnrollIterations; + /** + * Prefer DP4 instructions (rather than MUL/MAD) for matrix * vector + * operations, such as position transformation. + */ + GLboolean PreferDP4; + struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ }; @@ -2565,13 +2567,31 @@ struct gl_renderbuffer GLuint Name; GLint RefCount; GLuint Width, Height; + GLuint Depth; GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ GLboolean AttachedAnytime; /**< TRUE if it was attached to a framebuffer */ + /** + * True for renderbuffers that wrap textures, giving the driver a chance to + * flush render caches through the FinishRenderTexture hook. + * + * Drivers may also set this on renderbuffers other than those generated by + * glFramebufferTexture(), though it means FinishRenderTexture() would be + * called without a rb->TexImage. + */ + GLboolean NeedsFinishRenderTexture; GLubyte NumSamples; GLenum InternalFormat; /**< The user-specified format */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or GL_STENCIL_INDEX. */ gl_format Format; /**< The actual renderbuffer memory format */ + /** + * Pointer to the texture image if this renderbuffer wraps a texture, + * otherwise NULL. + * + * Note that the reference on the gl_texture_object containing this + * TexImage is held by the gl_renderbuffer_attachment. + */ + struct gl_texture_image *TexImage; /** Delete this renderbuffer */ void (*Delete)(struct gl_context *ctx, struct gl_renderbuffer *rb); @@ -2608,6 +2628,7 @@ struct gl_renderbuffer_attachment GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */ GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D * and 2D array textures */ + GLboolean Layered; }; @@ -2680,6 +2701,8 @@ struct gl_framebuffer struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS]; struct gl_renderbuffer *_ColorReadBuffer; + GLboolean Layered; + /** Delete this framebuffer */ void (*Delete)(struct gl_framebuffer *fb); }; @@ -2730,6 +2753,7 @@ struct gl_program_constants /* GL_ARB_uniform_buffer_object */ GLuint MaxUniformBlocks; GLuint MaxCombinedUniformComponents; + GLuint MaxTextureImageUnits; }; @@ -2746,11 +2770,8 @@ struct gl_constants GLuint MaxArrayTextureLayers; /**< Max layers in array textures */ GLuint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */ GLuint MaxTextureCoordUnits; - GLuint MaxTextureImageUnits; - GLuint MaxVertexTextureImageUnits; GLuint MaxCombinedTextureImageUnits; - GLuint MaxGeometryTextureImageUnits; - GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ + GLuint MaxTextureUnits; /**< = MIN(CoordUnits, FragmentProgram.ImageUnits) */ GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ GLuint MaxTextureBufferSize; /**< GL_ARB_texture_buffer_object */ @@ -2768,8 +2789,6 @@ struct gl_constants GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */ GLfloat LineWidthGranularity; - GLuint MaxColorTableSize; - GLuint MaxClipPlanes; GLuint MaxLights; GLfloat MaxShininess; /**< GL_NV_light_max_exponent */ @@ -2800,10 +2819,9 @@ struct gl_constants GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ - /** Number of varying vectors between vertex and fragment shaders */ + /** Number of varying vectors between any two shader stages. */ GLuint MaxVarying; - GLuint MaxVertexVaryingComponents; /**< Between vert and geom shader */ - GLuint MaxGeometryVaryingComponents; /**< Between geom and frag shader */ + GLuint MaxVaryingComponents; /** @{ * GL_ARB_uniform_buffer_object @@ -2965,6 +2983,7 @@ struct gl_extensions GLboolean ARB_framebuffer_object; GLboolean ARB_explicit_attrib_location; GLboolean ARB_geometry_shader4; + GLboolean ARB_gpu_shader5; GLboolean ARB_half_float_pixel; GLboolean ARB_half_float_vertex; GLboolean ARB_instanced_arrays; @@ -3019,6 +3038,7 @@ struct gl_extensions GLboolean EXT_fog_coord; GLboolean EXT_framebuffer_blit; GLboolean EXT_framebuffer_multisample; + GLboolean EXT_framebuffer_multisample_blit_scaled; GLboolean EXT_framebuffer_object; GLboolean EXT_framebuffer_sRGB; GLboolean EXT_gpu_program_parameters; @@ -3051,6 +3071,7 @@ struct gl_extensions GLboolean OES_standard_derivatives; /* vendor extensions */ GLboolean AMD_seamless_cubemap_per_texture; + GLboolean AMD_vertex_shader_layer; GLboolean APPLE_object_purgeable; GLboolean ATI_envmap_bumpmap; GLboolean ATI_texture_compression_3dc; @@ -3137,7 +3158,7 @@ struct gl_matrix_stack #define _NEW_TEXTURE (1 << 16) /**< gl_context::Texture */ #define _NEW_TRANSFORM (1 << 17) /**< gl_context::Transform */ #define _NEW_VIEWPORT (1 << 18) /**< gl_context::Viewport */ -#define _NEW_PACKUNPACK (1 << 19) /**< gl_context::Pack, Unpack */ +/* gap, re-use for core Mesa state only; use ctx->DriverFlags otherwise */ #define _NEW_ARRAY (1 << 20) /**< gl_context::Array */ #define _NEW_RENDERMODE (1 << 21) /**< gl_context::RenderMode, etc */ #define _NEW_BUFFERS (1 << 22) /**< gl_context::Visual, DrawBuffer, */ @@ -3148,34 +3169,9 @@ struct gl_matrix_stack #define _NEW_PROGRAM_CONSTANTS (1 << 27) #define _NEW_BUFFER_OBJECT (1 << 28) #define _NEW_FRAG_CLAMP (1 << 29) -#define _NEW_TRANSFORM_FEEDBACK (1 << 30) /**< gl_context::TransformFeedback */ +/* gap, re-use for core Mesa state only; use ctx->DriverFlags otherwise */ #define _NEW_VARYING_VP_INPUTS (1 << 31) /**< gl_context::varying_vp_inputs */ #define _NEW_ALL ~0 - -/** - * We use _NEW_TRANSFORM for GL_RASTERIZER_DISCARD. This #define is for - * clarity. - */ -#define _NEW_RASTERIZER_DISCARD _NEW_TRANSFORM -/*@}*/ - - -/** - * \name A bunch of flags that we think might be useful to drivers. - * - * Set in the __struct gl_contextRec::_TriangleCaps bitfield. - */ -/*@{*/ -#define DD_SEPARATE_SPECULAR (1 << 0) -#define DD_TRI_LIGHT_TWOSIDE (1 << 1) -#define DD_TRI_UNFILLED (1 << 2) -#define DD_TRI_SMOOTH (1 << 3) -#define DD_TRI_STIPPLE (1 << 4) -#define DD_TRI_OFFSET (1 << 5) -#define DD_LINE_SMOOTH (1 << 6) -#define DD_LINE_STIPPLE (1 << 7) -#define DD_POINT_SMOOTH (1 << 8) -#define DD_POINT_ATTEN (1 << 9) /*@}*/ @@ -3352,7 +3348,20 @@ typedef enum */ struct gl_driver_flags { - GLbitfield NewArray; /**< Vertex array state */ + /** gl_context::Array::_DrawArrays (vertex array state) */ + GLbitfield NewArray; + + /** gl_context::TransformFeedback::CurrentObject */ + GLbitfield NewTransformFeedback; + + /** gl_context::RasterDiscard */ + GLbitfield NewRasterizerDiscard; + + /** + * gl_context::UniformBufferBindings + * gl_shader_program::UniformBlocks + */ + GLbitfield NewUniformBuffer; }; struct gl_uniform_buffer_binding @@ -3534,7 +3543,8 @@ struct gl_context * associated with uniform blocks by glUniformBlockBinding()'s state in the * shader program. */ - struct gl_uniform_buffer_binding *UniformBufferBindings; + struct gl_uniform_buffer_binding + UniformBufferBindings[MAX_COMBINED_UNIFORM_BUFFERS]; /*@}*/ @@ -3568,11 +3578,6 @@ struct gl_context GLbitfield64 varying_vp_inputs; /**< mask of VERT_BIT_* flags */ /** \name Derived state */ - /*@{*/ - /** Bitwise-or of DD_* flags. Note that this bitfield may be used before - * state validation so they need to always be current. - */ - GLbitfield _TriangleCaps; GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ GLfloat _EyeZDir[3]; GLfloat _ModelViewInvScale; @@ -3593,12 +3598,6 @@ struct gl_context GLboolean TextureFormatSupported[MESA_FORMAT_COUNT]; - /** - * Use dp4 (rather than mul/mad) instructions for position - * transformation? - */ - GLboolean mvp_with_dp4; - GLboolean RasterDiscard; /**< GL_RASTERIZER_DISCARD */ /** diff --git a/mesalib/src/mesa/main/multisample.c b/mesalib/src/mesa/main/multisample.c index b0f45d933..02d6ca453 100644 --- a/mesalib/src/mesa/main/multisample.c +++ b/mesalib/src/mesa/main/multisample.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -30,6 +31,7 @@ #include "main/mtypes.h" #include "main/fbobject.h" #include "main/glformats.h" +#include "main/state.h" /** @@ -73,6 +75,10 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) { GET_CURRENT_CONTEXT(ctx); + if (ctx->NewState & _NEW_BUFFERS) { + _mesa_update_state(ctx); + } + switch (pname) { case GL_SAMPLE_POSITION: { if (index >= ctx->DrawBuffer->Visual.samples) { diff --git a/mesalib/src/mesa/main/multisample.h b/mesalib/src/mesa/main/multisample.h index f2f01de5c..d6995d8fb 100644 --- a/mesalib/src/mesa/main/multisample.h +++ b/mesalib/src/mesa/main/multisample.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/pack.h b/mesalib/src/mesa/main/pack.h index 2fbdf9115..ad357bae1 100644 --- a/mesalib/src/mesa/main/pack.h +++ b/mesalib/src/mesa/main/pack.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/pbo.c b/mesalib/src/mesa/main/pbo.c index 0dc4c04eb..400cec3f0 100644 --- a/mesalib/src/mesa/main/pbo.c +++ b/mesalib/src/mesa/main/pbo.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/pbo.h b/mesalib/src/mesa/main/pbo.h index 9eba33514..9851ef1a1 100644 --- a/mesalib/src/mesa/main/pbo.h +++ b/mesalib/src/mesa/main/pbo.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/pixel.c b/mesalib/src/mesa/main/pixel.c index e9f75a7df..0552de666 100644 --- a/mesalib/src/mesa/main/pixel.c +++ b/mesalib/src/mesa/main/pixel.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -33,7 +34,6 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mfeatures.h" #include "pixel.h" #include "pbo.h" #include "mtypes.h" diff --git a/mesalib/src/mesa/main/pixel.h b/mesalib/src/mesa/main/pixel.h index 433208cb6..88fc0cf99 100644 --- a/mesalib/src/mesa/main/pixel.h +++ b/mesalib/src/mesa/main/pixel.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -35,7 +36,6 @@ #include "compiler.h" #include "glheader.h" -#include "mfeatures.h" struct _glapi_table; struct gl_context; diff --git a/mesalib/src/mesa/main/pixelstore.c b/mesalib/src/mesa/main/pixelstore.c index 01068e8ea..cf871dc5c 100644 --- a/mesalib/src/mesa/main/pixelstore.c +++ b/mesalib/src/mesa/main/pixelstore.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -32,7 +33,6 @@ #include "bufferobj.h" #include "context.h" #include "pixelstore.h" -#include "mfeatures.h" #include "mtypes.h" @@ -48,7 +48,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) goto invalid_enum_error; if (param == (GLint)ctx->Pack.SwapBytes) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE; break; case GL_PACK_LSB_FIRST: @@ -56,7 +55,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) goto invalid_enum_error; if (param == (GLint)ctx->Pack.LsbFirst) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE; break; case GL_PACK_ROW_LENGTH: @@ -68,7 +66,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Pack.RowLength == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.RowLength = param; break; case GL_PACK_IMAGE_HEIGHT: @@ -80,7 +77,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Pack.ImageHeight == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.ImageHeight = param; break; case GL_PACK_SKIP_PIXELS: @@ -92,7 +88,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Pack.SkipPixels == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.SkipPixels = param; break; case GL_PACK_SKIP_ROWS: @@ -104,7 +99,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Pack.SkipRows == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.SkipRows = param; break; case GL_PACK_SKIP_IMAGES: @@ -116,7 +110,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Pack.SkipImages == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.SkipImages = param; break; case GL_PACK_ALIGNMENT: @@ -126,7 +119,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Pack.Alignment == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.Alignment = param; break; case GL_PACK_INVERT_MESA: @@ -138,7 +130,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Pack.Invert == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.Invert = param; break; @@ -149,7 +140,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) return; if ((GLint)ctx->Unpack.SwapBytes == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE; break; case GL_UNPACK_LSB_FIRST: @@ -159,7 +149,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) return; if ((GLint)ctx->Unpack.LsbFirst == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE; break; case GL_UNPACK_ROW_LENGTH: @@ -171,7 +160,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Unpack.RowLength == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.RowLength = param; break; case GL_UNPACK_IMAGE_HEIGHT: @@ -184,7 +172,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) if (ctx->Unpack.ImageHeight == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.ImageHeight = param; break; case GL_UNPACK_SKIP_PIXELS: @@ -196,7 +183,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Unpack.SkipPixels == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.SkipPixels = param; break; case GL_UNPACK_SKIP_ROWS: @@ -208,7 +194,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Unpack.SkipRows == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.SkipRows = param; break; case GL_UNPACK_SKIP_IMAGES: @@ -220,7 +205,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Unpack.SkipImages == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.SkipImages = param; break; case GL_UNPACK_ALIGNMENT: @@ -230,7 +214,6 @@ _mesa_PixelStorei( GLenum pname, GLint param ) } if (ctx->Unpack.Alignment == param) return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Unpack.Alignment = param; break; default: diff --git a/mesalib/src/mesa/main/pixelstore.h b/mesalib/src/mesa/main/pixelstore.h index eb5081974..1ffc8f8b8 100644 --- a/mesalib/src/mesa/main/pixelstore.h +++ b/mesalib/src/mesa/main/pixelstore.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/main/pixeltransfer.c b/mesalib/src/mesa/main/pixeltransfer.c index fa355eb4a..8bbeeb853 100644 --- a/mesalib/src/mesa/main/pixeltransfer.c +++ b/mesalib/src/mesa/main/pixeltransfer.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/pixeltransfer.h b/mesalib/src/mesa/main/pixeltransfer.h index 3cd7ebe77..b0a301f26 100644 --- a/mesalib/src/mesa/main/pixeltransfer.h +++ b/mesalib/src/mesa/main/pixeltransfer.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/points.c b/mesalib/src/mesa/main/points.c index c925d4cfd..71b1a4166 100644 --- a/mesalib/src/mesa/main/points.c +++ b/mesalib/src/mesa/main/points.c @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -122,11 +123,6 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 || ctx->Point.Params[1] != 0.0 || ctx->Point.Params[2] != 0.0); - - if (ctx->Point._Attenuated) - ctx->_TriangleCaps |= DD_POINT_ATTEN; - else - ctx->_TriangleCaps &= ~DD_POINT_ATTEN; break; case GL_POINT_SIZE_MIN_EXT: if (params[0] < 0.0F) { diff --git a/mesalib/src/mesa/main/points.h b/mesalib/src/mesa/main/points.h index 306a8a572..797f83158 100644 --- a/mesalib/src/mesa/main/points.h +++ b/mesalib/src/mesa/main/points.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/polygon.c b/mesalib/src/mesa/main/polygon.c index cdef01a2f..0ded7434c 100644 --- a/mesalib/src/mesa/main/polygon.c +++ b/mesalib/src/mesa/main/polygon.c @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -172,11 +173,6 @@ _mesa_PolygonMode( GLenum face, GLenum mode ) return; } - if (ctx->Polygon.FrontMode == GL_FILL && ctx->Polygon.BackMode == GL_FILL) - ctx->_TriangleCaps &= ~DD_TRI_UNFILLED; - else - ctx->_TriangleCaps |= DD_TRI_UNFILLED; - if (ctx->Driver.PolygonMode) ctx->Driver.PolygonMode(ctx, face, mode); } diff --git a/mesalib/src/mesa/main/polygon.h b/mesalib/src/mesa/main/polygon.h index 35f222f26..651c3356c 100644 --- a/mesalib/src/mesa/main/polygon.h +++ b/mesalib/src/mesa/main/polygon.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/querymatrix.h b/mesalib/src/mesa/main/querymatrix.h index 187b5f486..e08d843a9 100644 --- a/mesalib/src/mesa/main/querymatrix.h +++ b/mesalib/src/mesa/main/querymatrix.h @@ -25,7 +25,6 @@ #define QUERYMATRIX_H -#include "mfeatures.h" #include "mtypes.h" diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index f0db740fd..0d6fe39d4 100644 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "hash.h" #include "imports.h" #include "queryobj.h" -#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" @@ -76,7 +76,7 @@ _mesa_new_query_object(struct gl_context *ctx, GLuint id) static void _mesa_begin_query(struct gl_context *ctx, struct gl_query_object *q) { - /* no-op */ + ctx->NewState |= _NEW_DEPTH; /* for swrast */ } @@ -87,6 +87,7 @@ _mesa_begin_query(struct gl_context *ctx, struct gl_query_object *q) static void _mesa_end_query(struct gl_context *ctx, struct gl_query_object *q) { + ctx->NewState |= _NEW_DEPTH; /* for swrast */ q->Ready = GL_TRUE; } @@ -315,7 +316,7 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id) if (!query_error_check_index(ctx, target, index)) return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); + FLUSH_VERTICES(ctx, 0); bindpt = get_query_binding_point(ctx, target); if (!bindpt) { @@ -392,7 +393,7 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index) if (!query_error_check_index(ctx, target, index)) return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); + FLUSH_VERTICES(ctx, 0); bindpt = get_query_binding_point(ctx, target); if (!bindpt) { diff --git a/mesalib/src/mesa/main/queryobj.h b/mesalib/src/mesa/main/queryobj.h index 0616c943e..5b9ff5820 100644 --- a/mesalib/src/mesa/main/queryobj.h +++ b/mesalib/src/mesa/main/queryobj.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -27,7 +28,6 @@ #define QUERYOBJ_H -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/hash.h" diff --git a/mesalib/src/mesa/main/rastpos.c b/mesalib/src/mesa/main/rastpos.c index 5a030be44..e578c6cc8 100644 --- a/mesalib/src/mesa/main/rastpos.c +++ b/mesalib/src/mesa/main/rastpos.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -32,7 +33,6 @@ #include "context.h" #include "feedback.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "rastpos.h" #include "state.h" diff --git a/mesalib/src/mesa/main/rastpos.h b/mesalib/src/mesa/main/rastpos.h index bbd32abd3..45968f304 100644 --- a/mesalib/src/mesa/main/rastpos.h +++ b/mesalib/src/mesa/main/rastpos.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -33,7 +34,6 @@ #include "compiler.h" -#include "mfeatures.h" struct _glapi_table; struct gl_context; diff --git a/mesalib/src/mesa/main/readpix.c b/mesalib/src/mesa/main/readpix.c index 0dee38063..85952d671 100644 --- a/mesalib/src/mesa/main/readpix.c +++ b/mesalib/src/mesa/main/readpix.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "glheader.h" diff --git a/mesalib/src/mesa/main/readpix.h b/mesalib/src/mesa/main/readpix.h index 7491c22ff..9e2d58ae9 100644 --- a/mesalib/src/mesa/main/readpix.h +++ b/mesalib/src/mesa/main/readpix.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/remap.c b/mesalib/src/mesa/main/remap.c index a09870561..44ec96498 100644 --- a/mesalib/src/mesa/main/remap.c +++ b/mesalib/src/mesa/main/remap.c @@ -36,10 +36,6 @@ * a dynamic entry, or the corresponding static entry, in glapi. */ -#include "mfeatures.h" - -#if FEATURE_remap_table - #include "remap.h" #include "imports.h" #include "glapi/glapi.h" @@ -223,6 +219,3 @@ _mesa_init_remap_table(void) driDispatchRemapTable_size, MESA_remap_table_functions); } - - -#endif /* FEATURE_remap_table */ diff --git a/mesalib/src/mesa/main/remap.h b/mesalib/src/mesa/main/remap.h index fa3172487..bfef6ac4e 100644 --- a/mesalib/src/mesa/main/remap.h +++ b/mesalib/src/mesa/main/remap.h @@ -29,7 +29,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct gl_function_pool_remap { int pool_index; @@ -42,8 +41,6 @@ struct gl_function_remap { }; -#if FEATURE_remap_table - extern int driDispatchRemapTable[]; @@ -62,37 +59,5 @@ _mesa_map_static_functions(void); extern void _mesa_init_remap_table(void); -#else /* FEATURE_remap_table */ - -static inline const char * -_mesa_get_function_spec(int func_index) -{ - return NULL; -} - -static inline int -_mesa_map_function_spec(const char *spec) -{ - return -1; -} - -static inline void -_mesa_map_function_array(const struct gl_function_remap *func_array) -{ -} - -static inline void -_mesa_map_static_functions(void) -{ -} - - -static inline void -_mesa_init_remap_table(void) -{ -} - -#endif /* FEATURE_remap_table */ - #endif /* REMAP_H */ diff --git a/mesalib/src/mesa/main/renderbuffer.c b/mesalib/src/mesa/main/renderbuffer.c index b42616226..c82b5cd85 100644 --- a/mesalib/src/mesa/main/renderbuffer.c +++ b/mesalib/src/mesa/main/renderbuffer.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -52,6 +53,7 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) rb->Width = 0; rb->Height = 0; + rb->Depth = 0; rb->InternalFormat = GL_RGBA; rb->Format = MESA_FORMAT_NONE; } diff --git a/mesalib/src/mesa/main/renderbuffer.h b/mesalib/src/mesa/main/renderbuffer.h index c450b33cb..e3e56d29e 100644 --- a/mesalib/src/mesa/main/renderbuffer.h +++ b/mesalib/src/mesa/main/renderbuffer.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/samplerobj.c b/mesalib/src/mesa/main/samplerobj.c index 5cff32936..91b17ab5e 100644 --- a/mesalib/src/mesa/main/samplerobj.c +++ b/mesalib/src/mesa/main/samplerobj.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -35,7 +36,6 @@ #include "main/enums.h" #include "main/hash.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/samplerobj.h" diff --git a/mesalib/src/mesa/main/samplerobj.h b/mesalib/src/mesa/main/samplerobj.h index 69e389949..c72b1cd8d 100644 --- a/mesalib/src/mesa/main/samplerobj.h +++ b/mesalib/src/mesa/main/samplerobj.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/scissor.c b/mesalib/src/mesa/main/scissor.c index 0c2a91f5c..538ed595e 100644 --- a/mesalib/src/mesa/main/scissor.c +++ b/mesalib/src/mesa/main/scissor.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/scissor.h b/mesalib/src/mesa/main/scissor.h index da9385e2b..2ac0c88da 100644 --- a/mesalib/src/mesa/main/scissor.h +++ b/mesalib/src/mesa/main/scissor.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 2c307e79c..8cb02760b 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -41,7 +42,6 @@ #include "main/dispatch.h" #include "main/enums.h" #include "main/hash.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/shaderapi.h" #include "main/shaderobj.h" @@ -1453,8 +1453,10 @@ _mesa_ValidateProgram(GLhandleARB program) validate_program(ctx, program); } -#ifdef FEATURE_ES2 +/** + * For OpenGL ES 2.0, GL_ARB_ES2_compatibility + */ void GLAPIENTRY _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) @@ -1507,6 +1509,9 @@ _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, } +/** + * For OpenGL ES 2.0, GL_ARB_ES2_compatibility + */ void GLAPIENTRY _mesa_ReleaseShaderCompiler(void) { @@ -1514,6 +1519,9 @@ _mesa_ReleaseShaderCompiler(void) } +/** + * For OpenGL ES 2.0, GL_ARB_ES2_compatibility + */ void GLAPIENTRY _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length) @@ -1527,7 +1535,6 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); } -#endif /* FEATURE_ES2 */ void GLAPIENTRY _mesa_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, diff --git a/mesalib/src/mesa/main/shaderapi.h b/mesalib/src/mesa/main/shaderapi.h index 342b58905..1cd4ffcea 100644 --- a/mesalib/src/mesa/main/shaderapi.h +++ b/mesalib/src/mesa/main/shaderapi.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/shaderobj.c b/mesalib/src/mesa/main/shaderobj.c index 59daff5bf..a60d8f38a 100644 --- a/mesalib/src/mesa/main/shaderobj.c +++ b/mesalib/src/mesa/main/shaderobj.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -32,7 +33,6 @@ #include "main/glheader.h" #include "main/context.h" #include "main/hash.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/shaderobj.h" #include "main/uniforms.h" diff --git a/mesalib/src/mesa/main/shaderobj.h b/mesalib/src/mesa/main/shaderobj.h index 5470b51d7..a0dac5ec9 100644 --- a/mesalib/src/mesa/main/shaderobj.h +++ b/mesalib/src/mesa/main/shaderobj.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c index 408125998..9f5624def 100644 --- a/mesalib/src/mesa/main/shared.c +++ b/mesalib/src/mesa/main/shared.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -28,7 +29,6 @@ */ #include "imports.h" -#include "mfeatures.h" #include "mtypes.h" #include "hash.h" #include "hash_table.h" diff --git a/mesalib/src/mesa/main/shared.h b/mesalib/src/mesa/main/shared.h index 3fe4578cf..3bec08765 100644 --- a/mesalib/src/mesa/main/shared.h +++ b/mesalib/src/mesa/main/shared.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef SHARED_H diff --git a/mesalib/src/mesa/main/simple_list.h b/mesalib/src/mesa/main/simple_list.h index 9417108a0..0ade52d71 100644 --- a/mesalib/src/mesa/main/simple_list.h +++ b/mesalib/src/mesa/main/simple_list.h @@ -28,9 +28,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c index 251c1aea9..1b927ca65 100644 --- a/mesalib/src/mesa/main/state.c +++ b/mesalib/src/mesa/main/state.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -54,16 +55,6 @@ #include "blend.h" -static void -update_separate_specular(struct gl_context *ctx) -{ - if (_mesa_need_secondary_color(ctx)) - ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; - else - ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR; -} - - /** * Update the following fields: * ctx->VertexProgram._Enabled @@ -324,82 +315,6 @@ update_twoside(struct gl_context *ctx) } -/* - * Check polygon state and set DD_TRI_OFFSET - * in ctx->_TriangleCaps if needed. - */ -static void -update_polygon(struct gl_context *ctx) -{ - ctx->_TriangleCaps &= ~DD_TRI_OFFSET; - - if ( ctx->Polygon.OffsetPoint - || ctx->Polygon.OffsetLine - || ctx->Polygon.OffsetFill) - ctx->_TriangleCaps |= DD_TRI_OFFSET; -} - - -/** - * Update the ctx->_TriangleCaps bitfield. - * XXX that bitfield should really go away someday! - * This function must be called after other update_*() functions since - * there are dependencies on some other derived values. - */ -#if 0 -static void -update_tricaps(struct gl_context *ctx, GLbitfield new_state) -{ - ctx->_TriangleCaps = 0; - - /* - * Points - */ - if (1/*new_state & _NEW_POINT*/) { - if (ctx->Point.SmoothFlag) - ctx->_TriangleCaps |= DD_POINT_SMOOTH; - if (ctx->Point._Attenuated) - ctx->_TriangleCaps |= DD_POINT_ATTEN; - } - - /* - * Lines - */ - if (1/*new_state & _NEW_LINE*/) { - if (ctx->Line.SmoothFlag) - ctx->_TriangleCaps |= DD_LINE_SMOOTH; - if (ctx->Line.StippleFlag) - ctx->_TriangleCaps |= DD_LINE_STIPPLE; - } - - /* - * Polygons - */ - if (1/*new_state & _NEW_POLYGON*/) { - if (ctx->Polygon.SmoothFlag) - ctx->_TriangleCaps |= DD_TRI_SMOOTH; - if (ctx->Polygon.StippleFlag) - ctx->_TriangleCaps |= DD_TRI_STIPPLE; - if (ctx->Polygon.FrontMode != GL_FILL - || ctx->Polygon.BackMode != GL_FILL) - ctx->_TriangleCaps |= DD_TRI_UNFILLED; - if (ctx->Polygon.OffsetPoint || - ctx->Polygon.OffsetLine || - ctx->Polygon.OffsetFill) - ctx->_TriangleCaps |= DD_TRI_OFFSET; - } - - /* - * Lighting and shading - */ - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) - ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - if (_mesa_need_secondary_color(ctx)) - ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; -} -#endif - - /** * Compute derived GL state. * If __struct gl_contextRec::NewState is non-zero then this function \b must @@ -458,9 +373,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT)) _mesa_update_draw_buffer_bounds( ctx ); - if (new_state & _NEW_POLYGON) - update_polygon( ctx ); - if (new_state & _NEW_LIGHT) _mesa_update_lighting( ctx ); @@ -473,21 +385,12 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & _NEW_PIXEL) _mesa_update_pixel( ctx, new_state ); - if (new_state & _MESA_NEW_SEPARATE_SPECULAR) - update_separate_specular( ctx ); - if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT)) update_viewport_matrix(ctx); if (new_state & (_NEW_MULTISAMPLE | _NEW_BUFFERS)) update_multisample( ctx ); -#if 0 - if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT - | _NEW_STENCIL | _MESA_NEW_SEPARATE_SPECULAR)) - update_tricaps( ctx, new_state ); -#endif - /* ctx->_NeedEyeCoords is now up to date. * * If the truth value of this variable has changed, update for the @@ -508,8 +411,10 @@ _mesa_update_state_locked( struct gl_context *ctx ) new_prog_state |= update_program( ctx ); } - if (new_state & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT)) + if (ctx->Const.CheckArrayBounds && + new_state & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT)) { _mesa_update_array_object_max_element(ctx, ctx->Array.ArrayObj); + } out: new_prog_state |= update_program_constants(ctx); @@ -526,7 +431,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) new_state = ctx->NewState | new_prog_state; ctx->NewState = 0; ctx->Driver.UpdateState(ctx, new_state); - ctx->Array.ArrayObj->NewArrays = 0x0; } diff --git a/mesalib/src/mesa/main/state.h b/mesalib/src/mesa/main/state.h index 7b3121b4e..bc2406b4d 100644 --- a/mesalib/src/mesa/main/state.h +++ b/mesalib/src/mesa/main/state.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/stencil.c b/mesalib/src/mesa/main/stencil.c index 330841731..505703a3d 100644 --- a/mesalib/src/mesa/main/stencil.c +++ b/mesalib/src/mesa/main/stencil.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -109,10 +110,6 @@ _mesa_ClearStencil( GLint s ) { GET_CURRENT_CONTEXT(ctx); - if (ctx->Stencil.Clear == (GLuint) s) - return; - - FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.Clear = (GLuint) s; } @@ -135,7 +132,6 @@ void GLAPIENTRY _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) { GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glStencilFuncSeparateATI()\n"); @@ -151,8 +147,6 @@ _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLui return; } - ref = CLAMP( ref, 0, stencilMax ); - /* set both front and back state */ if (ctx->Stencil.Function[0] == frontfunc && ctx->Stencil.Function[1] == backfunc && @@ -192,7 +186,6 @@ void GLAPIENTRY _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) { GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; const GLint face = ctx->Stencil.ActiveFace; if (MESA_VERBOSE & VERBOSE_API) @@ -203,8 +196,6 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) return; } - ref = CLAMP( ref, 0, stencilMax ); - if (face != 0) { if (ctx->Stencil.Function[face] == func && ctx->Stencil.ValueMask[face] == mask && @@ -390,7 +381,6 @@ _mesa_ActiveStencilFaceEXT(GLenum face) } if (face == GL_FRONT || face == GL_BACK) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2; } else { @@ -467,7 +457,6 @@ void GLAPIENTRY _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) { GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glStencilFuncSeparate()\n"); @@ -481,8 +470,6 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) return; } - ref = CLAMP(ref, 0, stencilMax); - FLUSH_VERTICES(ctx, _NEW_STENCIL); if (face != GL_BACK) { diff --git a/mesalib/src/mesa/main/stencil.h b/mesalib/src/mesa/main/stencil.h index b772bfd6e..f2f7d37c6 100644 --- a/mesalib/src/mesa/main/stencil.h +++ b/mesalib/src/mesa/main/stencil.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -78,4 +79,18 @@ _mesa_update_stencil(struct gl_context *ctx); extern void _mesa_init_stencil( struct gl_context * ctx ); +/* From the GL 4.3 spec, 17.3.5: + * "Stencil comparison operations and queries of <ref> clamp its value + * to the range [0, 2^s-1], where <s> is the number of bits in the + * stencil buffer attached to the draw framebuffer." + */ + +static inline GLint +_mesa_get_stencil_ref(struct gl_context const *ctx, int face) +{ + GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; + GLint ref = ctx->Stencil.Ref[face]; + return CLAMP(ref, 0, stencilMax); +} + #endif diff --git a/mesalib/src/mesa/main/syncobj.c b/mesalib/src/mesa/main/syncobj.c index 020fa1d7a..c8d25cdf1 100644 --- a/mesalib/src/mesa/main/syncobj.c +++ b/mesalib/src/mesa/main/syncobj.c @@ -60,7 +60,6 @@ #include "imports.h" #include "context.h" #include "macros.h" -#include "mfeatures.h" #include "get.h" #include "dispatch.h" #include "mtypes.h" diff --git a/mesalib/src/mesa/main/syncobj.h b/mesalib/src/mesa/main/syncobj.h index 6b4367466..faa3f558d 100644 --- a/mesalib/src/mesa/main/syncobj.h +++ b/mesalib/src/mesa/main/syncobj.h @@ -32,7 +32,6 @@ #define SYNCOBJ_H #include "glheader.h" -#include "mfeatures.h" struct _glapi_table; struct dd_function_table; diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c index 734294e45..2391868a4 100644 --- a/mesalib/src/mesa/main/texcompress.c +++ b/mesalib/src/mesa/main/texcompress.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -35,7 +36,6 @@ #include "colormac.h" #include "context.h" #include "formats.h" -#include "mfeatures.h" #include "mtypes.h" #include "context.h" #include "texcompress.h" @@ -588,7 +588,7 @@ _mesa_decompress_image(gl_format format, GLuint width, GLuint height, for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - fetch(src, NULL, stride, i, j, 0, dest); + fetch(src, stride, i, j, dest); dest += 4; } } diff --git a/mesalib/src/mesa/main/texcompress.h b/mesalib/src/mesa/main/texcompress.h index b45e7cf1b..c27fc26c9 100644 --- a/mesalib/src/mesa/main/texcompress.h +++ b/mesalib/src/mesa/main/texcompress.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TEXCOMPRESS_H @@ -27,7 +28,6 @@ #include "formats.h" #include "glheader.h" -#include "mfeatures.h" struct gl_context; @@ -51,9 +51,8 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img, /** A function to fetch one texel from a compressed texture */ typedef void (*compressed_fetch_func)(const GLubyte *map, - const GLuint imageOffsets[], GLint rowStride, - GLint i, GLint j, GLint k, + GLint i, GLint j, GLfloat *texel); extern compressed_fetch_func diff --git a/mesalib/src/mesa/main/texcompress_cpal.c b/mesalib/src/mesa/main/texcompress_cpal.c index 75389a437..2838a6a4e 100644 --- a/mesalib/src/mesa/main/texcompress_cpal.c +++ b/mesalib/src/mesa/main/texcompress_cpal.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -33,7 +34,6 @@ #include "glheader.h" #include "compiler.h" /* for ASSERT */ #include "context.h" -#include "mfeatures.h" #include "mtypes.h" #include "imports.h" #include "pixelstore.h" diff --git a/mesalib/src/mesa/main/texcompress_cpal.h b/mesalib/src/mesa/main/texcompress_cpal.h index 7d28fd866..8a8eac292 100644 --- a/mesalib/src/mesa/main/texcompress_cpal.h +++ b/mesalib/src/mesa/main/texcompress_cpal.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/texcompress_etc.c b/mesalib/src/mesa/main/texcompress_etc.c index 7ad4ddeb6..a06d29f19 100644 --- a/mesalib/src/mesa/main/texcompress_etc.c +++ b/mesalib/src/mesa/main/texcompress_etc.c @@ -38,7 +38,6 @@ */ #include <stdbool.h> -#include "mfeatures.h" #include "texcompress.h" #include "texcompress_etc.h" #include "texstore.h" @@ -1223,8 +1222,8 @@ _mesa_unpack_etc2_format(uint8_t *dst_row, static void -fetch_etc1_rgb8(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, +fetch_etc1_rgb8(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc1_block block; @@ -1244,9 +1243,8 @@ fetch_etc1_rgb8(const GLubyte *map, const GLuint imageOffsets[], static void -fetch_etc2_rgb8(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_rgb8(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; uint8_t dst[3]; @@ -1266,9 +1264,8 @@ fetch_etc2_rgb8(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_etc2_srgb8(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_srgb8(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; uint8_t dst[3]; @@ -1288,9 +1285,8 @@ fetch_etc2_srgb8(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_etc2_rgba8_eac(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_rgba8_eac(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; uint8_t dst[4]; @@ -1308,9 +1304,8 @@ fetch_etc2_rgba8_eac(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_etc2_srgb8_alpha8_eac(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_srgb8_alpha8_eac(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; uint8_t dst[4]; @@ -1328,9 +1323,8 @@ fetch_etc2_srgb8_alpha8_eac(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_etc2_r11_eac(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_r11_eac(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; GLushort dst; @@ -1348,9 +1342,8 @@ fetch_etc2_r11_eac(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_etc2_rg11_eac(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_rg11_eac(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; GLushort dst[2]; @@ -1373,9 +1366,8 @@ fetch_etc2_rg11_eac(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_etc2_signed_r11_eac(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_signed_r11_eac(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; GLushort dst; @@ -1393,9 +1385,8 @@ fetch_etc2_signed_r11_eac(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_etc2_signed_rg11_eac(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_etc2_signed_rg11_eac(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; GLushort dst[2]; @@ -1419,8 +1410,7 @@ fetch_etc2_signed_rg11_eac(const GLubyte *map, const GLuint imageOffsets[], static void fetch_etc2_rgb8_punchthrough_alpha1(const GLubyte *map, - const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { struct etc2_block block; @@ -1441,10 +1431,8 @@ fetch_etc2_rgb8_punchthrough_alpha1(const GLubyte *map, static void fetch_etc2_srgb8_punchthrough_alpha1(const GLubyte *map, - const GLuint imageOffsets[], GLint rowStride, - GLint i, GLint j, GLint k, - GLfloat *texel) + GLint i, GLint j, GLfloat *texel) { struct etc2_block block; uint8_t dst[4]; diff --git a/mesalib/src/mesa/main/texcompress_etc.h b/mesalib/src/mesa/main/texcompress_etc.h index 503d0388a..9da0fb337 100644 --- a/mesalib/src/mesa/main/texcompress_etc.h +++ b/mesalib/src/mesa/main/texcompress_etc.h @@ -26,7 +26,6 @@ #include <inttypes.h> #include "glheader.h" -#include "mfeatures.h" #include "texcompress.h" #include "texstore.h" diff --git a/mesalib/src/mesa/main/texcompress_fxt1.c b/mesalib/src/mesa/main/texcompress_fxt1.c index f7254f92e..93bd19a9a 100644 --- a/mesalib/src/mesa/main/texcompress_fxt1.c +++ b/mesalib/src/mesa/main/texcompress_fxt1.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -34,7 +35,6 @@ #include "colormac.h" #include "image.h" #include "macros.h" -#include "mfeatures.h" #include "mipmap.h" #include "texcompress.h" #include "texcompress_fxt1.h" @@ -1616,8 +1616,8 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */ static void -fetch_rgb_fxt1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_rgb_fxt1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLubyte rgba[4]; fxt1_decode_1(map, rowStride, i, j, rgba); @@ -1629,8 +1629,8 @@ fetch_rgb_fxt1(const GLubyte *map, const GLuint imageOffsets[], static void -fetch_rgba_fxt1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_rgba_fxt1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLubyte rgba[4]; fxt1_decode_1(map, rowStride, i, j, rgba); diff --git a/mesalib/src/mesa/main/texcompress_fxt1.h b/mesalib/src/mesa/main/texcompress_fxt1.h index 5949df90f..3a00de5ac 100644 --- a/mesalib/src/mesa/main/texcompress_fxt1.h +++ b/mesalib/src/mesa/main/texcompress_fxt1.h @@ -17,16 +17,16 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TEXCOMPRESS_FXT1_H #define TEXCOMPRESS_FXT1_H #include "glheader.h" -#include "mfeatures.h" #include "texstore.h" diff --git a/mesalib/src/mesa/main/texcompress_rgtc.c b/mesalib/src/mesa/main/texcompress_rgtc.c index 1f8de25ec..7afd8ffa7 100644 --- a/mesalib/src/mesa/main/texcompress_rgtc.c +++ b/mesalib/src/mesa/main/texcompress_rgtc.c @@ -38,7 +38,6 @@ #include "colormac.h" #include "image.h" #include "macros.h" -#include "mfeatures.h" #include "mipmap.h" #include "texcompress.h" #include "texcompress_rgtc.h" @@ -319,12 +318,11 @@ _mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS) static void -fetch_red_rgtc1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_red_rgtc1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLubyte red; - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; - unsigned_fetch_texel_rgtc(rowStride, map + sliceOffset, i, j, &red, 1); + unsigned_fetch_texel_rgtc(rowStride, map, i, j, &red, 1); texel[RCOMP] = UBYTE_TO_FLOAT(red); texel[GCOMP] = 0.0; texel[BCOMP] = 0.0; @@ -332,12 +330,11 @@ fetch_red_rgtc1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_l_latc1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_l_latc1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLubyte red; - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; - unsigned_fetch_texel_rgtc(rowStride, map + sliceOffset, i, j, &red, 1); + unsigned_fetch_texel_rgtc(rowStride, map, i, j, &red, 1); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT(red); @@ -345,13 +342,11 @@ fetch_l_latc1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_signed_red_rgtc1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_signed_red_rgtc1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLbyte red; - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; - signed_fetch_texel_rgtc(rowStride, (const GLbyte *) map + sliceOffset, + signed_fetch_texel_rgtc(rowStride, (const GLbyte *) map, i, j, &red, 1); texel[RCOMP] = BYTE_TO_FLOAT_TEX(red); texel[GCOMP] = 0.0; @@ -360,13 +355,11 @@ fetch_signed_red_rgtc1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_signed_l_latc1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_signed_l_latc1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLbyte red; - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; - signed_fetch_texel_rgtc(rowStride, (GLbyte *) map + sliceOffset, + signed_fetch_texel_rgtc(rowStride, (GLbyte *) map, i, j, &red, 1); texel[RCOMP] = texel[GCOMP] = @@ -375,17 +368,15 @@ fetch_signed_l_latc1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_rg_rgtc2(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_rg_rgtc2(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLubyte red, green; - GLuint sliceOffset = k ? imageOffsets[k] : 0; unsigned_fetch_texel_rgtc(rowStride, - map + sliceOffset, + map, i, j, &red, 2); unsigned_fetch_texel_rgtc(rowStride, - map + sliceOffset + 8, + map + 8, i, j, &green, 2); texel[RCOMP] = UBYTE_TO_FLOAT(red); texel[GCOMP] = UBYTE_TO_FLOAT(green); @@ -394,17 +385,15 @@ fetch_rg_rgtc2(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_la_latc2(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_la_latc2(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLubyte red, green; - GLuint sliceOffset = k ? imageOffsets[k] : 0; unsigned_fetch_texel_rgtc(rowStride, - map + sliceOffset, + map, i, j, &red, 2); unsigned_fetch_texel_rgtc(rowStride, - map + sliceOffset + 8, + map + 8, i, j, &green, 2); texel[RCOMP] = texel[GCOMP] = @@ -414,17 +403,15 @@ fetch_la_latc2(const GLubyte *map, const GLuint imageOffsets[], static void -fetch_signed_rg_rgtc2(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_signed_rg_rgtc2(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLbyte red, green; - GLuint sliceOffset = k ? imageOffsets[k] : 0; signed_fetch_texel_rgtc(rowStride, - (GLbyte *) map + sliceOffset, + (GLbyte *) map, i, j, &red, 2); signed_fetch_texel_rgtc(rowStride, - (GLbyte *) map + sliceOffset + 8, + (GLbyte *) map + 8, i, j, &green, 2); texel[RCOMP] = BYTE_TO_FLOAT_TEX(red); texel[GCOMP] = BYTE_TO_FLOAT_TEX(green); @@ -434,17 +421,15 @@ fetch_signed_rg_rgtc2(const GLubyte *map, const GLuint imageOffsets[], static void -fetch_signed_la_latc2(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, - GLfloat *texel) +fetch_signed_la_latc2(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { GLbyte red, green; - GLuint sliceOffset = k ? imageOffsets[k] : 0; signed_fetch_texel_rgtc(rowStride, - (GLbyte *) map + sliceOffset, + (GLbyte *) map, i, j, &red, 2); signed_fetch_texel_rgtc(rowStride, - (GLbyte *) map + sliceOffset + 8, + (GLbyte *) map + 8, i, j, &green, 2); texel[RCOMP] = texel[GCOMP] = diff --git a/mesalib/src/mesa/main/texcompress_rgtc.h b/mesalib/src/mesa/main/texcompress_rgtc.h index 9e1cce438..98638f022 100644 --- a/mesalib/src/mesa/main/texcompress_rgtc.h +++ b/mesalib/src/mesa/main/texcompress_rgtc.h @@ -25,7 +25,6 @@ #define TEXCOMPRESS_RGTC_H #include "glheader.h" -#include "mfeatures.h" #include "texstore.h" diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c index 4a81ad803..41ea33613 100644 --- a/mesalib/src/mesa/main/texcompress_s3tc.c +++ b/mesalib/src/mesa/main/texcompress_s3tc.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -39,7 +40,6 @@ #include "dlopen.h" #include "image.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "texcompress.h" #include "texcompress_s3tc.h" @@ -345,13 +345,12 @@ problem(const char *func) static void -fetch_rgb_dxt1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_rgb_dxt1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgb_dxt1) { - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; GLubyte tex[4]; - fetch_ext_rgb_dxt1(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgb_dxt1(rowStride, map, i, j, tex); texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]); texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]); texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]); @@ -363,13 +362,12 @@ fetch_rgb_dxt1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_rgba_dxt1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_rgba_dxt1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgba_dxt1) { - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; GLubyte tex[4]; - fetch_ext_rgba_dxt1(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgba_dxt1(rowStride, map, i, j, tex); texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]); texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]); texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]); @@ -381,13 +379,12 @@ fetch_rgba_dxt1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_rgba_dxt3(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_rgba_dxt3(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgba_dxt3) { - GLuint sliceOffset = k ? imageOffsets[k] : 0; GLubyte tex[4]; - fetch_ext_rgba_dxt3(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgba_dxt3(rowStride, map, i, j, tex); texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]); texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]); texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]); @@ -399,13 +396,12 @@ fetch_rgba_dxt3(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_rgba_dxt5(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_rgba_dxt5(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgba_dxt5) { - GLuint sliceOffset = k ? imageOffsets[k] : 0; GLubyte tex[4]; - fetch_ext_rgba_dxt5(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgba_dxt5(rowStride, map, i, j, tex); texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]); texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]); texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]); @@ -418,13 +414,12 @@ fetch_rgba_dxt5(const GLubyte *map, const GLuint imageOffsets[], static void -fetch_srgb_dxt1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_srgb_dxt1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgb_dxt1) { - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; GLubyte tex[4]; - fetch_ext_rgb_dxt1(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgb_dxt1(rowStride, map, i, j, tex); texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]); texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]); texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]); @@ -436,13 +431,12 @@ fetch_srgb_dxt1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_srgba_dxt1(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_srgba_dxt1(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgba_dxt1) { - GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0; GLubyte tex[4]; - fetch_ext_rgba_dxt1(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgba_dxt1(rowStride, map, i, j, tex); texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]); texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]); texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]); @@ -454,13 +448,12 @@ fetch_srgba_dxt1(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_srgba_dxt3(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_srgba_dxt3(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgba_dxt3) { - GLuint sliceOffset = k ? imageOffsets[k] : 0; GLubyte tex[4]; - fetch_ext_rgba_dxt3(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgba_dxt3(rowStride, map, i, j, tex); texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]); texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]); texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]); @@ -472,13 +465,12 @@ fetch_srgba_dxt3(const GLubyte *map, const GLuint imageOffsets[], } static void -fetch_srgba_dxt5(const GLubyte *map, const GLuint imageOffsets[], - GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel) +fetch_srgba_dxt5(const GLubyte *map, + GLint rowStride, GLint i, GLint j, GLfloat *texel) { if (fetch_ext_rgba_dxt5) { - GLuint sliceOffset = k ? imageOffsets[k] : 0; GLubyte tex[4]; - fetch_ext_rgba_dxt5(rowStride, map + sliceOffset, i, j, tex); + fetch_ext_rgba_dxt5(rowStride, map, i, j, tex); texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]); texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]); texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]); diff --git a/mesalib/src/mesa/main/texcompress_s3tc.h b/mesalib/src/mesa/main/texcompress_s3tc.h index d9ef68992..fbc04c234 100644 --- a/mesalib/src/mesa/main/texcompress_s3tc.h +++ b/mesalib/src/mesa/main/texcompress_s3tc.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TEXCOMPRESS_S3TC_H @@ -27,7 +28,6 @@ #include "compiler.h" #include "glheader.h" -#include "mfeatures.h" #include "texstore.h" #include "texcompress.h" diff --git a/mesalib/src/mesa/main/texenv.c b/mesalib/src/mesa/main/texenv.c index 2979e6706..84731ddda 100644 --- a/mesalib/src/mesa/main/texenv.c +++ b/mesalib/src/mesa/main/texenv.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -879,7 +880,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param ) } else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) { GLint count = 0; - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { count++; } @@ -887,7 +888,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param ) *param = count; } else if (pname == GL_BUMP_TEX_UNITS_ATI) { - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { *param++ = i + GL_TEXTURE0; } @@ -928,7 +929,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param ) } else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) { GLint count = 0; - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { count++; } @@ -936,7 +937,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param ) *param = (GLfloat) count; } else if (pname == GL_BUMP_TEX_UNITS_ATI) { - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { *param++ = (GLfloat) (i + GL_TEXTURE0); } diff --git a/mesalib/src/mesa/main/texenv.h b/mesalib/src/mesa/main/texenv.h index 1e9c5faed..5f71e276d 100644 --- a/mesalib/src/mesa/main/texenv.h +++ b/mesalib/src/mesa/main/texenv.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/texenvprogram.h b/mesalib/src/mesa/main/texenvprogram.h index 3d9cb8546..aff404be0 100644 --- a/mesalib/src/mesa/main/texenvprogram.h +++ b/mesalib/src/mesa/main/texenvprogram.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c index 6f22a4f5f..495a2048d 100644 --- a/mesalib/src/mesa/main/texformat.c +++ b/mesalib/src/mesa/main/texformat.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -35,7 +36,6 @@ #include "context.h" #include "enums.h" -#include "mfeatures.h" #include "mtypes.h" #include "texcompress.h" #include "texformat.h" @@ -50,250 +50,229 @@ * internalFormat parameters passed to glTexImage(). * * \param ctx the GL context. + * \param target a texture target (GL_TEXTURE_x) * \param internalFormat user's prefered internal texture format. * \param format incoming image pixel format. * \param type incoming image data type. * - * \return a pointer to a gl_texture_format object which describes the - * choosen texture format, or NULL on failure. - * - * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers - * will typically override this function with a specialized version. + * \return the closest gl_format for the given format/type arguments + * + * This is called via dd_function_table::ChooseTextureFormat. Hardware + * drivers may override this function with a specialized version. */ gl_format _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, GLint internalFormat, GLenum format, GLenum type) { (void) format; - (void) type; switch (internalFormat) { - /* shallow RGBA formats */ - case 4: - case GL_RGBA: - if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); - } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); - } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); - } - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - - case GL_RGBA8: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - case GL_RGB5_A1: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); - break; - case GL_RGBA2: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_REV); /* just to test another format*/ - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); - break; - case GL_RGBA4: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); - break; - - /* deep RGBA formats */ - case GL_RGB10_A2: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - case GL_RGBA12: - case GL_RGBA16: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - - /* shallow RGB formats */ - case 3: - case GL_RGB: - if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); - } - /* fallthrough */ - case GL_RGB8: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); - RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - case GL_R3_G3_B2: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); - RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - case GL_RGB4: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); /* just to test another format */ - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); - break; - case GL_RGB5: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); - break; - - /* deep RGB formats */ - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - - /* Alpha formats */ - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - RETURN_IF_SUPPORTED(MESA_FORMAT_A8); - break; - - case GL_ALPHA12: - case GL_ALPHA16: - RETURN_IF_SUPPORTED(MESA_FORMAT_A16); - RETURN_IF_SUPPORTED(MESA_FORMAT_A8); - break; - - /* Luminance formats */ - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - RETURN_IF_SUPPORTED(MESA_FORMAT_L8); - break; - - case GL_LUMINANCE12: - case GL_LUMINANCE16: - RETURN_IF_SUPPORTED(MESA_FORMAT_L16); - RETURN_IF_SUPPORTED(MESA_FORMAT_L8); - break; + /* shallow RGBA formats */ + case 4: + case GL_RGBA: + if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); + } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + } + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + + case GL_RGBA8: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + case GL_RGB5_A1: + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); + break; + case GL_RGBA2: + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_REV); /* just to test another format*/ + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + break; + case GL_RGBA4: + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + break; + + /* deep RGBA formats */ + case GL_RGB10_A2: + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + case GL_RGBA12: + case GL_RGBA16: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + + /* shallow RGB formats */ + case 3: + case GL_RGB: + if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + } + /* fallthrough */ + case GL_RGB8: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + case GL_R3_G3_B2: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + case GL_RGB4: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); /* just to test another format */ + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + break; + case GL_RGB5: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + break; + + /* deep RGB formats */ + case GL_RGB10: + case GL_RGB12: + case GL_RGB16: + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + + /* Alpha formats */ + case GL_ALPHA: + case GL_ALPHA4: + case GL_ALPHA8: + RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + break; + + case GL_ALPHA12: + case GL_ALPHA16: + RETURN_IF_SUPPORTED(MESA_FORMAT_A16); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + break; + + /* Luminance formats */ + case 1: + case GL_LUMINANCE: + case GL_LUMINANCE4: + case GL_LUMINANCE8: + RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + break; + + case GL_LUMINANCE12: + case GL_LUMINANCE16: + RETURN_IF_SUPPORTED(MESA_FORMAT_L16); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + break; /* Luminance/Alpha formats */ - case GL_LUMINANCE4_ALPHA4: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL44); - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); - break; - - case 2: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); - break; - - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL1616); - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); - break; - - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - RETURN_IF_SUPPORTED(MESA_FORMAT_I8); - break; - - case GL_INTENSITY12: - case GL_INTENSITY16: - RETURN_IF_SUPPORTED(MESA_FORMAT_I16); - RETURN_IF_SUPPORTED(MESA_FORMAT_I8); - break; - - default: - ; /* fallthrough */ - } - - if (ctx->Extensions.ARB_depth_texture) { - switch (internalFormat) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z32); - RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); - break; - case GL_DEPTH_COMPONENT16: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z16); - RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); - default: - ; /* fallthrough */ + case GL_LUMINANCE4_ALPHA4: + RETURN_IF_SUPPORTED(MESA_FORMAT_AL44); + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; + + case 2: + case GL_LUMINANCE_ALPHA: + case GL_LUMINANCE6_ALPHA2: + case GL_LUMINANCE8_ALPHA8: + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; + + case GL_LUMINANCE12_ALPHA4: + case GL_LUMINANCE12_ALPHA12: + case GL_LUMINANCE16_ALPHA16: + RETURN_IF_SUPPORTED(MESA_FORMAT_AL1616); + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; + + case GL_INTENSITY: + case GL_INTENSITY4: + case GL_INTENSITY8: + RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + break; + + case GL_INTENSITY12: + case GL_INTENSITY16: + RETURN_IF_SUPPORTED(MESA_FORMAT_I16); + RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + break; + + case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: + RETURN_IF_SUPPORTED(MESA_FORMAT_Z32); + RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); + RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + break; + case GL_DEPTH_COMPONENT16: + RETURN_IF_SUPPORTED(MESA_FORMAT_Z16); + RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); + RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + break; + + case GL_COMPRESSED_ALPHA_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + break; + case GL_COMPRESSED_LUMINANCE_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + break; + case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; + case GL_COMPRESSED_INTENSITY_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + break; + case GL_COMPRESSED_RGB_ARB: + /* We don't use texture compression for 1D and 1D array textures. + * For 1D textures, compressions doesn't buy us much. + * For 1D ARRAY textures, there's complicated issues with updating + * sub-regions on non-block boundaries with glCopyTexSubImage, among + * other issues. FWIW, the GL_EXT_texture_array extension prohibits + * 1D ARRAY textures in S3TC format. + */ + if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) { + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.ANGLE_texture_compression_dxt) + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1); + if (ctx->Extensions.TDFX_texture_compression_FXT1) + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1); } - } - - switch (internalFormat) { - case GL_COMPRESSED_ALPHA_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_A8); - break; - case GL_COMPRESSED_LUMINANCE_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_L8); - break; - case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); - break; - case GL_COMPRESSED_INTENSITY_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_I8); - break; - case GL_COMPRESSED_RGB_ARB: - /* We don't use texture compression for 1D and 1D array textures. - * For 1D textures, compressions doesn't buy us much. - * For 1D ARRAY textures, there's complicated issues with updating - * sub-regions on non-block boundaries with glCopyTexSubImage, among - * other issues. FWIW, the GL_EXT_texture_array extension prohibits - * 1D ARRAY textures in S3TC format. - */ - if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) { - if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.ANGLE_texture_compression_dxt) - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1); - if (ctx->Extensions.TDFX_texture_compression_FXT1) - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1); - } - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); - RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - case GL_COMPRESSED_RGBA_ARB: - /* We don't use texture compression for 1D and 1D array textures. */ - if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) { - if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.ANGLE_texture_compression_dxt) - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */ - if (ctx->Extensions.TDFX_texture_compression_FXT1) - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1); - } - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - default: - ; /* fallthrough */ - } - - if (ctx->Extensions.ARB_ES2_compatibility) { - switch (internalFormat) { - case GL_RGB565: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); - break; - default: - ; /* fallthrough */ + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + case GL_COMPRESSED_RGBA_ARB: + /* We don't use texture compression for 1D and 1D array textures. */ + if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) { + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.ANGLE_texture_compression_dxt) + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */ + if (ctx->Extensions.TDFX_texture_compression_FXT1) + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1); } - } + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; - if (ctx->Extensions.MESA_ycbcr_texture) { - if (internalFormat == GL_YCBCR_MESA) { - if (type == GL_UNSIGNED_SHORT_8_8_MESA) - RETURN_IF_SUPPORTED(MESA_FORMAT_YCBCR); - else - RETURN_IF_SUPPORTED(MESA_FORMAT_YCBCR_REV); - } - } + case GL_RGB565: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + break; + + case GL_YCBCR_MESA: + if (type == GL_UNSIGNED_SHORT_8_8_MESA) + RETURN_IF_SUPPORTED(MESA_FORMAT_YCBCR); + else + RETURN_IF_SUPPORTED(MESA_FORMAT_YCBCR_REV); + break; /* For non-generic compressed format we assert two things: * @@ -303,7 +282,6 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, * 2. The driver only enables the extension if it supports all of the * formats that are part of that extension. */ - switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: @@ -368,560 +346,474 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, return MESA_FORMAT_SRGBA_DXT3; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return MESA_FORMAT_SRGBA_DXT5; - default: - ; /* fallthrough */ - } - - if (ctx->Extensions.ARB_texture_float) { - switch (internalFormat) { - case GL_ALPHA16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_ALPHA32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_LUMINANCE16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_LUMINANCE32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_LUMINANCE_ALPHA16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_LUMINANCE_ALPHA32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_INTENSITY16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_INTENSITY32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_RGB16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_RGB32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_RGBA16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_RGBA32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_texture_shared_exponent) { - switch (internalFormat) { - case GL_RGB9_E5: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_RGB9_E5_FLOAT]); - return MESA_FORMAT_RGB9_E5_FLOAT; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_packed_float) { - switch (internalFormat) { - case GL_R11F_G11F_B10F: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R11_G11_B10_FLOAT]); - return MESA_FORMAT_R11_G11_B10_FLOAT; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_packed_depth_stencil) { - switch (internalFormat) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_S8); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); - break; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.ARB_depth_buffer_float) { - switch (internalFormat) { - case GL_DEPTH_COMPONENT32F: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT]); - return MESA_FORMAT_Z32_FLOAT; - case GL_DEPTH32F_STENCIL8: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_X24S8]); - return MESA_FORMAT_Z32_FLOAT_X24S8; - default: - ; /* fallthrough */ - } - } - if (ctx->Extensions.ATI_envmap_bumpmap) { - switch (internalFormat) { - case GL_DUDV_ATI: - case GL_DU8DV8_ATI: - RETURN_IF_SUPPORTED(MESA_FORMAT_DUDV8); - break; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_texture_snorm) { - switch (internalFormat) { - case GL_RED_SNORM: - case GL_R8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R8); - break; - case GL_RG_SNORM: - case GL_RG8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG88_REV); - break; - case GL_RGB_SNORM: - case GL_RGB8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888); - /* FALLTHROUGH */ - case GL_RGBA_SNORM: - case GL_RGBA8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_ALPHA_SNORM: - case GL_ALPHA8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_LUMINANCE_SNORM: - case GL_LUMINANCE8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_LUMINANCE_ALPHA_SNORM: - case GL_LUMINANCE8_ALPHA8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL88); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_INTENSITY_SNORM: - case GL_INTENSITY8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_R16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R16); - break; - case GL_RG16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_GR1616); - break; - case GL_RGB16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16); - /* FALLTHROUGH */ - case GL_RGBA16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_ALPHA16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_LUMINANCE16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L16); - /* FALLTHROUGH */ - case GL_LUMINANCE16_ALPHA16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL1616); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - case GL_INTENSITY16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); - break; - default: - ; /* fall-through */ - } - } - - if (ctx->Extensions.EXT_texture_sRGB) { - switch (internalFormat) { - case GL_SRGB_EXT: - case GL_SRGB8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - case GL_SRGB_ALPHA_EXT: - case GL_SRGB8_ALPHA8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - case GL_SLUMINANCE_EXT: - case GL_SLUMINANCE8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - case GL_SLUMINANCE_ALPHA_EXT: - case GL_SLUMINANCE8_ALPHA8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - case GL_COMPRESSED_SLUMINANCE_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - case GL_COMPRESSED_SRGB_EXT: - if (ctx->Extensions.EXT_texture_compression_s3tc) - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - case GL_COMPRESSED_SRGB_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_compression_s3tc) - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, see spec */ - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); - break; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_texture_integer) { - switch (internalFormat) { - case GL_ALPHA8UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_UINT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); - break; - case GL_ALPHA16UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_UINT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); - break; - case GL_ALPHA32UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_UINT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); - break; - case GL_ALPHA8I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); - break; - case GL_ALPHA16I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); - break; - case GL_ALPHA32I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); - break; - case GL_LUMINANCE8UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_UINT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); - break; - case GL_LUMINANCE16UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_UINT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); - break; - case GL_LUMINANCE32UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_UINT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); - break; - case GL_LUMINANCE8I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); - break; - case GL_LUMINANCE16I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); - break; - case GL_LUMINANCE32I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); - break; - case GL_LUMINANCE_ALPHA8UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_UINT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); - break; - case GL_LUMINANCE_ALPHA16UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_UINT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); - break; - case GL_LUMINANCE_ALPHA32UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_UINT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); - break; - case GL_LUMINANCE_ALPHA8I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); - break; - case GL_LUMINANCE_ALPHA16I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); - break; - case GL_LUMINANCE_ALPHA32I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); - break; - case GL_INTENSITY8UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_UINT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); - break; - case GL_INTENSITY16UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_UINT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); - break; - case GL_INTENSITY32UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_UINT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); - break; - case GL_INTENSITY8I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); - break; - case GL_INTENSITY16I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); - break; - case GL_INTENSITY32I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); - break; - } - } - - if (ctx->Version >= 30 || - ctx->Extensions.EXT_texture_integer) { - switch (internalFormat) { - case GL_RGB8UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); - break; - case GL_RGB16UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); - break; - case GL_RGB32UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); - break; - case GL_RGB8I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); - break; - case GL_RGB16I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); - break; - case GL_RGB32I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); - break; - case GL_RGBA8UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); - break; - case GL_RGBA16UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); - break; - case GL_RGBA32UI_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); - break; - case GL_RGBA8I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); - break; - case GL_RGBA16I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); - break; - case GL_RGBA32I_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); - break; - } - } - - if (ctx->Extensions.ARB_texture_rg) { - switch (internalFormat) { - case GL_R8: - case GL_RED: - RETURN_IF_SUPPORTED(MESA_FORMAT_R8); - break; - - case GL_COMPRESSED_RED: - if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) - RETURN_IF_SUPPORTED(MESA_FORMAT_RED_RGTC1); - RETURN_IF_SUPPORTED(MESA_FORMAT_R8); - break; - - case GL_R16: - RETURN_IF_SUPPORTED(MESA_FORMAT_R16); - break; - - case GL_RG: - case GL_RG8: - RETURN_IF_SUPPORTED(MESA_FORMAT_GR88); - break; - - case GL_COMPRESSED_RG: - if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_RGTC2); - RETURN_IF_SUPPORTED(MESA_FORMAT_GR88); - break; - - case GL_RG16: - RETURN_IF_SUPPORTED(MESA_FORMAT_GR1616); - break; - - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.ARB_texture_rg && ctx->Extensions.ARB_texture_float) { - switch (internalFormat) { - case GL_R16F: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_R32F: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_RG16F: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_RG32F: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - - default: - ; /* fallthrough */ - } - } - - if (ctx->Version >= 30 || - (ctx->Extensions.ARB_texture_rg && - ctx->Extensions.EXT_texture_integer)) { - switch (internalFormat) { - case GL_R8UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT8); - break; - case GL_RG8UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT8); - break; - case GL_R16UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT16); - break; - case GL_RG16UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT16); - break; - case GL_R32UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT32); - break; - case GL_RG32UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT32); - break; - case GL_R8I: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT8); - break; - case GL_RG8I: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT8); - break; - case GL_R16I: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT16); - break; - case GL_RG16I: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT16); - break; - case GL_R32I: - RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT32); - break; - case GL_RG32I: - RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT32); - break; - default: - break; - } - } - - if (ctx->Extensions.ARB_texture_rgb10_a2ui) { - switch (internalFormat) { - case GL_RGB10_A2UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UINT); - RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR2101010_UINT); - break; - default: - break; - } - } - /* GL_BGRA can be an internal format *only* in OpenGL ES (1.x or 2.0). - */ - if (_mesa_is_gles(ctx)) { - switch (internalFormat) { - case GL_BGRA: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); - break; - - default: - ; /* fallthrough */ - } + case GL_ALPHA16F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_ALPHA32F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + case GL_LUMINANCE16F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_LUMINANCE32F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + case GL_LUMINANCE_ALPHA16F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_LUMINANCE_ALPHA32F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + case GL_INTENSITY16F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_INTENSITY32F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + case GL_RGB16F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_FLOAT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_RGB32F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_FLOAT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + case GL_RGBA16F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_RGBA32F_ARB: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + + case GL_RGB9_E5: + /* GL_EXT_texture_shared_exponent -- just one format to support */ + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_RGB9_E5_FLOAT]); + return MESA_FORMAT_RGB9_E5_FLOAT; + + case GL_R11F_G11F_B10F: + /* GL_EXT_texture_packed_float -- just one format to support */ + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R11_G11_B10_FLOAT]); + return MESA_FORMAT_R11_G11_B10_FLOAT; + + case GL_DEPTH_STENCIL_EXT: + case GL_DEPTH24_STENCIL8_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_S8); + RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + break; + + case GL_DEPTH_COMPONENT32F: + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT]); + return MESA_FORMAT_Z32_FLOAT; + case GL_DEPTH32F_STENCIL8: + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_X24S8]); + return MESA_FORMAT_Z32_FLOAT_X24S8; + + case GL_DUDV_ATI: + case GL_DU8DV8_ATI: + RETURN_IF_SUPPORTED(MESA_FORMAT_DUDV8); + break; + + case GL_RED_SNORM: + case GL_R8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R8); + break; + case GL_RG_SNORM: + case GL_RG8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG88_REV); + break; + case GL_RGB_SNORM: + case GL_RGB8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888); + /* FALLTHROUGH */ + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_ALPHA_SNORM: + case GL_ALPHA8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_LUMINANCE_SNORM: + case GL_LUMINANCE8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_LUMINANCE_ALPHA_SNORM: + case GL_LUMINANCE8_ALPHA8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL88); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_INTENSITY_SNORM: + case GL_INTENSITY8_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_R16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R16); + break; + case GL_RG16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_GR1616); + break; + case GL_RGB16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SNORM); + /* FALLTHROUGH */ + case GL_RGBA16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_ALPHA16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A16); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_LUMINANCE16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L16); + /* FALLTHROUGH */ + case GL_LUMINANCE16_ALPHA16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL1616); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + case GL_INTENSITY16_SNORM: + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I16); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; + + case GL_SRGB_EXT: + case GL_SRGB8_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + case GL_SRGB_ALPHA_EXT: + case GL_SRGB8_ALPHA8_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + case GL_SLUMINANCE_EXT: + case GL_SLUMINANCE8_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + case GL_SLUMINANCE_ALPHA_EXT: + case GL_SLUMINANCE8_ALPHA8_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + case GL_COMPRESSED_SLUMINANCE_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + case GL_COMPRESSED_SRGB_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + case GL_COMPRESSED_SRGB_ALPHA_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, see spec */ + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; + + case GL_ALPHA8UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_UINT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); + break; + case GL_ALPHA16UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_UINT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); + break; + case GL_ALPHA32UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_UINT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); + break; + case GL_ALPHA8I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); + break; + case GL_ALPHA16I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); + break; + case GL_ALPHA32I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); + break; + case GL_LUMINANCE8UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_UINT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); + break; + case GL_LUMINANCE16UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_UINT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); + break; + case GL_LUMINANCE32UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_UINT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); + break; + case GL_LUMINANCE8I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); + break; + case GL_LUMINANCE16I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); + break; + case GL_LUMINANCE32I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); + break; + case GL_LUMINANCE_ALPHA8UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_UINT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); + break; + case GL_LUMINANCE_ALPHA16UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_UINT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); + break; + case GL_LUMINANCE_ALPHA32UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_UINT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); + break; + case GL_LUMINANCE_ALPHA8I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); + break; + case GL_LUMINANCE_ALPHA16I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); + break; + case GL_LUMINANCE_ALPHA32I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); + break; + case GL_INTENSITY8UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_UINT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); + break; + case GL_INTENSITY16UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_UINT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); + break; + case GL_INTENSITY32UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_UINT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); + break; + case GL_INTENSITY8I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); + break; + case GL_INTENSITY16I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); + break; + case GL_INTENSITY32I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); + break; + + case GL_RGB8UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); + break; + case GL_RGB16UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); + break; + case GL_RGB32UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); + break; + case GL_RGB8I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT8); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_SINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); + break; + case GL_RGB16I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); + break; + case GL_RGB32I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_SINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); + break; + case GL_RGBA8UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); + break; + case GL_RGBA16UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); + break; + case GL_RGBA32UI_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); + break; + case GL_RGBA8I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); + break; + case GL_RGBA16I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); + break; + case GL_RGBA32I_EXT: + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); + break; + + case GL_R8: + case GL_RED: + RETURN_IF_SUPPORTED(MESA_FORMAT_R8); + break; + + case GL_COMPRESSED_RED: + if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) + RETURN_IF_SUPPORTED(MESA_FORMAT_RED_RGTC1); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8); + break; + + case GL_R16: + RETURN_IF_SUPPORTED(MESA_FORMAT_R16); + break; + + case GL_RG: + case GL_RG8: + RETURN_IF_SUPPORTED(MESA_FORMAT_GR88); + break; + + case GL_COMPRESSED_RG: + if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_RGTC2); + RETURN_IF_SUPPORTED(MESA_FORMAT_GR88); + break; + + case GL_RG16: + RETURN_IF_SUPPORTED(MESA_FORMAT_GR1616); + break; + + case GL_R16F: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_R32F: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + case GL_RG16F: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; + case GL_RG32F: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_FLOAT16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; + + case GL_R8UI: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT8); + break; + case GL_RG8UI: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT8); + break; + case GL_R16UI: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT16); + break; + case GL_RG16UI: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT16); + break; + case GL_R32UI: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT32); + break; + case GL_RG32UI: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT32); + break; + case GL_R8I: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT8); + break; + case GL_RG8I: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT8); + break; + case GL_R16I: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT16); + break; + case GL_RG16I: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT16); + break; + case GL_R32I: + RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT32); + break; + case GL_RG32I: + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT32); + break; + + case GL_RGB10_A2UI: + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR2101010_UINT); + break; + + case GL_BGRA: + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; } _mesa_problem(ctx, "unexpected format %s in _mesa_choose_tex_format()", @@ -929,3 +821,16 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, return MESA_FORMAT_NONE; } +GLboolean +_mesa_tex_target_is_array(GLenum target) +{ + switch (target) { + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + return GL_TRUE; + default: + return GL_FALSE; + } +} diff --git a/mesalib/src/mesa/main/texformat.h b/mesalib/src/mesa/main/texformat.h index 71af9ca22..d6ff54173 100644 --- a/mesalib/src/mesa/main/texformat.h +++ b/mesalib/src/mesa/main/texformat.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TEXFORMAT_H @@ -35,5 +36,7 @@ extern gl_format _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, GLint internalFormat, GLenum format, GLenum type); +extern GLboolean +_mesa_tex_target_is_array(GLenum target); #endif diff --git a/mesalib/src/mesa/main/texgen.c b/mesalib/src/mesa/main/texgen.c index e45cfe176..81ad224a0 100644 --- a/mesalib/src/mesa/main/texgen.c +++ b/mesalib/src/mesa/main/texgen.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -34,7 +35,6 @@ #include "main/context.h" #include "main/enums.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/texgen.h" #include "main/texstate.h" #include "math/m_matrix.h" diff --git a/mesalib/src/mesa/main/texgen.h b/mesalib/src/mesa/main/texgen.h index 97563a0f0..3292258dc 100644 --- a/mesalib/src/mesa/main/texgen.h +++ b/mesalib/src/mesa/main/texgen.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "compiler.h" #include "glheader.h" -#include "mfeatures.h" struct _glapi_table; diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c index 74b09ef2c..70319c52b 100644 --- a/mesalib/src/mesa/main/texgetimage.c +++ b/mesalib/src/mesa/main/texgetimage.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -37,7 +38,6 @@ #include "format_unpack.h" #include "glformats.h" #include "image.h" -#include "mfeatures.h" #include "mtypes.h" #include "pack.h" #include "pbo.h" diff --git a/mesalib/src/mesa/main/texgetimage.h b/mesalib/src/mesa/main/texgetimage.h index c9277fc91..32c33fed4 100644 --- a/mesalib/src/mesa/main/texgetimage.h +++ b/mesalib/src/mesa/main/texgetimage.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 784b389a7..9aaa63f13 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -39,7 +40,6 @@ #include "image.h" #include "imports.h" #include "macros.h" -#include "mfeatures.h" #include "multisample.h" #include "state.h" #include "texcompress.h" @@ -180,7 +180,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) default: ; /* fallthrough */ } - + if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: @@ -315,15 +315,17 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) case GL_SRGB_EXT: case GL_SRGB8_EXT: case GL_COMPRESSED_SRGB_EXT: - case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: return GL_RGB; + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: + return ctx->Extensions.EXT_texture_compression_s3tc ? GL_RGB : -1; case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: case GL_COMPRESSED_SRGB_ALPHA_EXT: + return GL_RGBA; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return GL_RGBA; + return ctx->Extensions.EXT_texture_compression_s3tc ? GL_RGBA : -1; case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: @@ -613,7 +615,7 @@ set_tex_image(struct gl_texture_object *tObj, /** * Allocate a texture image structure. - * + * * Called via ctx->Driver.NewTextureImage() unless overriden by a device * driver. * @@ -868,7 +870,7 @@ _mesa_get_tex_image(struct gl_context *ctx, struct gl_texture_object *texObj, if (!texObj) return NULL; - + texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (!texImage) { texImage = ctx->Driver.NewTextureImage(ctx); @@ -974,7 +976,7 @@ get_proxy_tex_image(struct gl_context *ctx, GLenum target, GLint level) * * \param ctx GL context. * \param target texture target. - * + * * \return the maximum number of allowed mipmap levels for the given * texture target, or zero if passed a bad target. * @@ -1536,13 +1538,13 @@ error_check_subtexture_dimensions(struct gl_context *ctx, } /* check xoffset and width */ - if (xoffset < -destImage->Border) { + if (xoffset < - (GLint) destImage->Border) { _mesa_error(ctx, GL_INVALID_VALUE, "%s%dD(xoffset)", function, dims); return GL_TRUE; } - if (xoffset + subWidth > destImage->Width) { + if (xoffset + subWidth > (GLint) destImage->Width) { _mesa_error(ctx, GL_INVALID_VALUE, "%s%dD(xoffset+width)", function, dims); return GL_TRUE; @@ -1556,7 +1558,7 @@ error_check_subtexture_dimensions(struct gl_context *ctx, function, dims); return GL_TRUE; } - if (yoffset + subHeight > destImage->Height) { + if (yoffset + subHeight > (GLint) destImage->Height) { _mesa_error(ctx, GL_INVALID_VALUE, "%s%dD(yoffset+height)", function, dims); return GL_TRUE; @@ -1594,18 +1596,24 @@ error_check_subtexture_dimensions(struct gl_context *ctx, return GL_TRUE; } - /* size must be multiple of bw by bh or equal to whole texture size */ - if ((subWidth % bw != 0) && subWidth != destImage->Width) { + /* The size must be a multiple of bw x bh, or we must be using a + * offset+size that exactly hits the edge of the image. This + * is important for small mipmap levels (1x1, 2x1, etc) and for + * NPOT textures. + */ + if ((subWidth % bw != 0) && + (xoffset + subWidth != (GLint) destImage->Width)) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s%dD(width = %d)", function, dims, subWidth); return GL_TRUE; } - if ((subHeight % bh != 0) && subHeight != destImage->Height) { + if ((subHeight % bh != 0) && + (yoffset + subHeight != (GLint) destImage->Height)) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s%dD(height = %d)", function, dims, subHeight); return GL_TRUE; - } + } } return GL_FALSE; @@ -1705,7 +1713,7 @@ target_can_be_compressed(const struct gl_context *ctx, GLenum target, return ctx->Extensions.ARB_texture_cube_map_array; default: return GL_FALSE; - } + } } @@ -1867,7 +1875,7 @@ compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth, /** * Test the glTexImage[123]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user (already validated). @@ -1879,7 +1887,7 @@ compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth, * \param height image height given by the user. * \param depth image depth given by the user. * \param border image border given by the user. - * + * * \return GL_TRUE if a error is found, GL_FALSE otherwise * * Verifies each of the parameters against the constants specified in @@ -1949,12 +1957,12 @@ texture_error_check( struct gl_context *ctx, internalFormat); } else { if (format != internalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexImage%dD(format = %s, internalFormat = %s)", - dimensions, - _mesa_lookup_enum_by_nr(format), - _mesa_lookup_enum_by_nr(internalFormat)); - return GL_TRUE; + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTexImage%dD(format = %s, internalFormat = %s)", + dimensions, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(internalFormat)); + return GL_TRUE; } err = _mesa_es_error_check_format_and_type(format, type, dimensions); @@ -2258,7 +2266,7 @@ error: /** * Test glTexSubImage[123]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user (already validated) @@ -2271,7 +2279,7 @@ error: * \param width image width given by the user. * \param height image height given by the user. * \param depth image depth given by the user. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. * * Verifies each of the parameters against the constants specified in @@ -2376,7 +2384,7 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions, /** * Test glCopyTexImage[12]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. @@ -2385,9 +2393,9 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions, * \param width image width given by the user. * \param height image height given by the user. * \param border texture border. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * + * * Verifies each of the parameters against the constants specified in * __struct gl_contextRec::Const and the supported extensions, and according * to the OpenGL specification. @@ -2407,7 +2415,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)", dimensions, _mesa_lookup_enum_by_nr(target)); return GL_TRUE; - } + } /* level check */ if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) { @@ -2753,9 +2761,8 @@ check_rtt_cb(GLuint key, void *data, void *userData) att->Texture == texObj && att->TextureLevel == level && att->CubeMapFace == face) { - ASSERT(_mesa_get_attachment_teximage(att)); - /* Tell driver about the new renderbuffer texture */ - ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att); + _mesa_update_texture_renderbuffer(ctx, ctx->DrawBuffer, att); + ASSERT(att->Renderbuffer->TexImage); /* Mark fb status as indeterminate to force re-validation */ fb->_Status = 0; } @@ -2920,6 +2927,7 @@ _mesa_choose_texture_format(struct gl_context *ctx, return f; } + /** * Adjust pixel unpack params and image dimensions to strip off the * one-pixel texture border. @@ -2957,7 +2965,9 @@ strip_texture_border(GLenum target, *height = *height - 2; /* reduce the height by two border pixels */ } - if (*depth >= 3 && target != GL_TEXTURE_2D_ARRAY && target != GL_TEXTURE_CUBE_MAP_ARRAY) { + if (*depth >= 3 && + target != GL_TEXTURE_2D_ARRAY && + target != GL_TEXTURE_CUBE_MAP_ARRAY) { unpackNew->SkipImages++; /* skip the border */ *depth = *depth - 2; /* reduce the depth by two border pixels */ } @@ -3309,7 +3319,7 @@ texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)", dims, _mesa_lookup_enum_by_nr(target)); return; - } + } if (ctx->NewState & _NEW_PIXEL) _mesa_update_state(ctx); @@ -3694,7 +3704,7 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims, targetOK = GL_FALSE; break; } - + if (!targetOK) { _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage%uD(target)", dims); @@ -4027,6 +4037,7 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) } } + static gl_format validate_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) { @@ -4098,6 +4109,7 @@ texbufferrange(struct gl_context *ctx, GLenum target, GLenum internalFormat, _mesa_unlock_texture(ctx, texObj); } + /** GL_ARB_texture_buffer_object */ void GLAPIENTRY _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) @@ -4124,6 +4136,7 @@ _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) texbufferrange(ctx, target, internalFormat, bufObj, 0, buffer ? -1 : 0); } + /** GL_ARB_texture_buffer_range */ void GLAPIENTRY _mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer, @@ -4164,6 +4177,7 @@ _mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer, texbufferrange(ctx, target, internalFormat, bufObj, offset, size); } + static GLboolean is_renderable_texture_format(struct gl_context *ctx, GLenum internalformat) { @@ -4174,6 +4188,7 @@ is_renderable_texture_format(struct gl_context *ctx, GLenum internalformat) return baseFormat != 0 && baseFormat != GL_STENCIL_INDEX; } + /** GL_ARB_texture_multisample */ static GLboolean check_multisample_target(GLuint dims, GLenum target) @@ -4192,6 +4207,7 @@ check_multisample_target(GLuint dims, GLenum target) } } + static void teximagemultisample(GLuint dims, GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, @@ -4309,7 +4325,6 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples, texImage->FixedSampleLocations = fixedsamplelocations; if (width > 0 && height > 0 && depth > 0) { - if (!ctx->Driver.AllocTextureStorage(ctx, texObj, 1, width, height, depth)) { /* tidy up the texture image state. strictly speaking, @@ -4326,15 +4341,18 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples, } } + void GLAPIENTRY _mesa_TexImage2DMultisample(GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) { teximagemultisample(2, target, samples, internalformat, - width, height, 1, fixedsamplelocations, GL_FALSE, "glTexImage2DMultisample"); + width, height, 1, fixedsamplelocations, GL_FALSE, + "glTexImage2DMultisample"); } + void GLAPIENTRY _mesa_TexImage3DMultisample(GLenum target, GLsizei samples, GLint internalformat, GLsizei width, @@ -4342,7 +4360,8 @@ _mesa_TexImage3DMultisample(GLenum target, GLsizei samples, GLboolean fixedsamplelocations) { teximagemultisample(3, target, samples, internalformat, - width, height, depth, fixedsamplelocations, GL_FALSE, "glTexImage3DMultisample"); + width, height, depth, fixedsamplelocations, GL_FALSE, + "glTexImage3DMultisample"); } @@ -4352,9 +4371,11 @@ _mesa_TexStorage2DMultisample(GLenum target, GLsizei samples, GLsizei height, GLboolean fixedsamplelocations) { teximagemultisample(2, target, samples, internalformat, - width, height, 1, fixedsamplelocations, GL_TRUE, "glTexStorage2DMultisample"); + width, height, 1, fixedsamplelocations, GL_TRUE, + "glTexStorage2DMultisample"); } + void GLAPIENTRY _mesa_TexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, @@ -4362,5 +4383,6 @@ _mesa_TexStorage3DMultisample(GLenum target, GLsizei samples, GLboolean fixedsamplelocations) { teximagemultisample(3, target, samples, internalformat, - width, height, depth, fixedsamplelocations, GL_TRUE, "glTexStorage3DMultisample"); + width, height, depth, fixedsamplelocations, GL_TRUE, + "glTexStorage3DMultisample"); } diff --git a/mesalib/src/mesa/main/teximage.h b/mesalib/src/mesa/main/teximage.h index bb295c7a7..a0d71c9f8 100644 --- a/mesalib/src/mesa/main/teximage.h +++ b/mesalib/src/mesa/main/teximage.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c index 66377c8c0..27c040301 100644 --- a/mesalib/src/mesa/main/texobj.c +++ b/mesalib/src/mesa/main/texobj.c @@ -22,13 +22,13 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ -#include "mfeatures.h" #include "bufferobj.h" #include "colortab.h" #include "context.h" diff --git a/mesalib/src/mesa/main/texobj.h b/mesalib/src/mesa/main/texobj.h index f86b4ebcd..622defa71 100644 --- a/mesalib/src/mesa/main/texobj.h +++ b/mesalib/src/mesa/main/texobj.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index f60eb204e..b5a1e58e2 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -38,7 +39,6 @@ #include "main/formats.h" #include "main/glformats.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/state.h" #include "main/texcompress.h" diff --git a/mesalib/src/mesa/main/texparam.h b/mesalib/src/mesa/main/texparam.h index 19b4116c0..32cefad22 100644 --- a/mesalib/src/mesa/main/texparam.h +++ b/mesalib/src/mesa/main/texparam.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c index d44cd7cf9..afc9337ff 100644 --- a/mesalib/src/mesa/main/texstate.c +++ b/mesalib/src/mesa/main/texstate.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -29,7 +30,6 @@ */ #include "glheader.h" -#include "mfeatures.h" #include "bufferobj.h" #include "colormac.h" #include "colortab.h" diff --git a/mesalib/src/mesa/main/texstate.h b/mesalib/src/mesa/main/texstate.h index 7abf9101e..5c7fa8a31 100644 --- a/mesalib/src/mesa/main/texstate.h +++ b/mesalib/src/mesa/main/texstate.h @@ -22,9 +22,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/texstorage.c b/mesalib/src/mesa/main/texstorage.c index 6309b5716..0a53726fe 100644 --- a/mesalib/src/mesa/main/texstorage.c +++ b/mesalib/src/mesa/main/texstorage.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -34,7 +35,6 @@ #include "enums.h" #include "imports.h" #include "macros.h" -#include "mfeatures.h" #include "teximage.h" #include "texobj.h" #include "texstorage.h" @@ -245,6 +245,36 @@ _mesa_is_legal_tex_storage_format(struct gl_context *ctx, GLenum internalformat) } } +/** + * Default ctx->Driver.AllocTextureStorage() handler. + * + * The driver can override this with a more specific implementation if it + * desires, but this can be used to get the texture images allocated using the + * usual texture image handling code. The immutability of + * GL_ARB_texture_storage texture layouts is handled by texObj->Immutable + * checks at glTexImage* time. + */ +GLboolean +_mesa_alloc_texture_storage(struct gl_context *ctx, + struct gl_texture_object *texObj, + GLsizei levels, GLsizei width, + GLsizei height, GLsizei depth) +{ + const int numFaces = _mesa_num_tex_faces(texObj->Target); + int face; + int level; + + for (face = 0; face < numFaces; face++) { + for (level = 0; level < levels; level++) { + struct gl_texture_image *const texImage = texObj->Image[face][level]; + if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage)) + return GL_FALSE; + } + } + + return GL_TRUE; +} + /** * Do error checking for calls to glTexStorage1/2/3D(). diff --git a/mesalib/src/mesa/main/texstorage.h b/mesalib/src/mesa/main/texstorage.h index 9f172e1ca..ec4f71374 100644 --- a/mesalib/src/mesa/main/texstorage.h +++ b/mesalib/src/mesa/main/texstorage.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -60,5 +61,10 @@ _mesa_TextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, extern GLboolean _mesa_is_legal_tex_storage_format(struct gl_context *ctx, GLenum internalformat); +extern GLboolean +_mesa_alloc_texture_storage(struct gl_context *ctx, + struct gl_texture_object *texObj, + GLsizei levels, GLsizei width, + GLsizei height, GLsizei depth); #endif /* TEXSTORAGE_H */ diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index 0e13d8903..daa024c80 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* @@ -58,7 +59,6 @@ #include "image.h" #include "macros.h" #include "mipmap.h" -#include "mfeatures.h" #include "mtypes.h" #include "pack.h" #include "pbo.h" diff --git a/mesalib/src/mesa/main/texstore.h b/mesalib/src/mesa/main/texstore.h index 75f24bd45..f3d4a7d05 100644 --- a/mesalib/src/mesa/main/texstore.h +++ b/mesalib/src/mesa/main/texstore.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c index fd4718d87..03f188300 100644 --- a/mesalib/src/mesa/main/transformfeedback.c +++ b/mesalib/src/mesa/main/transformfeedback.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -35,7 +36,6 @@ #include "context.h" #include "hash.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "transformfeedback.h" #include "shaderapi.h" @@ -385,7 +385,9 @@ _mesa_BeginTransformFeedback(GLenum mode) } } - FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback; + obj->Active = GL_TRUE; ctx->TransformFeedback.Mode = mode; @@ -422,7 +424,9 @@ _mesa_EndTransformFeedback(void) return; } - FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback; + ctx->TransformFeedback.CurrentObject->Active = GL_FALSE; ctx->TransformFeedback.CurrentObject->Paused = GL_FALSE; ctx->TransformFeedback.CurrentObject->EndedAnytime = GL_TRUE; @@ -443,7 +447,7 @@ bind_buffer_range(struct gl_context *ctx, GLuint index, struct gl_transform_feedback_object *obj = ctx->TransformFeedback.CurrentObject; - /* Note: no need to FLUSH_VERTICES or flag _NEW_TRANSFORM_FEEDBACK, because + /* Note: no need to FLUSH_VERTICES or flag NewTransformFeedback, because * transform feedback buffers can't be changed while transform feedback is * active. */ @@ -687,7 +691,7 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count, shProg->TransformFeedback.BufferMode = bufferMode; - /* No need to set _NEW_TRANSFORM_FEEDBACK (or invoke FLUSH_VERTICES) since + /* No need to invoke FLUSH_VERTICES or flag NewTransformFeedback since * the varyings won't be used until shader link time. */ } @@ -898,7 +902,9 @@ _mesa_PauseTransformFeedback(void) return; } - FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback; + obj->Paused = GL_TRUE; assert(ctx->Driver.PauseTransformFeedback); @@ -924,7 +930,9 @@ _mesa_ResumeTransformFeedback(void) return; } - FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback; + obj->Paused = GL_FALSE; assert(ctx->Driver.ResumeTransformFeedback); diff --git a/mesalib/src/mesa/main/transformfeedback.h b/mesalib/src/mesa/main/transformfeedback.h index c128746b3..f6dc2a7b3 100644 --- a/mesalib/src/mesa/main/transformfeedback.h +++ b/mesalib/src/mesa/main/transformfeedback.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -28,7 +29,6 @@ #include <stdbool.h> #include "compiler.h" #include "glheader.h" -#include "mfeatures.h" #include "mtypes.h" struct _glapi_table; diff --git a/mesalib/src/mesa/main/uniform_query.cpp b/mesalib/src/mesa/main/uniform_query.cpp index b8335fe6b..ec3104936 100644 --- a/mesalib/src/mesa/main/uniform_query.cpp +++ b/mesalib/src/mesa/main/uniform_query.cpp @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include <stdlib.h> @@ -777,24 +778,24 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, if (uni->type->is_sampler()) { int i; - for (i = 0; i < count; i++) { - shProg->SamplerUnits[uni->sampler + offset + i] = - ((unsigned *) values)[i]; - } - bool flushed = false; for (i = 0; i < MESA_SHADER_TYPES; i++) { struct gl_shader *const sh = shProg->_LinkedShaders[i]; + int j; - /* If the shader stage doesn't use any samplers, don't bother - * checking if any samplers have changed. + /* If the shader stage doesn't use the sampler uniform, skip this. */ - if (sh == NULL || sh->active_samplers == 0) + if (sh == NULL || !uni->sampler[i].active) continue; + for (j = 0; j < count; j++) { + sh->SamplerUnits[uni->sampler[i].index + offset + j] = + ((unsigned *) values)[j]; + } + struct gl_program *const prog = sh->Program; - assert(sizeof(prog->SamplerUnits) == sizeof(shProg->SamplerUnits)); + assert(sizeof(prog->SamplerUnits) == sizeof(sh->SamplerUnits)); /* Determine if any of the samplers used by this shader stage have * been modified. @@ -802,7 +803,7 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, bool changed = false; for (unsigned j = 0; j < Elements(prog->SamplerUnits); j++) { if ((sh->active_samplers & (1U << j)) != 0 - && (prog->SamplerUnits[j] != shProg->SamplerUnits[j])) { + && (prog->SamplerUnits[j] != sh->SamplerUnits[j])) { changed = true; break; } @@ -815,8 +816,8 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, } memcpy(prog->SamplerUnits, - shProg->SamplerUnits, - sizeof(shProg->SamplerUnits)); + sh->SamplerUnits, + sizeof(sh->SamplerUnits)); _mesa_update_shader_textures_used(shProg, prog); if (ctx->Driver.SamplerUniformChange) diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c index d902407a0..6d79df683 100644 --- a/mesalib/src/mesa/main/uniforms.c +++ b/mesalib/src/mesa/main/uniforms.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -44,6 +45,7 @@ #include "main/enums.h" #include "ir_uniform.h" #include "glsl_types.h" +#include "program/program.h" /** * Update the vertex/fragment program's TexturesUsed array. @@ -65,14 +67,18 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg, struct gl_program *prog) { GLuint s; + struct gl_shader *shader = + shProg->_LinkedShaders[_mesa_program_target_to_index(prog->Target)]; - memcpy(prog->SamplerUnits, shProg->SamplerUnits, sizeof(prog->SamplerUnits)); + assert(shader); + + memcpy(prog->SamplerUnits, shader->SamplerUnits, sizeof(prog->SamplerUnits)); memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed)); for (s = 0; s < MAX_SAMPLERS; s++) { if (prog->SamplersUsed & (1 << s)) { - GLuint unit = shProg->SamplerUnits[s]; - GLuint tgt = shProg->SamplerTargets[s]; + GLuint unit = shader->SamplerUnits[s]; + GLuint tgt = shader->SamplerTargets[s]; assert(unit < Elements(prog->TexturesUsed)); assert(tgt < NUM_TEXTURE_TARGETS); prog->TexturesUsed[unit] |= (1 << tgt); @@ -630,7 +636,9 @@ _mesa_UniformBlockBinding(GLuint program, uniformBlockBinding) { int i; - FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT); + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer; + shProg->UniformBlocks[uniformBlockIndex].Binding = uniformBlockBinding; for (i = 0; i < MESA_SHADER_TYPES; i++) { diff --git a/mesalib/src/mesa/main/uniforms.h b/mesalib/src/mesa/main/uniforms.h index a12ad9b36..5ebd5e49a 100644 --- a/mesalib/src/mesa/main/uniforms.h +++ b/mesalib/src/mesa/main/uniforms.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index 213b845c9..db0945e30 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -33,7 +34,6 @@ #include "hash.h" #include "image.h" #include "macros.h" -#include "mfeatures.h" #include "mtypes.h" #include "varray.h" #include "arrayobj.h" @@ -269,7 +269,6 @@ update_array(struct gl_context *ctx, ctx->Array.ArrayBufferObj); ctx->NewState |= _NEW_ARRAY; - ctx->Array.ArrayObj->NewArrays |= VERT_BIT(attrib); } @@ -521,7 +520,6 @@ _mesa_EnableVertexAttribArray(GLuint index) FLUSH_VERTICES(ctx, _NEW_ARRAY); arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_TRUE; arrayObj->_Enabled |= VERT_BIT_GENERIC(index); - arrayObj->NewArrays |= VERT_BIT_GENERIC(index); } } @@ -547,7 +545,6 @@ _mesa_DisableVertexAttribArray(GLuint index) FLUSH_VERTICES(ctx, _NEW_ARRAY); arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_FALSE; arrayObj->_Enabled &= ~VERT_BIT_GENERIC(index); - arrayObj->NewArrays |= VERT_BIT_GENERIC(index); } } @@ -1112,10 +1109,9 @@ _mesa_PrimitiveRestartIndex(GLuint index) return; } - ctx->Array.RestartIndex = index; - if (ctx->Array.PrimitiveRestart && ctx->Array._RestartIndex != index) { + if (ctx->Array.RestartIndex != index) { FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Array._RestartIndex = index; + ctx->Array.RestartIndex = index; } } @@ -1148,11 +1144,34 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor) if (array->InstanceDivisor != divisor) { FLUSH_VERTICES(ctx, _NEW_ARRAY); array->InstanceDivisor = divisor; - ctx->Array.ArrayObj->NewArrays |= VERT_BIT(VERT_ATTRIB_GENERIC(index)); } } +unsigned +_mesa_primitive_restart_index(const struct gl_context *ctx, GLenum ib_type) +{ + /* From the OpenGL 4.3 core specification, page 302: + * "If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are + * enabled, the index value determined by PRIMITIVE_RESTART_FIXED_INDEX + * is used." + */ + if (ctx->Array.PrimitiveRestartFixedIndex) { + switch (ib_type) { + case GL_UNSIGNED_BYTE: + return 0xff; + case GL_UNSIGNED_SHORT: + return 0xffff; + case GL_UNSIGNED_INT: + return 0xffffffff; + default: + assert(!"_mesa_primitive_restart_index: Invalid index buffer type."); + } + } + + return ctx->Array.RestartIndex; +} + /** * Copy one client vertex array to another. diff --git a/mesalib/src/mesa/main/varray.h b/mesalib/src/mesa/main/varray.h index 904fa1bea..a178bc13c 100644 --- a/mesalib/src/mesa/main/varray.h +++ b/mesalib/src/mesa/main/varray.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,7 +30,6 @@ #include "glheader.h" -#include "mfeatures.h" struct gl_client_array; struct gl_context; @@ -248,6 +248,8 @@ _mesa_PrimitiveRestartIndex(GLuint index); extern void GLAPIENTRY _mesa_VertexAttribDivisor(GLuint index, GLuint divisor); +extern unsigned +_mesa_primitive_restart_index(const struct gl_context *ctx, GLenum ib_type); extern void _mesa_copy_client_array(struct gl_context *ctx, diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c index ecca446c1..cdd5ed316 100644 --- a/mesalib/src/mesa/main/version.c +++ b/mesalib/src/mesa/main/version.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -259,7 +260,7 @@ compute_version(struct gl_context *ctx) ctx->Extensions.EXT_texture_snorm && ctx->Extensions.NV_primitive_restart && ctx->Extensions.NV_texture_rectangle && - ctx->Const.MaxVertexTextureImageUnits >= 16); + ctx->Const.VertexProgram.MaxTextureImageUnits >= 16); const GLboolean ver_3_2 = (ver_3_1 && ctx->Const.GLSLVersion >= 150 && ctx->Extensions.ARB_depth_clamp && diff --git a/mesalib/src/mesa/main/version.h b/mesalib/src/mesa/main/version.h index b4f8d8590..19d321d9a 100644 --- a/mesalib/src/mesa/main/version.h +++ b/mesalib/src/mesa/main/version.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/viewport.c b/mesalib/src/mesa/main/viewport.c index 92f04cdf1..c4d7f1e07 100644 --- a/mesalib/src/mesa/main/viewport.c +++ b/mesalib/src/mesa/main/viewport.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/viewport.h b/mesalib/src/mesa/main/viewport.h index db4507bea..77d8cbbfd 100644 --- a/mesalib/src/mesa/main/viewport.h +++ b/mesalib/src/mesa/main/viewport.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/main/vtxfmt.c b/mesalib/src/mesa/main/vtxfmt.c index 8669c4007..8864b8cf5 100644 --- a/mesalib/src/mesa/main/vtxfmt.c +++ b/mesalib/src/mesa/main/vtxfmt.c @@ -17,20 +17,19 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: - * Keith Whitwell <keith@tungstengraphics.com> - * Gareth Hughes + * Keith Whitwell <keith@tungstengraphics.com> Gareth Hughes */ #include "glheader.h" #include "api_arrayelt.h" #include "context.h" #include "imports.h" -#include "mfeatures.h" #include "mtypes.h" #include "vtxfmt.h" #include "eval.h" @@ -40,12 +39,12 @@ /** - * Use the per-vertex functions found in <vfmt> to initialize the given - * API dispatch table. + * Copy the functions found in the GLvertexformat object into the + * dispatch table. */ static void install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, - const GLvertexformat *vfmt, bool beginend) + const GLvertexformat *vfmt) { assert(ctx->Version > 0); @@ -62,7 +61,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, } if (ctx->API == API_OPENGL_COMPAT) { - _mesa_install_eval_vtxfmt(tab, vfmt, beginend); + _mesa_install_eval_vtxfmt(tab, vfmt); } if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { @@ -111,40 +110,6 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_Begin(tab, vfmt->Begin); SET_End(tab, vfmt->End); SET_PrimitiveRestartNV(tab, vfmt->PrimitiveRestartNV); - - SET_Rectf(tab, vfmt->Rectf); - } - - SET_DrawArrays(tab, vfmt->DrawArrays); - SET_DrawElements(tab, vfmt->DrawElements); - if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) { - SET_DrawRangeElements(tab, vfmt->DrawRangeElements); - } - - SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT); - - if (_mesa_is_desktop_gl(ctx)) { - SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); - SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); - SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); - SET_DrawArraysInstancedBaseInstance(tab, vfmt->DrawArraysInstancedBaseInstance); - SET_DrawElementsInstancedBaseInstance(tab, vfmt->DrawElementsInstancedBaseInstance); - SET_DrawElementsInstancedBaseVertex(tab, vfmt->DrawElementsInstancedBaseVertex); - SET_DrawElementsInstancedBaseVertexBaseInstance(tab, vfmt->DrawElementsInstancedBaseVertexBaseInstance); - } - - if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) { - SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced); - SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced); - } - - if (_mesa_is_desktop_gl(ctx)) { - SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback); - SET_DrawTransformFeedbackStream(tab, vfmt->DrawTransformFeedbackStream); - SET_DrawTransformFeedbackInstanced(tab, - vfmt->DrawTransformFeedbackInstanced); - SET_DrawTransformFeedbackStreamInstanced(tab, - vfmt->DrawTransformFeedbackStreamInstanced); } /* Originally for GL_NV_vertex_program, this is also used by dlist.c */ @@ -251,9 +216,9 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, void _mesa_install_exec_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt) { - install_vtxfmt(ctx, ctx->Exec, vfmt, false); + install_vtxfmt(ctx, ctx->Exec, vfmt); if (ctx->BeginEnd) - install_vtxfmt(ctx, ctx->BeginEnd, vfmt, true); + install_vtxfmt(ctx, ctx->BeginEnd, vfmt); } @@ -265,7 +230,7 @@ void _mesa_install_save_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt) { if (_mesa_is_desktop_gl(ctx)) - install_vtxfmt(ctx, ctx->Save, vfmt, false); + install_vtxfmt(ctx, ctx->Save, vfmt); } diff --git a/mesalib/src/mesa/main/vtxfmt.h b/mesalib/src/mesa/main/vtxfmt.h index 16ffb6ffd..4301c4277 100644 --- a/mesalib/src/mesa/main/vtxfmt.h +++ b/mesalib/src/mesa/main/vtxfmt.h @@ -24,9 +24,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -34,7 +35,6 @@ #define _VTXFMT_H_ #include "compiler.h" -#include "mfeatures.h" #include "mtypes.h" extern void _mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt ); diff --git a/mesalib/src/mesa/math/m_clip_tmp.h b/mesalib/src/mesa/math/m_clip_tmp.h index 2e3096405..c6b8bd83d 100644 --- a/mesalib/src/mesa/math/m_clip_tmp.h +++ b/mesalib/src/mesa/math/m_clip_tmp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/math/m_copy_tmp.h b/mesalib/src/mesa/math/m_copy_tmp.h index 07ab1f7b2..98fbd0730 100644 --- a/mesalib/src/mesa/math/m_copy_tmp.h +++ b/mesalib/src/mesa/math/m_copy_tmp.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/math/m_debug.h b/mesalib/src/mesa/math/m_debug.h index 6476b6de2..a1e8cee9d 100644 --- a/mesalib/src/mesa/math/m_debug.h +++ b/mesalib/src/mesa/math/m_debug.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Gareth Hughes diff --git a/mesalib/src/mesa/math/m_debug_clip.c b/mesalib/src/mesa/math/m_debug_clip.c index bbad6ef02..08b9eff06 100644 --- a/mesalib/src/mesa/math/m_debug_clip.c +++ b/mesalib/src/mesa/math/m_debug_clip.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Gareth Hughes diff --git a/mesalib/src/mesa/math/m_debug_norm.c b/mesalib/src/mesa/math/m_debug_norm.c index 00efa336d..588cd90a3 100644 --- a/mesalib/src/mesa/math/m_debug_norm.c +++ b/mesalib/src/mesa/math/m_debug_norm.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Gareth Hughes diff --git a/mesalib/src/mesa/math/m_debug_util.h b/mesalib/src/mesa/math/m_debug_util.h index ed11c849e..f356588ae 100644 --- a/mesalib/src/mesa/math/m_debug_util.h +++ b/mesalib/src/mesa/math/m_debug_util.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Gareth Hughes diff --git a/mesalib/src/mesa/math/m_debug_xform.c b/mesalib/src/mesa/math/m_debug_xform.c index 2cceaa2f8..cea382da6 100644 --- a/mesalib/src/mesa/math/m_debug_xform.c +++ b/mesalib/src/mesa/math/m_debug_xform.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/math/m_dotprod_tmp.h b/mesalib/src/mesa/math/m_dotprod_tmp.h index 03e65af6c..6f530cfc4 100644 --- a/mesalib/src/mesa/math/m_dotprod_tmp.h +++ b/mesalib/src/mesa/math/m_dotprod_tmp.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/math/m_eval.c b/mesalib/src/mesa/math/m_eval.c index d324673c5..7e8a81d13 100644 --- a/mesalib/src/mesa/math/m_eval.c +++ b/mesalib/src/mesa/math/m_eval.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/math/m_eval.h b/mesalib/src/mesa/math/m_eval.h index d73ecaafb..cc1d1894c 100644 --- a/mesalib/src/mesa/math/m_eval.h +++ b/mesalib/src/mesa/math/m_eval.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _M_EVAL_H diff --git a/mesalib/src/mesa/math/m_matrix.c b/mesalib/src/mesa/math/m_matrix.c index bcd2cae4a..4f64bd226 100644 --- a/mesalib/src/mesa/math/m_matrix.c +++ b/mesalib/src/mesa/math/m_matrix.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/math/m_matrix.h b/mesalib/src/mesa/math/m_matrix.h index 9f4ea2586..fabe15a94 100644 --- a/mesalib/src/mesa/math/m_matrix.h +++ b/mesalib/src/mesa/math/m_matrix.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/math/m_norm_tmp.h b/mesalib/src/mesa/math/m_norm_tmp.h index a20cb0501..24839e2b5 100644 --- a/mesalib/src/mesa/math/m_norm_tmp.h +++ b/mesalib/src/mesa/math/m_norm_tmp.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/math/m_trans_tmp.h b/mesalib/src/mesa/math/m_trans_tmp.h index 76ed83209..867384b78 100644 --- a/mesalib/src/mesa/math/m_trans_tmp.h +++ b/mesalib/src/mesa/math/m_trans_tmp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/math/m_translate.c b/mesalib/src/mesa/math/m_translate.c index 1da4de372..40c817463 100644 --- a/mesalib/src/mesa/math/m_translate.c +++ b/mesalib/src/mesa/math/m_translate.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/math/m_translate.h b/mesalib/src/mesa/math/m_translate.h index 8fec6f14b..eeb947f29 100644 --- a/mesalib/src/mesa/math/m_translate.h +++ b/mesalib/src/mesa/math/m_translate.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/math/m_vector.c b/mesalib/src/mesa/math/m_vector.c index 4bded31e0..0d38117e9 100644 --- a/mesalib/src/mesa/math/m_vector.c +++ b/mesalib/src/mesa/math/m_vector.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/math/m_vector.h b/mesalib/src/mesa/math/m_vector.h index 71281d575..143a30282 100644 --- a/mesalib/src/mesa/math/m_vector.h +++ b/mesalib/src/mesa/math/m_vector.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/math/m_xform.c b/mesalib/src/mesa/math/m_xform.c index 61ad3c753..f8c0993d4 100644 --- a/mesalib/src/mesa/math/m_xform.c +++ b/mesalib/src/mesa/math/m_xform.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/math/m_xform.h b/mesalib/src/mesa/math/m_xform.h index 280248883..7cec7f0ad 100644 --- a/mesalib/src/mesa/math/m_xform.h +++ b/mesalib/src/mesa/math/m_xform.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/math/m_xform_tmp.h b/mesalib/src/mesa/math/m_xform_tmp.h index e93837725..1f984887d 100644 --- a/mesalib/src/mesa/math/m_xform_tmp.h +++ b/mesalib/src/mesa/math/m_xform_tmp.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/program/Android.mk b/mesalib/src/mesa/program/Android.mk index 51362e0eb..3f974ea27 100644 --- a/mesalib/src/mesa/program/Android.mk +++ b/mesalib/src/mesa/program/Android.mk @@ -38,7 +38,7 @@ endef # Import the following variables: # PROGRAM_FILES -include $(MESA_TOP)/src/mesa/sources.mak +include $(MESA_TOP)/src/mesa/Makefile.sources include $(CLEAR_VARS) @@ -49,7 +49,7 @@ intermediates := $(call local-intermediates-dir) MESA_ENABLED_APIS := ES1 ES2 -# TODO(chadv): In sources.mak, move these vars to a different list so we can +# TODO(chadv): In Makefile.sources, move these vars to a different list so we can # remove this kludge. generated_sources_basenames := \ lex.yy.c \ diff --git a/mesalib/src/mesa/program/Makefile.am b/mesalib/src/mesa/program/Makefile.am index 1b8204658..ab565e251 100644 --- a/mesalib/src/mesa/program/Makefile.am +++ b/mesalib/src/mesa/program/Makefile.am @@ -19,9 +19,9 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -include ../sources.mak +include ../Makefile.sources -AM_CPPFLAGS = $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS) +AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS) AM_CFLAGS = $(VISIBILITY_CFLAGS) AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS) libdricore_program_la_CFLAGS = $(NOVISIBILITY_CFLAGS) diff --git a/mesalib/src/mesa/program/arbprogparse.c b/mesalib/src/mesa/program/arbprogparse.c index 527bb936e..0ec87e356 100644 --- a/mesalib/src/mesa/program/arbprogparse.c +++ b/mesalib/src/mesa/program/arbprogparse.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #define DEBUG_PARSING 0 diff --git a/mesalib/src/mesa/program/arbprogparse.h b/mesalib/src/mesa/program/arbprogparse.h index 4c0c30072..04d304bc0 100644 --- a/mesalib/src/mesa/program/arbprogparse.h +++ b/mesalib/src/mesa/program/arbprogparse.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index 14cf5baa7..a5b6699c2 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -1444,6 +1444,10 @@ ir_to_mesa_visitor::visit(ir_expression *ir) case ir_unop_unpack_half_2x16_split_x: case ir_unop_unpack_half_2x16_split_y: case ir_binop_pack_half_2x16_split: + case ir_unop_bitfield_reverse: + case ir_unop_bit_count: + case ir_unop_find_msb: + case ir_unop_find_lsb: assert(!"not supported"); break; case ir_binop_min: @@ -1485,6 +1489,15 @@ ir_to_mesa_visitor::visit(ir_expression *ir) emit(ir, OPCODE_LRP, result_dst, op[2], op[1], op[0]); break; + case ir_binop_vector_extract: + case ir_binop_bfm: + case ir_triop_bfi: + case ir_triop_bitfield_extract: + case ir_triop_vector_insert: + case ir_quadop_bitfield_insert: + assert(!"not supported"); + break; + case ir_quadop_vector: /* This operation should have already been handled. */ @@ -2391,8 +2404,10 @@ print_program(struct prog_instruction *mesa_instructions, class add_uniform_to_shader : public program_resource_visitor { public: add_uniform_to_shader(struct gl_shader_program *shader_program, - struct gl_program_parameter_list *params) - : shader_program(shader_program), params(params), idx(-1) + struct gl_program_parameter_list *params, + gl_shader_type shader_type) + : shader_program(shader_program), params(params), idx(-1), + shader_type(shader_type) { /* empty */ } @@ -2412,6 +2427,7 @@ private: struct gl_shader_program *shader_program; struct gl_program_parameter_list *params; int idx; + gl_shader_type shader_type; }; void @@ -2458,8 +2474,11 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name, struct gl_uniform_storage *storage = &this->shader_program->UniformStorage[location]; + assert(storage->sampler[shader_type].active); + for (unsigned int j = 0; j < size / 4; j++) - params->ParameterValues[index + j][0].f = storage->sampler + j; + params->ParameterValues[index + j][0].f = + storage->sampler[shader_type].index + j; } } @@ -2485,7 +2504,8 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program struct gl_program_parameter_list *params) { - add_uniform_to_shader add(shader_program, params); + add_uniform_to_shader add(shader_program, params, + _mesa_shader_type_to_index(sh->Type)); foreach_list(node, sh->ir) { ir_variable *var = ((ir_instruction *) node)->as_variable(); @@ -2757,6 +2777,8 @@ ir_to_mesa_visitor::copy_propagate(void) /* If this is a copy, add it to the ACP. */ if (inst->op == OPCODE_MOV && inst->dst.file == PROGRAM_TEMPORARY && + !(inst->dst.file == inst->src[0].file && + inst->dst.index == inst->src[0].index) && !inst->dst.reladdr && !inst->saturate && !inst->src[0].reladdr && @@ -3012,7 +3034,8 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress; progress = do_common_optimization(ir, true, true, - options->MaxUnrollIterations) + options->MaxUnrollIterations, + options) || progress; progress = lower_quadop_vector(ir, true) || progress; @@ -3039,6 +3062,7 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) || progress; progress = do_vec_index_to_cond_assign(ir) || progress; + progress = lower_vector_insert(ir, true) || progress; } while (progress); validate_ir_tree(ir); @@ -3118,11 +3142,13 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader) if (!state->error && !shader->ir->is_empty()) { validate_ir_tree(shader->ir); + struct gl_shader_compiler_options *options = + &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)]; /* Do some optimization at compile time to reduce shader IR size * and reduce later work if the same shader is linked multiple times */ - while (do_common_optimization(shader->ir, false, false, 32)) + while (do_common_optimization(shader->ir, false, false, 32, options)) ; validate_ir_tree(shader->ir); diff --git a/mesalib/src/mesa/program/prog_execute.c b/mesalib/src/mesa/program/prog_execute.c index d205cdbbe..548077d39 100644 --- a/mesalib/src/mesa/program/prog_execute.c +++ b/mesalib/src/mesa/program/prog_execute.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -240,37 +241,6 @@ fetch_vector4(const struct prog_src_register *source, /** - * Fetch a 4-element uint vector from the given source register. - * Apply swizzling but not negation/abs. - */ -static void -fetch_vector4ui(const struct prog_src_register *source, - const struct gl_program_machine *machine, GLuint result[4]) -{ - const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); - ASSERT(src); - - if (source->Swizzle == SWIZZLE_NOOP) { - /* no swizzling */ - COPY_4V(result, src); - } - else { - ASSERT(GET_SWZ(source->Swizzle, 0) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 1) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 2) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 3) <= 3); - result[0] = src[GET_SWZ(source->Swizzle, 0)]; - result[1] = src[GET_SWZ(source->Swizzle, 1)]; - result[2] = src[GET_SWZ(source->Swizzle, 2)]; - result[3] = src[GET_SWZ(source->Swizzle, 3)]; - } - - /* Note: no Negate or Abs here */ -} - - - -/** * Fetch the derivative with respect to X or Y for the given register. * XXX this currently only works for fragment program input attribs. */ @@ -666,18 +636,6 @@ _mesa_execute_program(struct gl_context * ctx, } } break; - case OPCODE_AND: /* bitwise AND */ - { - GLuint a[4], b[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - fetch_vector4ui(&inst->SrcReg[1], machine, b); - result[0] = a[0] & b[0]; - result[1] = a[1] & b[1]; - result[2] = a[2] & b[2]; - result[3] = a[3] & b[3]; - store_vector4ui(inst, machine, result); - } - break; case OPCODE_ARL: { GLfloat t[4]; @@ -790,20 +748,6 @@ _mesa_execute_program(struct gl_context * ctx, } } break; - case OPCODE_DP2A: - { - GLfloat a[4], b[4], c, result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - fetch_vector1(&inst->SrcReg[1], machine, &c); - result[0] = result[1] = result[2] = result[3] = DOT2(a, b) + c; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("DP2A %g = (%g %g) . (%g %g) + %g\n", - result[0], a[0], a[1], b[0], b[1], c); - } - } - break; case OPCODE_DP3: { GLfloat a[4], b[4], result[4]; @@ -1193,59 +1137,6 @@ _mesa_execute_program(struct gl_context * ctx, break; case OPCODE_NOP: break; - case OPCODE_NOT: /* bitwise NOT */ - { - GLuint a[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - result[0] = ~a[0]; - result[1] = ~a[1]; - result[2] = ~a[2]; - result[3] = ~a[3]; - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_NRM3: /* 3-component normalization */ - { - GLfloat a[4], result[4]; - GLfloat tmp; - fetch_vector4(&inst->SrcReg[0], machine, a); - tmp = a[0] * a[0] + a[1] * a[1] + a[2] * a[2]; - if (tmp != 0.0F) - tmp = INV_SQRTF(tmp); - result[0] = tmp * a[0]; - result[1] = tmp * a[1]; - result[2] = tmp * a[2]; - result[3] = 0.0; /* undefined, but prevent valgrind warnings */ - store_vector4(inst, machine, result); - } - break; - case OPCODE_NRM4: /* 4-component normalization */ - { - GLfloat a[4], result[4]; - GLfloat tmp; - fetch_vector4(&inst->SrcReg[0], machine, a); - tmp = a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]; - if (tmp != 0.0F) - tmp = INV_SQRTF(tmp); - result[0] = tmp * a[0]; - result[1] = tmp * a[1]; - result[2] = tmp * a[2]; - result[3] = tmp * a[3]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_OR: /* bitwise OR */ - { - GLuint a[4], b[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - fetch_vector4ui(&inst->SrcReg[1], machine, b); - result[0] = a[0] | b[0]; - result[1] = a[1] | b[1]; - result[2] = a[2] | b[2]; - result[3] = a[3] | b[3]; - store_vector4ui(inst, machine, result); - } - break; case OPCODE_PK2H: /* pack two 16-bit floats in one 32-bit float */ { GLfloat a[4]; @@ -1747,18 +1638,6 @@ _mesa_execute_program(struct gl_context * ctx, store_vector4(inst, machine, result); } break; - case OPCODE_XOR: /* bitwise XOR */ - { - GLuint a[4], b[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - fetch_vector4ui(&inst->SrcReg[1], machine, b); - result[0] = a[0] ^ b[0]; - result[1] = a[1] ^ b[1]; - result[2] = a[2] ^ b[2]; - result[3] = a[3] ^ b[3]; - store_vector4ui(inst, machine, result); - } - break; case OPCODE_XPD: /* cross product */ { GLfloat a[4], b[4], result[4]; @@ -1789,19 +1668,6 @@ _mesa_execute_program(struct gl_context * ctx, store_vector4(inst, machine, result); } break; - case OPCODE_PRINT: - { - if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - GLfloat a[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, - a[0], a[1], a[2], a[3]); - } - else { - printf("%s\n", (const char *) inst->Data); - } - } - break; case OPCODE_END: return GL_TRUE; default: diff --git a/mesalib/src/mesa/program/prog_execute.h b/mesalib/src/mesa/program/prog_execute.h index 1ae302c32..346b7b6b3 100644 --- a/mesalib/src/mesa/program/prog_execute.h +++ b/mesalib/src/mesa/program/prog_execute.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef PROG_EXECUTE_H diff --git a/mesalib/src/mesa/program/prog_instruction.c b/mesalib/src/mesa/program/prog_instruction.c index ab93932ef..4329e6544 100644 --- a/mesalib/src/mesa/program/prog_instruction.c +++ b/mesalib/src/mesa/program/prog_instruction.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -127,7 +128,6 @@ _mesa_free_instructions(struct prog_instruction *inst, GLuint count) { GLuint i; for (i = 0; i < count; i++) { - free(inst[i].Data); free((char *)inst[i].Comment); } free(inst); @@ -153,7 +153,6 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = { { OPCODE_NOP, "NOP", 0, 0 }, { OPCODE_ABS, "ABS", 1, 1 }, { OPCODE_ADD, "ADD", 2, 1 }, - { OPCODE_AND, "AND", 2, 1 }, { OPCODE_ARL, "ARL", 1, 1 }, { OPCODE_BGNLOOP,"BGNLOOP", 0, 0 }, { OPCODE_BGNSUB, "BGNSUB", 0, 0 }, @@ -165,7 +164,6 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = { { OPCODE_DDX, "DDX", 1, 1 }, { OPCODE_DDY, "DDY", 1, 1 }, { OPCODE_DP2, "DP2", 2, 1 }, - { OPCODE_DP2A, "DP2A", 3, 1 }, { OPCODE_DP3, "DP3", 2, 1 }, { OPCODE_DP4, "DP4", 2, 1 }, { OPCODE_DPH, "DPH", 2, 1 }, @@ -195,16 +193,11 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = { { OPCODE_NOISE2, "NOISE2", 1, 1 }, { OPCODE_NOISE3, "NOISE3", 1, 1 }, { OPCODE_NOISE4, "NOISE4", 1, 1 }, - { OPCODE_NOT, "NOT", 1, 1 }, - { OPCODE_NRM3, "NRM3", 1, 1 }, - { OPCODE_NRM4, "NRM4", 1, 1 }, - { OPCODE_OR, "OR", 2, 1 }, { OPCODE_PK2H, "PK2H", 1, 1 }, { OPCODE_PK2US, "PK2US", 1, 1 }, { OPCODE_PK4B, "PK4B", 1, 1 }, { OPCODE_PK4UB, "PK4UB", 1, 1 }, { OPCODE_POW, "POW", 2, 1 }, - { OPCODE_PRINT, "PRINT", 1, 0 }, { OPCODE_RCP, "RCP", 1, 1 }, { OPCODE_RET, "RET", 0, 0 }, { OPCODE_RFL, "RFL", 1, 1 }, @@ -234,7 +227,6 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = { { OPCODE_UP4B, "UP4B", 1, 1 }, { OPCODE_UP4UB, "UP4UB", 1, 1 }, { OPCODE_X2D, "X2D", 3, 1 }, - { OPCODE_XOR, "XOR", 2, 1 }, { OPCODE_XPD, "XPD", 2, 1 } }; diff --git a/mesalib/src/mesa/program/prog_instruction.h b/mesalib/src/mesa/program/prog_instruction.h index a7bba75f1..160b1d079 100644 --- a/mesalib/src/mesa/program/prog_instruction.h +++ b/mesalib/src/mesa/program/prog_instruction.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -147,7 +148,6 @@ typedef enum prog_opcode { OPCODE_NOP = 0, /* X */ OPCODE_ABS, /* X X 1.1 X */ OPCODE_ADD, /* X X X X X */ - OPCODE_AND, /* */ OPCODE_ARL, /* X X X */ OPCODE_BGNLOOP, /* opt */ OPCODE_BGNSUB, /* opt */ @@ -159,7 +159,6 @@ typedef enum prog_opcode { OPCODE_DDX, /* X X */ OPCODE_DDY, /* X X */ OPCODE_DP2, /* 2 X */ - OPCODE_DP2A, /* 2 */ OPCODE_DP3, /* X X X X X */ OPCODE_DP4, /* X X X X X */ OPCODE_DPH, /* X X 1.1 */ @@ -189,16 +188,11 @@ typedef enum prog_opcode { OPCODE_NOISE2, /* X */ OPCODE_NOISE3, /* X */ OPCODE_NOISE4, /* X */ - OPCODE_NOT, /* */ - OPCODE_NRM3, /* */ - OPCODE_NRM4, /* */ - OPCODE_OR, /* */ OPCODE_PK2H, /* X */ OPCODE_PK2US, /* X */ OPCODE_PK4B, /* X */ OPCODE_PK4UB, /* X */ OPCODE_POW, /* X X X X */ - OPCODE_PRINT, /* X X */ OPCODE_RCP, /* X X X X X */ OPCODE_RET, /* 2 2 opt */ OPCODE_RFL, /* X */ @@ -228,7 +222,6 @@ typedef enum prog_opcode { OPCODE_UP4B, /* X */ OPCODE_UP4UB, /* X */ OPCODE_X2D, /* X */ - OPCODE_XOR, /* */ OPCODE_XPD, /* X X */ MAX_OPCODE } gl_inst_opcode; @@ -389,9 +382,6 @@ struct prog_instruction /** for debugging purposes */ const char *Comment; - /** Arbitrary data. Used for OPCODE_PRINT and some drivers */ - void *Data; - /** for driver use (try to remove someday) */ GLint Aux; }; diff --git a/mesalib/src/mesa/program/prog_noise.c b/mesalib/src/mesa/program/prog_noise.c index 75cd8c659..63590c60c 100644 --- a/mesalib/src/mesa/program/prog_noise.c +++ b/mesalib/src/mesa/program/prog_noise.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/program/prog_noise.h b/mesalib/src/mesa/program/prog_noise.h index dd7986efc..9828343a6 100644 --- a/mesalib/src/mesa/program/prog_noise.h +++ b/mesalib/src/mesa/program/prog_noise.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef PROG_NOISE diff --git a/mesalib/src/mesa/program/prog_opt_constant_fold.c b/mesalib/src/mesa/program/prog_opt_constant_fold.c index e2418b554..3811c0d8a 100644 --- a/mesalib/src/mesa/program/prog_opt_constant_fold.c +++ b/mesalib/src/mesa/program/prog_opt_constant_fold.c @@ -204,10 +204,6 @@ _mesa_constant_fold(struct gl_program *prog) get_value(prog, &inst->SrcReg[0], a); get_value(prog, &inst->SrcReg[1], b); - /* It seems like a loop could be used here, but we cleverly put - * DP2A between DP2 and DP3. Subtracting DP2 (or similar) from - * the opcode results in various failures of the loop control. - */ result = (a[0] * b[0]) + (a[1] * b[1]); if (inst->Opcode >= OPCODE_DP3) diff --git a/mesalib/src/mesa/program/prog_parameter.c b/mesalib/src/mesa/program/prog_parameter.c index 8713d57b5..0b134f7da 100644 --- a/mesalib/src/mesa/program/prog_parameter.c +++ b/mesalib/src/mesa/program/prog_parameter.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/program/prog_parameter.h b/mesalib/src/mesa/program/prog_parameter.h index 7b6b4b80e..bb2aa973b 100644 --- a/mesalib/src/mesa/program/prog_parameter.h +++ b/mesalib/src/mesa/program/prog_parameter.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/program/prog_print.c b/mesalib/src/mesa/program/prog_print.c index c73f10df5..c8351e3b5 100644 --- a/mesalib/src/mesa/program/prog_print.c +++ b/mesalib/src/mesa/program/prog_print.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -663,20 +664,6 @@ _mesa_fprint_instruction_opt(FILE *f, } switch (inst->Opcode) { - case OPCODE_PRINT: - fprintf(f, "PRINT '%s'", (char *) inst->Data); - if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - fprintf(f, ", "); - fprintf(f, "%s[%d]%s", - _mesa_register_file_name((gl_register_file) inst->SrcReg[0].File), - inst->SrcReg[0].Index, - _mesa_swizzle_string(inst->SrcReg[0].Swizzle, - inst->SrcReg[0].Negate, GL_FALSE)); - } - if (inst->Comment) - fprintf(f, " # %s", inst->Comment); - fprint_comment(f, inst); - break; case OPCODE_SWZ: fprintf(f, "SWZ"); if (inst->SaturateMode == SATURATE_ZERO_ONE) diff --git a/mesalib/src/mesa/program/prog_print.h b/mesalib/src/mesa/program/prog_print.h index 3e400eb46..82195cbbc 100644 --- a/mesalib/src/mesa/program/prog_print.h +++ b/mesalib/src/mesa/program/prog_print.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/program/prog_statevars.c b/mesalib/src/mesa/program/prog_statevars.c index 09d2a568a..19a948237 100644 --- a/mesalib/src/mesa/program/prog_statevars.c +++ b/mesalib/src/mesa/program/prog_statevars.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/program/prog_statevars.h b/mesalib/src/mesa/program/prog_statevars.h index af2c89792..e26ded9e0 100644 --- a/mesalib/src/mesa/program/prog_statevars.h +++ b/mesalib/src/mesa/program/prog_statevars.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef PROG_STATEVARS_H diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c index 2ef969ff7..37bb7b7eb 100644 --- a/mesalib/src/mesa/program/program.c +++ b/mesalib/src/mesa/program/program.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -32,7 +33,6 @@ #include "main/glheader.h" #include "main/context.h" #include "main/hash.h" -#include "main/mfeatures.h" #include "program.h" #include "prog_cache.h" #include "prog_parameter.h" diff --git a/mesalib/src/mesa/program/program.h b/mesalib/src/mesa/program/program.h index c5650c519..8f88b3913 100644 --- a/mesalib/src/mesa/program/program.h +++ b/mesalib/src/mesa/program/program.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/program/program_parse.y b/mesalib/src/mesa/program/program_parse.y index 81d85f9fb..cbf3fe6ca 100644 --- a/mesalib/src/mesa/program/program_parse.y +++ b/mesalib/src/mesa/program/program_parse.y @@ -709,6 +709,7 @@ extSwizSel: INTEGER } $$.swz = ($1 == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; + $$.negate = 0; /* 0 and 1 are valid for both RGBA swizzle names and XYZW * swizzle names. @@ -728,6 +729,10 @@ extSwizSel: INTEGER s = $1[0]; free($1); + $$.rgba_valid = 0; + $$.xyzw_valid = 0; + $$.negate = 0; + switch (s) { case 'x': $$.swz = SWIZZLE_X; @@ -2709,7 +2714,7 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st ? & ctx->Const.VertexProgram : & ctx->Const.FragmentProgram; - state->MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits; + state->MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits; state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits; state->MaxTextureUnits = ctx->Const.MaxTextureUnits; state->MaxClipPlanes = ctx->Const.MaxClipPlanes; diff --git a/mesalib/src/mesa/program/program_parse_extra.c b/mesalib/src/mesa/program/program_parse_extra.c index 4d928483e..e8e1912eb 100644 --- a/mesalib/src/mesa/program/program_parse_extra.c +++ b/mesalib/src/mesa/program/program_parse_extra.c @@ -194,15 +194,21 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) } else if (strncmp(option, "precision_hint_", 15) == 0) { option += 15; - if (state->option.PrecisionHint == OPTION_NONE) { - if (strcmp(option, "nicest") == 0) { - state->option.PrecisionHint = OPTION_NICEST; - return 1; - } else if (strcmp(option, "fastest") == 0) { - state->option.PrecisionHint = OPTION_FASTEST; - return 1; - } - } + /* The ARB_fragment_program spec, 3.11.4.5.2 says: + * + * "Only one precision control option may be specified by any given + * fragment program. A fragment program that specifies both the + * "ARB_precision_hint_fastest" and "ARB_precision_hint_nicest" + * program options will fail to load. + */ + + if (strcmp(option, "nicest") == 0 && state->option.PrecisionHint != OPTION_FASTEST) { + state->option.PrecisionHint = OPTION_NICEST; + return 1; + } else if (strcmp(option, "fastest") == 0 && state->option.PrecisionHint != OPTION_NICEST) { + state->option.PrecisionHint = OPTION_FASTEST; + return 1; + } return 0; } else if (strcmp(option, "draw_buffers") == 0) { diff --git a/mesalib/src/mesa/program/programopt.c b/mesalib/src/mesa/program/programopt.c index d40ffd543..6a62e1f58 100644 --- a/mesalib/src/mesa/program/programopt.c +++ b/mesalib/src/mesa/program/programopt.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -218,7 +219,7 @@ _mesa_insert_mvp_mad_code(struct gl_context *ctx, struct gl_vertex_program *vpro void _mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog) { - if (ctx->mvp_with_dp4) + if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4) _mesa_insert_mvp_dp4_code( ctx, vprog ); else _mesa_insert_mvp_mad_code( ctx, vprog ); diff --git a/mesalib/src/mesa/program/programopt.h b/mesalib/src/mesa/program/programopt.h index b9205823c..3a274417f 100644 --- a/mesalib/src/mesa/program/programopt.h +++ b/mesalib/src/mesa/program/programopt.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/program/register_allocate.c b/mesalib/src/mesa/program/register_allocate.c index 2c826fc66..16739fd39 100644 --- a/mesalib/src/mesa/program/register_allocate.c +++ b/mesalib/src/mesa/program/register_allocate.c @@ -355,7 +355,7 @@ ra_alloc_interference_graph(struct ra_regs *regs, unsigned int count) g->stack = rzalloc_array(g, unsigned int, count); for (i = 0; i < count; i++) { - int bitset_count = ALIGN(count, BITSET_WORDBITS) / BITSET_WORDBITS; + int bitset_count = BITSET_WORDS(count); g->nodes[i].adjacency = rzalloc_array(g, BITSET_WORD, bitset_count); g->nodes[i].adjacency_list_size = 4; @@ -437,7 +437,7 @@ ra_simplify(struct ra_graph *g) } for (i = 0; i < g->count; i++) { - if (!g->nodes[i].in_stack) + if (!g->nodes[i].in_stack && g->nodes[i].reg == -1) return GL_FALSE; } @@ -586,7 +586,7 @@ int ra_get_best_spill_node(struct ra_graph *g) { unsigned int best_node = -1; - unsigned int best_benefit = 0.0; + float best_benefit = 0.0; unsigned int n; for (n = 0; n < g->count; n++) { diff --git a/mesalib/src/mesa/program/sampler.cpp b/mesalib/src/mesa/program/sampler.cpp index e3641aaa9..9b9412730 100644 --- a/mesalib/src/mesa/program/sampler.cpp +++ b/mesalib/src/mesa/program/sampler.cpp @@ -34,6 +34,7 @@ extern "C" { #include "main/compiler.h" #include "main/mtypes.h" #include "program/prog_parameter.h" +#include "program/program.h" } class get_sampler_name : public ir_hierarchical_visitor @@ -102,14 +103,16 @@ public: ir_dereference *last; }; -extern "C" { -int + +extern "C" int _mesa_get_sampler_uniform_value(class ir_dereference *sampler, struct gl_shader_program *shader_program, const struct gl_program *prog) { get_sampler_name getname(sampler, shader_program); + GLuint shader = _mesa_program_target_to_index(prog->Target); + sampler->accept(&getname); unsigned location; @@ -119,6 +122,15 @@ _mesa_get_sampler_uniform_value(class ir_dereference *sampler, return 0; } - return shader_program->UniformStorage[location].sampler + getname.offset; -} + if (!shader_program->UniformStorage[location].sampler[shader].active) { + assert(0 && "cannot return a sampler"); + linker_error(shader_program, + "cannot return a sampler named %s, because it is not " + "used in this shader stage. This is a driver bug.\n", + getname.name); + return 0; + } + + return shader_program->UniformStorage[location].sampler[shader].index + + getname.offset; } diff --git a/mesalib/src/mesa/state_tracker/st_atom.c b/mesalib/src/mesa/state_tracker/st_atom.c index 32bcc266a..1abaf8f3e 100644 --- a/mesalib/src/mesa/state_tracker/st_atom.c +++ b/mesalib/src/mesa/state_tracker/st_atom.c @@ -55,10 +55,10 @@ static const struct st_tracked_state *atoms[] = &st_update_viewport, &st_update_scissor, &st_update_blend, - &st_update_sampler, &st_update_vertex_texture, &st_update_fragment_texture, &st_update_geometry_texture, + &st_update_sampler, /* depends on update_*_texture for swizzle */ &st_update_framebuffer, &st_update_msaa, &st_update_vs_constants, @@ -160,11 +160,7 @@ void st_validate_state( struct st_context *st ) check_attrib_edgeflag(st); - /* The bitmap cache is immune to pixel unpack changes. - * Note that GLUT makes several calls to glPixelStore for each - * bitmap char it draws so this is an important check. - */ - if (state->mesa & ~_NEW_PACKUNPACK) + if (state->mesa) st_flush_bitmap_cache(st); check_program_state( st ); diff --git a/mesalib/src/mesa/state_tracker/st_atom_array.c b/mesalib/src/mesa/state_tracker/st_atom_array.c index 2437245bd..87a0a17f1 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_array.c +++ b/mesalib/src/mesa/state_tracker/st_atom_array.c @@ -589,7 +589,7 @@ static void update_array(struct st_context *st) const struct st_tracked_state st_update_array = { "st_update_array", /* name */ { /* dirty */ - _NEW_BUFFER_OBJECT, /* mesa */ + 0, /* mesa */ ST_NEW_VERTEX_ARRAYS | ST_NEW_VERTEX_PROGRAM, /* st */ }, update_array /* update */ diff --git a/mesalib/src/mesa/state_tracker/st_atom_constbuf.c b/mesalib/src/mesa/state_tracker/st_atom_constbuf.c index 56ba96fe3..27a910b5f 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_constbuf.c +++ b/mesalib/src/mesa/state_tracker/st_atom_constbuf.c @@ -194,12 +194,25 @@ static void st_bind_ubos(struct st_context *st, binding = &st->ctx->UniformBufferBindings[shader->UniformBlocks[i].Binding]; st_obj = st_buffer_object(binding->BufferObject); - pipe_resource_reference(&cb.buffer, st_obj->buffer); - cb.buffer_size = st_obj->buffer->width0 - binding->Offset; + cb.buffer = st_obj->buffer; + + if (cb.buffer) { + cb.buffer_offset = binding->Offset; + cb.buffer_size = cb.buffer->width0 - binding->Offset; + + /* AutomaticSize is FALSE if the buffer was set with BindBufferRange. + * Take the minimum just to be sure. + */ + if (!binding->AutomaticSize) + cb.buffer_size = MIN2(cb.buffer_size, binding->Size); + } + else { + cb.buffer_offset = 0; + cb.buffer_size = 0; + } cso_set_constant_buffer(st->cso_context, shader_type, 1 + i, &cb); - pipe_resource_reference(&cb.buffer, NULL); } } @@ -216,8 +229,8 @@ static void bind_vs_ubos(struct st_context *st) const struct st_tracked_state st_bind_vs_ubos = { "st_bind_vs_ubos", { - (_NEW_PROGRAM | _NEW_BUFFER_OBJECT), - ST_NEW_VERTEX_PROGRAM, + 0, + ST_NEW_VERTEX_PROGRAM | ST_NEW_UNIFORM_BUFFER, }, bind_vs_ubos }; @@ -230,14 +243,13 @@ static void bind_fs_ubos(struct st_context *st) return; st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_FRAGMENT], PIPE_SHADER_FRAGMENT); - } const struct st_tracked_state st_bind_fs_ubos = { "st_bind_fs_ubos", { - (_NEW_PROGRAM | _NEW_BUFFER_OBJECT), - ST_NEW_FRAGMENT_PROGRAM, + 0, + ST_NEW_FRAGMENT_PROGRAM | ST_NEW_UNIFORM_BUFFER, }, bind_fs_ubos }; diff --git a/mesalib/src/mesa/state_tracker/st_atom_depth.c b/mesalib/src/mesa/state_tracker/st_atom_depth.c index c76a6d8c6..18a56a2e4 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_depth.c +++ b/mesalib/src/mesa/state_tracker/st_atom_depth.c @@ -41,6 +41,9 @@ #include "pipe/p_defines.h" #include "cso_cache/cso_context.h" +#include "main/core.h" +#include "main/stencil.h" + /** * Convert an OpenGL compare mode to a pipe tokens. @@ -116,7 +119,7 @@ update_depth_stencil_alpha(struct st_context *st) dsa->stencil[0].zpass_op = gl_stencil_op_to_pipe(ctx->Stencil.ZPassFunc[0]); dsa->stencil[0].valuemask = ctx->Stencil.ValueMask[0] & 0xff; dsa->stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff; - sr.ref_value[0] = ctx->Stencil.Ref[0] & 0xff; + sr.ref_value[0] = _mesa_get_stencil_ref(ctx, 0); if (ctx->Stencil._TestTwoSide) { const GLuint back = ctx->Stencil._BackFace; @@ -127,7 +130,7 @@ update_depth_stencil_alpha(struct st_context *st) dsa->stencil[1].zpass_op = gl_stencil_op_to_pipe(ctx->Stencil.ZPassFunc[back]); dsa->stencil[1].valuemask = ctx->Stencil.ValueMask[back] & 0xff; dsa->stencil[1].writemask = ctx->Stencil.WriteMask[back] & 0xff; - sr.ref_value[1] = ctx->Stencil.Ref[back] & 0xff; + sr.ref_value[1] = _mesa_get_stencil_ref(ctx, back); } else { /* This should be unnecessary. Drivers must not expect this to @@ -153,7 +156,7 @@ update_depth_stencil_alpha(struct st_context *st) const struct st_tracked_state st_update_depth_stencil_alpha = { "st_update_depth_stencil", /* name */ { /* dirty */ - (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR), /* mesa */ + (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR|_NEW_BUFFERS),/* mesa */ 0, /* st */ }, update_depth_stencil_alpha /* update */ diff --git a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c index 3df8691f4..c752640f4 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c @@ -59,6 +59,7 @@ update_renderbuffer_surface(struct st_context *st, enum pipe_format format = st->ctx->Color.sRGBEnabled ? resource->format : util_format_linear(resource->format); if (!strb->surface || + strb->surface->texture->nr_samples != strb->Base.NumSamples || strb->surface->format != format || strb->surface->texture != resource || strb->surface->width != rtt_width || diff --git a/mesalib/src/mesa/state_tracker/st_atom_msaa.c b/mesalib/src/mesa/state_tracker/st_atom_msaa.c index 9baa4fcf2..fb760460c 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_msaa.c +++ b/mesalib/src/mesa/state_tracker/st_atom_msaa.c @@ -62,7 +62,8 @@ static void update_sample_mask( struct st_context *st ) if (st->ctx->Multisample.SampleCoverageInvert) sample_mask = ~sample_mask; } - /* TODO merge with app-supplied sample mask */ + if (st->ctx->Multisample.SampleMask) + sample_mask &= st->ctx->Multisample.SampleMaskValue; } /* mask off unused bits or don't care? */ diff --git a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c index 62464b475..f4d0cab42 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c @@ -228,9 +228,12 @@ static void update_raster_state( struct st_context *st ) /* _NEW_FRAG_CLAMP */ raster->clamp_fragment_color = !st->clamp_frag_color_in_shader && ctx->Color._ClampFragmentColor; - raster->gl_rasterization_rules = 1; - /* _NEW_RASTERIZER_DISCARD */ + raster->half_pixel_center = 1; + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) + raster->bottom_edge_rule = 1; + + /* ST_NEW_RASTERIZER */ raster->rasterizer_discard = ctx->RasterDiscard; /* _NEW_TRANSFORM */ @@ -252,9 +255,9 @@ const struct st_tracked_state st_update_rasterizer = { _NEW_PROGRAM | _NEW_SCISSOR | _NEW_FRAG_CLAMP | - _NEW_RASTERIZER_DISCARD | _NEW_TRANSFORM), /* mesa state dependencies*/ - ST_NEW_VERTEX_PROGRAM, /* state tracker dependencies */ + (ST_NEW_VERTEX_PROGRAM | + ST_NEW_RASTERIZER), /* state tracker dependencies */ }, update_raster_state /* update function */ }; diff --git a/mesalib/src/mesa/state_tracker/st_atom_sampler.c b/mesalib/src/mesa/state_tracker/st_atom_sampler.c index 3eba5b13c..302e12981 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_sampler.c +++ b/mesalib/src/mesa/state_tracker/st_atom_sampler.c @@ -48,6 +48,8 @@ #include "cso_cache/cso_context.h" +#include "util/u_format.h" + /** * Convert GLenum texcoord wrap tokens to pipe tokens. @@ -172,8 +174,10 @@ convert_sampler(struct st_context *st, msamp->BorderColor.ui[1] || msamp->BorderColor.ui[2] || msamp->BorderColor.ui[3]) { + struct st_texture_object *stobj = st_texture_object(texobj); struct gl_texture_image *teximg; GLboolean is_integer = GL_FALSE; + union pipe_color_union border_color; teximg = texobj->Image[0][texobj->BaseLevel]; @@ -181,9 +185,26 @@ convert_sampler(struct st_context *st, is_integer = _mesa_is_enum_format_integer(teximg->InternalFormat); } - st_translate_color(&msamp->BorderColor, - &sampler->border_color, - teximg ? teximg->_BaseFormat : GL_RGBA, is_integer); + if (st->apply_texture_swizzle_to_border_color && stobj->sampler_view) { + const unsigned char swz[4] = + { + stobj->sampler_view->swizzle_r, + stobj->sampler_view->swizzle_g, + stobj->sampler_view->swizzle_b, + stobj->sampler_view->swizzle_a, + }; + + st_translate_color(&msamp->BorderColor, + &border_color, + teximg ? teximg->_BaseFormat : GL_RGBA, is_integer); + + util_format_apply_color_swizzle(&sampler->border_color, + &border_color, swz, is_integer); + } else { + st_translate_color(&msamp->BorderColor, + &sampler->border_color, + teximg ? teximg->_BaseFormat : GL_RGBA, is_integer); + } } sampler->max_anisotropy = (msamp->MaxAnisotropy == 1.0 ? @@ -258,14 +279,14 @@ update_samplers(struct st_context *st) update_shader_samplers(st, PIPE_SHADER_FRAGMENT, &ctx->FragmentProgram._Current->Base, - ctx->Const.MaxTextureImageUnits, + ctx->Const.FragmentProgram.MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_FRAGMENT], &st->state.num_samplers[PIPE_SHADER_FRAGMENT]); update_shader_samplers(st, PIPE_SHADER_VERTEX, &ctx->VertexProgram._Current->Base, - ctx->Const.MaxVertexTextureImageUnits, + ctx->Const.VertexProgram.MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_VERTEX], &st->state.num_samplers[PIPE_SHADER_VERTEX]); @@ -273,7 +294,7 @@ update_samplers(struct st_context *st) update_shader_samplers(st, PIPE_SHADER_GEOMETRY, &ctx->GeometryProgram._Current->Base, - ctx->Const.MaxGeometryTextureImageUnits, + ctx->Const.GeometryProgram.MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_GEOMETRY], &st->state.num_samplers[PIPE_SHADER_GEOMETRY]); } diff --git a/mesalib/src/mesa/state_tracker/st_atom_scissor.c b/mesalib/src/mesa/state_tracker/st_atom_scissor.c index eb1387778..19c2cd2fb 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_scissor.c +++ b/mesalib/src/mesa/state_tracker/st_atom_scissor.c @@ -86,7 +86,7 @@ update_scissor( struct st_context *st ) if (memcmp(&scissor, &st->state.scissor, sizeof(scissor)) != 0) { /* state has changed */ st->state.scissor = scissor; /* struct copy */ - st->pipe->set_scissor_state(st->pipe, &scissor); /* activate */ + st->pipe->set_scissor_states(st->pipe, 0, 1, &scissor); /* activate */ } } diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c index fc2d69013..d79e04cf4 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_texture.c +++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c @@ -239,7 +239,8 @@ update_single_texture(struct st_context *st, st_mesa_format_to_pipe_format(stObj->base._BufferObjectFormat); } else { - view_format = stObj->pt->format; + view_format = + stObj->surface_based ? stObj->surface_format : stObj->pt->format; /* If sRGB decoding is off, use the linear format */ if (samp->sRGBDecode == GL_SKIP_DECODE_EXT) { @@ -325,11 +326,11 @@ update_vertex_textures(struct st_context *st) { const struct gl_context *ctx = st->ctx; - if (ctx->Const.MaxVertexTextureImageUnits > 0) { + if (ctx->Const.VertexProgram.MaxTextureImageUnits > 0) { update_textures(st, PIPE_SHADER_VERTEX, &ctx->VertexProgram._Current->Base, - ctx->Const.MaxVertexTextureImageUnits, + ctx->Const.VertexProgram.MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_VERTEX], &st->state.num_sampler_views[PIPE_SHADER_VERTEX]); } @@ -344,7 +345,7 @@ update_fragment_textures(struct st_context *st) update_textures(st, PIPE_SHADER_FRAGMENT, &ctx->FragmentProgram._Current->Base, - ctx->Const.MaxTextureImageUnits, + ctx->Const.FragmentProgram.MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_FRAGMENT], &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]); } @@ -359,7 +360,7 @@ update_geometry_textures(struct st_context *st) update_textures(st, PIPE_SHADER_GEOMETRY, &ctx->GeometryProgram._Current->Base, - ctx->Const.MaxTextureImageUnits, + ctx->Const.FragmentProgram.MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_GEOMETRY], &st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]); } diff --git a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c index b3ca40501..e96f4b36e 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c +++ b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c @@ -34,7 +34,6 @@ #include "main/image.h" #include "main/bufferobj.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/pbo.h" #include "program/program.h" #include "program/prog_print.h" @@ -299,7 +298,7 @@ make_bitmap_texture(struct gl_context *ctx, GLsizei width, GLsizei height, * Create texture to hold bitmap pattern. */ pt = st_texture_create(st, st->internal_target, st->bitmap.tex_format, - 0, width, height, 1, 1, + 0, width, height, 1, 1, 0, PIPE_BIND_SAMPLER_VIEW); if (!pt) { _mesa_unmap_pbo_source(ctx, unpack); @@ -567,7 +566,7 @@ reset_cache(struct st_context *st) cache->texture = st_texture_create(st, PIPE_TEXTURE_2D, st->bitmap.tex_format, 0, BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT, - 1, 1, + 1, 1, 0, PIPE_BIND_SAMPLER_VIEW); } @@ -826,7 +825,8 @@ st_init_bitmap(struct st_context *st) /* init baseline rasterizer state once */ memset(&st->bitmap.rasterizer, 0, sizeof(st->bitmap.rasterizer)); - st->bitmap.rasterizer.gl_rasterization_rules = 1; + st->bitmap.rasterizer.half_pixel_center = 1; + st->bitmap.rasterizer.bottom_edge_rule = 1; st->bitmap.rasterizer.depth_clip = 1; /* find a usable texture format */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_bitmap.h b/mesalib/src/mesa/state_tracker/st_cb_bitmap.h index d1c18058b..cc9f5f574 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bitmap.h +++ b/mesalib/src/mesa/state_tracker/st_cb_bitmap.h @@ -31,7 +31,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; struct st_context; diff --git a/mesalib/src/mesa/state_tracker/st_cb_blit.c b/mesalib/src/mesa/state_tracker/st_cb_blit.c index 50cab4294..a236a08e9 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_blit.c +++ b/mesalib/src/mesa/state_tracker/st_cb_blit.c @@ -33,7 +33,6 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "st_context.h" #include "st_texture.h" diff --git a/mesalib/src/mesa/state_tracker/st_cb_blit.h b/mesalib/src/mesa/state_tracker/st_cb_blit.h index 159c6ca8d..9e94e4439 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_blit.h +++ b/mesalib/src/mesa/state_tracker/st_cb_blit.h @@ -30,7 +30,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; struct st_context; diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c index 8ff32c842..2e5e253a4 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -182,6 +182,21 @@ st_bufferobj_data(struct gl_context *ctx, struct st_buffer_object *st_obj = st_buffer_object(obj); unsigned bind, pipe_usage; + if (size && data && st_obj->buffer && + st_obj->Base.Size == size && st_obj->Base.Usage == usage) { + /* Just discard the old contents and write new data. + * This should be the same as creating a new buffer, but we avoid + * a lot of validation in Mesa. + */ + struct pipe_box box; + + u_box_1d(0, size, &box); + pipe->transfer_inline_write(pipe, st_obj->buffer, 0, + PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE, + &box, data, 0, 0); + return GL_TRUE; + } + st_obj->Base.Size = size; st_obj->Base.Usage = usage; @@ -247,9 +262,11 @@ st_bufferobj_data(struct gl_context *ctx, if (data) pipe_buffer_write(pipe, st_obj->buffer, 0, size, data); - return GL_TRUE; } + /* BufferData may change an array or uniform buffer, need to update it */ + st->dirty.st |= ST_NEW_VERTEX_ARRAYS | ST_NEW_UNIFORM_BUFFER; + return GL_TRUE; } diff --git a/mesalib/src/mesa/state_tracker/st_cb_clear.c b/mesalib/src/mesa/state_tracker/st_cb_clear.c index a5aa8f496..566f4a76e 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_clear.c +++ b/mesalib/src/mesa/state_tracker/st_cb_clear.c @@ -67,7 +67,8 @@ st_init_clear(struct st_context *st) { memset(&st->clear, 0, sizeof(st->clear)); - st->clear.raster.gl_rasterization_rules = 1; + st->clear.raster.half_pixel_center = 1; + st->clear.raster.bottom_edge_rule = 1; st->clear.raster.depth_clip = 1; } diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c index f5a1e27f7..68359e803 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c @@ -35,7 +35,6 @@ #include "main/bufferobj.h" #include "main/format_pack.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/pack.h" #include "main/pbo.h" @@ -466,7 +465,7 @@ alloc_texture(struct st_context *st, GLsizei width, GLsizei height, struct pipe_resource *pt; pt = st_texture_create(st, st->internal_target, texFormat, 0, - width, height, 1, 1, PIPE_BIND_SAMPLER_VIEW); + width, height, 1, 1, 0, PIPE_BIND_SAMPLER_VIEW); return pt; } @@ -711,7 +710,8 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, memset(&rasterizer, 0, sizeof(rasterizer)); rasterizer.clamp_fragment_color = !st->clamp_frag_color_in_shader && ctx->Color._ClampFragmentColor; - rasterizer.gl_rasterization_rules = 1; + rasterizer.half_pixel_center = 1; + rasterizer.bottom_edge_rule = 1; rasterizer.depth_clip = !ctx->Transform.DepthClamp; rasterizer.scissor = ctx->Scissor.Enabled; cso_set_rasterizer(cso, &rasterizer); diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h index 6209dcade..6cd6a4ed6 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h @@ -31,7 +31,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; struct st_context; diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c index c4efce02f..2cc200e0c 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c @@ -15,7 +15,6 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "program/program.h" #include "program/prog_print.h" diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawtex.h b/mesalib/src/mesa/state_tracker/st_cb_drawtex.h index ccb615e98..9794ccc15 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawtex.h +++ b/mesalib/src/mesa/state_tracker/st_cb_drawtex.h @@ -11,7 +11,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; struct st_context; diff --git a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c index 8c78e5ef4..a396b9e97 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c +++ b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c @@ -26,7 +26,6 @@ * Chia-I Wu <olv@lunarg.com> */ -#include "main/mfeatures.h" #include "main/texobj.h" #include "main/teximage.h" #include "util/u_inlines.h" @@ -132,6 +131,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target, stObj->width0 = ps->width; stObj->height0 = ps->height; stObj->depth0 = 1; + stObj->surface_format = ps->format; _mesa_dirty_texobj(ctx, texObj, GL_TRUE); } diff --git a/mesalib/src/mesa/state_tracker/st_cb_eglimage.h b/mesalib/src/mesa/state_tracker/st_cb_eglimage.h index 1750b9147..c6ddec6ae 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_eglimage.h +++ b/mesalib/src/mesa/state_tracker/st_cb_eglimage.h @@ -30,7 +30,6 @@ #define ST_CB_EGLIMAGE_H #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 4452e523b..826722be8 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -38,7 +38,6 @@ #include "main/fbobject.h" #include "main/framebuffer.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/renderbuffer.h" #include "pipe/p_context.h" @@ -391,11 +390,10 @@ st_render_texture(struct gl_context *ctx, { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct st_renderbuffer *strb; - struct gl_renderbuffer *rb; + struct gl_renderbuffer *rb = att->Renderbuffer; + struct st_renderbuffer *strb = st_renderbuffer(rb); struct pipe_resource *pt; struct st_texture_object *stObj; - const struct gl_texture_image *texImage; struct pipe_surface surf_tmpl; if (!st_finalize_texture(ctx, pipe, att->Texture)) @@ -404,27 +402,6 @@ st_render_texture(struct gl_context *ctx, pt = st_get_texobj_resource(att->Texture); assert(pt); - /* get pointer to texture image we're rendeing to */ - texImage = _mesa_get_attachment_teximage(att); - - /* create new renderbuffer which wraps the texture image. - * Use the texture's name as the renderbuffer's name so that we have - * something that's non-zero (to determine vertical orientation) and - * possibly helpful for debugging. - */ - rb = st_new_renderbuffer(ctx, att->Texture->Name); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture()"); - return; - } - - _mesa_reference_renderbuffer(&att->Renderbuffer, rb); - assert(rb->RefCount == 1); - rb->AllocStorage = NULL; /* should not get called */ - strb = st_renderbuffer(rb); - - assert(strb->Base.RefCount > 0); - /* get the texture for the texture object */ stObj = st_texture_object(att->Texture); @@ -434,11 +411,6 @@ st_render_texture(struct gl_context *ctx, strb->rtt_face = att->CubeMapFace; strb->rtt_slice = att->Zoffset; - rb->Width = texImage->Width2; - rb->Height = texImage->Height2; - rb->_BaseFormat = texImage->_BaseFormat; - rb->InternalFormat = texImage->InternalFormat; - pipe_resource_reference( &strb->texture, pt ); pipe_surface_release(pipe, &strb->surface); @@ -477,10 +449,9 @@ st_render_texture(struct gl_context *ctx, * Called via ctx->Driver.FinishRenderTexture. */ static void -st_finish_render_texture(struct gl_context *ctx, - struct gl_renderbuffer_attachment *att) +st_finish_render_texture(struct gl_context *ctx, struct gl_renderbuffer *rb) { - struct st_renderbuffer *strb = st_renderbuffer(att->Renderbuffer); + struct st_renderbuffer *strb = st_renderbuffer(rb); if (!strb) return; @@ -527,7 +498,7 @@ st_validate_attachment(struct gl_context *ctx, return GL_FALSE; format = stObj->pt->format; - texFormat = _mesa_get_attachment_teximage_const(att)->TexFormat; + texFormat = att->Renderbuffer->TexImage->TexFormat; /* If the encoding is sRGB and sRGB rendering cannot be enabled, * check for linear format support instead. diff --git a/mesalib/src/mesa/state_tracker/st_cb_feedback.c b/mesalib/src/mesa/state_tracker/st_cb_feedback.c index 7a8fde465..d2e4346b7 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_feedback.c +++ b/mesalib/src/mesa/state_tracker/st_cb_feedback.c @@ -40,7 +40,6 @@ #include "main/imports.h" #include "main/context.h" #include "main/feedback.h" -#include "main/mfeatures.h" #include "vbo/vbo.h" diff --git a/mesalib/src/mesa/state_tracker/st_cb_feedback.h b/mesalib/src/mesa/state_tracker/st_cb_feedback.h index 0163631e3..6350da4e4 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_feedback.h +++ b/mesalib/src/mesa/state_tracker/st_cb_feedback.h @@ -31,7 +31,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; diff --git a/mesalib/src/mesa/state_tracker/st_cb_flush.c b/mesalib/src/mesa/state_tracker/st_cb_flush.c index b11004718..f428e0af9 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_flush.c +++ b/mesalib/src/mesa/state_tracker/st_cb_flush.c @@ -77,7 +77,7 @@ display_front_buffer(struct st_context *st) void st_flush(struct st_context *st, struct pipe_fence_handle **fence, - enum pipe_flush_flags flags) + unsigned flags) { FLUSH_VERTICES(st->ctx, 0); FLUSH_CURRENT(st->ctx, 0); diff --git a/mesalib/src/mesa/state_tracker/st_cb_flush.h b/mesalib/src/mesa/state_tracker/st_cb_flush.h index 003e2a2a9..cb5c62e87 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_flush.h +++ b/mesalib/src/mesa/state_tracker/st_cb_flush.h @@ -42,7 +42,7 @@ st_init_flush_functions(struct dd_function_table *functions); extern void st_flush(struct st_context *st, struct pipe_fence_handle **fence, - enum pipe_flush_flags flags); + unsigned flags); extern void st_finish(struct st_context *st); diff --git a/mesalib/src/mesa/state_tracker/st_cb_msaa.c b/mesalib/src/mesa/state_tracker/st_cb_msaa.c new file mode 100644 index 000000000..bbf2b2c5c --- /dev/null +++ b/mesalib/src/mesa/state_tracker/st_cb_msaa.c @@ -0,0 +1,59 @@ +/************************************************************************** + * + * Copyright 2013 Red Hat + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include "main/bufferobj.h" +#include "main/imports.h" + +#include "state_tracker/st_cb_msaa.h" +#include "state_tracker/st_context.h" +#include "state_tracker/st_atom.h" +#include "state_tracker/st_cb_fbo.h" + +#include "pipe/p_context.h" + + +static void +st_GetSamplePosition(struct gl_context *ctx, + struct gl_framebuffer *fb, + GLuint index, + GLfloat *outValue) +{ + struct st_context *st = st_context(ctx); + + st_validate_state(st); + + if (st->pipe->get_sample_position) + st->pipe->get_sample_position(st->pipe, (unsigned) fb->Visual.samples, + index, outValue); +} + + +void +st_init_msaa_functions(struct dd_function_table *functions) +{ + functions->GetSamplePosition = st_GetSamplePosition; +} diff --git a/mesalib/src/mesa/state_tracker/st_cb_msaa.h b/mesalib/src/mesa/state_tracker/st_cb_msaa.h new file mode 100644 index 000000000..ba4c06f6b --- /dev/null +++ b/mesalib/src/mesa/state_tracker/st_cb_msaa.h @@ -0,0 +1,39 @@ +/************************************************************************** + * + * Copyright 2013 Red Hat + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#ifndef ST_CB_MSAA_H +#define ST_CB_MSAA_H + +#include "main/glheader.h" + +struct dd_function_table; + +extern void +st_init_msaa_functions(struct dd_function_table *functions); + +#endif diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c index 6a35c1b69..24ce6351d 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c +++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c @@ -35,7 +35,6 @@ #include "main/imports.h" #include "main/context.h" -#include "main/mfeatures.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.h b/mesalib/src/mesa/state_tracker/st_cb_queryobj.h index d5b107532..e069b095c 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.h +++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.h @@ -29,7 +29,6 @@ #define ST_CB_QUERYOBJ_H -#include "main/mfeatures.h" #include "main/mtypes.h" /** diff --git a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c index 4731f2648..26a55909d 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c @@ -38,7 +38,6 @@ #include "main/imports.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/feedback.h" #include "st_context.h" diff --git a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h index bfd3e4138..99796f610 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h +++ b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h @@ -30,7 +30,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c index 0cd0d77af..56dbe85c0 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_texture.c +++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c @@ -25,7 +25,6 @@ * **************************************************************************/ -#include "main/mfeatures.h" #include "main/bufferobj.h" #include "main/enums.h" #include "main/fbobject.h" @@ -78,6 +77,8 @@ gl_target_to_pipe(GLenum target) case GL_TEXTURE_2D: case GL_PROXY_TEXTURE_2D: case GL_TEXTURE_EXTERNAL_OES: + case GL_TEXTURE_2D_MULTISAMPLE: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE: return PIPE_TEXTURE_2D; case GL_TEXTURE_RECTANGLE_NV: case GL_PROXY_TEXTURE_RECTANGLE_NV: @@ -99,6 +100,8 @@ gl_target_to_pipe(GLenum target) return PIPE_TEXTURE_1D_ARRAY; case GL_TEXTURE_2D_ARRAY_EXT: case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: return PIPE_TEXTURE_2D_ARRAY; case GL_TEXTURE_BUFFER: return PIPE_BUFFER; @@ -408,7 +411,7 @@ guess_and_alloc_texture(struct st_context *st, ptWidth, ptHeight, ptDepth, - ptLayers, + ptLayers, 0, bindings); stObj->lastLevel = lastLevel; @@ -496,7 +499,7 @@ st_AllocTextureImageBuffer(struct gl_context *ctx, ptWidth, ptHeight, ptDepth, - ptLayers, + ptLayers, 0, bindings); return stImage->pt != NULL; } @@ -1492,7 +1495,7 @@ st_finalize_texture(struct gl_context *ctx, GLuint face; struct st_texture_image *firstImage; enum pipe_format firstImageFormat; - GLuint ptWidth, ptHeight, ptDepth, ptLayers; + GLuint ptWidth, ptHeight, ptDepth, ptLayers, ptNumSamples; if (_mesa_is_texture_complete(tObj, &tObj->Sampler)) { /* The texture is complete and we know exactly how many mipmap levels @@ -1537,6 +1540,11 @@ st_finalize_texture(struct gl_context *ctx, pipe_sampler_view_release(st->pipe, &stObj->sampler_view); } + /* If this texture comes from a window system, there is nothing else to do. */ + if (stObj->surface_based) { + return GL_TRUE; + } + /* Find gallium format for the Mesa texture */ firstImageFormat = st_mesa_format_to_pipe_format(firstImage->base.TexFormat); @@ -1556,6 +1564,7 @@ st_finalize_texture(struct gl_context *ctx, /* convert GL dims to Gallium dims */ st_gl_texture_dims_to_pipe_dims(stObj->base.Target, width, height, depth, &ptWidth, &ptHeight, &ptDepth, &ptLayers); + ptNumSamples = firstImage->base.NumSamples; } /* If we already have a gallium texture, check that it matches the texture @@ -1563,11 +1572,12 @@ st_finalize_texture(struct gl_context *ctx, */ if (stObj->pt) { if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) || - !st_sampler_compat_formats(stObj->pt->format, firstImageFormat) || + stObj->pt->format != firstImageFormat || stObj->pt->last_level < stObj->lastLevel || stObj->pt->width0 != ptWidth || stObj->pt->height0 != ptHeight || stObj->pt->depth0 != ptDepth || + stObj->pt->nr_samples != ptNumSamples || stObj->pt->array_size != ptLayers) { /* The gallium texture does not match the Mesa texture so delete the @@ -1591,7 +1601,7 @@ st_finalize_texture(struct gl_context *ctx, ptWidth, ptHeight, ptDepth, - ptLayers, + ptLayers, ptNumSamples, bindings); if (!stObj->pt) { @@ -1637,11 +1647,14 @@ st_AllocTextureStorage(struct gl_context *ctx, GLsizei height, GLsizei depth) { const GLuint numFaces = _mesa_num_tex_faces(texObj->Target); + struct gl_texture_image *texImage = texObj->Image[0][0]; struct st_context *st = st_context(ctx); struct st_texture_object *stObj = st_texture_object(texObj); + struct pipe_screen *screen = st->pipe->screen; GLuint ptWidth, ptHeight, ptDepth, ptLayers, bindings; enum pipe_format fmt; GLint level; + int num_samples = texImage->NumSamples; assert(levels > 0); @@ -1651,10 +1664,30 @@ st_AllocTextureStorage(struct gl_context *ctx, stObj->depth0 = depth; stObj->lastLevel = levels - 1; - fmt = st_mesa_format_to_pipe_format(texObj->Image[0][0]->TexFormat); + fmt = st_mesa_format_to_pipe_format(texImage->TexFormat); bindings = default_bindings(st, fmt); + /* Raise the sample count if the requested one is unsupported. */ + if (num_samples > 1) { + boolean found = FALSE; + + for (; num_samples <= ctx->Const.MaxSamples; num_samples++) { + if (screen->is_format_supported(screen, fmt, PIPE_TEXTURE_2D, + num_samples, + PIPE_BIND_SAMPLER_VIEW)) { + /* Update the sample count in gl_texture_image as well. */ + texImage->NumSamples = num_samples; + found = TRUE; + break; + } + } + + if (!found) { + return GL_FALSE; + } + } + st_gl_texture_dims_to_pipe_dims(texObj->Target, width, height, depth, &ptWidth, &ptHeight, &ptDepth, &ptLayers); @@ -1662,11 +1695,11 @@ st_AllocTextureStorage(struct gl_context *ctx, stObj->pt = st_texture_create(st, gl_target_to_pipe(texObj->Target), fmt, - levels, + levels - 1, ptWidth, ptHeight, ptDepth, - ptLayers, + ptLayers, num_samples, bindings); if (!stObj->pt) return GL_FALSE; diff --git a/mesalib/src/mesa/state_tracker/st_cb_xformfb.c b/mesalib/src/mesa/state_tracker/st_cb_xformfb.c index 3e52c9988..e1a7a88a1 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_xformfb.c +++ b/mesalib/src/mesa/state_tracker/st_cb_xformfb.c @@ -36,7 +36,6 @@ #include "main/bufferobj.h" #include "main/context.h" -#include "main/mfeatures.h" #include "main/transformfeedback.h" #include "st_cb_bufferobjects.h" diff --git a/mesalib/src/mesa/state_tracker/st_cb_xformfb.h b/mesalib/src/mesa/state_tracker/st_cb_xformfb.h index 5c82fed18..998c41825 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_xformfb.h +++ b/mesalib/src/mesa/state_tracker/st_cb_xformfb.h @@ -30,7 +30,6 @@ #include "main/compiler.h" -#include "main/mfeatures.h" struct dd_function_table; struct gl_transform_feedback_object; diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c index cc87f2bb3..7d18c2521 100644 --- a/mesalib/src/mesa/state_tracker/st_context.c +++ b/mesalib/src/mesa/state_tracker/st_context.c @@ -49,6 +49,7 @@ #include "st_cb_eglimage.h" #include "st_cb_fbo.h" #include "st_cb_feedback.h" +#include "st_cb_msaa.h" #include "st_cb_program.h" #include "st_cb_queryobj.h" #include "st_cb_readpixels.h" @@ -187,6 +188,10 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe, st->needs_texcoord_semantic = screen->get_param(screen, PIPE_CAP_TGSI_TEXCOORD); + st->apply_texture_swizzle_to_border_color = + !!(screen->get_param(screen, PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK) & + (PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 | + PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600)); /* GL limits and extensions */ st_init_limits(st); @@ -203,6 +208,8 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe, static void st_init_driver_flags(struct gl_driver_flags *f) { f->NewArray = ST_NEW_VERTEX_ARRAYS; + f->NewRasterizerDiscard = ST_NEW_RASTERIZER; + f->NewUniformBuffer = ST_NEW_UNIFORM_BUFFER; } struct st_context *st_create_context(gl_api api, struct pipe_context *pipe, @@ -233,7 +240,7 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe, * driver prefers DP4 or MUL/MAD for vertex transformation. */ if (debug_get_option_mesa_mvp_dp4()) - _mesa_set_mvp_with_dp4( ctx, GL_TRUE ); + ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4 = GL_TRUE; return st_create_context_priv(ctx, pipe, options); } @@ -340,6 +347,7 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_fbo_functions(functions); st_init_feedback_functions(functions); + st_init_msaa_functions(functions); st_init_program_functions(functions); st_init_query_functions(functions); st_init_cond_render_functions(functions); diff --git a/mesalib/src/mesa/state_tracker/st_context.h b/mesalib/src/mesa/state_tracker/st_context.h index 8786a036f..ab89b4947 100644 --- a/mesalib/src/mesa/state_tracker/st_context.h +++ b/mesalib/src/mesa/state_tracker/st_context.h @@ -50,6 +50,8 @@ struct u_upload_mgr; #define ST_NEW_EDGEFLAGS_DATA (1 << 4) #define ST_NEW_GEOMETRY_PROGRAM (1 << 5) #define ST_NEW_VERTEX_ARRAYS (1 << 6) +#define ST_NEW_RASTERIZER (1 << 7) +#define ST_NEW_UNIFORM_BUFFER (1 << 8) struct st_state_flags { @@ -87,6 +89,7 @@ struct st_context boolean prefer_blit_based_texture_transfer; boolean needs_texcoord_semantic; + boolean apply_texture_swizzle_to_border_color; /* On old libGL's for linux we need to invalidate the drawables * on glViewpport calls, this is set via a option. diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c index bff8d9b31..a440ae2a8 100644 --- a/mesalib/src/mesa/state_tracker/st_draw.c +++ b/mesalib/src/mesa/state_tracker/st_draw.c @@ -40,7 +40,6 @@ #include "main/image.h" #include "main/bufferobj.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "vbo/vbo.h" @@ -231,7 +230,7 @@ st_draw_vbo(struct gl_context *ctx, nr_prims); if (!setup_index_buffer(st, ib, &ibuffer)) { - /* out of memory */ + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBegin/DrawElements/DrawArray"); return; } @@ -245,7 +244,7 @@ st_draw_vbo(struct gl_context *ctx, * so we only set these fields for indexed drawing: */ info.primitive_restart = ctx->Array._PrimitiveRestart; - info.restart_index = ctx->Array._RestartIndex; + info.restart_index = ctx->Array.RestartIndex; } else { /* Transform feedback drawing is always non-indexed. */ diff --git a/mesalib/src/mesa/state_tracker/st_draw_feedback.c b/mesalib/src/mesa/state_tracker/st_draw_feedback.c index ae87fb28d..b19d913e5 100644 --- a/mesalib/src/mesa/state_tracker/st_draw_feedback.c +++ b/mesalib/src/mesa/state_tracker/st_draw_feedback.c @@ -28,7 +28,6 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "vbo/vbo.h" @@ -134,7 +133,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, * code sends state updates to the pipe, not to our private draw module. */ assert(draw); - draw_set_viewport_state(draw, &st->state.viewport); + draw_set_viewport_states(draw, 0, 1, &st->state.viewport); draw_set_clip_state(draw, &st->state.clip); draw_set_rasterizer_state(draw, &st->state.rasterizer, NULL); draw_bind_vertex_shader(draw, st->vp_variant->draw_shader); @@ -176,7 +175,8 @@ st_feedback_draw_vbo(struct gl_context *ctx, map = pipe_buffer_map(pipe, vbuffers[attr].buffer, PIPE_TRANSFER_READ, &vb_transfer[attr]); - draw_set_mapped_vertex_buffer(draw, attr, map); + draw_set_mapped_vertex_buffer(draw, attr, map, + vbuffers[attr].buffer->width0); } else { vbuffers[attr].buffer = NULL; @@ -184,7 +184,8 @@ st_feedback_draw_vbo(struct gl_context *ctx, vbuffers[attr].buffer_offset = 0; velements[attr].src_offset = 0; - draw_set_mapped_vertex_buffer(draw, attr, vbuffers[attr].user_buffer); + draw_set_mapped_vertex_buffer(draw, attr, vbuffers[attr].user_buffer, + ~0); } /* common-case setup */ @@ -232,7 +233,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, draw_set_indexes(draw, (ubyte *) mapped_indices + ibuffer.offset, - ibuffer.index_size); + ibuffer.index_size, ~0); } /* set the constant buffer */ @@ -251,7 +252,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, * unmap vertex/index buffers */ if (ib) { - draw_set_indexes(draw, NULL, 0); + draw_set_indexes(draw, NULL, 0, 0); if (ib_transfer) pipe_buffer_unmap(pipe, ib_transfer); pipe_resource_reference(&ibuffer.buffer, NULL); @@ -261,7 +262,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, for (attr = 0; attr < vp->num_inputs; attr++) { if (vb_transfer[attr]) pipe_buffer_unmap(pipe, vb_transfer[attr]); - draw_set_mapped_vertex_buffer(draw, attr, NULL); + draw_set_mapped_vertex_buffer(draw, attr, NULL, 0); pipe_resource_reference(&vbuffers[attr].buffer, NULL); } draw_set_vertex_buffers(draw, 0, vp->num_inputs, NULL); diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 2d8b9efec..46acc8763 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -29,7 +29,6 @@ #include "main/imports.h" #include "main/context.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/version.h" #include "pipe/p_context.h" @@ -38,9 +37,9 @@ #include "st_context.h" #include "st_extensions.h" +#include "st_format.h" - -static int _min(int a, int b) +static unsigned _min(unsigned a, unsigned b) { return (a < b) ? a : b; } @@ -71,7 +70,6 @@ void st_init_limits(struct st_context *st) struct gl_constants *c = &st->ctx->Const; gl_shader_type sh; boolean can_ubo = TRUE; - int max_const_buffers; c->MaxTextureLevels = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS), @@ -91,25 +89,10 @@ void st_init_limits(struct st_context *st) c->MaxArrayTextureLayers = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS); - c->MaxTextureImageUnits - = _min(screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, - PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS), - MAX_TEXTURE_IMAGE_UNITS); - - c->MaxVertexTextureImageUnits - = _min(screen->get_shader_param(screen, PIPE_SHADER_VERTEX, - PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS), - MAX_VERTEX_TEXTURE_IMAGE_UNITS); - c->MaxCombinedTextureImageUnits = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS), MAX_COMBINED_TEXTURE_IMAGE_UNITS); - c->MaxTextureCoordUnits - = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); - - c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits); - /* Define max viewport size and max renderbuffer size in terms of * max texture size (note: max tex RECT size = max tex 2D size). * If this isn't true for some hardware we'll need new PIPE_CAP_ queries. @@ -118,9 +101,9 @@ void st_init_limits(struct st_context *st) c->MaxViewportHeight = c->MaxRenderbufferSize = c->MaxTextureRectSize; - c->MaxDrawBuffers - = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), - 1, MAX_DRAW_BUFFERS); + c->MaxDrawBuffers = c->MaxColorAttachments = + _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), + 1, MAX_DRAW_BUFFERS); c->MaxDualSourceDrawBuffers = _clamp(screen->get_param(screen, PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS), @@ -156,13 +139,16 @@ void st_init_limits(struct st_context *st) c->MaxTextureLodBias = screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_LOD_BIAS); - c->MaxDrawBuffers - = CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), - 1, MAX_DRAW_BUFFERS); - c->QuadsFollowProvokingVertexConvention = screen->get_param( screen, PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION); + c->MaxUniformBlockSize = + screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, + PIPE_SHADER_CAP_MAX_CONSTS) * 16; + if (c->MaxUniformBlockSize < 16384) { + can_ubo = FALSE; + } + for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) { struct gl_shader_compiler_options *options = &st->ctx->ShaderCompilerOptions[sh]; @@ -183,17 +169,39 @@ void st_init_limits(struct st_context *st) continue; } - pc->MaxNativeInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS); - pc->MaxNativeAluInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS); - pc->MaxNativeTexInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS); - pc->MaxNativeTexIndirections = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS); - pc->MaxNativeAttribs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS); - pc->MaxNativeTemps = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS); - pc->MaxNativeAddressRegs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS); - pc->MaxNativeParameters = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS); - pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS); - /* raise MaxParameters if native support is higher */ - pc->MaxParameters = MAX2(pc->MaxParameters, pc->MaxNativeParameters); + pc->MaxTextureImageUnits = + _min(screen->get_shader_param(screen, sh, + PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS), + MAX_TEXTURE_IMAGE_UNITS); + + pc->MaxInstructions = pc->MaxNativeInstructions = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS); + pc->MaxAluInstructions = pc->MaxNativeAluInstructions = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS); + pc->MaxTexInstructions = pc->MaxNativeTexInstructions = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS); + pc->MaxTexIndirections = pc->MaxNativeTexIndirections = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS); + pc->MaxAttribs = pc->MaxNativeAttribs = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS); + pc->MaxTemps = pc->MaxNativeTemps = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS); + pc->MaxAddressRegs = pc->MaxNativeAddressRegs = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS); + pc->MaxParameters = pc->MaxNativeParameters = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS); + + pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS); + + pc->MaxUniformBlocks = + screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONST_BUFFERS); + if (pc->MaxUniformBlocks) + pc->MaxUniformBlocks -= 1; /* The first one is for ordinary uniforms. */ + pc->MaxUniformBlocks = _min(pc->MaxUniformBlocks, MAX_UNIFORM_BUFFERS); + + pc->MaxCombinedUniformComponents = (pc->MaxUniformComponents + + c->MaxUniformBlockSize / 4 * + pc->MaxUniformBlocks); /* Gallium doesn't really care about local vs. env parameters so use the * same limits. @@ -220,15 +228,9 @@ void st_init_limits(struct st_context *st) options->EmitNoIndirectUniform = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_INDIRECT_CONST_ADDR); - if (pc->MaxNativeInstructions) { - if (options->EmitNoIndirectUniform) + if (pc->MaxNativeInstructions && + (options->EmitNoIndirectUniform || pc->MaxUniformBlocks < 12)) { can_ubo = FALSE; - - max_const_buffers = screen->get_shader_param(screen, sh, - PIPE_SHADER_CAP_MAX_CONST_BUFFERS); - /* we need 13 buffers - 1 constant, 12 UBO */ - if (max_const_buffers < 13) - can_ubo = FALSE; } if (options->EmitNoLoops) @@ -238,11 +240,20 @@ void st_init_limits(struct st_context *st) options->LowerClipDistance = true; } + /* This depends on program constants. */ + c->MaxTextureCoordUnits + = _min(c->FragmentProgram.MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); + + c->MaxTextureUnits = _min(c->FragmentProgram.MaxTextureImageUnits, c->MaxTextureCoordUnits); + + c->VertexProgram.MaxAttribs = MIN2(c->VertexProgram.MaxAttribs, 16); + /* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number * of inputs. It's always 2 colors + N generic inputs. */ c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS); c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING); + c->MaxVaryingComponents = c->MaxVarying * 4; c->MinProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET); c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET); @@ -267,8 +278,13 @@ void st_init_limits(struct st_context *st) if (can_ubo) { st->ctx->Extensions.ARB_uniform_buffer_object = GL_TRUE; - st->ctx->Const.UniformBufferOffsetAlignment = + c->UniformBufferOffsetAlignment = screen->get_param(screen, PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT); + c->MaxCombinedUniformBlocks = c->MaxUniformBufferBindings = + c->VertexProgram.MaxUniformBlocks + + c->GeometryProgram.MaxUniformBlocks + + c->FragmentProgram.MaxUniformBlocks; + assert(c->MaxCombinedUniformBlocks <= MAX_COMBINED_UNIFORM_BUFFERS); } } @@ -398,7 +414,8 @@ void st_init_extensions(struct st_context *st) { o(MESA_texture_array), PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS }, { o(OES_standard_derivatives), PIPE_CAP_SM3 }, - { o(ARB_texture_cube_map_array), PIPE_CAP_CUBE_MAP_ARRAY } + { o(ARB_texture_cube_map_array), PIPE_CAP_CUBE_MAP_ARRAY }, + { o(ARB_texture_multisample), PIPE_CAP_TEXTURE_MULTISAMPLE } }; /* Required: render target and sampler support */ @@ -658,10 +675,33 @@ void st_init_extensions(struct st_context *st) /* Maximum sample count. */ for (i = 16; i > 0; --i) { - if (screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_TEXTURE_2D, i, - PIPE_BIND_RENDER_TARGET)) { + enum pipe_format pformat = st_choose_format(st, GL_RGBA, + GL_NONE, GL_NONE, + PIPE_TEXTURE_2D, i, + PIPE_BIND_RENDER_TARGET, FALSE); + if (pformat != PIPE_FORMAT_NONE) { ctx->Const.MaxSamples = i; + ctx->Const.MaxColorTextureSamples = i; + break; + } + } + for (i = ctx->Const.MaxSamples; i > 0; --i) { + enum pipe_format pformat = st_choose_format(st, GL_DEPTH_STENCIL, + GL_NONE, GL_NONE, + PIPE_TEXTURE_2D, i, + PIPE_BIND_DEPTH_STENCIL, FALSE); + if (pformat != PIPE_FORMAT_NONE) { + ctx->Const.MaxDepthTextureSamples = i; + break; + } + } + for (i = ctx->Const.MaxSamples; i > 0; --i) { + enum pipe_format pformat = st_choose_format(st, GL_RGBA_INTEGER, + GL_NONE, GL_NONE, + PIPE_TEXTURE_2D, i, + PIPE_BIND_RENDER_TARGET, FALSE); + if (pformat != PIPE_FORMAT_NONE) { + ctx->Const.MaxIntegerSamples = i; break; } } @@ -689,7 +729,10 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.ARB_transform_feedback_instanced = GL_TRUE; } if (st->options.force_glsl_extensions_warn) - ctx->Const.ForceGLSLExtensionsWarn = 1; + ctx->Const.ForceGLSLExtensionsWarn = 1; + + if (st->options.disable_glsl_line_continuations) + ctx->Const.DisableGLSLLineContinuations = 1; ctx->Const.MinMapBufferAlignment = screen->get_param(screen, PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT); @@ -699,6 +742,9 @@ void st_init_extensions(struct st_context *st) if (screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS)) { ctx->Extensions.ARB_texture_buffer_object = GL_TRUE; + ctx->Const.MaxTextureBufferSize = + _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE), + (1u << 31) - 1); ctx->Const.TextureBufferOffsetAlignment = screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT); diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c index a15706a03..56f3a4a48 100644 --- a/mesalib/src/mesa/state_tracker/st_format.c +++ b/mesalib/src/mesa/state_tracker/st_format.c @@ -38,7 +38,6 @@ #include "main/texstore.h" #include "main/image.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" @@ -1801,41 +1800,6 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target, } -GLboolean -st_sampler_compat_formats(enum pipe_format format1, enum pipe_format format2) -{ - if (format1 == format2) - return GL_TRUE; - - if (format1 == PIPE_FORMAT_B8G8R8A8_UNORM && - format2 == PIPE_FORMAT_B8G8R8X8_UNORM) - return GL_TRUE; - - if (format1 == PIPE_FORMAT_B8G8R8X8_UNORM && - format2 == PIPE_FORMAT_B8G8R8A8_UNORM) - return GL_TRUE; - - if (format1 == PIPE_FORMAT_A8B8G8R8_UNORM && - format2 == PIPE_FORMAT_X8B8G8R8_UNORM) - return GL_TRUE; - - if (format1 == PIPE_FORMAT_X8B8G8R8_UNORM && - format2 == PIPE_FORMAT_A8B8G8R8_UNORM) - return GL_TRUE; - - if (format1 == PIPE_FORMAT_A8R8G8B8_UNORM && - format2 == PIPE_FORMAT_X8R8G8B8_UNORM) - return GL_TRUE; - - if (format1 == PIPE_FORMAT_X8R8G8B8_UNORM && - format2 == PIPE_FORMAT_A8R8G8B8_UNORM) - return GL_TRUE; - - return GL_FALSE; -} - - - /** * This is used for translating texture border color and the clear * color. For example, the clear color is interpreted according to diff --git a/mesalib/src/mesa/state_tracker/st_format.h b/mesalib/src/mesa/state_tracker/st_format.h index 0a1c18d92..6e97dcb96 100644 --- a/mesalib/src/mesa/state_tracker/st_format.h +++ b/mesalib/src/mesa/state_tracker/st_format.h @@ -70,10 +70,6 @@ size_t st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target, GLenum internalFormat, int samples[16]); -/* can we use a sampler view to translate these formats - only used to make TFP so far */ -extern GLboolean -st_sampler_compat_formats(enum pipe_format format1, enum pipe_format format2); extern void diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c index 8ce2e06a2..e5512af2a 100644 --- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c +++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c @@ -172,6 +172,7 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, oldTex->height0, oldTex->depth0, oldTex->array_size, + 0, oldTex->bind); /* This will copy the old texture's base image into the new texture diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 338c652cb..f8176eb77 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -1945,8 +1945,6 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir) if (ir->type->base_type == GLSL_TYPE_BOOL) { emit(ir, TGSI_OPCODE_USNE, result_dst, cbuf, st_src_reg_for_int(0)); - result_src.negate = 1; - emit(ir, TGSI_OPCODE_UCMP, result_dst, result_src, st_src_reg_for_int(~0), st_src_reg_for_int(0)); } else { emit(ir, TGSI_OPCODE_MOV, result_dst, cbuf); } @@ -1969,7 +1967,17 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir) case ir_unop_unpack_snorm_4x8: case ir_unop_unpack_unorm_4x8: case ir_binop_pack_half_2x16_split: + case ir_unop_bitfield_reverse: + case ir_unop_bit_count: + case ir_unop_find_msb: + case ir_unop_find_lsb: + case ir_binop_bfm: + case ir_triop_bfi: + case ir_triop_bitfield_extract: + case ir_quadop_bitfield_insert: case ir_quadop_vector: + case ir_binop_vector_extract: + case ir_triop_vector_insert: /* This operation is not supported, or should have already been handled. */ assert(!"Invalid ir opcode in glsl_to_tgsi_visitor::visit()"); @@ -2388,8 +2396,8 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir) if (native_integers) { /* This is necessary because TGSI's CMP instruction expects the * condition to be a float, and we store booleans as integers. - * If TGSI had a UCMP instruction or similar, this extra - * instruction would not be necessary. + * TODO: really want to avoid i2f path and use UCMP. Requires + * changes to process_move_condition though too. */ condition_temp = get_temp(glsl_type::vec4_type); condition.negate = 0; @@ -2683,7 +2691,7 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) void glsl_to_tgsi_visitor::visit(ir_texture *ir) { - st_src_reg result_src, coord, cube_sc, lod_info, projector, dx, dy, offset; + st_src_reg result_src, coord, cube_sc, lod_info, projector, dx, dy, offset, sample_index; st_dst_reg result_dst, coord_dst, cube_sc_dst; glsl_to_tgsi_instruction *inst = NULL; unsigned opcode = TGSI_OPCODE_NOP; @@ -2706,6 +2714,7 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir) */ coord = get_temp(glsl_type::vec4_type); coord_dst = st_dst_reg(coord); + coord_dst.writemask = (1 << ir->coordinate->type->vector_elements) - 1; emit(ir, TGSI_OPCODE_MOV, coord_dst, this->result); } @@ -2772,7 +2781,9 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir) } break; case ir_txf_ms: - assert(!"Unexpected ir_txf_ms opcode"); + opcode = TGSI_OPCODE_TXF; + ir->lod_info.sample_index->accept(this); + sample_index = this->result; break; case ir_lod: assert(!"Unexpected ir_lod opcode"); @@ -2859,7 +2870,11 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir) } } - if (opcode == TGSI_OPCODE_TXL || opcode == TGSI_OPCODE_TXB || + if (ir->op == ir_txf_ms) { + coord_dst.writemask = WRITEMASK_W; + emit(ir, TGSI_OPCODE_MOV, coord_dst, sample_index); + coord_dst.writemask = WRITEMASK_XYZW; + } else if (opcode == TGSI_OPCODE_TXL || opcode == TGSI_OPCODE_TXB || opcode == TGSI_OPCODE_TXF) { /* TGSI stores LOD or LOD bias in the last channel of the coords. */ coord_dst.writemask = WRITEMASK_W; @@ -2921,6 +2936,10 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir) case GLSL_SAMPLER_DIM_EXTERNAL: inst->tex_target = TEXTURE_EXTERNAL_INDEX; break; + case GLSL_SAMPLER_DIM_MS: + inst->tex_target = (sampler_type->sampler_array) + ? TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX : TEXTURE_2D_MULTISAMPLE_INDEX; + break; default: assert(!"Should not get here."); } @@ -2967,12 +2986,15 @@ glsl_to_tgsi_visitor::visit(ir_discard *ir) void glsl_to_tgsi_visitor::visit(ir_if *ir) { + unsigned if_opcode; glsl_to_tgsi_instruction *if_inst; ir->condition->accept(this); assert(this->result.file != PROGRAM_UNDEFINED); - if_inst = emit(ir->condition, TGSI_OPCODE_IF, undef_dst, this->result); + if_opcode = native_integers ? TGSI_OPCODE_UIF : TGSI_OPCODE_IF; + + if_inst = emit(ir->condition, if_opcode, undef_dst, this->result); this->instructions.push_tail(if_inst); @@ -3451,6 +3473,7 @@ glsl_to_tgsi_visitor::copy_propagate(void) break; case TGSI_OPCODE_IF: + case TGSI_OPCODE_UIF: ++level; break; @@ -3529,6 +3552,8 @@ glsl_to_tgsi_visitor::copy_propagate(void) /* If this is a copy, add it to the ACP. */ if (inst->op == TGSI_OPCODE_MOV && inst->dst.file == PROGRAM_TEMPORARY && + !(inst->dst.file == inst->src[0].file && + inst->dst.index == inst->src[0].index) && !inst->dst.reladdr && !inst->saturate && !inst->src[0].reladdr && @@ -3653,6 +3678,7 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void) break; case TGSI_OPCODE_IF: + case TGSI_OPCODE_UIF: ++level; /* fallthrough to default case to mark the condition as read */ @@ -4378,6 +4404,7 @@ compile_tgsi_instruction(struct st_translate *t, case TGSI_OPCODE_ELSE: case TGSI_OPCODE_ENDLOOP: case TGSI_OPCODE_IF: + case TGSI_OPCODE_UIF: assert(num_dst == 0); ureg_label_insn(ureg, inst->op, @@ -4903,7 +4930,7 @@ st_translate_program( assert(i == program->num_immediates); /* texture samplers */ - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { if (program->samplers_used & (1 << i)) { t->samplers[i] = ureg_DECL_sampler(ureg, i); } @@ -5216,6 +5243,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) lower_ubo_reference(prog->_LinkedShaders[i], ir); do_vec_index_to_cond_assign(ir); + lower_vector_insert(ir, true); lower_quadop_vector(ir, false); lower_noise(ir); if (options->MaxIfDepth == 0) { @@ -5228,7 +5256,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress; progress = do_common_optimization(ir, true, true, - options->MaxUnrollIterations) + options->MaxUnrollIterations, options) || progress; progress = lower_if_to_cond_assign(ir, options->MaxIfDepth) || progress; diff --git a/mesalib/src/mesa/state_tracker/st_manager.c b/mesalib/src/mesa/state_tracker/st_manager.c index 03e086a72..9e537f3c4 100644 --- a/mesalib/src/mesa/state_tracker/st_manager.c +++ b/mesalib/src/mesa/state_tracker/st_manager.c @@ -28,7 +28,6 @@ #include "main/mtypes.h" #include "main/context.h" -#include "main/mfeatures.h" #include "main/texobj.h" #include "main/teximage.h" #include "main/texstate.h" @@ -454,7 +453,7 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags, struct pipe_fence_handle **fence) { struct st_context *st = (struct st_context *) stctxi; - enum pipe_flush_flags pipe_flags = 0; + unsigned pipe_flags = 0; if (flags & ST_FLUSH_END_OF_FRAME) { pipe_flags |= PIPE_FLUSH_END_OF_FRAME; @@ -468,7 +467,7 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags, static boolean st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type tex_type, - int level, enum pipe_format internal_format, + int level, enum pipe_format pipe_format, struct pipe_resource *tex, boolean mipmap) { struct st_context *st = (struct st_context *) stctxi; @@ -512,29 +511,13 @@ st_context_teximage(struct st_context_iface *stctxi, texImage = _mesa_get_tex_image(ctx, texObj, target, level); stImage = st_texture_image(texImage); if (tex) { - gl_format texFormat; - - /* - * XXX When internal_format and tex->format differ, st_finalize_texture - * needs to allocate a new texture with internal_format and copy the - * texture here into the new one. It will result in surface_copy being - * called on surfaces whose formats differ. - * - * To avoid that, internal_format is (wrongly) ignored here. A sane fix - * is to use a sampler view. - */ - if (!st_sampler_compat_formats(tex->format, internal_format)) - internal_format = tex->format; - - if (util_format_get_component_bits(internal_format, - UTIL_FORMAT_COLORSPACE_RGB, 3) > 0) + gl_format texFormat = st_pipe_format_to_mesa_format(pipe_format); + + if (util_format_has_alpha(tex->format)) internalFormat = GL_RGBA; else internalFormat = GL_RGB; - texFormat = st_ChooseTextureFormat(ctx, target, internalFormat, - GL_BGRA, GL_UNSIGNED_BYTE); - _mesa_init_teximage_fields(ctx, texImage, tex->width0, tex->height0, 1, 0, internalFormat, texFormat); @@ -563,6 +546,7 @@ st_context_teximage(struct st_context_iface *stctxi, stObj->width0 = width; stObj->height0 = height; stObj->depth0 = depth; + stObj->surface_format = pipe_format; _mesa_dirty_texobj(ctx, texObj, GL_TRUE); _mesa_unlock_texture(ctx, texObj); @@ -884,16 +868,10 @@ st_manager_add_color_renderbuffer(struct st_context *st, static const struct st_api st_gl_api = { "Mesa " PACKAGE_VERSION, ST_API_OPENGL, -#if FEATURE_GL ST_PROFILE_DEFAULT_MASK | ST_PROFILE_OPENGL_CORE_MASK | -#endif -#if FEATURE_ES1 ST_PROFILE_OPENGL_ES1_MASK | -#endif -#if FEATURE_ES2 ST_PROFILE_OPENGL_ES2_MASK | -#endif 0, ST_API_FEATURE_MS_VISUALS_MASK, st_api_destroy, diff --git a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c index 3831a0a79..dd9f4fc53 100644 --- a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -269,6 +269,8 @@ st_translate_texture_target( GLuint textarget, } switch( textarget ) { + case TEXTURE_2D_MULTISAMPLE_INDEX: return TGSI_TEXTURE_2D_MSAA; + case TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX: return TGSI_TEXTURE_2D_ARRAY_MSAA; case TEXTURE_BUFFER_INDEX: return TGSI_TEXTURE_BUFFER; case TEXTURE_1D_INDEX: return TGSI_TEXTURE_1D; case TEXTURE_2D_INDEX: return TGSI_TEXTURE_2D; @@ -554,8 +556,6 @@ translate_opcode( unsigned op ) return TGSI_OPCODE_DDY; case OPCODE_DP2: return TGSI_OPCODE_DP2; - case OPCODE_DP2A: - return TGSI_OPCODE_DP2A; case OPCODE_DP3: return TGSI_OPCODE_DP3; case OPCODE_DP4: @@ -608,10 +608,6 @@ translate_opcode( unsigned op ) return TGSI_OPCODE_MUL; case OPCODE_NOP: return TGSI_OPCODE_NOP; - case OPCODE_NRM3: - return TGSI_OPCODE_NRM; - case OPCODE_NRM4: - return TGSI_OPCODE_NRM4; case OPCODE_POW: return TGSI_OPCODE_POW; case OPCODE_RCP: @@ -663,6 +659,7 @@ translate_opcode( unsigned op ) static void compile_instruction( + struct gl_context *ctx, struct st_translate *t, const struct prog_instruction *inst, boolean clamp_dst_color_output) @@ -695,7 +692,6 @@ compile_instruction( case OPCODE_CAL: case OPCODE_ELSE: case OPCODE_ENDLOOP: - case OPCODE_IF: debug_assert(num_dst == 0); ureg_label_insn( ureg, translate_opcode( inst->Opcode ), @@ -703,6 +699,14 @@ compile_instruction( get_label( t, inst->BranchTarget )); return; + case OPCODE_IF: + debug_assert(num_dst == 0); + ureg_label_insn( ureg, + ctx->Const.NativeIntegers ? TGSI_OPCODE_UIF : TGSI_OPCODE_IF, + src, num_src, + get_label( t, inst->BranchTarget )); + return; + case OPCODE_TEX: case OPCODE_TXB: case OPCODE_TXD: @@ -1217,7 +1221,7 @@ st_translate_mesa_program( } /* texture samplers */ - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { if (program->SamplersUsed & (1 << i)) { t->samplers[i] = ureg_DECL_sampler( ureg, i ); } @@ -1227,7 +1231,7 @@ st_translate_mesa_program( */ for (i = 0; i < program->NumInstructions; i++) { set_insn_start( t, ureg_get_instruction_number( ureg )); - compile_instruction( t, &program->Instructions[i], clamp_color ); + compile_instruction( ctx, t, &program->Instructions[i], clamp_color ); } /* Fix up all emitted labels: diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c index 7a38da84f..60cc37cf8 100644 --- a/mesalib/src/mesa/state_tracker/st_program.c +++ b/mesalib/src/mesa/state_tracker/st_program.c @@ -33,7 +33,6 @@ #include "main/imports.h" #include "main/hash.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "program/prog_parameter.h" #include "program/prog_print.h" diff --git a/mesalib/src/mesa/state_tracker/st_texture.c b/mesalib/src/mesa/state_tracker/st_texture.c index ed3709848..9a271826e 100644 --- a/mesalib/src/mesa/state_tracker/st_texture.c +++ b/mesalib/src/mesa/state_tracker/st_texture.c @@ -60,6 +60,7 @@ st_texture_create(struct st_context *st, GLuint height0, GLuint depth0, GLuint layers, + GLuint nr_samples, GLuint bind ) { struct pipe_resource pt, *newtex; @@ -90,6 +91,7 @@ st_texture_create(struct st_context *st, pt.usage = PIPE_USAGE_DEFAULT; pt.bind = bind; pt.flags = 0; + pt.nr_samples = nr_samples; newtex = screen->resource_create(screen, &pt); @@ -138,6 +140,8 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture, case GL_TEXTURE_RECTANGLE: case GL_PROXY_TEXTURE_RECTANGLE: case GL_TEXTURE_EXTERNAL_OES: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_2D_MULTISAMPLE: assert(depthIn == 1); *widthOut = widthIn; *heightOut = heightIn; @@ -159,7 +163,9 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture, *layersOut = 6; break; case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: case GL_PROXY_TEXTURE_2D_ARRAY: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: *widthOut = widthIn; *heightOut = heightIn; *depthOut = 1; @@ -402,7 +408,7 @@ st_create_color_map_texture(struct gl_context *ctx) /* create texture for color map/table */ pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0, - texSize, texSize, 1, 1, PIPE_BIND_SAMPLER_VIEW); + texSize, texSize, 1, 1, 0, PIPE_BIND_SAMPLER_VIEW); return pt; } diff --git a/mesalib/src/mesa/state_tracker/st_texture.h b/mesalib/src/mesa/state_tracker/st_texture.h index 8a701009a..c15aeaea6 100644 --- a/mesalib/src/mesa/state_tracker/st_texture.h +++ b/mesalib/src/mesa/state_tracker/st_texture.h @@ -87,10 +87,16 @@ struct st_texture_object */ struct pipe_sampler_view *sampler_view; - /* True if there is/was a surface bound to this texture object. It helps - * track whether the texture object is surface based or not. + /* True if this texture comes from the window system. Such a texture + * cannot be reallocated and the format can only be changed with a sampler + * view or a surface. */ GLboolean surface_based; + + /* If surface_based is true, this format should be used for all sampler + * views and surfaces instead of pt->format. + */ + enum pipe_format surface_format; }; @@ -153,6 +159,7 @@ st_texture_create(struct st_context *st, GLuint height0, GLuint depth0, GLuint layers, + GLuint nr_samples, GLuint tex_usage ); diff --git a/mesalib/src/mesa/swrast/s_aaline.c b/mesalib/src/mesa/swrast/s_aaline.c index dcc9e3a5c..6729c53fc 100644 --- a/mesalib/src/mesa/swrast/s_aaline.c +++ b/mesalib/src/mesa/swrast/s_aaline.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_aaline.h b/mesalib/src/mesa/swrast/s_aaline.h index 74d5518e1..8ff1d7da3 100644 --- a/mesalib/src/mesa/swrast/s_aaline.h +++ b/mesalib/src/mesa/swrast/s_aaline.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_aalinetemp.h b/mesalib/src/mesa/swrast/s_aalinetemp.h index 75e28f417..26efaa3e2 100644 --- a/mesalib/src/mesa/swrast/s_aalinetemp.h +++ b/mesalib/src/mesa/swrast/s_aalinetemp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_aatriangle.c b/mesalib/src/mesa/swrast/s_aatriangle.c index b59177fa7..02d49b9bd 100644 --- a/mesalib/src/mesa/swrast/s_aatriangle.c +++ b/mesalib/src/mesa/swrast/s_aatriangle.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_aatriangle.h b/mesalib/src/mesa/swrast/s_aatriangle.h index e40efb198..b5df414d9 100644 --- a/mesalib/src/mesa/swrast/s_aatriangle.h +++ b/mesalib/src/mesa/swrast/s_aatriangle.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_aatritemp.h b/mesalib/src/mesa/swrast/s_aatritemp.h index 4581248fd..a400364d3 100644 --- a/mesalib/src/mesa/swrast/s_aatritemp.h +++ b/mesalib/src/mesa/swrast/s_aatritemp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_alpha.c b/mesalib/src/mesa/swrast/s_alpha.c index 1ceda531c..3f12552fd 100644 --- a/mesalib/src/mesa/swrast/s_alpha.c +++ b/mesalib/src/mesa/swrast/s_alpha.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/swrast/s_alpha.h b/mesalib/src/mesa/swrast/s_alpha.h index fca209a44..6c8728daa 100644 --- a/mesalib/src/mesa/swrast/s_alpha.h +++ b/mesalib/src/mesa/swrast/s_alpha.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_bitmap.c b/mesalib/src/mesa/swrast/s_bitmap.c index 3a2792913..6d397da86 100644 --- a/mesalib/src/mesa/swrast/s_bitmap.c +++ b/mesalib/src/mesa/swrast/s_bitmap.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/swrast/s_blend.c b/mesalib/src/mesa/swrast/s_blend.c index 54fffbb45..4423d5b17 100644 --- a/mesalib/src/mesa/swrast/s_blend.c +++ b/mesalib/src/mesa/swrast/s_blend.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_blend.h b/mesalib/src/mesa/swrast/s_blend.h index 69cd89e7a..32f921352 100644 --- a/mesalib/src/mesa/swrast/s_blend.h +++ b/mesalib/src/mesa/swrast/s_blend.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_blit.c b/mesalib/src/mesa/swrast/s_blit.c index 051354dc8..0c8cfe551 100644 --- a/mesalib/src/mesa/swrast/s_blit.c +++ b/mesalib/src/mesa/swrast/s_blit.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -188,6 +189,12 @@ blit_nearest(struct gl_context *ctx, return; } + /* allocate the src/dst row buffers */ + srcBuffer = malloc(MAX_PIXEL_BYTES * srcWidth); + dstBuffer = malloc(MAX_PIXEL_BYTES * dstWidth); + if (!srcBuffer || !dstBuffer) + goto fail_no_memory; + /* Blit to all the draw buffers */ for (i = 0; i < numDrawBuffers; i++) { if (buffer == GL_COLOR_BUFFER_BIT) { @@ -229,7 +236,7 @@ blit_nearest(struct gl_context *ctx, default: _mesa_problem(ctx, "unexpected pixel size (%d) in blit_nearest", pixelSize); - return; + goto fail; } if ((readRb == drawRb) || @@ -248,8 +255,7 @@ blit_nearest(struct gl_context *ctx, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, &map, &rowStride); if (!map) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFramebuffer"); - return; + goto fail_no_memory; } srcMap = map + srcYpos * rowStride + srcXpos * formatSize; @@ -276,8 +282,7 @@ blit_nearest(struct gl_context *ctx, srcWidth, srcHeight, GL_MAP_READ_BIT, &srcMap, &srcRowStride); if (!srcMap) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFramebuffer"); - return; + goto fail_no_memory; } ctx->Driver.MapRenderbuffer(ctx, drawRb, dstXpos, dstYpos, @@ -285,24 +290,10 @@ blit_nearest(struct gl_context *ctx, GL_MAP_WRITE_BIT, &dstMap, &dstRowStride); if (!dstMap) { ctx->Driver.UnmapRenderbuffer(ctx, readRb); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFramebuffer"); - return; + goto fail_no_memory; } } - /* allocate the src/dst row buffers */ - srcBuffer = malloc(pixelSize * srcWidth); - if (!srcBuffer) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - dstBuffer = malloc(pixelSize * dstWidth); - if (!dstBuffer) { - free(srcBuffer); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - for (dstRow = 0; dstRow < dstHeight; dstRow++) { GLfloat srcRowF = (dstRow + 0.5F) / dstHeight * srcHeight - 0.5F; GLint srcRow = IROUND(srcRowF); @@ -369,14 +360,21 @@ blit_nearest(struct gl_context *ctx, } } - free(srcBuffer); - free(dstBuffer); - ctx->Driver.UnmapRenderbuffer(ctx, readRb); if (drawRb != readRb) { ctx->Driver.UnmapRenderbuffer(ctx, drawRb); } } + +fail: + free(srcBuffer); + free(dstBuffer); + return; + +fail_no_memory: + free(srcBuffer); + free(dstBuffer); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBuffer"); } @@ -564,22 +562,10 @@ blit_linear(struct gl_context *ctx, * Keep two adjacent src rows around for bilinear sampling. */ srcBuffer0 = malloc(pixelSize * srcWidth); - if (!srcBuffer0) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } srcBuffer1 = malloc(pixelSize * srcWidth); - if (!srcBuffer1) { - free(srcBuffer0); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } dstBuffer = malloc(pixelSize * dstWidth); - if (!dstBuffer) { - free(srcBuffer0); - free(srcBuffer1); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; + if (!srcBuffer0 || !srcBuffer1 || !dstBuffer) { + goto fail_no_memory; } for (i = 0; i < drawFb->_NumColorDrawBuffers; i++) { @@ -610,11 +596,7 @@ blit_linear(struct gl_context *ctx, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, &srcMap, &srcRowStride); if (!srcMap) { - free(srcBuffer0); - free(srcBuffer1); - free(dstBuffer); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFramebuffer"); - return; + goto fail_no_memory; } dstMap = srcMap; @@ -629,22 +611,14 @@ blit_linear(struct gl_context *ctx, 0, 0, readRb->Width, readRb->Height, GL_MAP_READ_BIT, &srcMap, &srcRowStride); if (!srcMap) { - free(srcBuffer0); - free(srcBuffer1); - free(dstBuffer); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFramebuffer"); - return; + goto fail_no_memory; } ctx->Driver.MapRenderbuffer(ctx, drawRb, 0, 0, drawRb->Width, drawRb->Height, GL_MAP_WRITE_BIT, &dstMap, &dstRowStride); if (!dstMap) { ctx->Driver.UnmapRenderbuffer(ctx, readRb); - free(srcBuffer0); - free(srcBuffer1); - free(dstBuffer); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFramebuffer"); - return; + goto fail_no_memory; } } @@ -734,15 +708,22 @@ blit_linear(struct gl_context *ctx, } } - free(srcBuffer0); - free(srcBuffer1); - free(dstBuffer); - ctx->Driver.UnmapRenderbuffer(ctx, readRb); if (drawRb != readRb) { ctx->Driver.UnmapRenderbuffer(ctx, drawRb); } } + + free(srcBuffer0); + free(srcBuffer1); + free(dstBuffer); + return; + +fail_no_memory: + free(srcBuffer0); + free(srcBuffer1); + free(dstBuffer); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFramebuffer"); } diff --git a/mesalib/src/mesa/swrast/s_chan.h b/mesalib/src/mesa/swrast/s_chan.h index 1db7fae4d..38daf6575 100644 --- a/mesalib/src/mesa/swrast/s_chan.h +++ b/mesalib/src/mesa/swrast/s_chan.h @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/swrast/s_clear.c b/mesalib/src/mesa/swrast/s_clear.c index d942e6e63..58b36e8a2 100644 --- a/mesalib/src/mesa/swrast/s_clear.c +++ b/mesalib/src/mesa/swrast/s_clear.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c index 11e906436..70bbb83dc 100644 --- a/mesalib/src/mesa/swrast/s_context.c +++ b/mesalib/src/mesa/swrast/s_context.c @@ -17,13 +17,13 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: - * Keith Whitwell <keith@tungstengraphics.com> - * Brian Paul + * Keith Whitwell <keith@tungstengraphics.com> Brian Paul */ #include "main/imports.h" @@ -459,7 +459,7 @@ _swrast_invalidate_state( struct gl_context *ctx, GLbitfield new_state ) swrast->BlendFunc = _swrast_validate_blend_func; if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC) - for (i = 0 ; i < ctx->Const.MaxTextureImageUnits ; i++) + for (i = 0 ; i < ARRAY_SIZE(swrast->TextureSample); i++) swrast->TextureSample[i] = NULL; } @@ -473,7 +473,7 @@ _swrast_update_texture_samplers(struct gl_context *ctx) if (!swrast) return; /* pipe hack */ - for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) { + for (u = 0; u < ARRAY_SIZE(swrast->TextureSample); u++) { struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current; /* Note: If tObj is NULL, the sample function will be a simple * function that just returns opaque black (0,0,0,1). @@ -766,7 +766,7 @@ _swrast_CreateContext( struct gl_context *ctx ) swrast->Driver.SpanRenderStart = _swrast_span_render_start; swrast->Driver.SpanRenderFinish = _swrast_span_render_finish; - for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) + for (i = 0; i < ARRAY_SIZE(swrast->TextureSample); i++) swrast->TextureSample[i] = NULL; /* SpanArrays is global and shared by all SWspan instances. However, when diff --git a/mesalib/src/mesa/swrast/s_context.h b/mesalib/src/mesa/swrast/s_context.h index 2f7a2b531..9520185b2 100644 --- a/mesalib/src/mesa/swrast/s_context.h +++ b/mesalib/src/mesa/swrast/s_context.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -137,11 +138,24 @@ struct swrast_texture_image /** used for mipmap LOD computation */ GLfloat WidthScale, HeightScale, DepthScale; - /** These fields only valid when texture memory is mapped */ - GLint RowStride; /**< Padded width in units of texels */ - GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to - each 2D slice in 'Data', in texels */ - GLubyte *Map; /**< Pointer to mapped image memory */ + /** + * Byte stride between rows in ImageSlices. + * + * For compressed textures, this is the byte stride between one row of + * blocks and the next row of blocks. + * + * Only valid while one of the ImageSlices is mapped, and must be the same + * between all slices. + */ + GLint RowStride; + /** + * When a texture image is mapped for swrast, this array contains pointers + * to the beginning of each slice. + * + * For swrast-allocated textures, these pointers will always stay + * initialized to point within Buffer. + */ + void **ImageSlices; /** Malloc'd texture memory */ GLubyte *Buffer; @@ -299,7 +313,7 @@ typedef struct /** Internal hooks, kept up to date by the same mechanism as above. */ blend_func BlendFunc; - texture_sample_func TextureSample[MAX_TEXTURE_IMAGE_UNITS]; + texture_sample_func TextureSample[MAX_COMBINED_TEXTURE_IMAGE_UNITS]; /** Buffer for saving the sampled texture colors. * Needed for GL_ARB_texture_env_crossbar implementation. @@ -379,6 +393,9 @@ _swrast_map_textures(struct gl_context *ctx); extern void _swrast_unmap_textures(struct gl_context *ctx); +extern unsigned int +_swrast_teximage_slice_height(struct gl_texture_image *texImage); + extern void _swrast_map_texture(struct gl_context *ctx, struct gl_texture_object *texObj); diff --git a/mesalib/src/mesa/swrast/s_copypix.c b/mesalib/src/mesa/swrast/s_copypix.c index 1d8926179..57bdce0d2 100644 --- a/mesalib/src/mesa/swrast/s_copypix.c +++ b/mesalib/src/mesa/swrast/s_copypix.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_depth.c b/mesalib/src/mesa/swrast/s_depth.c index 969b75f07..4d2a6bd36 100644 --- a/mesalib/src/mesa/swrast/s_depth.c +++ b/mesalib/src/mesa/swrast/s_depth.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_depth.h b/mesalib/src/mesa/swrast/s_depth.h index 25a7a0bbf..987c7af2b 100644 --- a/mesalib/src/mesa/swrast/s_depth.h +++ b/mesalib/src/mesa/swrast/s_depth.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_drawpix.c b/mesalib/src/mesa/swrast/s_drawpix.c index 3d23f912f..41b50ab71 100644 --- a/mesalib/src/mesa/swrast/s_drawpix.c +++ b/mesalib/src/mesa/swrast/s_drawpix.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_feedback.c b/mesalib/src/mesa/swrast/s_feedback.c index 00467e54f..67d84753e 100644 --- a/mesalib/src/mesa/swrast/s_feedback.c +++ b/mesalib/src/mesa/swrast/s_feedback.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" diff --git a/mesalib/src/mesa/swrast/s_feedback.h b/mesalib/src/mesa/swrast/s_feedback.h index 6bfd49735..62b9a38d6 100644 --- a/mesalib/src/mesa/swrast/s_feedback.h +++ b/mesalib/src/mesa/swrast/s_feedback.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_fog.c b/mesalib/src/mesa/swrast/s_fog.c index 57a6a8e61..1a2ef1d50 100644 --- a/mesalib/src/mesa/swrast/s_fog.c +++ b/mesalib/src/mesa/swrast/s_fog.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_fog.h b/mesalib/src/mesa/swrast/s_fog.h index 9f93b7050..d4d31e4f5 100644 --- a/mesalib/src/mesa/swrast/s_fog.h +++ b/mesalib/src/mesa/swrast/s_fog.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_fragprog.c b/mesalib/src/mesa/swrast/s_fragprog.c index 1ce2ee452..e7e1b8582 100644 --- a/mesalib/src/mesa/swrast/s_fragprog.c +++ b/mesalib/src/mesa/swrast/s_fragprog.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" diff --git a/mesalib/src/mesa/swrast/s_fragprog.h b/mesalib/src/mesa/swrast/s_fragprog.h index ac1f5ff4c..0522c6c7f 100644 --- a/mesalib/src/mesa/swrast/s_fragprog.h +++ b/mesalib/src/mesa/swrast/s_fragprog.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_lines.c b/mesalib/src/mesa/swrast/s_lines.c index 7364dd965..72c41369b 100644 --- a/mesalib/src/mesa/swrast/s_lines.c +++ b/mesalib/src/mesa/swrast/s_lines.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_lines.h b/mesalib/src/mesa/swrast/s_lines.h index a4c98a855..3d4453eb8 100644 --- a/mesalib/src/mesa/swrast/s_lines.h +++ b/mesalib/src/mesa/swrast/s_lines.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_linetemp.h b/mesalib/src/mesa/swrast/s_linetemp.h index 8feb8b120..f3ce6d95e 100644 --- a/mesalib/src/mesa/swrast/s_linetemp.h +++ b/mesalib/src/mesa/swrast/s_linetemp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_logic.c b/mesalib/src/mesa/swrast/s_logic.c index 93388d720..a111f6337 100644 --- a/mesalib/src/mesa/swrast/s_logic.c +++ b/mesalib/src/mesa/swrast/s_logic.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_logic.h b/mesalib/src/mesa/swrast/s_logic.h index 0a3adfca5..b5e11fbf8 100644 --- a/mesalib/src/mesa/swrast/s_logic.h +++ b/mesalib/src/mesa/swrast/s_logic.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_masking.c b/mesalib/src/mesa/swrast/s_masking.c index 8f5344650..d9d06b45b 100644 --- a/mesalib/src/mesa/swrast/s_masking.c +++ b/mesalib/src/mesa/swrast/s_masking.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_masking.h b/mesalib/src/mesa/swrast/s_masking.h index 5124509a0..0aa0755d1 100644 --- a/mesalib/src/mesa/swrast/s_masking.h +++ b/mesalib/src/mesa/swrast/s_masking.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_points.c b/mesalib/src/mesa/swrast/s_points.c index 80693be8e..7483a7716 100644 --- a/mesalib/src/mesa/swrast/s_points.c +++ b/mesalib/src/mesa/swrast/s_points.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_points.h b/mesalib/src/mesa/swrast/s_points.h index 0b6550e80..e356f063b 100644 --- a/mesalib/src/mesa/swrast/s_points.h +++ b/mesalib/src/mesa/swrast/s_points.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_renderbuffer.c b/mesalib/src/mesa/swrast/s_renderbuffer.c index 282b2c482..54b645e78 100644 --- a/mesalib/src/mesa/swrast/s_renderbuffer.c +++ b/mesalib/src/mesa/swrast/s_renderbuffer.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_renderbuffer.h b/mesalib/src/mesa/swrast/s_renderbuffer.h index 266ebd934..45c57fffd 100644 --- a/mesalib/src/mesa/swrast/s_renderbuffer.h +++ b/mesalib/src/mesa/swrast/s_renderbuffer.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_span.c b/mesalib/src/mesa/swrast/s_span.c index 7bb3b1f2b..cb755f9eb 100644 --- a/mesalib/src/mesa/swrast/s_span.c +++ b/mesalib/src/mesa/swrast/s_span.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_span.h b/mesalib/src/mesa/swrast/s_span.h index 6f710c533..0a5a6dc6c 100644 --- a/mesalib/src/mesa/swrast/s_span.h +++ b/mesalib/src/mesa/swrast/s_span.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_stencil.c b/mesalib/src/mesa/swrast/s_stencil.c index 3423737ee..a63a773cf 100644 --- a/mesalib/src/mesa/swrast/s_stencil.c +++ b/mesalib/src/mesa/swrast/s_stencil.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -28,6 +29,8 @@ #include "main/imports.h" #include "main/format_pack.h" #include "main/format_unpack.h" +#include "main/core.h" +#include "main/stencil.h" #include "s_context.h" #include "s_depth.h" @@ -128,7 +131,7 @@ apply_stencil_op(const struct gl_context *ctx, GLenum oper, GLuint face, GLuint n, GLubyte stencil[], const GLubyte mask[], GLint stride) { - const GLubyte ref = ctx->Stencil.Ref[face]; + const GLubyte ref = _mesa_get_stencil_ref(ctx, face); const GLubyte wrtmask = ctx->Stencil.WriteMask[face]; const GLubyte invmask = (GLubyte) (~wrtmask); GLuint i, j; @@ -215,7 +218,7 @@ do_stencil_test(struct gl_context *ctx, GLuint face, GLuint n, GLboolean allfail = GL_FALSE; GLuint i, j; const GLuint valueMask = ctx->Stencil.ValueMask[face]; - const GLubyte ref = (GLubyte) (ctx->Stencil.Ref[face] & valueMask); + const GLubyte ref = (GLubyte) (_mesa_get_stencil_ref(ctx, face) & valueMask); GLubyte s; /* diff --git a/mesalib/src/mesa/swrast/s_stencil.h b/mesalib/src/mesa/swrast/s_stencil.h index 113649a37..c92f0af3e 100644 --- a/mesalib/src/mesa/swrast/s_stencil.h +++ b/mesalib/src/mesa/swrast/s_stencil.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_texcombine.c b/mesalib/src/mesa/swrast/s_texcombine.c index c24807cb7..df3a74a06 100644 --- a/mesalib/src/mesa/swrast/s_texcombine.c +++ b/mesalib/src/mesa/swrast/s_texcombine.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -611,7 +612,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span ) * thread. */ swrast->TexelBuffer = - malloc(ctx->Const.MaxTextureImageUnits * maxThreads * + malloc(ctx->Const.FragmentProgram.MaxTextureImageUnits * maxThreads * SWRAST_MAX_WIDTH * 4 * sizeof(GLfloat)); if (!swrast->TexelBuffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine"); diff --git a/mesalib/src/mesa/swrast/s_texcombine.h b/mesalib/src/mesa/swrast/s_texcombine.h index 11049d86b..dd9151de2 100644 --- a/mesalib/src/mesa/swrast/s_texcombine.h +++ b/mesalib/src/mesa/swrast/s_texcombine.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c index 5e1a9f783..f6c269d8b 100644 --- a/mesalib/src/mesa/swrast/s_texfetch.c +++ b/mesalib/src/mesa/swrast/s_texfetch.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -97,10 +98,17 @@ static void fetch_compressed(const struct swrast_texture_image *swImage, GLint i, GLint j, GLint k, GLfloat *texel) { - swImage->FetchCompressedTexel(swImage->Map, - swImage->ImageOffsets, - swImage->RowStride, - i, j, k, texel); + /* The FetchCompressedTexel function takes an integer pixel rowstride, + * while the image's rowstride is bytes per row of blocks. + */ + GLuint bw, bh; + GLuint texelBytes = _mesa_get_format_bytes(swImage->Base.TexFormat); + _mesa_get_format_block_size(swImage->Base.TexFormat, &bw, &bh); + assert(swImage->RowStride * bw % texelBytes == 0); + + swImage->FetchCompressedTexel(swImage->ImageSlices[k], + swImage->RowStride * bw / texelBytes, + i, j, texel); } diff --git a/mesalib/src/mesa/swrast/s_texfetch.h b/mesalib/src/mesa/swrast/s_texfetch.h index 4e4397e13..dd37b066c 100644 --- a/mesalib/src/mesa/swrast/s_texfetch.h +++ b/mesalib/src/mesa/swrast/s_texfetch.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_texfetch_tmp.h b/mesalib/src/mesa/swrast/s_texfetch_tmp.h index 2de1f1a97..44fa8170b 100644 --- a/mesalib/src/mesa/swrast/s_texfetch_tmp.h +++ b/mesalib/src/mesa/swrast/s_texfetch_tmp.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -43,23 +44,24 @@ #if DIM == 1 #define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (j), (void) (k), ((type *)(image)->Map + (i) * (size))) + ((void) (j), (void) (k), ((type *)(image)->ImageSlices[0] + (i) * (size))) #define FETCH(x) fetch_texel_1d_##x #elif DIM == 2 #define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (k), \ - ((type *)(image)->Map + ((image)->RowStride * (j) + (i)) * (size))) + ((void) (k), \ + ((type *)((GLubyte *) (image)->ImageSlices[0] + (image)->RowStride * (j)) + \ + (i) * (size))) #define FETCH(x) fetch_texel_2d_##x #elif DIM == 3 #define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((type *)(image)->Map + ((image)->ImageOffsets[k] \ - + (image)->RowStride * (j) + (i)) * (size)) + ((type *)((GLubyte *) (image)->ImageSlices[k] + \ + (image)->RowStride * (j)) + (i) * (size)) #define FETCH(x) fetch_texel_3d_##x diff --git a/mesalib/src/mesa/swrast/s_texfilter.c b/mesalib/src/mesa/swrast/s_texfilter.c index ae3ffe5f4..fba8e6cba 100644 --- a/mesalib/src/mesa/swrast/s_texfilter.c +++ b/mesalib/src/mesa/swrast/s_texfilter.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -1435,7 +1436,7 @@ opt_sample_rgb_2d(struct gl_context *ctx, GLint i = IFLOOR(texcoords[k][0] * width) & colMask; GLint j = IFLOOR(texcoords[k][1] * height) & rowMask; GLint pos = (j << shift) | i; - GLubyte *texel = swImg->Map + 3 * pos; + GLubyte *texel = (GLubyte *) swImg->ImageSlices[0] + 3 * pos; rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[2]); rgba[k][GCOMP] = UBYTE_TO_FLOAT(texel[1]); rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[0]); @@ -1480,7 +1481,7 @@ opt_sample_rgba_2d(struct gl_context *ctx, const GLint col = IFLOOR(texcoords[i][0] * width) & colMask; const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; const GLint pos = (row << shift) | col; - const GLuint texel = *((GLuint *) swImg->Map + pos); + const GLuint texel = *((GLuint *) swImg->ImageSlices[0] + pos); rgba[i][RCOMP] = UBYTE_TO_FLOAT( (texel >> 24) ); rgba[i][GCOMP] = UBYTE_TO_FLOAT( (texel >> 16) & 0xff ); rgba[i][BCOMP] = UBYTE_TO_FLOAT( (texel >> 8) & 0xff ); @@ -1504,7 +1505,9 @@ sample_lambda_2d(struct gl_context *ctx, const GLboolean repeatNoBorderPOT = (samp->WrapS == GL_REPEAT) && (samp->WrapT == GL_REPEAT) - && (tImg->Border == 0 && (tImg->Width == swImg->RowStride)) + && (tImg->Border == 0) + && (_mesa_format_row_stride(tImg->TexFormat, tImg->Width) == + swImg->RowStride) && swImg->_IsPowerOfTwo; ASSERT(lambda != NULL); diff --git a/mesalib/src/mesa/swrast/s_texfilter.h b/mesalib/src/mesa/swrast/s_texfilter.h index 58b57365c..7bfa045a7 100644 --- a/mesalib/src/mesa/swrast/s_texfilter.h +++ b/mesalib/src/mesa/swrast/s_texfilter.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_texrender.c b/mesalib/src/mesa/swrast/s_texrender.c index 7b25a7b7d..751d7767b 100644 --- a/mesalib/src/mesa/swrast/s_texrender.c +++ b/mesalib/src/mesa/swrast/s_texrender.c @@ -22,37 +22,6 @@ delete_texture_wrapper(struct gl_context *ctx, struct gl_renderbuffer *rb) free(rb); } - -/** - * This function creates a renderbuffer object which wraps a texture image. - * The new renderbuffer is plugged into the given attachment point. - * This allows rendering into the texture as if it were a renderbuffer. - */ -static void -wrap_texture(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) -{ - struct gl_renderbuffer *rb; - const GLuint name = 0; - - ASSERT(att->Type == GL_TEXTURE); - ASSERT(att->Renderbuffer == NULL); - - rb = ctx->Driver.NewRenderbuffer(ctx, name); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "wrap_texture"); - return; - } - - /* init base gl_renderbuffer fields */ - _mesa_init_renderbuffer(rb, name); - /* plug in our texture_renderbuffer-specific functions */ - rb->Delete = delete_texture_wrapper; - rb->AllocStorage = NULL; /* illegal! */ - - /* update attachment point */ - _mesa_reference_renderbuffer(&att->Renderbuffer, rb); -} - /** * Update the renderbuffer wrapper for rendering to a texture. * For example, update the width, height of the RB based on the texture size, @@ -69,7 +38,7 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) (void) ctx; - swImage = swrast_texture_image(_mesa_get_attachment_teximage(att)); + swImage = swrast_texture_image(rb->TexImage); assert(swImage); format = swImage->Base.TexFormat; @@ -81,25 +50,10 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) zOffset = att->Zoffset; } - rb->Width = swImage->Base.Width; - rb->Height = swImage->Base.Height; - rb->InternalFormat = swImage->Base.InternalFormat; - rb->_BaseFormat = _mesa_get_format_base_format(format); - /* Want to store linear values, not sRGB */ rb->Format = _mesa_get_srgb_format_linear(format); - - /* Set the gl_renderbuffer::Buffer field so that mapping the buffer - * succeeds. - */ - if (att->Texture->Target == GL_TEXTURE_3D || - att->Texture->Target == GL_TEXTURE_2D_ARRAY_EXT) { - srb->Buffer = swImage->Buffer + - swImage->ImageOffsets[zOffset] * _mesa_get_format_bytes(format); - } - else { - srb->Buffer = swImage->Buffer; - } + + srb->Buffer = swImage->ImageSlices[zOffset]; } @@ -126,23 +80,24 @@ _swrast_render_texture(struct gl_context *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att) { + struct gl_renderbuffer *rb = att->Renderbuffer; (void) fb; - if (!att->Renderbuffer) { - wrap_texture(ctx, att); - } + /* plug in our texture_renderbuffer-specific functions */ + rb->Delete = delete_texture_wrapper; + update_wrapper(ctx, att); } void _swrast_finish_render_texture(struct gl_context *ctx, - struct gl_renderbuffer_attachment *att) + struct gl_renderbuffer *rb) { /* do nothing */ /* The renderbuffer texture wrapper will get deleted by the * normal mechanism for deleting renderbuffers. */ (void) ctx; - (void) att; + (void) rb; } diff --git a/mesalib/src/mesa/swrast/s_texture.c b/mesalib/src/mesa/swrast/s_texture.c index 8ae3d5bd0..27803c553 100644 --- a/mesalib/src/mesa/swrast/s_texture.c +++ b/mesalib/src/mesa/swrast/s_texture.c @@ -16,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -58,6 +59,26 @@ _swrast_delete_texture_image(struct gl_context *ctx, _mesa_delete_texture_image(ctx, texImage); } +static unsigned int +texture_slices(struct gl_texture_image *texImage) +{ + if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) + return texImage->Height; + else + return texImage->Depth; +} + +unsigned int +_swrast_teximage_slice_height(struct gl_texture_image *texImage) +{ + /* For 1D array textures, the slices are all 1 pixel high, and Height is + * the number of slices. + */ + if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) + return 1; + else + return texImage->Height; +} /** * Called via ctx->Driver.AllocTextureImageBuffer() @@ -67,31 +88,28 @@ _swrast_alloc_texture_image_buffer(struct gl_context *ctx, struct gl_texture_image *texImage) { struct swrast_texture_image *swImg = swrast_texture_image(texImage); - GLuint bytes = _mesa_format_image_size(texImage->TexFormat, texImage->Width, - texImage->Height, texImage->Depth); + GLuint bytesPerSlice; + GLuint slices = texture_slices(texImage); GLuint i; - assert(!swImg->Buffer); - swImg->Buffer = _mesa_align_malloc(bytes, 512); - if (!swImg->Buffer) + if (!_swrast_init_texture_image(texImage)) return GL_FALSE; - /* RowStride and ImageOffsets[] describe how to address texels in 'Data' */ - swImg->RowStride = texImage->Width; + bytesPerSlice = _mesa_format_image_size(texImage->TexFormat, texImage->Width, + _swrast_teximage_slice_height(texImage), 1); - /* Allocate the ImageOffsets array and initialize to typical values. - * We allocate the array for 1D/2D textures too in order to avoid special- - * case code in the texstore routines. - */ - swImg->ImageOffsets = malloc(texImage->Depth * sizeof(GLuint)); - if (!swImg->ImageOffsets) + assert(!swImg->Buffer); + swImg->Buffer = _mesa_align_malloc(bytesPerSlice * slices, 512); + if (!swImg->Buffer) return GL_FALSE; - for (i = 0; i < texImage->Depth; i++) { - swImg->ImageOffsets[i] = i * texImage->Width * texImage->Height; - } + /* RowStride and ImageSlices[] describe how to address texels in 'Data' */ + swImg->RowStride = _mesa_format_row_stride(texImage->TexFormat, + texImage->Width); - _swrast_init_texture_image(texImage); + for (i = 0; i < slices; i++) { + swImg->ImageSlices[i] = swImg->Buffer + bytesPerSlice * i; + } return GL_TRUE; } @@ -100,11 +118,11 @@ _swrast_alloc_texture_image_buffer(struct gl_context *ctx, /** * Code that overrides ctx->Driver.AllocTextureImageBuffer may use this to * initialize the fields of swrast_texture_image without allocating the image - * buffer or initializing ImageOffsets or RowStride. + * buffer or initializing RowStride or the contents of ImageSlices. * * Returns GL_TRUE on success, GL_FALSE on memory allocation failure. */ -void +GLboolean _swrast_init_texture_image(struct gl_texture_image *texImage) { struct swrast_texture_image *swImg = swrast_texture_image(texImage); @@ -128,6 +146,13 @@ _swrast_init_texture_image(struct gl_texture_image *texImage) swImg->HeightScale = (GLfloat) texImage->Height; swImg->DepthScale = (GLfloat) texImage->Depth; } + + assert(!swImg->ImageSlices); + swImg->ImageSlices = calloc(texture_slices(texImage), sizeof(void *)); + if (!swImg->ImageSlices) + return GL_FALSE; + + return GL_TRUE; } @@ -144,8 +169,8 @@ _swrast_free_texture_image_buffer(struct gl_context *ctx, swImage->Buffer = NULL; } - free(swImage->ImageOffsets); - swImage->ImageOffsets = NULL; + free(swImage->ImageSlices); + swImage->ImageSlices = NULL; } @@ -206,25 +231,15 @@ _swrast_map_teximage(struct gl_context *ctx, *mapOut = NULL; return; } - - map = swImage->Buffer; - - if (texImage->TexObject->Target == GL_TEXTURE_3D || - texImage->TexObject->Target == GL_TEXTURE_2D_ARRAY) { - GLuint sliceSize = _mesa_format_image_size(texImage->TexFormat, - texImage->Width, - texImage->Height, - 1); - assert(slice < texImage->Depth); - map += slice * sliceSize; - } else if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) { - GLuint sliceSize = _mesa_format_image_size(texImage->TexFormat, - texImage->Width, - 1, - 1); - assert(slice < texImage->Height); - map += slice * sliceSize; - } + + /* This function can only be used with a swrast-allocated buffer, in which + * case ImageSlices is populated with pointers into Buffer. + */ + assert(swImage->Buffer); + assert(swImage->Buffer == swImage->ImageSlices[0]); + + assert(slice < texture_slices(texImage)); + map = swImage->ImageSlices[slice]; /* apply x/y offset to map address */ map += stride * (y / bh) + texelSize * (x / bw); @@ -251,12 +266,42 @@ _swrast_map_texture(struct gl_context *ctx, struct gl_texture_object *texObj) for (face = 0; face < faces; face++) { for (level = texObj->BaseLevel; level < MAX_TEXTURE_LEVELS; level++) { struct gl_texture_image *texImage = texObj->Image[face][level]; - if (texImage) { - struct swrast_texture_image *swImage = - swrast_texture_image(texImage); + struct swrast_texture_image *swImage = swrast_texture_image(texImage); + unsigned int i; + + if (!texImage) + continue; + + /* In the case of a swrast-allocated texture buffer, the ImageSlices + * and RowStride are always available. + */ + if (swImage->Buffer) { + assert(swImage->ImageSlices[0] == swImage->Buffer); + continue; + } - /* XXX we'll eventually call _swrast_map_teximage() here */ - swImage->Map = swImage->Buffer; + for (i = 0; i < texture_slices(texImage); i++) { + GLubyte *map; + GLint rowStride; + + if (swImage->ImageSlices[i]) + continue; + + ctx->Driver.MapTextureImage(ctx, texImage, i, + 0, 0, + texImage->Width, texImage->Height, + GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, + &map, &rowStride); + + swImage->ImageSlices[i] = map; + /* A swrast-using driver has to return the same rowstride for + * every slice of the same texture, since we don't track them + * separately. + */ + if (i == 0) + swImage->RowStride = rowStride; + else + assert(swImage->RowStride == rowStride); } } } @@ -272,12 +317,20 @@ _swrast_unmap_texture(struct gl_context *ctx, struct gl_texture_object *texObj) for (face = 0; face < faces; face++) { for (level = texObj->BaseLevel; level < MAX_TEXTURE_LEVELS; level++) { struct gl_texture_image *texImage = texObj->Image[face][level]; - if (texImage) { - struct swrast_texture_image *swImage - = swrast_texture_image(texImage); + struct swrast_texture_image *swImage = swrast_texture_image(texImage); + unsigned int i; + + if (!texImage) + continue; - /* XXX we'll eventually call _swrast_unmap_teximage() here */ - swImage->Map = NULL; + if (swImage->Buffer) + return; + + for (i = 0; i < texture_slices(texImage); i++) { + if (swImage->ImageSlices[i]) { + ctx->Driver.UnmapTextureImage(ctx, texImage, i); + swImage->ImageSlices[i] = NULL; + } } } } @@ -322,30 +375,3 @@ _swrast_unmap_textures(struct gl_context *ctx) enabledUnits &= ~(1 << unit); } } - - -/** - * Called via ctx->Driver.AllocTextureStorage() - * Just have to allocate memory for the texture images. - */ -GLboolean -_swrast_AllocTextureStorage(struct gl_context *ctx, - struct gl_texture_object *texObj, - GLsizei levels, GLsizei width, - GLsizei height, GLsizei depth) -{ - const GLint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - GLint face, level; - - for (face = 0; face < numFaces; face++) { - for (level = 0; level < levels; level++) { - struct gl_texture_image *texImage = texObj->Image[face][level]; - if (!_swrast_alloc_texture_image_buffer(ctx, texImage)) { - return GL_FALSE; - } - } - } - - return GL_TRUE; -} - diff --git a/mesalib/src/mesa/swrast/s_triangle.c b/mesalib/src/mesa/swrast/s_triangle.c index f0b1d383d..ffe99832b 100644 --- a/mesalib/src/mesa/swrast/s_triangle.c +++ b/mesalib/src/mesa/swrast/s_triangle.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -133,7 +134,7 @@ _swrast_culltriangle( struct gl_context *ctx, const GLfloat twidth = (GLfloat) texImg->Width; \ const GLfloat theight = (GLfloat) texImg->Height; \ const GLint twidth_log2 = texImg->WidthLog2; \ - const GLubyte *texture = (const GLubyte *) swImg->Map; \ + const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \ const GLint smask = texImg->Width - 1; \ const GLint tmask = texImg->Height - 1; \ ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \ @@ -191,7 +192,7 @@ _swrast_culltriangle( struct gl_context *ctx, const GLfloat twidth = (GLfloat) texImg->Width; \ const GLfloat theight = (GLfloat) texImg->Height; \ const GLint twidth_log2 = texImg->WidthLog2; \ - const GLubyte *texture = (const GLubyte *) swImg->Map; \ + const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \ const GLint smask = texImg->Width - 1; \ const GLint tmask = texImg->Height - 1; \ ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \ @@ -547,7 +548,7 @@ affine_span(struct gl_context *ctx, SWspan *span, swrast_texture_image_const(texImg); \ const GLfloat twidth = (GLfloat) texImg->Width; \ const GLfloat theight = (GLfloat) texImg->Height; \ - info.texture = (const GLchan *) swImg->Map; \ + info.texture = (const GLchan *) swImg->ImageSlices[0]; \ info.twidth_log2 = texImg->WidthLog2; \ info.smask = texImg->Width - 1; \ info.tmask = texImg->Height - 1; \ @@ -814,7 +815,7 @@ fast_persp_span(struct gl_context *ctx, SWspan *span, obj->Image[0][obj->BaseLevel]; \ const struct swrast_texture_image *swImg = \ swrast_texture_image_const(texImg); \ - info.texture = (const GLchan *) swImg->Map; \ + info.texture = (const GLchan *) swImg->ImageSlices[0]; \ info.twidth_log2 = texImg->WidthLog2; \ info.smask = texImg->Width - 1; \ info.tmask = texImg->Height - 1; \ @@ -1078,7 +1079,8 @@ _swrast_choose_triangle( struct gl_context *ctx ) && texObj2D->_Swizzle == SWIZZLE_NOOP && swImg->_IsPowerOfTwo && texImg->Border == 0 - && texImg->Width == swImg->RowStride + && (_mesa_format_row_stride(format, texImg->Width) == + swImg->RowStride) && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888) && minFilter == magFilter && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR diff --git a/mesalib/src/mesa/swrast/s_triangle.h b/mesalib/src/mesa/swrast/s_triangle.h index 46e23d420..c0cbb3927 100644 --- a/mesalib/src/mesa/swrast/s_triangle.h +++ b/mesalib/src/mesa/swrast/s_triangle.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/swrast/s_tritemp.h b/mesalib/src/mesa/swrast/s_tritemp.h index 797afc41a..f96ddd45b 100644 --- a/mesalib/src/mesa/swrast/s_tritemp.h +++ b/mesalib/src/mesa/swrast/s_tritemp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/swrast/s_zoom.c b/mesalib/src/mesa/swrast/s_zoom.c index 3b309a251..01276f4e9 100644 --- a/mesalib/src/mesa/swrast/s_zoom.c +++ b/mesalib/src/mesa/swrast/s_zoom.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" diff --git a/mesalib/src/mesa/swrast/s_zoom.h b/mesalib/src/mesa/swrast/s_zoom.h index 1955e7e88..a1441e81e 100644 --- a/mesalib/src/mesa/swrast/s_zoom.h +++ b/mesalib/src/mesa/swrast/s_zoom.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef S_ZOOM_H diff --git a/mesalib/src/mesa/swrast/swrast.h b/mesalib/src/mesa/swrast/swrast.h index 82555ae6a..359a985fd 100644 --- a/mesalib/src/mesa/swrast/swrast.h +++ b/mesalib/src/mesa/swrast/swrast.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * */ @@ -217,7 +218,7 @@ extern GLboolean _swrast_alloc_texture_image_buffer(struct gl_context *ctx, struct gl_texture_image *texImage); -extern void +extern GLboolean _swrast_init_texture_image(struct gl_texture_image *texImage); extern void @@ -269,15 +270,7 @@ _swrast_render_texture(struct gl_context *ctx, extern void _swrast_finish_render_texture(struct gl_context *ctx, - struct gl_renderbuffer_attachment *att); - - - -extern GLboolean -_swrast_AllocTextureStorage(struct gl_context *ctx, - struct gl_texture_object *texObj, - GLsizei levels, GLsizei width, - GLsizei height, GLsizei depth); + struct gl_renderbuffer *rb); /** diff --git a/mesalib/src/mesa/swrast_setup/ss_context.c b/mesalib/src/mesa/swrast_setup/ss_context.c index 5847a7682..0c40683a5 100644 --- a/mesalib/src/mesa/swrast_setup/ss_context.c +++ b/mesalib/src/mesa/swrast_setup/ss_context.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/swrast_setup/ss_context.h b/mesalib/src/mesa/swrast_setup/ss_context.h index ecc1f5fd6..29de33232 100644 --- a/mesalib/src/mesa/swrast_setup/ss_context.h +++ b/mesalib/src/mesa/swrast_setup/ss_context.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/swrast_setup/ss_triangle.c b/mesalib/src/mesa/swrast_setup/ss_triangle.c index 5f4a997ee..c8378fc8b 100644 --- a/mesalib/src/mesa/swrast_setup/ss_triangle.c +++ b/mesalib/src/mesa/swrast_setup/ss_triangle.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/swrast_setup/ss_triangle.h b/mesalib/src/mesa/swrast_setup/ss_triangle.h index a027f4826..2fcc6d4dc 100644 --- a/mesalib/src/mesa/swrast_setup/ss_triangle.h +++ b/mesalib/src/mesa/swrast_setup/ss_triangle.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/swrast_setup/ss_tritmp.h b/mesalib/src/mesa/swrast_setup/ss_tritmp.h index 11742067f..a44fb24f2 100644 --- a/mesalib/src/mesa/swrast_setup/ss_tritmp.h +++ b/mesalib/src/mesa/swrast_setup/ss_tritmp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/swrast_setup/ss_vb.h b/mesalib/src/mesa/swrast_setup/ss_vb.h index 05e665b5c..72c077b92 100644 --- a/mesalib/src/mesa/swrast_setup/ss_vb.h +++ b/mesalib/src/mesa/swrast_setup/ss_vb.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/swrast_setup/swrast_setup.h b/mesalib/src/mesa/swrast_setup/swrast_setup.h index 1d87ec108..e453e56ae 100644 --- a/mesalib/src/mesa/swrast_setup/swrast_setup.h +++ b/mesalib/src/mesa/swrast_setup/swrast_setup.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_context.c b/mesalib/src/mesa/tnl/t_context.c index ed31b9c45..77f1c1bce 100644 --- a/mesalib/src/mesa/tnl/t_context.c +++ b/mesalib/src/mesa/tnl/t_context.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_context.h b/mesalib/src/mesa/tnl/t_context.h index c9ff1246d..4ebc31261 100644 --- a/mesalib/src/mesa/tnl/t_context.h +++ b/mesalib/src/mesa/tnl/t_context.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c index 0631eb183..08cd1d1ea 100644 --- a/mesalib/src/mesa/tnl/t_draw.c +++ b/mesalib/src/mesa/tnl/t_draw.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_pipeline.c b/mesalib/src/mesa/tnl/t_pipeline.c index 806d9ca6e..7f09af7f1 100644 --- a/mesalib/src/mesa/tnl/t_pipeline.c +++ b/mesalib/src/mesa/tnl/t_pipeline.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_pipeline.h b/mesalib/src/mesa/tnl/t_pipeline.h index 0eb03395c..35cd0afe3 100644 --- a/mesalib/src/mesa/tnl/t_pipeline.h +++ b/mesalib/src/mesa/tnl/t_pipeline.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_rasterpos.c b/mesalib/src/mesa/tnl/t_rasterpos.c index 1673b81ef..269a7162e 100644 --- a/mesalib/src/mesa/tnl/t_rasterpos.c +++ b/mesalib/src/mesa/tnl/t_rasterpos.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/tnl/t_vb_cliptmp.h b/mesalib/src/mesa/tnl/t_vb_cliptmp.h index 0b45bc534..4dc3320c6 100644 --- a/mesalib/src/mesa/tnl/t_vb_cliptmp.h +++ b/mesalib/src/mesa/tnl/t_vb_cliptmp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_vb_fog.c b/mesalib/src/mesa/tnl/t_vb_fog.c index 134cae1c7..c011ae785 100644 --- a/mesalib/src/mesa/tnl/t_vb_fog.c +++ b/mesalib/src/mesa/tnl/t_vb_fog.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_vb_light.c b/mesalib/src/mesa/tnl/t_vb_light.c index 39ba49685..133894853 100644 --- a/mesalib/src/mesa/tnl/t_vb_light.c +++ b/mesalib/src/mesa/tnl/t_vb_light.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/tnl/t_vb_lighttmp.h b/mesalib/src/mesa/tnl/t_vb_lighttmp.h index 1944e5ddc..5679640c9 100644 --- a/mesalib/src/mesa/tnl/t_vb_lighttmp.h +++ b/mesalib/src/mesa/tnl/t_vb_lighttmp.h @@ -17,14 +17,14 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * * Authors: - * Brian Paul - * Keith Whitwell <keith@tungstengraphics.com> + * Brian Paul Keith Whitwell <keith@tungstengraphics.com> */ diff --git a/mesalib/src/mesa/tnl/t_vb_normals.c b/mesalib/src/mesa/tnl/t_vb_normals.c index c19b48e51..519c90d8e 100644 --- a/mesalib/src/mesa/tnl/t_vb_normals.c +++ b/mesalib/src/mesa/tnl/t_vb_normals.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_vb_points.c b/mesalib/src/mesa/tnl/t_vb_points.c index 0e33b691e..932194d75 100644 --- a/mesalib/src/mesa/tnl/t_vb_points.c +++ b/mesalib/src/mesa/tnl/t_vb_points.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Brian Paul diff --git a/mesalib/src/mesa/tnl/t_vb_program.c b/mesalib/src/mesa/tnl/t_vb_program.c index 452285f6b..5ade54343 100644 --- a/mesalib/src/mesa/tnl/t_vb_program.c +++ b/mesalib/src/mesa/tnl/t_vb_program.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -259,7 +260,7 @@ map_textures(struct gl_context *ctx, const struct gl_vertex_program *vp) { GLuint u; - for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) { + for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) { if (vp->Base.TexturesUsed[u]) { /* Note: _Current *should* correspond to the target indicated * in TexturesUsed[u]. @@ -278,7 +279,7 @@ unmap_textures(struct gl_context *ctx, const struct gl_vertex_program *vp) { GLuint u; - for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) { + for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) { if (vp->Base.TexturesUsed[u]) { /* Note: _Current *should* correspond to the target indicated * in TexturesUsed[u]. diff --git a/mesalib/src/mesa/tnl/t_vb_render.c b/mesalib/src/mesa/tnl/t_vb_render.c index cb3192132..4d42bcd3e 100644 --- a/mesalib/src/mesa/tnl/t_vb_render.c +++ b/mesalib/src/mesa/tnl/t_vb_render.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_vb_rendertmp.h b/mesalib/src/mesa/tnl/t_vb_rendertmp.h index 4ed485a7b..1c6470cea 100644 --- a/mesalib/src/mesa/tnl/t_vb_rendertmp.h +++ b/mesalib/src/mesa/tnl/t_vb_rendertmp.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_vb_texgen.c b/mesalib/src/mesa/tnl/t_vb_texgen.c index 8ba67f3c0..881710858 100644 --- a/mesalib/src/mesa/tnl/t_vb_texgen.c +++ b/mesalib/src/mesa/tnl/t_vb_texgen.c @@ -17,13 +17,13 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: - * Brian Paul - * Keith Whitwell <keith@tungstengraphics.com> + * Brian Paul Keith Whitwell <keith@tungstengraphics.com> */ /* diff --git a/mesalib/src/mesa/tnl/t_vb_texmat.c b/mesalib/src/mesa/tnl/t_vb_texmat.c index 91bb0f797..f3e317b33 100644 --- a/mesalib/src/mesa/tnl/t_vb_texmat.c +++ b/mesalib/src/mesa/tnl/t_vb_texmat.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_vb_vertex.c b/mesalib/src/mesa/tnl/t_vb_vertex.c index 8f296f54b..4cb8c06b2 100644 --- a/mesalib/src/mesa/tnl/t_vb_vertex.c +++ b/mesalib/src/mesa/tnl/t_vb_vertex.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/tnl/t_vertex.c b/mesalib/src/mesa/tnl/t_vertex.c index ce3e32165..c7a745ed7 100644 --- a/mesalib/src/mesa/tnl/t_vertex.c +++ b/mesalib/src/mesa/tnl/t_vertex.c @@ -156,9 +156,11 @@ static void choose_interp_func( struct gl_context *ctx, GLboolean force_boundary ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); + GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL || + ctx->Polygon.BackMode != GL_FILL); + GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide; - if (vtx->need_extras && - (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { + if (vtx->need_extras && (twosided || unfilled)) { vtx->interp = _tnl_generic_interp_extras; } else { vtx->interp = _tnl_generic_interp; @@ -171,9 +173,12 @@ static void choose_interp_func( struct gl_context *ctx, static void choose_copy_pv_func( struct gl_context *ctx, GLuint edst, GLuint esrc ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); + GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL || + ctx->Polygon.BackMode != GL_FILL); - if (vtx->need_extras && - (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { + GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide; + + if (vtx->need_extras && (twosided || unfilled)) { vtx->copy_pv = _tnl_generic_copy_pv_extras; } else { vtx->copy_pv = _tnl_generic_copy_pv; diff --git a/mesalib/src/mesa/tnl/tnl.h b/mesalib/src/mesa/tnl/tnl.h index 958322887..d67a3a71d 100644 --- a/mesalib/src/mesa/tnl/tnl.h +++ b/mesalib/src/mesa/tnl/tnl.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/vbo/vbo.h b/mesalib/src/mesa/vbo/vbo.h index 49dab2314..08c67d67d 100644 --- a/mesalib/src/mesa/vbo/vbo.h +++ b/mesalib/src/mesa/vbo/vbo.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -32,6 +33,7 @@ #ifndef _VBO_H #define _VBO_H +#include <stdbool.h> #include "main/glheader.h" struct gl_client_array; @@ -72,6 +74,15 @@ void _vbo_DestroyContext( struct gl_context *ctx ); void _vbo_InvalidateState( struct gl_context *ctx, GLuint new_state ); +void +vbo_initialize_exec_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec); + +void +vbo_initialize_save_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec); + + typedef void (*vbo_draw_func)( struct gl_context *ctx, const struct _mesa_prim *prims, GLuint nr_prims, @@ -160,6 +171,15 @@ vbo_count_tessellated_primitives(GLenum mode, GLuint count, GLuint num_instances); void +vbo_try_prim_conversion(struct _mesa_prim *p); + +bool +vbo_can_merge_prims(const struct _mesa_prim *p0, const struct _mesa_prim *p1); + +void +vbo_merge_prims(struct _mesa_prim *p0, const struct _mesa_prim *p1); + +void vbo_sw_primitive_restart(struct gl_context *ctx, const struct _mesa_prim *prim, GLuint nr_prims, diff --git a/mesalib/src/mesa/vbo/vbo_context.c b/mesalib/src/mesa/vbo/vbo_context.c index 7eda31e8f..4c3c9c090 100644 --- a/mesalib/src/mesa/vbo/vbo_context.c +++ b/mesalib/src/mesa/vbo/vbo_context.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/vbo/vbo_context.h b/mesalib/src/mesa/vbo/vbo_context.h index 1ff6ec000..ced742033 100644 --- a/mesalib/src/mesa/vbo/vbo_context.h +++ b/mesalib/src/mesa/vbo/vbo_context.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -51,7 +52,6 @@ #ifndef _VBO_CONTEXT_H #define _VBO_CONTEXT_H -#include "main/mfeatures.h" #include "vbo.h" #include "vbo_attrib.h" #include "vbo_exec.h" diff --git a/mesalib/src/mesa/vbo/vbo_exec.c b/mesalib/src/mesa/vbo/vbo_exec.c index 5827f90c3..c56a14212 100644 --- a/mesalib/src/mesa/vbo/vbo_exec.c +++ b/mesalib/src/mesa/vbo/vbo_exec.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> @@ -47,7 +48,6 @@ void vbo_exec_init( struct gl_context *ctx ) return; vbo_exec_vtx_init( exec ); - vbo_exec_array_init( exec ); ctx->Driver.NeedFlush = 0; ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; @@ -68,7 +68,6 @@ void vbo_exec_destroy( struct gl_context *ctx ) } vbo_exec_vtx_destroy( exec ); - vbo_exec_array_destroy( exec ); } @@ -79,10 +78,26 @@ void vbo_exec_destroy( struct gl_context *ctx ) */ void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state ) { - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; - if (new_state & (_NEW_PROGRAM|_NEW_ARRAY)) { + if (!exec->validating && new_state & (_NEW_PROGRAM|_NEW_ARRAY)) { exec->array.recalculate_inputs = GL_TRUE; + + /* If we ended up here because a VAO was deleted, the _DrawArrays + * pointer which pointed to the VAO might be invalid now, so set it + * to NULL. This prevents crashes in driver functions like Clear + * where driver state validation might occur, but the vbo module is + * still in an invalid state. + * + * Drivers should skip vertex array state validation if _DrawArrays + * is NULL. It also has no effect on performance, because attrib + * bindings will be recalculated anyway. + */ + if (vbo->last_draw_method == DRAW_ARRAYS) { + ctx->Array._DrawArrays = NULL; + vbo->last_draw_method = DRAW_NONE; + } } if (new_state & _NEW_EVAL) @@ -142,3 +157,102 @@ vbo_count_tessellated_primitives(GLenum mode, GLuint count, } return num_primitives * num_instances; } + + + +/** + * In some degenarate cases we can improve our ability to merge + * consecutive primitives. For example: + * glBegin(GL_LINE_STRIP); + * glVertex(1); + * glVertex(1); + * glEnd(); + * glBegin(GL_LINE_STRIP); + * glVertex(1); + * glVertex(1); + * glEnd(); + * Can be merged as a GL_LINES prim with four vertices. + * + * This function converts 2-vertex line strips/loops into GL_LINES, etc. + */ +void +vbo_try_prim_conversion(struct _mesa_prim *p) +{ + if (p->mode == GL_LINE_STRIP && p->count == 2) { + /* convert 2-vertex line strip to a separate line */ + p->mode = GL_LINES; + } + else if ((p->mode == GL_TRIANGLE_STRIP || p->mode == GL_TRIANGLE_FAN) + && p->count == 3) { + /* convert 3-vertex tri strip or fan to a separate triangle */ + p->mode = GL_TRIANGLES; + } + + /* Note: we can't convert a 4-vertex quad strip to a separate quad + * because the vertex ordering is different. We'd have to muck + * around in the vertex data to make it work. + */ +} + + +/** + * Helper function for determining if two subsequent glBegin/glEnd + * primitives can be combined. This is only possible for GL_POINTS, + * GL_LINES, GL_TRIANGLES and GL_QUADS. + * If we return true, it means that we can concatenate p1 onto p0 (and + * discard p1). + */ +bool +vbo_can_merge_prims(const struct _mesa_prim *p0, const struct _mesa_prim *p1) +{ + if (!p0->begin || + !p1->begin || + !p0->end || + !p1->end) + return false; + + /* The prim mode must match (ex: both GL_TRIANGLES) */ + if (p0->mode != p1->mode) + return false; + + /* p1's vertices must come right after p0 */ + if (p0->start + p0->count != p1->start) + return false; + + if (p0->basevertex != p1->basevertex || + p0->num_instances != p1->num_instances || + p0->base_instance != p1->base_instance) + return false; + + /* can always merge subsequent GL_POINTS primitives */ + if (p0->mode == GL_POINTS) + return true; + + /* independent lines with no extra vertices */ + if (p0->mode == GL_LINES && p0->count % 2 == 0 && p1->count % 2 == 0) + return true; + + /* independent tris */ + if (p0->mode == GL_TRIANGLES && p0->count % 3 == 0 && p1->count % 3 == 0) + return true; + + /* independent quads */ + if (p0->mode == GL_QUADS && p0->count % 4 == 0 && p1->count % 4 == 0) + return true; + + return false; +} + + +/** + * If we've determined that p0 and p1 can be merged, this function + * concatenates p1 onto p0. + */ +void +vbo_merge_prims(struct _mesa_prim *p0, const struct _mesa_prim *p1) +{ + assert(vbo_can_merge_prims(p0, p1)); + + p0->count += p1->count; + p0->end = p1->end; +} diff --git a/mesalib/src/mesa/vbo/vbo_exec.h b/mesalib/src/mesa/vbo/vbo_exec.h index 96cf4c82b..01e2856f2 100644 --- a/mesalib/src/mesa/vbo/vbo_exec.h +++ b/mesalib/src/mesa/vbo/vbo_exec.h @@ -34,7 +34,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __VBO_EXEC_H__ #define __VBO_EXEC_H__ -#include "main/mfeatures.h" #include "main/mtypes.h" #include "vbo.h" #include "vbo_attrib.h" @@ -82,6 +81,7 @@ struct vbo_exec_context struct gl_context *ctx; GLvertexformat vtxfmt; GLvertexformat vtxfmt_noop; + GLboolean validating; /**< if we're in the middle of state validation */ struct { struct gl_buffer_object *bufferobj; @@ -152,9 +152,6 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags ); /* Internal functions: */ -void vbo_exec_array_init( struct vbo_exec_context *exec ); -void vbo_exec_array_destroy( struct vbo_exec_context *exec ); - void vbo_exec_vtx_init( struct vbo_exec_context *exec ); void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ); diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c index 353f8cfde..600398c58 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_api.c +++ b/mesalib/src/mesa/vbo/vbo_exec_api.c @@ -34,7 +34,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/bufferobj.h" #include "main/context.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/vtxfmt.h" #include "main/dlist.h" #include "main/eval.h" @@ -75,7 +74,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) GLuint last_begin = exec->vtx.prim[exec->vtx.prim_count-1].begin; GLuint last_count; - if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { + if (_mesa_inside_begin_end(exec->ctx)) { GLint i = exec->vtx.prim_count - 1; assert(i >= 0); exec->vtx.prim[i].count = (exec->vtx.vert_count - @@ -97,7 +96,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) */ assert(exec->vtx.prim_count == 0); - if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { + if (_mesa_inside_begin_end(exec->ctx)) { exec->vtx.prim[0].mode = exec->ctx->Driver.CurrentExecPrimitive; exec->vtx.prim[0].start = 0; exec->vtx.prim[0].count = 0; @@ -270,7 +269,7 @@ vbo_exec_wrap_upgrade_vertex(struct vbo_exec_context *exec, /* Heuristic: Attempt to isolate attributes received outside * begin/end so that they don't bloat the vertices. */ - if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END && + if (!_mesa_inside_begin_end(ctx) && !oldSize && lastcount > 8 && exec->vtx.vertex_size) { vbo_exec_copy_to_current( exec ); reset_attrfv( exec ); @@ -655,132 +654,6 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) } -static void GLAPIENTRY -vbo_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - GLfloat u, du; - GLenum prim; - - switch (mode) { - case GL_POINT: - prim = GL_POINTS; - break; - case GL_LINE: - prim = GL_LINE_STRIP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh1(mode)" ); - return; - } - - /* No effect if vertex maps disabled. - */ - if (!ctx->Eval.Map1Vertex4 && - !ctx->Eval.Map1Vertex3) - return; - - du = ctx->Eval.MapGrid1du; - u = ctx->Eval.MapGrid1u1 + i1 * du; - - CALL_Begin(GET_DISPATCH(), (prim)); - for (i=i1;i<=i2;i++,u+=du) { - CALL_EvalCoord1f(GET_DISPATCH(), (u)); - } - CALL_End(GET_DISPATCH(), ()); -} - - -static void GLAPIENTRY -vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat u, du, v, dv, v1, u1; - GLint i, j; - - switch (mode) { - case GL_POINT: - case GL_LINE: - case GL_FILL: - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" ); - return; - } - - /* No effect if vertex maps disabled. - */ - if (!ctx->Eval.Map2Vertex4 && - !ctx->Eval.Map2Vertex3) - return; - - du = ctx->Eval.MapGrid2du; - dv = ctx->Eval.MapGrid2dv; - v1 = ctx->Eval.MapGrid2v1 + j1 * dv; - u1 = ctx->Eval.MapGrid2u1 + i1 * du; - - switch (mode) { - case GL_POINT: - CALL_Begin(GET_DISPATCH(), (GL_POINTS)); - for (v=v1,j=j1;j<=j2;j++,v+=dv) { - for (u=u1,i=i1;i<=i2;i++,u+=du) { - CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); - } - } - CALL_End(GET_DISPATCH(), ()); - break; - case GL_LINE: - for (v=v1,j=j1;j<=j2;j++,v+=dv) { - CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); - for (u=u1,i=i1;i<=i2;i++,u+=du) { - CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); - } - CALL_End(GET_DISPATCH(), ()); - } - for (u=u1,i=i1;i<=i2;i++,u+=du) { - CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); - for (v=v1,j=j1;j<=j2;j++,v+=dv) { - CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); - } - CALL_End(GET_DISPATCH(), ()); - } - break; - case GL_FILL: - for (v=v1,j=j1;j<j2;j++,v+=dv) { - CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP)); - for (u=u1,i=i1;i<=i2;i++,u+=du) { - CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); - CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv)); - } - CALL_End(GET_DISPATCH(), ()); - } - break; - } -} - - -/** - * Execute a glRectf() function. This is not suitable for GL_COMPILE - * modes (as the test for outside begin/end is not compiled), - * but may be useful for drivers in circumstances which exclude - * display list interactions. - * - * (None of the functions in this file are suitable for GL_COMPILE - * modes). - */ -static void GLAPIENTRY -vbo_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ - CALL_Begin(GET_DISPATCH(), (GL_QUADS)); - CALL_Vertex2f(GET_DISPATCH(), (x1, y1)); - CALL_Vertex2f(GET_DISPATCH(), (x2, y1)); - CALL_Vertex2f(GET_DISPATCH(), (x2, y2)); - CALL_Vertex2f(GET_DISPATCH(), (x1, y2)); - CALL_End(GET_DISPATCH(), ()); -} - - /** * Called via glBegin. */ @@ -790,7 +663,7 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) struct vbo_exec_context *exec = &vbo_context(ctx)->exec; int i; - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { + if (_mesa_inside_begin_end(ctx)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBegin"); return; } @@ -846,6 +719,34 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) /** + * Try to merge / concatenate the two most recent VBO primitives. + */ +static void +try_vbo_merge(struct vbo_exec_context *exec) +{ + struct _mesa_prim *cur = &exec->vtx.prim[exec->vtx.prim_count - 1]; + + assert(exec->vtx.prim_count >= 1); + + vbo_try_prim_conversion(cur); + + if (exec->vtx.prim_count >= 2) { + struct _mesa_prim *prev = &exec->vtx.prim[exec->vtx.prim_count - 2]; + assert(prev == cur - 1); + + if (vbo_can_merge_prims(prev, cur)) { + assert(cur->begin); + assert(cur->end); + assert(prev->begin); + assert(prev->end); + vbo_merge_prims(prev, cur); + exec->vtx.prim_count--; /* drop the last primitive */ + } + } +} + + +/** * Called via glEnd. */ static void GLAPIENTRY vbo_exec_End( void ) @@ -853,7 +754,7 @@ static void GLAPIENTRY vbo_exec_End( void ) GET_CURRENT_CONTEXT( ctx ); struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) { + if (!_mesa_inside_begin_end(ctx)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glEnd"); return; } @@ -871,6 +772,8 @@ static void GLAPIENTRY vbo_exec_End( void ) exec->vtx.prim[i].end = 1; exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start; + + try_vbo_merge(exec); } ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; @@ -911,16 +814,21 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) struct gl_context *ctx = exec->ctx; GLvertexformat *vfmt = &exec->vtxfmt; - _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->ArrayElement = _ae_ArrayElement; vfmt->Begin = vbo_exec_Begin; vfmt->End = vbo_exec_End; vfmt->PrimitiveRestartNV = vbo_exec_PrimitiveRestartNV; - _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); - _MESA_INIT_EVAL_VTXFMT(vfmt, vbo_exec_); + vfmt->CallList = _mesa_CallList; + vfmt->CallLists = _mesa_CallLists; - vfmt->Rectf = vbo_exec_Rectf; + vfmt->EvalCoord1f = vbo_exec_EvalCoord1f; + vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv; + vfmt->EvalCoord2f = vbo_exec_EvalCoord2f; + vfmt->EvalCoord2fv = vbo_exec_EvalCoord2fv; + vfmt->EvalPoint1 = vbo_exec_EvalPoint1; + vfmt->EvalPoint2 = vbo_exec_EvalPoint2; /* from attrib_tmp.h: */ @@ -1243,7 +1151,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags ) assert(exec->flush_call_depth == 1); #endif - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { + if (_mesa_inside_begin_end(ctx)) { /* We've had glBegin but not glEnd! */ #ifdef DEBUG exec->flush_call_depth--; diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c index 7e61f7b31..9dadd0421 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_array.c +++ b/mesalib/src/mesa/vbo/vbo_exec_array.c @@ -30,6 +30,7 @@ #include "main/context.h" #include "main/state.h" #include "main/api_validate.h" +#include "main/dispatch.h" #include "main/varray.h" #include "main/bufferobj.h" #include "main/enums.h" @@ -91,7 +92,7 @@ vbo_get_minmax_index(struct gl_context *ctx, const GLuint count) { const GLboolean restart = ctx->Array._PrimitiveRestart; - const GLuint restartIndex = ctx->Array._RestartIndex; + const GLuint restartIndex = _mesa_primitive_restart_index(ctx, ib->type); const int index_size = vbo_sizeof_ib_type(ib->type); const char *indices; GLuint i; @@ -501,6 +502,7 @@ vbo_bind_arrays(struct gl_context *ctx) if (exec->array.recalculate_inputs) { recalculate_input_bindings(ctx); + exec->array.recalculate_inputs = GL_FALSE; /* Again... because we may have changed the bitmask of per-vertex varying * attributes. If we regenerate the fixed-function vertex program now @@ -508,10 +510,13 @@ vbo_bind_arrays(struct gl_context *ctx) * need in the shader. */ if (ctx->NewState) { + /* Setting "validating" to TRUE prevents _mesa_update_state from + * invalidating what we just did. + */ + exec->validating = GL_TRUE; _mesa_update_state(ctx); + exec->validating = GL_FALSE; } - - exec->array.recalculate_inputs = GL_FALSE; } } @@ -572,10 +577,10 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, prim[0].base_instance = baseInstance; /* Implement the primitive restart index */ - if (ctx->Array._PrimitiveRestart && ctx->Array._RestartIndex < count) { + if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) { GLuint primCount = 0; - if (ctx->Array._RestartIndex == start) { + if (ctx->Array.RestartIndex == start) { /* special case: RestartIndex at beginning */ if (count > 1) { prim[0].start = start + 1; @@ -583,7 +588,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, primCount = 1; } } - else if (ctx->Array._RestartIndex == start + count - 1) { + else if (ctx->Array.RestartIndex == start + count - 1) { /* special case: RestartIndex at end */ if (count > 1) { prim[0].start = start; @@ -594,10 +599,10 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, else { /* general case: RestartIndex in middle, split into two prims */ prim[0].start = start; - prim[0].count = ctx->Array._RestartIndex - start; + prim[0].count = ctx->Array.RestartIndex - start; prim[1] = prim[0]; - prim[1].start = ctx->Array._RestartIndex + 1; + prim[1].start = ctx->Array.RestartIndex + 1; prim[1].count = count - prim[1].start; primCount = 2; @@ -627,6 +632,128 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, } +/** + * Execute a glRectf() function. + */ +static void GLAPIENTRY +vbo_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + CALL_Begin(GET_DISPATCH(), (GL_QUADS)); + CALL_Vertex2f(GET_DISPATCH(), (x1, y1)); + CALL_Vertex2f(GET_DISPATCH(), (x2, y1)); + CALL_Vertex2f(GET_DISPATCH(), (x2, y2)); + CALL_Vertex2f(GET_DISPATCH(), (x1, y2)); + CALL_End(GET_DISPATCH(), ()); +} + + +static void GLAPIENTRY +vbo_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + GLfloat u, du; + GLenum prim; + + switch (mode) { + case GL_POINT: + prim = GL_POINTS; + break; + case GL_LINE: + prim = GL_LINE_STRIP; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh1(mode)" ); + return; + } + + /* No effect if vertex maps disabled. + */ + if (!ctx->Eval.Map1Vertex4 && + !ctx->Eval.Map1Vertex3) + return; + + du = ctx->Eval.MapGrid1du; + u = ctx->Eval.MapGrid1u1 + i1 * du; + + CALL_Begin(GET_DISPATCH(), (prim)); + for (i=i1;i<=i2;i++,u+=du) { + CALL_EvalCoord1f(GET_DISPATCH(), (u)); + } + CALL_End(GET_DISPATCH(), ()); +} + + +static void GLAPIENTRY +vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +{ + GET_CURRENT_CONTEXT(ctx); + GLfloat u, du, v, dv, v1, u1; + GLint i, j; + + switch (mode) { + case GL_POINT: + case GL_LINE: + case GL_FILL: + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" ); + return; + } + + /* No effect if vertex maps disabled. + */ + if (!ctx->Eval.Map2Vertex4 && + !ctx->Eval.Map2Vertex3) + return; + + du = ctx->Eval.MapGrid2du; + dv = ctx->Eval.MapGrid2dv; + v1 = ctx->Eval.MapGrid2v1 + j1 * dv; + u1 = ctx->Eval.MapGrid2u1 + i1 * du; + + switch (mode) { + case GL_POINT: + CALL_Begin(GET_DISPATCH(), (GL_POINTS)); + for (v=v1,j=j1;j<=j2;j++,v+=dv) { + for (u=u1,i=i1;i<=i2;i++,u+=du) { + CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); + } + } + CALL_End(GET_DISPATCH(), ()); + break; + case GL_LINE: + for (v=v1,j=j1;j<=j2;j++,v+=dv) { + CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); + for (u=u1,i=i1;i<=i2;i++,u+=du) { + CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); + } + CALL_End(GET_DISPATCH(), ()); + } + for (u=u1,i=i1;i<=i2;i++,u+=du) { + CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); + for (v=v1,j=j1;j<=j2;j++,v+=dv) { + CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); + } + CALL_End(GET_DISPATCH(), ()); + } + break; + case GL_FILL: + for (v=v1,j=j1;j<j2;j++,v+=dv) { + CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP)); + for (u=u1,i=i1;i<=i2;i++,u+=du) { + CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); + CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv)); + } + CALL_End(GET_DISPATCH(), ()); + } + break; + } +} + /** * Called from glDrawArrays when in immediate mode (not display list mode). @@ -859,6 +986,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, { static GLuint warnCount = 0; GLboolean index_bounds_valid = GL_TRUE; + GLuint max_element; GET_CURRENT_CONTEXT(ctx); if (MESA_VERBOSE & VERBOSE_DRAW) @@ -871,8 +999,27 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, type, indices, basevertex )) return; + if (ctx->Const.CheckArrayBounds) { + /* _MaxElement was computed, so we can use it. + * This path is used for drivers which need strict bounds checking. + */ + max_element = ctx->Array.ArrayObj->_MaxElement; + } + else { + /* Generally, hardware drivers don't need to know the buffer bounds + * if all vertex attributes are in VBOs. + * However, if none of vertex attributes are in VBOs, _MaxElement + * is always set to some random big number anyway, so bounds checking + * is mostly useless. + * + * This is only useful to catch invalid values in the "end" parameter + * like ~0. + */ + max_element = 2 * 1000 * 1000 * 1000; /* just a big number */ + } + if ((int) end + basevertex < 0 || - start + basevertex >= ctx->Array.ArrayObj->_MaxElement) { + start + basevertex >= max_element) { /* The application requested we draw using a range of indices that's * outside the bounds of the current VBO. This is invalid and appears * to give undefined results. The safest thing to do is to simply @@ -886,7 +1033,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, "\trange is outside VBO bounds (max=%u); ignoring.\n" "\tThis should be fixed in the application.", start, end, basevertex, count, type, indices, - ctx->Array.ArrayObj->_MaxElement - 1); + max_element - 1); } index_bounds_valid = GL_FALSE; } @@ -917,7 +1064,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, } if ((int) start + basevertex < 0 || - end + basevertex >= ctx->Array.ArrayObj->_MaxElement) + end + basevertex >= max_element) index_bounds_valid = GL_FALSE; #if 0 @@ -1359,40 +1506,50 @@ vbo_exec_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name, vbo_draw_transform_feedback(ctx, mode, obj, stream, primcount); } + /** - * Plug in the immediate-mode vertex array drawing commands into the - * givven vbo_exec_context object. + * Initialize the dispatch table with the VBO functions for drawing. */ void -vbo_exec_array_init( struct vbo_exec_context *exec ) +vbo_initialize_exec_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec) { - exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays; - exec->vtxfmt.DrawElements = vbo_exec_DrawElements; - exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements; - exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements; - exec->vtxfmt.DrawElementsBaseVertex = vbo_exec_DrawElementsBaseVertex; - exec->vtxfmt.DrawRangeElementsBaseVertex = vbo_exec_DrawRangeElementsBaseVertex; - exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex; - exec->vtxfmt.DrawArraysInstanced = vbo_exec_DrawArraysInstanced; - exec->vtxfmt.DrawArraysInstancedBaseInstance = vbo_exec_DrawArraysInstancedBaseInstance; - exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced; - exec->vtxfmt.DrawElementsInstancedBaseInstance = vbo_exec_DrawElementsInstancedBaseInstance; - exec->vtxfmt.DrawElementsInstancedBaseVertex = vbo_exec_DrawElementsInstancedBaseVertex; - exec->vtxfmt.DrawElementsInstancedBaseVertexBaseInstance = vbo_exec_DrawElementsInstancedBaseVertexBaseInstance; - exec->vtxfmt.DrawTransformFeedback = vbo_exec_DrawTransformFeedback; - exec->vtxfmt.DrawTransformFeedbackStream = - vbo_exec_DrawTransformFeedbackStream; - exec->vtxfmt.DrawTransformFeedbackInstanced = - vbo_exec_DrawTransformFeedbackInstanced; - exec->vtxfmt.DrawTransformFeedbackStreamInstanced = - vbo_exec_DrawTransformFeedbackStreamInstanced; -} + SET_DrawArrays(exec, vbo_exec_DrawArrays); + SET_DrawElements(exec, vbo_exec_DrawElements); + if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) { + SET_DrawRangeElements(exec, vbo_exec_DrawRangeElements); + } -void -vbo_exec_array_destroy( struct vbo_exec_context *exec ) -{ - /* nothing to do */ + SET_MultiDrawElementsEXT(exec, vbo_exec_MultiDrawElements); + + if (ctx->API == API_OPENGL_COMPAT) { + SET_Rectf(exec, vbo_exec_Rectf); + SET_EvalMesh1(exec, vbo_exec_EvalMesh1); + SET_EvalMesh2(exec, vbo_exec_EvalMesh2); + } + + if (_mesa_is_desktop_gl(ctx)) { + SET_DrawElementsBaseVertex(exec, vbo_exec_DrawElementsBaseVertex); + SET_DrawRangeElementsBaseVertex(exec, vbo_exec_DrawRangeElementsBaseVertex); + SET_MultiDrawElementsBaseVertex(exec, vbo_exec_MultiDrawElementsBaseVertex); + SET_DrawArraysInstancedBaseInstance(exec, vbo_exec_DrawArraysInstancedBaseInstance); + SET_DrawElementsInstancedBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseInstance); + SET_DrawElementsInstancedBaseVertex(exec, vbo_exec_DrawElementsInstancedBaseVertex); + SET_DrawElementsInstancedBaseVertexBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseVertexBaseInstance); + } + + if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) { + SET_DrawArraysInstancedARB(exec, vbo_exec_DrawArraysInstanced); + SET_DrawElementsInstancedARB(exec, vbo_exec_DrawElementsInstanced); + } + + if (_mesa_is_desktop_gl(ctx)) { + SET_DrawTransformFeedback(exec, vbo_exec_DrawTransformFeedback); + SET_DrawTransformFeedbackStream(exec, vbo_exec_DrawTransformFeedbackStream); + SET_DrawTransformFeedbackInstanced(exec, vbo_exec_DrawTransformFeedbackInstanced); + SET_DrawTransformFeedbackStreamInstanced(exec, vbo_exec_DrawTransformFeedbackStreamInstanced); + } } diff --git a/mesalib/src/mesa/vbo/vbo_exec_draw.c b/mesalib/src/mesa/vbo/vbo_exec_draw.c index 9529ce069..6a4f2a98b 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_draw.c +++ b/mesalib/src/mesa/vbo/vbo_exec_draw.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> @@ -30,7 +31,6 @@ #include "main/compiler.h" #include "main/context.h" #include "main/enums.h" -#include "main/mfeatures.h" #include "main/state.h" #include "main/vtxfmt.h" diff --git a/mesalib/src/mesa/vbo/vbo_exec_eval.c b/mesalib/src/mesa/vbo/vbo_exec_eval.c index e6c728476..103b04a01 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_eval.c +++ b/mesalib/src/mesa/vbo/vbo_exec_eval.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/vbo/vbo_noop.c b/mesalib/src/mesa/vbo/vbo_noop.c index 2f2200219..f86984589 100644 --- a/mesalib/src/mesa/vbo/vbo_noop.c +++ b/mesalib/src/mesa/vbo/vbo_noop.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -29,12 +30,10 @@ #include "main/glheader.h" -#include "main/api_arrayelt.h" #include "main/context.h" #include "main/dispatch.h" #include "main/dlist.h" #include "main/eval.h" -#include "main/mfeatures.h" #include "vbo/vbo_noop.h" static void GLAPIENTRY @@ -332,84 +331,23 @@ _mesa_noop_EvalPoint2(GLint a, GLint b) } static void GLAPIENTRY -_mesa_noop_Begin(GLenum mode) -{ -} - -static void GLAPIENTRY -_mesa_noop_End(void) -{ -} - -static void GLAPIENTRY -_mesa_noop_PrimitiveRestartNV(void) -{ -} - - -static void GLAPIENTRY -_mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ -} - - -static void GLAPIENTRY -_mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ -} - -static void GLAPIENTRY -_mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid * indices) -{ -} - -static void GLAPIENTRY -_mesa_noop_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid * indices, GLint basevertex) +_mesa_noop_ArrayElement(GLint elem) { } static void GLAPIENTRY -_mesa_noop_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid * indices) -{ -} - -static void GLAPIENTRY -_mesa_noop_MultiDrawElements(GLenum mode, const GLsizei * count, GLenum type, - const GLvoid ** indices, GLsizei primcount) -{ -} - -static void GLAPIENTRY -_mesa_noop_DrawRangeElementsBaseVertex(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid * indices, - GLint basevertex) -{ -} - -static void GLAPIENTRY -_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei * count, - GLenum type, - const GLvoid * const *indices, - GLsizei primcount, - const GLint * basevertex) +_mesa_noop_Begin(GLenum mode) { } static void GLAPIENTRY -_mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2) +_mesa_noop_End(void) { } static void GLAPIENTRY -_mesa_noop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +_mesa_noop_PrimitiveRestartNV(void) { } @@ -422,11 +360,12 @@ _mesa_noop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) void _mesa_noop_vtxfmt_init(GLvertexformat * vfmt) { - _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->ArrayElement = _mesa_noop_ArrayElement; vfmt->Begin = _mesa_noop_Begin; - _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); + vfmt->CallList = _mesa_CallList; + vfmt->CallLists = _mesa_CallLists; vfmt->Color3f = _mesa_noop_Color3f; vfmt->Color3fv = _mesa_noop_Color3fv; @@ -437,7 +376,12 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt) vfmt->PrimitiveRestartNV = _mesa_noop_PrimitiveRestartNV; - _MESA_INIT_EVAL_VTXFMT(vfmt, _mesa_noop_); + vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f; + vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv; + vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f; + vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv; + vfmt->EvalPoint1 = _mesa_noop_EvalPoint1; + vfmt->EvalPoint2 = _mesa_noop_EvalPoint2; vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; @@ -486,16 +430,6 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt) vfmt->VertexAttrib3fvARB = _mesa_noop_VertexAttrib3fvARB; vfmt->VertexAttrib4fARB = _mesa_noop_VertexAttrib4fARB; vfmt->VertexAttrib4fvARB = _mesa_noop_VertexAttrib4fvARB; - - vfmt->Rectf = _mesa_noop_Rectf; - - vfmt->DrawArrays = _mesa_noop_DrawArrays; - vfmt->DrawElements = _mesa_noop_DrawElements; - vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; - vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; - vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; - vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; - vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; } diff --git a/mesalib/src/mesa/vbo/vbo_noop.h b/mesalib/src/mesa/vbo/vbo_noop.h index 044d373e8..f61cd5136 100644 --- a/mesalib/src/mesa/vbo/vbo_noop.h +++ b/mesalib/src/mesa/vbo/vbo_noop.h @@ -17,16 +17,16 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _API_NOOP_H #define _API_NOOP_H -#include "main/mfeatures.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/vbo/vbo_primitive_restart.c b/mesalib/src/mesa/vbo/vbo_primitive_restart.c index a6a0149ca..418f8829d 100644 --- a/mesalib/src/mesa/vbo/vbo_primitive_restart.c +++ b/mesalib/src/mesa/vbo/vbo_primitive_restart.c @@ -31,6 +31,7 @@ #include "main/imports.h" #include "main/bufferobj.h" #include "main/macros.h" +#include "main/varray.h" #include "vbo.h" #include "vbo_context.h" @@ -171,7 +172,7 @@ vbo_sw_primitive_restart(struct gl_context *ctx, GLuint sub_prim_num; GLuint end_index; GLuint sub_end_index; - GLuint restart_index = ctx->Array._RestartIndex; + GLuint restart_index = _mesa_primitive_restart_index(ctx, ib->type); struct _mesa_prim temp_prim; struct vbo_context *vbo = vbo_context(ctx); vbo_draw_func draw_prims_func = vbo->draw_prims; diff --git a/mesalib/src/mesa/vbo/vbo_rebase.c b/mesalib/src/mesa/vbo/vbo_rebase.c index d0bf6c59d..65ab58bf3 100644 --- a/mesalib/src/mesa/vbo/vbo_rebase.c +++ b/mesalib/src/mesa/vbo/vbo_rebase.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/vbo/vbo_save.c b/mesalib/src/mesa/vbo/vbo_save.c index ad11b5ddc..305256a3a 100644 --- a/mesalib/src/mesa/vbo/vbo_save.c +++ b/mesalib/src/mesa/vbo/vbo_save.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> @@ -29,7 +30,6 @@ #include "main/mtypes.h" #include "main/bufferobj.h" #include "main/imports.h" -#include "main/mfeatures.h" #include "vbo_context.h" @@ -86,7 +86,7 @@ void vbo_save_init( struct gl_context *ctx ) } } - ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; + ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; } diff --git a/mesalib/src/mesa/vbo/vbo_save.h b/mesalib/src/mesa/vbo/vbo_save.h index 750117b12..aa075bb31 100644 --- a/mesalib/src/mesa/vbo/vbo_save.h +++ b/mesalib/src/mesa/vbo/vbo_save.h @@ -34,7 +34,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef VBO_SAVE_H #define VBO_SAVE_H -#include "main/mfeatures.h" #include "main/mtypes.h" #include "vbo.h" #include "vbo_attrib.h" @@ -127,10 +126,10 @@ struct vbo_save_context { struct gl_client_array arrays[VBO_ATTRIB_MAX]; const struct gl_client_array *inputs[VBO_ATTRIB_MAX]; - GLubyte attrsz[VBO_ATTRIB_MAX]; - GLenum attrtype[VBO_ATTRIB_MAX]; - GLubyte active_sz[VBO_ATTRIB_MAX]; - GLuint vertex_size; + GLubyte attrsz[VBO_ATTRIB_MAX]; /**< 1, 2, 3 or 4 */ + GLenum attrtype[VBO_ATTRIB_MAX]; /**< GL_FLOAT, GL_INT, etc */ + GLubyte active_sz[VBO_ATTRIB_MAX]; /**< 1, 2, 3 or 4 */ + GLuint vertex_size; /**< size in GLfloats */ GLboolean out_of_memory; /**< True if last VBO allocation failed */ diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c index 749071753..26951bd94 100644 --- a/mesalib/src/mesa/vbo/vbo_save_api.c +++ b/mesalib/src/mesa/vbo/vbo_save_api.c @@ -74,7 +74,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/enums.h" #include "main/eval.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/api_validate.h" #include "main/api_arrayelt.h" #include "main/vtxfmt.h" @@ -306,9 +305,9 @@ _save_reset_counters(struct gl_context *ctx) * previous prim. */ static void -vbo_merge_prims(struct gl_context *ctx, - struct _mesa_prim *prim_list, - GLuint *prim_count) +merge_prims(struct gl_context *ctx, + struct _mesa_prim *prim_list, + GLuint *prim_count) { GLuint i; struct _mesa_prim *prev_prim = prim_list; @@ -316,19 +315,13 @@ vbo_merge_prims(struct gl_context *ctx, for (i = 1; i < *prim_count; i++) { struct _mesa_prim *this_prim = prim_list + i; - if (this_prim->mode == prev_prim->mode && - this_prim->mode == GL_QUADS && - this_prim->count % 4 == 0 && - prev_prim->count % 4 == 0 && - this_prim->start == prev_prim->start + prev_prim->count && - this_prim->basevertex == prev_prim->basevertex && - this_prim->num_instances == prev_prim->num_instances && - this_prim->base_instance == prev_prim->base_instance) { + vbo_try_prim_conversion(this_prim); + + if (vbo_can_merge_prims(prev_prim, this_prim)) { /* We've found a prim that just extend the previous one. Tack it * onto the previous one, and let this primitive struct get dropped. */ - prev_prim->count += this_prim->count; - prev_prim->end = this_prim->end; + vbo_merge_prims(prev_prim, this_prim); continue; } @@ -421,7 +414,7 @@ _save_compile_vertex_list(struct gl_context *ctx) */ save->copied.nr = _save_copy_vertices(ctx, node, save->buffer); - vbo_merge_prims(ctx, node->prim, &node->prim_count); + merge_prims(ctx, node->prim, &node->prim_count); /* Deal with GL_COMPILE_AND_EXECUTE: */ @@ -476,6 +469,8 @@ _save_compile_vertex_list(struct gl_context *ctx) /** + * This is called when we fill a vertex buffer before we hit a glEnd(). + * We * TODO -- If no new vertices have been stored, don't bother saving it. */ static void @@ -584,7 +579,11 @@ _save_copy_from_current(struct gl_context *ctx) } -/* Flush existing data, set new attrib size, replay copied vertices. +/** + * Called when we increase the size of a vertex attribute. For example, + * if we've seen one or more glTexCoord2f() calls and now we get a + * glTexCoord3f() call. + * Flush existing data, set new attrib size, replay copied vertices. */ static void _save_upgrade_vertex(struct gl_context *ctx, GLuint attr, GLuint newsz) @@ -641,7 +640,7 @@ _save_upgrade_vertex(struct gl_context *ctx, GLuint attr, GLuint newsz) * and will need fixup at runtime. */ if (save->copied.nr) { - GLfloat *data = save->copied.buffer; + const GLfloat *data = save->copied.buffer; GLfloat *dest = save->buffer; GLuint j; @@ -683,6 +682,11 @@ _save_upgrade_vertex(struct gl_context *ctx, GLuint attr, GLuint newsz) } +/** + * This is called when the size of a vertex attribute changes. + * For example, after seeing one or more glTexCoord2f() calls we + * get a glTexCoord4f() or glTexCoord1f() call. + */ static void save_fixup_vertex(struct gl_context *ctx, GLuint attr, GLuint sz) { @@ -709,6 +713,11 @@ save_fixup_vertex(struct gl_context *ctx, GLuint attr, GLuint sz) } +/** + * Reset the current size of all vertex attributes to the default + * value of 0. This signals that we haven't yet seen any per-vertex + * commands such as glNormal3f() or glTexCoord2f(). + */ static void _save_reset_vertex(struct gl_context *ctx) { @@ -861,7 +870,7 @@ dlist_fallback(struct gl_context *ctx) else { _mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt); } - ctx->Driver.SaveNeedFlush = 0; + ctx->Driver.SaveNeedFlush = GL_FALSE; } @@ -931,15 +940,16 @@ _save_CallLists(GLsizei n, GLenum type, const GLvoid * v) -/* This begin is hooked into ... Updating of - * ctx->Driver.CurrentSavePrimitive is already taken care of. +/** + * Called via ctx->Driver.NotifySaveBegin() when a glBegin is getting + * compiled into a display list. + * Updating of ctx->Driver.CurrentSavePrimitive is already taken care of. */ GLboolean vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode) { struct vbo_save_context *save = &vbo_context(ctx)->save; - - GLuint i = save->prim_count++; + const GLuint i = save->prim_count++; assert(i < save->prim_max); save->prim[i].mode = mode & VBO_SAVE_PRIM_MODE_MASK; @@ -960,7 +970,13 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode) else { _mesa_install_save_vtxfmt(ctx, &save->vtxfmt); } - ctx->Driver.SaveNeedFlush = 1; + + /* We need to call SaveFlushVertices() if there's state change */ + ctx->Driver.SaveNeedFlush = GL_TRUE; + + /* GL_TRUE means we've handled this glBegin here; don't compile a BEGIN + * opcode into the display list. + */ return GL_TRUE; } @@ -970,7 +986,7 @@ _save_End(void) { GET_CURRENT_CONTEXT(ctx); struct vbo_save_context *save = &vbo_context(ctx)->save; - GLint i = save->prim_count - 1; + const GLint i = save->prim_count - 1; ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; save->prim[i].end = 1; @@ -994,198 +1010,6 @@ _save_End(void) } -/* These are all errors as this vtxfmt is only installed inside - * begin/end pairs. - */ -static void GLAPIENTRY -_save_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid * indices) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) count; - (void) type; - (void) indices; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawElements"); -} - - -static void GLAPIENTRY -_save_DrawRangeElements(GLenum mode, GLuint start, GLuint end, - GLsizei count, GLenum type, const GLvoid * indices) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) start; - (void) end; - (void) count; - (void) type; - (void) indices; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements"); -} - - -static void GLAPIENTRY -_save_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid * indices, GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) count; - (void) type; - (void) indices; - (void) basevertex; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawElements"); -} - - -static void GLAPIENTRY -_save_DrawRangeElementsBaseVertex(GLenum mode, - GLuint start, - GLuint end, - GLsizei count, - GLenum type, - const GLvoid * indices, GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) start; - (void) end; - (void) count; - (void) type; - (void) indices; - (void) basevertex; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements"); -} - - -static void GLAPIENTRY -_save_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) start; - (void) count; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawArrays"); -} - - -static void GLAPIENTRY -_save_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) count; - (void) type; - (void) indices; - (void) primcount; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glMultiDrawElements"); -} - - -static void GLAPIENTRY -_save_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, - GLenum type, const GLvoid * const *indices, - GLsizei primcount, const GLint *basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) count; - (void) type; - (void) indices; - (void) primcount; - (void) basevertex; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, - "glMultiDrawElementsBaseVertex"); -} - - -static void GLAPIENTRY -_save_DrawTransformFeedback(GLenum mode, GLuint name) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) name; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawTransformFeedback"); -} - - -static void GLAPIENTRY -_save_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) name; - (void) stream; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, - "glDrawTransformFeedbackStream"); -} - - -static void GLAPIENTRY -_save_DrawTransformFeedbackInstanced(GLenum mode, GLuint name, - GLsizei primcount) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) name; - (void) primcount; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, - "glDrawTransformFeedbackInstanced"); -} - - -static void GLAPIENTRY -_save_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name, - GLuint stream, GLsizei primcount) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) name; - (void) stream; - (void) primcount; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, - "glDrawTransformFeedbackStreamInstanced"); -} - - -static void GLAPIENTRY -_save_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ - GET_CURRENT_CONTEXT(ctx); - (void) x1; - (void) y1; - (void) x2; - (void) y2; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glRectf"); -} - - -static void GLAPIENTRY -_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) i1; - (void) i2; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glEvalMesh1"); -} - - -static void GLAPIENTRY -_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) i1; - (void) i2; - (void) j1; - (void) j2; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glEvalMesh2"); -} - - static void GLAPIENTRY _save_Begin(GLenum mode) { @@ -1233,8 +1057,14 @@ _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count) struct vbo_save_context *save = &vbo_context(ctx)->save; GLint i; - if (!_mesa_validate_DrawArrays(ctx, mode, start, count)) + if (!_mesa_is_valid_prim_mode(ctx, mode)) { + _mesa_compile_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)"); + return; + } + if (count < 0) { + _mesa_compile_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count<0)"); return; + } if (save->out_of_memory) return; @@ -1263,8 +1093,20 @@ _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type, struct vbo_save_context *save = &vbo_context(ctx)->save; GLint i; - if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices, 0)) + if (!_mesa_is_valid_prim_mode(ctx, mode)) { + _mesa_compile_error(ctx, GL_INVALID_ENUM, "glDrawElements(mode)"); + return; + } + if (count < 0) { + _mesa_compile_error(ctx, GL_INVALID_VALUE, "glDrawElements(count<0)"); + return; + } + if (type != GL_UNSIGNED_BYTE && + type != GL_UNSIGNED_SHORT && + type != GL_UNSIGNED_INT) { + _mesa_compile_error(ctx, GL_INVALID_VALUE, "glDrawElements(count<0)"); return; + } if (save->out_of_memory) return; @@ -1310,9 +1152,26 @@ _save_OBE_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GET_CURRENT_CONTEXT(ctx); struct vbo_save_context *save = &vbo_context(ctx)->save; - if (!_mesa_validate_DrawRangeElements(ctx, mode, - start, end, count, type, indices, 0)) + if (!_mesa_is_valid_prim_mode(ctx, mode)) { + _mesa_compile_error(ctx, GL_INVALID_ENUM, "glDrawRangeElements(mode)"); + return; + } + if (count < 0) { + _mesa_compile_error(ctx, GL_INVALID_VALUE, + "glDrawRangeElements(count<0)"); return; + } + if (type != GL_UNSIGNED_BYTE && + type != GL_UNSIGNED_SHORT && + type != GL_UNSIGNED_INT) { + _mesa_compile_error(ctx, GL_INVALID_ENUM, "glDrawRangeElements(type)"); + return; + } + if (end < start) { + _mesa_compile_error(ctx, GL_INVALID_VALUE, + "glDrawRangeElements(end < start)"); + return; + } if (save->out_of_memory) return; @@ -1360,9 +1219,8 @@ _save_vtxfmt_init(struct gl_context *ctx) struct vbo_save_context *save = &vbo_context(ctx)->save; GLvertexformat *vfmt = &save->vtxfmt; - _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->ArrayElement = _ae_ArrayElement; - vfmt->Begin = _save_Begin; vfmt->Color3f = _save_Color3f; vfmt->Color3fv = _save_Color3fv; vfmt->Color4f = _save_Color4f; @@ -1485,30 +1343,42 @@ _save_vtxfmt_init(struct gl_context *ctx) /* This will all require us to fallback to saving the list as opcodes: */ - _MESA_INIT_DLIST_VTXFMT(vfmt, _save_); /* inside begin/end */ + vfmt->CallList = _save_CallList; + vfmt->CallLists = _save_CallLists; - _MESA_INIT_EVAL_VTXFMT(vfmt, _save_); + vfmt->EvalCoord1f = _save_EvalCoord1f; + vfmt->EvalCoord1fv = _save_EvalCoord1fv; + vfmt->EvalCoord2f = _save_EvalCoord2f; + vfmt->EvalCoord2fv = _save_EvalCoord2fv; + vfmt->EvalPoint1 = _save_EvalPoint1; + vfmt->EvalPoint2 = _save_EvalPoint2; /* These calls all generate GL_INVALID_OPERATION since this vtxfmt is * only used when we're inside a glBegin/End pair. */ vfmt->Begin = _save_Begin; - vfmt->Rectf = _save_Rectf; - vfmt->DrawArrays = _save_DrawArrays; - vfmt->DrawElements = _save_DrawElements; - vfmt->DrawRangeElements = _save_DrawRangeElements; - vfmt->DrawElementsBaseVertex = _save_DrawElementsBaseVertex; - vfmt->DrawRangeElementsBaseVertex = _save_DrawRangeElementsBaseVertex; - vfmt->MultiDrawElementsEXT = _save_MultiDrawElements; - vfmt->MultiDrawElementsBaseVertex = _save_MultiDrawElementsBaseVertex; - vfmt->DrawTransformFeedback = _save_DrawTransformFeedback; - vfmt->DrawTransformFeedbackStream = _save_DrawTransformFeedbackStream; - vfmt->DrawTransformFeedbackInstanced = _save_DrawTransformFeedbackInstanced; - vfmt->DrawTransformFeedbackStreamInstanced = - _save_DrawTransformFeedbackStreamInstanced; } +/** + * Initialize the dispatch table with the VBO functions for display + * list compilation. + */ +void +vbo_initialize_save_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec) +{ + SET_DrawArrays(exec, _save_OBE_DrawArrays); + SET_DrawElements(exec, _save_OBE_DrawElements); + SET_DrawRangeElements(exec, _save_OBE_DrawRangeElements); + SET_MultiDrawElementsEXT(exec, _save_OBE_MultiDrawElements); + SET_MultiDrawElementsBaseVertex(exec, _save_OBE_MultiDrawElementsBaseVertex); + SET_Rectf(exec, _save_OBE_Rectf); + /* Note: other glDraw functins aren't compiled into display lists */ +} + + + void vbo_save_SaveFlushVertices(struct gl_context *ctx) { @@ -1516,8 +1386,7 @@ vbo_save_SaveFlushVertices(struct gl_context *ctx) /* Noop when we are actually active: */ - if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM || - ctx->Driver.CurrentSavePrimitive <= GL_POLYGON) + if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) return; if (save->vert_count || save->prim_count) @@ -1526,7 +1395,7 @@ vbo_save_SaveFlushVertices(struct gl_context *ctx) _save_copy_to_current(ctx); _save_reset_vertex(ctx); _save_reset_counters(ctx); - ctx->Driver.SaveNeedFlush = 0; + ctx->Driver.SaveNeedFlush = GL_FALSE; } @@ -1548,7 +1417,7 @@ vbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode) _save_reset_vertex(ctx); _save_reset_counters(ctx); - ctx->Driver.SaveNeedFlush = 0; + ctx->Driver.SaveNeedFlush = GL_FALSE; } @@ -1559,8 +1428,7 @@ vbo_save_EndList(struct gl_context *ctx) /* EndList called inside a (saved) Begin/End pair? */ - if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) { - + if (_mesa_inside_dlist_begin_end(ctx)) { if (save->prim_count > 0) { GLint i = save->prim_count - 1; ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; @@ -1700,14 +1568,4 @@ vbo_save_api_init(struct vbo_save_context *save) /* These will actually get set again when binding/drawing */ for (i = 0; i < VBO_ATTRIB_MAX; i++) save->inputs[i] = &save->arrays[i]; - - /* Hook our array functions into the outside-begin-end vtxfmt in - * ctx->ListState. - */ - ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf; - ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays; - ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements; - ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements; - ctx->ListState.ListVtxfmt.MultiDrawElementsEXT = _save_OBE_MultiDrawElements; - ctx->ListState.ListVtxfmt.MultiDrawElementsBaseVertex = _save_OBE_MultiDrawElementsBaseVertex; } diff --git a/mesalib/src/mesa/vbo/vbo_save_draw.c b/mesalib/src/mesa/vbo/vbo_save_draw.c index f5b5c411d..a6ce379e2 100644 --- a/mesalib/src/mesa/vbo/vbo_save_draw.c +++ b/mesalib/src/mesa/vbo/vbo_save_draw.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* Author: @@ -30,7 +31,6 @@ #include "main/bufferobj.h" #include "main/context.h" #include "main/imports.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/macros.h" #include "main/light.h" @@ -269,17 +269,12 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) if (node->prim_count > 0) { - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END && - node->prim[0].begin) { - - /* Degenerate case: list is called inside begin/end pair and - * includes operations such as glBegin or glDrawArrays. - */ - if (0) - printf("displaylist recursive begin"); - - vbo_save_loopback_vertex_list( ctx, node ); - + if (_mesa_inside_begin_end(ctx) && node->prim[0].begin) { + /* Error: we're about to begin a new primitive but we're already + * inside a glBegin/End pair. + */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "draw operation inside glBegin/End"); goto end; } else if (save->replay_flags) { diff --git a/mesalib/src/mesa/vbo/vbo_save_loopback.c b/mesalib/src/mesa/vbo/vbo_save_loopback.c index 98772be76..31343cd67 100644 --- a/mesalib/src/mesa/vbo/vbo_save_loopback.c +++ b/mesalib/src/mesa/vbo/vbo_save_loopback.c @@ -29,7 +29,6 @@ #include "main/glheader.h" #include "main/enums.h" #include "main/imports.h" -#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/dispatch.h" #include "glapi/glapi.h" @@ -178,7 +177,7 @@ void vbo_loopback_vertex_list( struct gl_context *ctx, for (i = 0 ; i < prim_count ; i++) { if ((prim[i].mode & VBO_SAVE_PRIM_WEAK) && - (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END)) + _mesa_inside_begin_end(ctx)) { loopback_weak_prim( ctx, &prim[i] ); } diff --git a/mesalib/src/mesa/vbo/vbo_split.c b/mesalib/src/mesa/vbo/vbo_split.c index c933a3f9a..e128f5bd0 100644 --- a/mesalib/src/mesa/vbo/vbo_split.c +++ b/mesalib/src/mesa/vbo/vbo_split.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/vbo/vbo_split.h b/mesalib/src/mesa/vbo/vbo_split.h index b7f0a9c57..a4e5fa0b8 100644 --- a/mesalib/src/mesa/vbo/vbo_split.h +++ b/mesalib/src/mesa/vbo/vbo_split.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/vbo/vbo_split_copy.c b/mesalib/src/mesa/vbo/vbo_split_copy.c index a917f39ca..9df36df78 100644 --- a/mesalib/src/mesa/vbo/vbo_split_copy.c +++ b/mesalib/src/mesa/vbo/vbo_split_copy.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/vbo/vbo_split_inplace.c b/mesalib/src/mesa/vbo/vbo_split_inplace.c index 8a3830805..b26b00af8 100644 --- a/mesalib/src/mesa/vbo/vbo_split_inplace.c +++ b/mesalib/src/mesa/vbo/vbo_split_inplace.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Keith Whitwell <keith@tungstengraphics.com> diff --git a/mesalib/src/mesa/x86/3dnow.c b/mesalib/src/mesa/x86/3dnow.c index de2fb1e2a..f12dc2610 100644 --- a/mesalib/src/mesa/x86/3dnow.c +++ b/mesalib/src/mesa/x86/3dnow.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/3dnow.h b/mesalib/src/mesa/x86/3dnow.h index 1c1fedcd4..e13f400d4 100644 --- a/mesalib/src/mesa/x86/3dnow.h +++ b/mesalib/src/mesa/x86/3dnow.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/3dnow_normal.S b/mesalib/src/mesa/x86/3dnow_normal.S index 7f5f6b357..b3908f07a 100644 --- a/mesalib/src/mesa/x86/3dnow_normal.S +++ b/mesalib/src/mesa/x86/3dnow_normal.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/3dnow_xform1.S b/mesalib/src/mesa/x86/3dnow_xform1.S index a73301a8d..004a734e1 100644 --- a/mesalib/src/mesa/x86/3dnow_xform1.S +++ b/mesalib/src/mesa/x86/3dnow_xform1.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifdef USE_3DNOW_ASM diff --git a/mesalib/src/mesa/x86/3dnow_xform2.S b/mesalib/src/mesa/x86/3dnow_xform2.S index 2988fb7bf..333ad6342 100644 --- a/mesalib/src/mesa/x86/3dnow_xform2.S +++ b/mesalib/src/mesa/x86/3dnow_xform2.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifdef USE_3DNOW_ASM diff --git a/mesalib/src/mesa/x86/3dnow_xform3.S b/mesalib/src/mesa/x86/3dnow_xform3.S index a356aaee7..740e07723 100644 --- a/mesalib/src/mesa/x86/3dnow_xform3.S +++ b/mesalib/src/mesa/x86/3dnow_xform3.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifdef USE_3DNOW_ASM diff --git a/mesalib/src/mesa/x86/3dnow_xform4.S b/mesalib/src/mesa/x86/3dnow_xform4.S index b2b7c64f2..4612d368f 100644 --- a/mesalib/src/mesa/x86/3dnow_xform4.S +++ b/mesalib/src/mesa/x86/3dnow_xform4.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifdef USE_3DNOW_ASM diff --git a/mesalib/src/mesa/x86/Makefile.am b/mesalib/src/mesa/x86/Makefile.am index 5976bb47c..21ce3607a 100644 --- a/mesalib/src/mesa/x86/Makefile.am +++ b/mesalib/src/mesa/x86/Makefile.am @@ -25,7 +25,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/mesa \ -I$(top_srcdir)/src/mapi \ - $(API_DEFINES) \ $(DEFINES) noinst_PROGRAMS = gen_matypes diff --git a/mesalib/src/mesa/x86/clip_args.h b/mesalib/src/mesa/x86/clip_args.h index 796611fbf..bafa535ef 100644 --- a/mesalib/src/mesa/x86/clip_args.h +++ b/mesalib/src/mesa/x86/clip_args.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/common_x86.c b/mesalib/src/mesa/x86/common_x86.c index 629950723..910828f16 100644 --- a/mesalib/src/mesa/x86/common_x86.c +++ b/mesalib/src/mesa/x86/common_x86.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** diff --git a/mesalib/src/mesa/x86/common_x86_asm.S b/mesalib/src/mesa/x86/common_x86_asm.S index ea4047a0e..230d588c4 100644 --- a/mesalib/src/mesa/x86/common_x86_asm.S +++ b/mesalib/src/mesa/x86/common_x86_asm.S @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/common_x86_asm.h b/mesalib/src/mesa/x86/common_x86_asm.h index 0d39e3d23..a4b714396 100644 --- a/mesalib/src/mesa/x86/common_x86_asm.h +++ b/mesalib/src/mesa/x86/common_x86_asm.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/common_x86_features.h b/mesalib/src/mesa/x86/common_x86_features.h index 676af8c1f..2069b906e 100644 --- a/mesalib/src/mesa/x86/common_x86_features.h +++ b/mesalib/src/mesa/x86/common_x86_features.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/gen_matypes.c b/mesalib/src/mesa/x86/gen_matypes.c index 61f181cd9..fff6f541b 100644 --- a/mesalib/src/mesa/x86/gen_matypes.c +++ b/mesalib/src/mesa/x86/gen_matypes.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Gareth Hughes diff --git a/mesalib/src/mesa/x86/mmx.h b/mesalib/src/mesa/x86/mmx.h index 74e9979d3..0772e0f6f 100644 --- a/mesalib/src/mesa/x86/mmx.h +++ b/mesalib/src/mesa/x86/mmx.h @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/mesalib/src/mesa/x86/norm_args.h b/mesalib/src/mesa/x86/norm_args.h index e22f8bbd7..34a546a8b 100644 --- a/mesalib/src/mesa/x86/norm_args.h +++ b/mesalib/src/mesa/x86/norm_args.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/sse.c b/mesalib/src/mesa/x86/sse.c index aef15b531..f3e93248b 100644 --- a/mesalib/src/mesa/x86/sse.c +++ b/mesalib/src/mesa/x86/sse.c @@ -17,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/sse.h b/mesalib/src/mesa/x86/sse.h index e92ddc139..20a4de277 100644 --- a/mesalib/src/mesa/x86/sse.h +++ b/mesalib/src/mesa/x86/sse.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/sse_normal.S b/mesalib/src/mesa/x86/sse_normal.S index a8c0d38c7..7024dd0ce 100644 --- a/mesalib/src/mesa/x86/sse_normal.S +++ b/mesalib/src/mesa/x86/sse_normal.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** TODO: diff --git a/mesalib/src/mesa/x86/sse_xform1.S b/mesalib/src/mesa/x86/sse_xform1.S index 4aa9de607..d165aff6d 100644 --- a/mesalib/src/mesa/x86/sse_xform1.S +++ b/mesalib/src/mesa/x86/sse_xform1.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** TODO: diff --git a/mesalib/src/mesa/x86/sse_xform2.S b/mesalib/src/mesa/x86/sse_xform2.S index a443dad35..bb0f75696 100644 --- a/mesalib/src/mesa/x86/sse_xform2.S +++ b/mesalib/src/mesa/x86/sse_xform2.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** TODO: diff --git a/mesalib/src/mesa/x86/sse_xform3.S b/mesalib/src/mesa/x86/sse_xform3.S index 4bc22d8a5..60c011094 100644 --- a/mesalib/src/mesa/x86/sse_xform3.S +++ b/mesalib/src/mesa/x86/sse_xform3.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** TODO: diff --git a/mesalib/src/mesa/x86/sse_xform4.S b/mesalib/src/mesa/x86/sse_xform4.S index fb1fa741c..596efd06a 100644 --- a/mesalib/src/mesa/x86/sse_xform4.S +++ b/mesalib/src/mesa/x86/sse_xform4.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifdef USE_SSE_ASM diff --git a/mesalib/src/mesa/x86/x86_cliptest.S b/mesalib/src/mesa/x86/x86_cliptest.S index e413aee61..b8163dad9 100644 --- a/mesalib/src/mesa/x86/x86_cliptest.S +++ b/mesalib/src/mesa/x86/x86_cliptest.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/x86_xform.c b/mesalib/src/mesa/x86/x86_xform.c index 3dcc55e16..8d1488e8b 100644 --- a/mesalib/src/mesa/x86/x86_xform.c +++ b/mesalib/src/mesa/x86/x86_xform.c @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/x86_xform.h b/mesalib/src/mesa/x86/x86_xform.h index e886d9add..9052fa46a 100644 --- a/mesalib/src/mesa/x86/x86_xform.h +++ b/mesalib/src/mesa/x86/x86_xform.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Gareth Hughes diff --git a/mesalib/src/mesa/x86/x86_xform2.S b/mesalib/src/mesa/x86/x86_xform2.S index 980725ef5..b66146041 100644 --- a/mesalib/src/mesa/x86/x86_xform2.S +++ b/mesalib/src/mesa/x86/x86_xform2.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/x86_xform3.S b/mesalib/src/mesa/x86/x86_xform3.S index 1c782f1c5..017914095 100644 --- a/mesalib/src/mesa/x86/x86_xform3.S +++ b/mesalib/src/mesa/x86/x86_xform3.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/x86_xform4.S b/mesalib/src/mesa/x86/x86_xform4.S index 97a841138..e9e9b7154 100644 --- a/mesalib/src/mesa/x86/x86_xform4.S +++ b/mesalib/src/mesa/x86/x86_xform4.S @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* diff --git a/mesalib/src/mesa/x86/xform_args.h b/mesalib/src/mesa/x86/xform_args.h index b773f5198..d2cf6f712 100644 --- a/mesalib/src/mesa/x86/xform_args.h +++ b/mesalib/src/mesa/x86/xform_args.h @@ -18,9 +18,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /* |