aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r--mesalib/src/mesa/Android.gen.mk131
-rw-r--r--mesalib/src/mesa/Android.mk115
-rw-r--r--mesalib/src/mesa/Makefile20
-rw-r--r--mesalib/src/mesa/Makefile.mgw22
-rw-r--r--mesalib/src/mesa/SConscript25
-rw-r--r--mesalib/src/mesa/drivers/common/driverfuncs.c13
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c263
-rw-r--r--mesalib/src/mesa/drivers/common/meta.h33
-rw-r--r--mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h150
-rw-r--r--mesalib/src/mesa/drivers/dri/common/mmx.h560
-rw-r--r--mesalib/src/mesa/drivers/dri/common/spantmp.h325
-rw-r--r--mesalib/src/mesa/drivers/dri/common/xmlconfig.c2
-rw-r--r--mesalib/src/mesa/drivers/dri/common/xmlpool.h2
-rw-r--r--mesalib/src/mesa/drivers/dri/common/xmlpool/options.h60
-rw-r--r--mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h30
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/ddlog.c192
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/ddlog.h109
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c2212
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglcontext.h281
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglglobals.c149
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglglobals.h198
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglmacros.h91
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglpf.c620
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglpf.h77
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglwgl.c2964
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglwgl.h127
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dll_main.c817
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dllmain.h64
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c1204
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h327
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h77
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c344
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c77
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c1445
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c2104
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c263
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c443
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c1346
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gld_debug_clip.c39
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gld_debug_norm.c39
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gld_debug_xform.c41
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gld_dispatch.c73
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gld_driver.c279
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gld_driver.h90
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc43
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/gldlame8.c181
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h520
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c1681
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/opengl32.def488
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref495
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/pixpack.h108
-rw-r--r--mesalib/src/mesa/drivers/windows/icd/icd.c347
-rw-r--r--mesalib/src/mesa/drivers/windows/icd/icdlist.h336
-rw-r--r--mesalib/src/mesa/drivers/windows/icd/mesa.def102
-rw-r--r--mesalib/src/mesa/main/api_arrayelt.c12
-rw-r--r--mesalib/src/mesa/main/api_validate.c6
-rw-r--r--mesalib/src/mesa/main/bufferobj.c84
-rw-r--r--mesalib/src/mesa/main/compiler.h3
-rw-r--r--mesalib/src/mesa/main/dd.h15
-rw-r--r--mesalib/src/mesa/main/debug.c1257
-rw-r--r--mesalib/src/mesa/main/dlist.c7
-rw-r--r--mesalib/src/mesa/main/drawtex.c270
-rw-r--r--mesalib/src/mesa/main/enums.c3549
-rw-r--r--mesalib/src/mesa/main/es_generator.py4
-rw-r--r--mesalib/src/mesa/main/extensions.c2009
-rw-r--r--mesalib/src/mesa/main/fbobject.c82
-rw-r--r--mesalib/src/mesa/main/imports.c3
-rw-r--r--mesalib/src/mesa/main/imports.h8
-rw-r--r--mesalib/src/mesa/main/mtypes.h9
-rw-r--r--mesalib/src/mesa/main/pbo.c33
-rw-r--r--mesalib/src/mesa/main/querymatrix.c424
-rw-r--r--mesalib/src/mesa/main/remap_helper.h3732
-rw-r--r--mesalib/src/mesa/main/shared.c2
-rw-r--r--mesalib/src/mesa/main/texgetimage.c14
-rw-r--r--mesalib/src/mesa/main/teximage.c2
-rw-r--r--mesalib/src/mesa/main/uniforms.c18
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp179
-rw-r--r--mesalib/src/mesa/program/prog_execute.c10
-rw-r--r--mesalib/src/mesa/program/prog_opt_constant_fold.c451
-rw-r--r--mesalib/src/mesa/program/prog_optimize.c2
-rw-r--r--mesalib/src/mesa/program/prog_optimize.h97
-rw-r--r--mesalib/src/mesa/program/register_allocate.c21
-rw-r--r--mesalib/src/mesa/program/register_allocate.h2
-rw-r--r--mesalib/src/mesa/sources.mak1
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c51
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c30
-rw-r--r--mesalib/src/mesa/state_tracker/st_gen_mipmap.c1
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp365
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h1
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.c4
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.h5
-rw-r--r--mesalib/src/mesa/swrast/s_aatritemp.h674
-rw-r--r--mesalib/src/mesa/swrast/s_context.c105
-rw-r--r--mesalib/src/mesa/swrast/s_stencil.c2491
-rw-r--r--mesalib/src/mesa/swrast/s_texcombine.c1506
-rw-r--r--mesalib/src/mesa/tnl/NOTES200
-rw-r--r--mesalib/src/mesa/tnl/t_draw.c39
-rw-r--r--mesalib/src/mesa/tnl/t_pipeline.c432
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c38
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_array.c60
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_draw.c843
-rw-r--r--mesalib/src/mesa/vbo/vbo_rebase.c10
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_api.c11
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_draw.c14
-rw-r--r--mesalib/src/mesa/vbo/vbo_split.c337
-rw-r--r--mesalib/src/mesa/vbo/vbo_split_copy.c1254
106 files changed, 11313 insertions, 31608 deletions
diff --git a/mesalib/src/mesa/Android.gen.mk b/mesalib/src/mesa/Android.gen.mk
new file mode 100644
index 000000000..2a08184ae
--- /dev/null
+++ b/mesalib/src/mesa/Android.gen.mk
@@ -0,0 +1,131 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
+# Copyright (C) 2010-2011 LunarG Inc.
+#
+# 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
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+# included by core mesa Android.mk for source generation
+
+ifeq ($(LOCAL_MODULE_CLASS),)
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+endif
+
+intermediates := $(call local-intermediates-dir)
+
+sources := \
+ main/api_exec_es1.c \
+ main/api_exec_es1_dispatch.h \
+ main/api_exec_es1_remap_helper.h \
+ main/api_exec_es2.c \
+ main/api_exec_es2_dispatch.h \
+ main/api_exec_es2_remap_helper.h \
+ program/lex.yy.c \
+ program/program_parse.tab.c
+
+LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES))
+
+LOCAL_C_INCLUDES += $(intermediates)/main
+
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
+ifeq ($(TARGET_ARCH),x86)
+sources += x86/matypes.h
+LOCAL_C_INCLUDES += $(intermediates)/x86
+endif
+endif
+
+sources += main/git_sha1.h
+
+sources := $(addprefix $(intermediates)/, $(sources))
+LOCAL_GENERATED_SOURCES += $(sources)
+
+glapi := $(MESA_TOP)/src/mapi/glapi/gen
+
+es_src_deps := \
+ $(LOCAL_PATH)/main/APIspec.xml \
+ $(LOCAL_PATH)/main/es_generator.py \
+ $(LOCAL_PATH)/main/APIspecutil.py \
+ $(LOCAL_PATH)/main/APIspec.py
+
+es_hdr_deps := \
+ $(wildcard $(glapi)/*.py) \
+ $(wildcard $(glapi)/*.xml)
+
+define es-gen
+ @mkdir -p $(dir $@)
+ @echo "Gen ES: $(PRIVATE_MODULE) <= $(notdir $(@))"
+ $(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@
+endef
+
+define local-l-to-c
+ @mkdir -p $(dir $@)
+ @echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
+ $(hide) $(LEX) -o$@ $<
+endef
+
+define local-y-to-c-and-h
+ @mkdir -p $(dir $@)
+ @echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<"
+ $(hide) $(YACC) -o $@ $<
+endef
+
+$(intermediates)/main/api_exec_%.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/main/es_generator.py
+$(intermediates)/main/api_exec_%.c: PRIVATE_XML := -S $(LOCAL_PATH)/main/APIspec.xml
+$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
+$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
+$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/remap_helper.py
+$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
+
+$(intermediates)/main/api_exec_es1.c: $(es_src_deps)
+ $(call es-gen,-V GLES1.1)
+
+$(intermediates)/main/api_exec_es2.c: $(es_src_deps)
+ $(call es-gen,-V GLES2.0)
+
+$(intermediates)/main/api_exec_%_dispatch.h: $(es_hdr_deps)
+ $(call es-gen, -c $* -m remap_table)
+
+$(intermediates)/main/api_exec_%_remap_helper.h: $(es_hdr_deps)
+ $(call es-gen, -c $*)
+
+$(intermediates)/program/program_parse.tab.c: $(LOCAL_PATH)/program/program_parse.y
+ $(local-y-to-c-and-h)
+
+$(intermediates)/program/lex.yy.c: $(LOCAL_PATH)/program/program_lexer.l
+ $(local-l-to-c)
+
+$(intermediates)/main/git_sha1.h:
+ @mkdir -p $(dir $@)
+ @echo "GIT-SHA1: $(PRIVATE_MODULE) <= git"
+ $(hide) touch $@
+ $(hide) if which git > /dev/null; then \
+ git --git-dir $(PRIVATE_PATH)/../../.git log -n 1 --oneline | \
+ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
+ > $@; \
+ fi
+
+matypes_deps := \
+ $(BUILD_OUT_EXECUTABLES)/mesa_gen_matypes$(BUILD_EXECUTABLE_SUFFIX) \
+ $(LOCAL_PATH)/main/mtypes.h \
+ $(LOCAL_PATH)/tnl/t_context.h
+
+$(intermediates)/x86/matypes.h: $(matypes_deps)
+ @mkdir -p $(dir $@)
+ @echo "MATYPES: $(PRIVATE_MODULE) <= $(notdir $@)"
+ $(hide) $< > $@
diff --git a/mesalib/src/mesa/Android.mk b/mesalib/src/mesa/Android.mk
new file mode 100644
index 000000000..67808d491
--- /dev/null
+++ b/mesalib/src/mesa/Android.mk
@@ -0,0 +1,115 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
+# Copyright (C) 2010-2011 LunarG Inc.
+#
+# 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
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+# Android.mk for core mesa
+
+LOCAL_PATH := $(call my-dir)
+
+include $(LOCAL_PATH)/sources.mak
+
+common_CFLAGS := \
+ -DFEATURE_ES1=1 \
+ -DFEATURE_ES2=1
+
+common_C_INCLUDES := \
+ $(MESA_TOP)/src/mapi \
+ $(MESA_TOP)/src/glsl
+
+common_ASM :=
+
+# ---------------------------------------
+# Build mesa_gen_matypes for host
+# ---------------------------------------
+
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
+ifeq ($(TARGET_ARCH),x86)
+common_ASM += $(X86_SOURCES)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := x86/gen_matypes.c
+LOCAL_CFLAGS := $(common_CFLAGS)
+LOCAL_C_INCLUDES := $(common_C_INCLUDES)
+LOCAL_MODULE := mesa_gen_matypes
+include $(MESA_COMMON_MK)
+include $(BUILD_HOST_EXECUTABLE)
+
+endif # x86
+endif # MESA_ENABLE_ASM
+
+# ---------------------------------------
+# Build libmesa_st_mesa
+# ---------------------------------------
+
+ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(MESA_GALLIUM_SOURCES) \
+ $(MESA_GALLIUM_CXX_SOURCES) \
+ $(common_ASM)
+
+LOCAL_CFLAGS := $(common_CFLAGS)
+
+LOCAL_C_INCLUDES := \
+ $(common_C_INCLUDES) \
+ $(MESA_TOP)/src/gallium/include \
+ $(MESA_TOP)/src/gallium/auxiliary
+
+LOCAL_MODULE := libmesa_st_mesa
+
+include $(LOCAL_PATH)/Android.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+endif # MESA_BUILD_GALLIUM
+
+# ---------------------------------------
+# Build libmesa_glsl_utils
+#
+# It is used to avoid circular dependency between core mesa and glsl.
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ program/hash_table.c \
+ program/symbol_table.c
+
+LOCAL_MODULE := libmesa_glsl_utils
+
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# ---------------------------------------
+# Build libmesa_glsl_utils for host
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ program/hash_table.c \
+ program/symbol_table.c
+
+LOCAL_MODULE := libmesa_glsl_utils
+
+include $(MESA_COMMON_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/mesalib/src/mesa/Makefile b/mesalib/src/mesa/Makefile
index 88f31b686..0e15d61bd 100644
--- a/mesalib/src/mesa/Makefile
+++ b/mesalib/src/mesa/Makefile
@@ -67,6 +67,26 @@ $(DRICORE_OBJ_DIR)/%.o: %.S
# then convenience libs (.a) and finally the device drivers:
default: $(DEPENDS) asm_subdirs $(MESA_LIBS) $(DRICORE_LIBS) driver_subdirs
+# include glapi_gen.mk for generating glapi headers for GLES
+GLAPI := $(TOP)/src/mapi/glapi/gen
+include $(GLAPI)/glapi_gen.mk
+
+main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps)
+ $(call glapi_gen_dispatch,$<,es1)
+
+main/api_exec_es1_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps)
+ $(call glapi_gen_remap,$<,es1)
+
+main/api_exec_es1.o: main/api_exec_es1_dispatch.h main/api_exec_es1_remap_helper.h
+
+main/api_exec_es2_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps)
+ $(call glapi_gen_dispatch,$<,es2)
+
+main/api_exec_es2_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps)
+ $(call glapi_gen_remap,$<,es2)
+
+main/api_exec_es2.o: main/api_exec_es2_dispatch.h main/api_exec_es2_remap_helper.h
+
main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
$(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
diff --git a/mesalib/src/mesa/Makefile.mgw b/mesalib/src/mesa/Makefile.mgw
index fc0ff28d6..23ceaca01 100644
--- a/mesalib/src/mesa/Makefile.mgw
+++ b/mesalib/src/mesa/Makefile.mgw
@@ -50,9 +50,6 @@
# As a consequence, you'll need the Win32 Glide3
# library to build any application.
# default = no
-# ICD=1 build the installable client driver interface
-# (windows opengl driver interface)
-# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
@@ -69,11 +66,7 @@
# Set this to the prefix of your build tools, i.e. mingw32-
TOOLS_PREFIX = mingw32-
-ifeq ($(ICD),1)
- LIB_NAME = mesa32
-else
- LIB_NAME = opengl32
-endif
+LIB_NAME = opengl32
DLL_EXT = .dll
IMP_EXT = .a
@@ -106,12 +99,7 @@ ifeq ($(FX),1)
GL_DEF = drivers/windows/fx/fxopengl.def
GL_RES = drivers/windows/fx/fx.rc
else
- ifeq ($(ICD),1)
- CFLAGS += -DUSE_MGL_NAMESPACE
- GL_DEF = drivers/windows/icd/mesa.def
- else
- GL_DEF = $(LIB_NAME).def
- endif
+ GL_DEF = $(LIB_NAME).def
endif
@@ -143,16 +131,10 @@ DRIVER_SOURCES = \
$(GLIDE_DRIVER_SOURCES) \
drivers/windows/fx/fxwgl.c
else
-ifeq ($(ICD),1)
-DRIVER_SOURCES = \
- drivers/windows/gdi/wmesa.c \
- drivers/windows/icd/icd.c
-else
DRIVER_SOURCES = \
drivers/windows/gdi/wmesa.c \
drivers/windows/gdi/wgl.c
endif
-endif
SOURCES = $(MESA_SOURCES) $(GLAPI_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES)
diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript
index cbd166251..b0c3334fa 100644
--- a/mesalib/src/mesa/SConscript
+++ b/mesalib/src/mesa/SConscript
@@ -293,6 +293,7 @@ program_sources = [
'program/prog_instruction.c',
'program/prog_noise.c',
'program/prog_optimize.c',
+ 'program/prog_opt_constant_fold.c',
'program/prog_parameter.c',
'program/prog_parameter_layout.c',
'program/prog_print.c',
@@ -347,28 +348,28 @@ if env['gles']:
GLAPI = '#src/mapi/glapi/'
gles_headers = []
gles_headers += env.CodeGenerate(
- target = 'es1api/main/dispatch.h',
+ target = 'main/api_exec_es1_dispatch.h',
script = GLAPI + 'gen/gl_table.py',
- source = GLAPI + 'gen-es/es1_API.xml',
- command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -c es1 -m remap_table -f $SOURCE > $TARGET',
)
gles_headers += env.CodeGenerate(
- target = 'es1api/main/remap_helper.h',
+ target = 'main/api_exec_es1_remap_helper.h',
script = GLAPI + 'gen/remap_helper.py',
- source = GLAPI + 'gen-es/es1_API.xml',
- command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -c es1 -f $SOURCE > $TARGET',
)
gles_headers += env.CodeGenerate(
- target = 'es2api/main/dispatch.h',
+ target = 'main/api_exec_es2_dispatch.h',
script = GLAPI + 'gen/gl_table.py',
- source = GLAPI + 'gen-es/es2_API.xml',
- command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -c es2 -m remap_table -f $SOURCE > $TARGET',
)
gles_headers += env.CodeGenerate(
- target = 'es2api/main/remap_helper.h',
+ target = 'main/api_exec_es2_remap_helper.h',
script = GLAPI + 'gen/remap_helper.py',
- source = GLAPI + 'gen-es/es2_API.xml',
- command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -c es2 -f $SOURCE > $TARGET',
)
env.Depends(gles_sources, gles_headers)
diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c
index 76630264b..a6174ee2f 100644
--- a/mesalib/src/mesa/drivers/common/driverfuncs.c
+++ b/mesalib/src/mesa/drivers/common/driverfuncs.c
@@ -248,10 +248,10 @@ _mesa_init_driver_state(struct gl_context *ctx)
GLuint i;
for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
ctx->Driver.ColorMaskIndexed(ctx, i,
- ctx->Color.ColorMask[0][RCOMP],
- ctx->Color.ColorMask[0][GCOMP],
- ctx->Color.ColorMask[0][BCOMP],
- ctx->Color.ColorMask[0][ACOMP]);
+ ctx->Color.ColorMask[i][RCOMP],
+ ctx->Color.ColorMask[i][GCOMP],
+ ctx->Color.ColorMask[i][BCOMP],
+ ctx->Color.ColorMask[i][ACOMP]);
}
}
else {
@@ -286,7 +286,10 @@ _mesa_init_driver_state(struct gl_context *ctx)
ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE);
ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color);
- ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0);
+ {
+ GLfloat mode = (GLfloat) ctx->Fog.Mode;
+ ctx->Driver.Fogfv(ctx, GL_FOG_MODE, &mode);
+ }
ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density);
ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start);
ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End);
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index f9b475598..291d91212 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -73,64 +73,36 @@
/** Return offset in bytes of the field within a vertex struct */
#define OFFSET(FIELD) ((void *) offsetof(struct vertex, FIELD))
-
-/**
- * Flags passed to _mesa_meta_begin().
- */
-/*@{*/
-#define META_ALL ~0x0
-#define META_ALPHA_TEST 0x1
-#define META_BLEND 0x2 /**< includes logicop */
-#define META_COLOR_MASK 0x4
-#define META_DEPTH_TEST 0x8
-#define META_FOG 0x10
-#define META_PIXEL_STORE 0x20
-#define META_PIXEL_TRANSFER 0x40
-#define META_RASTERIZATION 0x80
-#define META_SCISSOR 0x100
-#define META_SHADER 0x200
-#define META_STENCIL_TEST 0x400
-#define META_TRANSFORM 0x800 /**< modelview/projection matrix state */
-#define META_TEXTURE 0x1000
-#define META_VERTEX 0x2000
-#define META_VIEWPORT 0x4000
-#define META_CLAMP_FRAGMENT_COLOR 0x8000
-#define META_CLAMP_VERTEX_COLOR 0x10000
-#define META_CONDITIONAL_RENDER 0x20000
-#define META_CLIP 0x40000
-/*@}*/
-
-
/**
* State which we may save/restore across meta ops.
* XXX this may be incomplete...
*/
struct save_state
{
- GLbitfield SavedState; /**< bitmask of META_* flags */
+ GLbitfield SavedState; /**< bitmask of MESA_META_* flags */
- /** META_ALPHA_TEST */
+ /** MESA_META_ALPHA_TEST */
GLboolean AlphaEnabled;
GLenum AlphaFunc;
GLclampf AlphaRef;
- /** META_BLEND */
+ /** MESA_META_BLEND */
GLbitfield BlendEnabled;
GLboolean ColorLogicOpEnabled;
- /** META_COLOR_MASK */
+ /** MESA_META_COLOR_MASK */
GLubyte ColorMask[MAX_DRAW_BUFFERS][4];
- /** META_DEPTH_TEST */
+ /** MESA_META_DEPTH_TEST */
struct gl_depthbuffer_attrib Depth;
- /** META_FOG */
+ /** MESA_META_FOG */
GLboolean Fog;
- /** META_PIXEL_STORE */
+ /** MESA_META_PIXEL_STORE */
struct gl_pixelstore_attrib Pack, Unpack;
- /** META_PIXEL_TRANSFER */
+ /** MESA_META_PIXEL_TRANSFER */
GLfloat RedBias, RedScale;
GLfloat GreenBias, GreenScale;
GLfloat BlueBias, BlueScale;
@@ -138,17 +110,17 @@ struct save_state
GLfloat DepthBias, DepthScale;
GLboolean MapColorFlag;
- /** META_RASTERIZATION */
+ /** MESA_META_RASTERIZATION */
GLenum FrontPolygonMode, BackPolygonMode;
GLboolean PolygonOffset;
GLboolean PolygonSmooth;
GLboolean PolygonStipple;
GLboolean PolygonCull;
- /** META_SCISSOR */
+ /** MESA_META_SCISSOR */
struct gl_scissor_attrib Scissor;
- /** META_SHADER */
+ /** MESA_META_SHADER */
GLboolean VertexProgramEnabled;
struct gl_vertex_program *VertexProgram;
GLboolean FragmentProgramEnabled;
@@ -158,19 +130,19 @@ struct save_state
struct gl_shader_program *FragmentShader;
struct gl_shader_program *ActiveShader;
- /** META_STENCIL_TEST */
+ /** MESA_META_STENCIL_TEST */
struct gl_stencil_attrib Stencil;
- /** META_TRANSFORM */
+ /** MESA_META_TRANSFORM */
GLenum MatrixMode;
GLfloat ModelviewMatrix[16];
GLfloat ProjectionMatrix[16];
GLfloat TextureMatrix[16];
- /** META_CLIP */
+ /** MESA_META_CLIP */
GLbitfield ClipPlanesEnabled;
- /** META_TEXTURE */
+ /** MESA_META_TEXTURE */
GLuint ActiveUnit;
GLuint ClientActiveUnit;
/** for unit[0] only */
@@ -180,21 +152,21 @@ struct save_state
GLbitfield TexGenEnabled[MAX_TEXTURE_UNITS];
GLuint EnvMode; /* unit[0] only */
- /** META_VERTEX */
+ /** MESA_META_VERTEX */
struct gl_array_object *ArrayObj;
struct gl_buffer_object *ArrayBufferObj;
- /** META_VIEWPORT */
+ /** MESA_META_VIEWPORT */
GLint ViewportX, ViewportY, ViewportW, ViewportH;
GLclampd DepthNear, DepthFar;
- /** META_CLAMP_FRAGMENT_COLOR */
+ /** MESA_META_CLAMP_FRAGMENT_COLOR */
GLenum ClampFragmentColor;
- /** META_CLAMP_VERTEX_COLOR */
+ /** MESA_META_CLAMP_VERTEX_COLOR */
GLenum ClampVertexColor;
- /** META_CONDITIONAL_RENDER */
+ /** MESA_META_CONDITIONAL_RENDER */
struct gl_query_object *CondRenderQuery;
GLenum CondRenderMode;
@@ -342,10 +314,10 @@ _mesa_meta_free(struct gl_context *ctx)
* Enter meta state. This is like a light-weight version of glPushAttrib
* but it also resets most GL state back to default values.
*
- * \param state bitmask of META_* flags indicating which attribute groups
+ * \param state bitmask of MESA_META_* flags indicating which attribute groups
* to save and reset to their defaults
*/
-static void
+void
_mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
{
struct save_state *save;
@@ -357,7 +329,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
memset(save, 0, sizeof(*save));
save->SavedState = state;
- if (state & META_ALPHA_TEST) {
+ if (state & MESA_META_ALPHA_TEST) {
save->AlphaEnabled = ctx->Color.AlphaEnabled;
save->AlphaFunc = ctx->Color.AlphaFunc;
save->AlphaRef = ctx->Color.AlphaRef;
@@ -365,7 +337,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_set_enable(ctx, GL_ALPHA_TEST, GL_FALSE);
}
- if (state & META_BLEND) {
+ if (state & MESA_META_BLEND) {
save->BlendEnabled = ctx->Color.BlendEnabled;
if (ctx->Color.BlendEnabled) {
if (ctx->Extensions.EXT_draw_buffers2) {
@@ -383,7 +355,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, GL_FALSE);
}
- if (state & META_COLOR_MASK) {
+ if (state & MESA_META_COLOR_MASK) {
memcpy(save->ColorMask, ctx->Color.ColorMask,
sizeof(ctx->Color.ColorMask));
if (!ctx->Color.ColorMask[0][0] ||
@@ -393,26 +365,26 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
- if (state & META_DEPTH_TEST) {
+ if (state & MESA_META_DEPTH_TEST) {
save->Depth = ctx->Depth; /* struct copy */
if (ctx->Depth.Test)
_mesa_set_enable(ctx, GL_DEPTH_TEST, GL_FALSE);
}
- if (state & META_FOG) {
+ if (state & MESA_META_FOG) {
save->Fog = ctx->Fog.Enabled;
if (ctx->Fog.Enabled)
_mesa_set_enable(ctx, GL_FOG, GL_FALSE);
}
- if (state & META_PIXEL_STORE) {
+ if (state & MESA_META_PIXEL_STORE) {
save->Pack = ctx->Pack;
save->Unpack = ctx->Unpack;
ctx->Pack = ctx->DefaultPacking;
ctx->Unpack = ctx->DefaultPacking;
}
- if (state & META_PIXEL_TRANSFER) {
+ if (state & MESA_META_PIXEL_TRANSFER) {
save->RedScale = ctx->Pixel.RedScale;
save->RedBias = ctx->Pixel.RedBias;
save->GreenScale = ctx->Pixel.GreenScale;
@@ -435,7 +407,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
ctx->NewState |=_NEW_PIXEL;
}
- if (state & META_RASTERIZATION) {
+ if (state & MESA_META_RASTERIZATION) {
save->FrontPolygonMode = ctx->Polygon.FrontMode;
save->BackPolygonMode = ctx->Polygon.BackMode;
save->PolygonOffset = ctx->Polygon.OffsetFill;
@@ -449,12 +421,12 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_set_enable(ctx, GL_CULL_FACE, GL_FALSE);
}
- if (state & META_SCISSOR) {
+ if (state & MESA_META_SCISSOR) {
save->Scissor = ctx->Scissor; /* struct copy */
_mesa_set_enable(ctx, GL_SCISSOR_TEST, GL_FALSE);
}
- if (state & META_SHADER) {
+ if (state & MESA_META_SHADER) {
if (ctx->Extensions.ARB_vertex_program) {
save->VertexProgramEnabled = ctx->VertexProgram.Enabled;
_mesa_reference_vertprog(ctx, &save->VertexProgram,
@@ -483,14 +455,14 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
}
}
- if (state & META_STENCIL_TEST) {
+ if (state & MESA_META_STENCIL_TEST) {
save->Stencil = ctx->Stencil; /* struct copy */
if (ctx->Stencil.Enabled)
_mesa_set_enable(ctx, GL_STENCIL_TEST, GL_FALSE);
/* NOTE: other stencil state not reset */
}
- if (state & META_TEXTURE) {
+ if (state & MESA_META_TEXTURE) {
GLuint u, tgt;
save->ActiveUnit = ctx->Texture.CurrentUnit;
@@ -529,7 +501,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
}
- if (state & META_TRANSFORM) {
+ if (state & MESA_META_TRANSFORM) {
GLuint activeTexture = ctx->Texture.CurrentUnit;
memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m,
16 * sizeof(GLfloat));
@@ -552,7 +524,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
-1.0, 1.0);
}
- if (state & META_CLIP) {
+ if (state & MESA_META_CLIP) {
save->ClipPlanesEnabled = ctx->Transform.ClipPlanesEnabled;
if (ctx->Transform.ClipPlanesEnabled) {
GLuint i;
@@ -562,7 +534,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
}
}
- if (state & META_VERTEX) {
+ if (state & MESA_META_VERTEX) {
/* save vertex array object state */
_mesa_reference_array_object(ctx, &save->ArrayObj,
ctx->Array.ArrayObj);
@@ -571,7 +543,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
/* set some default state? */
}
- if (state & META_VIEWPORT) {
+ if (state & MESA_META_VIEWPORT) {
/* save viewport state */
save->ViewportX = ctx->Viewport.X;
save->ViewportY = ctx->Viewport.Y;
@@ -592,7 +564,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_DepthRange(0.0, 1.0);
}
- if (state & META_CLAMP_FRAGMENT_COLOR) {
+ if (state & MESA_META_CLAMP_FRAGMENT_COLOR) {
save->ClampFragmentColor = ctx->Color.ClampFragmentColor;
/* Generally in here we want to do clamping according to whether
@@ -603,7 +575,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
}
- if (state & META_CLAMP_VERTEX_COLOR) {
+ if (state & MESA_META_CLAMP_VERTEX_COLOR) {
save->ClampVertexColor = ctx->Light.ClampVertexColor;
/* Generally in here we never want vertex color clamping --
@@ -612,7 +584,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR, GL_FALSE);
}
- if (state & META_CONDITIONAL_RENDER) {
+ if (state & MESA_META_CONDITIONAL_RENDER) {
save->CondRenderQuery = ctx->Query.CondRenderQuery;
save->CondRenderMode = ctx->Query.CondRenderMode;
@@ -632,19 +604,19 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
/**
* Leave meta state. This is like a light-weight version of glPopAttrib().
*/
-static void
+void
_mesa_meta_end(struct gl_context *ctx)
{
struct save_state *save = &ctx->Meta->Save[--ctx->Meta->SaveStackDepth];
const GLbitfield state = save->SavedState;
- if (state & META_ALPHA_TEST) {
+ if (state & MESA_META_ALPHA_TEST) {
if (ctx->Color.AlphaEnabled != save->AlphaEnabled)
_mesa_set_enable(ctx, GL_ALPHA_TEST, save->AlphaEnabled);
_mesa_AlphaFunc(save->AlphaFunc, save->AlphaRef);
}
- if (state & META_BLEND) {
+ if (state & MESA_META_BLEND) {
if (ctx->Color.BlendEnabled != save->BlendEnabled) {
if (ctx->Extensions.EXT_draw_buffers2) {
GLuint i;
@@ -660,7 +632,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, save->ColorLogicOpEnabled);
}
- if (state & META_COLOR_MASK) {
+ if (state & MESA_META_COLOR_MASK) {
GLuint i;
for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
if (!TEST_EQ_4V(ctx->Color.ColorMask[i], save->ColorMask[i])) {
@@ -679,23 +651,23 @@ _mesa_meta_end(struct gl_context *ctx)
}
}
- if (state & META_DEPTH_TEST) {
+ if (state & MESA_META_DEPTH_TEST) {
if (ctx->Depth.Test != save->Depth.Test)
_mesa_set_enable(ctx, GL_DEPTH_TEST, save->Depth.Test);
_mesa_DepthFunc(save->Depth.Func);
_mesa_DepthMask(save->Depth.Mask);
}
- if (state & META_FOG) {
+ if (state & MESA_META_FOG) {
_mesa_set_enable(ctx, GL_FOG, save->Fog);
}
- if (state & META_PIXEL_STORE) {
+ if (state & MESA_META_PIXEL_STORE) {
ctx->Pack = save->Pack;
ctx->Unpack = save->Unpack;
}
- if (state & META_PIXEL_TRANSFER) {
+ if (state & MESA_META_PIXEL_TRANSFER) {
ctx->Pixel.RedScale = save->RedScale;
ctx->Pixel.RedBias = save->RedBias;
ctx->Pixel.GreenScale = save->GreenScale;
@@ -709,7 +681,7 @@ _mesa_meta_end(struct gl_context *ctx)
ctx->NewState |=_NEW_PIXEL;
}
- if (state & META_RASTERIZATION) {
+ if (state & MESA_META_RASTERIZATION) {
_mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode);
_mesa_PolygonMode(GL_BACK, save->BackPolygonMode);
_mesa_set_enable(ctx, GL_POLYGON_STIPPLE, save->PolygonStipple);
@@ -718,13 +690,13 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_set_enable(ctx, GL_CULL_FACE, save->PolygonCull);
}
- if (state & META_SCISSOR) {
+ if (state & MESA_META_SCISSOR) {
_mesa_set_enable(ctx, GL_SCISSOR_TEST, save->Scissor.Enabled);
_mesa_Scissor(save->Scissor.X, save->Scissor.Y,
save->Scissor.Width, save->Scissor.Height);
}
- if (state & META_SHADER) {
+ if (state & MESA_META_SHADER) {
if (ctx->Extensions.ARB_vertex_program) {
_mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB,
save->VertexProgramEnabled);
@@ -756,7 +728,7 @@ _mesa_meta_end(struct gl_context *ctx)
save->ActiveShader);
}
- if (state & META_STENCIL_TEST) {
+ if (state & MESA_META_STENCIL_TEST) {
const struct gl_stencil_attrib *stencil = &save->Stencil;
_mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
@@ -787,7 +759,7 @@ _mesa_meta_end(struct gl_context *ctx)
stencil->ZPassFunc[1]);
}
- if (state & META_TEXTURE) {
+ if (state & MESA_META_TEXTURE) {
GLuint u, tgt;
ASSERT(ctx->Texture.CurrentUnit == 0);
@@ -838,7 +810,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_ClientActiveTextureARB(GL_TEXTURE0 + save->ClientActiveUnit);
}
- if (state & META_TRANSFORM) {
+ if (state & MESA_META_TRANSFORM) {
GLuint activeTexture = ctx->Texture.CurrentUnit;
_mesa_ActiveTextureARB(GL_TEXTURE0);
_mesa_MatrixMode(GL_TEXTURE);
@@ -854,7 +826,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_MatrixMode(save->MatrixMode);
}
- if (state & META_CLIP) {
+ if (state & MESA_META_CLIP) {
if (save->ClipPlanesEnabled) {
GLuint i;
for (i = 0; i < ctx->Const.MaxClipPlanes; i++) {
@@ -865,7 +837,7 @@ _mesa_meta_end(struct gl_context *ctx)
}
}
- if (state & META_VERTEX) {
+ if (state & MESA_META_VERTEX) {
/* restore vertex buffer object */
_mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, save->ArrayBufferObj->Name);
_mesa_reference_buffer_object(ctx, &save->ArrayBufferObj, NULL);
@@ -875,7 +847,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_reference_array_object(ctx, &save->ArrayObj, NULL);
}
- if (state & META_VIEWPORT) {
+ if (state & MESA_META_VIEWPORT) {
if (save->ViewportX != ctx->Viewport.X ||
save->ViewportY != ctx->Viewport.Y ||
save->ViewportW != ctx->Viewport.Width ||
@@ -886,15 +858,15 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_DepthRange(save->DepthNear, save->DepthFar);
}
- if (state & META_CLAMP_FRAGMENT_COLOR) {
+ if (state & MESA_META_CLAMP_FRAGMENT_COLOR) {
_mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR, save->ClampFragmentColor);
}
- if (state & META_CLAMP_VERTEX_COLOR) {
+ if (state & MESA_META_CLAMP_VERTEX_COLOR) {
_mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR, save->ClampVertexColor);
}
- if (state & META_CONDITIONAL_RENDER) {
+ if (state & MESA_META_CONDITIONAL_RENDER) {
if (save->CondRenderQuery)
_mesa_BeginConditionalRender(save->CondRenderQuery->Id,
save->CondRenderMode);
@@ -1360,7 +1332,7 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
}
/* only scissor effects blit so save/clear all other relevant state */
- _mesa_meta_begin(ctx, ~META_SCISSOR);
+ _mesa_meta_begin(ctx, ~MESA_META_SCISSOR);
if (blit->ArrayObj == 0) {
/* one-time setup */
@@ -1489,15 +1461,15 @@ _mesa_meta_Clear(struct gl_context *ctx, GLbitfield buffers)
};
struct vertex verts[4];
/* save all state but scissor, pixel pack/unpack */
- GLbitfield metaSave = (META_ALL -
- META_SCISSOR -
- META_PIXEL_STORE -
- META_CONDITIONAL_RENDER);
+ GLbitfield metaSave = (MESA_META_ALL -
+ MESA_META_SCISSOR -
+ MESA_META_PIXEL_STORE -
+ MESA_META_CONDITIONAL_RENDER);
const GLuint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
if (buffers & BUFFER_BITS_COLOR) {
/* if clearing color buffers, don't save/restore colormask */
- metaSave -= META_COLOR_MASK;
+ metaSave -= MESA_META_COLOR_MASK;
}
_mesa_meta_begin(ctx, metaSave);
@@ -1532,7 +1504,7 @@ _mesa_meta_Clear(struct gl_context *ctx, GLbitfield buffers)
_mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
}
else {
- ASSERT(metaSave & META_COLOR_MASK);
+ ASSERT(metaSave & MESA_META_COLOR_MASK);
_mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
}
@@ -1669,22 +1641,22 @@ _mesa_meta_glsl_Clear(struct gl_context *ctx, GLbitfield buffers)
GLfloat x, y, z;
} verts[4];
- metaSave = (META_ALPHA_TEST |
- META_BLEND |
- META_DEPTH_TEST |
- META_RASTERIZATION |
- META_SHADER |
- META_STENCIL_TEST |
- META_VERTEX |
- META_VIEWPORT |
- META_CLIP |
- META_CLAMP_FRAGMENT_COLOR);
+ metaSave = (MESA_META_ALPHA_TEST |
+ MESA_META_BLEND |
+ MESA_META_DEPTH_TEST |
+ MESA_META_RASTERIZATION |
+ MESA_META_SHADER |
+ MESA_META_STENCIL_TEST |
+ MESA_META_VERTEX |
+ MESA_META_VIEWPORT |
+ MESA_META_CLIP |
+ MESA_META_CLAMP_FRAGMENT_COLOR);
if (!(buffers & BUFFER_BITS_COLOR)) {
/* We'll use colormask to disable color writes. Otherwise,
* respect color mask
*/
- metaSave |= META_COLOR_MASK;
+ metaSave |= MESA_META_COLOR_MASK;
}
_mesa_meta_begin(ctx, metaSave);
@@ -1706,7 +1678,7 @@ _mesa_meta_glsl_Clear(struct gl_context *ctx, GLbitfield buffers)
_mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
}
else {
- ASSERT(metaSave & META_COLOR_MASK);
+ ASSERT(metaSave & MESA_META_COLOR_MASK);
_mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
}
@@ -1788,13 +1760,13 @@ _mesa_meta_CopyPixels(struct gl_context *ctx, GLint srcX, GLint srcY,
/* Most GL state applies to glCopyPixels, but a there's a few things
* we need to override:
*/
- _mesa_meta_begin(ctx, (META_RASTERIZATION |
- META_SHADER |
- META_TEXTURE |
- META_TRANSFORM |
- META_CLIP |
- META_VERTEX |
- META_VIEWPORT));
+ _mesa_meta_begin(ctx, (MESA_META_RASTERIZATION |
+ MESA_META_SHADER |
+ MESA_META_TEXTURE |
+ MESA_META_TRANSFORM |
+ MESA_META_CLIP |
+ MESA_META_VERTEX |
+ MESA_META_VIEWPORT));
if (copypix->ArrayObj == 0) {
/* one-time setup */
@@ -2069,10 +2041,10 @@ _mesa_meta_DrawPixels(struct gl_context *ctx,
* in [0,1].
*/
texIntFormat = GL_ALPHA;
- metaExtraSave = (META_COLOR_MASK |
- META_DEPTH_TEST |
- META_SHADER |
- META_STENCIL_TEST);
+ metaExtraSave = (MESA_META_COLOR_MASK |
+ MESA_META_DEPTH_TEST |
+ MESA_META_SHADER |
+ MESA_META_STENCIL_TEST);
}
else {
fallback = GL_TRUE;
@@ -2082,7 +2054,7 @@ _mesa_meta_DrawPixels(struct gl_context *ctx,
if (ctx->Extensions.ARB_depth_texture &&
ctx->Extensions.ARB_fragment_program) {
texIntFormat = GL_DEPTH_COMPONENT;
- metaExtraSave = (META_SHADER);
+ metaExtraSave = (MESA_META_SHADER);
}
else {
fallback = GL_TRUE;
@@ -2110,14 +2082,14 @@ _mesa_meta_DrawPixels(struct gl_context *ctx,
/* Most GL state applies to glDrawPixels (like blending, stencil, etc),
* but a there's a few things we need to override:
*/
- _mesa_meta_begin(ctx, (META_RASTERIZATION |
- META_SHADER |
- META_TEXTURE |
- META_TRANSFORM |
- META_CLIP |
- META_VERTEX |
- META_VIEWPORT |
- META_CLAMP_FRAGMENT_COLOR |
+ _mesa_meta_begin(ctx, (MESA_META_RASTERIZATION |
+ MESA_META_SHADER |
+ MESA_META_TEXTURE |
+ MESA_META_TRANSFORM |
+ MESA_META_CLIP |
+ MESA_META_VERTEX |
+ MESA_META_VIEWPORT |
+ MESA_META_CLAMP_FRAGMENT_COLOR |
metaExtraSave));
newTex = alloc_texture(tex, width, height, texIntFormat);
@@ -2318,15 +2290,15 @@ _mesa_meta_Bitmap(struct gl_context *ctx,
/* Most GL state applies to glBitmap (like blending, stencil, etc),
* but a there's a few things we need to override:
*/
- _mesa_meta_begin(ctx, (META_ALPHA_TEST |
- META_PIXEL_STORE |
- META_RASTERIZATION |
- META_SHADER |
- META_TEXTURE |
- META_TRANSFORM |
- META_CLIP |
- META_VERTEX |
- META_VIEWPORT));
+ _mesa_meta_begin(ctx, (MESA_META_ALPHA_TEST |
+ MESA_META_PIXEL_STORE |
+ MESA_META_RASTERIZATION |
+ MESA_META_SHADER |
+ MESA_META_TEXTURE |
+ MESA_META_TRANSFORM |
+ MESA_META_CLIP |
+ MESA_META_VERTEX |
+ MESA_META_VIEWPORT));
if (bitmap->ArrayObj == 0) {
/* one-time setup */
@@ -2452,7 +2424,9 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
/* check for fallbacks */
if (!ctx->Extensions.EXT_framebuffer_object ||
- target == GL_TEXTURE_3D) {
+ target == GL_TEXTURE_3D ||
+ target == GL_TEXTURE_1D_ARRAY ||
+ target == GL_TEXTURE_2D_ARRAY) {
return GL_TRUE;
}
@@ -2504,7 +2478,8 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
/**
* Called via ctx->Driver.GenerateMipmap()
- * Note: texture borders and 3D texture support not yet complete.
+ * Note: We don't yet support 3D textures, 1D/2D array textures or texture
+ * borders.
*/
void
_mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
@@ -2544,7 +2519,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
faceTarget = target;
}
- _mesa_meta_begin(ctx, META_ALL);
+ _mesa_meta_begin(ctx, MESA_META_ALL);
if (original_active_unit != 0)
_mesa_BindTexture(target, texObj->Name);
@@ -2900,7 +2875,7 @@ copy_tex_sub_image(struct gl_context *ctx,
/*
* Read image from framebuffer (disable pixel transfer ops)
*/
- _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER);
+ _mesa_meta_begin(ctx, MESA_META_PIXEL_STORE | MESA_META_PIXEL_TRANSFER);
ctx->Driver.ReadPixels(ctx, x, y, width, height,
format, type, &ctx->Pack, buf);
_mesa_meta_end(ctx);
@@ -2910,7 +2885,7 @@ copy_tex_sub_image(struct gl_context *ctx,
/*
* Store texture data (with pixel transfer ops)
*/
- _mesa_meta_begin(ctx, META_PIXEL_STORE);
+ _mesa_meta_begin(ctx, MESA_META_PIXEL_STORE);
if (target == GL_TEXTURE_1D) {
ctx->Driver.TexSubImage1D(ctx, target, level, xoffset,
width, format, type, buf,
@@ -2982,7 +2957,7 @@ _mesa_meta_CopyColorTable(struct gl_context *ctx,
/*
* Read image from framebuffer (disable pixel transfer ops)
*/
- _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER);
+ _mesa_meta_begin(ctx, MESA_META_PIXEL_STORE | MESA_META_PIXEL_TRANSFER);
ctx->Driver.ReadPixels(ctx, x, y, width, 1,
GL_RGBA, GL_FLOAT, &ctx->Pack, buf);
@@ -3009,7 +2984,7 @@ _mesa_meta_CopyColorSubTable(struct gl_context *ctx,GLenum target, GLsizei start
/*
* Read image from framebuffer (disable pixel transfer ops)
*/
- _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER);
+ _mesa_meta_begin(ctx, MESA_META_PIXEL_STORE | MESA_META_PIXEL_TRANSFER);
ctx->Driver.ReadPixels(ctx, x, y, width, 1,
GL_RGBA, GL_FLOAT, &ctx->Pack, buf);
diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h
index 95b4b5579..ac20e370e 100644
--- a/mesalib/src/mesa/drivers/common/meta.h
+++ b/mesalib/src/mesa/drivers/common/meta.h
@@ -26,6 +26,33 @@
#ifndef META_H
#define META_H
+/**
+ * \name Flags for meta operations
+ * \{
+ *
+ * These flags are passed to _mesa_meta_begin().
+ */
+#define MESA_META_ALL ~0x0
+#define MESA_META_ALPHA_TEST 0x1
+#define MESA_META_BLEND 0x2 /**< includes logicop */
+#define MESA_META_COLOR_MASK 0x4
+#define MESA_META_DEPTH_TEST 0x8
+#define MESA_META_FOG 0x10
+#define MESA_META_PIXEL_STORE 0x20
+#define MESA_META_PIXEL_TRANSFER 0x40
+#define MESA_META_RASTERIZATION 0x80
+#define MESA_META_SCISSOR 0x100
+#define MESA_META_SHADER 0x200
+#define MESA_META_STENCIL_TEST 0x400
+#define MESA_META_TRANSFORM 0x800 /**< modelview/projection matrix state */
+#define MESA_META_TEXTURE 0x1000
+#define MESA_META_VERTEX 0x2000
+#define MESA_META_VIEWPORT 0x4000
+#define MESA_META_CLAMP_FRAGMENT_COLOR 0x8000
+#define MESA_META_CLAMP_VERTEX_COLOR 0x10000
+#define MESA_META_CONDITIONAL_RENDER 0x20000
+#define MESA_META_CLIP 0x40000
+/**\}*/
extern void
_mesa_meta_init(struct gl_context *ctx);
@@ -34,6 +61,12 @@ extern void
_mesa_meta_free(struct gl_context *ctx);
extern void
+_mesa_meta_begin(struct gl_context *ctx, GLbitfield state);
+
+extern void
+_mesa_meta_end(struct gl_context *ctx);
+
+extern void
_mesa_meta_BlitFramebuffer(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
diff --git a/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h b/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h
index 6c11d350d..b9065b2dd 100644
--- a/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h
+++ b/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h
@@ -1,79 +1,71 @@
-
-/**
- * A driRenderbuffer is dervied from gl_renderbuffer.
- * It describes a color buffer (front or back), a depth buffer, or stencil
- * buffer etc.
- * Specific to DRI drivers are the offset and pitch fields.
- */
-
-
-#ifndef DRIRENDERBUFFER_H
-#define DRIRENDERBUFFER_H
-
-#include "main/mtypes.h"
-#include "main/formats.h"
-#include "dri_util.h"
-
-
-typedef struct {
- struct gl_renderbuffer Base;
-
- /* Chars or bytes per pixel. If Z and Stencil are stored together this
- * will typically be 32 whether this a depth or stencil renderbuffer.
- */
- GLint cpp;
-
- /* Buffer position and pitch (row stride). Recall that for today's DRI
- * drivers, we have statically allocated color/depth/stencil buffers.
- * So this information describes the whole screen, not just a window.
- * To address pixels in a window, we need to know the window's position
- * and size with respect to the screen.
- */
- GLint offset; /* in bytes */
- GLint pitch; /* in pixels */
-
- /* If the driver can do page flipping (full-screen double buffering)
- * the current front/back buffers may get swapped.
- * If page flipping is disabled, these fields will be identical to
- * the offset/pitch/Data above.
- * If page flipping is enabled, and this is the front(back) renderbuffer,
- * flippedOffset/Pitch/Data will have the back(front) renderbuffer's values.
- */
- GLint flippedOffset;
- GLint flippedPitch;
- GLvoid *flippedData; /* mmap'd address of buffer memory, if used */
-
- /* Pointer to corresponding __DRIdrawable. This is used to compute
- * the window's position within the framebuffer.
- */
- __DRIdrawable *dPriv;
-
- /* XXX this is for radeon/r200 only. We should really create a new
- * r200Renderbuffer class, derived from this class... not a huge deal.
- */
- GLboolean depthHasSurface;
-
- /**
- * A handy flag to know if this is the back color buffer.
- *
- * \note
- * This is currently only used by tdfx.
- */
- GLboolean backBuffer;
-} driRenderbuffer;
-
-
-extern driRenderbuffer *
-driNewRenderbuffer(gl_format format, GLvoid *addr,
- GLint cpp, GLint offset, GLint pitch,
- __DRIdrawable *dPriv);
-
-extern void
-driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped);
-
-
-extern void
-driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv);
-
-
-#endif /* DRIRENDERBUFFER_H */
+
+/**
+ * A driRenderbuffer is dervied from gl_renderbuffer.
+ * It describes a color buffer (front or back), a depth buffer, or stencil
+ * buffer etc.
+ * Specific to DRI drivers are the offset and pitch fields.
+ */
+
+
+#ifndef DRIRENDERBUFFER_H
+#define DRIRENDERBUFFER_H
+
+#include "main/mtypes.h"
+#include "main/formats.h"
+#include "dri_util.h"
+
+
+typedef struct {
+ struct gl_renderbuffer Base;
+
+ /* Chars or bytes per pixel. If Z and Stencil are stored together this
+ * will typically be 32 whether this a depth or stencil renderbuffer.
+ */
+ GLint cpp;
+
+ /* Buffer position and pitch (row stride). Recall that for today's DRI
+ * drivers, we have statically allocated color/depth/stencil buffers.
+ * So this information describes the whole screen, not just a window.
+ * To address pixels in a window, we need to know the window's position
+ * and size with respect to the screen.
+ */
+ GLint offset; /* in bytes */
+ GLint pitch; /* in pixels */
+
+ /* If the driver can do page flipping (full-screen double buffering)
+ * the current front/back buffers may get swapped.
+ * If page flipping is disabled, these fields will be identical to
+ * the offset/pitch/Data above.
+ * If page flipping is enabled, and this is the front(back) renderbuffer,
+ * flippedOffset/Pitch/Data will have the back(front) renderbuffer's values.
+ */
+ GLint flippedOffset;
+ GLint flippedPitch;
+ GLvoid *flippedData; /* mmap'd address of buffer memory, if used */
+
+ /* Pointer to corresponding __DRIdrawable. This is used to compute
+ * the window's position within the framebuffer.
+ */
+ __DRIdrawable *dPriv;
+
+ /* XXX this is for radeon/r200 only. We should really create a new
+ * r200Renderbuffer class, derived from this class... not a huge deal.
+ */
+ GLboolean depthHasSurface;
+} driRenderbuffer;
+
+
+extern driRenderbuffer *
+driNewRenderbuffer(gl_format format, GLvoid *addr,
+ GLint cpp, GLint offset, GLint pitch,
+ __DRIdrawable *dPriv);
+
+extern void
+driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped);
+
+
+extern void
+driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv);
+
+
+#endif /* DRIRENDERBUFFER_H */
diff --git a/mesalib/src/mesa/drivers/dri/common/mmx.h b/mesalib/src/mesa/drivers/dri/common/mmx.h
deleted file mode 100644
index 49ce7e3e3..000000000
--- a/mesalib/src/mesa/drivers/dri/common/mmx.h
+++ /dev/null
@@ -1,560 +0,0 @@
-/* mmx.h
-
- MultiMedia eXtensions GCC interface library for IA32.
-
- To use this library, simply include this header file
- and compile with GCC. You MUST have inlining enabled
- in order for mmx_ok() to work; this can be done by
- simply using -O on the GCC command line.
-
- Compiling with -DMMX_TRACE will cause detailed trace
- output to be sent to stderr for each mmx operation.
- This adds lots of code, and obviously slows execution to
- a crawl, but can be very useful for debugging.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
- LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR ANY PARTICULAR PURPOSE.
-
- 1997-98 by H. Dietz and R. Fisher
-
- History:
- 97-98* R.Fisher Early versions
- 980501 R.Fisher Original Release
- 980611* H.Dietz Rewrite, correctly implementing inlines, and
- R.Fisher including direct register accesses.
- 980616 R.Fisher Release of 980611 as 980616.
- 980714 R.Fisher Minor corrections to Makefile, etc.
- 980715 R.Fisher mmx_ok() now prevents optimizer from using
- clobbered values.
- mmx_ok() now checks if cpuid instruction is
- available before trying to use it.
- 980726* R.Fisher mm_support() searches for AMD 3DNow, Cyrix
- Extended MMX, and standard MMX. It returns a
- value which is positive if any of these are
- supported, and can be masked with constants to
- see which. mmx_ok() is now a call to this
- 980726* R.Fisher Added i2r support for shift functions
- 980919 R.Fisher Fixed AMD extended feature recognition bug.
- 980921 R.Fisher Added definition/check for _MMX_H.
- Added "float s[2]" to mmx_t for use with
- 3DNow and EMMX. So same mmx_t can be used.
- 981013 R.Fisher Fixed cpuid function 1 bug (looked at wrong reg)
- Fixed psllq_i2r error in mmxtest.c
-
- * Unreleased (internal or interim) versions
-
- Notes:
- It appears that the latest gas has the pand problem fixed, therefore
- I'll undefine BROKEN_PAND by default.
- String compares may be quicker than the multiple test/jumps in vendor
- test sequence in mmx_ok(), but I'm not concerned with that right now.
-
- Acknowledgments:
- Jussi Laako for pointing out the errors ultimately found to be
- connected to the failure to notify the optimizer of clobbered values.
- Roger Hardiman for reminding us that CPUID isn't everywhere, and that
- someone may actually try to use this on a machine without CPUID.
- Also for suggesting code for checking this.
- Robert Dale for pointing out the AMD recognition bug.
- Jimmy Mayfield and Carl Witty for pointing out the Intel recognition
- bug.
- Carl Witty for pointing out the psllq_i2r test bug.
-*/
-
-#ifndef _MMX_H
-#define _MMX_H
-
-//#define MMX_TRACE
-
-/* Warning: at this writing, the version of GAS packaged
- with most Linux distributions does not handle the
- parallel AND operation mnemonic correctly. If the
- symbol BROKEN_PAND is defined, a slower alternative
- coding will be used. If execution of mmxtest results
- in an illegal instruction fault, define this symbol.
-*/
-#undef BROKEN_PAND
-
-
-/* The type of an value that fits in an MMX register
- (note that long long constant values MUST be suffixed
- by LL and unsigned long long values by ULL, lest
- they be truncated by the compiler)
-*/
-typedef union {
- long long q; /* Quadword (64-bit) value */
- unsigned long long uq; /* Unsigned Quadword */
- int d[2]; /* 2 Doubleword (32-bit) values */
- unsigned int ud[2]; /* 2 Unsigned Doubleword */
- short w[4]; /* 4 Word (16-bit) values */
- unsigned short uw[4]; /* 4 Unsigned Word */
- char b[8]; /* 8 Byte (8-bit) values */
- unsigned char ub[8]; /* 8 Unsigned Byte */
- float s[2]; /* Single-precision (32-bit) value */
-} mmx_t;
-
-/* Helper functions for the instruction macros that follow...
- (note that memory-to-register, m2r, instructions are nearly
- as efficient as register-to-register, r2r, instructions;
- however, memory-to-memory instructions are really simulated
- as a convenience, and are only 1/3 as efficient)
-*/
-#ifdef MMX_TRACE
-
-/* Include the stuff for printing a trace to stderr...
-*/
-
-#include <stdio.h>
-
-#define mmx_i2r(op, imm, reg) \
- { \
- mmx_t mmx_trace; \
- mmx_trace = (imm); \
- fprintf(stderr, #op "_i2r(" #imm "=0x%016llx, ", mmx_trace.q); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #reg "=0x%016llx) => ", mmx_trace.q); \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (imm)); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #reg "=0x%016llx\n", mmx_trace.q); \
- }
-
-#define mmx_m2r(op, mem, reg) \
- { \
- mmx_t mmx_trace; \
- mmx_trace = (mem); \
- fprintf(stderr, #op "_m2r(" #mem "=0x%016llx, ", mmx_trace.q); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #reg "=0x%016llx) => ", mmx_trace.q); \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (mem)); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #reg "=0x%016llx\n", mmx_trace.q); \
- }
-
-#define mmx_r2m(op, reg, mem) \
- { \
- mmx_t mmx_trace; \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #op "_r2m(" #reg "=0x%016llx, ", mmx_trace.q); \
- mmx_trace = (mem); \
- fprintf(stderr, #mem "=0x%016llx) => ", mmx_trace.q); \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=X" (mem) \
- : /* nothing */ ); \
- mmx_trace = (mem); \
- fprintf(stderr, #mem "=0x%016llx\n", mmx_trace.q); \
- }
-
-#define mmx_r2r(op, regs, regd) \
- { \
- mmx_t mmx_trace; \
- __asm__ __volatile__ ("movq %%" #regs ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #op "_r2r(" #regs "=0x%016llx, ", mmx_trace.q); \
- __asm__ __volatile__ ("movq %%" #regd ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #regd "=0x%016llx) => ", mmx_trace.q); \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd); \
- __asm__ __volatile__ ("movq %%" #regd ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- fprintf(stderr, #regd "=0x%016llx\n", mmx_trace.q); \
- }
-
-#define mmx_m2m(op, mems, memd) \
- { \
- mmx_t mmx_trace; \
- mmx_trace = (mems); \
- fprintf(stderr, #op "_m2m(" #mems "=0x%016llx, ", mmx_trace.q); \
- mmx_trace = (memd); \
- fprintf(stderr, #memd "=0x%016llx) => ", mmx_trace.q); \
- __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
- #op " %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems)); \
- mmx_trace = (memd); \
- fprintf(stderr, #memd "=0x%016llx\n", mmx_trace.q); \
- }
-
-#else
-
-/* These macros are a lot simpler without the tracing...
-*/
-
-#define mmx_i2r(op, imm, reg) \
- __asm__ __volatile__ (#op " $" #imm ", %%" #reg \
- : /* nothing */ \
- : /* nothing */);
-
-#define mmx_m2r(op, mem, reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (mem))
-
-#define mmx_r2m(op, reg, mem) \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=X" (mem) \
- : /* nothing */ )
-
-#define mmx_r2r(op, regs, regd) \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd)
-
-#define mmx_m2m(op, mems, memd) \
- __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
- #op " %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems))
-
-#endif
-
-
-/* 1x64 MOVe Quadword
- (this is both a load and a store...
- in fact, it is the only way to store)
-*/
-#define movq_m2r(var, reg) mmx_m2r(movq, var, reg)
-#define movq_r2m(reg, var) mmx_r2m(movq, reg, var)
-#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd)
-#define movq(vars, vard) \
- __asm__ __volatile__ ("movq %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (vard) \
- : "X" (vars))
-
-
-/* 1x32 MOVe Doubleword
- (like movq, this is both load and store...
- but is most useful for moving things between
- mmx registers and ordinary registers)
-*/
-#define movd_m2r(var, reg) mmx_m2r(movd, var, reg)
-#define movd_r2m(reg, var) mmx_r2m(movd, reg, var)
-#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd)
-#define movd(vars, vard) \
- __asm__ __volatile__ ("movd %1, %%mm0\n\t" \
- "movd %%mm0, %0" \
- : "=X" (vard) \
- : "X" (vars))
-
-
-/* 2x32, 4x16, and 8x8 Parallel ADDs
-*/
-#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg)
-#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd)
-#define paddd(vars, vard) mmx_m2m(paddd, vars, vard)
-
-#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg)
-#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd)
-#define paddw(vars, vard) mmx_m2m(paddw, vars, vard)
-
-#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg)
-#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd)
-#define paddb(vars, vard) mmx_m2m(paddb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic
-*/
-#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg)
-#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd)
-#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard)
-
-#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg)
-#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd)
-#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic
-*/
-#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg)
-#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd)
-#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard)
-
-#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg)
-#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd)
-#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel SUBs
-*/
-#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg)
-#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd)
-#define psubd(vars, vard) mmx_m2m(psubd, vars, vard)
-
-#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg)
-#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd)
-#define psubw(vars, vard) mmx_m2m(psubw, vars, vard)
-
-#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg)
-#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd)
-#define psubb(vars, vard) mmx_m2m(psubb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic
-*/
-#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg)
-#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd)
-#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard)
-
-#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg)
-#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd)
-#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic
-*/
-#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg)
-#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd)
-#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard)
-
-#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg)
-#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd)
-#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard)
-
-
-/* 4x16 Parallel MULs giving Low 4x16 portions of results
-*/
-#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg)
-#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd)
-#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard)
-
-
-/* 4x16 Parallel MULs giving High 4x16 portions of results
-*/
-#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg)
-#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd)
-#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard)
-
-
-/* 4x16->2x32 Parallel Mul-ADD
- (muls like pmullw, then adds adjacent 16-bit fields
- in the multiply result to make the final 2x32 result)
-*/
-#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg)
-#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd)
-#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard)
-
-
-/* 1x64 bitwise AND
-*/
-#ifdef BROKEN_PAND
-#define pand_m2r(var, reg) \
- { \
- mmx_m2r(pandn, (mmx_t) -1LL, reg); \
- mmx_m2r(pandn, var, reg); \
- }
-#define pand_r2r(regs, regd) \
- { \
- mmx_m2r(pandn, (mmx_t) -1LL, regd); \
- mmx_r2r(pandn, regs, regd) \
- }
-#define pand(vars, vard) \
- { \
- movq_m2r(vard, mm0); \
- mmx_m2r(pandn, (mmx_t) -1LL, mm0); \
- mmx_m2r(pandn, vars, mm0); \
- movq_r2m(mm0, vard); \
- }
-#else
-#define pand_m2r(var, reg) mmx_m2r(pand, var, reg)
-#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd)
-#define pand(vars, vard) mmx_m2m(pand, vars, vard)
-#endif
-
-
-/* 1x64 bitwise AND with Not the destination
-*/
-#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg)
-#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd)
-#define pandn(vars, vard) mmx_m2m(pandn, vars, vard)
-
-
-/* 1x64 bitwise OR
-*/
-#define por_m2r(var, reg) mmx_m2r(por, var, reg)
-#define por_r2r(regs, regd) mmx_r2r(por, regs, regd)
-#define por(vars, vard) mmx_m2m(por, vars, vard)
-
-
-/* 1x64 bitwise eXclusive OR
-*/
-#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg)
-#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd)
-#define pxor(vars, vard) mmx_m2m(pxor, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality
- (resulting fields are either 0 or -1)
-*/
-#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg)
-#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd)
-#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard)
-
-#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg)
-#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd)
-#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard)
-
-#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg)
-#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd)
-#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than
- (resulting fields are either 0 or -1)
-*/
-#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg)
-#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd)
-#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard)
-
-#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg)
-#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd)
-#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard)
-
-#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg)
-#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd)
-#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard)
-
-
-/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical
-*/
-#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg)
-#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg)
-#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd)
-#define psllq(vars, vard) mmx_m2m(psllq, vars, vard)
-
-#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg)
-#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg)
-#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd)
-#define pslld(vars, vard) mmx_m2m(pslld, vars, vard)
-
-#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg)
-#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg)
-#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd)
-#define psllw(vars, vard) mmx_m2m(psllw, vars, vard)
-
-
-/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical
-*/
-#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg)
-#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg)
-#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd)
-#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard)
-
-#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg)
-#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg)
-#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd)
-#define psrld(vars, vard) mmx_m2m(psrld, vars, vard)
-
-#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg)
-#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg)
-#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd)
-#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard)
-
-
-/* 2x32 and 4x16 Parallel Shift Right Arithmetic
-*/
-#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg)
-#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg)
-#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd)
-#define psrad(vars, vard) mmx_m2m(psrad, vars, vard)
-
-#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg)
-#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg)
-#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd)
-#define psraw(vars, vard) mmx_m2m(psraw, vars, vard)
-
-
-/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate
- (packs source and dest fields into dest in that order)
-*/
-#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg)
-#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd)
-#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard)
-
-#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg)
-#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd)
-#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard)
-
-
-/* 4x16->8x8 PACK and Unsigned Saturate
- (packs source and dest fields into dest in that order)
-*/
-#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg)
-#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd)
-#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard)
-
-
-/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low
- (interleaves low half of dest with low half of source
- as padding in each result field)
-*/
-#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg)
-#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd)
-#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard)
-
-#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg)
-#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd)
-#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard)
-
-#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg)
-#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd)
-#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard)
-
-
-/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High
- (interleaves high half of dest with high half of source
- as padding in each result field)
-*/
-#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg)
-#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd)
-#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard)
-
-#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg)
-#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd)
-#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard)
-
-#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg)
-#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd)
-#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard)
-
-
-/* Empty MMx State
- (used to clean-up when going from mmx to float use
- of the registers that are shared by both; note that
- there is no float-to-mmx operation needed, because
- only the float tag word info is corruptible)
-*/
-#ifdef MMX_TRACE
-
-#define emms() \
- { \
- fprintf(stderr, "emms()\n"); \
- __asm__ __volatile__ ("emms"); \
- }
-
-#else
-
-#define emms() __asm__ __volatile__ ("emms")
-
-#endif
-
-#endif
-
diff --git a/mesalib/src/mesa/drivers/dri/common/spantmp.h b/mesalib/src/mesa/drivers/dri/common/spantmp.h
deleted file mode 100644
index 9aea3660c..000000000
--- a/mesalib/src/mesa/drivers/dri/common/spantmp.h
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * (C) Copyright IBM Corporation 2002, 2003
- * 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
- * on 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
- * VA LINUX SYSTEM, IBM AND/OR THEIR 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.
- *
- * Authors:
- * Keith Whitwell <keithw@tungstengraphics.com>
- * Gareth Hughes <gareth@nvidia.com>
- */
-
-#include "spantmp_common.h"
-
-#ifndef DBG
-#define DBG 0
-#endif
-
-#ifndef HW_READ_CLIPLOOP
-#define HW_READ_CLIPLOOP() HW_CLIPLOOP()
-#endif
-
-#ifndef HW_WRITE_CLIPLOOP
-#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP()
-#endif
-
-
-static void TAG(WriteRGBASpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- if (DBG) fprintf(stderr, "WriteRGBASpan %d..%d (x1 %d)\n",
- (int)i, (int)n1, (int)x1);
-
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_RGBA( x1, y,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_RGBA( x1, y,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-static void TAG(WriteRGBSpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- if (DBG) fprintf(stderr, "WriteRGBSpan %d..%d (x1 %d)\n",
- (int)i, (int)n1, (int)x1);
-
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-static void TAG(WriteRGBAPixels)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
- GLuint i;
- LOCAL_VARS;
-
- if (DBG) fprintf(stderr, "WriteRGBAPixels\n");
-
- HW_WRITE_CLIPLOOP()
- {
- if (mask)
- {
- for (i=0;i<n;i++)
- {
- if (mask[i]) {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- else
- {
- for (i=0;i<n;i++)
- {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- y = Y_FLIP( y );
-
- if (DBG) fprintf(stderr, "WriteMonoRGBASpan\n");
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_PIXEL( x1, y, p );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_PIXEL( x1, y, p );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBAPixels)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *value,
- const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLuint i;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n");
-
- HW_WRITE_CLIPLOOP()
- {
- if (mask)
- {
- for (i=0;i<n;i++)
- if (mask[i]) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- else
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(ReadRGBASpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- HW_READ_LOCK()
- {
- GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
- GLint x1,n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- if (DBG) fprintf(stderr, "ReadRGBASpan\n");
-
- HW_READ_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- for (;n1>0;i++,x1++,n1--)
- READ_RGBA( rgba[i], x1, y );
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-
-
-static void TAG(ReadRGBAPixels)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values )
-{
- HW_READ_LOCK()
- {
- GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
- GLuint i;
- LOCAL_VARS;
-
- if (DBG) fprintf(stderr, "ReadRGBAPixels\n");
-
- HW_READ_CLIPLOOP()
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP( y[i] );
- if (CLIPPIXEL( x[i], fy ))
- READ_RGBA( rgba[i], x[i], fy );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-
-
-static void TAG(InitPointers)(struct gl_renderbuffer *rb)
-{
- rb->PutRow = TAG(WriteRGBASpan);
- rb->PutRowRGB = TAG(WriteRGBSpan);
- rb->PutMonoRow = TAG(WriteMonoRGBASpan);
- rb->PutValues = TAG(WriteRGBAPixels);
- rb->PutMonoValues = TAG(WriteMonoRGBAPixels);
- rb->GetValues = TAG(ReadRGBAPixels);
- rb->GetRow = TAG(ReadRGBASpan);
-}
-
-
-#undef WRITE_PIXEL
-#undef WRITE_RGBA
-#undef READ_RGBA
-#undef TAG
diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c
index 77967ac2a..12dd31bb1 100644
--- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c
@@ -567,7 +567,7 @@ static void parseOptInfoAttr (struct OptInfoData *data, const XML_Char **attr) {
} else
defaultVal = attrVal[OA_DEFAULT];
if (!parseValue (&cache->values[opt], cache->info[opt].type, defaultVal))
- XML_FATAL ("illegal default value: %s.", defaultVal);
+ XML_FATAL ("illegal default value for %s: %s.", cache->info[opt].name, defaultVal);
if (attrVal[OA_VALID]) {
if (cache->info[opt].type == DRI_BOOL)
diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool.h b/mesalib/src/mesa/drivers/dri/common/xmlpool.h
index 587517ea1..ffea43002 100644
--- a/mesalib/src/mesa/drivers/dri/common/xmlpool.h
+++ b/mesalib/src/mesa/drivers/dri/common/xmlpool.h
@@ -60,7 +60,7 @@
#define DRI_CONF_OPT_BEGIN(name,type,def) \
"<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n"
-/** \brief Begin an option definition with qouted default value */
+/** \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/options.h b/mesalib/src/mesa/drivers/dri/common/xmlpool/options.h
index d76595578..1e584ba08 100644
--- a/mesalib/src/mesa/drivers/dri/common/xmlpool/options.h
+++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/options.h
@@ -425,6 +425,66 @@ DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
DRI_CONF_DESC(sv,"Använd HyperZ för att maximera prestandan") \
DRI_CONF_OPT_END
+#define DRI_CONF_PP_CELSHADE(def) \
+DRI_CONF_OPT_BEGIN_V(pp_celshade,enum,def,"0:1") \
+ DRI_CONF_DESC(en,"A post-processing filter to cel-shade the output") \
+ DRI_CONF_DESC(de,"A post-processing filter to cel-shade the output") \
+ DRI_CONF_DESC(es,"A post-processing filter to cel-shade the output") \
+ DRI_CONF_DESC(nl,"A post-processing filter to cel-shade the output") \
+ DRI_CONF_DESC(fr,"A post-processing filter to cel-shade the output") \
+ DRI_CONF_DESC(sv,"A post-processing filter to cel-shade the output") \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_NORED(def) \
+DRI_CONF_OPT_BEGIN_V(pp_nored,enum,def,"0:1") \
+ DRI_CONF_DESC(en,"A post-processing filter to remove the red channel") \
+ DRI_CONF_DESC(de,"A post-processing filter to remove the red channel") \
+ DRI_CONF_DESC(es,"A post-processing filter to remove the red channel") \
+ DRI_CONF_DESC(nl,"A post-processing filter to remove the red channel") \
+ DRI_CONF_DESC(fr,"A post-processing filter to remove the red channel") \
+ DRI_CONF_DESC(sv,"A post-processing filter to remove the red channel") \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_NOGREEN(def) \
+DRI_CONF_OPT_BEGIN_V(pp_nogreen,enum,def,"0:1") \
+ DRI_CONF_DESC(en,"A post-processing filter to remove the green channel") \
+ DRI_CONF_DESC(de,"A post-processing filter to remove the green channel") \
+ DRI_CONF_DESC(es,"A post-processing filter to remove the green channel") \
+ DRI_CONF_DESC(nl,"A post-processing filter to remove the green channel") \
+ DRI_CONF_DESC(fr,"A post-processing filter to remove the green channel") \
+ DRI_CONF_DESC(sv,"A post-processing filter to remove the green channel") \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_NOBLUE(def) \
+DRI_CONF_OPT_BEGIN_V(pp_noblue,enum,def,"0:1") \
+ DRI_CONF_DESC(en,"A post-processing filter to remove the blue channel") \
+ DRI_CONF_DESC(de,"A post-processing filter to remove the blue channel") \
+ DRI_CONF_DESC(es,"A post-processing filter to remove the blue channel") \
+ DRI_CONF_DESC(nl,"A post-processing filter to remove the blue channel") \
+ DRI_CONF_DESC(fr,"A post-processing filter to remove the blue channel") \
+ DRI_CONF_DESC(sv,"A post-processing filter to remove the blue channel") \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_JIMENEZMLAA(def,min,max) \
+DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa,int,def, # min ":" # max ) \
+ DRI_CONF_DESC(en,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \
+ DRI_CONF_DESC(de,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \
+ DRI_CONF_DESC(es,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \
+ DRI_CONF_DESC(nl,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \
+ DRI_CONF_DESC(fr,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \
+ DRI_CONF_DESC(sv,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_JIMENEZMLAA_COLOR(def,min,max) \
+DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa_color,int,def, # min ":" # max ) \
+ DRI_CONF_DESC(en,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \
+ DRI_CONF_DESC(de,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \
+ DRI_CONF_DESC(es,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \
+ DRI_CONF_DESC(nl,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \
+ DRI_CONF_DESC(fr,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \
+ DRI_CONF_DESC(sv,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \
+DRI_CONF_OPT_END
+
#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
DRI_CONF_DESC(en,"Number of texture units used") \
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 5fd6ec65b..2427aa77f 100644
--- a/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h
+++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h
@@ -191,6 +191,36 @@ DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
DRI_CONF_DESC(en,gettext("Use HyperZ to boost performance")) \
DRI_CONF_OPT_END
+#define DRI_CONF_PP_CELSHADE(def) \
+DRI_CONF_OPT_BEGIN_V(pp_celshade,enum,def,"0:1") \
+ DRI_CONF_DESC(en,gettext("A post-processing filter to cel-shade the output")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_NORED(def) \
+DRI_CONF_OPT_BEGIN_V(pp_nored,enum,def,"0:1") \
+ DRI_CONF_DESC(en,gettext("A post-processing filter to remove the red channel")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_NOGREEN(def) \
+DRI_CONF_OPT_BEGIN_V(pp_nogreen,enum,def,"0:1") \
+ DRI_CONF_DESC(en,gettext("A post-processing filter to remove the green channel")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_NOBLUE(def) \
+DRI_CONF_OPT_BEGIN_V(pp_noblue,enum,def,"0:1") \
+ DRI_CONF_DESC(en,gettext("A post-processing filter to remove the blue channel")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_JIMENEZMLAA(def,min,max) \
+DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa,int,def, # min ":" # max ) \
+ DRI_CONF_DESC(en,gettext("Morphological anti-aliasing based on Jimenez\\\' MLAA. 0 to disable, 8 for default quality")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_PP_JIMENEZMLAA_COLOR(def,min,max) \
+DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa_color,int,def, # min ":" # max ) \
+ DRI_CONF_DESC(en,gettext("Morphological anti-aliasing based on Jimenez\\\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps")) \
+DRI_CONF_OPT_END
+
#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
DRI_CONF_DESC(en,gettext("Number of texture units used")) \
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/ddlog.c b/mesalib/src/mesa/drivers/windows/gldirect/ddlog.c
deleted file mode 100644
index 4ae79e2fd..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/ddlog.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Logging functions.
-*
-****************************************************************************/
-
-#define STRICT
-#include <windows.h>
-
-#include "ddlog.h"
-#include "gld_driver.h"
-
-// ***********************************************************************
-
-static char ddlogbuf[256];
-static FILE* fpDDLog = NULL; // Log file pointer
-static char szDDLogName[_MAX_PATH] = {"gldirect.log"}; // Filename of the log
-static DDLOG_loggingMethodType ddlogLoggingMethod = DDLOG_NONE; // Default to No Logging
-static DDLOG_severityType ddlogDebugLevel;
-static BOOL bUIWarning = FALSE; // MessageBox warning ?
-
-// ***********************************************************************
-
-void ddlogOpen(
- DDLOG_loggingMethodType LoggingMethod,
- DDLOG_severityType Severity)
-{
- if (fpDDLog != NULL) {
- // Tried to re-open the log
- ddlogMessage(DDLOG_WARN, "Tried to re-open the log file\n");
- return;
- }
-
- ddlogLoggingMethod = LoggingMethod;
- ddlogDebugLevel = Severity;
-
- if (ddlogLoggingMethod == DDLOG_NORMAL) {
- fpDDLog = fopen(szDDLogName, "wt");
- if (fpDDLog == NULL)
- return;
- }
-
- ddlogMessage(DDLOG_SYSTEM, "\n");
- ddlogMessage(DDLOG_SYSTEM, "-> Logging Started\n");
-}
-
-// ***********************************************************************
-
-void ddlogClose()
-{
- // Determine whether the log is already closed
- if (fpDDLog == NULL && ddlogLoggingMethod == DDLOG_NORMAL)
- return; // Nothing to do.
-
- ddlogMessage(DDLOG_SYSTEM, "<- Logging Ended\n");
-
- if (ddlogLoggingMethod == DDLOG_NORMAL) {
- fclose(fpDDLog);
- fpDDLog = NULL;
- }
-}
-
-// ***********************************************************************
-
-void ddlogMessage(
- DDLOG_severityType severity,
- LPSTR message)
-{
- char buf[256];
-
- // Bail if logging is disabled
- if (ddlogLoggingMethod == DDLOG_NONE)
- return;
-
- if (ddlogLoggingMethod == DDLOG_CRASHPROOF)
- fpDDLog = fopen(szDDLogName, "at");
-
- if (fpDDLog == NULL)
- return;
-
- if (severity >= ddlogDebugLevel) {
- sprintf(buf, "DDLog: (%s) %s", ddlogSeverityMessages[severity], message);
- fputs(buf, fpDDLog); // Write string to file
- OutputDebugString(buf); // Echo to debugger
- }
-
- if (ddlogLoggingMethod == DDLOG_CRASHPROOF) {
- fflush(fpDDLog); // Write info to disk
- fclose(fpDDLog);
- fpDDLog = NULL;
- }
-
- // Popup message box if critical error
- if (bUIWarning && severity == DDLOG_CRITICAL) {
- MessageBox(NULL, buf, "GLDirect", MB_OK | MB_ICONWARNING | MB_TASKMODAL);
- }
-}
-
-// ***********************************************************************
-
-// Write a string value to the log file
-void ddlogError(
- DDLOG_severityType severity,
- LPSTR message,
- HRESULT hResult)
-{
-#ifdef _USE_GLD3_WGL
- char dxErrStr[1024];
- _gldDriver.GetDXErrorString(hResult, &dxErrStr[0], sizeof(dxErrStr));
- if (FAILED(hResult)) {
- sprintf(ddlogbuf, "DDLog: %s %8x:[ %s ]\n", message, hResult, dxErrStr);
- } else
- sprintf(ddlogbuf, "DDLog: %s\n", message);
-#else
- if (FAILED(hResult)) {
- sprintf(ddlogbuf, "DDLog: %s %8x:[ %s ]\n", message, hResult, DDErrorToString(hResult));
- } else
- sprintf(ddlogbuf, "DDLog: %s\n", message);
-#endif
- ddlogMessage(severity, ddlogbuf);
-}
-
-// ***********************************************************************
-
-void ddlogPrintf(
- DDLOG_severityType severity,
- LPSTR message,
- ...)
-{
- va_list args;
-
- va_start(args, message);
- vsprintf(ddlogbuf, message, args);
- va_end(args);
-
- lstrcat(ddlogbuf, "\n");
-
- ddlogMessage(severity, ddlogbuf);
-}
-
-// ***********************************************************************
-
-void ddlogWarnOption(
- BOOL bWarnOption)
-{
- bUIWarning = bWarnOption;
-}
-
-// ***********************************************************************
-
-void ddlogPathOption(
- LPSTR szPath)
-{
- char szPathName[_MAX_PATH];
-
- strcpy(szPathName, szPath);
- strcat(szPathName, "\\");
- strcat(szPathName, szDDLogName);
- strcpy(szDDLogName, szPathName);
-}
-
-// ***********************************************************************
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/ddlog.h b/mesalib/src/mesa/drivers/windows/gldirect/ddlog.h
deleted file mode 100644
index d64067e22..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/ddlog.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Logging functions.
-*
-****************************************************************************/
-
-#ifndef __DDLOG_H
-#define __DDLOG_H
-
-#include <stdio.h>
-
-#ifndef _USE_GLD3_WGL
-#include "dderrstr.h" // ddraw/d3d error string
-#endif
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-typedef enum {
- DDLOG_NONE = 0, // No log output
- DDLOG_NORMAL = 1, // Log is kept open
- DDLOG_CRASHPROOF = 2, // Log is closed and flushed
- DDLOG_METHOD_FORCE_DWORD = 0x7fffffff,
-} DDLOG_loggingMethodType;
-
-// Denotes type of message sent to the logging functions
-typedef enum {
- DDLOG_INFO = 0, // Information only
- DDLOG_WARN = 1, // Warning only
- DDLOG_ERROR = 2, // Notify user of an error
- DDLOG_CRITICAL = 3, // Exceptionally severe error
- DDLOG_SYSTEM = 4, // System message. Not an error
- // but must always be printed.
- DDLOG_SEVERITY_FORCE_DWORD = 0x7fffffff, // Make enum dword
-} DDLOG_severityType;
-
-#ifdef _USE_GLD3_WGL
-// Synomyms
-#define GLDLOG_INFO DDLOG_INFO
-#define GLDLOG_WARN DDLOG_WARN
-#define GLDLOG_ERROR DDLOG_ERROR
-#define GLDLOG_CRITICAL DDLOG_CRITICAL
-#define GLDLOG_SYSTEM DDLOG_SYSTEM
-#endif
-
-// The message that will be output to the log
-static const char *ddlogSeverityMessages[] = {
- "INFO",
- "WARN",
- "ERROR",
- "*CRITICAL*",
- "System",
-};
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void ddlogOpen(DDLOG_loggingMethodType LoggingMethod, DDLOG_severityType Severity);
-void ddlogClose();
-void ddlogMessage(DDLOG_severityType severity, LPSTR message);
-void ddlogError(DDLOG_severityType severity, LPSTR message, HRESULT hResult);
-void ddlogPrintf(DDLOG_severityType severity, LPSTR message, ...);
-void ddlogWarnOption(BOOL bWarnOption);
-void ddlogPathOption(LPSTR szPath);
-
-#ifdef _USE_GLD3_WGL
-// Synomyms
-#define gldLogMessage ddlogMessage
-#define gldLogError ddlogError
-#define gldLogPrintf ddlogPrintf
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c b/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c
deleted file mode 100644
index 9aedd2e3c..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c
+++ /dev/null
@@ -1,2212 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Context handling.
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-
-// Get compile errors without this. KeithH
-//#include "scitech.h" // ibool, etc.
-
-#ifdef _USE_GLD3_WGL
-#include "gld_driver.h"
-
-extern void _gld_mesa_warning(struct gl_context *, char *);
-extern void _gld_mesa_fatal(struct gl_context *, char *);
-#endif // _USE_GLD3_WGL
-
-// TODO: Clean out old DX6-specific code from GLD 2.x CAD driver
-// if it is no longer being built as part of GLDirect. (DaveM)
-
-// ***********************************************************************
-
-#define GLDERR_NONE 0
-#define GLDERR_MEM 1
-#define GLDERR_DDRAW 2
-#define GLDERR_D3D 3
-#define GLDERR_BPP 4
-
-char szResourceWarning[] =
-"GLDirect does not have enough video memory resources\n"
-"to support the requested OpenGL rendering context.\n\n"
-"You may have to reduce the current display resolution\n"
-"to obtain satisfactory OpenGL performance.\n";
-
-char szDDrawWarning[] =
-"GLDirect is unable to initialize DirectDraw for the\n"
-"requested OpenGL rendering context.\n\n"
-"You will have to check the DirectX control panel\n"
-"for further information.\n";
-
-char szD3DWarning[] =
-"GLDirect is unable to initialize Direct3D for the\n"
-"requested OpenGL rendering context.\n\n"
-"You may have to change the display mode resolution\n"
-"color depth or check the DirectX control panel for\n"
-"further information.\n";
-
-char szBPPWarning[] =
-"GLDirect is unable to use the selected color depth for\n"
-"the requested OpenGL rendering context.\n\n"
-"You will have to change the display mode resolution\n"
-"color depth with the Display Settings control panel.\n";
-
-int nContextError = GLDERR_NONE;
-
-// ***********************************************************************
-
-#define VENDORID_ATI 0x1002
-
-static DWORD devATIRagePro[] = {
- 0x4742, // 3D RAGE PRO BGA AGP 1X/2X
- 0x4744, // 3D RAGE PRO BGA AGP 1X only
- 0x4749, // 3D RAGE PRO BGA PCI 33 MHz
- 0x4750, // 3D RAGE PRO PQFP PCI 33 MHz
- 0x4751, // 3D RAGE PRO PQFP PCI 33 MHz limited 3D
- 0x4C42, // 3D RAGE LT PRO BGA-312 AGP 133 MHz
- 0x4C44, // 3D RAGE LT PRO BGA-312 AGP 66 MHz
- 0x4C49, // 3D RAGE LT PRO BGA-312 PCI 33 MHz
- 0x4C50, // 3D RAGE LT PRO BGA-256 PCI 33 MHz
- 0x4C51, // 3D RAGE LT PRO BGA-256 PCI 33 MHz limited 3D
-};
-
-static DWORD devATIRageIIplus[] = {
- 0x4755, // 3D RAGE II+
- 0x4756, // 3D RAGE IIC PQFP PCI
- 0x4757, // 3D RAGE IIC BGA AGP
- 0x475A, // 3D RAGE IIC PQFP AGP
- 0x4C47, // 3D RAGE LT-G
-};
-
-// ***********************************************************************
-
-#ifndef _USE_GLD3_WGL
-extern DGL_mesaFuncs mesaFuncs;
-#endif
-
-extern DWORD dwLogging;
-
-#ifdef GLD_THREADS
-#pragma message("compiling DGLCONTEXT.C vars for multi-threaded support")
-CRITICAL_SECTION CriticalSection; // for serialized access
-DWORD dwTLSCurrentContext = 0xFFFFFFFF; // TLS index for current context
-DWORD dwTLSPixelFormat = 0xFFFFFFFF; // TLS index for current pixel format
-#endif
-HGLRC iCurrentContext = 0; // Index of current context (static)
-BOOL bContextReady = FALSE; // Context state ready ?
-
-DGL_ctx ctxlist[DGL_MAX_CONTEXTS]; // Context list
-
-// ***********************************************************************
-
-static BOOL bHaveWin95 = FALSE;
-static BOOL bHaveWinNT = FALSE;
-static BOOL bHaveWin2K = FALSE;
-
-/****************************************************************************
-REMARKS:
-Detect the installed OS type.
-****************************************************************************/
-static void DetectOS(void)
-{
- OSVERSIONINFO VersionInformation;
- LPOSVERSIONINFO lpVersionInformation = &VersionInformation;
-
- VersionInformation.dwOSVersionInfoSize = sizeof(VersionInformation);
-
- GetVersionEx(lpVersionInformation);
-
- switch (VersionInformation.dwPlatformId) {
- case VER_PLATFORM_WIN32_WINDOWS:
- bHaveWin95 = TRUE;
- bHaveWinNT = FALSE;
- bHaveWin2K = FALSE;
- break;
- case VER_PLATFORM_WIN32_NT:
- bHaveWin95 = FALSE;
- if (VersionInformation.dwMajorVersion <= 4) {
- bHaveWinNT = TRUE;
- bHaveWin2K = FALSE;
- }
- else {
- bHaveWinNT = FALSE;
- bHaveWin2K = TRUE;
- }
- break;
- case VER_PLATFORM_WIN32s:
- bHaveWin95 = FALSE;
- bHaveWinNT = FALSE;
- bHaveWin2K = FALSE;
- break;
- }
-}
-
-// ***********************************************************************
-
-HWND hWndEvent = NULL; // event monitor window
-HWND hWndLastActive = NULL; // last active client window
-LONG __stdcall GLD_EventWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
-
-// ***********************************************************************
-
-// Checks if the HGLRC is valid in range of context list.
-BOOL dglIsValidContext(
- HGLRC a)
-{
- return ((int)a > 0 && (int)a <= DGL_MAX_CONTEXTS);
-}
-
-// ***********************************************************************
-
-// Convert a HGLRC to a pointer into the context list.
-DGL_ctx* dglGetContextAddress(
- const HGLRC a)
-{
- if (dglIsValidContext(a))
- return &ctxlist[(int)a-1];
- return NULL;
-}
-
-// ***********************************************************************
-
-// Return the current HGLRC (however it may be stored for multi-threading).
-HGLRC dglGetCurrentContext(void)
-{
-#ifdef GLD_THREADS
- HGLRC hGLRC;
- // load from thread-specific instance
- if (glb.bMultiThreaded) {
- // protect against calls from arbitrary threads
- __try {
- hGLRC = (HGLRC)TlsGetValue(dwTLSCurrentContext);
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- hGLRC = iCurrentContext;
- }
- }
- // load from global static var
- else {
- hGLRC = iCurrentContext;
- }
- return hGLRC;
-#else
- return iCurrentContext;
-#endif
-}
-
-// ***********************************************************************
-
-// Set the current HGLRC (however it may be stored for multi-threading).
-void dglSetCurrentContext(HGLRC hGLRC)
-{
-#ifdef GLD_THREADS
- // store in thread-specific instance
- if (glb.bMultiThreaded) {
- // protect against calls from arbitrary threads
- __try {
- TlsSetValue(dwTLSCurrentContext, (LPVOID)hGLRC);
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- iCurrentContext = hGLRC;
- }
- }
- // store in global static var
- else {
- iCurrentContext = hGLRC;
- }
-#else
- iCurrentContext = hGLRC;
-#endif
-}
-
-// ***********************************************************************
-
-// Return the current HDC only for a currently active HGLRC.
-HDC dglGetCurrentDC(void)
-{
- HGLRC hGLRC;
- DGL_ctx* lpCtx;
-
- hGLRC = dglGetCurrentContext();
- if (hGLRC) {
- lpCtx = dglGetContextAddress(hGLRC);
- return lpCtx->hDC;
- }
- return 0;
-}
-
-// ***********************************************************************
-
-void dglInitContextState()
-{
- int i;
- WNDCLASS wc;
-
-#ifdef GLD_THREADS
- // Allocate thread local storage indexes for current context and pixel format
- dwTLSCurrentContext = TlsAlloc();
- dwTLSPixelFormat = TlsAlloc();
-#endif
-
- dglSetCurrentContext(NULL); // No current rendering context
-
- // Clear all context data
- ZeroMemory(ctxlist, sizeof(ctxlist[0]) * DGL_MAX_CONTEXTS);
-
- for (i=0; i<DGL_MAX_CONTEXTS; i++)
- ctxlist[i].bAllocated = FALSE; // Flag context as unused
-
- // This section of code crashes the dll in circumstances where the app
- // creates and destroys contexts.
-/*
- // Register the class for our event monitor window
- wc.style = 0;
- wc.lpfnWndProc = GLD_EventWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = GetModuleHandle(NULL);
- wc.hIcon = LoadIcon(GetModuleHandle(NULL), IDI_APPLICATION);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = "GLDIRECT";
- RegisterClass(&wc);
-
- // Create the non-visible window to monitor all broadcast messages
- hWndEvent = CreateWindowEx(
- WS_EX_TOOLWINDOW,"GLDIRECT","GLDIRECT",WS_POPUP,
- 0,0,0,0,
- NULL,NULL,GetModuleHandle(NULL),NULL);
-*/
-
-#ifdef GLD_THREADS
- // Create a critical section object for serializing access to
- // DirectDraw and DDStereo create/destroy functions in multiple threads
- if (glb.bMultiThreaded)
- InitializeCriticalSection(&CriticalSection);
-#endif
-
- // Context state is now initialized and ready
- bContextReady = TRUE;
-}
-
-// ***********************************************************************
-
-void dglDeleteContextState()
-{
- int i;
- static BOOL bOnceIsEnough = FALSE;
-
- // Only call once, from either DGL_exitDriver(), or DLL_PROCESS_DETACH
- if (bOnceIsEnough)
- return;
- bOnceIsEnough = TRUE;
-
- for (i=0; i<DGL_MAX_CONTEXTS; i++) {
- if (ctxlist[i].bAllocated == TRUE) {
- ddlogPrintf(DDLOG_WARN, "** Context %i not deleted - cleaning up.", (i+1));
- dglDeleteContext((HGLRC)(i+1));
- }
- }
-
- // Context state is no longer ready
- bContextReady = FALSE;
-
- // If executed when DLL unloads, DDraw objects may be invalid.
- // So catch any page faults with this exception handler.
-__try {
-
- // Release final DirectDraw interfaces
- if (glb.bDirectDrawPersistant) {
-// RELEASE(glb.lpGlobalPalette);
-// RELEASE(glb.lpDepth4);
-// RELEASE(glb.lpBack4);
-// RELEASE(glb.lpPrimary4);
-// RELEASE(glb.lpDD4);
- }
-}
-__except(EXCEPTION_EXECUTE_HANDLER) {
- ddlogPrintf(DDLOG_WARN, "Exception raised in dglDeleteContextState.");
-}
-
- // Destroy our event monitor window
- if (hWndEvent) {
- DestroyWindow(hWndEvent);
- hWndEvent = hWndLastActive = NULL;
- }
-
-#ifdef GLD_THREADS
- // Destroy the critical section object
- if (glb.bMultiThreaded)
- DeleteCriticalSection(&CriticalSection);
-
- // Release thread local storage indexes for current HGLRC and pixel format
- TlsFree(dwTLSPixelFormat);
- TlsFree(dwTLSCurrentContext);
-#endif
-}
-
-// ***********************************************************************
-
-// Application Window message handler interception
-static LONG __stdcall dglWndProc(
- HWND hwnd,
- UINT msg,
- WPARAM wParam,
- LPARAM lParam)
-{
- DGL_ctx* lpCtx = NULL;
- LONG lpfnWndProc = 0L;
- int i;
- HGLRC hGLRC;
- RECT rect;
- PAINTSTRUCT ps;
- BOOL bQuit = FALSE;
- BOOL bMain = FALSE;
- LONG rc;
-
- // Get the window's message handler *before* it is unhooked in WM_DESTROY
-
- // Is this the main window?
- if (hwnd == glb.hWndActive) {
- bMain = TRUE;
- lpfnWndProc = glb.lpfnWndProc;
- }
- // Search for DGL context matching window handle
- for (i=0; i<DGL_MAX_CONTEXTS; i++) {
- if (ctxlist[i].hWnd == hwnd) {
- lpCtx = &ctxlist[i];
- lpfnWndProc = lpCtx->lpfnWndProc;
- break;
- }
- }
- // Not one of ours...
- if (!lpfnWndProc)
- return DefWindowProc(hwnd, msg, wParam, lParam);
-
- // Intercept messages amd process *before* passing on to window
- switch (msg) {
-#ifdef _USE_GLD3_WGL
- case WM_DISPLAYCHANGE:
- glb.bPixelformatsDirty = TRUE;
- break;
-#endif
- case WM_ACTIVATEAPP:
- glb.bAppActive = (BOOL)wParam;
- ddlogPrintf(DDLOG_INFO, "Calling app has been %s", glb.bAppActive ? "activated" : "de-activated");
- break;
- case WM_ERASEBKGND:
- // Eat the GDI erase event for the GL window
- if (!lpCtx || !lpCtx->bHasBeenCurrent)
- break;
- lpCtx->bGDIEraseBkgnd = TRUE;
- return TRUE;
- case WM_PAINT:
- // Eat the invalidated update region if render scene is in progress
- if (!lpCtx || !lpCtx->bHasBeenCurrent)
- break;
- if (lpCtx->bFrameStarted) {
- if (GetUpdateRect(hwnd, &rect, FALSE)) {
- BeginPaint(hwnd, &ps);
- EndPaint(hwnd, &ps);
- ValidateRect(hwnd, &rect);
- return TRUE;
- }
- }
- break;
- }
- // Call the appropriate window message handler
- rc = CallWindowProc((WNDPROC)lpfnWndProc, hwnd, msg, wParam, lParam);
-
- // Intercept messages and process *after* passing on to window
- switch (msg) {
- case WM_QUIT:
- case WM_DESTROY:
- bQuit = TRUE;
- if (lpCtx && lpCtx->bAllocated) {
- ddlogPrintf(DDLOG_WARN, "WM_DESTROY detected for HWND=%X, HDC=%X, HGLRC=%d", hwnd, lpCtx->hDC, i+1);
- dglDeleteContext((HGLRC)(i+1));
- }
- break;
-#if 0
- case WM_SIZE:
- // Resize surfaces to fit window but not viewport (in case app did not bother)
- if (!lpCtx || !lpCtx->bHasBeenCurrent)
- break;
- w = LOWORD(lParam);
- h = HIWORD(lParam);
- if (lpCtx->dwWidth < w || lpCtx->dwHeight < h) {
- if (!dglWglResizeBuffers(lpCtx->glCtx, TRUE))
- dglWglResizeBuffers(lpCtx->glCtx, FALSE);
- }
- break;
-#endif
- }
-
- // If the main window is quitting, then so should we...
- if (bMain && bQuit) {
- ddlogPrintf(DDLOG_SYSTEM, "shutting down after WM_DESTROY detected for main HWND=%X", hwnd);
- dglDeleteContextState();
- dglExitDriver();
- }
-
- return rc;
-}
-
-// ***********************************************************************
-
-// Driver Window message handler
-static LONG __stdcall GLD_EventWndProc(
- HWND hwnd,
- UINT msg,
- WPARAM wParam,
- LPARAM lParam)
-{
- switch (msg) {
- // May be sent by splash screen dialog on exit
- case WM_ACTIVATE:
- if (LOWORD(wParam) == WA_ACTIVE && glb.hWndActive) {
- SetForegroundWindow(glb.hWndActive);
- return 0;
- }
- break;
- }
- return DefWindowProc(hwnd, msg, wParam, lParam);
-}
-
-// ***********************************************************************
-
-// Intercepted Keyboard handler for detecting hot keys.
-LRESULT CALLBACK dglKeyProc(
- int code,
- WPARAM wParam,
- LPARAM lParam)
-{
- HWND hWnd, hWndFrame;
- HGLRC hGLRC = NULL;
- DGL_ctx* lpCtx = NULL;
- int cmd = 0, dx1 = 0, dx2 = 0, i;
- static BOOL bAltPressed = FALSE;
- static BOOL bCtrlPressed = FALSE;
- static BOOL bShiftPressed = FALSE;
- RECT r, rf, rc;
- POINT pt;
- BOOL bForceReshape = FALSE;
-
- return CallNextHookEx(hKeyHook, code, wParam, lParam);
-}
-
-// ***********************************************************************
-
-HWND hWndMatch;
-
-// Window handle enumeration procedure.
-BOOL CALLBACK dglEnumChildProc(
- HWND hWnd,
- LPARAM lParam)
-{
- RECT rect;
-
- // Find window handle with matching client rect.
- GetClientRect(hWnd, &rect);
- if (EqualRect(&rect, (RECT*)lParam)) {
- hWndMatch = hWnd;
- return FALSE;
- }
- // Continue with next child window.
- return TRUE;
-}
-
-// ***********************************************************************
-
-// Find window handle with matching client rect.
-HWND dglFindWindowRect(
- RECT* pRect)
-{
- hWndMatch = NULL;
- EnumChildWindows(GetForegroundWindow(), dglEnumChildProc, (LPARAM)pRect);
- return hWndMatch;
-}
-
-// ***********************************************************************
-#ifndef _USE_GLD3_WGL
-void dglChooseDisplayMode(
- DGL_ctx *lpCtx)
-{
- // Note: Choose an exact match if possible.
-
- int i;
- DWORD area;
- DWORD bestarea;
- DDSURFACEDESC2 *lpDDSD = NULL; // Mode list pointer
- DDSURFACEDESC2 *lpBestDDSD = NULL; // Pointer to best
-
- lpDDSD = glb.lpDisplayModes;
- for (i=0; i<glb.nDisplayModeCount; i++, lpDDSD++) {
- if ((lpDDSD->dwWidth == lpCtx->dwWidth) &&
- (lpDDSD->dwHeight == lpCtx->dwHeight))
- goto matched; // Mode has been exactly matched
- // Choose modes that are larger in both dimensions than
- // the window, but smaller in area than the current best.
- if ( (lpDDSD->dwWidth >= lpCtx->dwWidth) &&
- (lpDDSD->dwHeight >= lpCtx->dwHeight))
- {
- if (lpBestDDSD == NULL) {
- lpBestDDSD = lpDDSD;
- bestarea = lpDDSD->dwWidth * lpDDSD->dwHeight;
- continue;
- }
- area = lpDDSD->dwWidth * lpDDSD->dwHeight;
- if (area < bestarea) {
- lpBestDDSD = lpDDSD;
- bestarea = area;
- }
- }
- }
-
- // Safety check
- if (lpBestDDSD == NULL) {
- ddlogMessage(DDLOG_CRITICAL, "dglChooseDisplayMode");
- return;
- }
-
- lpCtx->dwModeWidth = lpBestDDSD->dwWidth;
- lpCtx->dwModeHeight = lpBestDDSD->dwHeight;
-matched:
- ddlogPrintf(DDLOG_INFO, "Matched (%ldx%ld) to (%ldx%ld)",
- lpCtx->dwWidth, lpCtx->dwHeight, lpCtx->dwModeWidth, lpCtx->dwModeHeight);
-}
-#endif // _USE_GLD3_WGL
-// ***********************************************************************
-
-static BOOL IsDevice(
- DWORD *lpDeviceIdList,
- DWORD dwDeviceId,
- int count)
-{
- int i;
-
- for (i=0; i<count; i++)
- if (dwDeviceId == lpDeviceIdList[i])
- return TRUE;
-
- return FALSE;
-}
-
-// ***********************************************************************
-
-void dglTestForBrokenCards(
- DGL_ctx *lpCtx)
-{
-#ifndef _GLD3
- DDDEVICEIDENTIFIER dddi; // DX6 device identifier
-
- // Sanity check.
- if (lpCtx == NULL) {
- // Testing for broken cards is sensitive area, so we don't want
- // anything saying "broken cards" in the error message. ;)
- ddlogMessage(DDLOG_ERROR, "Null context passed to TFBC\n");
- return;
- }
-
- if (lpCtx->lpDD4 == NULL) {
- // Testing for broken cards is sensitive area, so we don't want
- // anything saying "broken cards" in the error message. ;)
- ddlogMessage(DDLOG_ERROR, "Null DD4 passed to TFBC\n");
- return;
- }
-
- // Microsoft really fucked up with the GetDeviceIdentifier function
- // on Windows 2000, since it locks up on stock driers on the CD. Updated
- // drivers from vendors appear to work, but we can't identify the drivers
- // without this function!!! For now we skip these tests on Windows 2000.
- if ((GetVersion() & 0x80000000UL) == 0)
- return;
-
- // Obtain device info
- if (FAILED(IDirectDraw4_GetDeviceIdentifier(lpCtx->lpDD4, &dddi, 0)))
- return;
-
- // Useful info. Log it.
- ddlogPrintf(DDLOG_INFO, "DirectDraw: VendorId=0x%x, DeviceId=0x%x", dddi.dwVendorId, dddi.dwDeviceId);
-
- // Vendor 1: ATI
- if (dddi.dwVendorId == VENDORID_ATI) {
- // Test A: ATI Rage PRO
- if (IsDevice(devATIRagePro, dddi.dwDeviceId, sizeof(devATIRagePro)))
- glb.bUseMipmaps = FALSE;
- // Test B: ATI Rage II+
- if (IsDevice(devATIRageIIplus, dddi.dwDeviceId, sizeof(devATIRageIIplus)))
- glb.bEmulateAlphaTest = TRUE;
- }
-
- // Vendor 2: Matrox
- if (dddi.dwVendorId == 0x102B) {
- // Test: Matrox G400 stencil buffer support does not work for AutoCAD
- if (dddi.dwDeviceId == 0x0525) {
- lpCtx->lpPF->pfd.cStencilBits = 0;
- if (lpCtx->lpPF->iZBufferPF != -1) {
- glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwStencilBitDepth = 0;
- glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwStencilBitMask = 0;
- glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwFlags &= ~DDPF_STENCILBUFFER;
- }
- }
- }
-#endif // _GLD3
-}
-
-// ***********************************************************************
-
-BOOL dglCreateContextBuffers(
- HDC a,
- DGL_ctx *lpCtx,
- BOOL bFallback)
-{
- HRESULT hResult;
-
- int i;
-// HGLRC hGLRC;
-// DGL_ctx* lpCtx;
-
-#ifndef _USE_GLD3_WGL
- DWORD dwFlags;
- DDSURFACEDESC2 ddsd2;
- DDSCAPS2 ddscaps2;
- LPDIRECTDRAWCLIPPER lpddClipper;
- D3DDEVICEDESC D3DHWDevDesc; // Direct3D Hardware description
- D3DDEVICEDESC D3DHELDevDesc; // Direct3D Hardware Emulation Layer
-#endif // _USE_GLD3_WGL
-
- float inv_aspect;
-
- GLenum bDoubleBuffer; // TRUE if double buffer required
- GLenum bDepthBuffer; // TRUE if depth buffer required
-
- const PIXELFORMATDESCRIPTOR *lpPFD = &lpCtx->lpPF->pfd;
-
- // Vars for Mesa visual
- DWORD dwDepthBits = 0;
- DWORD dwStencilBits = 0;
- DWORD dwAlphaBits = 0;
- DWORD bAlphaSW = GL_FALSE;
- DWORD bDouble = GL_FALSE;
-
- DDSURFACEDESC2 ddsd2DisplayMode;
- BOOL bFullScrnWin = FALSE; // fullscreen-size window ?
- DDBLTFX ddbltfx;
- DWORD dwMemoryType = (bFallback) ? DDSCAPS_SYSTEMMEMORY : glb.dwMemoryType;
- BOOL bBogusWindow = FALSE; // non-drawable window ?
- DWORD dwColorRef = 0; // GDI background color
- RECT rcDst; // GDI window rect
- POINT pt; // GDI window point
-
- // Palette used for creating default global palette
- PALETTEENTRY ppe[256];
-
-#ifndef _USE_GLD3_WGL
- // Vertex buffer description. Used for creation of vertex buffers
- D3DVERTEXBUFFERDESC vbufdesc;
-#endif // _USE_GLD3_WGL
-
-#define DDLOG_CRITICAL_OR_WARN (bFallback ? DDLOG_CRITICAL : DDLOG_WARN)
-
- ddlogPrintf(DDLOG_SYSTEM, "dglCreateContextBuffers for HDC=%X", a);
- nContextError = GLDERR_NONE;
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw object creation or DDS start
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
- // Check for back buffer
- bDoubleBuffer = GL_TRUE; //(lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? GL_TRUE : GL_FALSE;
- // Since we always do back buffering, check if we emulate front buffering
- lpCtx->EmulateSingle =
- (lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? FALSE : TRUE;
-#if 0 // Don't have to mimic MS OpenGL behavior for front-buffering (DaveM)
- lpCtx->EmulateSingle |=
- (lpPFD->dwFlags & PFD_SUPPORT_GDI) ? TRUE : FALSE;
-#endif
-
- // Check for depth buffer
- bDepthBuffer = (lpPFD->cDepthBits) ? GL_TRUE : GL_FALSE;
-
- lpCtx->bDoubleBuffer = bDoubleBuffer;
- lpCtx->bDepthBuffer = bDepthBuffer;
-
- // Set the Fullscreen flag for the context.
-// lpCtx->bFullscreen = glb.bFullscreen;
-
- // Obtain the dimensions of the rendering window
- lpCtx->hDC = a; // Cache DC
- lpCtx->hWnd = WindowFromDC(lpCtx->hDC);
- // Check for non-window DC = memory DC ?
- if (lpCtx->hWnd == NULL) {
- // bitmap memory contexts are always single-buffered
- lpCtx->EmulateSingle = TRUE;
- bBogusWindow = TRUE;
- ddlogPrintf(DDLOG_INFO, "Non-Window Memory Device Context");
- if (GetClipBox(lpCtx->hDC, &lpCtx->rcScreenRect) == ERROR) {
- ddlogMessage(DDLOG_WARN, "GetClipBox failed in dglCreateContext\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- }
- else if (!GetClientRect(lpCtx->hWnd, &lpCtx->rcScreenRect)) {
- bBogusWindow = TRUE;
- ddlogMessage(DDLOG_WARN, "GetClientRect failed in dglCreateContext\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- lpCtx->dwWidth = lpCtx->rcScreenRect.right - lpCtx->rcScreenRect.left;
- lpCtx->dwHeight = lpCtx->rcScreenRect.bottom - lpCtx->rcScreenRect.top;
-
- ddlogPrintf(DDLOG_INFO, "Input window %X: w=%i, h=%i",
- lpCtx->hWnd, lpCtx->dwWidth, lpCtx->dwHeight);
-
- // What if app only zeroes one dimension instead of both? (DaveM)
- if ( (lpCtx->dwWidth == 0) || (lpCtx->dwHeight == 0) ) {
- // Make the buffer size something sensible
- lpCtx->dwWidth = 8;
- lpCtx->dwHeight = 8;
- }
-
- // Set defaults
- lpCtx->dwModeWidth = lpCtx->dwWidth;
- lpCtx->dwModeHeight = lpCtx->dwHeight;
-/*
- // Find best display mode for fullscreen
- if (glb.bFullscreen || !glb.bPrimary) {
- dglChooseDisplayMode(lpCtx);
- }
-*/
- // Misc initialisation
- lpCtx->bCanRender = FALSE; // No rendering allowed yet
- lpCtx->bSceneStarted = FALSE;
- lpCtx->bFrameStarted = FALSE;
-
- // Detect OS (specifically 'Windows 2000' or 'Windows XP')
- DetectOS();
-
- // NOTE: WinNT not supported
- ddlogPrintf(DDLOG_INFO, "OS: %s", bHaveWin95 ? "Win9x" : (bHaveWin2K ? "Win2000/XP" : "Unsupported") );
-
- // Test for Fullscreen
- if (bHaveWin95) { // Problems with fullscreen on Win2K/XP
- if ((GetSystemMetrics(SM_CXSCREEN) == lpCtx->dwWidth) &&
- (GetSystemMetrics(SM_CYSCREEN) == lpCtx->dwHeight))
- {
- // Workaround for some apps that crash when going fullscreen.
- //lpCtx->bFullscreen = TRUE;
- }
-
- }
-
-#ifdef _USE_GLD3_WGL
- _gldDriver.CreateDrawable(lpCtx, glb.bDirectDrawPersistant, glb.bPersistantBuffers);
-#else
- // Check if DirectDraw has already been created by original GLRC (DaveM)
- if (glb.bDirectDrawPersistant && glb.bDirectDraw) {
- lpCtx->lpDD4 = glb.lpDD4;
- IDirectDraw4_AddRef(lpCtx->lpDD4);
- goto SkipDirectDrawCreate;
- }
-
- // Create DirectDraw object
- if (glb.bPrimary)
- hResult = DirectDrawCreate(NULL, &lpCtx->lpDD1, NULL);
- else {
- // A non-primary device is to be used.
- // Force context to be Fullscreen, secondary adaptors can not
- // be used in a window.
- hResult = DirectDrawCreate(&glb.ddGuid, &lpCtx->lpDD1, NULL);
- lpCtx->bFullscreen = TRUE;
- }
- if (FAILED(hResult)) {
- MessageBox(NULL, "Unable to initialize DirectDraw", "GLDirect", MB_OK);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create DirectDraw interface", hResult);
- nContextError = GLDERR_DDRAW;
- goto return_with_error;
- }
-
- // Query for DX6 IDirectDraw4.
- hResult = IDirectDraw_QueryInterface(lpCtx->lpDD1,
- &IID_IDirectDraw4,
- (void**)&lpCtx->lpDD4);
- if (FAILED(hResult)) {
- MessageBox(NULL, "GLDirect requires DirectX 6.0 or above", "GLDirect", MB_OK);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create DirectDraw4 interface", hResult);
- nContextError = GLDERR_DDRAW;
- goto return_with_error;
- }
-
- // Cache DirectDraw interface for subsequent GLRCs
- if (glb.bDirectDrawPersistant && !glb.bDirectDraw) {
- glb.lpDD4 = lpCtx->lpDD4;
- IDirectDraw4_AddRef(glb.lpDD4);
- glb.bDirectDraw = TRUE;
- }
-SkipDirectDrawCreate:
-
- // Now we have a DD4 interface we can check for broken cards
- dglTestForBrokenCards(lpCtx);
-
- // Test if primary device can use flipping instead of blitting
- ZeroMemory(&ddsd2DisplayMode, sizeof(ddsd2DisplayMode));
- ddsd2DisplayMode.dwSize = sizeof(ddsd2DisplayMode);
- hResult = IDirectDraw4_GetDisplayMode(
- lpCtx->lpDD4,
- &ddsd2DisplayMode);
- if (SUCCEEDED(hResult)) {
- if ( (lpCtx->dwWidth == ddsd2DisplayMode.dwWidth) &&
- (lpCtx->dwHeight == ddsd2DisplayMode.dwHeight) ) {
- // We have a fullscreen-size window
- bFullScrnWin = TRUE;
- // OK to use DirectDraw fullscreen mode ?
- if (glb.bPrimary && !glb.bFullscreenBlit && !lpCtx->EmulateSingle && !glb.bDirectDrawPersistant) {
- lpCtx->bFullscreen = TRUE;
- ddlogMessage(DDLOG_INFO, "Primary upgraded to page flipping.\n");
- }
- }
- // Cache the display mode dimensions
- lpCtx->dwModeWidth = ddsd2DisplayMode.dwWidth;
- lpCtx->dwModeHeight = ddsd2DisplayMode.dwHeight;
- }
-
- // Clamp the effective window dimensions to primary surface.
- // We need to do this for D3D viewport dimensions even if wide
- // surfaces are supported. This also is a good idea for handling
- // whacked-out window dimensions passed for non-drawable windows
- // like Solid Edge. (DaveM)
- if (lpCtx->dwWidth > ddsd2DisplayMode.dwWidth)
- lpCtx->dwWidth = ddsd2DisplayMode.dwWidth;
- if (lpCtx->dwHeight > ddsd2DisplayMode.dwHeight)
- lpCtx->dwHeight = ddsd2DisplayMode.dwHeight;
-
- // Check for non-RGB desktop resolution
- if (!lpCtx->bFullscreen && ddsd2DisplayMode.ddpfPixelFormat.dwRGBBitCount <= 8) {
- ddlogPrintf(DDLOG_CRITICAL_OR_WARN, "Desktop color depth %d bpp not supported",
- ddsd2DisplayMode.ddpfPixelFormat.dwRGBBitCount);
- nContextError = GLDERR_BPP;
- goto return_with_error;
- }
-#endif // _USE_GLD3_WGL
-
- ddlogPrintf(DDLOG_INFO, "Window: w=%i, h=%i (%s)",
- lpCtx->dwWidth,
- lpCtx->dwHeight,
- lpCtx->bFullscreen ? "fullscreen" : "windowed");
-
-#ifndef _USE_GLD3_WGL
- // Obtain ddraw caps
- ZeroMemory(&lpCtx->ddCaps, sizeof(DDCAPS));
- lpCtx->ddCaps.dwSize = sizeof(DDCAPS);
- if (glb.bHardware) {
- // Get HAL caps
- IDirectDraw4_GetCaps(lpCtx->lpDD4, &lpCtx->ddCaps, NULL);
- } else {
- // Get HEL caps
- IDirectDraw4_GetCaps(lpCtx->lpDD4, NULL, &lpCtx->ddCaps);
- }
-
- // If this flag is present then we can't default to Mesa
- // SW rendering between BeginScene() and EndScene().
- if (lpCtx->ddCaps.dwCaps2 & DDCAPS2_NO2DDURING3DSCENE) {
- ddlogMessage(DDLOG_INFO,
- "Warning : No 2D allowed during 3D scene.\n");
- }
-
- // Query for DX6 Direct3D3 interface
- hResult = IDirectDraw4_QueryInterface(lpCtx->lpDD4,
- &IID_IDirect3D3,
- (void**)&lpCtx->lpD3D3);
- if (FAILED(hResult)) {
- MessageBox(NULL, "Unable to initialize Direct3D", "GLDirect", MB_OK);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D interface", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Context creation
- if (lpCtx->bFullscreen) {
- // FULLSCREEN
-
- // Disable warning popups when in fullscreen mode
- ddlogWarnOption(FALSE);
-
- // Have to release persistant primary surface if fullscreen mode
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) {
- RELEASE(glb.lpPrimary4);
- glb.bDirectDrawPrimary = FALSE;
- }
-
- dwFlags = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT;
- if (glb.bFastFPU)
- dwFlags |= DDSCL_FPUSETUP; // fast FPU setup optional (DaveM)
- hResult = IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, lpCtx->hWnd, dwFlags);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to set Exclusive Fullscreen mode", hResult);
- goto return_with_error;
- }
-
- hResult = IDirectDraw4_SetDisplayMode(lpCtx->lpDD4,
- lpCtx->dwModeWidth,
- lpCtx->dwModeHeight,
- lpPFD->cColorBits,
- 0,
- 0);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetDisplayMode failed", hResult);
- goto return_with_error;
- }
-
- // ** The display mode has changed, so dont use MessageBox! **
-
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
-
- if (bDoubleBuffer) {
- // Double buffered
- // Primary surface
- ddsd2.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
- DDSCAPS_FLIP |
- DDSCAPS_COMPLEX |
- DDSCAPS_3DDEVICE |
- dwMemoryType;
- ddsd2.dwBackBufferCount = 1;
-
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
-
- // Render target surface
- ZeroMemory(&ddscaps2, sizeof(ddscaps2)); // Clear the entire struct.
- ddscaps2.dwCaps = DDSCAPS_BACKBUFFER;
- hResult = IDirectDrawSurface4_GetAttachedSurface(lpCtx->lpFront4, &ddscaps2, &lpCtx->lpBack4);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "GetAttachedSurface failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
- } else {
- // Single buffered
- // Primary surface
- ddsd2.dwFlags = DDSD_CAPS;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
- //DDSCAPS_3DDEVICE |
- dwMemoryType;
-
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
-
- lpCtx->lpBack4 = NULL;
- }
- } else {
- // WINDOWED
-
- // OK to enable warning popups in windowed mode
- ddlogWarnOption(glb.bMessageBoxWarnings);
-
- dwFlags = DDSCL_NORMAL;
- if (glb.bMultiThreaded)
- dwFlags |= DDSCL_MULTITHREADED;
- if (glb.bFastFPU)
- dwFlags |= DDSCL_FPUSETUP; // fast FPU setup optional (DaveM)
- hResult = IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4,
- lpCtx->hWnd,
- dwFlags);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to set Normal coop level", hResult);
- goto return_with_error;
- }
- // Has Primary surface already been created for original GLRC ?
- // Note this can only be applicable for windowed modes
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) {
- lpCtx->lpFront4 = glb.lpPrimary4;
- IDirectDrawSurface4_AddRef(lpCtx->lpFront4);
- // Update the window on the default clipper
- IDirectDrawSurface4_GetClipper(lpCtx->lpFront4, &lpddClipper);
- IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
- IDirectDrawClipper_Release(lpddClipper);
- goto SkipPrimaryCreate;
- }
-
- // Primary surface
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
-
- // Cache Primary surface for subsequent GLRCs
- // Note this can only be applicable to subsequent windowed modes
- if (glb.bDirectDrawPersistant && !glb.bDirectDrawPrimary) {
- glb.lpPrimary4 = lpCtx->lpFront4;
- IDirectDrawSurface4_AddRef(glb.lpPrimary4);
- glb.bDirectDrawPrimary = TRUE;
- }
-
- // Clipper object
- hResult = DirectDrawCreateClipper(0, &lpddClipper, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateClipper failed", hResult);
- goto return_with_error;
- }
- hResult = IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
- if (FAILED(hResult)) {
- RELEASE(lpddClipper);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetHWnd failed", hResult);
- goto return_with_error;
- }
- hResult = IDirectDrawSurface4_SetClipper(lpCtx->lpFront4, lpddClipper);
- RELEASE(lpddClipper); // We have finished with it.
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetClipper failed", hResult);
- goto return_with_error;
- }
-SkipPrimaryCreate:
-
- if (bDoubleBuffer) {
- // Render target surface
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
- ddsd2.dwWidth = lpCtx->dwWidth;
- ddsd2.dwHeight = lpCtx->dwHeight;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_3DDEVICE |
- DDSCAPS_OFFSCREENPLAIN |
- dwMemoryType;
-
- // Reserve the entire desktop size for persistant buffers option
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers) {
- ddsd2.dwWidth = ddsd2DisplayMode.dwWidth;
- ddsd2.dwHeight = ddsd2DisplayMode.dwHeight;
- }
- // Re-use original back buffer if persistant buffers exist
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpBack4)
- hResult = IDirectDrawSurface4_AddRef(lpCtx->lpBack4 = glb.lpBack4);
- else
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpBack4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Create Backbuffer failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpBack4)
- IDirectDrawSurface4_AddRef(glb.lpBack4 = lpCtx->lpBack4);
- } else {
- lpCtx->lpBack4 = NULL;
- }
- }
-
- //
- // Now create the Z-buffer
- //
- lpCtx->bStencil = FALSE; // Default to no stencil buffer
- if (bDepthBuffer && (lpCtx->lpPF->iZBufferPF != -1)) {
- // Get z-buffer dimensions from the render target
- // Setup the surface desc for the z-buffer.
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | dwMemoryType;
- ddsd2.dwWidth = lpCtx->dwWidth;
- ddsd2.dwHeight = lpCtx->dwHeight;
- memcpy(&ddsd2.ddpfPixelFormat,
- &glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF],
- sizeof(DDPIXELFORMAT) );
-
- // Reserve the entire desktop size for persistant buffers option
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers) {
- ddsd2.dwWidth = ddsd2DisplayMode.dwWidth;
- ddsd2.dwHeight = ddsd2DisplayMode.dwHeight;
- }
-
- // Create a z-buffer
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpDepth4)
- hResult = IDirectDrawSurface4_AddRef(lpCtx->lpDepth4 = glb.lpDepth4);
- else
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpDepth4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (ZBuffer) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpDepth4)
- IDirectDrawSurface4_AddRef(glb.lpDepth4 = lpCtx->lpDepth4);
- else if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpDepth4 && glb.lpBack4)
- IDirectDrawSurface4_DeleteAttachedSurface(glb.lpBack4, 0, glb.lpDepth4);
-
- // Attach Zbuffer to render target
- TRY(IDirectDrawSurface4_AddAttachedSurface(
- bDoubleBuffer ? lpCtx->lpBack4 : lpCtx->lpFront4,
- lpCtx->lpDepth4),
- "dglCreateContext: Attach Zbuffer");
- if (glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwFlags & DDPF_STENCILBUFFER) {
- lpCtx->bStencil = TRUE;
- ddlogMessage(DDLOG_INFO, "Depth buffer has stencil\n");
- }
- }
-
- // Clear all back buffers and Z-buffers in case of memory recycling.
- ZeroMemory(&ddbltfx, sizeof(ddbltfx));
- ddbltfx.dwSize = sizeof(ddbltfx);
- IDirectDrawSurface4_Blt(lpCtx->lpBack4, NULL, NULL, NULL,
- DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
- if (lpCtx->lpDepth4)
- IDirectDrawSurface4_Blt(lpCtx->lpDepth4, NULL, NULL, NULL,
- DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
-
- // Now that we have a Z-buffer we can create the 3D device
- hResult = IDirect3D3_CreateDevice(lpCtx->lpD3D3,
- &glb.d3dGuid,
- bDoubleBuffer ? lpCtx->lpBack4 : lpCtx->lpFront4,
- &lpCtx->lpDev3,
- NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D device", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // We must do this as soon as the device is created
- dglInitStateCaches(lpCtx);
-
- // Obtain the D3D Device Description
- D3DHWDevDesc.dwSize = D3DHELDevDesc.dwSize = sizeof(D3DDEVICEDESC);
- TRY(IDirect3DDevice3_GetCaps(lpCtx->lpDev3,
- &D3DHWDevDesc,
- &D3DHELDevDesc),
- "dglCreateContext: GetCaps failed");
-
- // Choose the relevant description and cache it in the context.
- // We will use this description later for caps checking
- memcpy( &lpCtx->D3DDevDesc,
- glb.bHardware ? &D3DHWDevDesc : &D3DHELDevDesc,
- sizeof(D3DDEVICEDESC));
-
- // Now we can examine the texture formats
- if (!dglBuildTextureFormatList(lpCtx->lpDev3)) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "dglBuildTextureFormatList failed\n");
- goto return_with_error;
- }
-
- // Get the pixel format of the back buffer
- lpCtx->ddpfRender.dwSize = sizeof(lpCtx->ddpfRender);
- if (bDoubleBuffer)
- hResult = IDirectDrawSurface4_GetPixelFormat(
- lpCtx->lpBack4,
- &lpCtx->ddpfRender);
- else
- hResult = IDirectDrawSurface4_GetPixelFormat(
- lpCtx->lpFront4,
- &lpCtx->ddpfRender);
-
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "GetPixelFormat failed", hResult);
- goto return_with_error;
- }
- // Find a pixel packing function suitable for this surface
- pxClassifyPixelFormat(&lpCtx->ddpfRender,
- &lpCtx->fnPackFunc,
- &lpCtx->fnUnpackFunc,
- &lpCtx->fnPackSpanFunc);
-
- // Viewport
- hResult = IDirect3D3_CreateViewport(lpCtx->lpD3D3, &lpCtx->lpViewport3, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateViewport failed", hResult);
- goto return_with_error;
- }
-
- hResult = IDirect3DDevice3_AddViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "AddViewport failed", hResult);
- goto return_with_error;
- }
-
- // Initialise the viewport
- // Note screen coordinates are used for viewport clipping since D3D
- // transform operations are not used in the GLD CAD driver. (DaveM)
- inv_aspect = (float)lpCtx->dwHeight/(float)lpCtx->dwWidth;
-
- lpCtx->d3dViewport.dwSize = sizeof(lpCtx->d3dViewport);
- lpCtx->d3dViewport.dwX = 0;
- lpCtx->d3dViewport.dwY = 0;
- lpCtx->d3dViewport.dwWidth = lpCtx->dwWidth;
- lpCtx->d3dViewport.dwHeight = lpCtx->dwHeight;
- lpCtx->d3dViewport.dvClipX = 0; // -1.0f;
- lpCtx->d3dViewport.dvClipY = 0; // inv_aspect;
- lpCtx->d3dViewport.dvClipWidth = lpCtx->dwWidth; // 2.0f;
- lpCtx->d3dViewport.dvClipHeight = lpCtx->dwHeight; // 2.0f * inv_aspect;
- lpCtx->d3dViewport.dvMinZ = 0.0f;
- lpCtx->d3dViewport.dvMaxZ = 1.0f;
- TRY(IDirect3DViewport3_SetViewport2(lpCtx->lpViewport3, &lpCtx->d3dViewport), "dglCreateContext: SetViewport2");
-
- hResult = IDirect3DDevice3_SetCurrentViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetCurrentViewport failed", hResult);
- goto return_with_error;
- }
-
- lpCtx->dwBPP = lpPFD->cColorBits;
- lpCtx->iZBufferPF = lpCtx->lpPF->iZBufferPF;
-
- // Set last texture to NULL
- for (i=0; i<MAX_TEXTURE_UNITS; i++) {
- lpCtx->ColorOp[i] = D3DTOP_DISABLE;
- lpCtx->AlphaOp[i] = D3DTOP_DISABLE;
- lpCtx->tObj[i] = NULL;
- }
-
- // Default to perspective correct texture mapping
- dglSetRenderState(lpCtx, D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE, "TexturePersp");
-
- // Set the default culling mode
- lpCtx->cullmode = D3DCULL_NONE;
- dglSetRenderState(lpCtx, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE, "CullMode");
-
- // Disable specular
- dglSetRenderState(lpCtx, D3DRENDERSTATE_SPECULARENABLE, FALSE, "SpecularEnable");
- // Disable subpixel correction
-// dglSetRenderState(lpCtx, D3DRENDERSTATE_SUBPIXEL, FALSE, "SubpixelEnable");
- // Disable dithering
- dglSetRenderState(lpCtx, D3DRENDERSTATE_DITHERENABLE, FALSE, "DitherEnable");
-
- // Initialise the primitive caches
-// lpCtx->dwNextLineVert = 0;
-// lpCtx->dwNextTriVert = 0;
-
- // Init the global texture palette
- lpCtx->lpGlobalPalette = NULL;
-
- // Init the HW/SW usage counters
-// lpCtx->dwHWUsageCount = lpCtx->dwSWUsageCount = 0L;
-
- //
- // Create two D3D vertex buffers.
- // One will hold the pre-transformed data with the other one
- // being used to hold the post-transformed & clipped verts.
- //
-#if 0 // never used (DaveM)
- vbufdesc.dwSize = sizeof(D3DVERTEXBUFFERDESC);
- vbufdesc.dwCaps = D3DVBCAPS_WRITEONLY;
- if (glb.bHardware == FALSE)
- vbufdesc.dwCaps = D3DVBCAPS_SYSTEMMEMORY;
- vbufdesc.dwNumVertices = 32768; // For the time being
-
- // Source vertex buffer
- vbufdesc.dwFVF = DGL_LVERTEX;
- hResult = IDirect3D3_CreateVertexBuffer(lpCtx->lpD3D3, &vbufdesc, &lpCtx->m_vbuf, 0, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateVertexBuffer(src) failed", hResult);
- goto return_with_error;
- }
-
- // Destination vertex buffer
- vbufdesc.dwFVF = (glb.bMultitexture == FALSE) ? D3DFVF_TLVERTEX : (D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX2);
- hResult = IDirect3D3_CreateVertexBuffer(lpCtx->lpD3D3, &vbufdesc, &lpCtx->m_pvbuf, 0, NULL);
- if(FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateVertexBuffer(dst) failed", hResult);
- goto return_with_error;
- }
-#endif
-
-#endif _USE_GLD3_WGL
-
- //
- // Now create the Mesa context
- //
-
- // Create the Mesa visual
- if (lpPFD->cDepthBits)
- dwDepthBits = 16;
- if (lpPFD->cStencilBits)
- dwStencilBits = 8;
- if (lpPFD->cAlphaBits) {
- dwAlphaBits = 8;
- bAlphaSW = GL_TRUE;
- }
- if (lpPFD->dwFlags & PFD_DOUBLEBUFFER)
- bDouble = GL_TRUE;
-// lpCtx->EmulateSingle =
-// (lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? FALSE : TRUE;
-
-#ifdef _USE_GLD3_WGL
- lpCtx->glVis = _mesa_create_visual(
- bDouble, /* double buffer */
- GL_FALSE, // stereo
- lpPFD->cRedBits,
- lpPFD->cGreenBits,
- lpPFD->cBlueBits,
- dwAlphaBits,
- dwDepthBits,
- dwStencilBits,
- lpPFD->cAccumRedBits, // accum bits
- lpPFD->cAccumGreenBits, // accum bits
- lpPFD->cAccumBlueBits, // accum bits
- lpPFD->cAccumAlphaBits, // accum alpha bits
- 1 // num samples
- );
-#else // _USE_GLD3_WGL
- lpCtx->glVis = (*mesaFuncs.gl_create_visual)(
- GL_TRUE, // RGB mode
- bAlphaSW, // Is an alpha buffer required?
- bDouble, // Is an double-buffering required?
- GL_FALSE, // stereo
- dwDepthBits, // depth_size
- dwStencilBits, // stencil_size
- lpPFD->cAccumBits, // accum_size
- 0, // colour-index bits
- lpPFD->cRedBits, // Red bit count
- lpPFD->cGreenBits, // Green bit count
- lpPFD->cBlueBits, // Blue bit count
- dwAlphaBits // Alpha bit count
- );
-#endif // _USE_GLD3_WGL
-
- if (lpCtx->glVis == NULL) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_visual failed\n");
- goto return_with_error;
- }
-
-#ifdef _USE_GLD3_WGL
- lpCtx->glCtx = _mesa_create_context(API_OPENGL, lpCtx->glVis, NULL, (void *)lpCtx, GL_TRUE);
-#else
- // Create the Mesa context
- lpCtx->glCtx = (*mesaFuncs.gl_create_context)(
- lpCtx->glVis, // Mesa visual
- NULL, // share list context
- (void *)lpCtx, // Pointer to our driver context
- GL_TRUE // Direct context flag
- );
-#endif // _USE_GLD3_WGL
-
- if (lpCtx->glCtx == NULL) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_context failed\n");
- goto return_with_error;
- }
-
- // Create the Mesa framebuffer
-#ifdef _USE_GLD3_WGL
- lpCtx->glBuffer = _mesa_create_framebuffer(
- lpCtx->glVis,
- lpCtx->glVis->depthBits > 0,
- lpCtx->glVis->stencilBits > 0,
- lpCtx->glVis->accumRedBits > 0,
- GL_FALSE //swalpha
- );
-#else
- lpCtx->glBuffer = (*mesaFuncs.gl_create_framebuffer)(lpCtx->glVis);
-#endif // _USE_GLD3_WGL
-
- if (lpCtx->glBuffer == NULL) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_framebuffer failed\n");
- goto return_with_error;
- }
-
-#ifdef _USE_GLD3_WGL
- // Init Mesa internals
- _swrast_CreateContext( lpCtx->glCtx );
- _vbo_CreateContext( lpCtx->glCtx );
- _tnl_CreateContext( lpCtx->glCtx );
- _swsetup_CreateContext( lpCtx->glCtx );
-
- _gldDriver.InitialiseMesa(lpCtx);
-
- lpCtx->glCtx->imports.warning = _gld_mesa_warning;
- lpCtx->glCtx->imports.fatal = _gld_mesa_fatal;
-
-#else
- // Tell Mesa how many texture stages we have
- glb.wMaxSimultaneousTextures = lpCtx->D3DDevDesc.wMaxSimultaneousTextures;
- // Only use as many Units as the spec requires
- if (glb.wMaxSimultaneousTextures > MAX_TEXTURE_UNITS)
- glb.wMaxSimultaneousTextures = MAX_TEXTURE_UNITS;
- lpCtx->glCtx->Const.MaxTextureUnits = glb.wMaxSimultaneousTextures;
- ddlogPrintf(DDLOG_INFO, "Texture stages : %d", glb.wMaxSimultaneousTextures);
-
- // Set the max texture size.
- // NOTE: clamped to a max of 1024 for extra performance!
- lpCtx->dwMaxTextureSize = (lpCtx->D3DDevDesc.dwMaxTextureWidth <= 1024) ? lpCtx->D3DDevDesc.dwMaxTextureWidth : 1024;
-
-// Texture resize takes place elsewhere. KH
-// NOTE: This was added to workaround an issue with the Intel app.
-#if 0
- lpCtx->glCtx->Const.MaxTextureSize = lpCtx->dwMaxTextureSize;
-#else
- lpCtx->glCtx->Const.MaxTextureSize = 1024;
-#endif
- lpCtx->glCtx->Const.MaxDrawBuffers = 1;
-
- // Setup the Display Driver pointers
- dglSetupDDPointers(lpCtx->glCtx);
-
- // Initialise all the Direct3D renderstates
- dglInitStateD3D(lpCtx->glCtx);
-
-#if 0
- // Signal a reload of texture state on next glBegin
- lpCtx->m_texHandleValid = FALSE;
- lpCtx->m_mtex = FALSE;
- lpCtx->m_texturing = FALSE;
-#else
- // Set default texture unit state
-// dglSetTexture(lpCtx, 0, NULL);
-// dglSetTexture(lpCtx, 1, NULL);
-#endif
-
- //
- // Set the global texture palette to default values.
- //
-
- // Clear the entire palette
- ZeroMemory(ppe, sizeof(PALETTEENTRY) * 256);
-
- // Fill the palette with a default colour.
- // A garish colour is used to catch bugs. Here Magenta is used.
- for (i=0; i < 256; i++) {
- ppe[i].peRed = 255;
- ppe[i].peGreen = 0;
- ppe[i].peBlue = 255;
- }
-
- RELEASE(lpCtx->lpGlobalPalette);
-
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpGlobalPalette)
- hResult = IDirectDrawPalette_AddRef(lpCtx->lpGlobalPalette = glb.lpGlobalPalette);
- else
- hResult = IDirectDraw4_CreatePalette(
- lpCtx->lpDD4,
- DDPCAPS_INITIALIZE | DDPCAPS_8BIT | DDPCAPS_ALLOW256,
- ppe,
- &(lpCtx->lpGlobalPalette),
- NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_ERROR, "Default CreatePalette failed\n", hResult);
- lpCtx->lpGlobalPalette = NULL;
- goto return_with_error;
- }
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpGlobalPalette)
- IDirectDrawPalette_AddRef(glb.lpGlobalPalette = lpCtx->lpGlobalPalette);
-
-#endif // _USE_GLD3_WGL
-
- // ** If we have made it to here then we can enable rendering **
- lpCtx->bCanRender = TRUE;
-
-// ddlogMessage(DDLOG_SYSTEM, "dglCreateContextBuffers succeded\n");
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return TRUE;
-
-return_with_error:
- // Clean up before returning.
- // This is critical for secondary devices.
-
- lpCtx->bCanRender = FALSE;
-
-#ifdef _USE_GLD3_WGL
- // Destroy the Mesa context
- if (lpCtx->glBuffer)
- _mesa_destroy_framebuffer(lpCtx->glBuffer);
- if (lpCtx->glCtx)
- _mesa_destroy_context(lpCtx->glCtx);
- if (lpCtx->glVis)
- _mesa_destroy_visual(lpCtx->glVis);
-
- // Destroy driver data
- _gldDriver.DestroyDrawable(lpCtx);
-#else
- // Destroy the Mesa context
- if (lpCtx->glBuffer)
- (*mesaFuncs.gl_destroy_framebuffer)(lpCtx->glBuffer);
- if (lpCtx->glCtx)
- (*mesaFuncs.gl_destroy_context)(lpCtx->glCtx);
- if (lpCtx->glVis)
- (*mesaFuncs.gl_destroy_visual)(lpCtx->glVis);
-
- RELEASE(lpCtx->m_pvbuf); // Release D3D vertex buffer
- RELEASE(lpCtx->m_vbuf); // Release D3D vertex buffer
-
- if (lpCtx->lpViewport3) {
- if (lpCtx->lpDev3) IDirect3DDevice3_DeleteViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- RELEASE(lpCtx->lpViewport3);
- lpCtx->lpViewport3 = NULL;
- }
-
- RELEASE(lpCtx->lpDev3);
- if (lpCtx->lpDepth4) {
- if (lpCtx->lpBack4)
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpBack4, 0L, lpCtx->lpDepth4);
- else
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpFront4, 0L, lpCtx->lpDepth4);
- RELEASE(lpCtx->lpDepth4);
- lpCtx->lpDepth4 = NULL;
- }
- RELEASE(lpCtx->lpBack4);
- RELEASE(lpCtx->lpFront4);
- else
- if (lpCtx->bFullscreen) {
- IDirectDraw4_RestoreDisplayMode(lpCtx->lpDD4);
- IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, NULL, DDSCL_NORMAL);
- }
- RELEASE(lpCtx->lpD3D3);
- RELEASE(lpCtx->lpDD4);
- RELEASE(lpCtx->lpDD1);
-#endif // _USE_GLD3_WGL
-
- lpCtx->bAllocated = FALSE;
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return FALSE;
-
-#undef DDLOG_CRITICAL_OR_WARN
-}
-
-// ***********************************************************************
-
-HGLRC dglCreateContext(
- HDC a,
- const DGL_pixelFormat *lpPF)
-{
- int i;
- HGLRC hGLRC;
- DGL_ctx* lpCtx;
- static BOOL bWarnOnce = TRUE;
- DWORD dwThreadId = GetCurrentThreadId();
- char szMsg[256];
- HWND hWnd;
- LONG lpfnWndProc;
-
- // Validate license
- if (!dglValidate())
- return NULL;
-
- // Is context state ready ?
- if (!bContextReady)
- return NULL;
-
- ddlogPrintf(DDLOG_SYSTEM, "dglCreateContext for HDC=%X, ThreadId=%X", a, dwThreadId);
-
- // Find next free context.
- // Also ensure that only one Fullscreen context is created at any one time.
- hGLRC = 0; // Default to Not Found
- for (i=0; i<DGL_MAX_CONTEXTS; i++) {
- if (ctxlist[i].bAllocated) {
- if (/*glb.bFullscreen && */ctxlist[i].bFullscreen)
- break;
- } else {
- hGLRC = (HGLRC)(i+1);
- break;
- }
- }
-
- // Bail if no GLRC was found
- if (!hGLRC)
- return NULL;
-
- // Set the context pointer
- lpCtx = dglGetContextAddress(hGLRC);
- // Make sure that context is zeroed before we do anything.
- // MFC and C++ apps call wglCreateContext() and wglDeleteContext() multiple times,
- // even though only one context is ever used by the app, so keep it clean. (DaveM)
- ZeroMemory(lpCtx, sizeof(DGL_ctx));
- lpCtx->bAllocated = TRUE;
- // Flag that buffers need creating on next wglMakeCurrent call.
- lpCtx->bHasBeenCurrent = FALSE;
- lpCtx->lpPF = (DGL_pixelFormat *)lpPF; // cache pixel format
- lpCtx->bCanRender = FALSE;
-
- // Create all the internal resources here, not in dglMakeCurrent().
- // We do a re-size check in dglMakeCurrent in case of re-allocations. (DaveM)
- // We now try context allocations twice, first with video memory,
- // then again with system memory. This is similar to technique
- // used for dglWglResizeBuffers(). (DaveM)
- if (lpCtx->bHasBeenCurrent == FALSE) {
- if (!dglCreateContextBuffers(a, lpCtx, FALSE)) {
- if (glb.bMessageBoxWarnings && bWarnOnce && dwLogging) {
- bWarnOnce = FALSE;
- switch (nContextError) {
- case GLDERR_DDRAW: strcpy(szMsg, szDDrawWarning); break;
- case GLDERR_D3D: strcpy(szMsg, szD3DWarning); break;
- case GLDERR_MEM: strcpy(szMsg, szResourceWarning); break;
- case GLDERR_BPP: strcpy(szMsg, szBPPWarning); break;
- default: strcpy(szMsg, "");
- }
- if (strlen(szMsg))
- MessageBox(NULL, szMsg, "GLDirect", MB_OK | MB_ICONWARNING);
- }
- // Only need to try again if memory error
- if (nContextError == GLDERR_MEM) {
- ddlogPrintf(DDLOG_WARN, "dglCreateContext failed 1st time with video memory");
- }
- else {
- ddlogPrintf(DDLOG_ERROR, "dglCreateContext failed");
- return NULL;
- }
- }
- }
-
- // Now that we have a hWnd, we can intercept the WindowProc.
- hWnd = lpCtx->hWnd;
- if (hWnd) {
- // Only hook individual window handler once if not hooked before.
- lpfnWndProc = GetWindowLong(hWnd, GWL_WNDPROC);
- if (lpfnWndProc != (LONG)dglWndProc) {
- lpCtx->lpfnWndProc = lpfnWndProc;
- SetWindowLong(hWnd, GWL_WNDPROC, (LONG)dglWndProc);
- }
- // Find the parent window of the app too.
- if (glb.hWndActive == NULL) {
- while (hWnd != NULL) {
- glb.hWndActive = hWnd;
- hWnd = GetParent(hWnd);
- }
- // Hook the parent window too.
- lpfnWndProc = GetWindowLong(glb.hWndActive, GWL_WNDPROC);
- if (glb.hWndActive == lpCtx->hWnd)
- glb.lpfnWndProc = lpCtx->lpfnWndProc;
- else if (lpfnWndProc != (LONG)dglWndProc)
- glb.lpfnWndProc = lpfnWndProc;
- if (glb.lpfnWndProc)
- SetWindowLong(glb.hWndActive, GWL_WNDPROC, (LONG)dglWndProc);
- }
- }
-
- ddlogPrintf(DDLOG_SYSTEM, "dglCreateContext succeeded for HGLRC=%d", (int)hGLRC);
-
- return hGLRC;
-}
-
-// ***********************************************************************
-// Make a DirectGL context current
-// Used by wgl functions and dgl functions
-BOOL dglMakeCurrent(
- HDC a,
- HGLRC b)
-{
- int context;
- DGL_ctx* lpCtx;
- HWND hWnd;
- BOOL bNeedResize = FALSE;
- BOOL bWindowChanged, bContextChanged;
- LPDIRECTDRAWCLIPPER lpddClipper;
- DWORD dwThreadId = GetCurrentThreadId();
- LONG lpfnWndProc;
-
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- // Is context state ready ?
- if (!bContextReady)
- return FALSE;
-
- context = (int)b; // This is as a result of STRICT!
- ddlogPrintf(DDLOG_SYSTEM, "dglMakeCurrent: HDC=%X, HGLRC=%d, ThreadId=%X", a, context, dwThreadId);
-
- // If the HGLRC is NULL then make no context current;
- // Ditto if the HDC is NULL either. (DaveM)
- if (context == 0 || a == 0) {
- // Corresponding Mesa operation
-#ifdef _USE_GLD3_WGL
- _mesa_make_current(NULL, NULL);
-#else
- (*mesaFuncs.gl_make_current)(NULL, NULL);
-#endif
- dglSetCurrentContext(0);
- return TRUE;
- }
-
- // Make sure the HGLRC is in range
- if ((context > DGL_MAX_CONTEXTS) || (context < 0)) {
- ddlogMessage(DDLOG_ERROR, "dglMakeCurrent: HGLRC out of range\n");
- return FALSE;
- }
-
- // Find address of context and make sure that it has been allocated
- lpCtx = dglGetContextAddress(b);
- if (!lpCtx->bAllocated) {
- ddlogMessage(DDLOG_ERROR, "dglMakeCurrent: Context not allocated\n");
-// return FALSE;
- return TRUE; // HACK: Shuts up "WebLab Viewer Pro". KeithH
- }
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw or DDS operations
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
- // Check if window has changed
- hWnd = (a != lpCtx->hDC) ? WindowFromDC(a) : lpCtx->hWnd;
- bWindowChanged = (hWnd != lpCtx->hWnd) ? TRUE : FALSE;
- bContextChanged = (b != dglGetCurrentContext()) ? TRUE : FALSE;
-
- // If the window has changed, make sure the clipper is updated. (DaveM)
- if (glb.bDirectDrawPersistant && !lpCtx->bFullscreen && (bWindowChanged || bContextChanged)) {
- lpCtx->hWnd = hWnd;
-#ifndef _USE_GLD3_WGL
- IDirectDrawSurface4_GetClipper(lpCtx->lpFront4, &lpddClipper);
- IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
- IDirectDrawClipper_Release(lpddClipper);
-#endif // _USE_GLD3_WGL
- }
-
- // Make sure hDC and hWnd is current. (DaveM)
- // Obtain the dimensions of the rendering window
- lpCtx->hDC = a; // Cache DC
- lpCtx->hWnd = hWnd;
- hWndLastActive = hWnd;
-
- // Check for non-window DC = memory DC ?
- if (hWnd == NULL) {
- if (GetClipBox(a, &lpCtx->rcScreenRect) == ERROR) {
- ddlogMessage(DDLOG_WARN, "GetClipBox failed in dglMakeCurrent\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- }
- else if (!GetClientRect(lpCtx->hWnd, &lpCtx->rcScreenRect)) {
- ddlogMessage(DDLOG_WARN, "GetClientRect failed in dglMakeCurrent\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- // Check if buffers need to be re-sized;
- // If so, wait until Mesa GL stuff is setup before re-sizing;
- if (lpCtx->dwWidth != lpCtx->rcScreenRect.right - lpCtx->rcScreenRect.left ||
- lpCtx->dwHeight != lpCtx->rcScreenRect.bottom - lpCtx->rcScreenRect.top)
- bNeedResize = TRUE;
-
- // Now we can update our globals
- dglSetCurrentContext(b);
-
- // Corresponding Mesa operation
-#ifdef _USE_GLD3_WGL
- _mesa_make_current(lpCtx->glCtx, lpCtx->glBuffer);
- lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL);
- if (bNeedResize) {
- // Resize buffers (Note Mesa GL needs to be setup beforehand);
- // Resize Mesa internal buffer too via glViewport() command,
- // which subsequently calls dglWglResizeBuffers() too.
- lpCtx->glCtx->Driver.Viewport(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
- lpCtx->bHasBeenCurrent = TRUE;
- }
-#else
- (*mesaFuncs.gl_make_current)(lpCtx->glCtx, lpCtx->glBuffer);
-
- dglSetupDDPointers(lpCtx->glCtx);
-
- // Insure DirectDraw surfaces fit current window DC
- if (bNeedResize) {
- // Resize buffers (Note Mesa GL needs to be setup beforehand);
- // Resize Mesa internal buffer too via glViewport() command,
- // which subsequently calls dglWglResizeBuffers() too.
- (*mesaFuncs.gl_Viewport)(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
- lpCtx->bHasBeenCurrent = TRUE;
- }
-#endif // _USE_GLD3_WGL
- ddlogPrintf(DDLOG_SYSTEM, "dglMakeCurrent: width = %d, height = %d", lpCtx->dwWidth, lpCtx->dwHeight);
-
- // We have to clear D3D back buffer and render state if emulated front buffering
- // for different window (but not context) like in Solid Edge.
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers
- && (bWindowChanged /* || bContextChanged */) && lpCtx->EmulateSingle) {
-#ifdef _USE_GLD3_WGL
-// IDirect3DDevice8_EndScene(lpCtx->pDev);
-// lpCtx->bSceneStarted = FALSE;
- lpCtx->glCtx->Driver.Clear(lpCtx->glCtx, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
- GL_TRUE, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#else
- IDirect3DDevice3_EndScene(lpCtx->lpDev3);
- lpCtx->bSceneStarted = FALSE;
- dglClearD3D(lpCtx->glCtx, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
- GL_TRUE, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#endif // _USE_GLD3_WGL
- }
-
- // The first time we call MakeCurrent we set the initial viewport size
- if (lpCtx->bHasBeenCurrent == FALSE)
-#ifdef _USE_GLD3_WGL
- lpCtx->glCtx->Driver.Viewport(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#else
- (*mesaFuncs.gl_Viewport)(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#endif // _USE_GLD3_WGL
- lpCtx->bHasBeenCurrent = TRUE;
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return TRUE;
-}
-
-// ***********************************************************************
-
-BOOL dglDeleteContext(
- HGLRC a)
-{
- DGL_ctx* lpCtx;
- DWORD dwThreadId = GetCurrentThreadId();
- char argstr[256];
-
-#if 0 // We have enough trouble throwing exceptions as it is... (DaveM)
- // Validate license
- if (!dglValidate())
- return FALSE;
-#endif
-
- // Is context state ready ?
- if (!bContextReady)
- return FALSE;
-
- ddlogPrintf(DDLOG_SYSTEM, "dglDeleteContext: Deleting context HGLRC=%d, ThreadId=%X", (int)a, dwThreadId);
-
- // Make sure the HGLRC is in range
- if (((int) a> DGL_MAX_CONTEXTS) || ((int)a < 0)) {
- ddlogMessage(DDLOG_ERROR, "dglDeleteCurrent: HGLRC out of range\n");
- return FALSE;
- }
-
- // Make sure context is valid
- lpCtx = dglGetContextAddress(a);
- if (!lpCtx->bAllocated) {
- ddlogPrintf(DDLOG_WARN, "Tried to delete unallocated context HGLRC=%d", (int)a);
-// return FALSE;
- return TRUE; // HACK: Shuts up "WebLab Viewer Pro". KeithH
- }
-
- // Make sure context is de-activated
- if (a == dglGetCurrentContext()) {
- ddlogPrintf(DDLOG_WARN, "dglDeleteContext: context HGLRC=%d still active", (int)a);
- dglMakeCurrent(NULL, NULL);
- }
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw or DDS operations
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
- // We are about to destroy all Direct3D objects.
- // Therefore we must disable rendering
- lpCtx->bCanRender = FALSE;
-
- // This exception handler was installed to catch some
- // particularly nasty apps. Console apps that call exit()
- // fall into this catagory (i.e. Win32 Glut).
-
- // VC cannot successfully implement multiple exception handlers
- // if more than one exception occurs. Therefore reverting back to
- // single exception handler as Keith originally had it. (DaveM)
-
-#define WARN_MESSAGE(p) strcpy(argstr, (#p));
-#define SAFE_RELEASE(p) WARN_MESSAGE(p); RELEASE(p);
-
-__try {
-#ifdef _USE_GLD3_WGL
- WARN_MESSAGE(gl_destroy_framebuffer);
- if (lpCtx->glBuffer)
- _mesa_destroy_framebuffer(lpCtx->glBuffer);
- WARN_MESSAGE(gl_destroy_context);
- if (lpCtx->glCtx)
- _mesa_destroy_context(lpCtx->glCtx);
- WARN_MESSAGE(gl_destroy_visual);
- if (lpCtx->glVis)
- _mesa_destroy_visual(lpCtx->glVis);
-
- _gldDriver.DestroyDrawable(lpCtx);
-#else
- // Destroy the Mesa context
- WARN_MESSAGE(gl_destroy_framebuffer);
- if (lpCtx->glBuffer)
- (*mesaFuncs.gl_destroy_framebuffer)(lpCtx->glBuffer);
- WARN_MESSAGE(gl_destroy_context);
- if (lpCtx->glCtx)
- (*mesaFuncs.gl_destroy_context)(lpCtx->glCtx);
- WARN_MESSAGE(gl_destroy_visual);
- if (lpCtx->glVis)
- (*mesaFuncs.gl_destroy_visual)(lpCtx->glVis);
-
- SAFE_RELEASE(lpCtx->m_pvbuf); // release D3D vertex buffer
- SAFE_RELEASE(lpCtx->m_vbuf); // release D3D vertex buffer
-
- // Delete the global palette
- SAFE_RELEASE(lpCtx->lpGlobalPalette);
-
- // Clean up.
- if (lpCtx->lpViewport3) {
- if (lpCtx->lpDev3) IDirect3DDevice3_DeleteViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- SAFE_RELEASE(lpCtx->lpViewport3);
- lpCtx->lpViewport3 = NULL;
- }
-
- SAFE_RELEASE(lpCtx->lpDev3);
- if (lpCtx->lpDepth4) {
- if (lpCtx->lpBack4)
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpBack4, 0L, lpCtx->lpDepth4);
- else
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpFront4, 0L, lpCtx->lpDepth4);
- SAFE_RELEASE(lpCtx->lpDepth4);
- lpCtx->lpDepth4 = NULL;
- }
- SAFE_RELEASE(lpCtx->lpBack4);
- SAFE_RELEASE(lpCtx->lpFront4);
- if (lpCtx->bFullscreen) {
- IDirectDraw4_RestoreDisplayMode(lpCtx->lpDD4);
- IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, NULL, DDSCL_NORMAL);
- }
- SAFE_RELEASE(lpCtx->lpD3D3);
- SAFE_RELEASE(lpCtx->lpDD4);
- SAFE_RELEASE(lpCtx->lpDD1);
-#endif // _ULSE_GLD3_WGL
-
-}
-__except(EXCEPTION_EXECUTE_HANDLER) {
- ddlogPrintf(DDLOG_WARN, "Exception raised in dglDeleteContext: %s", argstr);
-}
-
- // Restore the window message handler because this context may be used
- // again by another window with a *different* message handler. (DaveM)
- if (lpCtx->lpfnWndProc) {
- SetWindowLong(lpCtx->hWnd, GWL_WNDPROC, (LONG)lpCtx->lpfnWndProc);
- lpCtx->lpfnWndProc = (LONG)NULL;
- }
-
- lpCtx->bAllocated = FALSE; // This context is now free for use
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return TRUE;
-}
-
-// ***********************************************************************
-
-BOOL dglSwapBuffers(
- HDC hDC)
-{
- RECT rSrcRect; // Source rectangle
- RECT rDstRect; // Destination rectangle
- POINT pt;
- HRESULT hResult;
-
- DDBLTFX bltFX;
- DWORD dwBlitFlags;
- DDBLTFX *lpBltFX;
-
-// DWORD dwThreadId = GetCurrentThreadId();
- HGLRC hGLRC = dglGetCurrentContext();
- DGL_ctx *lpCtx = dglGetContextAddress(hGLRC);
- HWND hWnd;
-
- HDC hDCAux; // for memory DC
- int x,y,w,h; // for memory DC BitBlt
-
-#if 0 // Perhaps not a good idea. Called too often. KH
- // Validate license
- if (!dglValidate())
- return FALSE;
-#endif
-
- if (!lpCtx) {
- return TRUE; //FALSE; // No current context
- }
-
- if (!lpCtx->bCanRender) {
- // Don't return false else some apps will bail.
- return TRUE;
- }
-
- hWnd = lpCtx->hWnd;
- if (hDC != lpCtx->hDC) {
- ddlogPrintf(DDLOG_WARN, "dglSwapBuffers: HDC=%X does not match HDC=%X for HGLRC=%d", hDC, lpCtx->hDC, hGLRC);
- hWnd = WindowFromDC(hDC);
- }
-
-#ifndef _USE_GLD3_WGL
- // Ensure that the surfaces exist before we tell
- // the device to render to them.
- IDirectDraw4_RestoreAllSurfaces(lpCtx->lpDD4);
-
- // Make sure that the vertex caches have been emptied
-// dglStateChange(lpCtx);
-
- // Some OpenGL programs don't issue a glFinish - check for it here.
- if (lpCtx->bSceneStarted) {
- IDirect3DDevice3_EndScene(lpCtx->lpDev3);
- lpCtx->bSceneStarted = FALSE;
- }
-#endif
-
-#if 0
- // If the calling app is not active then we don't need to Blit/Flip.
- // We can therefore simply return TRUE.
- if (!glb.bAppActive)
- return TRUE;
- // Addendum: This is WRONG! We should bail if the app is *minimized*,
- // not merely if the app is just plain 'not active'.
- // KeithH, 27/May/2000.
-#endif
-
- // Check for non-window DC = memory DC ?
- if (hWnd == NULL) {
- if (GetClipBox(hDC, &rSrcRect) == ERROR)
- return TRUE;
- // Use GDI BitBlt instead from compatible DirectDraw DC
- x = rSrcRect.left;
- y = rSrcRect.top;
- w = rSrcRect.right - rSrcRect.left;
- h = rSrcRect.bottom - rSrcRect.top;
-
- // Ack. DX8 does not have a GetDC() function...
- // TODO: Defer to DX7 or DX9 drivers... (DaveM)
- return TRUE;
- }
-
- // Bail if window client region is not drawable, like in Solid Edge
- if (!IsWindow(hWnd) /* || !IsWindowVisible(hWnd) */ || !GetClientRect(hWnd, &rSrcRect))
- return TRUE;
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw or DDS operations
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
-#ifdef _USE_GLD3_WGL
- // Notify Mesa of impending swap, so Mesa can flush internal buffers.
- _mesa_notifySwapBuffers(lpCtx->glCtx);
- // Now perform driver buffer swap
- _gldDriver.SwapBuffers(lpCtx, hDC, hWnd);
-#else
- if (lpCtx->bFullscreen) {
- // Sync with retrace if required
- if (glb.bWaitForRetrace) {
- IDirectDraw4_WaitForVerticalBlank(
- lpCtx->lpDD4,
- DDWAITVB_BLOCKBEGIN,
- 0);
- }
-
- // Perform the fullscreen flip
- TRY(IDirectDrawSurface4_Flip(
- lpCtx->lpFront4,
- NULL,
- DDFLIP_WAIT),
- "dglSwapBuffers: Flip");
- } else {
- // Calculate current window position and size
- pt.x = pt.y = 0;
- ClientToScreen(hWnd, &pt);
- GetClientRect(hWnd, &rDstRect);
- if (rDstRect.right > lpCtx->dwModeWidth)
- rDstRect.right = lpCtx->dwModeWidth;
- if (rDstRect.bottom > lpCtx->dwModeHeight)
- rDstRect.bottom = lpCtx->dwModeHeight;
- OffsetRect(&rDstRect, pt.x, pt.y);
- rSrcRect.left = rSrcRect.top = 0;
- rSrcRect.right = lpCtx->dwWidth;
- rSrcRect.bottom = lpCtx->dwHeight;
- if (rSrcRect.right > lpCtx->dwModeWidth)
- rSrcRect.right = lpCtx->dwModeWidth;
- if (rSrcRect.bottom > lpCtx->dwModeHeight)
- rSrcRect.bottom = lpCtx->dwModeHeight;
-
- if (glb.bWaitForRetrace) {
- // Sync the blit to the vertical retrace
- ZeroMemory(&bltFX, sizeof(bltFX));
- bltFX.dwSize = sizeof(bltFX);
- bltFX.dwDDFX = DDBLTFX_NOTEARING;
- dwBlitFlags = DDBLT_WAIT | DDBLT_DDFX;
- lpBltFX = &bltFX;
- } else {
- dwBlitFlags = DDBLT_WAIT;
- lpBltFX = NULL;
- }
-
- // Perform the actual blit
- TRY(IDirectDrawSurface4_Blt(
- lpCtx->lpFront4,
- &rDstRect,
- lpCtx->lpBack4, // Blit source
- &rSrcRect,
- dwBlitFlags,
- lpBltFX),
- "dglSwapBuffers: Blt");
- }
-#endif // _USE_GLD3_WGL
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- // TODO: Re-instate rendering bitmap snapshot feature??? (DaveM)
-
- // Render frame is completed
- ValidateRect(hWnd, NULL);
- lpCtx->bFrameStarted = FALSE;
-
- return TRUE;
-}
-
-// ***********************************************************************
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.h b/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.h
deleted file mode 100644
index 5eea9de3d..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: OpenGL context handling.
-*
-****************************************************************************/
-
-#ifndef __DGLCONTEXT_H
-#define __DGLCONTEXT_H
-
-// Disable compiler complaints about DLL linkage
-#pragma warning (disable:4273)
-
-// Macros to control compilation
-#ifndef STRICT
-#define STRICT
-#endif // STRICT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <GL\gl.h>
-
-#ifdef _USE_GLD3_WGL
- #include "dglmacros.h"
- #include "dglglobals.h"
- #include "pixpack.h"
- #include "ddlog.h"
- #include "dglpf.h"
- #include "context.h" // Mesa context
-#else
- #include <ddraw.h>
- #include <d3d.h>
-
- #include "dglmacros.h"
- #include "dglglobals.h"
- #include "pixpack.h"
- #include "ddlog.h"
- #include "dglpf.h"
- #include "d3dvertex.h"
-
- #include "DirectGL.h"
-
- #include "context.h" // Mesa context
- #include "vb.h" // Mesa vertex buffer
-#endif // _USE_GLD3_WGL
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-// TODO: Use a list instead of this constant!
-#define DGL_MAX_CONTEXTS 32
-
-// Structure for describing an OpenGL context
-#ifdef _USE_GLD3_WGL
-typedef struct {
- BOOL bHasBeenCurrent;
- DGL_pixelFormat *lpPF;
-
- // Pointer to private driver data (this also contains the drawable).
- void *glPriv;
-
- // Mesa vars:
- struct gl_context *glCtx; // The core Mesa context
- struct gl_config *glVis; // Describes the color buffer
- struct gl_framebuffer *glBuffer; // Ancillary buffers
-
- GLuint ClearIndex;
- GLuint CurrentIndex;
- GLubyte ClearColor[4];
- GLubyte CurrentColor[4];
-
- BOOL EmulateSingle; // Emulate single-buffering
- BOOL bDoubleBuffer;
- BOOL bDepthBuffer;
-
- // Shared driver vars:
- BOOL bAllocated;
- BOOL bFullscreen; // Is this a fullscreen context?
- BOOL bSceneStarted; // Has a lpDev->BeginScene been issued?
- BOOL bCanRender; // Flag: states whether rendering is OK
- BOOL bFrameStarted; // Has frame update started at all?
- BOOL bStencil; // TRUE if this context has stencil
- BOOL bGDIEraseBkgnd; // GDI Erase Background command
-
- // Window information
- HWND hWnd; // Window handle
- HDC hDC; // Windows' Device Context of the window
- DWORD dwWidth; // Window width
- DWORD dwHeight; // Window height
- DWORD dwBPP; // Window bits-per-pixel;
- RECT rcScreenRect; // Screen rectangle
- DWORD dwModeWidth; // Display mode width
- DWORD dwModeHeight; // Display mode height
- float dvClipX;
- float dvClipY;
- LONG lpfnWndProc; // window message handler function
-
-} DGL_ctx;
-
-#define GLD_context DGL_ctx
-#define GLD_GET_CONTEXT(c) (GLD_context*)(c)->DriverCtx
-
-#else // _USE_GLD3_WGL
-
-typedef struct {
- BOOL bHasBeenCurrent;
- DGL_pixelFormat *lpPF;
- //
- // Mesa context vars:
- //
- struct gl_context *glCtx; // The core Mesa context
- struct gl_config *glVis; // Describes the color buffer
- struct gl_framebuffer *glBuffer; // Ancillary buffers
-
- GLuint ClearIndex;
- GLuint CurrentIndex;
- GLubyte ClearColor[4];
- GLubyte CurrentColor[4];
-
- BOOL EmulateSingle; // Emulate single-buffering
- BOOL bDoubleBuffer;
- BOOL bDepthBuffer;
- int iZBufferPF; // Index of Zbuffer pixel format
-
- // Vertex buffer: one-to-one correlation with Mesa's vertex buffer.
- // This will be filled by our setup function (see d3dvsetup.c)
- DGL_TLvertex gWin[VB_SIZE]; // Transformed and lit vertices
-// DGL_Lvertex gObj[VB_SIZE]; // Lit vertices in object coordinates.
-
- // Indices for DrawIndexedPrimitive.
- // Clipped quads are drawn seperately, so use VB_SIZE.
- // 6 indices are needed to make 2 triangles for each possible quad
-// WORD wIndices[(VB_SIZE / 4) * 6];
- WORD wIndices[32768];
-
- //
- // Device driver vars:
- //
- BOOL bAllocated;
- BOOL bFullscreen; // Is this a fullscreen context?
- BOOL bSceneStarted; // Has a lpDev->BeginScene been issued?
- BOOL bCanRender; // Flag: states whether rendering is OK
- BOOL bFrameStarted; // Has frame update started at all?
-
- // DirectX COM interfaces, postfixed with the interface number
- IDirectDraw *lpDD1;
- IDirectDraw4 *lpDD4;
- IDirect3D3 *lpD3D3;
- IDirect3DDevice3 *lpDev3;
- IDirect3DViewport3 *lpViewport3;
- IDirectDrawSurface4 *lpFront4;
- IDirectDrawSurface4 *lpBack4;
- IDirectDrawSurface4 *lpDepth4;
-
- // Vertex buffers
- BOOL bD3DPipeline; // True if using D3D geometry pipeline
- IDirect3DVertexBuffer *m_vbuf; // Unprocessed vertices
- IDirect3DVertexBuffer *m_pvbuf; // Processed vertices ready to be rendered
-
- D3DTEXTUREOP ColorOp[MAX_TEXTURE_UNITS]; // Used for re-enabling texturing
- D3DTEXTUREOP AlphaOp[MAX_TEXTURE_UNITS]; // Used for re-enabling texturing
- struct gl_texture_object *tObj[MAX_TEXTURE_UNITS];
-
- DDCAPS ddCaps; // DirectDraw caps
- D3DDEVICEDESC D3DDevDesc; // Direct3D Device description
-
- DDPIXELFORMAT ddpfRender; // Pixel format of the render buffer
- DDPIXELFORMAT ddpfDepth; // Pixel format of the depth buffer
-
- BOOL bStencil; // TRUE is this context has stencil
-
- PX_packFunc fnPackFunc; // Pixel packing function for SW
- PX_unpackFunc fnUnpackFunc; // Pixel unpacking function for SW
- PX_packSpanFunc fnPackSpanFunc; // Pixel span packer
-
- D3DVIEWPORT2 d3dViewport; // D3D Viewport object
-
- D3DCULL cullmode; // Direct3D cull mode
- D3DCOLOR curcolor; // Current color
- DWORD dwColorPF; // Current color, in format of target surface
- D3DCOLOR d3dClearColor; // Clear color
- D3DCOLOR ConstantColor; // For flat shading
- DWORD dwClearColorPF; // Clear color, in format of target surface
- BOOL bGDIEraseBkgnd; // GDI Erase Background command
-
- // Primitive caches
-// DGL_vertex LineCache[DGL_MAX_LINE_VERTS];
-// DGL_vertex TriCache[DGL_MAX_TRI_VERTS];
-// DWORD dwNextLineVert;
-// DWORD dwNextTriVert;
-
- // Window information
- HWND hWnd; // Window handle
- HDC hDC; // Windows' Device Context of the window
- DWORD dwWidth; // Window width
- DWORD dwHeight; // Window height
- DWORD dwBPP; // Window bits-per-pixel;
- RECT rcScreenRect; // Screen rectangle
- DWORD dwModeWidth; // Display mode width
- DWORD dwModeHeight; // Display mode height
- float dvClipX;
- float dvClipY;
- LONG lpfnWndProc; // window message handler function
-
- // Shared texture palette
- IDirectDrawPalette *lpGlobalPalette;
-
- // Usage counters.
- // One of these counters will be incremented when we choose
- // between hardware and software rendering functions.
-// DWORD dwHWUsageCount; // Hardware usage count
-// DWORD dwSWUsageCount; // Software usage count
-
- // Texture state flags.
-// BOOL m_texturing; // TRUE is texturing
-// BOOL m_mtex; // TRUE if multitexture
-// BOOL m_texHandleValid; // TRUE if tex state valid
-
- // Renderstate caches to ensure no redundant state changes
- DWORD dwRS[256]; // Renderstates
- DWORD dwTSS[2][24]; // Texture-stage states
- LPDIRECT3DTEXTURE2 lpTex[2]; // Texture (1 per stage)
-
- DWORD dwMaxTextureSize; // Max texture size:
- // clamped to 1024.
-
-} DGL_ctx;
-#endif // _USE_GLD3_WGL
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HHOOK hKeyHook;
-LRESULT CALLBACK dglKeyProc(int code,WPARAM wParam,LPARAM lParam);
-
-void dglInitContextState();
-void dglDeleteContextState();
-BOOL dglIsValidContext(HGLRC a);
-DGL_ctx* dglGetContextAddress(const HGLRC a);
-HDC dglGetCurrentDC(void);
-HGLRC dglGetCurrentContext(void);
-HGLRC dglCreateContext(HDC a, const DGL_pixelFormat *lpPF);
-BOOL dglMakeCurrent(HDC a, HGLRC b);
-BOOL dglDeleteContext(HGLRC a);
-BOOL dglSwapBuffers(HDC hDC);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglglobals.c b/mesalib/src/mesa/drivers/windows/gldirect/dglglobals.c
deleted file mode 100644
index c633e3bcf..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglglobals.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Global variables.
-*
-****************************************************************************/
-
-#include "dglglobals.h"
-
-// =======================================================================
-// Global Variables
-// =======================================================================
-
-char szCopyright[] = "Copyright (c) 1998 SciTech Software, Inc.";
-char szDllName[] = "Scitech GLDirect";
-char szErrorTitle[] = "GLDirect Error";
-
-DGL_globals glb;
-
-// Shared result variable
-HRESULT hResult;
-
-// ***********************************************************************
-
-// Patch function for missing function in Mesa
-int finite(
- double x)
-{
- return _finite(x);
-};
-
-// ***********************************************************************
-
-void dglInitGlobals()
-{
- // Zero all fields just in case
- memset(&glb, 0, sizeof(glb));
-
- // Set the global defaults
- glb.bPrimary = FALSE; // Not the primary device
- glb.bHardware = FALSE; // Not a hardware device
-// glb.bFullscreen = FALSE; // Not running fullscreen
- glb.bSquareTextures = FALSE; // Device does not need sq
- glb.bPAL8 = FALSE; // Device cannot do 8bit
- glb.dwMemoryType = DDSCAPS_SYSTEMMEMORY;
- glb.dwRendering = DGL_RENDER_D3D;
-
- glb.bWaitForRetrace = TRUE; // Sync to vertical retrace
- glb.bFullscreenBlit = FALSE;
-
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL; // Pixel format list
-#ifndef _USE_GLD3_WGL
- glb.nZBufferPFCount = 0;
- glb.lpZBufferPF = NULL;
- glb.nDisplayModeCount = 0;
- glb.lpDisplayModes = NULL;
- glb.nTextureFormatCount = 0;
- glb.lpTextureFormat = NULL;
-#endif // _USE_GLD3_WGL
-
- glb.wMaxSimultaneousTextures = 1;
-
- // Enable support for multitexture, if available.
- glb.bMultitexture = TRUE;
-
- // Enable support for mipmapping
- glb.bUseMipmaps = TRUE;
-
- // Alpha emulation via chroma key
- glb.bEmulateAlphaTest = FALSE;
-
- // Use Mesa pipeline always (for compatibility)
- glb.bForceMesaPipeline = FALSE;
-
- // Init support for multiple GLRCs
- glb.bDirectDraw = FALSE;
- glb.bDirectDrawPrimary = FALSE;
- glb.bDirect3D = FALSE;
- glb.bDirect3DDevice = FALSE;
- glb.bDirectDrawStereo = FALSE;
- glb.iDirectDrawStereo = 0;
- glb.hWndActive = NULL;
- // Init DirectX COM interfaces for multiple GLRCs
-// glb.lpDD4 = NULL;
-// glb.lpPrimary4 = NULL;
-// glb.lpBack4 = NULL;
-// glb.lpDepth4 = NULL;
-// glb.lpGlobalPalette = NULL;
-
- // Init special support options
- glb.bMessageBoxWarnings = TRUE;
- glb.bDirectDrawPersistant = FALSE;
- glb.bPersistantBuffers = FALSE;
-
- // Do not assume single-precision-only FPU (for compatibility)
- glb.bFastFPU = FALSE;
-
- // Allow hot-key support
- glb.bHotKeySupport = TRUE;
-
- // Default to single-threaded support (for simplicity)
- glb.bMultiThreaded = FALSE;
-
- // Use application-specific customizations (for end-user convenience)
- glb.bAppCustomizations = TRUE;
-
-#ifdef _USE_GLD3_WGL
- // Registry/ini-file settings for GLDirect 3.x
- glb.dwAdapter = 0; // Primary DX8 adapter
- glb.dwTnL = 1; // MesaSW TnL
- glb.dwMultisample = 0; // Multisample Off
- glb.dwDriver = 2; // Direct3D HW
-
- // Signal a pixelformat list rebuild
- glb.bPixelformatsDirty = TRUE;
-#endif
-}
-
-// ***********************************************************************
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglglobals.h b/mesalib/src/mesa/drivers/windows/gldirect/dglglobals.h
deleted file mode 100644
index 995f1cd5e..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglglobals.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Globals.
-*
-****************************************************************************/
-
-#ifndef __DGLGLOBALS_H
-#define __DGLGLOBALS_H
-
-#include "dglcontext.h"
-#include "dglpf.h" // Pixel format
-#ifndef _USE_GLD3_WGL
-#include "d3dtexture.h"
-#endif
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-typedef enum {
- DGL_RENDER_MESASW = 0,
- DGL_RENDER_D3D = 1,
- DGL_RENDER_FORCE_DWORD = 0x7ffffff,
-} DGL_renderType;
-
-#ifdef _USE_GLD3_WGL
-
-// Same as DGL_renderType? KeithH
-typedef enum {
- GLDS_DRIVER_MESA_SW = 0, // Mesa SW rendering
- GLDS_DRIVER_REF = 1, // Direct3D Reference Rasteriser
- GLDS_DRIVER_HAL = 2, // Direct3D HW rendering
-} GLDS_DRIVER;
-
-typedef enum {
- GLDS_TNL_DEFAULT = 0, // Choose best TnL method
- GLDS_TNL_MESA = 1, // Mesa TnL
- GLDS_TNL_D3DSW = 2, // D3D Software TnL
- GLDS_TNL_D3DHW = 3, // D3D Hardware TnL
-} GLDS_TNL;
-
-typedef enum {
- GLDS_MULTISAMPLE_NONE = 0,
- GLDS_MULTISAMPLE_FASTEST = 1,
- GLDS_MULTISAMPLE_NICEST = 2,
-} GLDS_MULTISAMPLE;
-#endif
-
-typedef struct {
- // Registry settings
- char szDDName[MAX_DDDEVICEID_STRING]; // DirectDraw device name
- char szD3DName[MAX_DDDEVICEID_STRING]; // Direct3D driver name
- BOOL bPrimary; // Is ddraw device the Primary device?
- BOOL bHardware; // Is the d3d driver a Hardware driver?
-#ifndef _USE_GLD3_WGL
- GUID ddGuid; // GUID of the ddraw device
- GUID d3dGuid; // GUID of the direct3d driver
-#endif // _USE_GLD3_WGL
-// BOOL bFullscreen; // Force fullscreen - only useful for primary adaptors.
- BOOL bSquareTextures; // Does this driver require square textures?
- DWORD dwRendering; // Type of rendering required
-
- BOOL bWaitForRetrace; // Sync to vertical retrace
- BOOL bFullscreenBlit; // Use Blt instead of Flip in fullscreen modes
-
- // Multitexture
- BOOL bMultitexture;
-
- BOOL bUseMipmaps;
-
- DWORD dwMemoryType; // Sysmem or Vidmem
-
- // Global palette
- BOOL bPAL8;
- DDPIXELFORMAT ddpfPAL8;
-
- // Multitexture
- WORD wMaxSimultaneousTextures;
-
- // Win32 internals
- BOOL bAppActive; // Keep track of Alt-Tab
- LONG lpfnWndProc; // WndProc of calling app
-
- // Pixel Format Descriptior list.
- int nPixelFormatCount;
- DGL_pixelFormat *lpPF;
-#ifndef _USE_GLD3_WGL
- // ZBuffer pixel formats
- int nZBufferPFCount; // Count of Zbuffer pixel formats
- DDPIXELFORMAT *lpZBufferPF; // ZBuffer pixel formats
-
- // Display modes (for secondary devices)
- int nDisplayModeCount;
- DDSURFACEDESC2 *lpDisplayModes;
-
- // Texture pixel formats
- int nTextureFormatCount;
- DGL_textureFormat *lpTextureFormat;
-#endif // _USE_GLD3_WGL
- // Alpha emulation via chroma key
- BOOL bEmulateAlphaTest;
-
- // Geom pipeline override.
- // If this is set TRUE then the D3D pipeline will never be used,
- // and the Mesa pipline will always be used.
- BOOL bForceMesaPipeline;
-
-#ifdef _USE_GLD3_WGL
- BOOL bPixelformatsDirty; // Signal a list rebuild
-#endif
-
- // Additional globals to support multiple GL rendering contexts, GLRCs
- BOOL bDirectDraw; // DirectDraw interface exists ?
- BOOL bDirectDrawPrimary; // DirectDraw primary surface exists ?
- BOOL bDirect3D; // Direct3D interface exists ?
- BOOL bDirect3DDevice; // Direct3D device exists ?
-
- BOOL bDirectDrawStereo; // DirectDraw Stereo driver started ?
- int iDirectDrawStereo; // DirectDraw Stereo driver reference count
- HWND hWndActive; // copy of active window
-
- // Copies of DirectX COM interfaces for re-referencing across multiple GLRCs
-// IDirectDraw4 *lpDD4; // copy of DirectDraw interface
-// IDirectDrawSurface4 *lpPrimary4; // copy of DirectDraw primary surface
-// IDirectDrawSurface4 *lpBack4;
-// IDirectDrawSurface4 *lpDepth4;
-// IDirectDrawPalette *lpGlobalPalette;
-
- // Aids for heavy-duty MFC-windowed OGL apps, like AutoCAD
- BOOL bMessageBoxWarnings; // popup message box warning
- BOOL bDirectDrawPersistant; // DirectDraw is persisitant
- BOOL bPersistantBuffers; // DirectDraw buffers persisitant
-
- // FPU setup option for CAD precision (AutoCAD) vs GAME speed (Quake)
- BOOL bFastFPU; // single-precision-only FPU ?
-
- // Hot-Key support, like for real-time stereo parallax adjustments
- BOOL bHotKeySupport; // hot-key support ?
-
- // Multi-threaded support, for apps like 3DStudio
- BOOL bMultiThreaded; // multi-threaded ?
-
- // Detect and use app-specific customizations for apps like 3DStudio
- BOOL bAppCustomizations; // app customizations ?
-
-#ifdef _USE_GLD3_WGL
- DWORD dwAdapter; // Primary DX8 adapter
- DWORD dwTnL; // MesaSW TnL
- DWORD dwMultisample; // Multisample Off
- DWORD dwDriver; // Direct3D HW
- void *pDrvPrivate; // Driver-specific data
-#endif
-
-} DGL_globals;
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-DGL_globals glb;
-
-void dglInitGlobals();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglmacros.h b/mesalib/src/mesa/drivers/windows/gldirect/dglmacros.h
deleted file mode 100644
index aed0f2110..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglmacros.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Useful generic macros.
-*
-****************************************************************************/
-
-#ifndef __DGLMACROS_H
-#define __DGLMACROS_H
-
-#include <ddraw.h>
-
-// Define the relevant RELEASE macro depending on C or C++
-#if !defined(__cplusplus) || defined(CINTERFACE)
- // Standard C version
- #define RELEASE(x) if (x!=NULL) { x->lpVtbl->Release(x); x=NULL; }
-#else
- // C++ version
- #define RELEASE(x) if (x!=NULL) { x->Release(); x=NULL; }
-#endif
-
-// We don't want a message *every* time we call an unsupported function
-#define UNSUPPORTED(x) \
- { \
- static BOOL bFirstTime = TRUE; \
- if (bFirstTime) { \
- bFirstTime = FALSE; \
- ddlogError(DDLOG_WARN, (x), DDERR_CURRENTLYNOTAVAIL); \
- } \
- }
-
-#define DGL_CHECK_CONTEXT \
- if (ctx == NULL) return;
-
-// Don't render if bCanRender is not TRUE.
-#define DGL_CHECK_RENDER \
- if (!dgl->bCanRender) return;
-
-#if 0
-#define TRY(a,b) (a)
-#define TRY_ERR(a,b) (a)
-#else
-// hResult should be defined in the function
-// Return codes should be checked via SUCCEDDED and FAILED macros
-#define TRY(a,b) \
- { \
- if (FAILED(hResult=(a))) \
- ddlogError(DDLOG_ERROR, (b), hResult); \
- }
-
-// hResult is a global
-// The label exit_with_error should be defined within the calling scope
-#define TRY_ERR(a,b) \
- { \
- if (FAILED(hResult=(a))) { \
- ddlogError(DDLOG_ERROR, (b), hResult); \
- goto exit_with_error; \
- } \
- }
-#endif // #if 1
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglpf.c b/mesalib/src/mesa/drivers/windows/gldirect/dglpf.c
deleted file mode 100644
index 4cd4d0334..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglpf.c
+++ /dev/null
@@ -1,620 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Pixel Formats.
-*
-****************************************************************************/
-
-#include "dglpf.h"
-
-#ifdef _USE_GLD3_WGL
-#include "gld_driver.h"
-#endif
-
-// ***********************************************************************
-
-char szColorDepthWarning[] =
-"GLDirect does not support the current desktop\n\
-color depth.\n\n\
-You may need to change the display resolution to\n\
-16 bits per pixel or higher color depth using\n\
-the Windows Display Settings control panel\n\
-before running this OpenGL application.\n";
-
-// ***********************************************************************
-// This pixel format will be used as a template when compiling the list
-// of pixel formats supported by the hardware. Many fields will be
-// filled in at runtime.
-// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM
-DGL_pixelFormat pfTemplateHW =
-{
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
- 1, // Structure version - should be 1
- // Flags:
- PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
- PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
- PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
- PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
- PFD_DOUBLEBUFFER | // The buffer is double-buffered.
- 0, // Placeholder for easy commenting of above flags
- PFD_TYPE_RGBA, // Pixel type RGBA.
- 16, // Total colour bitplanes (excluding alpha bitplanes)
- 5, 0, // Red bits, shift
- 5, 5, // Green bits, shift
- 5, 10, // Blue bits, shift
- 0, 0, // Alpha bits, shift (destination alpha)
- 0, // Accumulator bits (total)
- 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha
- 0, // Depth bits
- 0, // Stencil bits
- 0, // Number of auxiliary buffers
- 0, // Layer type
- 0, // Specifies the number of overlay and underlay planes.
- 0, // Layer mask
- 0, // Specifies the transparent color or index of an underlay plane.
- 0 // Damage mask
- },
- -1, // No depth/stencil buffer
-};
-
-// ***********************************************************************
-// Return the count of the number of bits in a Bit Mask.
-int BitCount(
- DWORD dw)
-{
- int i;
-
- if (dw == 0)
- return 0; // account for non-RGB mode
-
- for (i=0; dw; dw=dw>>1)
- i += (dw & 1);
- return i;
-}
-
-// ***********************************************************************
-
-DWORD BitShift(
- DWORD dwMaskIn)
-{
- DWORD dwShift, dwMask;
-
- if (dwMaskIn == 0)
- return 0; // account for non-RGB mode
-
- for (dwShift=0, dwMask=dwMaskIn; !(dwMask&1); dwShift++, dwMask>>=1);
-
- return dwShift;
-}
-
-// ***********************************************************************
-
-BOOL IsValidPFD(int iPFD)
-{
- DGL_pixelFormat *lpPF;
-
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- if ((glb.lpPF == NULL) ||
- (glb.nPixelFormatCount == 0))
- return FALSE;
-
- // Check PFD range
- if ( (iPFD < 1) || (iPFD > glb.nPixelFormatCount) ) {
- ddlogMessage(DDLOG_ERROR, "PFD out of range\n");
- return FALSE; // PFD is invalid
- }
-
- // Make a pointer to the pixel format
- lpPF = &glb.lpPF[iPFD-1];
-
- // Check size
- if (lpPF->pfd.nSize != sizeof(PIXELFORMATDESCRIPTOR)) {
- ddlogMessage(DDLOG_ERROR, "Bad PFD size\n");
- return FALSE; // PFD is invalid
- }
-
- // Check version
- if (lpPF->pfd.nVersion != 1) {
- ddlogMessage(DDLOG_ERROR, "PFD is not Version 1\n");
- return FALSE; // PFD is invalid
- }
-
- return TRUE; // PFD is valid
-}
-
-// ***********************************************************************
-
-#ifndef _USE_GLD3_WGL
-
-int iEnumCount; // Enumeration count
-DWORD dwDisplayBitDepth; // Bit depth of current display mode
-
-// ***********************************************************************
-
-HRESULT WINAPI EnumDisplayModesCallback(
- DDSURFACEDESC2* pddsd,
- void *pvContext)
-{
- DWORD dwModeDepth;
- DDSURFACEDESC2 *lpDisplayMode;
- char buf[32];
-
- // Check parameters
- if (pddsd == NULL)
- return DDENUMRET_CANCEL;
-
- dwModeDepth = pddsd->ddpfPixelFormat.dwRGBBitCount;
- lpDisplayMode = (DDSURFACEDESC2 *)pvContext;
-
- // Check mode for compatability with device.
- if (dwModeDepth != dwDisplayBitDepth)
- return DDENUMRET_OK;
-
- if (lpDisplayMode != NULL) {
- memcpy(&lpDisplayMode[iEnumCount], pddsd, sizeof(DDSURFACEDESC2));
- sprintf(buf, TEXT("Mode: %ld x %ld x %ld\n"),
- pddsd->dwWidth, pddsd->dwHeight, dwModeDepth);
- ddlogMessage(DDLOG_INFO, buf);
- }
-
- iEnumCount++;
-
- return DDENUMRET_OK;
-}
-
-// ***********************************************************************
-
-HRESULT CALLBACK d3dEnumZBufferFormatsCallback(
- DDPIXELFORMAT* pddpf,
- VOID* lpZBufferPF )
-{
- char buf[64];
-
- if(pddpf == NULL)
- return D3DENUMRET_CANCEL;
-
- if (pddpf->dwFlags & DDPF_ZBUFFER) {
- if (lpZBufferPF == NULL) {
- // Pass 1. Merely counting the PF
- glb.nZBufferPFCount++;
- } else {
- // Pass 2. Save the PF
- if (pddpf->dwFlags & DDPF_STENCILBUFFER) {
- sprintf(buf, " %d: Z=%d S=%d\n",
- iEnumCount,
- pddpf->dwZBufferBitDepth,
- pddpf->dwStencilBitDepth);
- } else {
- sprintf(buf, " %d: Z=%d S=0\n",
- iEnumCount,
- pddpf->dwZBufferBitDepth);
- }
- ddlogMessage(DDLOG_INFO, buf);
-
- memcpy(&glb.lpZBufferPF[iEnumCount++],
- pddpf,
- sizeof(DDPIXELFORMAT));
- }
- }
-
- return D3DENUMRET_OK;
-}
-#endif // _USE_GLD3_WGL
-
-// ***********************************************************************
-
-BOOL IsStencilSupportBroken(LPDIRECTDRAW4 lpDD4)
-{
- DDDEVICEIDENTIFIER dddi; // DX6 device identifier
- BOOL bBroken = FALSE;
-
- // Microsoft really fucked up with the GetDeviceIdentifier function
- // on Windows 2000, since it locks up on stock driers on the CD. Updated
- // drivers from vendors appear to work, but we can't identify the drivers
- // without this function!!! For now we skip these tests on Windows 2000.
- if ((GetVersion() & 0x80000000UL) == 0)
- return FALSE;
-
- // Obtain device info
- if (FAILED(IDirectDraw4_GetDeviceIdentifier(lpDD4, &dddi, 0)))
- return FALSE;
-
- // Matrox G400 stencil buffer support does not draw anything in AutoCAD,
- // but ordinary Z buffers draw shaded models fine. (DaveM)
- if (dddi.dwVendorId == 0x102B) { // Matrox
- if (dddi.dwDeviceId == 0x0525) { // G400
- bBroken = TRUE;
- }
- }
-
- return bBroken;
-}
-
-// ***********************************************************************
-
-void dglBuildPixelFormatList()
-{
- int i;
- char buf[128];
- char cat[8];
- DGL_pixelFormat *lpPF;
-
-#ifdef _USE_GLD3_WGL
- _gldDriver.BuildPixelformatList();
-#else
- HRESULT hRes;
- IDirectDraw *lpDD1 = NULL;
- IDirectDraw4 *lpDD4 = NULL;
- IDirect3D3 *lpD3D3 = NULL;
- DDSURFACEDESC2 ddsdDisplayMode;
-
- DWORD dwRb, dwGb, dwBb, dwAb; // Bit counts
- DWORD dwRs, dwGs, dwBs, dwAs; // Bit shifts
- DWORD dwPixelType; // RGB or color index
-
- // Set defaults
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL;
- glb.nZBufferPFCount = 0;
- glb.lpZBufferPF = NULL;
- glb.nDisplayModeCount = 0;
- glb.lpDisplayModes = NULL;
-
- //
- // Examine the hardware for depth and stencil
- //
-
- if (glb.bPrimary)
- hRes = DirectDrawCreate(NULL, &lpDD1, NULL);
- else
- hRes = DirectDrawCreate(&glb.ddGuid, &lpDD1, NULL);
-
- if (FAILED(hRes)) {
- ddlogError(DDLOG_ERROR, "dglBPFL: DirectDrawCreate failed", hRes);
- return;
- }
-
- // Query for DX6 IDirectDraw4.
- hRes = IDirectDraw_QueryInterface(
- lpDD1,
- &IID_IDirectDraw4,
- (void**)&lpDD4);
- if (FAILED(hRes)) {
- ddlogError(DDLOG_ERROR, "dglBPFL: QueryInterface (DD4) failed", hRes);
- goto clean_up;
- }
-
-
- // Retrieve caps of current display mode
- ZeroMemory(&ddsdDisplayMode, sizeof(ddsdDisplayMode));
- ddsdDisplayMode.dwSize = sizeof(ddsdDisplayMode);
- hRes = IDirectDraw4_GetDisplayMode(lpDD4, &ddsdDisplayMode);
- if (FAILED(hRes))
- goto clean_up;
-
- dwDisplayBitDepth = ddsdDisplayMode.ddpfPixelFormat.dwRGBBitCount;
- dwPixelType = (dwDisplayBitDepth <= 8) ? PFD_TYPE_COLORINDEX : PFD_TYPE_RGBA;
- dwRb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwRBitMask);
- dwGb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwGBitMask);
- dwBb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwBBitMask);
- dwRs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwRBitMask);
- dwGs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwGBitMask);
- dwBs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwBBitMask);
-
- if (BitCount(ddsdDisplayMode.ddpfPixelFormat.dwRGBAlphaBitMask)) {
- dwAb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwRGBAlphaBitMask);
- dwAs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwRGBAlphaBitMask);
- } else {
- dwAb = 0;
- dwAs = 0;
- }
-
- // Query for available display modes
- ddlogMessage(DDLOG_INFO, "\n");
- ddlogMessage(DDLOG_INFO, "Display Modes:\n");
-
- // Pass 1: Determine count
- iEnumCount = 0;
- hRes = IDirectDraw4_EnumDisplayModes(
- lpDD4,
- 0,
- NULL,
- NULL,
- EnumDisplayModesCallback);
- if (FAILED(hRes)) {
- ddlogError(DDLOG_ERROR, "dglBPFL: EnumDisplayModes failed", hRes);
- goto clean_up;
- }
- if (iEnumCount == 0) {
- ddlogMessage(DDLOG_ERROR, "dglBPFL: No display modes found");
- goto clean_up;
- }
- glb.lpDisplayModes = (DDSURFACEDESC2 *)calloc(iEnumCount,
- sizeof(DDSURFACEDESC2));
- if (glb.lpDisplayModes == NULL) {
- ddlogMessage(DDLOG_ERROR, "dglBPFL: DDSURFACEDESC2 calloc failed");
- goto clean_up;
- }
- glb.nDisplayModeCount = iEnumCount;
- // Pass 2: Save modes
- iEnumCount = 0;
- hRes = IDirectDraw4_EnumDisplayModes(
- lpDD4,
- 0,
- NULL,
- (void *)glb.lpDisplayModes,
- EnumDisplayModesCallback);
- if (FAILED(hRes)) {
- ddlogError(DDLOG_ERROR, "dglBPFL: EnumDisplayModes failed", hRes);
- goto clean_up;
- }
- // Query for IDirect3D3 interface
- hRes = IDirectDraw4_QueryInterface(
- lpDD4,
- &IID_IDirect3D3,
- (void**)&lpD3D3);
- if (FAILED(hRes)) {
- ddlogError(DDLOG_ERROR, "dglBPFL: QueryInterface (D3D3) failed", hRes);
- goto clean_up;
- }
-
- ddlogMessage(DDLOG_INFO, "\n");
- ddlogMessage(DDLOG_INFO, "ZBuffer formats:\n");
-
- // Pass 1. Count the ZBuffer pixel formats
- hRes = IDirect3D3_EnumZBufferFormats(
- lpD3D3,
- &glb.d3dGuid,
- d3dEnumZBufferFormatsCallback,
- NULL);
-
- if (FAILED(hRes))
- goto clean_up;
-
- if (glb.nZBufferPFCount) {
- glb.lpZBufferPF = (DDPIXELFORMAT *)calloc(glb.nZBufferPFCount,
- sizeof(DDPIXELFORMAT));
- if(glb.lpZBufferPF == NULL)
- goto clean_up;
-
- // Pass 2. Cache the ZBuffer pixel formats
- iEnumCount = 0; // (Used by the enum function)
- hRes = IDirect3D3_EnumZBufferFormats(
- lpD3D3,
- &glb.d3dGuid,
- d3dEnumZBufferFormatsCallback,
- glb.lpZBufferPF);
-
- if (FAILED(hRes))
- goto clean_up;
- }
-
- // Remove stencil support for boards which don't work for AutoCAD;
- // Matrox G400 does not work, but NVidia TNT2 and ATI Rage128 do... (DaveM)
- if (IsStencilSupportBroken(lpDD4)) {
- for (i=0; i<iEnumCount; i++)
- if (glb.lpZBufferPF[i].dwFlags & DDPF_STENCILBUFFER)
- glb.nZBufferPFCount--;
- }
-
- // One each for every ZBuffer pixel format (including no depth buffer)
- // Times-two because duplicated for single buffering (as opposed to double)
- glb.nPixelFormatCount = 2 * (glb.nZBufferPFCount + 1);
- glb.lpPF = (DGL_pixelFormat *)calloc(glb.nPixelFormatCount,
- sizeof(DGL_pixelFormat));
- if (glb.lpPF == NULL)
- goto clean_up;
- //
- // Fill in the pixel formats
- // Note: Depth buffer bits are really (dwZBufferBitDepth-dwStencilBitDepth)
- // but this will pass wierd numbers to the OpenGL app. (?)
- //
-
- pfTemplateHW.pfd.iPixelType = dwPixelType;
- pfTemplateHW.pfd.cColorBits = dwDisplayBitDepth;
- pfTemplateHW.pfd.cRedBits = dwRb;
- pfTemplateHW.pfd.cGreenBits = dwGb;
- pfTemplateHW.pfd.cBlueBits = dwBb;
- pfTemplateHW.pfd.cAlphaBits = dwAb;
- pfTemplateHW.pfd.cRedShift = dwRs;
- pfTemplateHW.pfd.cGreenShift = dwGs;
- pfTemplateHW.pfd.cBlueShift = dwBs;
- pfTemplateHW.pfd.cAlphaShift = dwAs;
-
- lpPF = glb.lpPF;
-
- // Fill in the double-buffered pixel formats
- for (i=0; i<(glb.nZBufferPFCount + 1); i++, lpPF++) {
- memcpy(lpPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- if (i) {
- lpPF->iZBufferPF = i-1;
- lpPF->pfd.cDepthBits = glb.lpZBufferPF[i-1].dwZBufferBitDepth;
- lpPF->pfd.cStencilBits = glb.lpZBufferPF[i-1].dwStencilBitDepth;
- }
- }
- // Fill in the single-buffered pixel formats
- for (i=0; i<(glb.nZBufferPFCount + 1); i++, lpPF++) {
- memcpy(lpPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- if (i) {
- lpPF->iZBufferPF = i-1;
- lpPF->pfd.cDepthBits = glb.lpZBufferPF[i-1].dwZBufferBitDepth;
- lpPF->pfd.cStencilBits = glb.lpZBufferPF[i-1].dwStencilBitDepth;
- }
- // Remove double-buffer flag. Could use XOR instead...
- lpPF->pfd.dwFlags &= (~(PFD_DOUBLEBUFFER));
- // Insert GDI flag for single buffered format only.
- lpPF->pfd.dwFlags |= PFD_SUPPORT_GDI;
- }
-#endif // _USE_GLD3_WGL
-
- // Lets dump the list to the log
- // ** Based on "wglinfo" by Nate Robins **
- ddlogMessage(DDLOG_INFO, "\n");
- ddlogMessage(DDLOG_INFO, "Pixel Formats:\n");
- ddlogMessage(DDLOG_INFO,
- " visual x bf lv rg d st r g b a ax dp st accum buffs ms\n");
- ddlogMessage(DDLOG_INFO,
- " id dep cl sp sz l ci b ro sz sz sz sz bf th cl r g b a ns b\n");
- ddlogMessage(DDLOG_INFO,
- "-----------------------------------------------------------------\n");
- for (i=0, lpPF = glb.lpPF; i<glb.nPixelFormatCount; i++, lpPF++) {
- sprintf(buf, "0x%02x ", i+1);
-
- sprintf(cat, "%2d ", lpPF->pfd.cColorBits);
- strcat(buf, cat);
- if(lpPF->pfd.dwFlags & PFD_DRAW_TO_WINDOW) sprintf(cat, "wn ");
- else if(lpPF->pfd.dwFlags & PFD_DRAW_TO_BITMAP) sprintf(cat, "bm ");
- else sprintf(cat, ". ");
- strcat(buf, cat);
-
- /* should find transparent pixel from LAYERPLANEDESCRIPTOR */
- sprintf(cat, " . ");
- strcat(buf, cat);
-
- sprintf(cat, "%2d ", lpPF->pfd.cColorBits);
- strcat(buf, cat);
-
- /* bReserved field indicates number of over/underlays */
- if(lpPF->pfd.bReserved) sprintf(cat, " %d ", lpPF->pfd.bReserved);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- sprintf(cat, " %c ", lpPF->pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : 'c');
- strcat(buf, cat);
-
- sprintf(cat, "%c ", lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.');
- strcat(buf, cat);
-
- sprintf(cat, " %c ", lpPF->pfd.dwFlags & PFD_STEREO ? 'y' : '.');
- strcat(buf, cat);
-
- if(lpPF->pfd.cRedBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", lpPF->pfd.cRedBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cGreenBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", lpPF->pfd.cGreenBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cBlueBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", lpPF->pfd.cBlueBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cAlphaBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", lpPF->pfd.cAlphaBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cAuxBuffers) sprintf(cat, "%2d ", lpPF->pfd.cAuxBuffers);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cDepthBits) sprintf(cat, "%2d ", lpPF->pfd.cDepthBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cStencilBits) sprintf(cat, "%2d ", lpPF->pfd.cStencilBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cAccumRedBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumRedBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cAccumGreenBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumGreenBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cAccumBlueBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumBlueBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(lpPF->pfd.cAccumAlphaBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumAlphaBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- /* no multisample in Win32 */
- sprintf(cat, " . .\n");
- strcat(buf, cat);
-
- ddlogMessage(DDLOG_INFO, buf);
- }
- ddlogMessage(DDLOG_INFO,
- "-----------------------------------------------------------------\n");
- ddlogMessage(DDLOG_INFO, "\n");
-
-#ifndef _USE_GLD3_WGL
-clean_up:
- // Release COM objects
- RELEASE(lpD3D3);
- RELEASE(lpDD4);
- RELEASE(lpDD1);
-
- // Popup warning message if non RGB color mode
- if (dwDisplayBitDepth <= 8) {
- ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth);
- MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING);
- }
-#endif // _USE_GLD3_WGL
-}
-
-// ***********************************************************************
-
-void dglReleasePixelFormatList()
-{
- glb.nPixelFormatCount = 0;
- if (glb.lpPF) {
- free(glb.lpPF);
- glb.lpPF = NULL;
- }
-#ifndef _USE_GLD3_WGL
- glb.nZBufferPFCount = 0;
- if (glb.lpZBufferPF) {
- free(glb.lpZBufferPF);
- glb.lpZBufferPF = NULL;
- }
- glb.nDisplayModeCount = 0;
- if (glb.lpDisplayModes) {
- free(glb.lpDisplayModes);
- glb.lpDisplayModes = NULL;
- }
-#endif // _USE_GLD3_WGL
-}
-
-// ***********************************************************************
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglpf.h b/mesalib/src/mesa/drivers/windows/gldirect/dglpf.h
deleted file mode 100644
index 8a7e38c4b..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglpf.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Pixel Formats.
-*
-****************************************************************************/
-
-#ifndef __DGLPF_H
-#define __DGLPF_H
-
-#ifndef STRICT
-#define STRICT
-#endif // STRICT
-#define WIN32_LEAN_AND_MEAN
-
-#include <windows.h>
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-typedef struct {
- PIXELFORMATDESCRIPTOR pfd; // Win32 Pixel Format Descriptor
-#ifdef _USE_GLD3_WGL
- // Driver-specific data.
- // Example: The DX8 driver uses this to hold an index into a
- // list of depth-stencil descriptions.
- DWORD dwDriverData;
-#else
- int iZBufferPF; // Index of depth buffer pixel format
-#endif
-} DGL_pixelFormat;
-
-#include "dglglobals.h"
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-BOOL IsValidPFD(int iPFD);
-void dglBuildPixelFormatList();
-void dglReleasePixelFormatList();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglwgl.c b/mesalib/src/mesa/drivers/windows/gldirect/dglwgl.c
deleted file mode 100644
index 37e681dfc..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglwgl.c
+++ /dev/null
@@ -1,2964 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: OpenGL window functions (wgl*).
-*
-****************************************************************************/
-
-#include "dglwgl.h"
-#ifdef _USE_GLD3_WGL
-#include "gld_driver.h"
-#endif
-
-#include "gl/glu.h" // MUST USE MICROSOFT'S GLU32!
-
-#ifndef _USE_GLD3_WGL
-extern DGL_mesaFuncs mesaFuncs;
-#endif
-
-// Need to export wgl* functions if using GLD3,
-// otherwise export GLD2 DGL_* functions.
-#ifdef _USE_GLD3_WGL
-#define _GLD_WGL_EXPORT(a) wgl##a
-#else
-#define _GLD_WGL_EXPORT(a) DGL_##a
-#endif
-
-// Calls into Mesa 4.x are different
-#ifdef _USE_GLD3_WGL
-#include "dlist.h"
-#include "drawpix.h"
-#include "get.h"
-#include "matrix.h"
-// NOTE: All the _GLD* macros now call the gl* functions direct.
-// This ensures that the correct internal pathway is taken. KeithH
-#define _GLD_glNewList glNewList
-#define _GLD_glBitmap glBitmap
-#define _GLD_glEndList glEndList
-#define _GLD_glDeleteLists glDeleteLists
-#define _GLD_glGetError glGetError
-#define _GLD_glTranslatef glTranslatef
-#define _GLD_glBegin glBegin
-#define _GLD_glVertex2fv glVertex2fv
-#define _GLD_glEnd glEnd
-#define _GLD_glNormal3f glNormal3f
-#define _GLD_glVertex3f glVertex3f
-#define _GLD_glVertex3fv glVertex3fv
-#else // _USE_GLD3_WGL
-#define _GLD_glNewList (*mesaFuncs.glNewList)
-#define _GLD_glBitmap (*mesaFuncs.glBitmap)
-#define _GLD_glEndList (*mesaFuncs.glEndList)
-#define _GLD_glDeleteLists (*mesaFuncs.glDeleteLists)
-#define _GLD_glGetError (*mesaFuncs.glGetError)
-#define _GLD_glTranslatef (*mesaFuncs.glTranslatef)
-#define _GLD_glBegin (*mesaFuncs.glBegin)
-#define _GLD_glVertex2fv (*mesaFuncs.glVertex2fv)
-#define _GLD_glEnd (*mesaFuncs.glEnd)
-#define _GLD_glNormal3f (*mesaFuncs.glNormal3f)
-#define _GLD_glVertex3f (*mesaFuncs.glVertex3f)
-#define _GLD_glVertex3fv (*mesaFuncs.glVertex3fv)
-#endif // _USE_GLD3_WGL
-
-// ***********************************************************************
-
-// Emulate SGI DDK calls.
-#define __wglMalloc(a) GlobalAlloc(GPTR, (a))
-#define __wglFree(a) GlobalFree((a))
-
-// ***********************************************************************
-
-// Mesa glu.h and MS glu.h call these different things...
-//#define GLUtesselator GLUtriangulatorObj
-//#define GLU_TESS_VERTEX_DATA GLU_VERTEX_DATA
-
-// For wglFontOutlines
-
-typedef GLUtesselator *(APIENTRY *gluNewTessProto)(void);
-typedef void (APIENTRY *gluDeleteTessProto)(GLUtesselator *tess);
-typedef void (APIENTRY *gluTessBeginPolygonProto)(GLUtesselator *tess, void *polygon_data);
-typedef void (APIENTRY *gluTessBeginContourProto)(GLUtesselator *tess);
-typedef void (APIENTRY *gluTessVertexProto)(GLUtesselator *tess, GLdouble coords[3], void *data);
-typedef void (APIENTRY *gluTessEndContourProto)(GLUtesselator *tess);
-typedef void (APIENTRY *gluTessEndPolygonProto)(GLUtesselator *tess);
-typedef void (APIENTRY *gluTessPropertyProto)(GLUtesselator *tess, GLenum which, GLdouble value);
-typedef void (APIENTRY *gluTessNormalProto)(GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRY *gluTessCallbackProto)(GLUtesselator *tess, GLenum which, void (CALLBACK *)());
-
-static HINSTANCE gluModuleHandle;
-static gluNewTessProto gluNewTessProc;
-static gluDeleteTessProto gluDeleteTessProc;
-static gluTessBeginPolygonProto gluTessBeginPolygonProc;
-static gluTessBeginContourProto gluTessBeginContourProc;
-static gluTessVertexProto gluTessVertexProc;
-static gluTessEndContourProto gluTessEndContourProc;
-static gluTessEndPolygonProto gluTessEndPolygonProc;
-static gluTessPropertyProto gluTessPropertyProc;
-static gluTessNormalProto gluTessNormalProc;
-static gluTessCallbackProto gluTessCallbackProc;
-
-static HFONT hNewFont, hOldFont;
-static FLOAT ScaleFactor;
-
-#define LINE_BUF_QUANT 4000
-#define VERT_BUF_QUANT 4000
-
-static FLOAT* LineBuf;
-static DWORD LineBufSize;
-static DWORD LineBufIndex;
-static FLOAT* VertBuf;
-static DWORD VertBufSize;
-static DWORD VertBufIndex;
-static GLenum TessErrorOccurred;
-
-static int AppendToLineBuf(
- FLOAT value);
-
-static int AppendToVertBuf(
- FLOAT value);
-
-static int DrawGlyph(
- UCHAR* glyphBuf,
- DWORD glyphSize,
- FLOAT chordalDeviation,
- FLOAT extrusion,
- INT format);
-
-static void FreeLineBuf(void);
-
-static void FreeVertBuf(void);
-
-static long GetWord(
- UCHAR** p);
-
-static long GetDWord(
- UCHAR** p);
-
-static double GetFixed(
- UCHAR** p);
-
-static int InitLineBuf(void);
-
-static int InitVertBuf(void);
-
-static HFONT CreateHighResolutionFont(
- HDC hDC);
-
-static int MakeDisplayListFromGlyph(
- DWORD listName,
- UCHAR* glyphBuf,
- DWORD glyphSize,
- LPGLYPHMETRICSFLOAT glyphMetricsFloat,
- FLOAT chordalDeviation,
- FLOAT extrusion,
- INT format);
-
-static BOOL LoadGLUTesselator(void);
-static BOOL UnloadGLUTesselator(void);
-
-static int MakeLinesFromArc(
- FLOAT x0,
- FLOAT y0,
- FLOAT x1,
- FLOAT y1,
- FLOAT x2,
- FLOAT y2,
- DWORD vertexCountIndex,
- FLOAT chordalDeviationSquared);
-
-static int MakeLinesFromGlyph( UCHAR* glyphBuf,
- DWORD glyphSize,
- FLOAT chordalDeviation);
-
-static int MakeLinesFromTTLine( UCHAR** pp,
- DWORD vertexCountIndex,
- WORD pointCount);
-
-static int MakeLinesFromTTPolycurve( UCHAR** pp,
- DWORD vertexCountIndex,
- FLOAT chordalDeviation);
-
-static int MakeLinesFromTTPolygon( UCHAR** pp,
- FLOAT chordalDeviation);
-
-static int MakeLinesFromTTQSpline( UCHAR** pp,
- DWORD vertexCountIndex,
- WORD pointCount,
- FLOAT chordalDeviation);
-
-static void CALLBACK TessCombine( double coords[3],
- void* vertex_data[4],
- FLOAT weight[4],
- void** outData);
-
-static void CALLBACK TessError( GLenum error);
-
-static void CALLBACK TessVertexOutData( FLOAT p[3],
- GLfloat z);
-
-// ***********************************************************************
-
-#ifdef GLD_THREADS
-#pragma message("compiling DGLWGL.C vars for multi-threaded support")
-extern CRITICAL_SECTION CriticalSection;
-extern DWORD dwTLSPixelFormat; // TLS index for current pixel format
-#endif
-int curPFD = 0; // Current PFD (static)
-
-// ***********************************************************************
-
-int dglGetPixelFormat(void)
-{
-#ifdef GLD_THREADS
- int iPixelFormat;
- // get thread-specific instance
- if (glb.bMultiThreaded) {
- __try {
- iPixelFormat = (int)TlsGetValue(dwTLSPixelFormat);
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- iPixelFormat = curPFD;
- }
- }
- // get global static var
- else {
- iPixelFormat = curPFD;
- }
- return iPixelFormat;
-#else
- return curPFD;
-#endif
-}
-
-// ***********************************************************************
-
-void dglSetPixelFormat(int iPixelFormat)
-{
-#ifdef GLD_THREADS
- // set thread-specific instance
- if (glb.bMultiThreaded) {
- __try {
- TlsSetValue(dwTLSPixelFormat, (LPVOID)iPixelFormat);
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- curPFD = iPixelFormat;
- }
- }
- // set global static var
- else {
- curPFD = iPixelFormat;
- }
-#else
- curPFD = iPixelFormat;
-#endif
-}
-
-// ***********************************************************************
-
-int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)(
- HDC a,
- CONST PIXELFORMATDESCRIPTOR *ppfd)
-{
- DGL_pixelFormat *lpPF = glb.lpPF;
-
- PIXELFORMATDESCRIPTOR ppfdBest;
- int i;
- int bestIndex = -1;
- int numPixelFormats;
- DWORD dwFlags;
-
- char buf[128];
- char cat[8];
-
- DWORD dwAllFlags =
- PFD_DRAW_TO_WINDOW |
- PFD_DRAW_TO_BITMAP |
- PFD_SUPPORT_GDI |
- PFD_SUPPORT_OPENGL |
- PFD_GENERIC_FORMAT |
- PFD_NEED_PALETTE |
- PFD_NEED_SYSTEM_PALETTE |
- PFD_DOUBLEBUFFER |
- PFD_STEREO |
- /*PFD_SWAP_LAYER_BUFFERS |*/
- PFD_DOUBLEBUFFER_DONTCARE |
- PFD_STEREO_DONTCARE |
- PFD_SWAP_COPY |
- PFD_SWAP_EXCHANGE |
- PFD_GENERIC_ACCELERATED |
- 0;
-
- // Validate license
- if (!dglValidate())
- return 0;
-
- // List may not be built until dglValidate() is called! KeithH
- lpPF = glb.lpPF;
-
- //
- // Lets print the input pixel format to the log
- // ** Based on "wglinfo" by Nate Robins **
- //
- ddlogMessage(DDLOG_SYSTEM, "ChoosePixelFormat:\n");
- ddlogMessage(DDLOG_INFO, "Input pixel format for ChoosePixelFormat:\n");
- ddlogMessage(DDLOG_INFO,
- " visual x bf lv rg d st r g b a ax dp st accum buffs ms\n");
- ddlogMessage(DDLOG_INFO,
- " id dep cl sp sz l ci b ro sz sz sz sz bf th cl r g b a ns b\n");
- ddlogMessage(DDLOG_INFO,
- "-----------------------------------------------------------------\n");
- sprintf(buf, " . ");
-
- sprintf(cat, "%2d ", ppfd->cColorBits);
- strcat(buf, cat);
- if(ppfd->dwFlags & PFD_DRAW_TO_WINDOW) sprintf(cat, "wn ");
- else if(ppfd->dwFlags & PFD_DRAW_TO_BITMAP) sprintf(cat, "bm ");
- else sprintf(cat, ". ");
- strcat(buf, cat);
-
- /* should find transparent pixel from LAYERPLANEDESCRIPTOR */
- sprintf(cat, " . ");
- strcat(buf, cat);
-
- sprintf(cat, "%2d ", ppfd->cColorBits);
- strcat(buf, cat);
-
- /* bReserved field indicates number of over/underlays */
- if(ppfd->bReserved) sprintf(cat, " %d ", ppfd->bReserved);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- sprintf(cat, " %c ", ppfd->iPixelType == PFD_TYPE_RGBA ? 'r' : 'c');
- strcat(buf, cat);
-
- sprintf(cat, "%c ", ppfd->dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.');
- strcat(buf, cat);
-
- sprintf(cat, " %c ", ppfd->dwFlags & PFD_STEREO ? 'y' : '.');
- strcat(buf, cat);
-
- if(ppfd->cRedBits && ppfd->iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", ppfd->cRedBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cGreenBits && ppfd->iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", ppfd->cGreenBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cBlueBits && ppfd->iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", ppfd->cBlueBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cAlphaBits && ppfd->iPixelType == PFD_TYPE_RGBA)
- sprintf(cat, "%2d ", ppfd->cAlphaBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cAuxBuffers) sprintf(cat, "%2d ", ppfd->cAuxBuffers);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cDepthBits) sprintf(cat, "%2d ", ppfd->cDepthBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cStencilBits) sprintf(cat, "%2d ", ppfd->cStencilBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cAccumRedBits) sprintf(cat, "%2d ", ppfd->cAccumRedBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cAccumGreenBits) sprintf(cat, "%2d ", ppfd->cAccumGreenBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cAccumBlueBits) sprintf(cat, "%2d ", ppfd->cAccumBlueBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- if(ppfd->cAccumAlphaBits) sprintf(cat, "%2d ", ppfd->cAccumAlphaBits);
- else sprintf(cat, " . ");
- strcat(buf, cat);
-
- /* no multisample in Win32 */
- sprintf(cat, " . .\n");
- strcat(buf, cat);
-
- ddlogMessage(DDLOG_INFO, buf);
- ddlogMessage(DDLOG_INFO,
- "-----------------------------------------------------------------\n");
- ddlogMessage(DDLOG_INFO, "\n");
-
- //
- // Examine the flags for correctness
- //
- dwFlags = ppfd->dwFlags;
- if (dwFlags != (dwFlags & dwAllFlags))
- {
- /* error: bad dwFlags */
- ddlogPrintf(DDLOG_WARN,
- "ChoosePixelFormat: bad flags (0x%x)",
- dwFlags & (~dwAllFlags));
- // Mask illegal flags and continue
- dwFlags = dwFlags & dwAllFlags;
- }
-
- switch (ppfd->iPixelType) {
- case PFD_TYPE_RGBA:
- case PFD_TYPE_COLORINDEX:
- break;
- default:
- /* error: bad iPixelType */
- ddlogMessage(DDLOG_WARN, "ChoosePixelFormat: bad pixel type\n");
- return 0;
- }
-
- switch (ppfd->iLayerType) {
- case PFD_MAIN_PLANE:
- case PFD_OVERLAY_PLANE:
- case PFD_UNDERLAY_PLANE:
- break;
- default:
- /* error: bad iLayerType */
- ddlogMessage(DDLOG_WARN, "ChoosePixelFormat: bad layer type\n");
- return 0;
- }
-
- numPixelFormats = glb.nPixelFormatCount;
-
- /* loop through candidate pixel format descriptors */
- for (i=0; i<numPixelFormats; ++i) {
- PIXELFORMATDESCRIPTOR ppfdCandidate;
-
- memcpy(&ppfdCandidate, &lpPF[i].pfd, sizeof(PIXELFORMATDESCRIPTOR));
-
- /*
- ** Check attributes which must match
- */
- if (ppfd->iPixelType != ppfdCandidate.iPixelType) {
- continue;
- }
-
- if (ppfd->iLayerType != ppfdCandidate.iLayerType) {
- continue;
- }
-
- if (((dwFlags ^ ppfdCandidate.dwFlags) & dwFlags) &
- (PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP |
- PFD_SUPPORT_GDI | PFD_SUPPORT_OPENGL))
- {
- continue;
- }
-
- if (!(dwFlags & PFD_DOUBLEBUFFER_DONTCARE)) {
- if ((dwFlags & PFD_DOUBLEBUFFER) !=
- (ppfdCandidate.dwFlags & PFD_DOUBLEBUFFER))
- {
- continue;
- }
- }
-
-// if (!(dwFlags & PFD_STEREO_DONTCARE)) {
- if ((dwFlags & PFD_STEREO) !=
- (ppfdCandidate.dwFlags & PFD_STEREO))
- {
- continue;
- }
-// }
-
- if (ppfd->iPixelType==PFD_TYPE_RGBA
- && ppfd->cAlphaBits && !ppfdCandidate.cAlphaBits) {
- continue;
- }
-
- if (ppfd->iPixelType==PFD_TYPE_RGBA
- && ppfd->cAccumBits && !ppfdCandidate.cAccumBits) {
- continue;
- }
-
- if (ppfd->cDepthBits && !ppfdCandidate.cDepthBits) {
- continue;
- }
-
- if (ppfd->cStencilBits && !ppfdCandidate.cStencilBits) {
- continue;
- }
-
- if (ppfd->cAuxBuffers && !ppfdCandidate.cAuxBuffers) {
- continue;
- }
-
- /*
- ** See if candidate is better than the previous best choice
- */
- if (bestIndex == -1) {
- ppfdBest = ppfdCandidate;
- bestIndex = i;
- continue;
- }
-
- if ((ppfd->cColorBits > ppfdBest.cColorBits &&
- ppfdCandidate.cColorBits > ppfdBest.cColorBits) ||
- (ppfd->cColorBits <= ppfdCandidate.cColorBits &&
- ppfdCandidate.cColorBits < ppfdBest.cColorBits))
- {
- ppfdBest = ppfdCandidate;
- bestIndex = i;
- continue;
- }
-
- if (ppfd->iPixelType==PFD_TYPE_RGBA
- && ppfd->cAlphaBits
- && ppfdCandidate.cAlphaBits > ppfdBest.cAlphaBits)
- {
- ppfdBest = ppfdCandidate;
- bestIndex = i;
- continue;
- }
-
- if (ppfd->iPixelType==PFD_TYPE_RGBA
- && ppfd->cAccumBits
- && ppfdCandidate.cAccumBits > ppfdBest.cAccumBits)
- {
- ppfdBest = ppfdCandidate;
- bestIndex = i;
- continue;
- }
-
- if ((ppfd->cDepthBits > ppfdBest.cDepthBits &&
- ppfdCandidate.cDepthBits > ppfdBest.cDepthBits) ||
- (ppfd->cDepthBits <= ppfdCandidate.cDepthBits &&
- ppfdCandidate.cDepthBits < ppfdBest.cDepthBits))
- {
- ppfdBest = ppfdCandidate;
- bestIndex = i;
- continue;
- }
-
- if (ppfd->cStencilBits &&
- ppfdCandidate.cStencilBits > ppfdBest.cStencilBits)
- {
- ppfdBest = ppfdCandidate;
- bestIndex = i;
- continue;
- }
-
- if (ppfd->cAuxBuffers &&
- ppfdCandidate.cAuxBuffers > ppfdBest.cAuxBuffers)
- {
- ppfdBest = ppfdCandidate;
- bestIndex = i;
- continue;
- }
- }
-
- if (bestIndex != -1) {
- ddlogPrintf(DDLOG_SYSTEM, "Pixel Format %d chosen as best match", bestIndex+1);
- return bestIndex + 1;
- }
-
- // Return the pixelformat that has the most capabilities.
- // ** NOTE: This is only possible due to the way the list
- // of pixelformats is built. **
- // Now picks best pixelformat. KeithH
- bestIndex = numPixelFormats; // most capable double buffer format
- ddlogPrintf(DDLOG_SYSTEM, "Pixel Format %d chosen by default", bestIndex);
- return (bestIndex);
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(CopyContext)(
- HGLRC a,
- HGLRC b,
- UINT c)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
- UNSUPPORTED("wglCopyContext")
- return FALSE; // Failed
-}
-
-// ***********************************************************************
-
-HGLRC APIENTRY _GLD_WGL_EXPORT(CreateContext)(
- HDC a)
-{
- int ipf;
-
- // Validate license
- if (!dglValidate())
- return 0;
-
- // Check that the current PFD is valid
- ipf = dglGetPixelFormat();
- if (!IsValidPFD(ipf))
- return (HGLRC)0;
-
- return dglCreateContext(a, &glb.lpPF[ipf-1]);
-}
-
-// ***********************************************************************
-
-HGLRC APIENTRY _GLD_WGL_EXPORT(CreateLayerContext)(
- HDC a,
- int b)
-{
- // Validate license
- if (!dglValidate())
- return 0;
-
- UNSUPPORTED("wglCreateLayerContext")
- return NULL; // Failed
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(DeleteContext)(
- HGLRC a)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- return dglDeleteContext(a);
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(DescribeLayerPlane)(
- HDC hDC,
- int iPixelFormat,
- int iLayerPlane,
- UINT nBytes,
- LPLAYERPLANEDESCRIPTOR plpd)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- UNSUPPORTED("DGL_DescribeLayerPlane")
-
-// gldLogPrintf(GLDLOG_INFO, "DescribeLayerPlane: %d, %d", iPixelFormat, iLayerPlane);
-
- return FALSE;
-}
-
-// ***********************************************************************
-
-int APIENTRY _GLD_WGL_EXPORT(DescribePixelFormat)(
- HDC a,
- int b,
- UINT c,
- LPPIXELFORMATDESCRIPTOR d)
-{
- UINT nSize;
-
- // Validate license
- if (!dglValidate())
- return 0;
-
- if (d == NULL) // Calling app requires max number of PF's
- return glb.nPixelFormatCount;
-
- // The supplied buffer may be larger than the info that we
- // will be copying.
- if (c > sizeof(PIXELFORMATDESCRIPTOR))
- nSize = sizeof(PIXELFORMATDESCRIPTOR);
- else
- nSize = c;
-
- // Setup an empty PFD before doing validation check
- memset(d, 0, nSize);
- d->nSize = nSize;
- d->nVersion = 1;
-
- if (!IsValidPFD(b))
- return 0; // Bail if PFD index is invalid
-
- memcpy(d, &glb.lpPF[b-1].pfd, nSize);
-
- return glb.nPixelFormatCount;
-}
-
-// ***********************************************************************
-
-HGLRC APIENTRY _GLD_WGL_EXPORT(GetCurrentContext)(void)
-{
- // Validate license
- if (!dglValidate())
- return 0;
-
- return dglGetCurrentContext();
-}
-
-// ***********************************************************************
-
-HDC APIENTRY _GLD_WGL_EXPORT(GetCurrentDC)(void)
-{
- // Validate license
- if (!dglValidate())
- return 0;
-
- return dglGetCurrentDC();
-}
-
-// ***********************************************************************
-
-PROC APIENTRY _GLD_WGL_EXPORT(GetDefaultProcAddress)(
- LPCSTR a)
-{
- // Validate license
- if (!dglValidate())
- return NULL;
-
- UNSUPPORTED("DGL_GetDefaultProcAddress")
- return NULL;
-}
-
-// ***********************************************************************
-
-int APIENTRY _GLD_WGL_EXPORT(GetLayerPaletteEntries)(
- HDC a,
- int b,
- int c,
- int d,
- COLORREF *e)
-{
- // Validate license
- if (!dglValidate())
- return 0;
-
- UNSUPPORTED("DGL_GetLayerPaletteEntries")
- return 0;
-}
-
-// ***********************************************************************
-
-int APIENTRY _GLD_WGL_EXPORT(GetPixelFormat)(
- HDC a)
-{
- // Validate license
- if (!dglValidate())
- return 0;
-
- return dglGetPixelFormat();
-}
-
-// ***********************************************************************
-
-PROC APIENTRY _GLD_WGL_EXPORT(GetProcAddress)(
- LPCSTR a)
-{
- PROC dglGetProcAddressD3D(LPCSTR a);
-
- // Validate license
- if (!dglValidate())
- return NULL;
-
-#ifdef _USE_GLD3_WGL
- return _gldDriver.wglGetProcAddress(a);
-#else
- return dglGetProcAddressD3D(a);
-#endif
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(MakeCurrent)(
- HDC a,
- HGLRC b)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- return dglMakeCurrent(a, b);
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(RealizeLayerPalette)(
- HDC a,
- int b,
- BOOL c)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- UNSUPPORTED("DGL_RealizeLayerPalette")
- return FALSE;
-}
-
-// ***********************************************************************
-
-int APIENTRY _GLD_WGL_EXPORT(SetLayerPaletteEntries)(
- HDC a,
- int b,
- int c,
- int d,
- CONST COLORREF *e)
-{
- // Validate license
- if (!dglValidate())
- return 0;
-
- UNSUPPORTED("DGL_SetLayerPaletteEntries")
- return 0;
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(SetPixelFormat)(
- HDC a,
- int b,
- CONST PIXELFORMATDESCRIPTOR *c)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- if (IsValidPFD(b)) {
- ddlogPrintf(DDLOG_SYSTEM, "SetPixelFormat: PixelFormat %d has been set", b);
- dglSetPixelFormat(b);
- return TRUE;
- } else {
- ddlogPrintf(DDLOG_ERROR,
- "SetPixelFormat: PixelFormat %d is invalid and cannot be set", b);
- return FALSE;
- }
-}
-
-// ***********************************************************************
-/*
- * Share lists between two gl_context structures.
- * This was added for WIN32 WGL function support, since wglShareLists()
- * must be called *after* wglCreateContext() with valid GLRCs. (DaveM)
- */
-//
-// Copied from GLD2.x. KeithH
-//
-static GLboolean _gldShareLists(
- struct gl_context *ctx1,
- struct gl_context *ctx2)
-{
- /* Sanity check context pointers */
- if (ctx1 == NULL || ctx2 == NULL)
- return GL_FALSE;
- /* Sanity check shared list pointers */
- if (ctx1->Shared == NULL || ctx2->Shared == NULL)
- return GL_FALSE;
- /* Decrement reference count on sharee to release previous list */
- ctx2->Shared->RefCount--;
-#if 0 /* 3DStudio exits on this memory release */
- if (ctx2->Shared->RefCount == 0)
- free_shared_state(ctx2, ctx2->Shared);
-#endif
- /* Re-assign list from sharer to sharee and increment reference count */
- ctx2->Shared = ctx1->Shared;
- ctx1->Shared->RefCount++;
- return GL_TRUE;
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(ShareLists)(
- HGLRC a,
- HGLRC b)
-{
- DGL_ctx *dgl1, *dgl2;
-
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- // Mesa supports shared lists, but you need to supply the shared
- // GL context info when calling gl_create_context(). An auxiliary
- // function gl_share_lists() has been added to update the shared
- // list info after the GL contexts have been created. (DaveM)
- dgl1 = dglGetContextAddress(a);
- dgl2 = dglGetContextAddress(b);
- if (dgl1->bAllocated && dgl2->bAllocated) {
-#ifdef _USE_GLD3_WGL
- return _gldShareLists(dgl1->glCtx, dgl2->glCtx);
-#else
- return (*mesaFuncs.gl_share_lists)(dgl1->glCtx, dgl2->glCtx);
-#endif
- }
- return FALSE;
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(SwapBuffers)(
- HDC a)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- return dglSwapBuffers(a);
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(SwapLayerBuffers)(
- HDC a,
- UINT b)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- return dglSwapBuffers(a);
-}
-
-// ***********************************************************************
-
-// ***********************************************************************
-// Note: This ResizeBuffers() function may be called from
-// either MESA glViewport() or GLD wglMakeCurrent().
-
-BOOL dglWglResizeBuffers(
- struct gl_context *ctx,
- BOOL bDefaultDriver)
-{
- DGL_ctx *dgl = NULL;
- RECT rcScreenRect;
- DWORD dwWidth;
- DWORD dwHeight;
- DDSURFACEDESC2 ddsd2;
- DDSCAPS2 ddscaps2;
- IDirectDrawClipper *lpddClipper = NULL;
- DWORD dwFlags;
- HRESULT hResult;
-
- DWORD dwMemoryType;
-
- int i;
- struct gl_texture_object *tObj;
- struct gl_texture_image *image;
-
- BOOL bWasFullscreen;
- BOOL bSaveDesktop;
- BOOL bFullScrnWin = FALSE;
- DDSURFACEDESC2 ddsd2DisplayMode;
-
- DDBLTFX ddbltfx;
- POINT pt;
- RECT rcDst;
-#ifdef _USE_GLD3_WGL
- GLD_displayMode glddm;
-#endif
-
-#define DDLOG_CRITICAL_OR_WARN (bDefaultDriver ? DDLOG_WARN : DDLOG_CRITICAL)
-
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- // Sanity checks
- if (ctx == NULL)
- return FALSE;
- dgl = ctx->DriverCtx;
- if (dgl == NULL)
- return FALSE;
-
- // Get the window size and calculate its dimensions
- if (dgl->hWnd == NULL) {
- // Check for non-window DC = memory DC ?
- if (GetClipBox(dgl->hDC, &rcScreenRect) == ERROR)
- SetRect(&rcScreenRect, 0, 0, 0, 0);
- }
- else if (!GetClientRect(dgl->hWnd, &rcScreenRect))
- SetRect(&rcScreenRect, 0, 0, 0, 0);
- dwWidth = rcScreenRect.right - rcScreenRect.left;
- dwHeight = rcScreenRect.bottom - rcScreenRect.top;
- CopyRect(&dgl->rcScreenRect, &rcScreenRect);
-
- // This will occur on Alt-Tab
- if ((dwWidth == 0) && (dwHeight == 0)) {
- //dgl->bCanRender = FALSE;
- return TRUE; // No resize possible!
- }
-
- // Some apps zero only 1 dimension for non-visible window... (DaveM)
- if ((dwWidth == 0) || (dwHeight == 0)) {
- dwWidth = 8;
- dwHeight = 8;
- }
-
- // Test to see if a resize is required.
- // Note that the dimensions will be the same if a prior resize attempt failed.
- if ((dwWidth == dgl->dwWidth) && (dwHeight == dgl->dwHeight) && bDefaultDriver) {
- return TRUE; // No resize required
- }
-
- ddlogPrintf(DDLOG_SYSTEM, "dglResize: %dx%d", dwWidth, dwHeight);
-#ifndef _USE_GLD3_WGL
- // Work out where we want our surfaces created
- dwMemoryType = (bDefaultDriver) ? glb.dwMemoryType : DDSCAPS_SYSTEMMEMORY;
-#endif // _USE_GLD3_WGL
-
- // Note previous fullscreen vs window display status
- bWasFullscreen = dgl->bFullscreen;
-
-#ifdef _USE_GLD3_WGL
- if (_gldDriver.GetDisplayMode(dgl, &glddm)) {
- if ( (dwWidth == glddm.Width) &&
- (dwHeight == glddm.Height) ) {
- bFullScrnWin = TRUE;
- }
- if (bFullScrnWin && glb.bPrimary && !glb.bFullscreenBlit && !glb.bDirectDrawPersistant) {
- dgl->bFullscreen = TRUE;
- ddlogMessage(DDLOG_INFO, "Fullscreen window after resize.\n");
- }
- else {
- dgl->bFullscreen = FALSE;
- ddlogMessage(DDLOG_INFO, "Non-Fullscreen window after resize.\n");
- }
- // Cache the display mode dimensions
- dgl->dwModeWidth = glddm.Width;
- dgl->dwModeHeight = glddm.Height;
- }
-
- // Clamp the effective window dimensions to primary surface.
- // We need to do this for D3D viewport dimensions even if wide
- // surfaces are supported. This also is a good idea for handling
- // whacked-out window dimensions passed for non-drawable windows
- // like Solid Edge. (DaveM)
- if (dgl->dwWidth > glddm.Width)
- dgl->dwWidth = glddm.Width;
- if (dgl->dwHeight > glddm.Height)
- dgl->dwHeight = glddm.Height;
-#else // _USE_GLD3_WGL
- // Window resize may have changed to fullscreen
- ZeroMemory(&ddsd2DisplayMode, sizeof(ddsd2DisplayMode));
- ddsd2DisplayMode.dwSize = sizeof(ddsd2DisplayMode);
- hResult = IDirectDraw4_GetDisplayMode(
- dgl->lpDD4,
- &ddsd2DisplayMode);
- if (SUCCEEDED(hResult)) {
- if ( (dwWidth == ddsd2DisplayMode.dwWidth) &&
- (dwHeight == ddsd2DisplayMode.dwHeight) ) {
- bFullScrnWin = TRUE;
- }
- if (bFullScrnWin && glb.bPrimary && !glb.bFullscreenBlit && !glb.bDirectDrawPersistant) {
- dgl->bFullscreen = TRUE;
- ddlogMessage(DDLOG_INFO, "Fullscreen window after resize.\n");
- }
- else {
- dgl->bFullscreen = FALSE;
- ddlogMessage(DDLOG_INFO, "Non-Fullscreen window after resize.\n");
- }
- // Cache the display mode dimensions
- dgl->dwModeWidth = ddsd2DisplayMode.dwWidth;
- dgl->dwModeHeight = ddsd2DisplayMode.dwHeight;
- }
-
- // Clamp the effective window dimensions to primary surface.
- // We need to do this for D3D viewport dimensions even if wide
- // surfaces are supported. This also is a good idea for handling
- // whacked-out window dimensions passed for non-drawable windows
- // like Solid Edge. (DaveM)
- if (dgl->dwWidth > ddsd2DisplayMode.dwWidth)
- dgl->dwWidth = ddsd2DisplayMode.dwWidth;
- if (dgl->dwHeight > ddsd2DisplayMode.dwHeight)
- dgl->dwHeight = ddsd2DisplayMode.dwHeight;
-#endif // _USE_GLD3_WGL
-
- // Note if fullscreen vs window display has changed?
- bSaveDesktop = (!bWasFullscreen && !dgl->bFullscreen) ? TRUE : FALSE;
- // Save the desktop primary surface from being destroyed
- // whenever remaining in windowed mode, since the stereo mode
- // switches are expensive...
-
-#ifndef _USE_GLD3_WGL
- // Don't need to re-allocate persistant buffers. (DaveM)
- // Though we should clear the back buffers to hide artifacts.
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers) {
- dgl->dwWidth = dwWidth;
- dgl->dwHeight = dwHeight;
- ZeroMemory(&ddbltfx, sizeof(ddbltfx));
- ddbltfx.dwSize = sizeof(ddbltfx);
- ddbltfx.dwFillColor = dgl->dwClearColorPF;
- IDirectDrawSurface4_Blt(dgl->lpBack4, &rcScreenRect, NULL, NULL,
- DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx);
- return TRUE;
- }
-
- // Ensure all rendering is complete
- if (ctx->Driver.Finish)
- (*ctx->Driver.Finish)(ctx);
- if (dgl->bSceneStarted == TRUE) {
- IDirect3DDevice3_EndScene(dgl->lpDev3);
- dgl->bSceneStarted = FALSE;
- }
-#endif // _USE_GLD3_WGL
- dgl->bCanRender = FALSE;
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw and DDS operations
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
-#ifndef _USE_GLD3_WGL
- // Release existing surfaces
- RELEASE(dgl->lpDev3);
- RELEASE(dgl->lpDepth4);
- RELEASE(dgl->lpBack4);
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary)
- ;
- else
- RELEASE(dgl->lpFront4);
-#endif // _USE_GLD3_WGL
- dgl->dwWidth = dwWidth;
- dgl->dwHeight = dwHeight;
-
- // Set defaults
- dgl->dwModeWidth = dgl->dwWidth;
- dgl->dwModeHeight = dgl->dwHeight;
-
-#ifdef _USE_GLD3_WGL
- if (!_gldDriver.ResizeDrawable(dgl, bDefaultDriver, glb.bDirectDrawPersistant, glb.bPersistantBuffers))
- goto cleanup_and_return_with_error;
-#else // _USE_GLD3_WGL
-
- if (dgl->bFullscreen) {
- //
- // FULLSCREEN
- //
-
- // Disable warning popups when in fullscreen mode
- ddlogWarnOption(FALSE);
-
- // Have to release the persistant DirectDraw primary surface
- // if switching to fullscreen mode. So if application wants
- // persistant display in fullscreen mode, a fullscreen-size
- // window should be used instead via fullscreen-blit option.
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) {
- RELEASE(glb.lpPrimary4);
- glb.bDirectDrawPrimary = FALSE;
- }
-
- dwFlags = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT;
- if (glb.bFastFPU)
- dwFlags |= DDSCL_FPUSETUP; // optional
- hResult = IDirectDraw4_SetCooperativeLevel(dgl->lpDD4, dgl->hWnd, dwFlags);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Unable to set Exclusive Fullscreen mode", hResult);
- goto cleanup_and_return_with_error;
- }
-
- hResult = IDirectDraw4_SetDisplayMode(dgl->lpDD4,
- dgl->dwModeWidth,
- dgl->dwModeHeight,
- dgl->dwBPP,
- 0,
- 0);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: SetDisplayMode failed", hResult);
- goto cleanup_and_return_with_error;
- }
-
- // ** The display mode has changed, so dont use MessageBox! **
-
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
-
- if (dgl->bDoubleBuffer) {
- // Double buffered
- // Primary surface
- ddsd2.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
- DDSCAPS_FLIP |
- DDSCAPS_COMPLEX |
- DDSCAPS_3DDEVICE |
- dwMemoryType;
- ddsd2.dwBackBufferCount = 1;
- hResult = IDirectDraw4_CreateSurface(dgl->lpDD4, &ddsd2, &dgl->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: CreateSurface (primary) failed", hResult);
- goto cleanup_and_return_with_error;
- }
- // Render target surface
- ZeroMemory(&ddscaps2, sizeof(ddscaps2)); // Clear the entire struct.
- ddscaps2.dwCaps = DDSCAPS_BACKBUFFER;
- hResult = IDirectDrawSurface4_GetAttachedSurface(dgl->lpFront4, &ddscaps2, &dgl->lpBack4);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: GetAttachedSurface failed", hResult);
- goto cleanup_and_return_with_error;
- }
- } else {
- // Single buffered
- // Primary surface
- ddsd2.dwFlags = DDSD_CAPS;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
- //DDSCAPS_3DDEVICE |
- dwMemoryType;
-
- hResult = IDirectDraw4_CreateSurface(dgl->lpDD4, &ddsd2, &dgl->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: CreateSurface (primary) failed", hResult);
- goto cleanup_and_return_with_error;
- }
-
- dgl->lpBack4 = NULL;
- }
- } else {
- // WINDOWED
-
- // OK to enable warning popups in windowed mode
- ddlogWarnOption(glb.bMessageBoxWarnings);
-
- // Ditto if persistant DirectDraw primary
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary)
- goto DoClipperOnly;
-
- // WINDOWED
- dwFlags = DDSCL_NORMAL;
- if (glb.bMultiThreaded)
- dwFlags |= DDSCL_MULTITHREADED;
- if (glb.bFastFPU)
- dwFlags |= DDSCL_FPUSETUP; // optional
- hResult = IDirectDraw4_SetCooperativeLevel(dgl->lpDD4,
- dgl->hWnd,
- dwFlags);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Unable to set Normal coop level", hResult);
- goto cleanup_and_return_with_error;
- }
- // Primary surface
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- hResult = IDirectDraw4_CreateSurface(dgl->lpDD4, &ddsd2, &dgl->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: CreateSurface (primary) failed", hResult);
- goto cleanup_and_return_with_error;
- }
-
- // Cache the primary surface for persistant DirectDraw state
- if (glb.bDirectDrawPersistant && !glb.bDirectDrawPrimary) {
- glb.lpPrimary4 = dgl->lpFront4;
- IDirectDrawSurface4_AddRef(glb.lpPrimary4);
- glb.bDirectDrawPrimary = TRUE;
- }
-
- // Clipper object
- hResult = DirectDrawCreateClipper(0, &lpddClipper, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: CreateClipper failed", hResult);
- goto cleanup_and_return_with_error;
- }
- hResult = IDirectDrawClipper_SetHWnd(lpddClipper, 0, dgl->hWnd);
- if (FAILED(hResult)) {
- RELEASE(lpddClipper);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: SetHWnd failed", hResult);
- goto cleanup_and_return_with_error;
- }
- hResult = IDirectDrawSurface4_SetClipper(dgl->lpFront4, lpddClipper);
- RELEASE(lpddClipper); // We have finished with it.
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: SetClipper failed", hResult);
- goto cleanup_and_return_with_error;
- }
-DoClipperOnly:
- // Update the window for the original clipper
- if ((glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) || bSaveDesktop) {
- IDirectDrawSurface4_GetClipper(dgl->lpFront4, &lpddClipper);
- IDirectDrawClipper_SetHWnd(lpddClipper, 0, dgl->hWnd);
- RELEASE(lpddClipper);
- }
-
- if (dgl->bDoubleBuffer) {
- // Render target surface
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
- ddsd2.dwWidth = dgl->dwWidth;
- ddsd2.dwHeight = dgl->dwHeight;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_3DDEVICE |
- DDSCAPS_OFFSCREENPLAIN |
- dwMemoryType;
- hResult = IDirectDraw4_CreateSurface(dgl->lpDD4, &ddsd2, &dgl->lpBack4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Create Backbuffer failed", hResult);
- goto cleanup_and_return_with_error;
- }
-
- } else {
- dgl->lpBack4 = NULL;
- }
- }
-
- //
- // Now create the Zbuffer
- //
- if (dgl->bDepthBuffer) {
- // Get z-buffer dimensions from the render target
- // Setup the surface desc for the z-buffer.
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | dwMemoryType;
- ddsd2.dwWidth = dgl->dwWidth;
- ddsd2.dwHeight = dgl->dwHeight;
- memcpy(&ddsd2.ddpfPixelFormat,
- &glb.lpZBufferPF[dgl->iZBufferPF],
- sizeof(DDPIXELFORMAT) );
-
- // Create a z-buffer
- hResult = IDirectDraw4_CreateSurface(dgl->lpDD4, &ddsd2, &dgl->lpDepth4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: CreateSurface (ZBuffer) failed", hResult);
- goto cleanup_and_return_with_error;
- }
-
- // Attach Zbuffer to render target
- TRY(IDirectDrawSurface4_AddAttachedSurface(
- dgl->bDoubleBuffer ? dgl->lpBack4 : dgl->lpFront4,
- dgl->lpDepth4),
- "dglResize: Attach Zbuffer");
-
- }
-
- // Clear the newly resized back buffers for the window client area.
- ZeroMemory(&ddbltfx, sizeof(ddbltfx));
- ddbltfx.dwSize = sizeof(ddbltfx);
- ddbltfx.dwFillColor = dgl->dwClearColorPF;
- IDirectDrawSurface4_Blt(dgl->lpBack4, &rcScreenRect, NULL, NULL,
- DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx);
-
- //
- // Now that we have a zbuffer we can create the 3D device
- //
- hResult = IDirect3D3_CreateDevice(dgl->lpD3D3,
- bDefaultDriver ? &glb.d3dGuid : &IID_IDirect3DRGBDevice,
- dgl->bDoubleBuffer ? dgl->lpBack4 : dgl->lpFront4,
- &dgl->lpDev3,
- NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Could not create Direct3D device", hResult);
- goto cleanup_and_return_with_error;
- }
-
- // We must do this as soon as the device is created
- dglInitStateCaches(dgl);
-
- //
- // Viewport
- //
- hResult = IDirect3DDevice3_AddViewport(dgl->lpDev3, dgl->lpViewport3);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: AddViewport failed", hResult);
- goto cleanup_and_return_with_error;
- }
-
- // Initialise the viewport
- dgl->d3dViewport.dwSize = sizeof(dgl->d3dViewport);
- dgl->d3dViewport.dwX = 0;
- dgl->d3dViewport.dwY = 0;
- dgl->d3dViewport.dwWidth = dgl->dwWidth;
- dgl->d3dViewport.dwHeight = dgl->dwHeight;
- dgl->d3dViewport.dvClipX = 0;
- dgl->d3dViewport.dvClipY = 0;
- dgl->d3dViewport.dvClipWidth = dgl->dwWidth;
- dgl->d3dViewport.dvClipHeight = dgl->dwHeight;
-// dgl->d3dViewport.dvMinZ = 0.0f;
-// dgl->d3dViewport.dvMaxZ = 1.0f;
- TRY(IDirect3DViewport3_SetViewport2(dgl->lpViewport3, &dgl->d3dViewport),
- "dglResize: SetViewport2");
-
- hResult = IDirect3DDevice3_SetCurrentViewport(dgl->lpDev3, dgl->lpViewport3);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: SetCurrentViewport failed", hResult);
- goto cleanup_and_return_with_error;
- }
-
- // (Re)Initialise all the Direct3D renderstates
- dglInitStateD3D(ctx);
-
- // Now we have to recreate all of our textures (+ mipmaps).
- // Walk over all textures in hash table
- // XXX what about the default texture objects (id=0)?
- {
- struct _mesa_HashTable *textures = ctx->Shared->TexObjects;
- GLuint id;
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- tObj = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- if (tObj->DriverData) {
- // We could call our TexImage function directly, but it's
- // safer to use the driver pointer.
- for (i=0; i<MAX_TEXTURE_LEVELS; i++) {
- image = tObj->Image[i];
- if (image) {
- switch (tObj->Dimensions){
- case 1:
- if (ctx->Driver.TexImage)
- (*ctx->Driver.TexImage)(ctx, GL_TEXTURE_1D, tObj, i, image->Format, image);
- break;
- case 2:
- if (ctx->Driver.TexImage)
- (*ctx->Driver.TexImage)(ctx, GL_TEXTURE_2D, tObj, i, image->Format, image);
- break;
- default:
- break;
- }
- }
- }
- }
- }
- }
-
- // Re-Bind each texture Unit
- for (i=0; i<glb.wMaxSimultaneousTextures; i++) {
- tObj = ctx->Texture.Unit[i].Current;
- if (tObj) {
- DGL_texture *lpTex = (DGL_texture *)tObj->DriverData;
- hResult = dglSetTexture(dgl, i, lpTex ? lpTex->lpTexture : NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_ERROR, "dglResize: SetTexture failed", hResult);
- }
- }
- }
-#endif // _USE_GLD3_WGL
-
- dgl->bCanRender = TRUE;
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- // SUCCESS.
- return TRUE;
-
-cleanup_and_return_with_error:
- // Relase all interfaces before returning.
-#ifdef _USE_GLD3_WGL
- _gldDriver.DestroyDrawable(dgl);
-#else // _USE_GLD3_WGL
- RELEASE(dgl->lpDev3);
- RELEASE(dgl->lpDepth4);
- RELEASE(dgl->lpBack4);
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary)
- ;
- else
- RELEASE(dgl->lpFront4);
-
-#undef DDLOG_CRITICAL_OR_WARN
-#endif // _USE_GLD3_WGL
-
- // Mark context as not being able to render
- dgl->bCanRender = FALSE;
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return FALSE;
-}
-
-// ***********************************************************************
-// ***********************************************************************
-// Support for bitmap fonts.
-// ***********************************************************************
-// ***********************************************************************
-
-/*****************************************************************************
-**
-** InvertGlyphBitmap.
-**
-** Invert the bitmap so that it suits OpenGL's representation.
-** Each row starts on a double word boundary.
-**
-*****************************************************************************/
-
-static void InvertGlyphBitmap(
- int w,
- int h,
- DWORD *fptr,
- DWORD *tptr)
-{
- int dWordsInRow = (w+31)/32;
- int i, j;
- DWORD *tmp = tptr;
-
- if (w <= 0 || h <= 0) {
- return;
- }
-
- tptr += ((h-1)*dWordsInRow);
- for (i = 0; i < h; i++) {
- for (j = 0; j < dWordsInRow; j++) {
- *(tptr + j) = *(fptr + j);
- }
- tptr -= dWordsInRow;
- fptr += dWordsInRow;
- }
-}
-
-// ***********************************************************************
-
-/*****************************************************************************
- * wglUseFontBitmaps
- *
- * Converts a subrange of the glyphs in a GDI font to OpenGL display
- * lists.
- *
- * Extended to support any GDI font, not just TrueType fonts. (DaveM)
- *
- *****************************************************************************/
-
-BOOL APIENTRY _GLD_WGL_EXPORT(UseFontBitmapsA)(
- HDC hDC,
- DWORD first,
- DWORD count,
- DWORD listBase)
-{
- int i, ox, oy, ix, iy;
- int w, h;
- int iBufSize, iCurBufSize = 0;
- DWORD *bitmapBuffer = NULL;
- DWORD *invertedBitmapBuffer = NULL;
- BOOL bSuccessOrFail = TRUE;
- BOOL bTrueType = FALSE;
- TEXTMETRIC tm;
- GLYPHMETRICS gm;
- RASTERIZER_STATUS rs;
- MAT2 mat;
- SIZE size;
- RECT rect;
- HDC hDCMem;
- HBITMAP hBitmap;
- BITMAPINFO bmi;
- HFONT hFont;
-
- // Validate SciTech DirectGL license
- if (!dglValidate())
- return FALSE;
-
- // Set up a unity matrix.
- ZeroMemory(&mat, sizeof(mat));
- mat.eM11.value = 1;
- mat.eM22.value = 1;
-
- // Test to see if selected font is TrueType or not
- ZeroMemory(&tm, sizeof(tm));
- if (!GetTextMetrics(hDC, &tm)) {
- ddlogMessage(DDLOG_ERROR, "DGL_UseFontBitmaps: Font metrics error\n");
- return (FALSE);
- }
- bTrueType = (tm.tmPitchAndFamily & TMPF_TRUETYPE) ? TRUE : FALSE;
-
- // Test to see if TRUE-TYPE capabilities are installed
- // (only necessary if TrueType font selected)
- ZeroMemory(&rs, sizeof(rs));
- if (bTrueType) {
- if (!GetRasterizerCaps (&rs, sizeof (RASTERIZER_STATUS))) {
- ddlogMessage(DDLOG_ERROR, "DGL_UseFontBitmaps: Raster caps error\n");
- return (FALSE);
- }
- if (!(rs.wFlags & TT_ENABLED)) {
- ddlogMessage(DDLOG_ERROR, "DGL_UseFontBitmaps: No TrueType caps\n");
- return (FALSE);
- }
- }
-
- // Trick to get the current font handle
- hFont = SelectObject(hDC, GetStockObject(SYSTEM_FONT));
- SelectObject(hDC, hFont);
-
- // Have memory device context available for holding bitmaps of font glyphs
- hDCMem = CreateCompatibleDC(hDC);
- SelectObject(hDCMem, hFont);
- SetTextColor(hDCMem, RGB(0xFF, 0xFF, 0xFF));
- SetBkColor(hDCMem, 0);
-
- for (i = first; (DWORD) i < (first + count); i++) {
- // Find out how much space is needed for the bitmap so we can
- // Set the buffer size correctly.
- if (bTrueType) {
- // Use TrueType support to get bitmap size of glyph
- iBufSize = GetGlyphOutline(hDC, i, GGO_BITMAP, &gm,
- 0, NULL, &mat);
- if (iBufSize == GDI_ERROR) {
- bSuccessOrFail = FALSE;
- break;
- }
- }
- else {
- // Use generic GDI support to compute bitmap size of glyph
- w = tm.tmMaxCharWidth;
- h = tm.tmHeight;
- if (GetTextExtentPoint32(hDC, (LPCTSTR)&i, 1, &size)) {
- w = size.cx;
- h = size.cy;
- }
- iBufSize = w * h;
- // Use DWORD multiple for compatibility
- iBufSize += 3;
- iBufSize /= 4;
- iBufSize *= 4;
- }
-
- // If we need to allocate Larger Buffers, then do so - but allocate
- // An extra 50 % so that we don't do too many mallocs !
- if (iBufSize > iCurBufSize) {
- if (bitmapBuffer) {
- __wglFree(bitmapBuffer);
- }
- if (invertedBitmapBuffer) {
- __wglFree(invertedBitmapBuffer);
- }
-
- iCurBufSize = iBufSize * 2;
- bitmapBuffer = (DWORD *) __wglMalloc(iCurBufSize);
- invertedBitmapBuffer = (DWORD *) __wglMalloc(iCurBufSize);
-
- if (bitmapBuffer == NULL || invertedBitmapBuffer == NULL) {
- bSuccessOrFail = FALSE;
- break;
- }
- }
-
- // If we fail to get the Glyph data, delete the display lists
- // Created so far and return FALSE.
- if (bTrueType) {
- // Use TrueType support to get bitmap of glyph
- if (GetGlyphOutline(hDC, i, GGO_BITMAP, &gm,
- iBufSize, bitmapBuffer, &mat) == GDI_ERROR) {
- bSuccessOrFail = FALSE;
- break;
- }
-
- // Setup glBitmap parameters for current font glyph
- w = gm.gmBlackBoxX;
- h = gm.gmBlackBoxY;
- ox = gm.gmptGlyphOrigin.x;
- oy = gm.gmptGlyphOrigin.y;
- ix = gm.gmCellIncX;
- iy = gm.gmCellIncY;
- }
- else {
- // Use generic GDI support to create bitmap of glyph
- ZeroMemory(bitmapBuffer, iBufSize);
-
- if (i >= tm.tmFirstChar && i <= tm.tmLastChar) {
- // Only create bitmaps for actual font glyphs
- hBitmap = CreateBitmap(w, h, 1, 1, NULL);
- SelectObject(hDCMem, hBitmap);
- // Make bitmap of current font glyph
- SetRect(&rect, 0, 0, w, h);
- DrawText(hDCMem, (LPCTSTR)&i, 1, &rect,
- DT_LEFT | DT_BOTTOM | DT_SINGLELINE | DT_NOCLIP);
- // Make copy of bitmap in our local buffer
- ZeroMemory(&bmi, sizeof(bmi));
- bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi.bmiHeader.biWidth = w;
- bmi.bmiHeader.biHeight = -h;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = 1;
- bmi.bmiHeader.biCompression = BI_RGB;
- GetDIBits(hDCMem, hBitmap, 0, h, bitmapBuffer, &bmi, 0);
- DeleteObject(hBitmap);
- }
- else {
- // Otherwise use empty display list for non-existing glyph
- iBufSize = 0;
- }
-
- // Setup glBitmap parameters for current font glyph
- ox = 0;
- oy = tm.tmDescent;
- ix = w;
- iy = 0;
- }
-
- // Create an OpenGL display list.
- _GLD_glNewList((listBase + i), GL_COMPILE);
-
- // Some fonts have no data for the space character, yet advertise
- // a non-zero size.
- if (0 == iBufSize) {
- _GLD_glBitmap(0, 0, 0.0f, 0.0f, (GLfloat) ix, (GLfloat) iy, NULL);
- } else {
- // Invert the Glyph data.
- InvertGlyphBitmap(w, h, bitmapBuffer, invertedBitmapBuffer);
-
- // Render an OpenGL bitmap and invert the origin.
- _GLD_glBitmap(w, h,
- (GLfloat) ox, (GLfloat) (h-oy),
- (GLfloat) ix, (GLfloat) iy,
- (GLubyte *) invertedBitmapBuffer);
- }
-
- // Close this display list.
- _GLD_glEndList();
- }
-
- if (bSuccessOrFail == FALSE) {
- ddlogMessage(DDLOG_ERROR, "DGL_UseFontBitmaps: Get glyph failed\n");
- _GLD_glDeleteLists((i+listBase), (i-first));
- }
-
- // Release resources used
- DeleteObject(hFont);
- DeleteDC(hDCMem);
-
- if (bitmapBuffer)
- __wglFree(bitmapBuffer);
- if (invertedBitmapBuffer)
- __wglFree(invertedBitmapBuffer);
-
- return(bSuccessOrFail);
-}
-
-// ***********************************************************************
-
-BOOL APIENTRY _GLD_WGL_EXPORT(UseFontBitmapsW)(
- HDC a,
- DWORD b,
- DWORD c,
- DWORD d)
-{
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- return _GLD_WGL_EXPORT(UseFontBitmapsA)(a, b, c, d);
-}
-
-// ***********************************************************************
-// ***********************************************************************
-// Support for outline TrueType fonts.
-// ***********************************************************************
-// ***********************************************************************
-
-void * __wglRealloc(
- void *oldPtr,
- size_t newSize)
-{
- void *newPtr = NULL;
-
- if (newSize != 0) {
- newPtr = (void *) GlobalAlloc(GPTR, newSize);
- if (oldPtr && newPtr) {
- DWORD oldSize = GlobalSize(oldPtr);
-
- memcpy(newPtr, oldPtr, (oldSize <= newSize ? oldSize : newSize));
- GlobalFree(oldPtr);
- }
- } else if (oldPtr) {
- GlobalFree(oldPtr);
- }
- if (newPtr == NULL) {
- return NULL; /* XXX out of memory error */
- }
- return newPtr;
-}
-
-// ***********************************************************************
-
-
-/*****************************************************************************
- * wglUseFontOutlinesW
- *
- * Converts a subrange of the glyphs in a TrueType font to OpenGL display
- * lists.
- *****************************************************************************/
-
-BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesW)(
- IN HDC hDC,
- IN DWORD first,
- IN DWORD count,
- IN DWORD listBase,
- IN FLOAT chordalDeviation,
- IN FLOAT extrusion,
- IN INT format,
- OUT LPGLYPHMETRICSFLOAT lpgmf)
-{
- return _GLD_WGL_EXPORT(UseFontOutlinesA)(hDC, first, count, listBase,
- chordalDeviation, extrusion, format, lpgmf);
-}
-
-/*****************************************************************************
- * wglUseFontOutlinesA
- *
- * Converts a subrange of the glyphs in a TrueType font to OpenGL display
- * lists.
- *****************************************************************************/
-
-BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesA)(
- IN HDC hDC,
- IN DWORD first,
- IN DWORD count,
- IN DWORD listBase,
- IN FLOAT chordalDeviation,
- IN FLOAT extrusion,
- IN INT format,
- OUT LPGLYPHMETRICSFLOAT glyphMetricsFloatArray)
- {
- DWORD glyphIndex;
- UCHAR* glyphBuf;
- DWORD glyphBufSize;
-
-
- /*
- * Flush any previous OpenGL errors. This allows us to check for
- * new errors so they can be reported via the function return value.
- */
- while (_GLD_glGetError() != GL_NO_ERROR)
- ;
-
- /*
- * Make sure that the current font can be sampled accurately.
- */
- hNewFont = CreateHighResolutionFont(hDC);
- if (!hNewFont)
- return FALSE;
-
- hOldFont = SelectObject(hDC, hNewFont);
- if (!hOldFont)
- return FALSE;
-
- /*
- * Preallocate a buffer for the outline data, and track its size:
- */
- glyphBuf = (UCHAR*) __wglMalloc(glyphBufSize = 10240);
- if (!glyphBuf)
- return FALSE; /*WGL_STATUS_NOT_ENOUGH_MEMORY*/
-
- /*
- * Process each glyph in the given range:
- */
- for (glyphIndex = first; glyphIndex - first < count; ++glyphIndex)
- {
- GLYPHMETRICS glyphMetrics;
- DWORD glyphSize;
- static MAT2 matrix =
- {
- {0, 1}, {0, 0},
- {0, 0}, {0, 1}
- };
- LPGLYPHMETRICSFLOAT glyphMetricsFloat =
- &glyphMetricsFloatArray[glyphIndex - first];
-
-
- /*
- * Determine how much space is needed to store the glyph's
- * outlines. If our glyph buffer isn't large enough,
- * resize it.
- */
- glyphSize = GetGlyphOutline( hDC,
- glyphIndex,
- GGO_NATIVE,
- &glyphMetrics,
- 0,
- NULL,
- &matrix
- );
- if (glyphSize < 0)
- return FALSE; /*WGL_STATUS_FAILURE*/
- if (glyphSize > glyphBufSize)
- {
- __wglFree(glyphBuf);
- glyphBuf = (UCHAR*) __wglMalloc(glyphBufSize = glyphSize);
- if (!glyphBuf)
- return FALSE; /*WGL_STATUS_NOT_ENOUGH_MEMORY*/
- }
-
-
- /*
- * Get the glyph's outlines.
- */
- if (GetGlyphOutline( hDC,
- glyphIndex,
- GGO_NATIVE,
- &glyphMetrics,
- glyphBufSize,
- glyphBuf,
- &matrix
- ) < 0)
- {
- __wglFree(glyphBuf);
- return FALSE; /*WGL_STATUS_FAILURE*/
- }
-
- glyphMetricsFloat->gmfBlackBoxX =
- (FLOAT) glyphMetrics.gmBlackBoxX * ScaleFactor;
- glyphMetricsFloat->gmfBlackBoxY =
- (FLOAT) glyphMetrics.gmBlackBoxY * ScaleFactor;
- glyphMetricsFloat->gmfptGlyphOrigin.x =
- (FLOAT) glyphMetrics.gmptGlyphOrigin.x * ScaleFactor;
- glyphMetricsFloat->gmfptGlyphOrigin.y =
- (FLOAT) glyphMetrics.gmptGlyphOrigin.y * ScaleFactor;
- glyphMetricsFloat->gmfCellIncX =
- (FLOAT) glyphMetrics.gmCellIncX * ScaleFactor;
- glyphMetricsFloat->gmfCellIncY =
- (FLOAT) glyphMetrics.gmCellIncY * ScaleFactor;
-
- /*
- * Turn the glyph into a display list:
- */
- if (!MakeDisplayListFromGlyph( (glyphIndex - first) + listBase,
- glyphBuf,
- glyphSize,
- glyphMetricsFloat,
- chordalDeviation + ScaleFactor,
- extrusion,
- format))
- {
- __wglFree(glyphBuf);
- return FALSE; /*WGL_STATUS_FAILURE*/
- }
- }
-
-
- /*
- * Clean up temporary storage and return. If an error occurred,
- * clear all OpenGL error flags and return FAILURE status;
- * otherwise just return SUCCESS.
- */
- __wglFree(glyphBuf);
-
- SelectObject(hDC, hOldFont);
-
- if (_GLD_glGetError() == GL_NO_ERROR)
- return TRUE; /*WGL_STATUS_SUCCESS*/
- else
- {
- while (_GLD_glGetError() != GL_NO_ERROR)
- ;
- return FALSE; /*WGL_STATUS_FAILURE*/
- }
- }
-
-
-
-/*****************************************************************************
- * CreateHighResolutionFont
- *
- * Gets metrics for the current font and creates an equivalent font
- * scaled to the design units of the font.
- *
- *****************************************************************************/
-
-static HFONT
-CreateHighResolutionFont(HDC hDC)
- {
- UINT otmSize;
- OUTLINETEXTMETRIC *otm;
- LONG fontHeight, fontWidth, fontUnits;
- LOGFONT logFont;
-
- otmSize = GetOutlineTextMetrics(hDC, 0, NULL);
- if (otmSize == 0)
- return NULL;
-
- otm = (OUTLINETEXTMETRIC *) __wglMalloc(otmSize);
- if (otm == NULL)
- return NULL;
-
- otm->otmSize = otmSize;
- if (GetOutlineTextMetrics(hDC, otmSize, otm) == 0)
- return NULL;
-
- fontHeight = otm->otmTextMetrics.tmHeight -
- otm->otmTextMetrics.tmInternalLeading;
- fontWidth = otm->otmTextMetrics.tmAveCharWidth;
- fontUnits = (LONG) otm->otmEMSquare;
-
- ScaleFactor = 1.0F / (FLOAT) fontUnits;
-
- logFont.lfHeight = - ((LONG) fontUnits);
- logFont.lfWidth = (LONG)
- ((FLOAT) (fontWidth * fontUnits) / (FLOAT) fontHeight);
- logFont.lfEscapement = 0;
- logFont.lfOrientation = 0;
- logFont.lfWeight = otm->otmTextMetrics.tmWeight;
- logFont.lfItalic = otm->otmTextMetrics.tmItalic;
- logFont.lfUnderline = otm->otmTextMetrics.tmUnderlined;
- logFont.lfStrikeOut = otm->otmTextMetrics.tmStruckOut;
- logFont.lfCharSet = otm->otmTextMetrics.tmCharSet;
- logFont.lfOutPrecision = OUT_OUTLINE_PRECIS;
- logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
- logFont.lfQuality = DEFAULT_QUALITY;
- logFont.lfPitchAndFamily =
- otm->otmTextMetrics.tmPitchAndFamily & 0xf0;
- strcpy(logFont.lfFaceName,
- (char *)otm + (int)otm->otmpFaceName);
-
- hNewFont = CreateFontIndirect(&logFont);
- if (hNewFont == NULL)
- return NULL;
-
- __wglFree(otm);
-
- return hNewFont;
- }
-
-
-
-/*****************************************************************************
- * MakeDisplayListFromGlyph
- *
- * Converts the outline of a glyph to an OpenGL display list.
- *
- * Return value is nonzero for success, zero for failure.
- *
- * Does not check for OpenGL errors, so if the caller needs to know about them,
- * it should call glGetError().
- *****************************************************************************/
-
-static int
-MakeDisplayListFromGlyph( IN DWORD listName,
- IN UCHAR* glyphBuf,
- IN DWORD glyphSize,
- IN LPGLYPHMETRICSFLOAT glyphMetricsFloat,
- IN FLOAT chordalDeviation,
- IN FLOAT extrusion,
- IN INT format)
- {
- int status;
-
- _GLD_glNewList(listName, GL_COMPILE);
- status = DrawGlyph( glyphBuf,
- glyphSize,
- chordalDeviation,
- extrusion,
- format);
-
- _GLD_glTranslatef(glyphMetricsFloat->gmfCellIncX,
- glyphMetricsFloat->gmfCellIncY,
- 0.0F);
- _GLD_glEndList();
-
- return status;
- }
-
-
-
-/*****************************************************************************
- * DrawGlyph
- *
- * Converts the outline of a glyph to OpenGL drawing primitives, tessellating
- * as needed, and then draws the glyph. Tessellation of the quadratic splines
- * in the outline is controlled by "chordalDeviation", and the drawing
- * primitives (lines or polygons) are selected by "format".
- *
- * Return value is nonzero for success, zero for failure.
- *
- * Does not check for OpenGL errors, so if the caller needs to know about them,
- * it should call glGetError().
- *****************************************************************************/
-
-static int
-DrawGlyph( IN UCHAR* glyphBuf,
- IN DWORD glyphSize,
- IN FLOAT chordalDeviation,
- IN FLOAT extrusion,
- IN INT format)
- {
- INT status = 0;
- FLOAT* p;
- DWORD loop;
- DWORD point;
- GLUtesselator* tess = NULL;
-
-
- /*
- * Initialize the global buffer into which we place the outlines:
- */
- if (!InitLineBuf())
- goto exit;
-
-
- /*
- * Convert the glyph outlines to a set of polyline loops.
- * (See MakeLinesFromGlyph() for the format of the loop data
- * structure.)
- */
- if (!MakeLinesFromGlyph(glyphBuf, glyphSize, chordalDeviation))
- goto exit;
- p = LineBuf;
-
-
- /*
- * Now draw the loops in the appropriate format:
- */
- if (format == WGL_FONT_LINES)
- {
- /*
- * This is the easy case. Just draw the outlines.
- */
- for (loop = (DWORD) *p++; loop; --loop)
- {
- _GLD_glBegin(GL_LINE_LOOP);
- for (point = (DWORD) *p++; point; --point)
- {
- _GLD_glVertex2fv(p);
- p += 2;
- }
- _GLD_glEnd();
- }
- status = 1;
- }
-
- else if (format == WGL_FONT_POLYGONS)
- {
- double v[3];
- FLOAT *save_p = p;
- GLfloat z_value;
-
- /*
- * This is the hard case. We have to set up a tessellator
- * to convert the outlines into a set of polygonal
- * primitives, which the tessellator passes to some
- * auxiliary routines for drawing.
- */
- if (!LoadGLUTesselator())
- goto exit;
- if (!InitVertBuf())
- goto exit;
- if (!(tess = gluNewTessProc()))
- goto exit;
- gluTessCallbackProc(tess, GLU_BEGIN, (void(CALLBACK *)()) _GLD_glBegin);
- gluTessCallbackProc(tess, GLU_TESS_VERTEX_DATA,
- (void(CALLBACK *)()) TessVertexOutData);
- gluTessCallbackProc(tess, GLU_END, (void(CALLBACK *)()) _GLD_glEnd);
- gluTessCallbackProc(tess, GLU_ERROR, (void(CALLBACK *)()) TessError);
- gluTessCallbackProc(tess, GLU_TESS_COMBINE, (void(CALLBACK *)()) TessCombine);
- gluTessNormalProc(tess, 0.0F, 0.0F, 1.0F);
-
- TessErrorOccurred = 0;
- _GLD_glNormal3f(0.0f, 0.0f, 1.0f);
- v[2] = 0.0;
- z_value = 0.0f;
-
- gluTessBeginPolygonProc(tess, (void *)*(int *)&z_value);
- for (loop = (DWORD) *p++; loop; --loop)
- {
- gluTessBeginContourProc(tess);
-
- for (point = (DWORD) *p++; point; --point)
- {
- v[0] = p[0];
- v[1] = p[1];
- gluTessVertexProc(tess, v, p);
- p += 2;
- }
-
- gluTessEndContourProc(tess);
- }
- gluTessEndPolygonProc(tess);
-
- status = !TessErrorOccurred;
-
- /* Extrusion code */
- if (extrusion) {
- DWORD loops;
- GLfloat thickness = (GLfloat) -extrusion;
- FLOAT *vert, *vert2;
- DWORD count;
-
- p = save_p;
- loops = (DWORD) *p++;
-
- for (loop = 0; loop < loops; loop++) {
- GLfloat dx, dy, len;
- DWORD last;
-
- count = (DWORD) *p++;
- _GLD_glBegin(GL_QUAD_STRIP);
-
- /* Check if the first and last vertex are identical
- * so we don't draw the same quad twice.
- */
- vert = p + (count-1)*2;
- last = (p[0] == vert[0] && p[1] == vert[1]) ? count-1 : count;
-
- for (point = 0; point <= last; point++) {
- vert = p + 2 * (point % last);
- vert2 = p + 2 * ((point+1) % last);
-
- dx = vert[0] - vert2[0];
- dy = vert[1] - vert2[1];
- len = (GLfloat)sqrt(dx * dx + dy * dy);
-
- _GLD_glNormal3f(dy / len, -dx / len, 0.0f);
- _GLD_glVertex3f((GLfloat) vert[0],
- (GLfloat) vert[1], thickness);
- _GLD_glVertex3f((GLfloat) vert[0],
- (GLfloat) vert[1], 0.0f);
- }
-
- _GLD_glEnd();
- p += count*2;
- }
-
- /* Draw the back face */
- p = save_p;
- v[2] = thickness;
- _GLD_glNormal3f(0.0f, 0.0f, -1.0f);
- gluTessNormalProc(tess, 0.0F, 0.0F, -1.0F);
-
- gluTessBeginPolygonProc(tess, (void *)*(int *)&thickness);
-
- for (loop = (DWORD) *p++; loop; --loop)
- {
- count = (DWORD) *p++;
-
- gluTessBeginContourProc(tess);
-
- for (point = 0; point < count; point++)
- {
- vert = p + ((count-point-1)<<1);
- v[0] = vert[0];
- v[1] = vert[1];
- gluTessVertexProc(tess, v, vert);
- }
- p += count*2;
-
- gluTessEndContourProc(tess);
- }
- gluTessEndPolygonProc(tess);
- }
-
-#if DEBUG
- if (TessErrorOccurred)
- printf("Tessellation error %s\n",
- gluErrorString(TessErrorOccurred));
-#endif
- }
-
-
-exit:
- FreeLineBuf();
- if (tess)
- gluDeleteTessProc(tess);
- // UnloadGLUTesselator();
- FreeVertBuf();
- return status;
- }
-
-
-
-/*****************************************************************************
- * LoadGLUTesselator
- *
- * Maps the glu32.dll module and gets function pointers for the
- * tesselator functions.
- *****************************************************************************/
-
-static BOOL
-LoadGLUTesselator(void)
- {
- if (gluModuleHandle != NULL)
- return TRUE;
-
- {
- extern HINSTANCE hInstanceOpenGL;
- char *gluName = "GLU32.DLL";
-// char name[256];
-// char *ptr;
-// int len;
-
-/*
- len = GetModuleFileName(hInstanceOpenGL, name, 255);
- if (len != 0)
- {
- ptr = name+len-1;
- while (ptr > name && *ptr != '\\')
- ptr--;
- if (*ptr == '\\')
- ptr++;
- if (!stricmp(ptr, "cosmogl.dll"))
- {
- gluName = "COSMOGLU.DLL";
- }
- else if (!stricmp(ptr, "opengl32.dll"))
- {
- gluName = "GLU32.DLL";
- }
- }
-*/
- if ((gluModuleHandle = LoadLibrary(gluName)) == NULL)
- return FALSE;
- }
-
- if ((gluNewTessProc = (gluNewTessProto)
- GetProcAddress(gluModuleHandle, "gluNewTess")) == NULL)
- return FALSE;
-
- if ((gluDeleteTessProc = (gluDeleteTessProto)
- GetProcAddress(gluModuleHandle, "gluDeleteTess")) == NULL)
- return FALSE;
-
- if ((gluTessBeginPolygonProc = (gluTessBeginPolygonProto)
- GetProcAddress(gluModuleHandle, "gluTessBeginPolygon")) == NULL)
- return FALSE;
-
- if ((gluTessBeginContourProc = (gluTessBeginContourProto)
- GetProcAddress(gluModuleHandle, "gluTessBeginContour")) == NULL)
- return FALSE;
-
- if ((gluTessVertexProc = (gluTessVertexProto)
- GetProcAddress(gluModuleHandle, "gluTessVertex")) == NULL)
- return FALSE;
-
- if ((gluTessEndContourProc = (gluTessEndContourProto)
- GetProcAddress(gluModuleHandle, "gluTessEndContour")) == NULL)
- return FALSE;
-
- if ((gluTessEndPolygonProc = (gluTessEndPolygonProto)
- GetProcAddress(gluModuleHandle, "gluTessEndPolygon")) == NULL)
- return FALSE;
-
- if ((gluTessPropertyProc = (gluTessPropertyProto)
- GetProcAddress(gluModuleHandle, "gluTessProperty")) == NULL)
- return FALSE;
-
- if ((gluTessNormalProc = (gluTessNormalProto)
- GetProcAddress(gluModuleHandle, "gluTessNormal")) == NULL)
- return FALSE;
-
- if ((gluTessCallbackProc = (gluTessCallbackProto)
- GetProcAddress(gluModuleHandle, "gluTessCallback")) == NULL)
- return FALSE;
-
- return TRUE;
- }
-
-
-
-/*****************************************************************************
- * UnloadGLUTesselator
- *
- * Unmaps the glu32.dll module.
- *****************************************************************************/
-
-static BOOL
-UnloadGLUTesselator(void)
- {
- if (gluModuleHandle != NULL)
- if (FreeLibrary(gluModuleHandle) == FALSE)
- return FALSE;
- gluModuleHandle = NULL;
- }
-
-
-
-/*****************************************************************************
- * TessVertexOut
- *
- * Used by tessellator to handle output vertexes.
- *****************************************************************************/
-
-static void CALLBACK
-TessVertexOut(FLOAT p[3])
- {
- GLfloat v[2];
-
- v[0] = p[0] * ScaleFactor;
- v[1] = p[1] * ScaleFactor;
- _GLD_glVertex2fv(v);
- }
-
-static void CALLBACK
-TessVertexOutData(FLOAT p[3], GLfloat z)
-{
- GLfloat v[3];
-
- v[0] = (GLfloat) p[0];
- v[1] = (GLfloat) p[1];
- v[2] = z;
- _GLD_glVertex3fv(v);
-}
-
-
-/*****************************************************************************
- * TessCombine
- *
- * Used by tessellator to handle self-intersecting contours and degenerate
- * geometry.
- *****************************************************************************/
-
-static void CALLBACK
-TessCombine(double coords[3],
- void* vertex_data[4],
- FLOAT weight[4],
- void** outData)
- {
- if (!AppendToVertBuf((FLOAT) coords[0])
- || !AppendToVertBuf((FLOAT) coords[1])
- || !AppendToVertBuf((FLOAT) coords[2]))
- TessErrorOccurred = GL_OUT_OF_MEMORY;
- *outData = VertBuf + (VertBufIndex - 3);
- }
-
-
-
-/*****************************************************************************
- * TessError
- *
- * Saves the last tessellator error code in the global TessErrorOccurred.
- *****************************************************************************/
-
-static void CALLBACK
-TessError(GLenum error)
- {
- TessErrorOccurred = error;
- }
-
-
-
-/*****************************************************************************
- * MakeLinesFromGlyph
- *
- * Converts the outline of a glyph from the TTPOLYGON format to a simple
- * array of floating-point values containing one or more loops.
- *
- * The first element of the output array is a count of the number of loops.
- * The loop data follows this count. Each loop consists of a count of the
- * number of vertices it contains, followed by the vertices. Each vertex
- * is an X and Y coordinate. For example, a single triangle might be
- * described by this array:
- *
- * 1., 3., 0., 0., 1., 0., 0., 1.
- * ^ ^ ^ ^ ^ ^ ^ ^
- * #loops #verts x1 y1 x2 y2 x3 y3
- *
- * A two-loop glyph would look like this:
- *
- * 2., 3., 0.,0., 1.,0., 0.,1., 3., .2,.2, .4,.2, .2,.4
- *
- * Line segments from the TTPOLYGON are transferred to the output array in
- * the obvious way. Quadratic splines in the TTPOLYGON are converted to
- * collections of line segments
- *****************************************************************************/
-
-static int
-MakeLinesFromGlyph(IN UCHAR* glyphBuf,
- IN DWORD glyphSize,
- IN FLOAT chordalDeviation)
- {
- UCHAR* p;
- int status = 0;
-
-
- /*
- * Pick up all the polygons (aka loops) that make up the glyph:
- */
- if (!AppendToLineBuf(0.0F)) /* loop count at LineBuf[0] */
- goto exit;
-
- p = glyphBuf;
- while (p < glyphBuf + glyphSize)
- {
- if (!MakeLinesFromTTPolygon(&p, chordalDeviation))
- goto exit;
- LineBuf[0] += 1.0F; /* increment loop count */
- }
-
- status = 1;
-
-exit:
- return status;
- }
-
-
-
-/*****************************************************************************
- * MakeLinesFromTTPolygon
- *
- * Converts a TTPOLYGONHEADER and its associated curve structures into a
- * single polyline loop in the global LineBuf.
- *****************************************************************************/
-
-static int
-MakeLinesFromTTPolygon( IN OUT UCHAR** pp,
- IN FLOAT chordalDeviation)
- {
- DWORD polySize;
- UCHAR* polyStart;
- DWORD vertexCountIndex;
-
- /*
- * Record where the polygon data begins, and where the loop's
- * vertex count resides:
- */
- polyStart = *pp;
- vertexCountIndex = LineBufIndex;
- if (!AppendToLineBuf(0.0F))
- return 0;
-
- /*
- * Extract relevant data from the TTPOLYGONHEADER:
- */
- polySize = GetDWord(pp);
- if (GetDWord(pp) != TT_POLYGON_TYPE) /* polygon type */
- return 0;
- if (!AppendToLineBuf((FLOAT) GetFixed(pp))) /* first X coord */
- return 0;
- if (!AppendToLineBuf((FLOAT) GetFixed(pp))) /* first Y coord */
- return 0;
- LineBuf[vertexCountIndex] += 1.0F;
-
- /*
- * Process each of the TTPOLYCURVE structures in the polygon:
- */
- while (*pp < polyStart + polySize)
- if (!MakeLinesFromTTPolycurve( pp,
- vertexCountIndex,
- chordalDeviation))
- return 0;
-
- return 1;
- }
-
-
-
-/*****************************************************************************
- * MakeLinesFromTTPolyCurve
- *
- * Converts the lines and splines in a single TTPOLYCURVE structure to points
- * in the global LineBuf.
- *****************************************************************************/
-
-static int
-MakeLinesFromTTPolycurve( IN OUT UCHAR** pp,
- IN DWORD vertexCountIndex,
- IN FLOAT chordalDeviation)
- {
- WORD type;
- WORD pointCount;
-
-
- /*
- * Pick up the relevant fields of the TTPOLYCURVE structure:
- */
- type = (WORD) GetWord(pp);
- pointCount = (WORD) GetWord(pp);
-
- /*
- * Convert the "curve" to line segments:
- */
- if (type == TT_PRIM_LINE)
- return MakeLinesFromTTLine( pp,
- vertexCountIndex,
- pointCount);
- else if (type == TT_PRIM_QSPLINE)
- return MakeLinesFromTTQSpline( pp,
- vertexCountIndex,
- pointCount,
- chordalDeviation);
- else
- return 0;
- }
-
-
-
-/*****************************************************************************
- * MakeLinesFromTTLine
- *
- * Converts points from the polyline in a TT_PRIM_LINE structure to
- * equivalent points in the global LineBuf.
- *****************************************************************************/
-static int
-MakeLinesFromTTLine( IN OUT UCHAR** pp,
- IN DWORD vertexCountIndex,
- IN WORD pointCount)
- {
- /*
- * Just copy the line segments into the line buffer (converting
- * type as we go):
- */
- LineBuf[vertexCountIndex] += pointCount;
- while (pointCount--)
- {
- if (!AppendToLineBuf((FLOAT) GetFixed(pp)) /* X coord */
- || !AppendToLineBuf((FLOAT) GetFixed(pp))) /* Y coord */
- return 0;
- }
-
- return 1;
- }
-
-
-
-/*****************************************************************************
- * MakeLinesFromTTQSpline
- *
- * Converts points from the poly quadratic spline in a TT_PRIM_QSPLINE
- * structure to polyline points in the global LineBuf.
- *****************************************************************************/
-
-static int
-MakeLinesFromTTQSpline( IN OUT UCHAR** pp,
- IN DWORD vertexCountIndex,
- IN WORD pointCount,
- IN FLOAT chordalDeviation)
- {
- FLOAT x0, y0, x1, y1, x2, y2;
- WORD point;
-
- /*
- * Process each of the non-interpolated points in the outline.
- * To do this, we need to generate two interpolated points (the
- * start and end of the arc) for each non-interpolated point.
- * The first interpolated point is always the one most recently
- * stored in LineBuf, so we just extract it from there. The
- * second interpolated point is either the average of the next
- * two points in the QSpline, or the last point in the QSpline
- * if only one remains.
- */
- for (point = 0; point < pointCount - 1; ++point)
- {
- x0 = LineBuf[LineBufIndex - 2];
- y0 = LineBuf[LineBufIndex - 1];
-
- x1 = (FLOAT) GetFixed(pp);
- y1 = (FLOAT) GetFixed(pp);
-
- if (point == pointCount - 2)
- {
- /*
- * This is the last arc in the QSpline. The final
- * point is the end of the arc.
- */
- x2 = (FLOAT) GetFixed(pp);
- y2 = (FLOAT) GetFixed(pp);
- }
- else
- {
- /*
- * Peek at the next point in the input to compute
- * the end of the arc:
- */
- x2 = 0.5F * (x1 + (FLOAT) GetFixed(pp));
- y2 = 0.5F * (y1 + (FLOAT) GetFixed(pp));
- /*
- * Push the point back onto the input so it will
- * be reused as the next off-curve point:
- */
- *pp -= 8;
- }
-
- if (!MakeLinesFromArc( x0, y0,
- x1, y1,
- x2, y2,
- vertexCountIndex,
- chordalDeviation * chordalDeviation))
- return 0;
- }
-
- return 1;
- }
-
-
-
-/*****************************************************************************
- * MakeLinesFromArc
- *
- * Subdivides one arc of a quadratic spline until the chordal deviation
- * tolerance requirement is met, then places the resulting set of line
- * segments in the global LineBuf.
- *****************************************************************************/
-
-static int
-MakeLinesFromArc( IN FLOAT x0,
- IN FLOAT y0,
- IN FLOAT x1,
- IN FLOAT y1,
- IN FLOAT x2,
- IN FLOAT y2,
- IN DWORD vertexCountIndex,
- IN FLOAT chordalDeviationSquared)
- {
- FLOAT x01;
- FLOAT y01;
- FLOAT x12;
- FLOAT y12;
- FLOAT midPointX;
- FLOAT midPointY;
- FLOAT deltaX;
- FLOAT deltaY;
-
- /*
- * Calculate midpoint of the curve by de Casteljau:
- */
- x01 = 0.5F * (x0 + x1);
- y01 = 0.5F * (y0 + y1);
- x12 = 0.5F * (x1 + x2);
- y12 = 0.5F * (y1 + y2);
- midPointX = 0.5F * (x01 + x12);
- midPointY = 0.5F * (y01 + y12);
-
-
- /*
- * Estimate chordal deviation by the distance from the midpoint
- * of the curve to its non-interpolated control point. If this
- * distance is greater than the specified chordal deviation
- * constraint, then subdivide. Otherwise, generate polylines
- * from the three control points.
- */
- deltaX = midPointX - x1;
- deltaY = midPointY - y1;
- if (deltaX * deltaX + deltaY * deltaY > chordalDeviationSquared)
- {
- MakeLinesFromArc( x0, y0,
- x01, y01,
- midPointX, midPointY,
- vertexCountIndex,
- chordalDeviationSquared);
-
- MakeLinesFromArc( midPointX, midPointY,
- x12, y12,
- x2, y2,
- vertexCountIndex,
- chordalDeviationSquared);
- }
- else
- {
- /*
- * The "pen" is already at (x0, y0), so we don't need to
- * add that point to the LineBuf.
- */
- if (!AppendToLineBuf(x1)
- || !AppendToLineBuf(y1)
- || !AppendToLineBuf(x2)
- || !AppendToLineBuf(y2))
- return 0;
- LineBuf[vertexCountIndex] += 2.0F;
- }
-
- return 1;
- }
-
-
-
-/*****************************************************************************
- * InitLineBuf
- *
- * Initializes the global LineBuf and its associated size and current-element
- * counters.
- *****************************************************************************/
-
-static int
-InitLineBuf(void)
- {
- if (!(LineBuf = (FLOAT*)
- __wglMalloc((LineBufSize = LINE_BUF_QUANT) * sizeof(FLOAT))))
- return 0;
- LineBufIndex = 0;
- return 1;
- }
-
-
-
-/*****************************************************************************
- * InitVertBuf
- *
- * Initializes the global VertBuf and its associated size and current-element
- * counters.
- *****************************************************************************/
-
-static int
-InitVertBuf(void)
- {
- if (!(VertBuf = (FLOAT*)
- __wglMalloc((VertBufSize = VERT_BUF_QUANT) * sizeof(FLOAT))))
- return 0;
- VertBufIndex = 0;
- return 1;
- }
-
-
-
-/*****************************************************************************
- * AppendToLineBuf
- *
- * Appends one floating-point value to the global LineBuf array. Return value
- * is non-zero for success, zero for failure.
- *****************************************************************************/
-
-static int
-AppendToLineBuf(FLOAT value)
- {
- if (LineBufIndex >= LineBufSize)
- {
- FLOAT* f;
-
- f = (FLOAT*) __wglRealloc(LineBuf,
- (LineBufSize += LINE_BUF_QUANT) * sizeof(FLOAT));
- if (!f)
- return 0;
- LineBuf = f;
- }
- LineBuf[LineBufIndex++] = value;
- return 1;
- }
-
-
-
-/*****************************************************************************
- * AppendToVertBuf
- *
- * Appends one floating-point value to the global VertBuf array. Return value
- * is non-zero for success, zero for failure.
- *
- * Note that we can't realloc this one, because the tessellator is using
- * pointers into it.
- *****************************************************************************/
-
-static int
-AppendToVertBuf(FLOAT value)
- {
- if (VertBufIndex >= VertBufSize)
- return 0;
- VertBuf[VertBufIndex++] = value;
- return 1;
- }
-
-
-
-/*****************************************************************************
- * FreeLineBuf
- *
- * Cleans up vertex buffer structure.
- *****************************************************************************/
-
-static void
-FreeLineBuf(void)
- {
- if (LineBuf)
- {
- __wglFree(LineBuf);
- LineBuf = NULL;
- }
- }
-
-
-
-/*****************************************************************************
- * FreeVertBuf
- *
- * Cleans up vertex buffer structure.
- *****************************************************************************/
-
-static void
-FreeVertBuf(void)
- {
- if (VertBuf)
- {
- __wglFree(VertBuf);
- VertBuf = NULL;
- }
- }
-
-
-
-/*****************************************************************************
- * GetWord
- *
- * Fetch the next 16-bit word from a little-endian byte stream, and increment
- * the stream pointer to the next unscanned byte.
- *****************************************************************************/
-
-static long GetWord(UCHAR** p)
- {
- long value;
-
- value = ((*p)[1] << 8) + (*p)[0];
- *p += 2;
- return value;
- }
-
-
-
-/*****************************************************************************
- * GetDWord
- *
- * Fetch the next 32-bit word from a little-endian byte stream, and increment
- * the stream pointer to the next unscanned byte.
- *****************************************************************************/
-
-static long GetDWord(UCHAR** p)
- {
- long value;
-
- value = ((*p)[3] << 24) + ((*p)[2] << 16) + ((*p)[1] << 8) + (*p)[0];
- *p += 4;
- return value;
- }
-
-
-
-
-/*****************************************************************************
- * GetFixed
- *
- * Fetch the next 32-bit fixed-point value from a little-endian byte stream,
- * convert it to floating-point, and increment the stream pointer to the next
- * unscanned byte.
- *****************************************************************************/
-
-static double GetFixed(
- UCHAR** p)
-{
- long hiBits, loBits;
- double value;
-
- loBits = GetWord(p);
- hiBits = GetWord(p);
- value = (double) ((hiBits << 16) | loBits) / 65536.0;
-
- return value * ScaleFactor;
-}
-
-// ***********************************************************************
-
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglwgl.h b/mesalib/src/mesa/drivers/windows/gldirect/dglwgl.h
deleted file mode 100644
index 1dc5c034e..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglwgl.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: OpenGL window functions (wgl*).
-*
-****************************************************************************/
-
-#ifndef __DGLWGL_H
-#define __DGLWGL_H
-
-// Disable compiler complaints about DLL linkage
-#pragma warning (disable:4273)
-
-// Macros to control compilation
-#define STRICT
-#define WIN32_LEAN_AND_MEAN
-
-#include <windows.h>
-#include <GL\gl.h>
-
-#include "dglcontext.h"
-#include "dglglobals.h"
-#include "dglmacros.h"
-#include "ddlog.h"
-#include "dglpf.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-typedef struct {
- PROC proc;
- char *name;
-} DGL_extension;
-
-#ifndef __MINGW32__
-/* XXX why is this here?
- * It should probaby be somewhere in src/mesa/drivers/windows/
- */
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP)
-# define WGL_FONT_LINES 0
-# define WGL_FONT_POLYGONS 1
-#ifndef _GNU_H_WINDOWS32_FUNCTIONS
-# ifdef UNICODE
-# define wglUseFontBitmaps wglUseFontBitmapsW
-# define wglUseFontOutlines wglUseFontOutlinesW
-# else
-# define wglUseFontBitmaps wglUseFontBitmapsA
-# define wglUseFontOutlines wglUseFontOutlinesA
-# endif /* !UNICODE */
-#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
-typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
-typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
-typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
-#if !defined(GLX_USE_MESA)
-#include <GL/mesa_wgl.h>
-#endif
-#endif
-#endif /* !__MINGW32__ */
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _USE_GLD3_WGL
-int APIENTRY DGL_ChoosePixelFormat(HDC a, CONST PIXELFORMATDESCRIPTOR *ppfd);
-BOOL APIENTRY DGL_CopyContext(HGLRC a, HGLRC b, UINT c);
-HGLRC APIENTRY DGL_CreateContext(HDC a);
-HGLRC APIENTRY DGL_CreateLayerContext(HDC a, int b);
-BOOL APIENTRY DGL_DeleteContext(HGLRC a);
-BOOL APIENTRY DGL_DescribeLayerPlane(HDC a, int b, int c, UINT d, LPLAYERPLANEDESCRIPTOR e);
-int APIENTRY DGL_DescribePixelFormat(HDC a, int b, UINT c, LPPIXELFORMATDESCRIPTOR d);
-HGLRC APIENTRY DGL_GetCurrentContext(void);
-HDC APIENTRY DGL_GetCurrentDC(void);
-PROC APIENTRY DGL_GetDefaultProcAddress(LPCSTR a);
-int APIENTRY DGL_GetLayerPaletteEntries(HDC a, int b, int c, int d, COLORREF *e);
-int APIENTRY DGL_GetPixelFormat(HDC a);
-PROC APIENTRY DGL_GetProcAddress(LPCSTR a);
-BOOL APIENTRY DGL_MakeCurrent(HDC a, HGLRC b);
-BOOL APIENTRY DGL_RealizeLayerPalette(HDC a, int b, BOOL c);
-int APIENTRY DGL_SetLayerPaletteEntries(HDC a, int b, int c, int d, CONST COLORREF *e);
-BOOL APIENTRY DGL_SetPixelFormat(HDC a, int b, CONST PIXELFORMATDESCRIPTOR *c);
-BOOL APIENTRY DGL_ShareLists(HGLRC a, HGLRC b);
-BOOL APIENTRY DGL_SwapBuffers(HDC a);
-BOOL APIENTRY DGL_SwapLayerBuffers(HDC a, UINT b);
-BOOL APIENTRY DGL_UseFontBitmapsA(HDC a, DWORD b, DWORD c, DWORD d);
-BOOL APIENTRY DGL_UseFontBitmapsW(HDC a, DWORD b, DWORD c, DWORD d);
-BOOL APIENTRY DGL_UseFontOutlinesA(HDC a, DWORD b, DWORD c, DWORD d, FLOAT e, FLOAT f, int g, LPGLYPHMETRICSFLOAT h);
-BOOL APIENTRY DGL_UseFontOutlinesW(HDC a, DWORD b, DWORD c, DWORD d, FLOAT e, FLOAT f, int g, LPGLYPHMETRICSFLOAT h);
-#endif //_USE_GLD3_WGL
-
-BOOL dglWglResizeBuffers(struct gl_context *ctx, BOOL bDefaultDriver);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dll_main.c b/mesalib/src/mesa/drivers/windows/gldirect/dll_main.c
deleted file mode 100644
index 1d7ac64f4..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dll_main.c
+++ /dev/null
@@ -1,817 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Win32 DllMain functions.
-*
-****************************************************************************/
-
-// INITGUID must only be defined once.
-// Don't put it in a shared header file!
-// GLD3 uses dxguid.lib, so INITGUID must *not* be used!
-#ifndef _USE_GLD3_WGL
-#define INITGUID
-#endif // _USE_GLD3_WGL
-
-#include "dllmain.h"
-
-//#include "snap/graphics.h"
-//#include "drvlib/os/os.h"
-
-#ifdef _USE_GLD3_WGL
-typedef void (APIENTRY *LPDGLSPLASHSCREEN)(int, int, char*);
-#include "gld_driver.h"
-#endif
-
-// ***********************************************************************
-
-BOOL bInitialized = FALSE; // callback driver initialized?
-BOOL bExited = FALSE; // callback driver exited this instance?
-HINSTANCE hInstanceDll = NULL; // DLL instance handle
-
-static BOOL bDriverValidated = FALSE; // prior validation status
-static BOOL bSplashScreen = TRUE; // Splash Screen ?
-static BOOL bValidINIFound = FALSE; // Have we found a valid INI file?
-
-HHOOK hKeyHook = NULL; // global keyboard handler hook
-
-// Multi-threaded support needs to be reflected in Mesa code. (DaveM)
-int _gld_bMultiThreaded = FALSE;
-
-// ***********************************************************************
-
-DWORD dwLogging = 0; // Logging flag
-DWORD dwDebugLevel = 0; // Log debug level
-
-char szLogPath[_MAX_PATH] = {"\0"}; // Log file path
-char szSNAPPath[_MAX_PATH] = {"\0"}; // SNAP driver path
-
-#ifndef _USE_GLD3_WGL
-DGL_wglFuncs wglFuncs = {
- sizeof(DGL_wglFuncs),
- DGL_ChoosePixelFormat,
- DGL_CopyContext,
- DGL_CreateContext,
- DGL_CreateLayerContext,
- DGL_DeleteContext,
- DGL_DescribeLayerPlane,
- DGL_DescribePixelFormat,
- DGL_GetCurrentContext,
- DGL_GetCurrentDC,
- DGL_GetDefaultProcAddress,
- DGL_GetLayerPaletteEntries,
- DGL_GetPixelFormat,
- DGL_GetProcAddress,
- DGL_MakeCurrent,
- DGL_RealizeLayerPalette,
- DGL_SetLayerPaletteEntries,
- DGL_SetPixelFormat,
- DGL_ShareLists,
- DGL_SwapBuffers,
- DGL_SwapLayerBuffers,
- DGL_UseFontBitmapsA,
- DGL_UseFontBitmapsW,
- DGL_UseFontOutlinesA,
- DGL_UseFontOutlinesW,
-};
-
-DGL_mesaFuncs mesaFuncs = {
- sizeof(DGL_mesaFuncs),
-};
-#endif // _USE_GLD3_WGL
-
-// ***********************************************************************
-
-typedef struct {
- DWORD dwDriver; // 0=SciTech SW, 1=Direct3D SW, 2=Direct3D HW
- BOOL bMipmapping; // 0=off, 1=on
- BOOL bMultitexture; // 0=off, 1=on
- BOOL bWaitForRetrace; // 0=off, 1=on
- BOOL bFullscreenBlit; // 0=off, 1=on
- BOOL bFastFPU; // 0=off, 1=on
- BOOL bDirectDrawPersistant;// 0=off, 1=on
- BOOL bPersistantBuffers; // 0=off, 1=on
- DWORD dwLogging; // 0=off, 1=normal, 2=crash-proof
- DWORD dwLoggingSeverity; // 0=all, 1=warnings+errors, 2=errors only
- BOOL bMessageBoxWarnings;// 0=off, 1=on
- BOOL bMultiThreaded; // 0=off, 1=on
- BOOL bAppCustomizations; // 0=off, 1=on
- BOOL bHotKeySupport; // 0=off, 1=on
- BOOL bSplashScreen; // 0=off, 1=on
-
-#ifdef _USE_GLD3_WGL
- //
- // New for GLDirect 3.0
- //
- DWORD dwAdapter; // DX8 adpater ordinal
- DWORD dwTnL; // Transform & Lighting type
- DWORD dwMultisample; // DX8 multisample type
-#endif // _USE_GLD3_WGL
-} INI_settings;
-
-static INI_settings ini;
-
-// ***********************************************************************
-
-BOOL APIENTRY DGL_initDriver(
-#ifdef _USE_GLD3_WGL
- void)
-{
-#else
- DGL_wglFuncs *lpWglFuncs,
- DGL_mesaFuncs *lpMesaFuncs)
-{
- // Check for valid pointers
- if ((lpWglFuncs == NULL) || (lpMesaFuncs == NULL))
- return FALSE;
-
- // Check for valid structs
- if (lpWglFuncs->dwSize != sizeof(DGL_wglFuncs)) {
- return FALSE;
- }
-
- // Check for valid structs
- if (lpMesaFuncs->dwSize != sizeof(DGL_mesaFuncs)) {
- return FALSE;
- }
-
- // Copy the Mesa functions
- memcpy(&mesaFuncs, lpMesaFuncs, sizeof(DGL_mesaFuncs));
-
- // Pass back the wgl functions
- memcpy(lpWglFuncs, &wglFuncs, sizeof(DGL_wglFuncs));
-#endif // _USE_GLD3_WGL
-
- // Finally initialize the callback driver
- if (!dglInitDriver())
- return FALSE;
-
- return TRUE;
-};
-
-// ***********************************************************************
-
-BOOL ReadINIFile(
- HINSTANCE hInstance)
-{
- char szModuleFilename[MAX_PATH];
- char szSystemDirectory[MAX_PATH];
- const char szSectionName[] = "Config";
- char szINIFile[MAX_PATH];
- int pos;
-
- // Now using the DLL module handle. KeithH, 24/May/2000.
- // Addendum: GetModuleFileName(NULL, ... returns process filename,
- // GetModuleFileName(hModule, ... returns DLL filename,
-
- // Get the dll path and filename.
- GetModuleFileName(hInstance, &szModuleFilename[0], MAX_PATH); // NULL for current process
- // Get the System directory.
- GetSystemDirectory(&szSystemDirectory[0], MAX_PATH);
-
- // Test to see if DLL is in system directory.
- if (strnicmp(szModuleFilename, szSystemDirectory, strlen(szSystemDirectory))==0) {
- // DLL *is* in system directory.
- // Return FALSE to indicate that registry keys should be read.
- return FALSE;
- }
-
- // Compose filename of INI file
- strcpy(szINIFile, szModuleFilename);
- pos = strlen(szINIFile);
- while (szINIFile[pos] != '\\') {
- pos--;
- }
- szINIFile[pos+1] = '\0';
- // Use run-time DLL path for log file too
- strcpy(szLogPath, szINIFile);
- szLogPath[pos] = '\0';
- // Complete full INI file path
- strcat(szINIFile, "gldirect.ini");
-
- // Read settings from private INI file.
- // Note that defaults are contained in the calls.
- ini.dwDriver = GetPrivateProfileInt(szSectionName, "dwDriver", 2, szINIFile);
- ini.bMipmapping = GetPrivateProfileInt(szSectionName, "bMipmapping", 1, szINIFile);
- ini.bMultitexture = GetPrivateProfileInt(szSectionName, "bMultitexture", 1, szINIFile);
- ini.bWaitForRetrace = GetPrivateProfileInt(szSectionName, "bWaitForRetrace", 0, szINIFile);
- ini.bFullscreenBlit = GetPrivateProfileInt(szSectionName, "bFullscreenBlit", 0, szINIFile);
- ini.bFastFPU = GetPrivateProfileInt(szSectionName, "bFastFPU", 1, szINIFile);
- ini.bDirectDrawPersistant = GetPrivateProfileInt(szSectionName, "bPersistantDisplay", 0, szINIFile);
- ini.bPersistantBuffers = GetPrivateProfileInt(szSectionName, "bPersistantResources", 0, szINIFile);
- ini.dwLogging = GetPrivateProfileInt(szSectionName, "dwLogging", 0, szINIFile);
- ini.dwLoggingSeverity = GetPrivateProfileInt(szSectionName, "dwLoggingSeverity", 0, szINIFile);
- ini.bMessageBoxWarnings = GetPrivateProfileInt(szSectionName, "bMessageBoxWarnings", 0, szINIFile);
- ini.bMultiThreaded = GetPrivateProfileInt(szSectionName, "bMultiThreaded", 0, szINIFile);
- ini.bAppCustomizations = GetPrivateProfileInt(szSectionName, "bAppCustomizations", 1, szINIFile);
- ini.bHotKeySupport = GetPrivateProfileInt(szSectionName, "bHotKeySupport", 0, szINIFile);
- ini.bSplashScreen = GetPrivateProfileInt(szSectionName, "bSplashScreen", 1, szINIFile);
-
-#ifdef _USE_GLD3_WGL
- // New for GLDirect 3.x
- ini.dwAdapter = GetPrivateProfileInt(szSectionName, "dwAdapter", 0, szINIFile);
- // dwTnL now defaults to zero (chooses TnL at runtime). KeithH
- ini.dwTnL = GetPrivateProfileInt(szSectionName, "dwTnL", 0, szINIFile);
- ini.dwMultisample = GetPrivateProfileInt(szSectionName, "dwMultisample", 0, szINIFile);
-#endif
-
- return TRUE;
-}
-
-// ***********************************************************************
-
-BOOL dllReadRegistry(
- HINSTANCE hInstance)
-{
- // Read settings from INI file, if available
- bValidINIFound = FALSE;
- if (ReadINIFile(hInstance)) {
- const char *szRendering[3] = {
- "SciTech Software Renderer",
- "Direct3D MMX Software Renderer",
- "Direct3D Hardware Renderer"
- };
- // Set globals
- glb.bPrimary = 1;
- glb.bHardware = (ini.dwDriver == 2) ? 1 : 0;
-#ifndef _USE_GLD3_WGL
- memset(&glb.ddGuid, 0, sizeof(glb.ddGuid));
- glb.d3dGuid = (ini.dwDriver == 2) ? IID_IDirect3DHALDevice : IID_IDirect3DRGBDevice;
-#endif // _USE_GLD3_WGL
- strcpy(glb.szDDName, "Primary");
- strcpy(glb.szD3DName, szRendering[ini.dwDriver]);
- glb.dwRendering = ini.dwDriver;
- glb.bUseMipmaps = ini.bMipmapping;
- glb.bMultitexture = ini.bMultitexture;
- glb.bWaitForRetrace = ini.bWaitForRetrace;
- glb.bFullscreenBlit = ini.bFullscreenBlit;
- glb.bFastFPU = ini.bFastFPU;
- glb.bDirectDrawPersistant = ini.bDirectDrawPersistant;
- glb.bPersistantBuffers = ini.bPersistantBuffers;
- dwLogging = ini.dwLogging;
- dwDebugLevel = ini.dwLoggingSeverity;
- glb.bMessageBoxWarnings = ini.bMessageBoxWarnings;
- glb.bMultiThreaded = ini.bMultiThreaded;
- glb.bAppCustomizations = ini.bAppCustomizations;
- glb.bHotKeySupport = ini.bHotKeySupport;
- bSplashScreen = ini.bSplashScreen;
-#ifdef _USE_GLD3_WGL
- // New for GLDirect 3.x
- glb.dwAdapter = ini.dwAdapter;
- glb.dwDriver = ini.dwDriver;
- glb.dwTnL = ini.dwTnL;
- glb.dwMultisample = ini.dwMultisample;
-#endif
- bValidINIFound = TRUE;
- return TRUE;
- }
- // Read settings from registry
- else {
- HKEY hReg;
- DWORD cbValSize;
- DWORD dwType = REG_SZ; // Registry data type for strings
- BOOL bRegistryError;
- BOOL bSuccess;
-
-#define REG_READ_DWORD(a, b) \
- cbValSize = sizeof(b); \
- if (ERROR_SUCCESS != RegQueryValueEx( hReg, (a), \
- NULL, NULL, (LPBYTE)&(b), &cbValSize )) \
- bRegistryError = TRUE;
-
-#define REG_READ_DEVICEID(a, b) \
- cbValSize = MAX_DDDEVICEID_STRING; \
- if(ERROR_SUCCESS != RegQueryValueEx(hReg, (a), 0, &dwType, \
- (LPBYTE)&(b), &cbValSize)) \
- bRegistryError = TRUE;
-
-#define REG_READ_STRING(a, b) \
- cbValSize = sizeof((b)); \
- if(ERROR_SUCCESS != RegQueryValueEx(hReg, (a), 0, &dwType, \
- (LPBYTE)&(b), &cbValSize)) \
- bRegistryError = TRUE;
-
- // Read settings from the registry.
-
- // Open the registry key for the current user if it exists.
- bSuccess = (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER,
- DIRECTGL_REG_SETTINGS_KEY,
- 0,
- KEY_READ,
- &hReg));
- // Otherwise open the registry key for the local machine.
- if (!bSuccess)
- bSuccess = (ERROR_SUCCESS == RegOpenKeyEx(DIRECTGL_REG_KEY_ROOT,
- DIRECTGL_REG_SETTINGS_KEY,
- 0,
- KEY_READ,
- &hReg));
- if (!bSuccess)
- return FALSE;
-
- bRegistryError = FALSE;
-
- REG_READ_DWORD(DIRECTGL_REG_SETTING_PRIMARY, glb.bPrimary);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_D3D_HW, glb.bHardware);
-#ifndef _USE_GLD3_WGL
- REG_READ_DWORD(DIRECTGL_REG_SETTING_DD_GUID, glb.ddGuid);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_D3D_GUID, glb.d3dGuid);
-#endif // _USE_GLD3_WGL
- REG_READ_DWORD(DIRECTGL_REG_SETTING_LOGGING, dwLogging);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_DEBUGLEVEL, dwDebugLevel);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_RENDERING, glb.dwRendering);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_MULTITEXTURE, glb.bMultitexture);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_WAITFORRETRACE, glb.bWaitForRetrace);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_FULLSCREENBLIT, glb.bFullscreenBlit);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_USEMIPMAPS, glb.bUseMipmaps);
-
- REG_READ_DEVICEID(DIRECTGL_REG_SETTING_DD_NAME, glb.szDDName);
- REG_READ_DEVICEID(DIRECTGL_REG_SETTING_D3D_NAME, glb.szD3DName);
-
- REG_READ_DWORD(DIRECTGL_REG_SETTING_MSGBOXWARNINGS, glb.bMessageBoxWarnings);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_PERSISTDISPLAY, glb.bDirectDrawPersistant);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_PERSISTBUFFERS, glb.bPersistantBuffers);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_FASTFPU, glb.bFastFPU);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_HOTKEYS, glb.bHotKeySupport);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_MULTITHREAD, glb.bMultiThreaded);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_APPCUSTOM, glb.bAppCustomizations);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_SPLASHSCREEN, bSplashScreen);
-
-#ifdef _USE_GLD3_WGL
- // New for GLDirect 3.x
- glb.dwDriver = glb.dwRendering;
- REG_READ_DWORD(DIRECTGL_REG_SETTING_ADAPTER, glb.dwAdapter);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_TNL, glb.dwTnL);
- REG_READ_DWORD(DIRECTGL_REG_SETTING_MULTISAMPLE, glb.dwMultisample);
-#endif
-
- RegCloseKey(hReg);
-
- // Open the global registry key for GLDirect
- bSuccess = (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- DIRECTGL_REG_SETTINGS_KEY,
- 0,
- KEY_READ,
- &hReg));
- if (bSuccess) {
- // Read the installation path for GLDirect
- REG_READ_STRING("InstallLocation",szLogPath);
- RegCloseKey(hReg);
- }
-
- if (bRegistryError || !bSuccess)
- return FALSE;
- else
-
- return TRUE;
-
-#undef REG_READ_DWORD
-#undef REG_READ_DEVICEID
-#undef REG_READ_STRING
- }
-}
-
-// ***********************************************************************
-
-BOOL dllWriteRegistry(
- void )
-{
- HKEY hReg;
- DWORD dwCreateDisposition, cbValSize;
- BOOL bRegistryError = FALSE;
-
-#define REG_WRITE_DWORD(a, b) \
- cbValSize = sizeof(b); \
- if (ERROR_SUCCESS != RegSetValueEx( hReg, (a), \
- 0, REG_DWORD, (LPBYTE)&(b), cbValSize )) \
- bRegistryError = TRUE;
-
- if (ERROR_SUCCESS == RegCreateKeyEx( DIRECTGL_REG_KEY_ROOT, DIRECTGL_REG_SETTINGS_KEY,
- 0, NULL, 0, KEY_WRITE, NULL, &hReg,
- &dwCreateDisposition )) {
- RegFlushKey(hReg); // Make sure keys are written to disk
- RegCloseKey(hReg);
- hReg = NULL;
- }
-
- if (bRegistryError)
- return FALSE;
- else
- return TRUE;
-
-#undef REG_WRITE_DWORD
-}
-
-// ***********************************************************************
-
-void dglInitHotKeys(HINSTANCE hInstance)
-{
- // Hot-Key support at all?
- if (!glb.bHotKeySupport)
- return;
-
- // Install global keyboard interceptor
- hKeyHook = SetWindowsHookEx(WH_KEYBOARD, dglKeyProc, hInstance, 0);
-}
-
-// ***********************************************************************
-
-void dglExitHotKeys(void)
-{
- // Hot-Key support at all?
- if (!glb.bHotKeySupport)
- return;
-
- // Remove global keyboard interceptor
- if (hKeyHook)
- UnhookWindowsHookEx(hKeyHook);
- hKeyHook = NULL;
-}
-
-// ***********************************************************************
-
-// Note: This app-customization step must be performed in both the main
-// OpenGL32 driver and the callback driver DLLs for multithreading option.
-void dglSetAppCustomizations(void)
-{
- char szModuleFileName[MAX_PATH];
- int iSize = MAX_PATH;
-
- // Get the currently loaded EXE filename.
- GetModuleFileName(NULL, &szModuleFileName[0], MAX_PATH); // NULL for current process
- strupr(szModuleFileName);
- iSize = strlen(szModuleFileName);
-
- // Check for specific EXEs and adjust global settings accordingly
-
- // NOTE: In GLD3.x "bDirectDrawPersistant" corresponds to IDirect3D8 and
- // "bPersistantBuffers" corresponds to IDirect3DDevice8. KeithH
-
- // Case 1: 3DStudio must be multi-threaded
- // Added: Discreet GMAX (3DStudio MAX 4 for gamers. KeithH)
- if (strstr(szModuleFileName, "3DSMAX.EXE")
- || strstr(szModuleFileName, "3DSVIZ.EXE")
- || strstr(szModuleFileName, "GMAX.EXE")) {
- glb.bMultiThreaded = TRUE;
- glb.bDirectDrawPersistant = FALSE;
- glb.bPersistantBuffers = FALSE;
- return;
- }
-
- // Case 2: Solid Edge must use pre-allocated resources for all GLRCs
- if (strstr(szModuleFileName, "PART.EXE")
- || strstr(szModuleFileName, "ASSEMBL.EXE")
- || strstr(szModuleFileName, "DRAFT.EXE")
- || strstr(szModuleFileName, "SMARTVW.EXE")
- || strstr(szModuleFileName, "SMETAL.EXE")) {
- glb.bMultiThreaded = FALSE;
- glb.bDirectDrawPersistant = TRUE;
- glb.bPersistantBuffers = FALSE;
- return;
- }
-
- // Case 3: Sudden Depth creates and destroys GLRCs on paint commands
- if (strstr(szModuleFileName, "SUDDEPTH.EXE")
- || strstr(szModuleFileName, "SUDDEMO.EXE")) {
- glb.bMultiThreaded = FALSE;
- glb.bDirectDrawPersistant = TRUE;
- glb.bPersistantBuffers = TRUE;
- glb.bFullscreenBlit = TRUE;
- return;
- }
-
- // Case 4: StereoGraphics test apps create and destroy GLRCs on paint commands
- if (strstr(szModuleFileName, "REDBLUE.EXE")
- || strstr(szModuleFileName, "DIAGNOSE.EXE")) {
- glb.bMultiThreaded = FALSE;
- glb.bDirectDrawPersistant = TRUE;
- glb.bPersistantBuffers = TRUE;
- return;
- }
-
- // Case 5: Pipes screen savers share multiple GLRCs for same window
- if (strstr(szModuleFileName, "PIPES.SCR")
- || (strstr(szModuleFileName, "PIPES") && strstr(szModuleFileName, ".SCR"))) {
- glb.bMultiThreaded = FALSE;
- glb.bDirectDrawPersistant = TRUE;
- glb.bPersistantBuffers = TRUE;
- return;
- }
-
- // Case 6: AutoVue uses sub-viewport ops which are temporarily broken in stereo window
- if (strstr(szModuleFileName, "AVWIN.EXE")) {
- glb.bMultiThreaded = FALSE;
- glb.bDirectDrawPersistant = TRUE;
- glb.bPersistantBuffers = TRUE;
- return;
- }
- // Case 7: Quake3 is waiting for DDraw objects to be released at exit
- if (strstr(szModuleFileName, "QUAKE")) {
- glb.bMultiThreaded = FALSE;
- glb.bDirectDrawPersistant = FALSE;
- glb.bPersistantBuffers = FALSE;
- glb.bFullscreenBlit = FALSE;
- return;
- }
- // Case 8: Reflection GLX server is unable to switch contexts at run-time
- if (strstr(szModuleFileName, "RX.EXE")) {
- glb.bMultiThreaded = FALSE;
- glb.bMessageBoxWarnings = FALSE;
- return;
- }
- // Case 9: Original AutoCAD 2000 must share DDraw objects across GLRCs
- if (strstr(szModuleFileName, "ACAD.EXE")) {
- glb.bFastFPU = FALSE;
- if (GetModuleHandle("wopengl6.hdi") != NULL) {
- glb.bMultiThreaded = FALSE;
- glb.bDirectDrawPersistant = TRUE;
- glb.bPersistantBuffers = FALSE;
- }
- return;
- }
-}
-
-// ***********************************************************************
-
-BOOL dglInitDriver(void)
-{
- UCHAR szExeName[MAX_PATH];
- const char *szRendering[] = {
- "Mesa Software",
- "Direct3D RGB SW",
- "Direct3D HW",
- };
- static BOOL bWarnOnce = FALSE;
-
- // Already initialized?
- if (bInitialized)
- return TRUE;
-
- // Moved from DllMain DLL_PROCESS_ATTACH:
-
- // (Re-)Init defaults
- dglInitGlobals();
-
- // Read registry or INI file settings
- if (!dllReadRegistry(hInstanceDll)) {
- if (!bWarnOnce)
- MessageBox( NULL, "GLDirect has not been configured.\n\n"
- "Please run the configuration program\n"
- "before using GLDirect with applications.\n",
- "GLDirect", MB_OK | MB_ICONWARNING);
- bWarnOnce = TRUE;
- return FALSE;
- }
-
-#ifdef _USE_GLD3_WGL
- // Must do this as early as possible.
- // Need to read regkeys/ini-file first though.
- gldInitDriverPointers(glb.dwDriver);
-
- // Create private driver globals
- _gldDriver.CreatePrivateGlobals();
-#endif
- // Overide settings with application customizations
- if (glb.bAppCustomizations)
- dglSetAppCustomizations();
-
-//#ifndef _USE_GLD3_WGL
- // Set the global memory type to either sysmem or vidmem
- glb.dwMemoryType = glb.bHardware ? DDSCAPS_VIDEOMEMORY : DDSCAPS_SYSTEMMEMORY;
-//#endif
-
- // Multi-threaded support overides persistant display support
- if (glb.bMultiThreaded)
- glb.bDirectDrawPersistant = glb.bPersistantBuffers = FALSE;
-
- // Multi-threaded support needs to be reflected in Mesa code. (DaveM)
- _gld_bMultiThreaded = glb.bMultiThreaded;
-
- // Start logging
- ddlogPathOption(szLogPath);
- ddlogWarnOption(glb.bMessageBoxWarnings);
- ddlogOpen((DDLOG_loggingMethodType)dwLogging,
- (DDLOG_severityType)dwDebugLevel);
-
- // Obtain the name of the calling app
- ddlogMessage(DDLOG_SYSTEM, "Driver : SciTech GLDirect 4.0\n");
- GetModuleFileName(NULL, szExeName, sizeof(szExeName));
- ddlogPrintf(DDLOG_SYSTEM, "Executable : %s", szExeName);
-
- ddlogPrintf(DDLOG_SYSTEM, "DirectDraw device: %s", glb.szDDName);
- ddlogPrintf(DDLOG_SYSTEM, "Direct3D driver : %s", glb.szD3DName);
-
- ddlogPrintf(DDLOG_SYSTEM, "Rendering type : %s", szRendering[glb.dwRendering]);
-
- ddlogPrintf(DDLOG_SYSTEM, "Multithreaded : %s", glb.bMultiThreaded ? "Enabled" : "Disabled");
- ddlogPrintf(DDLOG_SYSTEM, "Display resources: %s", glb.bDirectDrawPersistant ? "Persistant" : "Instanced");
- ddlogPrintf(DDLOG_SYSTEM, "Buffer resources : %s", glb.bPersistantBuffers ? "Persistant" : "Instanced");
-
- dglInitContextState();
- dglBuildPixelFormatList();
- //dglBuildTextureFormatList();
-
- // D3D callback driver is now successfully initialized
- bInitialized = TRUE;
- // D3D callback driver is now ready to be exited
- bExited = FALSE;
-
- return TRUE;
-}
-
-// ***********************************************************************
-
-void dglExitDriver(void)
-{
-
- // Only need to clean up once per instance:
- // May be called implicitly from DLL_PROCESS_DETACH,
- // or explicitly from DGL_exitDriver().
- if (bExited)
- return;
- bExited = TRUE;
-
- // DDraw objects may be invalid when DLL unloads.
-__try {
-
- // Clean-up sequence (moved from DLL_PROCESS_DETACH)
-#ifndef _USE_GLD3_WGL
- dglReleaseTextureFormatList();
-#endif
- dglReleasePixelFormatList();
- dglDeleteContextState();
-
-#ifdef _USE_GLD3_WGL
- _gldDriver.DestroyPrivateGlobals();
-#endif
-
-}
-__except(EXCEPTION_EXECUTE_HANDLER) {
- ddlogPrintf(DDLOG_WARN, "Exception raised in dglExitDriver.");
-}
-
- // Close the log file
- ddlogClose();
-}
-
-// ***********************************************************************
-
-int WINAPI DllMain(
- HINSTANCE hInstance,
- DWORD fdwReason,
- PVOID pvReserved)
-{
- switch (fdwReason) {
- case DLL_PROCESS_ATTACH:
- // Cache DLL instance handle
- hInstanceDll = hInstance;
-
- // Flag that callback driver has yet to be initialized
- bInitialized = bExited = FALSE;
-
-#ifndef _USE_GLD3_WGL
- // Init internal Mesa function pointers
- memset(&mesaFuncs, 0, sizeof(DGL_mesaFuncs));
-#endif // _USE_GLD3_WGL
-
- // Init defaults
- dglInitGlobals();
-
- // Defer rest of DLL initialization to 1st WGL function call
- break;
-
- case DLL_PROCESS_DETACH:
- // Call exit clean-up sequence
- dglExitDriver();
- break;
- }
-
- return TRUE;
-}
-
-// ***********************************************************************
-
-void APIENTRY DGL_exitDriver(void)
-{
- // Call exit clean-up sequence
- dglExitDriver();
-}
-
-// ***********************************************************************
-
-void APIENTRY DGL_reinitDriver(void)
-{
- // Force init sequence again
- bInitialized = bExited = FALSE;
- dglInitDriver();
-}
-
-// ***********************************************************************
-
-int WINAPI DllInitialize(
- HINSTANCE hInstance,
- DWORD fdwReason,
- PVOID pvReserved)
-{
- // Some Watcom compiled executables require this.
- return DllMain(hInstance, fdwReason, pvReserved);
-}
-
-// ***********************************************************************
-
-void DGL_LoadSplashScreen(int piReg, char* pszUser)
-{
- HINSTANCE hSplashDll = NULL;
- LPDGLSPLASHSCREEN dglSplashScreen = NULL;
- static BOOL bOnce = FALSE;
- static int iReg = 0;
- static char szUser[255] = {"\0"};
-
- // Display splash screen at all?
- if (!bSplashScreen)
- return;
-
- // Only display splash screen once
- if (bOnce)
- return;
- bOnce = TRUE;
-
- // Make local copy of string for passing to DLL
- if (pszUser)
- strcpy(szUser, pszUser);
- iReg = piReg;
-
- // Load Splash Screen DLL
- // (If it fails to load for any reason, we don't care...)
- hSplashDll = LoadLibrary("gldsplash.dll");
- if (hSplashDll) {
- // Execute the Splash Screen function
- dglSplashScreen = (LPDGLSPLASHSCREEN)GetProcAddress(hSplashDll, "GLDSplashScreen");
- if (dglSplashScreen)
- (*dglSplashScreen)(1, iReg, szUser);
- // Don't unload the DLL since splash screen dialog is modeless now
- }
-}
-
-// ***********************************************************************
-
-BOOL dglValidate()
-{
- char *szCaption = "SciTech GLDirect Driver";
- UINT uType = MB_OK | MB_ICONEXCLAMATION;
-
-#ifdef _USE_GLD3_WGL
- // (Re)build pixelformat list
- if (glb.bPixelformatsDirty)
- _gldDriver.BuildPixelformatList();
-#endif
-
- // Check to see if we have already validated
- if (bDriverValidated && bInitialized)
- return TRUE;
-
- // Since all (most) the WGL functions must be validated at this point,
- // this also insure that the callback driver is completely initialized.
- if (!bInitialized)
- if (!dglInitDriver()) {
- MessageBox(NULL,
- "The GLDirect driver could not initialize.\n\n"
- "Please run the configuration program to\n"
- "properly configure the driver, or else\n"
- "re-run the installation program.", szCaption, uType);
- _exit(1); // Bail
- }
-
- return TRUE;
-}
-
-// ***********************************************************************
-
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dllmain.h b/mesalib/src/mesa/drivers/windows/gldirect/dllmain.h
deleted file mode 100644
index 03343ef7a..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dllmain.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Win32 DllMain functions.
-*
-****************************************************************************/
-
-#ifndef __DLLMAIN_H
-#define __DLLMAIN_H
-
-// Macros to control compilation
-#define STRICT
-#define WIN32_LEAN_AND_MEAN
-
-#include <windows.h>
-
-#ifndef _USE_GLD3_WGL
-#include "DirectGL.h"
-#endif // _USE_GLD3_WGL
-
-//#include "gldirect/regkeys.h"
-#include "dglglobals.h"
-#include "ddlog.h"
-#ifndef _USE_GLD3_WGL
-#include "d3dtexture.h"
-#endif // _USE_GLD3_WGL
-
-#include "dglwgl.h"
-
-extern BOOL bInitialized;
-
-BOOL dglInitDriver(void);
-void dglExitDriver(void);
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c
deleted file mode 100644
index 171585dcf..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c
+++ /dev/null
@@ -1,1204 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Driver interface code to Mesa
-*
-****************************************************************************/
-
-//#include <windows.h>
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "vbo/vbo.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-extern BOOL dglSwapBuffers(HDC hDC);
-
-// HACK: Hack the _33 member of the OpenGL perspective projection matrix
-const float _fPersp_33 = 1.6f;
-
-//---------------------------------------------------------------------------
-// Internal functions
-//---------------------------------------------------------------------------
-
-void _gld_mesa_warning(
- __struct gl_context *gc,
- char *str)
-{
- // Intercept Mesa's internal warning mechanism
- gldLogPrintf(GLDLOG_WARN, "Mesa warning: %s", str);
-}
-
-//---------------------------------------------------------------------------
-
-void _gld_mesa_fatal(
- __struct gl_context *gc,
- char *str)
-{
- // Intercept Mesa's internal fatal-message mechanism
- gldLogPrintf(GLDLOG_CRITICAL, "Mesa FATAL: %s", str);
-
- // Mesa calls abort(0) here.
- ddlogClose();
- exit(0);
-}
-
-//---------------------------------------------------------------------------
-
-D3DSTENCILOP _gldConvertStencilOp(
- GLenum StencilOp)
-{
- // Used by Stencil: pass, fail and zfail
-
- switch (StencilOp) {
- case GL_KEEP:
- return D3DSTENCILOP_KEEP;
- case GL_ZERO:
- return D3DSTENCILOP_ZERO;
- case GL_REPLACE:
- return D3DSTENCILOP_REPLACE;
- case GL_INCR:
- return D3DSTENCILOP_INCRSAT;
- case GL_DECR:
- return D3DSTENCILOP_DECRSAT;
- case GL_INVERT:
- return D3DSTENCILOP_INVERT;
- case GL_INCR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_INCR;
- case GL_DECR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_DECR;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertStencilOp: Unknown StencilOp\n");
-#endif
-
- return D3DSTENCILOP_KEEP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DCMPFUNC _gldConvertCompareFunc(
- GLenum CmpFunc)
-{
- // Used for Alpha func, depth func and stencil func.
-
- switch (CmpFunc) {
- case GL_NEVER:
- return D3DCMP_NEVER;
- case GL_LESS:
- return D3DCMP_LESS;
- case GL_EQUAL:
- return D3DCMP_EQUAL;
- case GL_LEQUAL:
- return D3DCMP_LESSEQUAL;
- case GL_GREATER:
- return D3DCMP_GREATER;
- case GL_NOTEQUAL:
- return D3DCMP_NOTEQUAL;
- case GL_GEQUAL:
- return D3DCMP_GREATEREQUAL;
- case GL_ALWAYS:
- return D3DCMP_ALWAYS;
- };
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertCompareFunc: Unknown CompareFunc\n");
-#endif
-
- return D3DCMP_ALWAYS;
-}
-
-//---------------------------------------------------------------------------
-
-D3DBLEND _gldConvertBlendFunc(
- GLenum blend,
- GLenum DefaultBlend)
-{
- switch (blend) {
- case GL_ZERO:
- return D3DBLEND_ZERO;
- case GL_ONE:
- return D3DBLEND_ONE;
- case GL_DST_COLOR:
- return D3DBLEND_DESTCOLOR;
- case GL_SRC_COLOR:
- return D3DBLEND_SRCCOLOR;
- case GL_ONE_MINUS_DST_COLOR:
- return D3DBLEND_INVDESTCOLOR;
- case GL_ONE_MINUS_SRC_COLOR:
- return D3DBLEND_INVSRCCOLOR;
- case GL_SRC_ALPHA:
- return D3DBLEND_SRCALPHA;
- case GL_ONE_MINUS_SRC_ALPHA:
- return D3DBLEND_INVSRCALPHA;
- case GL_DST_ALPHA:
- return D3DBLEND_DESTALPHA;
- case GL_ONE_MINUS_DST_ALPHA:
- return D3DBLEND_INVDESTALPHA;
- case GL_SRC_ALPHA_SATURATE:
- return D3DBLEND_SRCALPHASAT;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertBlendFunc: Unknown BlendFunc\n");
-#endif
-
- return DefaultBlend;
-}
-
-//---------------------------------------------------------------------------
-// Misc. functions
-//---------------------------------------------------------------------------
-
-void gld_Noop_DX9(
- struct gl_context *ctx)
-{
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "gld_Noop called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Error_DX9(
- struct gl_context *ctx)
-{
-#ifdef _DEBUG
- // Quite useless.
-// gldLogMessage(GLDLOG_ERROR, "ctx->Driver.Error called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Required Mesa functions
-//---------------------------------------------------------------------------
-
-static GLboolean gld_set_draw_buffer_DX9(
- struct gl_context *ctx,
- GLenum mode)
-{
- (void) ctx;
- if ((mode==GL_FRONT_LEFT) || (mode == GL_BACK_LEFT)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_set_read_buffer_DX9(
- struct gl_context *ctx,
- struct gl_framebuffer *buffer,
- GLenum mode)
-{
- /* separate read buffer not supported */
-/*
- ASSERT(buffer == ctx->DrawBuffer);
- ASSERT(mode == GL_FRONT_LEFT);
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Clear_DX9(
- struct gl_context *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint x,
- GLint y,
- GLint width,
- GLint height)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DCOLOR Color = 0;
- float Z = 0.0f;
- DWORD Stencil = 0;
- D3DRECT d3dClearRect;
-
- // TODO: Colourmask
- const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask[0];
-
- if (!gld->pDev)
- return;
-
- if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
- GLubyte col[4];
- CLAMPED_FLOAT_TO_UBYTE(col[0], ctx->Color.ClearColor[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], ctx->Color.ClearColor[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], ctx->Color.ClearColor[2]);
- CLAMPED_FLOAT_TO_UBYTE(col[3], ctx->Color.ClearColor[3]);
- dwFlags |= D3DCLEAR_TARGET;
- Color = D3DCOLOR_RGBA(col[0], col[1], col[2], col[3]);
- }
-
- if (mask & DD_DEPTH_BIT) {
- // D3D8 will fail the Clear call if we try and clear a
- // depth buffer and we haven't created one.
- // Also, some apps try and clear a depth buffer,
- // when a depth buffer hasn't been requested by the app.
- if (ctx->Visual.depthBits == 0) {
- mask &= ~DD_DEPTH_BIT; // Remove depth bit from mask
- } else {
- dwFlags |= D3DCLEAR_ZBUFFER;
- Z = ctx->Depth.Clear;
- }
- }
-
- if (mask & DD_STENCIL_BIT) {
- if (ctx->Visual.stencilBits == 0) {
- // No stencil bits in depth buffer
- mask &= ~DD_STENCIL_BIT; // Remove stencil bit from mask
- } else {
- dwFlags |= D3DCLEAR_STENCIL;
- Stencil = ctx->Stencil.Clear;
- }
- }
-
- // Some apps do really weird things with the rect, such as Quake3.
- if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0)) {
- all = GL_TRUE;
- }
-
- if (!all) {
- // Calculate clear subrect
- d3dClearRect.x1 = x;
- d3dClearRect.y1 = gldCtx->dwHeight - (y + height);
- d3dClearRect.x2 = x + width;
- d3dClearRect.y2 = d3dClearRect.y1 + height;
-// gldLogPrintf(GLDLOG_INFO, "Rect %d,%d %d,%d", x,y,width,height);
- }
-
- // dwFlags will be zero if there's nothing to clear
- if (dwFlags) {
- _GLD_DX9_DEV(Clear(
- gld->pDev,
- all ? 0 : 1,
- all ? NULL : &d3dClearRect,
- dwFlags,
- Color, Z, Stencil));
- }
-
- if (mask & DD_ACCUM_BIT) {
- // Clear accumulation buffer
- }
-}
-
-//---------------------------------------------------------------------------
-
-// Mesa 5: Parameter change
-static void gld_buffer_size_DX9(
-// struct gl_context *ctx,
- struct gl_framebuffer *fb,
- GLuint *width,
- GLuint *height)
-{
-// GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
-
- *width = fb->Width; // gldCtx->dwWidth;
- *height = fb->Height; // gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Finish_DX9(
- struct gl_context *ctx)
-{
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Flush_DX9(
- struct gl_context *ctx)
-{
- GLD_context *gld = GLD_GET_CONTEXT(ctx);
-
- // TODO: Detect apps that glFlush() then SwapBuffers() ?
-
- if (gld->EmulateSingle) {
- // Emulating a single-buffered context.
- // [Direct3D doesn't allow rendering to front buffer]
- dglSwapBuffers(gld->hDC);
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_STENCIL(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Two-sided stencil. New for Mesa 5
- const GLuint uiFace = 0UL;
-
- struct gl_stencil_attrib *pStencil = &ctx->Stencil;
-
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILENABLE, pStencil->Enabled ? TRUE : FALSE));
- if (pStencil->Enabled) {
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFUNC, _gldConvertCompareFunc(pStencil->Function[uiFace])));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILREF, pStencil->Ref[uiFace]));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILMASK, pStencil->ValueMask[uiFace]));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILWRITEMASK, pStencil->WriteMask[uiFace]));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFAIL, _gldConvertStencilOp(pStencil->FailFunc[uiFace])));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILZFAIL, _gldConvertStencilOp(pStencil->ZFailFunc[uiFace])));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILPASS, _gldConvertStencilOp(pStencil->ZPassFunc[uiFace])));
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_COLOR(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DBLEND src;
- D3DBLEND dest;
-
- // Alpha func
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, _gldConvertCompareFunc(ctx->Color.AlphaFunc)));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAREF, (DWORD)ctx->Color.AlphaRef));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, ctx->Color.AlphaEnabled));
-
- // Blend func
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHABLENDENABLE, ctx->Color.BlendEnabled));
- src = _gldConvertBlendFunc(ctx->Color.BlendSrcRGB, GL_ONE);
- dest = _gldConvertBlendFunc(ctx->Color.BlendDstRGB, GL_ZERO);
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SRCBLEND, src));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_DESTBLEND, dest));
-
- // Color mask
- if (ctx->Color.ColorMask[0][0]) dwFlags |= D3DCOLORWRITEENABLE_RED;
- if (ctx->Color.ColorMask[0][1]) dwFlags |= D3DCOLORWRITEENABLE_GREEN;
- if (ctx->Color.ColorMask[0][2]) dwFlags |= D3DCOLORWRITEENABLE_BLUE;
- if (ctx->Color.ColorMask[0][3]) dwFlags |= D3DCOLORWRITEENABLE_ALPHA;
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_COLORWRITEENABLE, dwFlags));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_DEPTH(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZENABLE, ctx->Depth.Test ? D3DZB_TRUE : D3DZB_FALSE));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZFUNC, _gldConvertCompareFunc(ctx->Depth.Func)));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZWRITEENABLE, ctx->Depth.Mask ? TRUE : FALSE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_POLYGON(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DFILLMODE d3dFillMode = D3DFILL_SOLID;
- D3DCULL d3dCullMode = D3DCULL_NONE;
- float fOffset = 0; // Changed from int to float for DX9
-
- // Fillmode
- switch (ctx->Polygon.FrontMode) {
- case GL_POINT:
- d3dFillMode = D3DFILL_POINT;
- break;
- case GL_LINE:
- d3dFillMode = D3DFILL_WIREFRAME;
- break;
- case GL_FILL:
- d3dFillMode = D3DFILL_SOLID;
- break;
- }
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FILLMODE, d3dFillMode));
-
- if (ctx->Polygon.CullFlag) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_BACK:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CW;
- else
- d3dCullMode = D3DCULL_CCW;
- break;
- case GL_FRONT:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CCW;
- else
- d3dCullMode = D3DCULL_CW;
- break;
- case GL_FRONT_AND_BACK:
- d3dCullMode = D3DCULL_NONE;
- break;
- default:
- break;
- }
- } else {
- d3dCullMode = D3DCULL_NONE;
- }
-// d3dCullMode = D3DCULL_NONE; // FOR DEBUGGING
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CULLMODE, d3dCullMode));
-
- // Polygon offset
- // ZBIAS ranges from 0 to 16 and can only move towards the viewer
- // Mesa5: ctx->Polygon._OffsetAny removed
- if (ctx->Polygon.OffsetFill) {
- fOffset = ctx->Polygon.OffsetUnits;
-// if (iOffset < 0.0f)
-// iOffset = -iOffset;
-// else
-// iOffset = 0.0f; // D3D can't push away
- }
- // NOTE: SetRenderState() required a DWORD, so need to cast
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_DEPTHBIAS, *((DWORD*)&fOffset)));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_FOG(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DCOLOR d3dFogColour;
- D3DFOGMODE d3dFogMode = D3DFOG_LINEAR;
-
- // TODO: Fog is calculated seperately in the Mesa pipeline
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, FALSE));
- return;
-
- // Fog enable
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, ctx->Fog.Enabled));
- if (!ctx->Fog.Enabled) {
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, D3DFOG_NONE));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE));
- return; // If disabled, don't bother setting any fog state
- }
-
- // Fog colour
- d3dFogColour = D3DCOLOR_COLORVALUE( ctx->Fog.Color[0],
- ctx->Fog.Color[1],
- ctx->Fog.Color[2],
- ctx->Fog.Color[3]);
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGCOLOR, d3dFogColour));
-
- // Fog density
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGDENSITY, *((DWORD*) (&ctx->Fog.Density))));
-
- // Fog start
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGSTART, *((DWORD*) (&ctx->Fog.Start))));
-
- // Fog end
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGEND, *((DWORD*) (&ctx->Fog.End))));
-
- // Fog mode
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- d3dFogMode = D3DFOG_LINEAR;
- break;
- case GL_EXP:
- d3dFogMode = D3DFOG_EXP;
- break;
- case GL_EXP2:
- d3dFogMode = D3DFOG_EXP2;
- break;
- }
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, d3dFogMode));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_LIGHT(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- DWORD dwSpecularEnable;
-
- // Shademode
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SHADEMODE, (ctx->Light.ShadeModel == GL_SMOOTH) ? D3DSHADE_GOURAUD : D3DSHADE_FLAT));
-
- // Separate specular colour
- if (ctx->Light.Enabled)
- dwSpecularEnable = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TRUE: FALSE;
- else
- dwSpecularEnable = FALSE;
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SPECULARENABLE, dwSpecularEnable));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_MODELVIEW(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ModelView.m;
- // Mesa5: Model-view is now a stack
- GLfloat *pM = ctx->ModelviewMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10];
- m._34 = pM[11];
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14];
- m._44 = pM[15];
-
- gld->matModelView = m;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_PROJECTION(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ProjectionMatrix.m;
- // Mesa 5: Now a stack
- GLfloat *pM = ctx->ProjectionMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
-
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
-
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10] / _fPersp_33; // / 1.6f;
- m._34 = pM[11];
-
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14] / 2.0f;
- m._44 = pM[15];
-
- gld->matProjection = m;
-}
-
-//---------------------------------------------------------------------------
-/*
-void gldFrustumHook_DX9(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Frustum(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = farval / (nearval - farval);
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Frustum: %f", farval/nearval);
-}
-
-//---------------------------------------------------------------------------
-
-void gldOrthoHook_DX9(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Ortho(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = 1.6f;
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Ortho: %f", farval/nearval);
-}
-*/
-//---------------------------------------------------------------------------
-
-void gld_NEW_VIEWPORT(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DVIEWPORT9 d3dvp;
-// GLint x, y;
-// GLsizei w, h;
-
- // Set depth range
- _GLD_DX9_DEV(GetViewport(gld->pDev, &d3dvp));
- // D3D can't do Quake1/Quake2 z-trick
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.MinZ = ctx->Viewport.Near;
- d3dvp.MaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.MinZ = ctx->Viewport.Far;
- d3dvp.MaxZ = ctx->Viewport.Near;
- }
-/* x = ctx->Viewport.X;
- y = ctx->Viewport.Y;
- w = ctx->Viewport.Width;
- h = ctx->Viewport.Height;
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
- d3dvp.X = x;
- d3dvp.Y = gldCtx->dwHeight - (y + h);
- d3dvp.Width = w;
- d3dvp.Height = h;*/
- _GLD_DX9_DEV(SetViewport(gld->pDev, &d3dvp));
-
-// gld->fFlipWindowY = (float)gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_SCISSOR(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Bail if IHV driver cannot scissor
- if (!gld->bCanScissor)
- return;
-
- // Set scissor rect
- if (ctx->Scissor.Enabled) {
- RECT rcRect;
- // Keep in mind that RECT's need an extra row and column
- rcRect.left = ctx->Scissor.X;
- rcRect.right = ctx->Scissor.X + ctx->Scissor.Width; // + 1;
- rcRect.top = gldCtx->dwHeight - (ctx->Scissor.Y + ctx->Scissor.Height);
- rcRect.bottom = rcRect.top + ctx->Scissor.Height;
- IDirect3DDevice9_SetScissorRect(gld->pDev, &rcRect);
- }
-
- // Enable/disable scissor as required
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SCISSORTESTENABLE, ctx->Scissor.Enabled));
-}
-
-//---------------------------------------------------------------------------
-
-__inline BOOL _gldAnyEvalEnabled(
- struct gl_context *ctx)
-{
- struct gl_eval_attrib *eval = &ctx->Eval;
-
- if ((eval->AutoNormal) ||
- (eval->Map1Color4) ||
- (eval->Map1Index) ||
- (eval->Map1Normal) ||
- (eval->Map1TextureCoord1) ||
- (eval->Map1TextureCoord2) ||
- (eval->Map1TextureCoord3) ||
- (eval->Map1TextureCoord4) ||
- (eval->Map1Vertex3) ||
- (eval->Map1Vertex4) ||
- (eval->Map2Color4) ||
- (eval->Map2Index) ||
- (eval->Map2Normal) ||
- (eval->Map2TextureCoord1) ||
- (eval->Map2TextureCoord2) ||
- (eval->Map2TextureCoord3) ||
- (eval->Map2TextureCoord4) ||
- (eval->Map2Vertex3) ||
- (eval->Map2Vertex4)
- )
- return TRUE;
-
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL _gldChooseInternalPipeline(
- struct gl_context *ctx,
- GLD_driver_dx9 *gld)
-{
-// return TRUE; // DEBUGGING: ALWAYS USE MESA
-// return FALSE; // DEBUGGING: ALWAYS USE D3D
-
- if ((glb.dwTnL == GLDS_TNL_MESA) || (gld->bHasHWTnL == FALSE))
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE; // Force Mesa TnL
- }
-
- if ((ctx->Light.Enabled) ||
- (1) ||
- (ctx->Texture._TexGenEnabled) ||
- (ctx->Texture._TexMatEnabled) ||
-// (ctx->Transform._AnyClip) ||
- (ctx->Scissor.Enabled) ||
- _gldAnyEvalEnabled(ctx) // Put this last so we can early-out
- )
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE;
- }
-
- gld->PipelineUsage.qwD3DFVF.QuadPart++;
- return FALSE;
-
-/* // Force Mesa pipeline?
- if (glb.dwTnL == GLDS_TNL_MESA) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Test for functionality not exposed in the D3D pathways
- if ((ctx->Texture._GenFlags)) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Now decide if vertex shader can be used.
- // If two sided lighting is enabled then we must either
- // use Mesa TnL or the vertex shader
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
- if (gld->VStwosidelight.hShader && !ctx->Fog.Enabled) {
- // Use Vertex Shader
- gld->PipelineUsage.dwD3D2SVS.QuadPart++;
- return GLD_PIPELINE_D3D_VS_TWOSIDE;
- } else {
- // Use Mesa TnL
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
- }
-
- // Must be D3D fixed-function pipeline
- gld->PipelineUsage.dwD3DFVF.QuadPart++;
- return GLD_PIPELINE_D3D_FVF;
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_update_state_DX9(
- struct gl_context *ctx,
- GLuint new_state)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLD_pb_dx9 *gldPB;
-
- if (!gld || !gld->pDev)
- return;
-
- _swsetup_InvalidateState( ctx, new_state );
- _vbo_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-
- // SetupIndex will be used in the pipelines for choosing setup function
- if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) ||
- (ctx->Fog.Enabled))
- {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT_EXTRAS;
- else
- gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS;
- } else {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture
- else
- gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture
- }
-
- gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld);
- if (gld->bUseMesaTnL) {
- gldPB = &gld->PB2d;
- _GLD_DX9_DEV(SetSoftwareVertexProcessing(gld->pDev, TRUE));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, FALSE));
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL));
- _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF));
- } else {
- gldPB = &gld->PB3d;
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE));
-// if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) {
-// _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware));
-// _GLD_DX9_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
-// } else {
-// _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL));
- _GLD_DX9_DEV(SetSoftwareVertexProcessing(gld->pDev, !gld->bHasHWTnL));
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL));
- _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF));
-// }
- }
-
-#define _GLD_TEST_STATE(a) \
- if (new_state & (a)) { \
- gld##a(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_TEST_STATE_DX9(a) \
- if (new_state & (a)) { \
- gld##a##_DX9(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_IGNORE_STATE(a) new_state &= ~(a);
-
-// if (!gld->bUseMesaTnL) {
- // Not required if Mesa is doing the TnL.
- // Problem: If gld->bUseMesaTnL is TRUE when these are signaled,
- // then we'll miss updating the D3D TnL pipeline.
- // Therefore, don't test for gld->bUseMesaTnL
- _GLD_TEST_STATE(_NEW_MODELVIEW);
- _GLD_TEST_STATE(_NEW_PROJECTION);
-// }
-
- _GLD_TEST_STATE_DX9(_NEW_TEXTURE); // extern, so guard with _DX9
- _GLD_TEST_STATE(_NEW_COLOR);
- _GLD_TEST_STATE(_NEW_DEPTH);
- _GLD_TEST_STATE(_NEW_POLYGON);
- _GLD_TEST_STATE(_NEW_STENCIL);
- _GLD_TEST_STATE(_NEW_FOG);
- _GLD_TEST_STATE(_NEW_LIGHT);
- _GLD_TEST_STATE(_NEW_VIEWPORT);
-
- _GLD_IGNORE_STATE(_NEW_TRANSFORM);
-
- // Scissor Test: New for DX9
- _GLD_TEST_STATE(_NEW_SCISSOR);
-
-// Stubs for future use.
-/* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_STATE(_NEW_EVAL);
- _GLD_TEST_STATE(_NEW_HINT);
- _GLD_TEST_STATE(_NEW_LINE);
- _GLD_TEST_STATE(_NEW_PIXEL);
- _GLD_TEST_STATE(_NEW_POINT);
- _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE);
- _GLD_TEST_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_STATE(_NEW_ARRAY);
- _GLD_TEST_STATE(_NEW_RENDERMODE);
- _GLD_TEST_STATE(_NEW_BUFFERS);
- _GLD_TEST_STATE(_NEW_MULTISAMPLE);
-*/
-
-// For debugging.
-#if 0
-#define _GLD_TEST_UNHANDLED_STATE(a) \
- if (new_state & (a)) { \
- gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \
- }
- _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_HINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_LINE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE);
-// _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY);
- _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS);
- _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE);
-#undef _GLD_UNHANDLED_STATE
-#endif
-
-#undef _GLD_TEST_STATE
-}
-
-//---------------------------------------------------------------------------
-// Viewport
-//---------------------------------------------------------------------------
-
-void gld_Viewport_DX9(
- struct gl_context *ctx,
- GLint x,
- GLint y,
- GLsizei w,
- GLsizei h)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DVIEWPORT9 d3dvp;
-
- if (!gld || !gld->pDev)
- return;
-
- // This is a hack. When the app is minimized, Mesa passes
- // w=1 and h=1 for viewport dimensions. Without this test
- // we get a GPF in gld_wgl_resize_buffers().
- if ((w==1) && (h==1))
- return;
-
- // Call ResizeBuffersMESA. This function will early-out
- // if no resize is needed.
- //ctx->Driver.ResizeBuffersMESA(ctx);
- // Mesa 5: Changed parameters
- ctx->Driver.ResizeBuffers(gldCtx->glBuffer);
-
-#if 0
- ddlogPrintf(GLDLOG_SYSTEM, ">> Viewport x=%d y=%d w=%d h=%d", x,y,w,h);
-#endif
-
- // ** D3D viewport must not be outside the render target surface **
- // Sanity check the GL viewport dimensions
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
-
- d3dvp.X = x;
- d3dvp.Y = gldCtx->dwHeight - (y + h);
- d3dvp.Width = w;
- d3dvp.Height = h;
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.MinZ = ctx->Viewport.Near;
- d3dvp.MaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.MinZ = ctx->Viewport.Far;
- d3dvp.MaxZ = ctx->Viewport.Near;
- }
-
- // TODO: DEBUGGING
-// d3dvp.MinZ = 0.0f;
-// d3dvp.MaxZ = 1.0f;
-
- _GLD_DX9_DEV(SetViewport(gld->pDev, &d3dvp));
-
-}
-
-//---------------------------------------------------------------------------
-
-extern BOOL dglWglResizeBuffers(struct gl_context *ctx, BOOL bDefaultDriver);
-
-// Mesa 5: Parameter change
-void gldResizeBuffers_DX9(
-// struct gl_context *ctx)
- struct gl_framebuffer *fb)
-{
- GET_CURRENT_CONTEXT(ctx);
- dglWglResizeBuffers(ctx, TRUE);
-}
-
-//---------------------------------------------------------------------------
-#ifdef _DEBUG
-// This is only for debugging.
-// To use, plug into ctx->Driver.Enable pointer below.
-void gld_Enable(
- struct gl_context *ctx,
- GLenum e,
- GLboolean b)
-{
- char buf[1024];
- sprintf(buf, "Enable: %s (%s)\n", _mesa_lookup_enum_by_nr(e), b?"TRUE":"FALSE");
- ddlogMessage(DDLOG_SYSTEM, buf);
-}
-#endif
-//---------------------------------------------------------------------------
-// Driver pointer setup
-//---------------------------------------------------------------------------
-
-extern const GLubyte* _gldGetStringGeneric(struct gl_context*, GLenum);
-
-void gldSetupDriverPointers_DX9(
- struct gl_context *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- // Mandatory functions
- ctx->Driver.GetString = _gldGetStringGeneric;
- ctx->Driver.UpdateState = gld_update_state_DX9;
- ctx->Driver.Clear = gld_Clear_DX9;
- ctx->Driver.DrawBuffer = gld_set_draw_buffer_DX9;
- ctx->Driver.GetBufferSize = gld_buffer_size_DX9;
- ctx->Driver.Finish = gld_Finish_DX9;
- ctx->Driver.Flush = gld_Flush_DX9;
- ctx->Driver.Error = gld_Error_DX9;
-
- // Hardware accumulation buffer
- ctx->Driver.Accum = NULL; // TODO: gld_Accum;
-
- // Bitmap functions
- ctx->Driver.CopyPixels = gld_CopyPixels_DX9;
- ctx->Driver.DrawPixels = gld_DrawPixels_DX9;
- ctx->Driver.ReadPixels = gld_ReadPixels_DX9;
- ctx->Driver.Bitmap = gld_Bitmap_DX9;
-
- // Buffer resize
- ctx->Driver.ResizeBuffers = gldResizeBuffers_DX9;
-
- // Texture image functions
- ctx->Driver.ChooseTextureFormat = gld_ChooseTextureFormat_DX9;
- ctx->Driver.TexImage1D = gld_TexImage1D_DX9;
- ctx->Driver.TexImage2D = gld_TexImage2D_DX9;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage1D = gld_TexSubImage1D_DX9;
- ctx->Driver.TexSubImage2D = gld_TexSubImage2D_DX9;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
-
- ctx->Driver.CopyTexImage1D = gldCopyTexImage1D_DX9; //NULL;
- ctx->Driver.CopyTexImage2D = gldCopyTexImage2D_DX9; //NULL;
- ctx->Driver.CopyTexSubImage1D = gldCopyTexSubImage1D_DX9; //NULL;
- ctx->Driver.CopyTexSubImage2D = gldCopyTexSubImage2D_DX9; //NULL;
- ctx->Driver.CopyTexSubImage3D = gldCopyTexSubImage3D_DX9;
- ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
-
- // Texture object functions
- ctx->Driver.BindTexture = NULL;
- ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!;
- ctx->Driver.DeleteTexture = gld_DeleteTexture_DX9;
- ctx->Driver.PrioritizeTexture = NULL;
-
- // Imaging functionality
- ctx->Driver.CopyColorTable = NULL;
- ctx->Driver.CopyColorSubTable = NULL;
- ctx->Driver.CopyConvolutionFilter1D = NULL;
- ctx->Driver.CopyConvolutionFilter2D = NULL;
-
- // State changing functions
- ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc;
- ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc;
- ctx->Driver.ClearColor = NULL; //gld_ClearColor;
- ctx->Driver.ClearDepth = NULL; //gld_ClearDepth;
- ctx->Driver.ClearStencil = NULL; //gld_ClearStencil;
- ctx->Driver.ColorMask = NULL; //gld_ColorMask;
- ctx->Driver.CullFace = NULL; //gld_CullFace;
- ctx->Driver.ClipPlane = NULL; //gld_ClipPlane;
- ctx->Driver.FrontFace = NULL; //gld_FrontFace;
- ctx->Driver.DepthFunc = NULL; //gld_DepthFunc;
- ctx->Driver.DepthMask = NULL; //gld_DepthMask;
- ctx->Driver.DepthRange = NULL;
- ctx->Driver.Enable = NULL; //gld_Enable;
- ctx->Driver.Fogfv = NULL; //gld_Fogfv;
- ctx->Driver.Hint = NULL; //gld_Hint;
- ctx->Driver.Lightfv = NULL; //gld_Lightfv;
- ctx->Driver.LightModelfv = NULL; //gld_LightModelfv;
- ctx->Driver.LineStipple = NULL; //gld_LineStipple;
- ctx->Driver.LineWidth = NULL; //gld_LineWidth;
- ctx->Driver.LogicOpcode = NULL; //gld_LogicOpcode;
- ctx->Driver.PointParameterfv = NULL; //gld_PointParameterfv;
- ctx->Driver.PointSize = NULL; //gld_PointSize;
- ctx->Driver.PolygonMode = NULL; //gld_PolygonMode;
- ctx->Driver.PolygonOffset = NULL; //gld_PolygonOffset;
- ctx->Driver.PolygonStipple = NULL; //gld_PolygonStipple;
- ctx->Driver.RenderMode = NULL; //gld_RenderMode;
- ctx->Driver.Scissor = NULL; //gld_Scissor;
- ctx->Driver.ShadeModel = NULL; //gld_ShadeModel;
- ctx->Driver.StencilFunc = NULL; //gld_StencilFunc;
- ctx->Driver.StencilMask = NULL; //gld_StencilMask;
- ctx->Driver.StencilOp = NULL; //gld_StencilOp;
- ctx->Driver.TexGen = NULL; //gld_TexGen;
- ctx->Driver.TexEnv = NULL;
- ctx->Driver.TexParameter = NULL;
- ctx->Driver.TextureMatrix = NULL; //gld_TextureMatrix;
- ctx->Driver.Viewport = gld_Viewport_DX9;
-
- _swsetup_Wakeup(ctx);
-
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- tnl->Driver.Render.ResetLineStipple = gld_ResetLineStipple_DX9;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
-
- // Hook into glFrustum() and glOrtho()
-// ctx->Exec->Frustum = gldFrustumHook_DX9;
-// ctx->Exec->Ortho = gldOrthoHook_DX9;
-
-}
-
-//---------------------------------------------------------------------------
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h
deleted file mode 100644
index 5cb36ac05..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 9.0 header file
-*
-****************************************************************************/
-
-#ifndef _GLD_DX9_H
-#define _GLD_DX9_H
-
-//---------------------------------------------------------------------------
-// Windows includes
-//---------------------------------------------------------------------------
-
-//#ifndef STRICT
-//#define STRICT
-//#endif
-
-//#define WIN32_LEAN_AND_MEAN
-//#include <windows.h>
-#include <d3d9.h>
-#include <d3dx9.h>
-
-// MS screwed up with the DX8.1 SDK - there's no compile-time
-// method of compiling for 8.0 via the 8.1 SDK unless you
-// "make sure you don't use any 8.1 interfaces".
-// We CAN use 8.1 D3DX static functions, though - just not new 8.1 interfaces.
-//
-// D3D_SDK_VERSION is 120 for 8.0 (supported by Windows 95).
-// D3D_SDK_VERSION is 220 for 8.1 (NOT supported by Windows 95).
-//
-//#define D3D_SDK_VERSION_DX9_SUPPORT_WIN95 120
-//#define D3D_SDK_VERSION_DX91 220
-
-// Typedef for obtaining function from d3d8.dll
-typedef IDirect3D9* (WINAPI *FNDIRECT3DCREATE9) (UINT);
-
-
-//---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-
-#ifdef _DEBUG
-#define _GLD_TEST_HRESULT(h) \
-{ \
- HRESULT _hr = (h); \
- if (FAILED(_hr)) { \
- gldLogError(GLDLOG_ERROR, #h, _hr); \
- } \
-}
-#define _GLD_DX9(func) _GLD_TEST_HRESULT(IDirect3D9_##func##)
-#define _GLD_DX9_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice9_##func##)
-#define _GLD_DX9_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer9_##func##)
-#define _GLD_DX9_TEX(func) _GLD_TEST_HRESULT(IDirect3DTexture9_##func##)
-#else
-#define _GLD_DX9(func) IDirect3D9_##func
-#define _GLD_DX9_DEV(func) IDirect3DDevice9_##func
-#define _GLD_DX9_VB(func) IDirect3DVertexBuffer9_##func
-#define _GLD_DX9_TEX(func) IDirect3DTexture9_##func
-#endif
-
-#define SAFE_RELEASE(p) \
-{ \
- if (p) { \
- (p)->lpVtbl->Release(p); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_VB9(p) \
-{ \
- if (p) { \
- IDirect3DVertexBuffer9_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_SURFACE9(p) \
-{ \
- if (p) { \
- IDirect3DSurface9_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-// Setup index.
-enum {
- GLD_SI_FLAT = 0,
- GLD_SI_SMOOTH = 1,
- GLD_SI_FLAT_EXTRAS = 2,
- GLD_SI_SMOOTH_EXTRAS = 3,
-};
-/*
-// Internal pipeline
-typedef enum {
- GLD_PIPELINE_MESA = 0, // Mesa pipeline
- GLD_PIPELINE_D3D_FVF = 1, // Direct3D Fixed-function pipeline
- GLD_PIPELINE_D3D_VS_TWOSIDE = 2 // Direct3D two-sided-lighting vertex shader
-} GLD_tnl_pipeline;
-*/
-//---------------------------------------------------------------------------
-// Vertex definitions for Fixed-Function pipeline
-//---------------------------------------------------------------------------
-
-//
-// NOTE: If the number of texture units is altered then most of
-// the texture code will need to be revised.
-//
-
-#define GLD_MAX_TEXTURE_UNITS_DX9 2
-
-//
-// 2D vertex transformed by Mesa
-//
-#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \
- D3DFVF_DIFFUSE | \
- D3DFVF_SPECULAR | \
- D3DFVF_TEX2)
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT sz; // Screen Z (depth)
- FLOAT rhw; // Reciprocal homogenous W
- DWORD diffuse; // Diffuse colour
- DWORD specular; // For separate-specular support
- FLOAT t0_u, t0_v; // 1st set of texture coords
- FLOAT t1_u, t1_v; // 2nd set of texture coords
-} GLD_2D_VERTEX;
-
-
-//
-// 3D vertex transformed by Direct3D
-//
-#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \
- D3DFVF_DIFFUSE | \
- D3DFVF_TEX2)
-
-typedef struct {
- D3DXVECTOR3 Position; // XYZ Vector in object space
- D3DCOLOR Diffuse; // Diffuse colour
- D3DXVECTOR2 TexUnit0; // Texture unit 0
- D3DXVECTOR2 TexUnit1; // Texture unit 1
-} GLD_3D_VERTEX;
-
-//---------------------------------------------------------------------------
-// Vertex Shaders
-//---------------------------------------------------------------------------
-/*
-// DX8 Vertex Shader
-typedef struct {
- DWORD hShader; // If NULL, shader is invalid and cannot be used
- BOOL bHardware; // If TRUE then shader was created for hardware,
- // otherwise shader was created for software.
-} GLD_vertexShader;
-*/
-//---------------------------------------------------------------------------
-// Structs
-//---------------------------------------------------------------------------
-
-// This keeps a count of how many times we choose each individual internal
-// pathway. Useful for seeing if a certain pathway was ever used by an app, and
-// how much each pathway is biased.
-// Zero the members at context creation and dump stats at context deletion.
-typedef struct {
- // Note: DWORD is probably too small
- ULARGE_INTEGER qwMesa; // Mesa TnL pipeline
- ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline
-// ULARGE_INTEGER dwD3D2SVS; // Direct3D Two-Sided Vertex Shader pipeline
-} GLD_pipeline_usage;
-
-// GLDirect Primitive Buffer (points, lines, triangles and quads)
-typedef struct {
- // Data for IDirect3DDevice9::CreateVertexBuffer()
- DWORD dwStride; // Stride of vertex
- DWORD dwUsage; // Usage flags
- DWORD dwFVF; // Direct3D Flexible Vertex Format
- DWORD dwPool; // Pool flags
-
- IDirect3DVertexBuffer9 *pVB; // Holds points, lines, tris and quads.
-
- // Point list is assumed to be at start of buffer
- DWORD iFirstLine; // Index of start of line list
- DWORD iFirstTriangle; // Index of start of triangle list
-
- BYTE *pPoints; // Pointer to next free point
- BYTE *pLines; // Pointer to next free line
- BYTE *pTriangles; // Pointer to next free triangle
-
- DWORD nPoints; // Number of points ready to render
- DWORD nLines; // Number of lines ready to render
- DWORD nTriangles; // Number of triangles ready to render
-} GLD_pb_dx9;
-
-// GLDirect DX9 driver data
-typedef struct {
- // GLDirect vars
- BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered)
- BOOL bDepthStencil; // Depth buffer needed (stencil optional)
- D3DFORMAT RenderFormat; // Format of back/front buffer
- D3DFORMAT DepthFormat; // Format of depth/stencil
-// float fFlipWindowY; // Value for flipping viewport Y coord
-
- // Direct3D vars
- D3DCAPS9 d3dCaps9;
- BOOL bHasHWTnL; // Device has Hardware Transform/Light?
- IDirect3D9 *pD3D; // Base Direct3D9 interface
- IDirect3DDevice9 *pDev; // Direct3D9 Device interface
- GLD_pb_dx9 PB2d; // Vertices transformed by Mesa
- GLD_pb_dx9 PB3d; // Vertices transformed by Direct3D
- D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type
- D3DXMATRIX matProjection; // Projection matrix for D3D TnL
- D3DXMATRIX matModelView; // Model/View matrix for D3D TnL
- int iSetupFunc; // Which setup functions to use
- BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL
-
- // Direct3D vars for two-sided lighting
-// GLD_vertexShader VStwosidelight; // Vertex Shader for two-sided lighting
-// D3DXMATRIX matWorldViewProj;// World/View/Projection matrix for shaders
-
-
-// GLD_tnl_pipeline TnLPipeline; // Index of current internal pipeline
- GLD_pipeline_usage PipelineUsage;
-
- BOOL bCanScissor; // Scissor test - new for DX9
-} GLD_driver_dx9;
-
-#define GLD_GET_DX9_DRIVER(c) (GLD_driver_dx9*)(c)->glPriv
-
-//---------------------------------------------------------------------------
-// Function prototypes
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX9(LPCSTR a);
-void gldEnableExtensions_DX9(struct gl_context *ctx);
-void gldInstallPipeline_DX9(struct gl_context *ctx);
-void gldSetupDriverPointers_DX9(struct gl_context *ctx);
-//void gldResizeBuffers_DX9(struct gl_context *ctx);
-void gldResizeBuffers_DX9(struct gl_framebuffer *fb);
-
-
-// Texture functions
-
-void gldCopyTexImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-void gldCopyTexImage2D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void gldCopyTexSubImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
-void gldCopyTexSubImage2D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-void gldCopyTexSubImage3D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-
-void gld_NEW_TEXTURE_DX9(struct gl_context *ctx);
-void gld_DrawPixels_DX9(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels);
-void gld_ReadPixels_DX9(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest);
-void gld_CopyPixels_DX9(struct gl_context *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type);
-void gld_Bitmap_DX9(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
-const struct gl_texture_format* gld_ChooseTextureFormat_DX9(struct gl_context *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType);
-void gld_TexImage2D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *tObj, struct gl_texture_image *texImage);
-void gld_TexImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage2D_DX9( struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage);
-void gld_DeleteTexture_DX9(struct gl_context *ctx, struct gl_texture_object *tObj);
-void gld_ResetLineStipple_DX9(struct gl_context *ctx);
-
-// 2D primitive functions
-
-void gld_Points2D_DX9(struct gl_context *ctx, GLuint first, GLuint last);
-
-void gld_Line2DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
-
-void gld_Triangle2DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DFlatExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-
-void gld_Quad2DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DFlatExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// 3D primitive functions
-
-void gld_Points3D_DX9(struct gl_context *ctx, GLuint first, GLuint last);
-void gld_Line3DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Line3DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// Primitive functions for Two-sided-lighting Vertex Shader
-
-void gld_Points2DTwoside_DX9(struct gl_context *ctx, GLuint first, GLuint last);
-void gld_Line2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
-void gld_Triangle2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h
deleted file mode 100644
index 7ec8c8a46..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*==========================================================================;
- *
- *
- * File: dxerr9.h
- * Content: DirectX Error Library Include File
- *
- ****************************************************************************/
-
-#ifndef _GLD_DXERR9_H_
-#define _GLD_DXERR9_H_
-
-
-#include <d3d9.h>
-
-//
-// DXGetErrorString9
-//
-// Desc: Converts an DirectX HRESULT to a string
-//
-// Args: HRESULT hr Can be any error code from
-// DPLAY D3D8 D3DX8 DMUSIC DSOUND
-//
-// Return: Converted string
-//
-const char* __stdcall DXGetErrorString9A(HRESULT hr);
-const WCHAR* __stdcall DXGetErrorString9W(HRESULT hr);
-
-#ifdef UNICODE
- #define DXGetErrorString9 DXGetErrorString9W
-#else
- #define DXGetErrorString9 DXGetErrorString9A
-#endif
-
-
-//
-// DXTrace
-//
-// Desc: Outputs a formatted error message to the debug stream
-//
-// Args: CHAR* strFile The current file, typically passed in using the
-// __FILE__ macro.
-// DWORD dwLine The current line number, typically passed in using the
-// __LINE__ macro.
-// HRESULT hr An HRESULT that will be traced to the debug stream.
-// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
-// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
-//
-// Return: The hr that was passed in.
-//
-//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
-//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
-HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
-HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
-
-#ifdef UNICODE
- #define DXTrace DXTraceW
-#else
- #define DXTrace DXTraceA
-#endif
-
-
-//
-// Helper macros
-//
-#if defined(DEBUG) | defined(_DEBUG)
- #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
- #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
- #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
-#else
- #define DXTRACE_MSG(str) (0L)
- #define DXTRACE_ERR(str,hr) (hr)
- #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
-#endif
-
-
-#endif
-
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c
deleted file mode 100644
index d370ce413..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GL extensions
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "../gld_settings.h"
-
-#include <windows.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-//#include "ddlog.h"
-//#include "gld_dx8.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "vbo/vbo.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "dglcontext.h"
-#include "extensions.h"
-
-// For some reason this is not defined in an above header...
-extern void _mesa_enable_imaging_extensions(struct gl_context *ctx);
-
-//---------------------------------------------------------------------------
-// Hack for the SGIS_multitexture extension that was removed from Mesa
-// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel
-
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // To enable, uncomment:
- // _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
-//---------------------------------------------------------------------------
-
-enum {
- /* Quake2 GL_SGIS_multitexture */
- GL_SELECTED_TEXTURE_SGIS = 0x835B,
- GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C,
- GL_MAX_TEXTURES_SGIS = 0x835D,
- GL_TEXTURE0_SGIS = 0x835E,
- GL_TEXTURE1_SGIS = 0x835F,
- GL_TEXTURE2_SGIS = 0x8360,
- GL_TEXTURE3_SGIS = 0x8361,
- GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363,
-};
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldSelectTextureSGIS(
- GLenum target)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glActiveTextureARB(ARB_target);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fSGIS(
- GLenum target,
- GLfloat s,
- GLfloat t)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fARB(ARB_target, s, t);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fvSGIS(
- GLenum target,
- const GLfloat *v)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fvARB(ARB_target, v);
-}
-
-//---------------------------------------------------------------------------
-// Extensions
-//---------------------------------------------------------------------------
-
-typedef struct {
- PROC proc;
- char *name;
-} GLD_extension;
-
-GLD_extension GLD_extList[] = {
-#ifdef GL_EXT_polygon_offset
- { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
-#endif
- { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
- { (PROC)glBlendColorEXT, "glBlendColorExt" },
- { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
- { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
- { (PROC)glColorPointerEXT, "glColorPointerEXT" },
- { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
- { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
- { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
- { (PROC)glGetPointervEXT, "glGetPointervEXT" },
- { (PROC)glArrayElementEXT, "glArrayElementEXT" },
- { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
- { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
- { (PROC)glBindTextureEXT, "glBindTextureEXT" },
- { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
- { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
- { (PROC)glIsTextureEXT, "glIsTextureEXT" },
- { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
- { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
- { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
- { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
- { (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
- { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
-
- { (PROC)glLockArraysEXT, "glLockArraysEXT" },
- { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
- { NULL, "\0" }
-};
-
-GLD_extension GLD_multitexList[] = {
-/*
- { (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" },
- { (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" },
- { (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" },
- { (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" },
- { (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" },
- { (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" },
- { (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" },
- { (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" },
- { (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" },
- { (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" },
- { (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
- { (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" },
- { (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" },
- { (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" },
- { (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" },
- { (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" },
- { (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" },
- { (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" },
- { (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" },
- { (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" },
- { (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" },
- { (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" },
- { (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" },
- { (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" },
- { (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" },
- { (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" },
- { (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" },
- { (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" },
- { (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" },
- { (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" },
- { (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" },
- { (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" },
- { (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" },
-*/
- { (PROC)glActiveTextureARB, "glActiveTextureARB" },
- { (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" },
- { (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" },
- { (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" },
- { (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" },
- { (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" },
- { (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" },
- { (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" },
- { (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" },
- { (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" },
- { (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" },
- { (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" },
- { (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" },
- { (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" },
- { (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" },
- { (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" },
- { (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" },
- { (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" },
- { (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" },
- { (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" },
- { (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" },
- { (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" },
- { (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" },
- { (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" },
- { (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" },
- { (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" },
- { (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" },
- { (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" },
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" },
- { (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" },
- { (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" },
- { (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" },
- { (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" },
- { (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" },
-
- // Descent3 doesn't use correct string, hence this hack
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" },
-
- // Quake2 SGIS multitexture
- { (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
-
- { NULL, "\0" }
-};
-
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX(
- LPCSTR a)
-{
- int i;
- PROC proc = NULL;
-
- for (i=0; GLD_extList[i].proc; i++) {
- if (!strcmp(a, GLD_extList[i].name)) {
- proc = GLD_extList[i].proc;
- break;
- }
- }
-
- if (glb.bMultitexture) {
- for (i=0; GLD_multitexList[i].proc; i++) {
- if (!strcmp(a, GLD_multitexList[i].name)) {
- proc = GLD_multitexList[i].proc;
- break;
- }
- }
- }
-
- gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
-
- return proc;
-}
-
-//---------------------------------------------------------------------------
-
-void gldEnableExtensions_DX9(
- struct gl_context *ctx)
-{
- GLuint i;
-
- // Mesa enables some extensions by default.
- // This table decides which ones we want to switch off again.
-
- // NOTE: GL_EXT_compiled_vertex_array appears broken.
-
- const char *gld_disable_extensions[] = {
-// "GL_ARB_transpose_matrix",
-// "GL_EXT_compiled_vertex_array",
-// "GL_EXT_polygon_offset",
-// "GL_EXT_rescale_normal",
- "GL_EXT_texture3D",
-// "GL_NV_texgen_reflection",
- NULL
- };
-
- const char *gld_multitex_extensions[] = {
- "GL_ARB_multitexture", // Quake 3
- NULL
- };
-
- // Quake 2 engines
- const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture";
-
- const char *gld_enable_extensions[] = {
- "GL_EXT_texture_env_add", // Quake 3
- "GL_ARB_texture_env_add", // Quake 3
- NULL
- };
-
- for (i=0; gld_disable_extensions[i]; i++) {
- _mesa_disable_extension(ctx, gld_disable_extensions[i]);
- }
-
- for (i=0; gld_enable_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_enable_extensions[i]);
- }
-
- if (glb.bMultitexture) {
- for (i=0; gld_multitex_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_multitex_extensions[i]);
- }
-
- // GL_SGIS_multitexture
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // Fair bit slower on GeForce256,
- // Much slower on 3dfx Voodoo5 5500.
-// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
- }
-
- _mesa_enable_imaging_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
- _mesa_enable_1_4_extensions(ctx);
-}
-
-//---------------------------------------------------------------------------
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c
deleted file mode 100644
index 6c41e567d..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Mesa transformation pipeline with GLDirect fastpath
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-
-extern struct tnl_pipeline_stage _gld_d3d_render_stage;
-extern struct tnl_pipeline_stage _gld_mesa_render_stage;
-
-static const struct tnl_pipeline_stage *gld_pipeline[] = {
- &_gld_d3d_render_stage, // Direct3D TnL
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
- &_gld_mesa_render_stage, // Mesa TnL, D3D rendering
- 0,
-};
-
-//---------------------------------------------------------------------------
-
-void gldInstallPipeline_DX9(
- struct gl_context *ctx)
-{
- // Remove any existing pipeline stages,
- // then install GLDirect pipeline stages.
-
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, gld_pipeline);
-}
-
-//---------------------------------------------------------------------------
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
deleted file mode 100644
index 256ffcc38..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
+++ /dev/null
@@ -1,1445 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Primitive (points/lines/tris/quads) rendering
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "vbo/vbo.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "swrast/s_context.h"
-#include "swrast/s_depth.h"
-#include "swrast/s_lines.h"
-#include "swrast/s_triangle.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-// Disable compiler complaints about unreferenced local variables
-#pragma warning (disable:4101)
-
-//---------------------------------------------------------------------------
-// Helper defines for primitives
-//---------------------------------------------------------------------------
-
-//static const float ooZ = 1.0f / 65536.0f; // One over Z
-
-#define GLD_COLOUR (D3DCOLOR_RGBA(swv->color[0], swv->color[1], swv->color[2], swv->color[3]))
-#define GLD_SPECULAR (D3DCOLOR_RGBA(swv->specular[0], swv->specular[1], swv->specular[2], swv->specular[3]))
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-//---------------------------------------------------------------------------
-// 2D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_2D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pPoints; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pLines; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_TRIANGLES \
- BOOL bFog = ctx->Fog.Enabled; \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pTriangles; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour; \
- GLuint facing = 0; \
- struct vertex_buffer *VB; \
- GLchan (*vbcolor)[4]; \
- GLchan (*vbspec)[4]
-
-#define GLD_SETUP_GET_SWVERT(s) \
- swv = &ss->verts[##s]
-
-#define GLD_SETUP_2D_VERTEX \
- pV->x = swv->win[0]; \
- pV->y = GLD_FLIP_Y(swv->win[1]); \
- pV->rhw = swv->win[3]
-
-#define GLD_SETUP_SMOOTH_COLOUR \
- pV->diffuse = GLD_COLOUR
-
-#define GLD_SETUP_GET_FLAT_COLOUR \
- dwFlatColour = GLD_COLOUR
-#define GLD_SETUP_GET_FLAT_FOG_COLOUR \
- dwFlatColour = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_USE_FLAT_COLOUR \
- pV->diffuse = dwFlatColour
-
-#define GLD_SETUP_GET_FLAT_SPECULAR \
- dwSpecularColour= GLD_SPECULAR
-
-#define GLD_SETUP_USE_FLAT_SPECULAR \
- pV->specular = dwSpecularColour
-
-#define GLD_SETUP_DEPTH \
- pV->sz = swv->win[2] / ctx->DepthMaxF
-// pV->z = swv->win[2] * ooZ;
-
-#define GLD_SETUP_SPECULAR \
- pV->specular = GLD_SPECULAR
-
-#define GLD_SETUP_FOG \
- pV->diffuse = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_TEX0 \
- pV->t0_u = swv->texcoord[0][0]; \
- pV->t0_v = swv->texcoord[0][1]
-
-#define GLD_SETUP_TEX1 \
- pV->t1_u = swv->texcoord[1][0]; \
- pV->t1_v = swv->texcoord[1][1]
-
-#define GLD_SETUP_LIGHTING(v) \
- if (facing == 1) { \
- pV->diffuse = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- pV->specular = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- } else { \
- if (bFog) \
- GLD_SETUP_FOG; \
- else \
- GLD_SETUP_SMOOTH_COLOUR; \
- GLD_SETUP_SPECULAR; \
- }
-
-#define GLD_SETUP_GET_FLAT_LIGHTING(v) \
- if (facing == 1) { \
- dwFlatColour = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- dwSpecularColour = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- }
-
-#define GLD_SETUP_TWOSIDED_LIGHTING \
- /* Two-sided lighting */ \
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { \
- SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; \
- SWvertex *v[3]; \
- GLfloat ex,ey,fx,fy,cc; \
- /* Get vars for later */ \
- VB = &TNL_CONTEXT(ctx)->vb; \
- vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data; \
- if (VB->BackfaceSecondaryColorPtr) { \
- vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data; \
- } else { \
- vbspec = NULL; \
- } \
- v[0] = &verts[v0]; \
- v[1] = &verts[v1]; \
- v[2] = &verts[v2]; \
- ex = v[0]->win[0] - v[2]->win[0]; \
- ey = v[0]->win[1] - v[2]->win[1]; \
- fx = v[1]->win[0] - v[2]->win[0]; \
- fy = v[1]->win[1] - v[2]->win[1]; \
- cc = ex*fy - ey*fx; \
- facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; \
- }
-
-//---------------------------------------------------------------------------
-// 3D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_3D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pPoints; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pLines; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_TRIANGLES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pTriangles; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VERTEX(v) \
- p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data; \
- pV->Position.x = p4f[##v][0]; \
- pV->Position.y = p4f[##v][1]; \
- pV->Position.z = p4f[##v][2];
-
-#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; \
- pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-
-#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR00]->data; \
- dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-#define GLD_SETUP_USE_FLAT_COLOUR_3D \
- pV->Diffuse = dwColor;
-
-#define GLD_SETUP_TEX0_3D(v) \
- if (VB->AttribPtr[_TNL_ATTRIB_TEX0]) { \
- tc = VB->AttribPtr[_TNL_ATTRIB_TEX0]->data; \
- pV->TexUnit0.x = tc[##v][0]; \
- pV->TexUnit0.y = tc[##v][1]; \
- }
-
-#define GLD_SETUP_TEX1_3D(v) \
- if (VB->AttribPtr[_TNL_ATTRIB_TEX1]) { \
- tc = VB->AttribPtr[_TNL_ATTRIB_TEX1]->data; \
- pV->TexUnit1.x = tc[##v][0]; \
- pV->TexUnit1.y = tc[##v][1]; \
- }
-
-//---------------------------------------------------------------------------
-// Helper functions
-//---------------------------------------------------------------------------
-
-__inline DWORD _gldComputeFog(
- struct gl_context *ctx,
- SWvertex *swv)
-{
- // Full fog calculation.
- // Based on Mesa code.
-
- GLchan rFog, gFog, bFog;
- GLchan fR, fG, fB;
- const GLfloat f = swv->fog;
- const GLfloat g = 1.0 - f;
-
- UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]);
- fR = f * swv->color[0] + g * rFog;
- fG = f * swv->color[1] + g * gFog;
- fB = f * swv->color[2] + g * bFog;
- return D3DCOLOR_RGBA(fR, fG, fB, swv->color[3]);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ResetLineStipple_DX9(
- struct gl_context *ctx)
-{
- // TODO: Fake stipple with a 32x32 texture.
-}
-
-//---------------------------------------------------------------------------
-// 2D (post-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points2D_DX9(
- struct gl_context *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_2D_VARS_POINTS;
-
- unsigned i;
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
- GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- } else {
- GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, swv++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- }
-
- gld->PB2d.pPoints = (BYTE*)pV;
- gld->PB2d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlat_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmooth_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlat_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmooth_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
-
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatExtras_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v2);
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v2);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothExtras_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlat_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmooth_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatExtras_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v3);
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v3);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothExtras_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v3);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// 3D (pre-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points3D_DX9(
- struct gl_context *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_3D_VARS_POINTS
-
- unsigned i;
-// struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
-// GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_3D_VERTEX(VB->Elts[i])
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- } else {
-// GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- }
-/*
- for (i=first; i<last; i++, pV++) {
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
-*/
- gld->PB3d.pPoints = (BYTE*)pV;
- gld->PB3d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-// Line functions
-//---------------------------------------------------------------------------
-
-void gld_Line3DFlat_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line3DSmooth_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-// Triangle functions
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DFlat_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DSmooth_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-// Quad functions
-//---------------------------------------------------------------------------
-
-void gld_Quad3DFlat_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad3DSmooth_DX9(
- struct gl_context *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_SMOOTH_COLOUR_3D(v3)
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// Vertex setup for two-sided-lighting vertex shader
-//---------------------------------------------------------------------------
-
-/*
-
-void gld_Points2DTwoside_DX9(struct gl_context *ctx, GLuint first, GLuint last)
-{
- // NOTE: Two-sided lighting does not apply to Points
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-*/
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c
deleted file mode 100644
index c3ebdc3af..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c
+++ /dev/null
@@ -1,2104 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Texture / Bitmap functions
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include <d3dx9tex.h>
-
-#include "texformat.h"
-#include "colormac.h"
-#include "texstore.h"
-#include "image.h"
-// #include "mem.h"
-
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_HEIGHT(y,h) (gldCtx->dwHeight - (y) - (h))
-
-//---------------------------------------------------------------------------
-// 1D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + (i) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (i) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (i))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (i))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 2D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + ((t)->Width * (j) + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 3D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz)
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// Direct3D texture formats that have no Mesa equivalent
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format _gld_texformat_X8R8G8B8 = {
- MESA_FORMAT_ARGB8888, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 8, /* RedBits */
- 8, /* GreenBits */
- 8, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 4, /* TexelBytes */
- _mesa_texstore_argb8888, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X8R8G8B8, /* FetchTexel1D */
- gld_fetch_2d_texel_X8R8G8B8, /* FetchTexel2D */
- gld_fetch_3d_texel_X8R8G8B8, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X8R8G8B8, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X8R8G8B8, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X8R8G8B8, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X1R5G5B5 = {
- MESA_FORMAT_ARGB1555, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 5, /* RedBits */
- 5, /* GreenBits */
- 5, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb1555, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X1R5G5B5, /* FetchTexel1D */
- gld_fetch_2d_texel_X1R5G5B5, /* FetchTexel2D */
- gld_fetch_3d_texel_X1R5G5B5, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X1R5G5B5, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X1R5G5B5, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X1R5G5B5, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X4R4G4B4 = {
- MESA_FORMAT_ARGB4444, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 4, /* RedBits */
- 4, /* GreenBits */
- 4, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb4444, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X4R4G4B4, /* FetchTexel1D */
- gld_fetch_2d_texel_X4R4G4B4, /* FetchTexel2D */
- gld_fetch_3d_texel_X4R4G4B4, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X4R4G4B4, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X4R4G4B4, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X4R4G4B4, /* FetchTexel3Df */
-};
-
-//---------------------------------------------------------------------------
-// Texture unit constants
-//---------------------------------------------------------------------------
-
-// List of possible combinations of texture environments.
-// Example: GLD_TEXENV_MODULATE_RGBA means
-// GL_MODULATE, GL_RGBA base internal format.
-#define GLD_TEXENV_DECAL_RGB 0
-#define GLD_TEXENV_DECAL_RGBA 1
-#define GLD_TEXENV_DECAL_ALPHA 2
-#define GLD_TEXENV_REPLACE_RGB 3
-#define GLD_TEXENV_REPLACE_RGBA 4
-#define GLD_TEXENV_REPLACE_ALPHA 5
-#define GLD_TEXENV_MODULATE_RGB 6
-#define GLD_TEXENV_MODULATE_RGBA 7
-#define GLD_TEXENV_MODULATE_ALPHA 8
-#define GLD_TEXENV_BLEND_RGB 9
-#define GLD_TEXENV_BLEND_RGBA 10
-#define GLD_TEXENV_BLEND_ALPHA 11
-#define GLD_TEXENV_ADD_RGB 12
-#define GLD_TEXENV_ADD_RGBA 13
-#define GLD_TEXENV_ADD_ALPHA 14
-
-// Per-stage (i.e. per-unit) texture environment
-typedef struct {
- DWORD ColorArg1; // Colour argument 1
- D3DTEXTUREOP ColorOp; // Colour operation
- DWORD ColorArg2; // Colour argument 2
- DWORD AlphaArg1; // Alpha argument 1
- D3DTEXTUREOP AlphaOp; // Alpha operation
- DWORD AlphaArg2; // Alpha argument 2
-} GLD_texenv;
-
-// TODO: Do we really need to set ARG1 and ARG2 every time?
-// They seem to always be TEXTURE and CURRENT respectively.
-
-// C = Colour out
-// A = Alpha out
-// Ct = Colour from Texture
-// Cf = Colour from fragment (diffuse)
-// At = Alpha from Texture
-// Af = Alpha from fragment (diffuse)
-// Cc = GL_TEXTURE_ENV_COLOUR (GL_BLEND)
-const GLD_texenv gldTexEnv[] = {
- // DECAL_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_RGBA: C=Cf(1-At)+CtAt, A=Af
- {D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_ALPHA: <undefined> use DECAL_RGB
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
-
- // REPLACE_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // REPLACE_RGBA: C=Ct, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
- // REPLACE_ALPHA: C=Cf, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
-
- // MODULATE_RGB: C=CfCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // MODULATE_RGBA: C=CfCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // MODULATE_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // BLEND_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- // ADD_RGB: C=Cf+Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // ADD_RGBA: C=Cf+Ct, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // ADD_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-};
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREADDRESS _gldConvertWrap(
- GLenum wrap)
-{
- return (wrap == GL_CLAMP) ? D3DTADDRESS_CLAMP : D3DTADDRESS_WRAP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREFILTERTYPE _gldConvertMagFilter(
- GLenum magfilter)
-{
- return (magfilter == GL_LINEAR) ? D3DTEXF_LINEAR : D3DTEXF_POINT;
-}
-
-//---------------------------------------------------------------------------
-
-void _gldConvertMinFilter(
- GLenum minfilter,
- D3DTEXTUREFILTERTYPE *min_filter,
- D3DTEXTUREFILTERTYPE *mip_filter)
-{
- switch (minfilter) {
- case GL_NEAREST:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_NONE;
- break;
- case GL_LINEAR:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_POINT;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_POINT;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_LINEAR;
- break;
- }
-}
-
-//---------------------------------------------------------------------------
-
-D3DFORMAT _gldGLFormatToD3DFormat(
- GLenum internalFormat)
-{
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- // LUNIMANCE != INTENSITY, but D3D doesn't have I8 textures
- return D3DFMT_L8;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return D3DFMT_L8;
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return D3DFMT_A8;
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return D3DFMT_X8R8G8B8;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return D3DFMT_A8L8;
- case GL_R3_G3_B2:
- // TODO: Mesa does not support RGB332 internally
- return D3DFMT_X4R4G4B4; //D3DFMT_R3G3B2;
- case GL_RGB4:
- return D3DFMT_X4R4G4B4;
- case GL_RGB5:
- return D3DFMT_X1R5G5B5;
- case 3:
- case GL_RGB:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return D3DFMT_R8G8B8;
- case GL_RGBA4:
- return D3DFMT_A4R4G4B4;
- case 4:
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return D3DFMT_A8R8G8B8;
- case GL_RGB5_A1:
- return D3DFMT_A1R5G5B5;
- }
-
- // Return an acceptable default
- return D3DFMT_A8R8G8B8;
-}
-
-//---------------------------------------------------------------------------
-
-GLenum _gldDecodeBaseFormat(
- IDirect3DTexture9 *pTex)
-{
- // Examine Direct3D texture and return base OpenGL internal texture format
- // NOTE: We can't use any base format info from Mesa because D3D might have
- // used a different texture format when we used D3DXCreateTexture().
-
- // Base internal format is one of (Red Book p355):
- // GL_ALPHA,
- // GL_LUMINANCE,
- // GL_LUMINANCE_ALPHA,
- // GL_INTENSITY,
- // GL_RGB,
- // GL_RGBA
-
- // NOTE: INTENSITY not used (not supported by Direct3D)
- // LUMINANCE has same texture functions as RGB
- // LUMINANCE_ALPHA has same texture functions as RGBA
-
- // TODO: cache format instead of using GetLevelDesc()
- D3DSURFACE_DESC desc;
- _GLD_DX9_TEX(GetLevelDesc(pTex, 0, &desc));
-
- switch (desc.Format) {
- case D3DFMT_R8G8B8:
- case D3DFMT_X8R8G8B8:
- case D3DFMT_R5G6B5:
- case D3DFMT_X1R5G5B5:
- case D3DFMT_R3G3B2:
- case D3DFMT_X4R4G4B4:
- case D3DFMT_P8:
- case D3DFMT_L8:
- return GL_RGB;
- case D3DFMT_A8R8G8B8:
- case D3DFMT_A1R5G5B5:
- case D3DFMT_A4R4G4B4:
- case D3DFMT_A8R3G3B2:
- case D3DFMT_A8P8:
- case D3DFMT_A8L8:
- case D3DFMT_A4L4:
- return GL_RGBA;
- case D3DFMT_A8:
- return GL_ALPHA;
- // Compressed texture formats. Need to check these...
- case D3DFMT_DXT1:
- return GL_RGBA;
- case D3DFMT_DXT2:
- return GL_RGB;
- case D3DFMT_DXT3:
- return GL_RGBA;
- case D3DFMT_DXT4:
- return GL_RGB;
- case D3DFMT_DXT5:
- return GL_RGBA;
- }
-
- // Fell through. Return arbitary default.
- return GL_RGBA;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* _gldMesaFormatForD3DFormat(
- D3DFORMAT d3dfmt)
-{
- switch (d3dfmt) {
- case D3DFMT_A8R8G8B8:
- return &_mesa_texformat_argb8888;
- case D3DFMT_R8G8B8:
- return &_mesa_texformat_rgb888;
- case D3DFMT_R5G6B5:
- return &_mesa_texformat_rgb565;
- case D3DFMT_A4R4G4B4:
- return &_mesa_texformat_argb4444;
- case D3DFMT_A1R5G5B5:
- return &_mesa_texformat_argb1555;
- case D3DFMT_A8L8:
- return &_mesa_texformat_al88;
- case D3DFMT_R3G3B2:
- return &_mesa_texformat_rgb332;
- case D3DFMT_A8:
- return &_mesa_texformat_a8;
- case D3DFMT_L8:
- return &_mesa_texformat_l8;
- case D3DFMT_X8R8G8B8:
- return &_gld_texformat_X8R8G8B8;
- case D3DFMT_X1R5G5B5:
- return &_gld_texformat_X1R5G5B5;
- case D3DFMT_X4R4G4B4:
- return &_gld_texformat_X4R4G4B4;
- }
-
- // If we reach here then we've made an error somewhere else
- // by allowing a format that is not supported.
- assert(0);
-
- return NULL; // Shut up compiler warning
-}
-
-//---------------------------------------------------------------------------
-// Copy* functions
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage1D_DX9(
- struct gl_context *ctx,
- GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y,
- GLsizei width, GLint border )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage2D_DX9(
- struct gl_context *ctx,
- GLenum target,
- GLint level,
- GLenum internalFormat,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- GLint border)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage1D_DX9(
- struct gl_context *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage2D_DX9(
- struct gl_context *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage3D_DX9(
- struct gl_context *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height )
-{
- // TODO ?
-}
-
-//---------------------------------------------------------------------------
-// Bitmap/Pixel functions
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-#define _GLD_FVF_IMAGE (D3DFVF_XYZRHW | D3DFVF_TEX1)
-
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT z; // depth value
- FLOAT rhw; // reciprocal homogenous W (always 1.0f)
- FLOAT tu, tv; // texture coords
-} _GLD_IMAGE_VERTEX;
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldDrawPixels(
- struct gl_context *ctx,
- BOOL bChromakey, // Alpha test for glBitmap() images
- GLint x, // GL x position
- GLint y, // GL y position (needs flipping)
- GLsizei width, // Width of input image
- GLsizei height, // Height of input image
- IDirect3DSurface9 *pImage)
-{
- //
- // Draw input image as texture implementing PixelZoom and clipping.
- // Any fragment operations currently enabled will be used.
- //
-
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTexture;
- D3DSURFACE_DESC d3dsd;
- IDirect3DSurface9 *pSurface;
- _GLD_IMAGE_VERTEX v[4];
- HRESULT hr;
-
- float ZoomWidth, ZoomHeight;
- float ScaleWidth, ScaleHeight;
-
- // Create a texture to hold image
- hr = D3DXCreateTexture(
- gld->pDev,
- width, height,
- 1, // miplevels
- 0, // usage
- D3DFMT_A8R8G8B8, // format
- D3DPOOL_MANAGED, // pool
- &pTexture);
- if (FAILED(hr))
- return hr;
-
- hr = IDirect3DTexture9_GetSurfaceLevel(pTexture, 0, &pSurface);
- if (FAILED(hr)) {
- IDirect3DTexture9_Release(pTexture);
- return hr;
- }
-
- // Copy image into texture
- hr = D3DXLoadSurfaceFromSurface(
- pSurface, NULL, NULL, // Dest surface
- pImage, NULL, NULL, // Src surface
- D3DX_FILTER_NONE,
- 0);
- IDirect3DSurface9_Release(pSurface);
- if (FAILED(hr)) {
- IDirect3DTexture9_Release(pTexture);
- return hr;
- }
-
- //
- // Set up the quad like this (ascii-art ahead!)
- //
- // 3--2
- // | |
- // 0--1
- //
- //
-
- // Set depth
- v[0].z = v[1].z = v[2].z = v[3].z = ctx->Current.RasterPos[2];
- // Set Reciprocal Homogenous W
- v[0].rhw = v[1].rhw = v[2].rhw = v[3].rhw = 1.0f;
-
- // Set texcoords
- // Examine texture size - if different to input width and height
- // then we'll need to munge the texcoords to fit.
- IDirect3DTexture9_GetLevelDesc(pTexture, 0, &d3dsd);
- ScaleWidth = (float)width / (float)d3dsd.Width;
- ScaleHeight = (float)height / (float)d3dsd.Height;
- v[0].tu = 0.0f; v[0].tv = 0.0f;
- v[1].tu = ScaleWidth; v[1].tv = 0.0f;
- v[2].tu = ScaleWidth; v[2].tv = ScaleHeight;
- v[3].tu = 0.0f; v[3].tv = ScaleHeight;
-
- // Set raster positions
- ZoomWidth = (float)width * ctx->Pixel.ZoomX;
- ZoomHeight = (float)height * ctx->Pixel.ZoomY;
-
- v[0].x = x; v[0].y = GLD_FLIP_Y(y);
- v[1].x = x+ZoomWidth; v[1].y = GLD_FLIP_Y(y);
- v[2].x = x+ZoomWidth; v[2].y = GLD_FLIP_Y(y+ZoomHeight);
- v[3].x = x; v[3].y = GLD_FLIP_Y(y+ZoomHeight);
-
- // Draw image with full HW acceleration
- // NOTE: Be nice to use a State Block for all this state...
- IDirect3DDevice9_SetTexture(gld->pDev, 0, pTexture);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE);
-
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MINFILTER, D3DTEXF_POINT);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MAGFILTER, D3DTEXF_POINT);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
-
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 1, D3DTSS_COLOROP, D3DTOP_DISABLE);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
-
- IDirect3DDevice9_SetVertexShader(gld->pDev, NULL);
- IDirect3DDevice9_SetFVF(gld->pDev, _GLD_FVF_IMAGE);
-
- //
- // Emulate Chromakey with an Alpha Test.
- // [Alpha Test is more widely supported anyway]
- //
- if (bChromakey) {
- // Switch on alpha testing
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, TRUE);
- // Fragment passes is alpha is greater than reference value
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, D3DCMP_GREATER);
- // Set alpha reference value between Bitmap alpha values of
- // zero (transparent) and one (opaque).
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHAREF, 0x7f);
- }
-
- IDirect3DDevice9_DrawPrimitiveUP(gld->pDev, D3DPT_TRIANGLEFAN, 2, &v, sizeof(_GLD_IMAGE_VERTEX));
-
- // Release texture
- IDirect3DDevice9_SetTexture(gld->pDev, 0, NULL);
- IDirect3DTexture9_Release(pTexture);
-
- // Reset state to before we messed it up
- FLUSH_VERTICES(ctx, _NEW_ALL);
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DrawPixels_DX9(
- struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pImage;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
-
- const struct gl_texture_format *MesaFormat;
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
-
- // Mesa does not currently handle this format.
- if (format == GL_BGR)
- return;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- D3DPOOL_SCRATCH,
- &pImage,
- NULL);
- if (FAILED(hr)) {
- return;
- }
-
- //
- // Use Mesa to fill in image
- //
-
- // Lock all of surface
- hr = IDirect3DSurface9_LockRect(pImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- MesaFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA,
- &_mesa_texformat_argb8888,
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, /* dstImageStride */
- format, type, pixels, unpack);
-
- IDirect3DSurface9_UnlockRect(pImage);
-
- _gldDrawPixels(ctx, FALSE, x, y, width, height, pImage);
-
- IDirect3DSurface9_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ReadPixels_DX9(
- struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest)
-{
-
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pBackbuffer = NULL;
- IDirect3DSurface9 *pNativeImage = NULL;
- IDirect3DSurface9 *pCanonicalImage = NULL;
-
- D3DSURFACE_DESC d3dsd;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- struct gl_pixelstore_attrib srcPacking;
- int i;
- GLint DstRowStride;
- const struct gl_texture_format *MesaFormat;
-
- switch (format) {
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- return;
- }
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
- DstRowStride = _mesa_image_row_stride(pack, width, format, type);
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice9_GetBackBuffer(
- gld->pDev,
- 0, // First swapchain
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface9_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- D3DPOOL_SCRATCH,
- &pNativeImage,
- NULL);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, x, GLD_FLIP_HEIGHT(y, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels.
- //
- // This intermediate surface ensure that we can use CopyRects()
- // instead of relying on D3DXLoadSurfaceFromSurface(), which may
- // try and lock the backbuffer. This way seems safer.
- //
- // CopyRects has been removed for DX9.
- //
-/* hr = IDirect3DDevice9_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pNativeImage,
- &ptDst);*/
- hr = D3DXLoadSurfaceFromSurface(
- pNativeImage, // Dest surface
- NULL, // Dest palette
- &rcSrc, // Dest rect
- pBackbuffer, // Src surface
- NULL, // Src palette
- &rcSrc, // Src rect
- D3DX_FILTER_NONE, // Filter
- 0 // Colorkey (0=no colorkey)
- );
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Create an RGBA8888 surface
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- D3DPOOL_SCRATCH,
- &pCanonicalImage,
- NULL);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Convert to RGBA8888
- hr = D3DXLoadSurfaceFromSurface(
- pCanonicalImage, // Dest surface
- NULL, NULL, // Dest palette, RECT
- pNativeImage, // Src surface
- NULL, NULL, // Src palette, RECT
- D3DX_FILTER_NONE, // Filter
- 0); // Colourkey
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- srcPacking.Alignment = 1;
- srcPacking.ImageHeight = height;
- srcPacking.LsbFirst = GL_FALSE;
- srcPacking.RowLength = 0;
- srcPacking.SkipImages = 0;
- srcPacking.SkipPixels = 0;
- srcPacking.SkipRows = 0;
- srcPacking.SwapBytes = GL_FALSE;
-
- // Lock all of image
- hr = IDirect3DSurface9_LockRect(pCanonicalImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // We need to flip the data. Yuck.
- // Perhaps Mesa has a span packer we can use in future...
- for (i=0; i<height; i++) {
- BYTE *pDestRow = (BYTE*)_mesa_image_address(2,pack, dest, width, height, format, type, 0, i, 0);
- BYTE *pSrcRow = (BYTE*)d3dLockedRect.pBits + (d3dLockedRect.Pitch * (height-i-1));
- MesaFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA, // base format
- MesaFormat, // dst format
- pDestRow, // dest addr
- width, 1, 1, 0, 0, 0, // src x,y,z & dst offsets x,y,z
- DstRowStride, // dst row stride
- 0, // dstImageStride
- GL_BGRA, // src format
- GL_UNSIGNED_BYTE, // src type
- pSrcRow, // src addr
- &srcPacking); // packing params of source image
- }
-
- IDirect3DSurface9_UnlockRect(pCanonicalImage);
-
-gld_ReadPixels_DX9_return:
- SAFE_RELEASE_SURFACE9(pCanonicalImage);
- SAFE_RELEASE_SURFACE9(pNativeImage);
- SAFE_RELEASE_SURFACE9(pBackbuffer);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_CopyPixels_DX9(
- struct gl_context *ctx,
- GLint srcx,
- GLint srcy,
- GLsizei width,
- GLsizei height,
- GLint dstx,
- GLint dsty,
- GLenum type)
-{
- //
- // NOTE: Not allowed to copy vidmem to vidmem!
- // Therefore we use an intermediate image surface.
- //
-
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pBackbuffer;
- D3DSURFACE_DESC d3dsd;
- IDirect3DSurface9 *pImage;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
-
- // Only backbuffer
- if (type != GL_COLOR)
- return;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice9_GetBackBuffer(
- gld->pDev,
- 0, // First swapchain
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface9_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pBackbuffer);
- return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- D3DPOOL_SCRATCH,
- &pImage,
- NULL);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pBackbuffer);
- return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, srcx, GLD_FLIP_HEIGHT(srcy, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels
-/* hr = IDirect3DDevice8_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pImage,
- &ptDst);*/
- hr = D3DXLoadSurfaceFromSurface(
- pImage, // Dest surface
- NULL, // Dest palette
- &rcSrc, // Dest rect
- pBackbuffer, // Src surface
- NULL, // Src palette
- &rcSrc, // Src rect
- D3DX_FILTER_NONE, // Filter
- 0 // Colorkey (0=no colorkey)
- );
- IDirect3DSurface9_Release(pBackbuffer);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- _gldDrawPixels(ctx, FALSE, dstx, dsty, width, height, pImage);
-
- IDirect3DSurface9_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Bitmap_DX9(
- struct gl_context *ctx,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap)
-{
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pImage;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- BYTE *pTempBitmap;
- D3DCOLOR clBitmapOne, clBitmapZero;
- D3DCOLOR *pBits;
- const GLubyte *src;
- int i, j, k;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // A NULL bitmap is valid, but merely advances the raster position
- if ((bitmap == NULL) || (width == 0) || (height == 0))
- return;
-
- clBitmapZero = D3DCOLOR_RGBA(0,0,0,0); // NOTE: Alpha is Zero
- clBitmapOne = D3DCOLOR_COLORVALUE(
- ctx->Current.RasterColor[0],
- ctx->Current.RasterColor[1],
- ctx->Current.RasterColor[2],
- 1.0f); // NOTE: Alpha is One
-
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- D3DPOOL_SCRATCH,
- &pImage,
- NULL);
- if (FAILED(hr)) {
- return;
- }
-
- // Lock all of surface
- hr = IDirect3DSurface9_LockRect(pImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- pTempBitmap = _mesa_unpack_bitmap(width, height, bitmap, unpack);
- if (pTempBitmap == NULL) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- pBits = (D3DCOLOR*)d3dLockedRect.pBits;
-
- for (i=0; i<height; i++) {
- GLubyte byte;
- pBits = (D3DCOLOR*)((BYTE*)d3dLockedRect.pBits + (i*d3dLockedRect.Pitch));
- src = (const GLubyte *) _mesa_image_address(2,
- &ctx->DefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
- 0, i, 0);
- for (j=0; j<(width>>3); j++) {
- byte = *src++;
- for (k=0; k<8; k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- // Fill remaining bits from bitmap
- if (width & 7) {
- byte = *src;
- for (k=0; k<(width & 7); k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- }
-
- FREE(pTempBitmap);
-
-/*
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- GL_BITMAP,
- &_mesa_texformat_argb8888,
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- GL_BITMAP, GL_COLOR_INDEX, bitmap, unpack);
-*/
- IDirect3DSurface9_UnlockRect(pImage);
-
- _gldDrawPixels(ctx, TRUE, x, y, width, height, pImage);
-
- IDirect3DSurface9_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-// Texture functions
-//---------------------------------------------------------------------------
-
-void _gldAllocateTexture(
- struct gl_context *ctx,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- D3DFORMAT d3dFormat;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (pTex) {
- // Decide whether we can keep existing D3D texture
- // by examining top-level surface.
- D3DSURFACE_DESC d3dsd;
- _GLD_DX9_TEX(GetLevelDesc(pTex, 0, &d3dsd));
- // Release existing texture if not compatible
- if ((d3dsd.Width == texImage->Width) ||
- (d3dsd.Height == texImage->Height))
- {
- return; // Keep the existing texture
- }
- tObj->DriverData = NULL;
- _GLD_DX9_TEX(Release(pTex));
- }
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->IntFormat);
- D3DXCreateTexture(
- gld->pDev,
- texImage->Width,
- texImage->Height,
- // TODO: Re-evaluate mipmapping
- (glb.bUseMipmaps) ? D3DX_DEFAULT : 1,
- 0, // Usage
- d3dFormat,
- D3DPOOL_MANAGED,
- &pTex);
- tObj->DriverData = pTex;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* gld_ChooseTextureFormat_DX9(
- struct gl_context *ctx,
- GLint internalFormat,
- GLenum srcFormat,
- GLenum srcType)
-{
- // [Based on mesa_choose_tex_format()]
- //
- // We will choose only texture formats that are supported
- // by Direct3D. If the hardware doesn't support a particular
- // texture format, then the D3DX texture calls that we use
- // will automatically use a HW supported format.
- //
- // The most critical aim is to reduce copying; if we can use
- // texture-image data directly then it will be a big performance assist.
- //
-
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return &_mesa_texformat_a8; // D3DFMT_A8
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_rgb565; // D3DFMT_R5G6B5
- // Mesa will convert this for us later...
- // return &_mesa_texformat_ci8; // D3DFMT_R5G6B5
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return &_mesa_texformat_al88; // D3DFMT_A8L8
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb332; // D3DFMT_R3G3B2
- case GL_RGB4:
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444; // D3DFMT_A4R4G4B4
- case 3:
- case GL_RGB:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return &_mesa_texformat_rgb565;
- case 4:
- case GL_RGBA:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return &_mesa_texformat_argb8888;
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
- default:
- _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat");
- return NULL;
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
-// Safer(?), slower version.
-void gld_TexImage2D_DX9(
- struct gl_context *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- RECT rcSrcRect;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
-
- if (!tObj || !texImage)
- return;
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture9_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface9_Release(pSurface);
- return;
- }
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- SetRect(&rcSrcRect, 0, 0, width, height);
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- NULL,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface9_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexImage2D_DX9(
- struct gl_context *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- D3DSURFACE_DESC d3dsd;
-
- if (!tObj || !texImage)
- return;
-
- // GLQUAKE FIX
- // Test for input alpha data with non-alpha internalformat
- if (((internalFormat==3) || (internalFormat==GL_RGB)) && (format==GL_RGBA)) {
- // Input format has alpha, but a non-alpha format has been requested.
- texImage->IntFormat = GL_RGBA;
- internalFormat = GL_RGBA;
- }
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture9_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- IDirect3DSurface9_GetDesc(pSurface, &d3dsd);
-
- // Lock all of surface
- hr = IDirect3DSurface9_LockRect(pSurface, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- texImage->Format,
- _gldMesaFormatForD3DFormat(d3dsd.Format),
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- IDirect3DSurface9_UnlockRect(pSurface);
- IDirect3DSurface9_Release(pSurface);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- // A 1D texture is a 2D texture with a height of zero
- gld_TexImage2D_DX9(ctx, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-/*
-void gld_TexSubImage2D( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_GET_CONTEXT
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- D3DFORMAT d3dFormat;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
- RECT rcSrcRect;
- RECT rcDstRect;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= _GLD_DX9_TEX(GetLevelCount(pTex))
- return; // Level does not exist
- hr = _GLD_DX9_TEX(GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->Format);
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface9_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- // Source rectangle is whole of input image
- SetRect(&rcSrcRect, 0, 0, width, height);
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- &rcDstRect,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface9_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexSubImage2D_DX9( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- HRESULT hr;
- RECT rcDstRect;
- D3DLOCKED_RECT d3dLockedRect;
- D3DSURFACE_DESC d3dsd;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture9_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- IDirect3DSurface9_GetDesc(pSurface, &d3dsd);
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- // Lock sub-rect of surface
- hr = IDirect3DSurface9_LockRect(pSurface, &d3dLockedRect, &rcDstRect, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- _gldMesaFormatForD3DFormat(d3dsd.Format),
- d3dLockedRect.pBits,
- width, height, 1,
- 0, 0, 0, // NOTE: d3dLockedRect.pBits is already offset!!!
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
-
- IDirect3DSurface9_UnlockRect(pSurface);
- IDirect3DSurface9_Release(pSurface);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexSubImage1D_DX9( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gld_TexSubImage2D_DX9(ctx, target, level, xoffset, 0, width, 1, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DeleteTexture_DX9(
- struct gl_context *ctx,
- struct gl_texture_object *tObj)
-{
- GLD_context *gld = (GLD_context*)(ctx->DriverCtx);
-
- if (tObj) {
- IDirect3DTexture9 *pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (pTex) {
-/* // Make sure texture is not bound to a stage before releasing it
- for (int i=0; i<MAX_TEXTURE_UNITS; i++) {
- if (gld->CurrentTexture[i] == pTex) {
- gld->pDev->SetTexture(i, NULL);
- gld->CurrentTexture[i] = NULL;
- }
- }*/
- _GLD_DX9_TEX(Release(pTex));
- tObj->DriverData = NULL;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetColorOps(
- const GLD_driver_dx9 *gld,
- GLuint unit,
- DWORD ColorArg1,
- D3DTEXTUREOP ColorOp,
- DWORD ColorArg2)
-{
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG1, ColorArg1));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLOROP, ColorOp));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG2, ColorArg2));
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetAlphaOps(
- const GLD_driver_dx9 *gld,
- GLuint unit,
- DWORD AlphaArg1,
- D3DTEXTUREOP AlphaOp,
- DWORD AlphaArg2)
-{
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG1, AlphaArg1));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAOP, AlphaOp));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG2, AlphaArg2));
-}
-
-//---------------------------------------------------------------------------
-
-void gldUpdateTextureUnit(
- struct gl_context *ctx,
- GLuint unit,
- BOOL bPassThrough)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DTEXTUREFILTERTYPE minfilter;
- D3DTEXTUREFILTERTYPE mipfilter;
- GLenum BaseFormat;
- DWORD dwColorArg0;
- int iTexEnv = 0;
- GLD_texenv *pTexenv;
-
- // NOTE: If bPassThrough is FALSE then texture stage can be
- // disabled otherwise it must pass-through it's current fragment.
-
- const struct gl_texture_unit *pUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *tObj = pUnit->_Current;
-
- IDirect3DTexture9 *pTex = NULL;
- if (tObj) {
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- }
-
- // Enable texturing if unit is enabled and a valid D3D texture exists
- // Mesa 5: TEXTUREn_x altered to TEXTURE_nD_BIT
- //if (pTex && (pUnit->Enabled & (TEXTURE0_1D | TEXTURE0_2D))) {
- if (pTex && (pUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT))) {
- // Enable texturing
- _GLD_DX9_DEV(SetTexture(gld->pDev, unit, pTex));
- } else {
- // Disable texturing, then return
- _GLD_DX9_DEV(SetTexture(gld->pDev, unit, NULL));
- if (bPassThrough) {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- } else {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- }
- return;
- }
-
- // Texture parameters
- _gldConvertMinFilter(tObj->MinFilter, &minfilter, &mipfilter);
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MINFILTER, minfilter));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MIPFILTER, mipfilter));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter)));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSU, _gldConvertWrap(tObj->WrapS)));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSV, _gldConvertWrap(tObj->WrapT)));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MINFILTER, minfilter));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MIPFILTER, mipfilter));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter)));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_ADDRESSU, _gldConvertWrap(tObj->WrapS)));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_ADDRESSV, _gldConvertWrap(tObj->WrapT)));
-
- // Texture priority
- _GLD_DX9_TEX(SetPriority(pTex, (DWORD)(tObj->Priority*65535.0f)));
-
- // Texture environment
- // TODO: Examine input texture for alpha and use specific alpha/non-alpha ops.
- // See Page 355 of the Red Book.
- BaseFormat = _gldDecodeBaseFormat(pTex);
-
- switch (BaseFormat) {
- case GL_RGB:
- iTexEnv = 0;
- break;
- case GL_RGBA:
- iTexEnv = 1;
- break;
- case GL_ALPHA:
- iTexEnv = 2;
- break;
- }
-
- switch (pUnit->EnvMode) {
- case GL_DECAL:
- iTexEnv += 0;
- break;
- case GL_REPLACE:
- iTexEnv += 3;
- break;
- case GL_MODULATE:
- iTexEnv += 6;
- break;
- case GL_BLEND:
- // Set blend colour
- dwColorArg0 = D3DCOLOR_COLORVALUE(pUnit->EnvColor[0], pUnit->EnvColor[1], pUnit->EnvColor[2], pUnit->EnvColor[3]);
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG0, dwColorArg0));
- iTexEnv += 9;
- break;
- case GL_ADD:
- iTexEnv += 12;
- break;
- }
- pTexenv = (GLD_texenv*)&gldTexEnv[iTexEnv];
- _gldSetColorOps(gld, unit, pTexenv->ColorArg1, pTexenv->ColorOp, pTexenv->ColorArg2);
- _gldSetAlphaOps(gld, unit, pTexenv->AlphaArg1, pTexenv->AlphaOp, pTexenv->AlphaArg2);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_TEXTURE_DX9(
- struct gl_context *ctx)
-{
- // TODO: Support for three (ATI Radeon) or more (nVidia GeForce3) texture units
-
- BOOL bUnit0Enabled;
- BOOL bUnit1Enabled;
-
- if (!ctx)
- return; // Sanity check
-
- if (ctx->Const.MaxTextureUnits == 1) {
- gldUpdateTextureUnit(ctx, 0, TRUE);
- return;
- }
-
- //
- // NOTE: THE FOLLOWING RELATES TO TWO TEXTURE UNITS, AND TWO ONLY!!
- //
-
- // Mesa 5: Texture Units altered
- //bUnit0Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D)) ? TRUE : FALSE;
- //bUnit1Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE1_1D | TEXTURE1_2D)) ? TRUE : FALSE;
- bUnit0Enabled = (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
- bUnit1Enabled = (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
-
- // If Unit0 is disabled and Unit1 is enabled then we must pass-though
- gldUpdateTextureUnit(ctx, 0, (!bUnit0Enabled && bUnit1Enabled) ? TRUE : FALSE);
- // We can always disable the last texture unit
- gldUpdateTextureUnit(ctx, 1, FALSE);
-
-#ifdef _DEBUG
-#if 0
- {
- // Find out whether device supports current renderstates
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-// GLD_context *gld = GLD_GET_CONTEXT(ctx);
-
- DWORD dwPasses;
- _GLD_DX9_DEV(ValidateDevice(gld->pDev, &dwPasses));
-// if (FAILED(hr)) {
-// gldLogError(GLDLOG_ERROR, "ValidateDevice failed", hr);
-// }
- if (dwPasses != 1) {
- gldLogMessage(GLDLOG_ERROR, "ValidateDevice: Can't do in one pass\n");
- }
- }
-#endif
-#endif
-};
-
-//---------------------------------------------------------------------------
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c
deleted file mode 100644
index 28164a8de..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect fastpath pipeline stage
-*
-****************************************************************************/
-
-//---------------------------------------------------------------------------
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-// #include "mem.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetVertexShaderConstants(
- struct gl_context *ctx,
- GLD_driver_dx9 *gld)
-{
- D3DXMATRIX mat, matView, matProj;
- GLfloat *pM;
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ModelView.m;
- pM = ctx->ModelviewMatrixStack.Top->m;
- matView._11 = pM[0];
- matView._12 = pM[1];
- matView._13 = pM[2];
- matView._14 = pM[3];
- matView._21 = pM[4];
- matView._22 = pM[5];
- matView._23 = pM[6];
- matView._24 = pM[7];
- matView._31 = pM[8];
- matView._32 = pM[9];
- matView._33 = pM[10];
- matView._34 = pM[11];
- matView._41 = pM[12];
- matView._42 = pM[13];
- matView._43 = pM[14];
- matView._44 = pM[15];
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ProjectionMatrix.m;
- pM = ctx->ProjectionMatrixStack.Top->m;
- matProj._11 = pM[0];
- matProj._12 = pM[1];
- matProj._13 = pM[2];
- matProj._14 = pM[3];
- matProj._21 = pM[4];
- matProj._22 = pM[5];
- matProj._23 = pM[6];
- matProj._24 = pM[7];
- matProj._31 = pM[8];
- matProj._32 = pM[9];
- matProj._33 = pM[10];
- matProj._34 = pM[11];
- matProj._41 = pM[12];
- matProj._42 = pM[13];
- matProj._43 = pM[14];
- matProj._44 = pM[15];
-
- D3DXMatrixMultiply( &mat, &matView, &matProj );
- D3DXMatrixTranspose( &mat, &mat );
-
- _GLD_DX9_DEV(SetVertexShaderConstantF(gld->pDev, 0, (float*)&mat, 4));
-}
-
-//---------------------------------------------------------------------------
-
-static GLboolean gld_d3d_render_stage_run(
- struct gl_context *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- TNLcontext *tnl;
- struct vertex_buffer *VB;
- tnl_render_func *tab;
- GLint pass;
- GLD_pb_dx9 *gldPB = &gld->PB3d;
-/*
- static int count = 0;
- count++;
- if (count != 2)
- return GL_FALSE;
-*/
- // The "check" function should disable this stage,
- // but we'll test gld->bUseMesaTnL anyway.
- if (gld->bUseMesaTnL) {
- // Do nothing in this stage, but continue pipeline
- return GL_TRUE;
- }
-
- tnl = TNL_CONTEXT(ctx);
- VB = &tnl->vb;
- pass = 0;
-
- tnl->Driver.Render.Start( ctx );
-
-#if 0
- // For debugging: Useful to see if an app passes colour data in
- // an unusual format.
- switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
- case GL_FLOAT:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
- break;
- case GL_UNSIGNED_BYTE:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n");
- break;
- default:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n");
- break;
- }
-#endif
-
- tnl->Driver.Render.Points = gld_Points3D_DX9;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- tnl->Driver.Render.Line = gld_Line3DFlat_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX9;
- tnl->Driver.Render.Quad = gld_Quad3DFlat_DX9;
- } else {
- tnl->Driver.Render.Line = gld_Line3DSmooth_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX9;
- tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX9;
- }
-
- _GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
- // Allocate primitive pointers
- // gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts);
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length)
- {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
- _GLD_DX9_VB(Unlock(gldPB->pVB));
-
- _GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride));
-
- _GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_PROJECTION, &gld->matProjection));
- _GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_WORLD, &gld->matModelView));
-
- if (gldPB->nPoints) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_d3d_render_stage_check(
- struct gl_context *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- // Is this thread safe?
- stage->active = (gld->bUseMesaTnL) ? GL_FALSE : GL_TRUE;
- return;
-}
-
-
-//---------------------------------------------------------------------------
-
-const struct tnl_pipeline_stage _gld_d3d_render_stage =
-{
- "gld_d3d_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- gld_d3d_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c
deleted file mode 100644
index 4023d547d..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c
+++ /dev/null
@@ -1,443 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 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.
- *
- * Authors:
- * Keith Whitwell <keithw@valinux.com>
- */
-
-
-/*
- * Render whole vertex buffers, including projection of vertices from
- * clip space and clipping of primitives.
- *
- * This file makes calls to project vertices and to the point, line
- * and triangle rasterizers via the function pointers:
- *
- * context->Driver.Render.*
- *
- */
-
-
-//---------------------------------------------------------------------------
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-/**********************************************************************/
-/* Clip single primitives */
-/**********************************************************************/
-
-
-#if defined(USE_IEEE)
-#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
-//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
-#else
-#define NEGATIVE(x) (x < 0)
-//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
-/* Could just use (x*y<0) except for the flatshading requirements.
- * Maybe there's a better way?
- */
-#endif
-
-
-#define W(i) coord[i][3]
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 4
-#define TAG(x) x##_4
-#include "tnl/t_vb_cliptmp.h"
-
-
-
-/**********************************************************************/
-/* Clip and render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, with the possibility of clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte ormask = c1|c2; \
- if (!ormask) \
- LineFunc( ctx, v1, v2 ); \
- else if (!(c1 & c2 & 0x3f)) \
- clip_line_4( ctx, v1, v2, ormask ); \
-} while (0)
-
-#define RENDER_TRI( v1, v2, v3 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
- GLubyte ormask = c1|c2|c3; \
- if (!ormask) \
- TriangleFunc( ctx, v1, v2, v3 ); \
- else if (!(c1 & c2 & c3 & 0x3f)) \
- clip_tri_4( ctx, v1, v2, v3, ormask ); \
-} while (0)
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte c3 = mask[v3], c4 = mask[v4]; \
- GLubyte ormask = c1|c2|c3|c4; \
- if (!ormask) \
- QuadFunc( ctx, v1, v2, v3, v4 ); \
- else if (!(c1 & c2 & c3 & c4 & 0x3f)) \
- clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \
-} while (0)
-
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const GLubyte *mask = VB->ClipMask; \
- const GLuint sz = VB->ClipPtr->size; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt; (void) mask; (void) sz; (void) stipple;
-
-#define TAG(x) clip_##x##_verts
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-
-/* Elts, with the possibility of clipping.
- */
-#undef ELT
-#undef TAG
-#define ELT(x) elt[x]
-#define TAG(x) clip_##x##_elts
-#include "tnl/t_vb_rendertmp.h"
-
-/* TODO: do this for all primitives, verts and elts:
- */
-static void clip_elt_triangles( struct gl_context *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES];
- struct vertex_buffer *VB = &tnl->vb;
- const GLuint * const elt = VB->Elts;
- GLubyte *mask = VB->ClipMask;
- GLuint last = count-2;
- GLuint j;
- (void) flags;
-
- tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES );
-
- for (j=start; j < last; j+=3 ) {
- GLubyte c1 = mask[elt[j]];
- GLubyte c2 = mask[elt[j+1]];
- GLubyte c3 = mask[elt[j+2]];
- GLubyte ormask = c1|c2|c3;
- if (ormask) {
- if (start < j)
- render_tris( ctx, start, j, 0 );
- if (!(c1&c2&c3&0x3f))
- clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
- start = j+3;
- }
- }
-
- if (start < j)
- render_tris( ctx, start, j, 0 );
-}
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, no clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
- LineFunc( ctx, v1, v2 )
-
-#define RENDER_TRI( v1, v2, v3 ) \
- TriangleFunc( ctx, v1, v2, v3 )
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
- QuadFunc( ctx, v1, v2, v3, v4 )
-
-#define TAG(x) _gld_tnl_##x##_verts
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt;
-
-#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx )
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RENDER_TAB_QUALIFIER
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-/* Elts, no clipping.
- */
-#undef ELT
-#define TAG(x) _gld_tnl_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Helper functions for drivers */
-/**********************************************************************/
-/*
-void _tnl_RenderClippedPolygon( struct gl_context *ctx, const GLuint *elts, GLuint n )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint *tmp = VB->Elts;
-
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
-}
-
-void _tnl_RenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-*/
-
-
-/**********************************************************************/
-/* Clip and render whole vertex buffers */
-/**********************************************************************/
-
-tnl_points_func _gldSetupPoints[4] = {
- gld_Points2D_DX9,
- gld_Points2D_DX9,
- gld_Points2D_DX9,
- gld_Points2D_DX9
-};
-tnl_line_func _gldSetupLine[4] = {
- gld_Line2DFlat_DX9,
- gld_Line2DSmooth_DX9,
- gld_Line2DFlat_DX9,
- gld_Line2DSmooth_DX9,
-};
-tnl_triangle_func _gldSetupTriangle[4] = {
- gld_Triangle2DFlat_DX9,
- gld_Triangle2DSmooth_DX9,
- gld_Triangle2DFlatExtras_DX9,
- gld_Triangle2DSmoothExtras_DX9
-};
-tnl_quad_func _gldSetupQuad[4] = {
- gld_Quad2DFlat_DX9,
- gld_Quad2DSmooth_DX9,
- gld_Quad2DFlatExtras_DX9,
- gld_Quad2DSmoothExtras_DX9
-};
-
-//---------------------------------------------------------------------------
-
-static GLboolean _gld_mesa_render_stage_run(
- struct gl_context *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- tnl_render_func *tab;
- GLint pass = 0;
- GLD_pb_dx9 *gldPB;
-
- /* Allow the drivers to lock before projected verts are built so
- * that window coordinates are guarenteed not to change before
- * rendering.
- */
- ASSERT(tnl->Driver.Render.Start);
-
- tnl->Driver.Render.Start( ctx );
-
- // NOTE: Setting D3DRS_SOFTWAREVERTEXPROCESSING for a mixed-mode device resets
- // stream, indices and shader to default values of NULL or 0.
-/* if ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) &&
- gld->VStwosidelight.hShader &&
- !ctx->Fog.Enabled)
- {
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware);
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
- gldPB = &gld->PBtwosidelight;
- tnl->Driver.Render.Points = gld_Points2DTwoside_DX9;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- tnl->Driver.Render.Line = gld_Line2DFlatTwoside_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle2DFlatTwoside_DX9;
- tnl->Driver.Render.Quad = gld_Quad2DFlatTwoside_DX9;
- } else {
- tnl->Driver.Render.Line = gld_Line2DSmoothTwoside_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle2DSmoothTwoside_DX9;
- tnl->Driver.Render.Quad = gld_Quad2DSmoothTwoside_DX9;
- }
- } else {*/
-// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE);
- IDirect3DDevice9_SetSoftwareVertexProcessing(gld->pDev, TRUE);
- gldPB = &gld->PB2d;
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL));
- _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF));
- tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc];
- tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc];
- tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc];
- tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc];
-// }
-
- _GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
- // Allocate primitive pointers
- // gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
-
- if (VB->ClipOrMask) {
- tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts;
- clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
- }
- else {
- tab = (VB->Elts ?
- tnl->Driver.Render.PrimTabElts :
- tnl->Driver.Render.PrimTabVerts);
- }
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length) {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
-
-// tnl->Driver.Render.Finish( ctx );
-
- _GLD_DX9_VB(Unlock(gldPB->pVB));
-
- _GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride));
-
- if (gldPB->nPoints) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-
-
-const struct tnl_pipeline_stage _gld_mesa_render_stage =
-{
- "gld_mesa_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- _gld_mesa_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c
deleted file mode 100644
index 45324128a..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c
+++ /dev/null
@@ -1,1346 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 8.x WGL (WindowsGL)
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "gld_driver.h"
-#include "gld_dxerr9.h"
-#include "gld_dx9.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-// Copied from dglcontect.c
-#define GLDERR_NONE 0
-#define GLDERR_MEM 1
-#define GLDERR_DDRAW 2
-#define GLDERR_D3D 3
-#define GLDERR_BPP 4
-#define GLDERR_DDS 5
-// This external var keeps track of any error
-extern int nContextError;
-
-#define DDLOG_CRITICAL_OR_WARN DDLOG_CRITICAL
-
-extern void _gld_mesa_warning(struct gl_context *, char *);
-extern void _gld_mesa_fatal(struct gl_context *, char *);
-
-//---------------------------------------------------------------------------
-
-static char szColorDepthWarning[] =
-"GLDirect does not support the current desktop\n\
-color depth.\n\n\
-You may need to change the display resolution to\n\
-16 bits per pixel or higher color depth using\n\
-the Windows Display Settings control panel\n\
-before running this OpenGL application.\n";
-
-// The only depth-stencil formats currently supported by Direct3D
-// Surface Format Depth Stencil Total Bits
-// D3DFMT_D32 32 - 32
-// D3DFMT_D15S1 15 1 16
-// D3DFMT_D24S8 24 8 32
-// D3DFMT_D16 16 - 16
-// D3DFMT_D24X8 24 - 32
-// D3DFMT_D24X4S4 24 4 32
-
-// This pixel format will be used as a template when compiling the list
-// of pixel formats supported by the hardware. Many fields will be
-// filled in at runtime.
-// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM
-static DGL_pixelFormat pfTemplateHW =
-{
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
- 1, // Structure version - should be 1
- // Flags:
- PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
- PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
- PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
- PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
- PFD_DOUBLEBUFFER | // The buffer is double-buffered.
- 0, // Placeholder for easy commenting of above flags
- PFD_TYPE_RGBA, // Pixel type RGBA.
- 16, // Total colour bitplanes (excluding alpha bitplanes)
- 5, 0, // Red bits, shift
- 5, 0, // Green bits, shift
- 5, 0, // Blue bits, shift
- 0, 0, // Alpha bits, shift (destination alpha)
- 0, // Accumulator bits (total)
- 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha
- 0, // Depth bits
- 0, // Stencil bits
- 0, // Number of auxiliary buffers
- 0, // Layer type
- 0, // Specifies the number of overlay and underlay planes.
- 0, // Layer mask
- 0, // Specifies the transparent color or index of an underlay plane.
- 0 // Damage mask
- },
- D3DFMT_UNKNOWN, // No depth/stencil buffer
-};
-
-//---------------------------------------------------------------------------
-// Vertex Shaders
-//---------------------------------------------------------------------------
-/*
-// Vertex Shader Declaration
-static DWORD dwTwoSidedLightingDecl[] =
-{
- D3DVSD_STREAM(0),
- D3DVSD_REG(0, D3DVSDT_FLOAT3), // XYZ position
- D3DVSD_REG(1, D3DVSDT_FLOAT3), // XYZ normal
- D3DVSD_REG(2, D3DVSDT_D3DCOLOR), // Diffuse color
- D3DVSD_REG(3, D3DVSDT_D3DCOLOR), // Specular color
- D3DVSD_REG(4, D3DVSDT_FLOAT2), // 2D texture unit 0
- D3DVSD_REG(5, D3DVSDT_FLOAT2), // 2D texture unit 1
- D3DVSD_END()
-};
-
-// Vertex Shader for two-sided lighting
-static char *szTwoSidedLightingVS =
-// This is a test shader!
-"vs.1.0\n"
-"m4x4 oPos,v0,c0\n"
-"mov oD0,v2\n"
-"mov oD1,v3\n"
-"mov oT0,v4\n"
-"mov oT1,v5\n"
-;
-*/
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-typedef struct {
- HINSTANCE hD3D9DLL; // Handle to d3d9.dll
- FNDIRECT3DCREATE9 fnDirect3DCreate9; // Direct3DCreate9 function prototype
- BOOL bDirect3D; // Persistant Direct3D9 exists
- BOOL bDirect3DDevice; // Persistant Direct3DDevice9 exists
- IDirect3D9 *pD3D; // Persistant Direct3D9
- IDirect3DDevice9 *pDev; // Persistant Direct3DDevice9
-} GLD_dx9_globals;
-
-// These are "global" to all DX9 contexts. KeithH
-static GLD_dx9_globals dx9Globals;
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-BOOL gldGetDXErrorString_DX(
- HRESULT hr,
- char *buf,
- int nBufSize)
-{
- //
- // Return a string describing the input HRESULT error code
- //
-
- const char *pStr = DXGetErrorString9(hr);
-
- if (pStr == NULL)
- return FALSE;
-
- if (strlen(pStr) > nBufSize)
- strncpy(buf, pStr, nBufSize);
- else
- strcpy(buf, pStr);
-
-// D3DXGetErrorString(hr, buf, nBufSize);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-static D3DMULTISAMPLE_TYPE _gldGetDeviceMultiSampleType(
- IDirect3D9 *pD3D9,
- D3DFORMAT SurfaceFormat,
- D3DDEVTYPE d3dDevType,
- BOOL Windowed)
-{
- int i;
- HRESULT hr;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_NONE)
- return D3DMULTISAMPLE_NONE;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_FASTEST) {
- // Find fastest multisample
- for (i=2; i<17; i++) {
- hr = IDirect3D9_CheckDeviceMultiSampleType(
- pD3D9,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i,
- NULL);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- } else {
- // Find nicest multisample
- for (i=16; i>1; i--) {
- hr = IDirect3D9_CheckDeviceMultiSampleType(
- pD3D9,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i,
- NULL);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- }
-
- // Nothing found - return default
- return D3DMULTISAMPLE_NONE;
-}
-
-//---------------------------------------------------------------------------
-
-void _gldDestroyPrimitiveBuffer(
- GLD_pb_dx9 *gldVB)
-{
- SAFE_RELEASE(gldVB->pVB);
-
- // Sanity check...
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
-}
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldCreatePrimitiveBuffer(
- struct gl_context *ctx,
- GLD_driver_dx9 *lpCtx,
- GLD_pb_dx9 *gldVB)
-{
- HRESULT hResult;
- char *szCreateVertexBufferFailed = "CreateVertexBuffer failed";
- DWORD dwMaxVertices; // Max number of vertices in vertex buffer
- DWORD dwVBSize; // Total size of vertex buffer
-
- // If CVA (Compiled Vertex Array) is used by an OpenGL app, then we
- // will need enough vertices to cater for Mesa::Const.MaxArrayLockSize.
- // We'll use IMM_SIZE if it's larger (which it should not be).
- dwMaxVertices = MAX_ARRAY_LOCK_SIZE;
-
- // Now calculate how many vertices to allow for in total
- // 1 per point, 2 per line, 6 per quad = 9
- dwVBSize = dwMaxVertices * 9 * gldVB->dwStride;
-
- hResult = IDirect3DDevice9_CreateVertexBuffer(
- lpCtx->pDev,
- dwVBSize,
- gldVB->dwUsage,
- gldVB->dwFVF,
- gldVB->dwPool,
- &gldVB->pVB,
- NULL);
- if (FAILED(hResult)) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, szCreateVertexBufferFailed);
- return hResult;
- }
-
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
- gldVB->pPoints = gldVB->pLines = gldVB->pTriangles = NULL;
- gldVB->iFirstLine = dwMaxVertices; // Index of first line in VB
- gldVB->iFirstTriangle = dwMaxVertices*3; // Index of first triangle in VB
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-// Function: _gldCreateVertexShaders
-// Create DX9 Vertex Shaders.
-//---------------------------------------------------------------------------
-/*
-void _gldCreateVertexShaders(
- GLD_driver_dx9 *gld)
-{
- DWORD dwFlags;
- LPD3DXBUFFER pVSOpcodeBuffer; // Vertex Shader opcode buffer
- HRESULT hr;
-
-#ifdef _DEBUG
- dwFlags = D3DXASM_DEBUG;
-#else
- dwFlags = 0; // D3DXASM_SKIPVALIDATION;
-#endif
-
- ddlogMessage(DDLOG_INFO, "Creating shaders...\n");
-
- // Init the shader handle
- gld->VStwosidelight.hShader = 0;
-
- if (gld->d3dCaps8.MaxStreams == 0) {
- // Lame DX8 driver doesn't support streams
- // Not fatal, as defaults will be used
- ddlogMessage(DDLOG_WARN, "Driver doesn't support Vertex Shaders (MaxStreams==0)\n");
- return;
- }
-
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-// return;
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-
- //
- // Two-sided lighting
- //
-
-#if 0
- //
- // DEBUGGING: Load shader from a text file
- //
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- hr = D3DXAssembleShaderFromFile(
- "twoside.vsh",
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#else
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- // Assemble ascii shader text into shader opcodes
- hr = D3DXAssembleShader(
- szTwoSidedLightingVS,
- strlen(szTwoSidedLightingVS),
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#endif
- if (FAILED(hr)) {
- ddlogError(DDLOG_WARN, "AssembleShader failed", hr);
- SAFE_RELEASE(pVSOpcodeBuffer);
- return;
- }
-
-// This is for debugging. Remove to enable vertex shaders in HW
-#define _GLD_FORCE_SW_VS 0
-
- if (_GLD_FORCE_SW_VS) {
- // _GLD_FORCE_SW_VS should be disabled for Final Release
- ddlogMessage(DDLOG_SYSTEM, "[Forcing shaders in SW]\n");
- }
-
- // Try and create shader in hardware.
- // NOTE: The D3D Ref device appears to succeed when trying to
- // create the device in hardware, but later complains
- // when trying to set it with SetVertexShader(). Go figure.
- if (_GLD_FORCE_SW_VS || glb.dwDriver == GLDS_DRIVER_REF) {
- // Don't try and create a hardware shader with the Ref device
- hr = E_FAIL; // COM error/fail result
- } else {
- gld->VStwosidelight.bHardware = TRUE;
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- 0);
- }
- if (FAILED(hr)) {
- ddlogMessage(DDLOG_INFO, "... HW failed, trying SW...\n");
- // Failed. Try and create shader for software processing
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- D3DUSAGE_SOFTWAREPROCESSING);
- if (FAILED(hr)) {
- gld->VStwosidelight.hShader = 0; // Sanity check
- ddlogError(DDLOG_WARN, "CreateVertexShader failed", hr);
- return;
- }
- // Succeeded, but for software processing
- gld->VStwosidelight.bHardware = FALSE;
- }
-
- SAFE_RELEASE(pVSOpcodeBuffer);
-
- ddlogMessage(DDLOG_INFO, "... OK\n");
-}
-
-//---------------------------------------------------------------------------
-
-void _gldDestroyVertexShaders(
- GLD_driver_dx9 *gld)
-{
- if (gld->VStwosidelight.hShader) {
- IDirect3DDevice8_DeleteVertexShader(gld->pDev, gld->VStwosidelight.hShader);
- gld->VStwosidelight.hShader = 0;
- }
-}
-*/
-//---------------------------------------------------------------------------
-
-BOOL gldCreateDrawable_DX(
- DGL_ctx *ctx,
-// BOOL bDefaultDriver,
- BOOL bDirectDrawPersistant,
- BOOL bPersistantBuffers)
-{
- //
- // bDirectDrawPersistant: applies to IDirect3D9
- // bPersistantBuffers: applies to IDirect3DDevice9
- //
-
- HRESULT hResult;
- GLD_driver_dx9 *lpCtx = NULL;
- D3DDEVTYPE d3dDevType;
- D3DPRESENT_PARAMETERS d3dpp;
- D3DDISPLAYMODE d3ddm;
- DWORD dwBehaviourFlags;
- D3DADAPTER_IDENTIFIER9 d3dIdent;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- if (ctx->glPriv) {
- lpCtx = ctx->glPriv;
- // Release any existing interfaces
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- } else {
- lpCtx = (GLD_driver_dx9*)malloc(sizeof(GLD_driver_dx9));
- ZeroMemory(lpCtx, sizeof(lpCtx));
- }
-
- d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- // TODO: Check this
-// if (bDefaultDriver)
-// d3dDevType = D3DDEVTYPE_REF;
-
- // Use persistant interface if needed
- if (bDirectDrawPersistant && dx9Globals.bDirect3D) {
- lpCtx->pD3D = dx9Globals.pD3D;
- IDirect3D9_AddRef(lpCtx->pD3D);
- goto SkipDirectDrawCreate;
- }
-
- // Create Direct3D9 object
- lpCtx->pD3D = dx9Globals.fnDirect3DCreate9(D3D_SDK_VERSION);
- if (lpCtx->pD3D == NULL) {
- MessageBox(NULL, "Unable to initialize Direct3D9", "GLDirect", MB_OK);
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D9 interface");
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Cache Direct3D interface for subsequent GLRCs
- if (bDirectDrawPersistant && !dx9Globals.bDirect3D) {
- dx9Globals.pD3D = lpCtx->pD3D;
- IDirect3D9_AddRef(dx9Globals.pD3D);
- dx9Globals.bDirect3D = TRUE;
- }
-SkipDirectDrawCreate:
-
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D9_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Get device caps
- hResult = IDirect3D9_GetDeviceCaps(lpCtx->pD3D, glb.dwAdapter, d3dDevType, &lpCtx->d3dCaps9);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D9_GetDeviceCaps failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Check for hardware transform & lighting
- lpCtx->bHasHWTnL = lpCtx->d3dCaps9.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE;
-
-/*
- //
- // GONE FOR DX9?
- //
- // If this flag is present then we can't default to Mesa
- // SW rendering between BeginScene() and EndScene().
- if (lpCtx->d3dCaps9.Caps2 & D3DCAPS2_NO2DDURING3DSCENE) {
- ddlogMessage(DDLOG_WARN,
- "Warning : No 2D allowed during 3D scene.\n");
- }
-*/
-
- //
- // Create the Direct3D context
- //
-
- // Re-use original IDirect3DDevice if persistant buffers exist.
- // Note that we test for persistant IDirect3D9 as well
- // bDirectDrawPersistant == persistant IDirect3D9 (DirectDraw9 does not exist)
- if (bDirectDrawPersistant && bPersistantBuffers && dx9Globals.pD3D && dx9Globals.pDev) {
- lpCtx->pDev = dx9Globals.pDev;
- IDirect3DDevice9_AddRef(dx9Globals.pDev);
- goto skip_direct3ddevice_create;
- }
-
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 2; //1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(lpCtx->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
-
- // Support for vertical retrace synchronisation.
- // Set default presentation interval in case caps bits are missing
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- if (glb.bWaitForRetrace) {
- if (lpCtx->d3dCaps9.PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
- } else {
- if (lpCtx->d3dCaps9.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- }
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- // PresentationInterval Windowed mode is optional now in DX9 (DaveM)
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- if (glb.bWaitForRetrace) {
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
- } else {
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- }
- }
-
- // Decide if we can use hardware TnL
- dwBehaviourFlags = (lpCtx->bHasHWTnL) ?
- D3DCREATE_MIXED_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING;
- // Add flag to tell D3D to be thread-safe
- if (glb.bMultiThreaded)
- dwBehaviourFlags |= D3DCREATE_MULTITHREADED;
- // Add flag to tell D3D to be FPU-safe
- if (!glb.bFastFPU)
- dwBehaviourFlags |= D3DCREATE_FPU_PRESERVE;
- hResult = IDirect3D9_CreateDevice(lpCtx->pD3D,
- glb.dwAdapter,
- d3dDevType,
- ctx->hWnd,
- dwBehaviourFlags,
- &d3dpp,
- &lpCtx->pDev);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D9_CreateDevice failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- if (bDirectDrawPersistant && bPersistantBuffers && dx9Globals.pD3D) {
- dx9Globals.pDev = lpCtx->pDev;
- dx9Globals.bDirect3DDevice = TRUE;
- }
-
- // Dump some useful stats
- hResult = IDirect3D9_GetAdapterIdentifier(
- lpCtx->pD3D,
- glb.dwAdapter,
- 0, // No WHQL detection (avoid few seconds delay)
- &d3dIdent);
- if (SUCCEEDED(hResult)) {
- ddlogPrintf(DDLOG_INFO, "[Driver Description: %s]", &d3dIdent.Description);
- ddlogPrintf(DDLOG_INFO, "[Driver file: %s %d.%d.%02d.%d]",
- d3dIdent.Driver,
- HIWORD(d3dIdent.DriverVersion.HighPart),
- LOWORD(d3dIdent.DriverVersion.HighPart),
- HIWORD(d3dIdent.DriverVersion.LowPart),
- LOWORD(d3dIdent.DriverVersion.LowPart));
- ddlogPrintf(DDLOG_INFO, "[VendorId: 0x%X, DeviceId: 0x%X, SubSysId: 0x%X, Revision: 0x%X]",
- d3dIdent.VendorId, d3dIdent.DeviceId, d3dIdent.SubSysId, d3dIdent.Revision);
- }
-
- // Test to see if IHV driver exposes Scissor Test (new for DX9)
- lpCtx->bCanScissor = lpCtx->d3dCaps9.RasterCaps & D3DPRASTERCAPS_SCISSORTEST;
- ddlogPrintf(DDLOG_INFO, "Can Scissor: %s", lpCtx->bCanScissor ? "Yes" : "No");
-
- // Init projection matrix for D3D TnL
- D3DXMatrixIdentity(&lpCtx->matProjection);
- lpCtx->matModelView = lpCtx->matProjection;
-// gld->bUseMesaProjection = TRUE;
-
-skip_direct3ddevice_create:
-
- // Create buffers to hold primitives
- lpCtx->PB2d.dwFVF = GLD_FVF_2D_VERTEX;
- lpCtx->PB2d.dwPool = D3DPOOL_SYSTEMMEM;
- lpCtx->PB2d.dwStride = sizeof(GLD_2D_VERTEX);
- lpCtx->PB2d.dwUsage = D3DUSAGE_DONOTCLIP |
- D3DUSAGE_DYNAMIC |
- D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB2d);
- if (FAILED(hResult))
- goto return_with_error;
-
- lpCtx->PB3d.dwFVF = GLD_FVF_3D_VERTEX;
- lpCtx->PB3d.dwPool = D3DPOOL_DEFAULT;
- lpCtx->PB3d.dwStride = sizeof(GLD_3D_VERTEX);
- lpCtx->PB3d.dwUsage = D3DUSAGE_DYNAMIC |
-//DaveM D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB3d);
- if (FAILED(hResult))
- goto return_with_error;
-
-/* // NOTE: A FVF code of zero indicates a non-FVF vertex buffer (for vertex shaders)
- lpCtx->PBtwosidelight.dwFVF = 0; //GLD_FVF_TWOSIDED_VERTEX;
- lpCtx->PBtwosidelight.dwPool = D3DPOOL_DEFAULT;
- lpCtx->PBtwosidelight.dwStride = sizeof(GLD_TWOSIDED_VERTEX);
- lpCtx->PBtwosidelight.dwUsage = D3DUSAGE_DONOTCLIP |
- D3DUSAGE_DYNAMIC |
- D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PBtwosidelight);
- if (FAILED(hResult))
- goto return_with_error;*/
-
- // Now try and create the DX9 Vertex Shaders
-// _gldCreateVertexShaders(lpCtx);
-
- // Zero the pipeline usage counters
- lpCtx->PipelineUsage.qwMesa.QuadPart =
-// lpCtx->PipelineUsage.dwD3D2SVS.QuadPart =
- lpCtx->PipelineUsage.qwD3DFVF.QuadPart = 0;
-
- // Assign drawable to GL private
- ctx->glPriv = lpCtx;
- return TRUE;
-
-return_with_error:
- // Clean up and bail
-
-// _gldDestroyVertexShaders(lpCtx);
-
-// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldResizeDrawable_DX(
- DGL_ctx *ctx,
- BOOL bDefaultDriver,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- GLD_driver_dx9 *gld = NULL;
- D3DDEVTYPE d3dDevType;
- D3DPRESENT_PARAMETERS d3dpp;
- D3DDISPLAYMODE d3ddm;
- HRESULT hResult;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (ctx->bSceneStarted) {
- IDirect3DDevice9_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-
- d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- if (!bDefaultDriver)
- d3dDevType = D3DDEVTYPE_REF; // Force Direct3D Reference Rasterise (software)
-
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D9_GetAdapterDisplayMode(gld->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
-// goto return_with_error;
- return FALSE;
- }
-
- // Destroy DX9 Vertex Shaders before Reset()
-// _gldDestroyVertexShaders(gld);
-
- // Release POOL_DEFAULT objects before Reset()
- if (gld->PB2d.dwPool == D3DPOOL_DEFAULT)
- _gldDestroyPrimitiveBuffer(&gld->PB2d);
- if (gld->PB3d.dwPool == D3DPOOL_DEFAULT)
- _gldDestroyPrimitiveBuffer(&gld->PB3d);
-// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT)
-// _gldDestroyPrimitiveBuffer(&gld->PBtwosidelight);
-
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(gld->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- // TODO: Sync to refresh
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- // Get better benchmark results? KeithH
-// d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_UNLIMITED;
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- }
- hResult = IDirect3DDevice9_Reset(gld->pDev, &d3dpp);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Reset failed", hResult);
- return FALSE;
- //goto cleanup_and_return_with_error;
- }
-
- //
- // Recreate POOL_DEFAULT objects
- //
- if (gld->PB2d.dwPool == D3DPOOL_DEFAULT) {
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d);
- }
- if (gld->PB3d.dwPool == D3DPOOL_DEFAULT) {
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB3d);
- }
-// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT) {
-// _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d);
-// }
-
- // Recreate DX9 Vertex Shaders
-// _gldCreateVertexShaders(gld);
-
- // Signal a complete state update
- ctx->glCtx->Driver.UpdateState(ctx->glCtx, _NEW_ALL);
-
- // Begin a new scene
- IDirect3DDevice9_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyDrawable_DX(
- DGL_ctx *ctx)
-{
- GLD_driver_dx9 *lpCtx = NULL;
-
- // Error if context is NULL.
- if (!ctx)
- return FALSE;
-
- // Error if the drawable does not exist.
- if (!ctx->glPriv)
- return FALSE;
-
- lpCtx = ctx->glPriv;
-
-#ifdef _DEBUG
- // Dump out stats
- ddlogPrintf(DDLOG_SYSTEM, "Usage: M:0x%X%X, D:0x%X%X",
- lpCtx->PipelineUsage.qwMesa.HighPart,
- lpCtx->PipelineUsage.qwMesa.LowPart,
- lpCtx->PipelineUsage.qwD3DFVF.HighPart,
- lpCtx->PipelineUsage.qwD3DFVF.LowPart);
-#endif
-
-// _gldDestroyVertexShaders(lpCtx);
-
-// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
-
- // Free the private drawable data
- free(ctx->glPriv);
- ctx->glPriv = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldCreatePrivateGlobals_DX(void)
-{
- ZeroMemory(&dx9Globals, sizeof(dx9Globals));
-
- // Load d3d9.dll
- dx9Globals.hD3D9DLL = LoadLibrary("D3D9.DLL");
- if (dx9Globals.hD3D9DLL == NULL)
- return FALSE;
-
- // Now try and obtain Direct3DCreate9
- dx9Globals.fnDirect3DCreate9 = (FNDIRECT3DCREATE9)GetProcAddress(dx9Globals.hD3D9DLL, "Direct3DCreate9");
- if (dx9Globals.fnDirect3DCreate9 == NULL) {
- FreeLibrary(dx9Globals.hD3D9DLL);
- return FALSE;
- }
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyPrivateGlobals_DX(void)
-{
- if (dx9Globals.bDirect3DDevice) {
- SAFE_RELEASE(dx9Globals.pDev);
- dx9Globals.bDirect3DDevice = FALSE;
- }
- if (dx9Globals.bDirect3D) {
- SAFE_RELEASE(dx9Globals.pD3D);
- dx9Globals.bDirect3D = FALSE;
- }
-
- FreeLibrary(dx9Globals.hD3D9DLL);
- dx9Globals.hD3D9DLL = NULL;
- dx9Globals.fnDirect3DCreate9 = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDisplayFormat(
- D3DFORMAT fmt,
- BYTE *cColorBits,
- BYTE *cRedBits,
- BYTE *cGreenBits,
- BYTE *cBlueBits,
- BYTE *cAlphaBits)
-{
- switch (fmt) {
- case D3DFMT_X1R5G5B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 5;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DFMT_R5G6B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 6;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DFMT_X8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
- return;
- case D3DFMT_A8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 8;
- return;
- }
-
- // Should not get here!
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDepthStencilFormat(
- D3DFORMAT fmt,
- BYTE *cDepthBits,
- BYTE *cStencilBits)
-{
- // NOTE: GL expects either 32 or 16 as depth bits.
- switch (fmt) {
- case D3DFMT_D32:
- *cDepthBits = 32;
- *cStencilBits = 0;
- return;
- case D3DFMT_D15S1:
- *cDepthBits = 16;
- *cStencilBits = 1;
- return;
- case D3DFMT_D24S8:
- *cDepthBits = 32;
- *cStencilBits = 8;
- return;
- case D3DFMT_D16:
- *cDepthBits = 16;
- *cStencilBits = 0;
- return;
- case D3DFMT_D24X8:
- *cDepthBits = 32;
- *cStencilBits = 0;
- return;
- case D3DFMT_D24X4S4:
- *cDepthBits = 32;
- *cStencilBits = 4;
- return;
- }
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldBuildPixelformatList_DX(void)
-{
- D3DDISPLAYMODE d3ddm;
- D3DFORMAT fmt[6];
- IDirect3D9 *pD3D = NULL;
- HRESULT hr;
- int nSupportedFormats = 0;
- int i;
- DGL_pixelFormat *pPF;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-// char buf[128];
-// char cat[8];
-
- // Direct3D (SW or HW)
- // These are arranged so that 'best' pixelformat
- // is higher in the list (for ChoosePixelFormat).
- const D3DFORMAT DepthStencil[6] = {
-// New order: increaing Z, then increasing stencil
- D3DFMT_D15S1,
- D3DFMT_D16,
- D3DFMT_D24X4S4,
- D3DFMT_D24X8,
- D3DFMT_D24S8,
- D3DFMT_D32,
- };
-
- // Dump DX version
- ddlogMessage(GLDLOG_SYSTEM, "DirectX Version : 9.0\n");
-
- // Release any existing pixelformat list
- if (glb.lpPF) {
- free(glb.lpPF);
- }
-
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL;
-
- //
- // Pixelformats for Direct3D (SW or HW) rendering
- //
-
- // Get a Direct3D 9.0 interface
- pD3D = dx9Globals.fnDirect3DCreate9(D3D_SDK_VERSION);
- if (!pD3D) {
- return FALSE;
- }
-
- // We will use the display mode format when finding compliant
- // rendertarget/depth-stencil surfaces.
- hr = IDirect3D9_GetAdapterDisplayMode(pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hr)) {
- IDirect3D9_Release(pD3D);
- return FALSE;
- }
-
- // Run through the possible formats and detect supported formats
- for (i=0; i<6; i++) {
- hr = IDirect3D9_CheckDeviceFormat(
- pD3D,
- glb.dwAdapter,
- glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF,
- d3ddm.Format,
- D3DUSAGE_DEPTHSTENCIL,
- D3DRTYPE_SURFACE,
- DepthStencil[i]);
- if (FAILED(hr))
- // A failure here is not fatal.
- continue;
-
- // Verify that the depth format is compatible.
- hr = IDirect3D9_CheckDepthStencilMatch(
- pD3D,
- glb.dwAdapter,
- glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF,
- d3ddm.Format,
- d3ddm.Format,
- DepthStencil[i]);
- if (FAILED(hr))
- // A failure here is not fatal, just means depth-stencil
- // format is not compatible with this display mode.
- continue;
-
- fmt[nSupportedFormats++] = DepthStencil[i];
- }
-
- IDirect3D9_Release(pD3D);
-
- if (nSupportedFormats == 0)
- return FALSE; // Bail: no compliant pixelformats
-
- // Total count of pixelformats is:
- // (nSupportedFormats+1)*2
- // UPDATED: nSupportedFormats*2
- glb.lpPF = (DGL_pixelFormat *)calloc(nSupportedFormats*2, sizeof(DGL_pixelFormat));
- glb.nPixelFormatCount = nSupportedFormats*2;
- if (glb.lpPF == NULL) {
- glb.nPixelFormatCount = 0;
- return FALSE;
- }
-
- // Get a copy of pointer that we can alter
- pPF = glb.lpPF;
-
- // Cache colour bits from display format
- _BitsFromDisplayFormat(d3ddm.Format, &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
-
- //
- // Add single-buffer formats
- //
-/*
- // NOTE: No longer returning pixelformats that don't contain depth
- // Single-buffer, no depth-stencil buffer
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DFMT_UNKNOWN;
- pPF++;
-*/
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- //
- // Add double-buffer formats
- //
-
- // NOTE: No longer returning pixelformats that don't contain depth
-/*
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DFMT_UNKNOWN;
- pPF++;
-*/
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- // Popup warning message if non RGB color mode
- {
- // This is a hack. KeithH
- HDC hdcDesktop = GetDC(NULL);
- DWORD dwDisplayBitDepth = GetDeviceCaps(hdcDesktop, BITSPIXEL);
- ReleaseDC(0, hdcDesktop);
- if (dwDisplayBitDepth <= 8) {
- ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth);
- MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING);
- }
- }
-
- // Mark list as 'current'
- glb.bPixelformatsDirty = FALSE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldInitialiseMesa_DX(
- DGL_ctx *lpCtx)
-{
- GLD_driver_dx9 *gld = NULL;
- int MaxTextureSize, TextureLevels;
- BOOL bSoftwareTnL;
-
- if (lpCtx == NULL)
- return FALSE;
-
- gld = lpCtx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (glb.bMultitexture) {
- lpCtx->glCtx->Const.MaxTextureUnits = gld->d3dCaps9.MaxSimultaneousTextures;
- // Only support MAX_TEXTURE_UNITS texture units.
- // ** If this is altered then the FVF formats must be reviewed **.
- if (lpCtx->glCtx->Const.MaxTextureUnits > GLD_MAX_TEXTURE_UNITS_DX9)
- lpCtx->glCtx->Const.MaxTextureUnits = GLD_MAX_TEXTURE_UNITS_DX9;
- } else {
- // Multitexture override
- lpCtx->glCtx->Const.MaxTextureUnits = 1;
- }
-
- // max texture size
- MaxTextureSize = min(gld->d3dCaps9.MaxTextureHeight, gld->d3dCaps9.MaxTextureWidth);
- if (MaxTextureSize == 0)
- MaxTextureSize = 256; // Sanity check
-
- //
- // HACK!!
- if (MaxTextureSize > 1024)
- MaxTextureSize = 1024; // HACK - CLAMP TO 1024
- // HACK!!
- //
-
- // Got to set MAX_TEXTURE_SIZE as max levels.
- // Who thought this stupid idea up? ;)
- TextureLevels = 0;
- // Calculate power-of-two.
- while (MaxTextureSize) {
- TextureLevels++;
- MaxTextureSize >>= 1;
- }
- lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8;
- lpCtx->glCtx->Const.MaxDrawBuffers = 1;
-
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_DITHERENABLE, TRUE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_SHADEMODE, D3DSHADE_GOURAUD);
-
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ZENABLE,
- (lpCtx->lpPF->dwDriverData!=D3DFMT_UNKNOWN) ? D3DZB_TRUE : D3DZB_FALSE);
-
- // Set the view matrix
- {
- D3DXMATRIX vm;
-#if 1
- D3DXMatrixIdentity(&vm);
-#else
- D3DXVECTOR3 Eye(0.0f, 0.0f, 0.0f);
- D3DXVECTOR3 At(0.0f, 0.0f, -1.0f);
- D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f);
- D3DXMatrixLookAtRH(&vm, &Eye, &At, &Up);
- vm._31 = -vm._31;
- vm._32 = -vm._32;
- vm._33 = -vm._33;
- vm._34 = -vm._34;
-#endif
- IDirect3DDevice9_SetTransform(gld->pDev, D3DTS_VIEW, &vm);
- }
-
- if (gld->bHasHWTnL) {
- if (glb.dwTnL == GLDS_TNL_DEFAULT)
- bSoftwareTnL = FALSE; // HW TnL
- else {
- bSoftwareTnL = ((glb.dwTnL == GLDS_TNL_MESA) || (glb.dwTnL == GLDS_TNL_D3DSW)) ? TRUE : FALSE;
- }
- } else {
- // No HW TnL, so no choice possible
- bSoftwareTnL = TRUE;
- }
-// IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, bSoftwareTnL);
- IDirect3DDevice9_SetSoftwareVertexProcessing(gld->pDev, bSoftwareTnL);
-
-// Dump this in a Release build as well, now.
-//#ifdef _DEBUG
- ddlogPrintf(DDLOG_INFO, "HW TnL: %s",
- gld->bHasHWTnL ? (bSoftwareTnL ? "Disabled" : "Enabled") : "Unavailable");
-//#endif
-
- gldEnableExtensions_DX9(lpCtx->glCtx);
- gldInstallPipeline_DX9(lpCtx->glCtx);
- gldSetupDriverPointers_DX9(lpCtx->glCtx);
-
- // Signal a complete state update
- lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL);
-
- // Start a scene
- IDirect3DDevice9_BeginScene(gld->pDev);
- lpCtx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldSwapBuffers_DX(
- DGL_ctx *ctx,
- HDC hDC,
- HWND hWnd)
-{
- HRESULT hr;
- GLD_driver_dx9 *gld = NULL;
-
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (ctx->bSceneStarted) {
- IDirect3DDevice9_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-
- // Swap the buffers. hWnd may override the hWnd used for CreateDevice()
- hr = IDirect3DDevice9_Present(gld->pDev, NULL, NULL, hWnd, NULL);
-
-exit_swap:
-
- IDirect3DDevice9_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
-// Debugging code
-#ifdef _DEBUG
-// ddlogMessage(GLDLOG_WARN, "SwapBuffers\n");
-#endif
-
- return (FAILED(hr)) ? FALSE : TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldGetDisplayMode_DX(
- DGL_ctx *ctx,
- GLD_displayMode *glddm)
-{
- D3DDISPLAYMODE d3ddm;
- HRESULT hr;
- GLD_driver_dx9 *lpCtx = NULL;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-
- if ((glddm == NULL) || (ctx == NULL))
- return FALSE;
-
- lpCtx = ctx->glPriv;
- if (lpCtx == NULL)
- return FALSE;
-
- if (lpCtx->pD3D == NULL)
- return FALSE;
-
- hr = IDirect3D9_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hr))
- return FALSE;
-
- // Get info from the display format
- _BitsFromDisplayFormat(d3ddm.Format,
- &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
-
- glddm->Width = d3ddm.Width;
- glddm->Height = d3ddm.Height;
- glddm->BPP = cColorBits;
- glddm->Refresh = d3ddm.RefreshRate;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_clip.c b/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_clip.c
deleted file mode 100644
index 044d2e66f..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_clip.c
+++ /dev/null
@@ -1,39 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 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.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#ifdef DEBUG /* This code only used for debugging */
-
-// Stub to enable Mesa to build. KeithH
-#pragma message("NOTE: Using gld_debug_clip.c HACK")
-
-void _math_test_all_cliptest_functions( char *description )
-{
-}
-
-
-#endif /* DEBUG */
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_norm.c b/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_norm.c
deleted file mode 100644
index c20362bb2..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_norm.c
+++ /dev/null
@@ -1,39 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 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.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#ifdef DEBUG /* This code only used for debugging */
-
-// Stub to enable Mesa to build. KeithH
-#pragma message("NOTE: Using gld_debug_norm.c HACK")
-
-void _math_test_all_normal_transform_functions( char *description )
-{
-}
-
-
-#endif /* DEBUG */
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_xform.c b/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_xform.c
deleted file mode 100644
index 73439dc3b..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gld_debug_xform.c
+++ /dev/null
@@ -1,41 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 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.
- */
-
-/*
- * Updated for P6 architecture by Gareth Hughes.
- */
-
-
-#ifdef DEBUG /* This code only used for debugging */
-
-// Stub to enable Mesa to build. KeithH
-#pragma message("NOTE: Using gld_debug_xform.c HACK")
-
-void _math_test_all_transform_functions( char *description )
-{
-}
-
-
-#endif /* DEBUG */
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gld_dispatch.c b/mesalib/src/mesa/drivers/windows/gldirect/gld_dispatch.c
deleted file mode 100644
index e05d767e3..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gld_dispatch.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Thread-aware dispatch table.
-*
-****************************************************************************/
-
-#include "glheader.h"
-#include "glapi.h"
-#include "glapitable.h"
-#include "mtypes.h"
-#include "context.h"
-
-#define KEYWORD1
-#define KEYWORD2 GLAPIENTRY
-#if defined(USE_MGL_NAMESPACE)
- #define NAME(func) mgl##func
-#else
- #define NAME(func) gl##func
-#endif
-
-#if 0
-// Altered these to get the dispatch table from
-// the current context of the calling thread.
-#define DISPATCH(FUNC, ARGS, MESSAGE) \
- GET_CURRENT_CONTEXT(gc); \
- (gc->CurrentDispatch->FUNC) ARGS
-#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
- GET_CURRENT_CONTEXT(gc); \
- return (gc->CurrentDispatch->FUNC) ARGS
-#else // #if 0
-#define DISPATCH(FUNC, ARGS, MESSAGE) \
- GET_CURRENT_CONTEXT(gc); \
- (_glapi_Dispatch->FUNC) ARGS
-#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
- GET_CURRENT_CONTEXT(gc); \
- return (_glapi_Dispatch->FUNC) ARGS
-#endif // #if 0
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#include "glapitemp.h"
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gld_driver.c b/mesalib/src/mesa/drivers/windows/gldirect/gld_driver.c
deleted file mode 100644
index 226dc5a5a..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gld_driver.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Driver functions and interfaces
-*
-****************************************************************************/
-
-#define STRICT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "gld_driver.h"
-#include "ddlog.h"
-#include "glheader.h"
-
-// For glGetString().
-#include "common_x86_asm.h"
-
-//---------------------------------------------------------------------------
-
-static char *szDriverError = "Driver used before initialisation!";
-
-// This holds our dynamically created OpenGL renderer string.
-// 256 chars should be plenty - remember that some apps display this.
-static char _gldRendererString[256];
-
-static char *szVendor = "SciTech Software, Inc.";
-
-//---------------------------------------------------------------------------
-
-extern BOOL gldGetDXErrorString_DX(HRESULT hr, char *buf, int nBufSize);
-
-extern BOOL gldCreateDrawable_MesaSW(DGL_ctx *ctx, BOOL bPersistantInterface, BOOL bPersistantBuffers);
-extern BOOL gldResizeDrawable_MesaSW(DGL_ctx *ctx, BOOL bDefaultDriver, BOOL bPersistantInterface, BOOL bPersistantBuffers);
-extern BOOL gldDestroyDrawable_MesaSW(DGL_ctx *ctx);
-extern BOOL gldCreatePrivateGlobals_MesaSW(void);
-extern BOOL gldDestroyPrivateGlobals_MesaSW(void);
-extern BOOL gldBuildPixelformatList_MesaSW(void);
-extern BOOL gldInitialiseMesa_MesaSW(DGL_ctx *ctx);
-extern BOOL gldSwapBuffers_MesaSW(DGL_ctx *ctx, HDC hDC, HWND hWnd);
-extern PROC gldGetProcAddress_MesaSW(LPCSTR a);
-extern BOOL gldGetDisplayMode_MesaSW(DGL_ctx *ctx, GLD_displayMode *glddm);
-
-extern BOOL gldCreateDrawable_DX(DGL_ctx *ctx, BOOL bPersistantInterface, BOOL bPersistantBuffers);
-extern BOOL gldResizeDrawable_DX(DGL_ctx *ctx, BOOL bDefaultDriver, BOOL bPersistantInterface, BOOL bPersistantBuffers);
-extern BOOL gldDestroyDrawable_DX(DGL_ctx *ctx);
-extern BOOL gldCreatePrivateGlobals_DX(void);
-extern BOOL gldDestroyPrivateGlobals_DX(void);
-extern BOOL gldBuildPixelformatList_DX(void);
-extern BOOL gldInitialiseMesa_DX(DGL_ctx *ctx);
-extern BOOL gldSwapBuffers_DX(DGL_ctx *ctx, HDC hDC, HWND hWnd);
-extern PROC gldGetProcAddress_DX(LPCSTR a);
-extern BOOL gldGetDisplayMode_DX(DGL_ctx *ctx, GLD_displayMode *glddm);
-
-//---------------------------------------------------------------------------
-// NOP functions. Called if proper driver functions are not set.
-//---------------------------------------------------------------------------
-
-static BOOL _gldDriverError(void)
-{
- ddlogMessage(DDLOG_CRITICAL, szDriverError);
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _GetDXErrorString_ERROR(
- HRESULT hr,
- char *buf,
- int nBufSize)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _CreateDrawable_ERROR(
- DGL_ctx *ctx,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _ResizeDrawable_ERROR(
- DGL_ctx *ctx,
- BOOL bDefaultDriver,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _DestroyDrawable_ERROR(
- DGL_ctx *ctx)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _CreatePrivateGlobals_ERROR(void)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _DestroyPrivateGlobals_ERROR(void)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _BuildPixelformatList_ERROR(void)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-
-static BOOL _InitialiseMesa_ERROR(
- DGL_ctx *ctx)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _SwapBuffers_ERROR(
- DGL_ctx *ctx,
- HDC hDC,
- HWND hWnd)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-
-static PROC _GetProcAddress_ERROR(
- LPCSTR a)
-{
- _gldDriverError();
- return NULL;
-}
-
-//---------------------------------------------------------------------------
-
-static BOOL _GetDisplayMode_ERROR(
- DGL_ctx *ctx,
- GLD_displayMode *glddm)
-{
- return _gldDriverError();
-}
-
-//---------------------------------------------------------------------------
-// Functions useful to all drivers
-//---------------------------------------------------------------------------
-
-const GLubyte* _gldGetStringGeneric(
- struct gl_context *ctx,
- GLenum name)
-{
- if (!ctx)
- return NULL;
-
- switch (name) {
- case GL_RENDERER:
- sprintf(_gldRendererString, "GLDirect 4.0 %s%s%s%s (%s %s)",
- _mesa_x86_cpu_features ? "/x86" : "",
- cpu_has_mmx ? "/MMX" : "",
- cpu_has_3dnow ? "/3DNow!" : "",
- cpu_has_xmm ? "/SSE" : "",
- __DATE__, __TIME__);
- return (const GLubyte *) _gldRendererString;
- case GL_VENDOR:
- return (const GLubyte *) szVendor;
- default:
- return NULL;
- }
-}
-
-//---------------------------------------------------------------------------
-// Global driver function pointers, initially set to functions that
-// will report an error when called.
-//---------------------------------------------------------------------------
-
-GLD_driver _gldDriver = {
- _GetDXErrorString_ERROR,
- _CreateDrawable_ERROR,
- _ResizeDrawable_ERROR,
- _DestroyDrawable_ERROR,
- _CreatePrivateGlobals_ERROR,
- _DestroyPrivateGlobals_ERROR,
- _BuildPixelformatList_ERROR,
- _InitialiseMesa_ERROR,
- _SwapBuffers_ERROR,
- _GetProcAddress_ERROR,
- _GetDisplayMode_ERROR
-};
-
-//---------------------------------------------------------------------------
-// Init function. Should be called as soon as regkeys/ini-settings are read.
-//---------------------------------------------------------------------------
-
-BOOL gldInitDriverPointers(
- DWORD dwDriver)
-{
- _gldDriver.GetDXErrorString = gldGetDXErrorString_DX;
-
- if (dwDriver == GLDS_DRIVER_MESA_SW) {
- // Mesa Software driver
- _gldDriver.CreateDrawable = gldCreateDrawable_MesaSW;
- _gldDriver.ResizeDrawable = gldResizeDrawable_MesaSW;
- _gldDriver.DestroyDrawable = gldDestroyDrawable_MesaSW;
- _gldDriver.CreatePrivateGlobals = gldCreatePrivateGlobals_MesaSW;
- _gldDriver.DestroyPrivateGlobals = gldDestroyPrivateGlobals_MesaSW;
- _gldDriver.BuildPixelformatList = gldBuildPixelformatList_MesaSW;
- _gldDriver.InitialiseMesa = gldInitialiseMesa_MesaSW;
- _gldDriver.SwapBuffers = gldSwapBuffers_MesaSW;
- _gldDriver.wglGetProcAddress = gldGetProcAddress_MesaSW;
- _gldDriver.GetDisplayMode = gldGetDisplayMode_MesaSW;
- return TRUE;
- }
-
- if ((dwDriver == GLDS_DRIVER_REF) || (dwDriver == GLDS_DRIVER_HAL)) {
- // Direct3D driver, either HW or SW
- _gldDriver.CreateDrawable = gldCreateDrawable_DX;
- _gldDriver.ResizeDrawable = gldResizeDrawable_DX;
- _gldDriver.DestroyDrawable = gldDestroyDrawable_DX;
- _gldDriver.CreatePrivateGlobals = gldCreatePrivateGlobals_DX;
- _gldDriver.DestroyPrivateGlobals = gldDestroyPrivateGlobals_DX;
- _gldDriver.BuildPixelformatList = gldBuildPixelformatList_DX;
- _gldDriver.InitialiseMesa = gldInitialiseMesa_DX;
- _gldDriver.SwapBuffers = gldSwapBuffers_DX;
- _gldDriver.wglGetProcAddress = gldGetProcAddress_DX;
- _gldDriver.GetDisplayMode = gldGetDisplayMode_DX;
- return TRUE;
- };
-
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gld_driver.h b/mesalib/src/mesa/drivers/windows/gldirect/gld_driver.h
deleted file mode 100644
index 6067245b8..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gld_driver.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Driver functions and interfaces
-*
-****************************************************************************/
-
-#ifndef _GLD_DRIVER_H
-#define _GLD_DRIVER_H
-
-// This file is only useful is we're using the new GLD3 WGL code.
-#ifdef _USE_GLD3_WGL
-
-#include "dglcontext.h"
-
-// Same as DX8 D3DDISPLAYMODE
-typedef struct {
- DWORD Width;
- DWORD Height;
- DWORD Refresh;
- DWORD BPP;
-} GLD_displayMode;
-
-typedef struct {
- // Returns a string for a given HRESULT error code.
- BOOL (*GetDXErrorString)(HRESULT hr, char *buf, int nBufSize);
-
- // Driver functions for managing drawables.
- // Functions must respect persistant buffers / persistant interface.
- // NOTE: Persistant interface is: DirectDraw, pre-DX8; Direct3D, DX8 and above.
- BOOL (*CreateDrawable)(DGL_ctx *ctx, BOOL bPersistantInterface, BOOL bPersistantBuffers);
- BOOL (*ResizeDrawable)(DGL_ctx *ctx, BOOL bDefaultDriver, BOOL bPersistantInterface, BOOL bPersistantBuffers);
- BOOL (*DestroyDrawable)(DGL_ctx *ctx);
-
- // Create/Destroy private globals belonging to driver
- BOOL (*CreatePrivateGlobals)(void);
- BOOL (*DestroyPrivateGlobals)(void);
-
- // Build pixelformat list
- BOOL (*BuildPixelformatList)(void);
-
- // Initialise Mesa's driver pointers
- BOOL (*InitialiseMesa)(DGL_ctx *ctx);
-
- // Swap buffers
- BOOL (*SwapBuffers)(DGL_ctx *ctx, HDC hDC, HWND hWnd);
-
- // wglGetProcAddress()
- PROC (*wglGetProcAddress)(LPCSTR a);
-
- BOOL (*GetDisplayMode)(DGL_ctx *ctx, GLD_displayMode *glddm);
-} GLD_driver;
-
-extern GLD_driver _gldDriver;
-
-BOOL gldInitDriverPointers(DWORD dwDriver);
-const GLubyte* _gldGetStringGeneric(struct gl_context *ctx, GLenum name);
-
-#endif // _USE_GLD3_WGL
-
-#endif // _GLD_DRIVER_H
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc b/mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc
deleted file mode 100644
index b0a22b281..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: Windows Resource Compiler
-* Environment: Windows 95
-*
-****************************************************************************/
-
-#ifndef WORKSHOP_INVOKED
- #include <windows.h>
-#endif
-
-#define FILE_DESCRIPTION "SciTech GLDirect"
-#define ORIG_FILENAME "opengl32.dll"
-#define FILE_TYPE VFT_DLL
-
-#include "gldirect/gldver.ver"
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gldlame8.c b/mesalib/src/mesa/drivers/windows/gldirect/gldlame8.c
deleted file mode 100644
index 5ac519c17..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/gldlame8.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: GLDirect utility for determining lame boards/drivers.
-*
-****************************************************************************/
-
-#define STRICT
-#define WIN32_LEAN_AND_MEAN
-#include <d3d8.h>
-
-/*
-Ack. Broken out from gldlame.c because of broken D3D headers. KeithH
-*/
-
-/****************************************************************************
-REMARKS:
-Scans list of DirectDraw devices for specific device IDs.
-****************************************************************************/
-
-#define VENDORID_ATI 0x1002
-
-static DWORD devATIRagePro[] = {
- 0x4742, // 3D RAGE PRO BGA AGP 1X/2X
- 0x4744, // 3D RAGE PRO BGA AGP 1X only
- 0x4749, // 3D RAGE PRO BGA PCI 33 MHz
- 0x4750, // 3D RAGE PRO PQFP PCI 33 MHz
- 0x4751, // 3D RAGE PRO PQFP PCI 33 MHz limited 3D
- 0x4C42, // 3D RAGE LT PRO BGA-312 AGP 133 MHz
- 0x4C44, // 3D RAGE LT PRO BGA-312 AGP 66 MHz
- 0x4C49, // 3D RAGE LT PRO BGA-312 PCI 33 MHz
- 0x4C50, // 3D RAGE LT PRO BGA-256 PCI 33 MHz
- 0x4C51, // 3D RAGE LT PRO BGA-256 PCI 33 MHz limited 3D
-};
-
-static DWORD devATIRageIIplus[] = {
- 0x4755, // 3D RAGE II+
- 0x4756, // 3D RAGE IIC PQFP PCI
- 0x4757, // 3D RAGE IIC BGA AGP
- 0x475A, // 3D RAGE IIC PQFP AGP
- 0x4C47, // 3D RAGE LT-G
-};
-
-static __inline BOOL IsDevice(
- DWORD *lpDeviceIdList,
- DWORD dwDeviceId,
- int count)
-{
- int i;
-
- for (i=0; i<count; i++)
- if (dwDeviceId == lpDeviceIdList[i])
- return TRUE;
-
- return FALSE;
-}
-
-/****************************************************************************
-REMARKS:
-Test the Direct3D8 device for "lameness" with respect to GLDirect.
-This is done on per-chipset basis, as in GLD CAD driver (DGLCONTEXT.C).
-If bTestForWHQL is set then the device is tested to see if it is
-certified, and bIsWHQL is set to indicate TRUE or FALSE. Otherwise bIsWHQL
-is not set. [WHQL = Windows Hardware Quality Labs]
-
-NOTE: There is a one- or two-second time penalty incurred in determining
- the WHQL certification date.
-****************************************************************************/
-BOOL IsThisD3D8Lame(
- IDirect3D8 *pD3D,
- DWORD dwAdapter,
- BOOL bTestForWHQL,
- BOOL *bIsWHQL)
-{
- DWORD dwFlags = bTestForWHQL ? 0 : D3DENUM_NO_WHQL_LEVEL;
- D3DADAPTER_IDENTIFIER8 d3dai;
- HRESULT hr;
-
- hr = IDirect3D8_GetAdapterIdentifier(pD3D, dwAdapter, dwFlags, &d3dai);
- if (FAILED(hr))
- return TRUE; // Definitely lame if adapter details can't be obtained!
-
- if (bTestForWHQL) {
- *bIsWHQL = d3dai.WHQLLevel ? TRUE : FALSE;
- }
-
- // Vendor 1: ATI
- if (d3dai.VendorId == VENDORID_ATI) {
- // Test A: ATI Rage PRO
- if (IsDevice(devATIRagePro, d3dai.DeviceId, sizeof(devATIRagePro)))
- return TRUE; // bad mipmapping
- // Test B: ATI Rage II+
- if (IsDevice(devATIRageIIplus, d3dai.DeviceId, sizeof(devATIRageIIplus)))
- return TRUE; // bad HW alpha testing
- }
-
- return FALSE;
-}
-
-/****************************************************************************
-REMARKS:
-Test the Direct3DDevice8 device for "lameness" with respect to GLDirect.
-This is done by querying for particular caps, as in GLD CPL (CPLMAIN.CPP).
-****************************************************************************/
-BOOL IsThisD3D8DeviceLame(
- IDirect3DDevice8 *pDev)
-{
- D3DCAPS8 d3dCaps;
- HRESULT hr;
-
- hr = IDirect3DDevice8_GetDeviceCaps(pDev, &d3dCaps);
- if (FAILED(hr))
- return TRUE;
-
- // Test 1: Perspective-correct textures
- // Any card that cannot do perspective-textures is *exceptionally* lame.
- if (!(d3dCaps.TextureCaps & D3DPTEXTURECAPS_PERSPECTIVE)) {
- return TRUE; // Lame!
- }
-
- // Test 2: Bilinear filtering
- if (!(d3dCaps.TextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR)) {
- return TRUE; // Lame!
- }
-
- // Test 3: Mipmapping
- if (!(d3dCaps.TextureCaps & D3DPTEXTURECAPS_MIPMAP)) {
- return TRUE; // Lame!
- }
-
- // Test 4: Depth-test modes (?)
-
- // Test 5: Blend Modes -- Based on DX7 D3DIM MTEXTURE.CPP caps test
-
- // Accept devices that can do multipass, alpha blending
- if( !((d3dCaps.DestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) &&
- (d3dCaps.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHA)) )
- return TRUE;
-
- // Accept devices that can do multipass, color blending
- if( !((d3dCaps.DestBlendCaps & D3DPBLENDCAPS_SRCCOLOR) &&
- (d3dCaps.SrcBlendCaps & D3DPBLENDCAPS_ZERO)) )
- return TRUE;
-
- // Accept devices that really support multiple textures.
- if( !((d3dCaps.MaxTextureBlendStages > 1 ) &&
- (d3dCaps.MaxSimultaneousTextures > 1 ) &&
- (d3dCaps.TextureOpCaps & D3DTEXOPCAPS_MODULATE )) )
- return TRUE;
-
- return FALSE; // Not lame
-}
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h b/mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h
deleted file mode 100644
index 12b5003bf..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h
+++ /dev/null
@@ -1,520 +0,0 @@
-/* File name : colors.h
- * Version : 2.3
- *
- * Header file for display driver for Mesa 2.3 under
- * Windows95 and WindowsNT
- * This file defines macros and global variables needed
- * for converting color format
- *
- * Copyright (C) 1996- Li Wei
- * Address : Institute of Artificial Intelligence
- * : & Robotics
- * : Xi'an Jiaotong University
- * Email : liwei@aiar.xjtu.edu.cn
- * Web page : http://sun.aiar.xjtu.edu.cn
- *
- * This file and its associations are partially based on the
- * Windows NT driver for Mesa, written by Mark Leaming
- * (mark@rsinc.com).
- */
-
-/*
- * Macros for pixel format defined
- */
-
-/*
- * Revision 1.1 2004/04/20 11:13:11 alanh
- * add SciTech's GLDirect driver for Windows.
- *
- * This code is donated to Mesa which allows the usage of
- * a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
- *
- * No build system exists for this code yet, that will come.....
- *
- * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
- * Imported sources
- *
- * Revision 1.2 1999/01/03 03:08:57 brianp
- * Ted Jump's changes
- *
- * Revision 1.1 1999/01/03 03:08:12 brianp
- * Initial revision
- *
- * Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
- * Add LUTs need for dithering
- */
-
-/*
- * Revision 1.1 2004/04/20 11:13:11 alanh
- * add SciTech's GLDirect driver for Windows.
- *
- * This code is donated to Mesa which allows the usage of
- * a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
- *
- * No build system exists for this code yet, that will come.....
- *
- * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
- * Imported sources
- *
- * Revision 1.2 1999/01/03 03:08:57 brianp
- * Ted Jump's changes
- *
- * Revision 1.1 1999/01/03 03:08:12 brianp
- * Initial revision
- *
- * Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
- * Add BGR8 Macro
- */
-
-/*
- * Revision 1.1 2004/04/20 11:13:11 alanh
- * add SciTech's GLDirect driver for Windows.
- *
- * This code is donated to Mesa which allows the usage of
- * a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
- *
- * No build system exists for this code yet, that will come.....
- *
- * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
- * Imported sources
- *
- * Revision 1.2 1999/01/03 03:08:57 brianp
- * Ted Jump's changes
- *
- * Revision 1.1 1999/01/03 03:08:12 brianp
- * Initial revision
- *
- * Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
- * Initial revision
- */
-/* Values for wmesa->pixelformat: */
-
-#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
-#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */
-#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
-#define PF_DITHER8 6 /* Dithered RGB using a lookup table */
-#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */
-#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */
-#define PF_BADFORMAT 11
-#define PF_INDEX8 12
-
-char ColorMap16[] = {
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
-0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
-0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
-0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
-0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,
-0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,
-0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
-0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
-0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,
-0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,
-0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,
-0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
-0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,
-0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,
-0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
-0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
-0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
-0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
-0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,
-0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
-0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,
-0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,
-0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
-0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,
-0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
-0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,
-0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,
-0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
-
-#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5)))
-#ifdef DDRAW
-#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11)))
-#else
-#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10)))
-#endif
-#define BGR24(r,g,b) (unsigned long)(((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8)
-#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))
-
-
-
-/*
- * If pixelformat==PF_8A8B8G8R:
- */
-#define PACK_8A8B8G8R( R, G, B, A ) \
- ( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) )
-
-
-/*
- * If pixelformat==PF_8R8G8B:
- */
-#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) )
-
-
-/*
- * If pixelformat==PF_5R6G5B:
- */
-
-
-#ifdef DDRAW
-#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11)))
-#else
-#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10)))
-#endif
-/*----------------------------------------------------------------------------
-
-Division lookup tables. These tables compute 0-255 divided by 51 and
-modulo 51. These tables could approximate gamma correction.
-
-*/
-
-char unsigned const aDividedBy51Rounded[256] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-};
-
-char unsigned const aDividedBy51[256] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
-};
-
-char unsigned const aModulo51[256] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0,
-};
-
-/*----------------------------------------------------------------------------
-
-Multiplication LUTs. These compute 0-5 times 6 and 36.
-
-*/
-
-char unsigned const aTimes6[6] =
-{
- 0, 6, 12, 18, 24, 30
-};
-
-char unsigned const aTimes36[6] =
-{
- 0, 36, 72, 108, 144, 180
-};
-
-
-/*----------------------------------------------------------------------------
-
-Dither matrices for 8 bit to 2.6 bit halftones.
-
-*/
-
-char unsigned const aHalftone16x16[256] =
-{
- 0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43,
- 34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21,
- 38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6,
- 22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34,
- 2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42,
- 37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20,
- 40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4,
- 24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32,
- 2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41,
- 37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19,
- 40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3,
- 24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31,
- 1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43,
- 36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21,
- 39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5,
- 23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33,
-};
-
-char unsigned const aHalftone8x8[64] =
-{
- 0, 38, 9, 47, 2, 40, 11, 50,
- 25, 12, 35, 22, 27, 15, 37, 24,
- 6, 44, 3, 41, 8, 47, 5, 43,
- 31, 19, 28, 15, 34, 21, 31, 18,
- 1, 39, 11, 49, 0, 39, 10, 48,
- 27, 14, 36, 23, 26, 13, 35, 23,
- 7, 46, 4, 43, 7, 45, 3, 42,
- 33, 20, 30, 17, 32, 19, 29, 16,
-};
-
-char unsigned const aHalftone4x4_1[16] =
-{
- 0, 25, 6, 31,
- 38, 12, 44, 19,
- 9, 35, 3, 28,
- 47, 22, 41, 15
-};
-
-char unsigned const aHalftone4x4_2[16] =
-{
- 41, 3, 9, 28,
- 35, 15, 22, 47,
- 6, 25, 38, 0,
- 19, 44, 31, 12
-};
-
-/***************************************************************************
- aWinGHalftoneTranslation
-
- Translates a 2.6 bit-per-pixel halftoned representation into the
- slightly rearranged WinG Halftone Palette.
-*/
-
-char unsigned const aWinGHalftoneTranslation[216] =
-{
- 0,
- 29,
- 30,
- 31,
- 32,
- 249,
- 33,
- 34,
- 35,
- 36,
- 37,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 46,
- 47,
- 48,
- 49,
- 50,
- 51,
- 52,
- 53,
- 54,
- 55,
- 56,
- 250,
- 250,
- 57,
- 58,
- 59,
- 251,
- 60,
- 61,
- 62,
- 63,
- 64,
- 65,
- 66,
- 67,
- 68,
- 69,
- 70,
- 71,
- 72,
- 73,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 82,
- 83,
- 84,
- 85,
- 86,
- 87,
- 88,
- 89,
- 250,
- 90,
- 91,
- 92,
- 93,
- 94,
- 95,
- 96,
- 97,
- 98,
- 99,
- 100,
- 101,
- 102,
- 103,
- 104,
- 105,
- 106,
- 107,
- 108,
- 109,
- 110,
- 111,
- 227,
- 112,
- 113,
- 114,
- 115,
- 116,
- 117,
- 118,
- 119,
- 151,
- 120,
- 121,
- 122,
- 123,
- 124,
- 228,
- 125,
- 126,
- 229,
- 133,
- 162,
- 135,
- 131,
- 132,
- 137,
- 166,
- 134,
- 140,
- 130,
- 136,
- 143,
- 138,
- 139,
- 174,
- 141,
- 142,
- 177,
- 129,
- 144,
- 145,
- 146,
- 147,
- 148,
- 149,
- 150,
- 157,
- 152,
- 153,
- 154,
- 155,
- 156,
- 192,
- 158,
- 159,
- 160,
- 161,
- 196,
- 163,
- 164,
- 165,
- 127,
- 199,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 207,
- 175,
- 176,
- 210,
- 178,
- 179,
- 180,
- 181,
- 182,
- 183,
- 184,
- 185,
- 186,
- 187,
- 188,
- 189,
- 190,
- 191,
- 224,
- 193,
- 194,
- 195,
- 252,
- 252,
- 197,
- 198,
- 128,
- 253,
- 252,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 230,
- 208,
- 209,
- 231,
- 211,
- 212,
- 213,
- 214,
- 215,
- 216,
- 217,
- 218,
- 219,
- 220,
- 221,
- 222,
- 254,
- 223,
- 232,
- 225,
- 226,
- 255,
-};
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
deleted file mode 100644
index 02f0dfacd..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
+++ /dev/null
@@ -1,1681 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Mesa Software WGL (WindowsGL)
-*
-****************************************************************************/
-
-#include <windows.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-#include "glheader.h"
-#include "colors.h"
-#include "context.h"
-#include "colormac.h"
-#include "dd.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "vbo/vbo.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast/s_context.h"
-#include "swrast/s_depth.h"
-#include "swrast/s_lines.h"
-#include "swrast/s_triangle.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "dglcontext.h"
-#include "gld_driver.h"
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-DGL_pixelFormat pfTemplateMesaSW =
-{
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
- 1, // Structure version - should be 1
- // Flags:
- PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
- PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
- PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
- PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
- PFD_DOUBLEBUFFER | // The buffer is double-buffered.
- 0, // Placeholder for easy commenting of above flags
- PFD_TYPE_RGBA, // Pixel type RGBA.
- 32, // Total colour bitplanes (excluding alpha bitplanes)
- 8, 0, // Red bits, shift
- 8, 8, // Green bits, shift
- 8, 16, // Blue bits, shift
- 8, 24, // Alpha bits, shift (destination alpha)
- 64, // Accumulator bits (total)
- 16, 16, 16, 16, // Accumulator bits: Red, Green, Blue, Alpha
- 16, // Depth bits
- 8, // Stencil bits
- 0, // Number of auxiliary buffers
- 0, // Layer type
- 0, // Specifies the number of overlay and underlay planes.
- 0, // Layer mask
- 0, // Specifies the transparent color or index of an underlay plane.
- 0 // Damage mask
- },
- 0, // Unused
-};
-
-//---------------------------------------------------------------------------
-// Extensions
-//---------------------------------------------------------------------------
-
-typedef struct {
- PROC proc;
- char *name;
-} GLD_extension;
-
-static GLD_extension GLD_extList[] = {
-#ifdef GL_EXT_polygon_offset
- { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
-#endif
- { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
- { (PROC)glBlendColorEXT, "glBlendColorExt" },
- { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
- { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
- { (PROC)glColorPointerEXT, "glColorPointerEXT" },
- { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
- { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
- { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
- { (PROC)glGetPointervEXT, "glGetPointervEXT" },
- { (PROC)glArrayElementEXT, "glArrayElementEXT" },
- { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
- { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
- { (PROC)glBindTextureEXT, "glBindTextureEXT" },
- { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
- { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
- { (PROC)glIsTextureEXT, "glIsTextureEXT" },
- { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
- { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
- { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
- { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
- { (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
- { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
- { (PROC)glLockArraysEXT, "glLockArraysEXT" },
- { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
- { NULL, "\0" }
-};
-
-//---------------------------------------------------------------------------
-// WMesa Internal Functions
-//---------------------------------------------------------------------------
-
-#define PAGE_FILE 0xffffffff
-
-#define REDBITS 0x03
-#define REDSHIFT 0x00
-#define GREENBITS 0x03
-#define GREENSHIFT 0x03
-#define BLUEBITS 0x02
-#define BLUESHIFT 0x06
-
-typedef struct _dibSection {
- HDC hDC;
- HANDLE hFileMap;
- BOOL fFlushed;
- LPVOID base;
-} WMDIBSECTION, *PWMDIBSECTION;
-
-typedef struct wmesa_context {
- HWND Window;
- HDC hDC;
- HPALETTE hPalette;
- HPALETTE hOldPalette;
- HPEN hPen;
- HPEN hOldPen;
- HCURSOR hOldCursor;
- COLORREF crColor;
- // 3D projection stuff
- RECT drawRect;
- UINT uiDIBoffset;
- // OpenGL stuff
- HPALETTE hGLPalette;
- GLuint width;
- GLuint height;
- GLuint ScanWidth;
- GLboolean db_flag; //* double buffered?
- GLboolean rgb_flag; //* RGB mode?
- GLboolean dither_flag; //* use dither when 256 color mode for RGB?
- GLuint depth; //* bits per pixel (1, 8, 24, etc)
- ULONG pixel; // current color index or RGBA pixel value
- ULONG clearpixel; //* pixel for clearing the color buffers
- PBYTE ScreenMem; // WinG memory
- BITMAPINFO *IndexFormat;
- HPALETTE hPal; // Current Palette
- HPALETTE hPalHalfTone;
-
-
- WMDIBSECTION dib;
- BITMAPINFO bmi;
- HBITMAP hbmDIB;
- HBITMAP hOldBitmap;
- HBITMAP Old_Compat_BM;
- HBITMAP Compat_BM; // Bitmap for double buffering
- PBYTE pbPixels;
- int nColors;
- BYTE cColorBits;
- int pixelformat;
-
- RECT rectOffScreen;
- RECT rectSurface;
-// HWND hwnd;
- DWORD pitch;
- PBYTE addrOffScreen;
-
- // We always double-buffer, for performance reasons, but
- // we need to know which of SwapBuffers() or glFlush() to
- // handle. If we're emulating, then we update on Flush(),
- // otherwise we update on SwapBufers(). KeithH
- BOOL bEmulateSingleBuffer;
-} WMesaContext, *PWMC;
-
-#define GLD_GET_WMESA_DRIVER(c) (WMesaContext*)(c)->glPriv
-
-// TODO:
-GLint stereo_flag = 0 ;
-
-/* If we are double-buffering, we want to get the DC for the
- * off-screen DIB, otherwise the DC for the window.
- */
-#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC )
-#define DD_RELEASEDC
-
-#define FLIP(Y) (Current->height-(Y)-1)
-
-struct DISPLAY_OPTIONS {
- int stereo;
- int fullScreen;
- int mode;
- int bpp;
-};
-
-struct DISPLAY_OPTIONS displayOptions;
-
-//---------------------------------------------------------------------------
-
-static unsigned char threeto8[8] = {
- 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377
-};
-
-static unsigned char twoto8[4] = {
- 0, 0x55, 0xaa, 0xff
-};
-
-static unsigned char oneto8[2] = {
- 0, 255
-};
-
-//---------------------------------------------------------------------------
-
-BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline)
-{
- char unsigned redtemp, greentemp, bluetemp, paletteindex;
-
- //*** now, look up each value in the halftone matrix
- //*** using an 8x8 ordered dither.
- redtemp = aDividedBy51[red]
- + (aModulo51[red] > aHalftone8x8[(pixel%8)*8
- + scanline%8]);
- greentemp = aDividedBy51[(char unsigned)green]
- + (aModulo51[green] > aHalftone8x8[
- (pixel%8)*8 + scanline%8]);
- bluetemp = aDividedBy51[(char unsigned)blue]
- + (aModulo51[blue] > aHalftone8x8[
- (pixel%8)*8 +scanline%8]);
-
- //*** recombine the halftoned rgb values into a palette index
- paletteindex =
- redtemp + aTimes6[greentemp] + aTimes36[bluetemp];
-
- //*** and translate through the wing halftone palette
- //*** translation vector to give the correct value.
- return aWinGHalftoneTranslation[paletteindex];
-}
-
-//---------------------------------------------------------------------------
-
-static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift)
-{
- unsigned char val;
-
- val = i >> shift;
- switch (nbits) {
-
- case 1:
- val &= 0x1;
- return oneto8[val];
-
- case 2:
- val &= 0x3;
- return twoto8[val];
-
- case 3:
- val &= 0x7;
- return threeto8[val];
-
- default:
- return 0;
- }
-}
-
-//---------------------------------------------------------------------------
-
-
-void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b)
-{
- WMesaContext *Current = pwc;
-
- // Test for invalid scanline parameter. KeithH
- if ((iScanLine < 0) || (iScanLine >= pwc->height))
- return;
-
- if (Current->db_flag) {
- LPBYTE lpb = pwc->pbPixels;
- UINT nBypp = pwc->cColorBits >> 3;
- UINT nOffset = iPixel % nBypp;
-
- lpb += pwc->ScanWidth * iScanLine;
- lpb += iPixel * nBypp;
-
- if(nBypp == 1){
- if(pwc->dither_flag)
- *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel);
- else
- *lpb = BGR8(r,g,b);
- }
- else if(nBypp == 2)
- *((LPWORD)lpb) = BGR16(r,g,b);
- else if (nBypp == 3)
- *((LPDWORD)lpb) = BGR24(r,g,b);
- else if (nBypp == 4)
- *((LPDWORD)lpb) = BGR32(r,g,b);
- }
- else{
- SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b));
- }
-}
-
-//---------------------------------------------------------------------------
-
-void wmCreateDIBSection(
- HDC hDC,
- PWMC pwc, // handle of device context
- CONST BITMAPINFO *pbmi, // bitmap size, format, and color data
- UINT iUsage // color data type indicator: RGB values or palette indices
- )
-{
- DWORD dwSize = 0;
- DWORD dwScanWidth;
- UINT nBypp = pwc->cColorBits / 8;
- HDC hic;
-
- dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3);
-
- pwc->ScanWidth =pwc->pitch = dwScanWidth;
-
- if (stereo_flag)
- pwc->ScanWidth = 2* pwc->pitch;
-
- dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height);
-
- pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE,
- NULL,
- PAGE_READWRITE | SEC_COMMIT,
- 0,
- dwSize,
- NULL);
-
- if (!pwc->dib.hFileMap)
- return;
-
- pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap,
- FILE_MAP_ALL_ACCESS,
- 0,
- 0,
- 0);
-
- if(!pwc->dib.base){
- CloseHandle(pwc->dib.hFileMap);
- return;
- }
-
-
- CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO));
-
- hic = CreateIC("display", NULL, NULL, NULL);
- pwc->dib.hDC = CreateCompatibleDC(hic);
-
-
- pwc->hbmDIB = CreateDIBSection(hic,
- &(pwc->bmi),
- (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS),
- &(pwc->pbPixels),
- pwc->dib.hFileMap,
- 0);
- pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels;
- pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB);
-
- DeleteDC(hic);
-
- return;
-
-}
-
-//---------------------------------------------------------------------------
-
-void wmCreatePalette( PWMC pwdc )
-{
- /* Create a compressed and re-expanded 3:3:2 palette */
- int i;
- LOGPALETTE *pPal;
- BYTE rb, rs, gb, gs, bb, bs;
-
- pwdc->nColors = 0x100;
-
- pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) +
- pwdc->nColors * sizeof(PALETTEENTRY));
- memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) );
-
- pPal->palVersion = 0x300;
-
- rb = REDBITS;
- rs = REDSHIFT;
- gb = GREENBITS;
- gs = GREENSHIFT;
- bb = BLUEBITS;
- bs = BLUESHIFT;
-
- if (pwdc->db_flag) {
-
- /* Need to make two palettes: one for the screen DC and one for the DIB. */
- pPal->palNumEntries = pwdc->nColors;
- for (i = 0; i < pwdc->nColors; i++) {
- pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs );
- pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs );
- pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs );
- pPal->palPalEntry[i].peFlags = 0;
- }
- pwdc->hGLPalette = CreatePalette( pPal );
- pwdc->hPalette = CreatePalette( pPal );
- }
-
- else {
- pPal->palNumEntries = pwdc->nColors;
- for (i = 0; i < pwdc->nColors; i++) {
- pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs );
- pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs );
- pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs );
- pPal->palPalEntry[i].peFlags = 0;
- }
- pwdc->hGLPalette = CreatePalette( pPal );
- }
-
- free(pPal);
-
-}
-
-//---------------------------------------------------------------------------
-
-/* This function sets the color table of a DIB section
- * to match that of the destination DC
- */
-BOOL wmSetDibColors(PWMC pwc)
-{
- RGBQUAD *pColTab, *pRGB;
- PALETTEENTRY *pPal, *pPE;
- int i, nColors;
- BOOL bRet=TRUE;
- DWORD dwErr=0;
-
- /* Build a color table in the DIB that maps to the
- * selected palette in the DC.
- */
- nColors = 1 << pwc->cColorBits;
- pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY));
- memset( pPal, 0, nColors * sizeof(PALETTEENTRY) );
- GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal );
- pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD));
- for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) {
- pRGB->rgbRed = pPE->peRed;
- pRGB->rgbGreen = pPE->peGreen;
- pRGB->rgbBlue = pPE->peBlue;
- }
- if(pwc->db_flag)
- bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab );
-
- if(!bRet)
- dwErr = GetLastError();
-
- free( pColTab );
- free( pPal );
-
- return bRet;
-}
-
-//---------------------------------------------------------------------------
-
-static void wmSetPixelFormat( PWMC wc, HDC hDC)
-{
- if(wc->rgb_flag)
- wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL);
- else
- wc->cColorBits = 8;
- switch(wc->cColorBits){
- case 8:
- if(wc->dither_flag != GL_TRUE)
- wc->pixelformat = PF_INDEX8;
- else
- wc->pixelformat = PF_DITHER8;
- break;
- case 16:
- wc->pixelformat = PF_5R6G5B;
- break;
- case 32:
- wc->pixelformat = PF_8R8G8B;
- break;
- default:
- wc->pixelformat = PF_BADFORMAT;
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * This function creates the DIB section that is used for combined
- * GL and GDI calls
- */
-BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize)
-{
- HDC hdc = pwc->hDC;
- LPBITMAPINFO pbmi = &(pwc->bmi);
- int iUsage;
-
- pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- pbmi->bmiHeader.biWidth = lxSize;
- pbmi->bmiHeader.biHeight= -lySize;
- pbmi->bmiHeader.biPlanes = 1;
- if(pwc->rgb_flag)
- pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL);
- else
- pbmi->bmiHeader.biBitCount = 8;
- pbmi->bmiHeader.biCompression = BI_RGB;
- pbmi->bmiHeader.biSizeImage = 0;
- pbmi->bmiHeader.biXPelsPerMeter = 0;
- pbmi->bmiHeader.biYPelsPerMeter = 0;
- pbmi->bmiHeader.biClrUsed = 0;
- pbmi->bmiHeader.biClrImportant = 0;
-
- iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS;
-
- pwc->cColorBits = pbmi->bmiHeader.biBitCount;
- pwc->ScanWidth = pwc->pitch = lxSize;
- pwc->width = lxSize;
- pwc->height = lySize;
-
- wmCreateDIBSection(hdc, pwc, pbmi, iUsage);
-
- if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) {
- wmCreatePalette( pwc );
- wmSetDibColors( pwc );
- }
- wmSetPixelFormat(pwc, pwc->hDC);
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * Free up the dib section that was created
- */
-BOOL wmDeleteBackingStore(PWMC pwc)
-{
- SelectObject(pwc->dib.hDC, pwc->hOldBitmap);
- DeleteDC(pwc->dib.hDC);
- DeleteObject(pwc->hbmDIB);
- UnmapViewOfFile(pwc->dib.base);
- CloseHandle(pwc->dib.hFileMap);
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * Blit memory DC to screen DC
- */
-BOOL wmFlush(PWMC pwc, HDC hDC)
-{
- BOOL bRet = 0;
- DWORD dwErr = 0;
-
-// Now using bEmulateSingleBuffer in the calling function. KeithH
-
-// if(pwc->db_flag){
- bRet = BitBlt(hDC, 0, 0, pwc->width, pwc->height,
- pwc->dib.hDC, 0, 0, SRCCOPY);
-// }
-
- return bRet;
-
-}
-
-//---------------------------------------------------------------------------
-// Support Functions
-//---------------------------------------------------------------------------
-
-static void flush(struct gl_context* ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
-/*
- if((Current->rgb_flag &&!(Current->db_flag))
- ||(!Current->rgb_flag))
- {
- wmFlush(Current, Current->hDC);
- }
-*/
- // Only flush if we're not in double-buffer mode. KeithH
- // The demo fractal.c calls glutSwapBuffers() then glFlush()!
- if (Current->bEmulateSingleBuffer) {
- wmFlush(Current, Current->hDC);
- }
-}
-
-
-//---------------------------------------------------------------------------
-
-/*
- * Set the color used to clear the color buffer.
- */
-//static void clear_color( struct gl_context* ctx, const GLchan color[4] )
-// Changed for Mesa 5.x. KeithH
-static void clear_color(
- struct gl_context* ctx,
- const GLfloat color[4])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLubyte col[4];
- CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
- Current->clearpixel = RGB(col[0], col[1], col[2]);
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Clear the specified region of the color buffer using the clear color
- * or index as specified by one of the two functions above.
- *
- * This procedure clears either the front and/or the back COLOR buffers.
- * Only the "left" buffer is cleared since we are not stereo.
- * Clearing of the other non-color buffers is left to the swrast.
- * We also only clear the color buffers if the color masks are all 1's.
- * Otherwise, we let swrast do it.
- */
-
-static clear(struct gl_context* ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- DWORD dwColor;
- WORD wColor;
- BYTE bColor;
- LPDWORD lpdw = (LPDWORD)Current->pbPixels;
- LPWORD lpw = (LPWORD)Current->pbPixels;
- LPBYTE lpb = Current->pbPixels;
- int lines;
- const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
-
- if (all){
- x=y=0;
- width=Current->width;
- height=Current->height;
- }
-
-
- /* sanity check - can't have right(stereo) buffers */
- assert((mask & (DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT)) == 0);
-
- /* clear alpha */
- if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_RIGHT_BIT)) &&
- ctx->DrawBuffer->UseSoftwareAlphaBuffers &&
- ctx->Color.ColorMask[ACOMP]) {
- _swrast_clear_alpha_buffers( ctx );
- }
-
- if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
- if (mask & DD_BACK_LEFT_BIT) {
- /* Double-buffering - clear back buffer */
- UINT nBypp = Current->cColorBits / 8;
- int i = 0;
- int iSize = 0;
-
- assert(Current->db_flag==GL_TRUE); /* we'd better be double buffer */
- if(nBypp ==1 ){
- iSize = Current->width/4;
- bColor = BGR8(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- wColor = MAKEWORD(bColor,bColor);
- dwColor = MAKELONG(wColor, wColor);
- }
- if(nBypp == 2){
- iSize = Current->width / 2;
- wColor = BGR16(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- dwColor = MAKELONG(wColor, wColor);
- }
- else if(nBypp == 4){
- iSize = Current->width;
- dwColor = BGR32(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- }
-
- /* clear a line */
- while(i < iSize){
- *lpdw = dwColor;
- lpdw++;
- i++;
- }
-
- /* This is the 24bit case */
- if (nBypp == 3) {
- iSize = Current->width *3/4;
- dwColor = BGR24(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- while(i < iSize){
- *lpdw = dwColor;
- lpb += nBypp;
- lpdw = (LPDWORD)lpb;
- i++;
- }
- }
-
- i = 0;
- if (stereo_flag)
- lines = height /2;
- else
- lines = height;
- /* copy cleared line to other lines in buffer */
- do {
- memcpy(lpb, Current->pbPixels, iSize*4);
- lpb += Current->ScanWidth;
- i++;
- }
- while (i<lines-1);
- mask &= ~DD_BACK_LEFT_BIT;
- } /* double-buffer */
-
- if (mask & DD_FRONT_LEFT_BIT) {
- /* single-buffer */
- HDC DC=DD_GETDC;
- HPEN Pen=CreatePen(PS_SOLID,1,Current->clearpixel);
- HBRUSH Brush=CreateSolidBrush(Current->clearpixel);
- HPEN Old_Pen=SelectObject(DC,Pen);
- HBRUSH Old_Brush=SelectObject(DC,Brush);
- Rectangle(DC,x,y,x+width,y+height);
- SelectObject(DC,Old_Pen);
- SelectObject(DC,Old_Brush);
- DeleteObject(Pen);
- DeleteObject(Brush);
- DD_RELEASEDC;
- mask &= ~DD_FRONT_LEFT_BIT;
- } /* single-buffer */
- } /* if masks are all 1's */
-
- /* Call swrast if there is anything left to clear (like DEPTH) */
- if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
-}
-
-
-//---------------------------------------------------------------------------
-
-
-static void enable( struct gl_context* ctx, GLenum pname, GLboolean enable )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
-
- if (!Current)
- return;
-
- if (pname == GL_DITHER) {
- if(enable == GL_FALSE){
- Current->dither_flag = GL_FALSE;
- if(Current->cColorBits == 8)
- Current->pixelformat = PF_INDEX8;
- }
- else{
- if (Current->rgb_flag && Current->cColorBits == 8){
- Current->pixelformat = PF_DITHER8;
- Current->dither_flag = GL_TRUE;
- }
- else
- Current->dither_flag = GL_FALSE;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-static GLboolean set_draw_buffer( struct gl_context* ctx, GLenum mode )
-{
- /* TODO: this could be better */
- if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-//---------------------------------------------------------------------------
-
-
-static void set_read_buffer(struct gl_context *ctx, struct gl_framebuffer *colorBuffer,
- GLenum buffer )
-{
- /* XXX todo */
- return;
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/* Return characteristics of the output buffer. */
-//static void buffer_size( struct gl_context* ctx, GLuint *width, GLuint *height )
-// Altered for Mesa 5.x. KeithH
-static void buffer_size(
- struct gl_framebuffer *buffer,
- GLuint *width,
- GLuint *height)
-{
- // For some reason the context is not passed into this function.
- // Therefore we have to explicitly retrieve it.
- GET_CURRENT_CONTEXT(ctx);
-
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- int New_Size;
- RECT CR;
-
- GetClientRect(Current->Window,&CR);
-
- *width=CR.right;
- *height=CR.bottom;
-
- New_Size=((*width)!=Current->width) || ((*height)!=Current->height);
-
- if (New_Size){
- Current->width=*width;
- Current->height=*height;
- Current->ScanWidth=Current->width;
- if ((Current->ScanWidth%sizeof(long))!=0)
- Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long)));
-
- if (Current->db_flag){
- if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){
- wmDeleteBackingStore(Current);
- wmCreateBackingStore(Current, Current->width, Current->height);
- }
- }
-
- }
-}
-
-
-
-/**********************************************************************/
-/***** Accelerated point, line, polygon rendering *****/
-/**********************************************************************/
-
-/* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */
-
-static void fast_rgb_points( struct gl_context* ctx, GLuint first, GLuint last )
-{
-}
-
-//---------------------------------------------------------------------------
-
-/* Return pointer to accelerated points function */
-extern tnl_points_func choose_points_function( struct gl_context* ctx )
-{
- return NULL;
-}
-
-//---------------------------------------------------------------------------
-
-static void fast_flat_rgb_line( struct gl_context* ctx, GLuint v0,
- GLuint v1, GLuint pv )
-{
-}
-
-//---------------------------------------------------------------------------
-
-static tnl_line_func choose_line_function( struct gl_context* ctx )
-{
-}
-
-
-/**********************************************************************/
-/***** Span-based pixel drawing *****/
-/**********************************************************************/
-
-
-/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */
-static void write_ci32_span( const struct gl_context* ctx,
- GLuint n, GLint x, GLint y,
- const GLuint index[],
- const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i]=index[i];
-}
-
-
-//---------------------------------------------------------------------------
-
-/* Write a horizontal span of 8-bit color-index pixels with a boolean mask. */
-static void write_ci8_span( const struct gl_context* ctx,
- GLuint n, GLint x, GLint y,
- const GLubyte index[],
- const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i]=index[i];
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current
- * color index is used for all pixels.
- */
-static void write_mono_ci_span(const struct gl_context* ctx,
- GLuint n,GLint x,GLint y,
- GLuint colorIndex, const GLubyte mask[])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- BYTE *Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i]=colorIndex;
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * To improve the performance of this routine, frob the data into an actual
- * scanline and call bitblt on the complete scan line instead of SetPixel.
- */
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span( const struct gl_context* ctx, GLuint n, GLint x, GLint y,
- const GLubyte rgba[][4], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- PWMC pwc = Current;
-
- if (pwc->rgb_flag==GL_TRUE)
- {
- GLuint i;
- HDC DC=DD_GETDC;
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, y, x + i,
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- wmSetPixel(pwc, y, x + i,
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
- }
- DD_RELEASEDC;
- }
- else
- {
- GLuint i;
- BYTE *Mem=Current->ScreenMem+y*Current->ScanWidth+x;
- y = FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgba[i][RCOMP],
- rgba[i][GCOMP],
- rgba[i][BCOMP]));
- }
- else {
- for (i=0; i<n; i++)
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgba[i][RCOMP],
- rgba[i][GCOMP],
- rgba[i][BCOMP]));
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-/* Write a horizontal span of RGB color pixels with a boolean mask. */
-static void write_rgb_span( const struct gl_context* ctx,
- GLuint n, GLint x, GLint y,
- const GLubyte rgb[][3], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- PWMC pwc = Current;
-
- if (pwc->rgb_flag==GL_TRUE)
- {
- GLuint i;
- HDC DC=DD_GETDC;
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, y, x + i,
- rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- wmSetPixel(pwc, y, x + i,
- rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP] );
- }
- DD_RELEASEDC;
- }
- else
- {
- GLuint i;
- BYTE *Mem=Current->ScreenMem+y*Current->ScanWidth+x;
- y = FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgb[i][RCOMP],
- rgb[i][GCOMP],
- rgb[i][BCOMP]));
- }
- else {
- for (i=0; i<n; i++)
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgb[i][RCOMP],
- rgb[i][GCOMP],
- rgb[i][BCOMP]));
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_span( const struct gl_context* ctx,
- GLuint n, GLint x, GLint y,
- const GLchan color[4], const GLubyte mask[])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] );
- GLuint i;
- HDC DC=DD_GETDC;
- PWMC pwc = Current;
- assert(Current->rgb_flag==GL_TRUE);
- y=FLIP(y);
- if(Current->rgb_flag==GL_TRUE){
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc,y,x+i,color[RCOMP], color[GCOMP], color[BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(DC, y, x+i, pixel);
- }
- DD_RELEASEDC;
-}
-
-
-
-/**********************************************************************/
-/***** Array-based pixel drawing *****/
-/**********************************************************************/
-
-
-/* Write an array of 32-bit index pixels with a boolean mask. */
-static void write_ci32_pixels( const struct gl_context* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLuint index[], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- BYTE *Mem=Current->ScreenMem+FLIP(y[i])*Current->ScanWidth+x[i];
- *Mem = index[i];
- }
- }
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * index is used for all pixels.
- */
-static void write_mono_ci_pixels( const struct gl_context* ctx,
- GLuint n,
- const GLint x[], const GLint y[],
- GLuint colorIndex, const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- BYTE *Mem=Current->ScreenMem+FLIP(y[i])*Current->ScanWidth+x[i];
- *Mem = colorIndex;
- }
- }
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels( const struct gl_context* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLubyte rgba[][4], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PWMC pwc = Current;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
- DD_RELEASEDC;
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_pixels( const struct gl_context* ctx,
- GLuint n,
- const GLint x[], const GLint y[],
- const GLchan color[4],
- const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PWMC pwc = Current;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, FLIP(y[i]),x[i],color[RCOMP],
- color[GCOMP], color[BCOMP]);
- DD_RELEASEDC;
-}
-
-/**********************************************************************/
-/***** Read spans/arrays of pixels *****/
-/**********************************************************************/
-
-/* Read a horizontal span of color-index pixels. */
-static void read_ci32_span( const struct gl_context* ctx, GLuint n, GLint x, GLint y,
- GLuint index[])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- BYTE *Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- index[i]=Mem[i];
-}
-
-//---------------------------------------------------------------------------
-
-/* Read an array of color index pixels. */
-static void read_ci32_pixels( const struct gl_context* ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint indx[], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- indx[i]=*(Current->ScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]);
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span( const struct gl_context* ctx,
- GLuint n, GLint x, GLint y,
- GLubyte rgba[][4] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- UINT i;
- COLORREF Color;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- y = Current->height - y - 1;
- for (i=0; i<n; i++) {
- Color=GetPixel(DC,x+i,y);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
- DD_RELEASEDC;
-}
-
-//---------------------------------------------------------------------------
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels( const struct gl_context* ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLubyte rgba[][4], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- COLORREF Color;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- GLint y2 = Current->height - y[i] - 1;
- Color=GetPixel(DC,x[i],y2);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
- }
- DD_RELEASEDC;
-}
-
-//---------------------------------------------------------------------------
-
-static void wmesa_update_state(
- struct gl_context *ctx,
- GLuint new_state)
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _vbo_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-//---------------------------------------------------------------------------
-
-static void wmesa_viewport(
- struct gl_context *ctx,
- GLint x,
- GLint y,
- GLsizei w,
- GLsizei h)
-{
-// ctx->Driver.ResizeBuffersMESA(ctx);
-}
-
-//---------------------------------------------------------------------------
-
-static void wmesa_update_state_first_time(
- struct gl_context *ctx,
- GLuint new_state)
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- _mesa_init_driver_functions(&ctx->Driver);
-
- /*
- * XXX these function pointers could be initialized just once during
- * context creation since they don't depend on any state changes.
- * kws - This is true - this function gets called a lot and it
- * would be good to minimize setting all this when not needed.
- */
- // Good idea, so I'll do it. KeithH. :-)
-
- ctx->Driver.GetString = _gldGetStringGeneric;
- ctx->Driver.UpdateState = wmesa_update_state;
- ctx->Driver.DrawBuffer = set_draw_buffer;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
- ctx->Driver.GetBufferSize = buffer_size;
-
- ctx->Driver.Viewport = wmesa_viewport;
-
- ctx->Driver.Clear = clear;
-
- ctx->Driver.Flush = flush;
- ctx->Driver.ClearColor = clear_color;
- ctx->Driver.Enable = enable;
-
-
- // Does not apply for Mesa 5.x
- //ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat;
- //ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size;
- //ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage;
-
- swdd->SetBuffer = set_read_buffer;
-
-
- /* Pixel/span writing functions: */
- swdd->WriteRGBASpan = write_rgba_span;
- swdd->WriteRGBSpan = write_rgb_span;
- swdd->WriteMonoRGBASpan = write_mono_rgba_span;
- swdd->WriteRGBAPixels = write_rgba_pixels;
- swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels;
- swdd->WriteCI32Span = write_ci32_span;
- swdd->WriteCI8Span = write_ci8_span;
- swdd->WriteMonoCISpan = write_mono_ci_span;
- swdd->WriteCI32Pixels = write_ci32_pixels;
- swdd->WriteMonoCIPixels = write_mono_ci_pixels;
-
- swdd->ReadCI32Span = read_ci32_span;
- swdd->ReadRGBASpan = read_rgba_span;
- swdd->ReadCI32Pixels = read_ci32_pixels;
- swdd->ReadRGBAPixels = read_rgba_pixels;
-
-
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
-
- wmesa_update_state(ctx, new_state);
-}
-
-//---------------------------------------------------------------------------
-// Driver interface functions
-//---------------------------------------------------------------------------
-
-BOOL gldCreateDrawable_MesaSW(
- DGL_ctx *pCtx,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- WMesaContext *c;
- GLboolean true_color_flag;
- GLboolean rgb_flag = GL_TRUE;
- GLboolean db_flag = GL_TRUE;
-
- if (pCtx == NULL)
- return FALSE;
-
- c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context));
- if (!c)
- return FALSE;
-
- pCtx->glPriv = c;
-
- c->hDC = pCtx->hDC;
- c->Window = pCtx->hWnd;
-
- true_color_flag = GetDeviceCaps(pCtx->hDC, BITSPIXEL) > 8;
-
-
-#ifdef DITHER
- if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){
- c->dither_flag = GL_TRUE;
- c->hPalHalfTone = WinGCreateHalftonePalette();
- }
- else
- c->dither_flag = GL_FALSE;
-#else
- c->dither_flag = GL_FALSE;
-#endif
-
-
- if (rgb_flag==GL_FALSE)
- {
- c->rgb_flag = GL_FALSE;
-#if 0
- /* Old WinG stuff???? */
- c->db_flag = db_flag =GL_TRUE; /* WinG requires double buffering */
- printf("Single buffer is not supported in color index mode, ",
- "setting to double buffer.\n");
-#endif
- }
- else
- {
- c->rgb_flag = GL_TRUE;
- }
-
-// db_flag = pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER ? GL_TRUE : GL_FALSE;
- db_flag = GL_TRUE; // Force double-buffer
- if (db_flag) {
- c->db_flag = 1;
- /* Double buffered */
- {
- wmCreateBackingStore(c, pCtx->dwWidth, pCtx->dwHeight);
-
- }
- } else {
- /* Single Buffered */
- if (c->rgb_flag)
- c->db_flag = 0;
- }
-
- c->bEmulateSingleBuffer = (pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER)
- ? FALSE : TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldResizeDrawable_MesaSW(
- DGL_ctx *ctx,
- BOOL bDefaultDriver,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- WMesaContext *c;
-
- if (ctx == NULL)
- return FALSE;
-
- c = ctx->glPriv;
- if (c == NULL)
- return FALSE;
-
- c->hDC = ctx->hDC;
- c->Window = ctx->hWnd;
-// c->width = ctx->dwWidth;
-// c->height = ctx->dwHeight;
-
- if (c->db_flag) {
- wmDeleteBackingStore(c);
- wmCreateBackingStore(c, ctx->dwWidth, ctx->dwHeight);
- }
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyDrawable_MesaSW(
- DGL_ctx *ctx)
-{
- WMesaContext *c;
-
- if (ctx == NULL)
- return FALSE;
-
- c = ctx->glPriv;
- if (c == NULL)
- return FALSE;
-
- if (c->hPalHalfTone != NULL)
- DeleteObject(c->hPalHalfTone);
-
- if (c->db_flag)
- wmDeleteBackingStore(c);
-
- free(c);
-
- ctx->glPriv = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldCreatePrivateGlobals_MesaSW(void)
-{
- // Mesa Software driver needs no private globals
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyPrivateGlobals_MesaSW(void)
-{
- // Mesa Software driver needs no private globals
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldBuildPixelformatList_MesaSW(void)
-{
- // Release any existing pixelformat list
- if (glb.lpPF) {
- free(glb.lpPF);
- }
-
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL;
-
- glb.lpPF = (DGL_pixelFormat *)calloc(2, sizeof(DGL_pixelFormat));
- if (glb.lpPF == NULL)
- return FALSE;
- // Single-buffered
- memcpy(&glb.lpPF[0], &pfTemplateMesaSW, sizeof(DGL_pixelFormat));
- glb.lpPF[0].pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- // Double-buffered
- memcpy(&glb.lpPF[1], &pfTemplateMesaSW, sizeof(DGL_pixelFormat));
- glb.nPixelFormatCount = 2;
-
- // Mark list as 'current'
- glb.bPixelformatsDirty = FALSE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldInitialiseMesa_MesaSW(
- DGL_ctx *gld)
-{
- struct gl_context *ctx;
-
- if (gld == NULL)
- return FALSE;
-
- ctx = gld->glCtx;
-
- // Set max texture size to 256
- ctx->Const.MaxTextureLevels = 8;
-
- // Multitexture enable/disable
- ctx->Const.MaxTextureUnits = (glb.bMultitexture) ? MAX_TEXTURE_UNITS : 1;
-
- /* Initialize the software rasterizer and helper modules.*/
-
- // Added this to force max texture diminsion to 256. KeithH
- ctx->Const.MaxTextureLevels = 8;
- ctx->Const.MaxDrawBuffers = 1;
-
- _mesa_enable_sw_extensions(ctx);
- _mesa_enable_imaging_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
-
-// _swrast_CreateContext( ctx );
-// _vbo_CreateContext( ctx );
-// _tnl_CreateContext( ctx );
-// _swsetup_CreateContext( ctx );
-
- _swsetup_Wakeup( ctx );
-
- wmesa_update_state_first_time(ctx, ~0);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldSwapBuffers_MesaSW(
- DGL_ctx *ctx,
- HDC hDC,
- HWND hWnd)
-{
- WMesaContext *c;
-
- if (ctx == NULL)
- return FALSE;
-
- c = ctx->glPriv;
- if (c == NULL)
- return FALSE;
-
- /* If we're swapping the buffer associated with the current context
- * we have to flush any pending rendering commands first.
- */
-
- // Altered to respect bEmulateSingleBuffer. KeithH
-// if (c->db_flag)
- if (!c->bEmulateSingleBuffer)
- wmFlush(c, hDC);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_MesaSW(
- LPCSTR a)
-{
- int i;
- PROC proc = NULL;
-
- for (i=0; GLD_extList[i].proc; i++) {
- if (!strcmp(a, GLD_extList[i].name)) {
- proc = GLD_extList[i].proc;
- break;
- }
- }
-
- gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
-
- return proc;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldGetDisplayMode_MesaSW(
- DGL_ctx *ctx,
- GLD_displayMode *glddm)
-{
- HDC hdcDesktop;
-
- if (glddm == NULL)
- return FALSE;
-
- //
- // A bit hacky... KeithH
- //
-
- hdcDesktop = GetDC(NULL);
- glddm->Width = GetDeviceCaps(hdcDesktop, HORZRES);
- glddm->Height = GetDeviceCaps(hdcDesktop, VERTRES);
- glddm->BPP = GetDeviceCaps(hdcDesktop, BITSPIXEL);
- glddm->Refresh = 0;
- ReleaseDC(0, hdcDesktop);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/opengl32.def b/mesalib/src/mesa/drivers/windows/gldirect/opengl32.def
deleted file mode 100644
index b213b6e04..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/opengl32.def
+++ /dev/null
@@ -1,488 +0,0 @@
-;****************************************************************************
-;*
-;* Mesa 3-D graphics library
-;* Direct3D Driver Interface
-;*
-;* ========================================================================
-;*
-;* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-;* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-;* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-;* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-;* SOFTWARE.
-;*
-;* ======================================================================
-;*
-;* Language: ANSI C
-;* Environment: Windows 9x/2000/XP/XBox (Win32)
-;*
-;* Description: DLL Module definition file
-;*
-;****************************************************************************/
-
-DESCRIPTION 'GLDirect'
-
-VERSION 3.0
-
-EXPORTS
- glAccum=glAccum @1
- glAlphaFunc=glAlphaFunc @2
- glAreTexturesResident=glAreTexturesResident @3
- glArrayElement=glArrayElement @4
- glBegin=glBegin @5
- glBindTexture=glBindTexture @6
- glBitmap=glBitmap @7
- glBlendFunc=glBlendFunc @8
- glCallList=glCallList @9
- glCallLists=glCallLists @10
- glClear=glClear @11
- glClearAccum=glClearAccum @12
- glClearIndex=glClearIndex @13
- glClearColor=glClearColor @14
- glClearDepth=glClearDepth @15
- glClearStencil=glClearStencil @16
- glClipPlane=glClipPlane @17
- glColor3b=glColor3b @18
- glColor3d=glColor3d @19
- glColor3f=glColor3f @20
- glColor3i=glColor3i @21
- glColor3s=glColor3s @22
- glColor3ub=glColor3ub @23
- glColor3ui=glColor3ui @24
- glColor3us=glColor3us @25
- glColor4b=glColor4b @26
- glColor4d=glColor4d @27
- glColor4f=glColor4f @28
- glColor4i=glColor4i @29
- glColor4s=glColor4s @30
- glColor4ub=glColor4ub @31
- glColor4ui=glColor4ui @32
- glColor4us=glColor4us @33
- glColor3bv=glColor3bv @34
- glColor3dv=glColor3dv @35
- glColor3fv=glColor3fv @36
- glColor3iv=glColor3iv @37
- glColor3sv=glColor3sv @38
- glColor3ubv=glColor3ubv @39
- glColor3uiv=glColor3uiv @40
- glColor3usv=glColor3usv @41
- glColor4bv=glColor4bv @42
- glColor4dv=glColor4dv @43
- glColor4fv=glColor4fv @44
- glColor4iv=glColor4iv @45
- glColor4sv=glColor4sv @46
- glColor4ubv=glColor4ubv @47
- glColor4uiv=glColor4uiv @48
- glColor4usv=glColor4usv @49
- glColorMask=glColorMask @50
- glColorMaterial=glColorMaterial @51
- glColorPointer=glColorPointer @52
- glColorTableEXT=glColorTableEXT @53
- glColorSubTableEXT=glColorSubTableEXT @54
- glCopyPixels=glCopyPixels @55
- glCopyTexImage1D=glCopyTexImage1D @56
- glCopyTexImage2D=glCopyTexImage2D @57
- glCopyTexSubImage1D=glCopyTexSubImage1D @58
- glCopyTexSubImage2D=glCopyTexSubImage2D @59
- glCullFace=glCullFace @60
- glDepthFunc=glDepthFunc @61
- glDepthMask=glDepthMask @62
- glDepthRange=glDepthRange @63
- glDeleteLists=glDeleteLists @64
- glDeleteTextures=glDeleteTextures @65
- glDisable=glDisable @66
- glDisableClientState=glDisableClientState @67
- glDrawArrays=glDrawArrays @68
- glDrawBuffer=glDrawBuffer @69
- glDrawElements=glDrawElements @70
- glDrawPixels=glDrawPixels @71
- glEnable=glEnable @72
- glEnableClientState=glEnableClientState @73
- glEnd=glEnd @74
- glEndList=glEndList @75
- glEvalCoord1d=glEvalCoord1d @76
- glEvalCoord1f=glEvalCoord1f @77
- glEvalCoord1dv=glEvalCoord1dv @78
- glEvalCoord1fv=glEvalCoord1fv @79
- glEvalCoord2d=glEvalCoord2d @80
- glEvalCoord2f=glEvalCoord2f @81
- glEvalCoord2dv=glEvalCoord2dv @82
- glEvalCoord2fv=glEvalCoord2fv @83
- glEvalPoint1=glEvalPoint1 @84
- glEvalPoint2=glEvalPoint2 @85
- glEvalMesh1=glEvalMesh1 @86
- glEdgeFlag=glEdgeFlag @87
- glEdgeFlagv=glEdgeFlagv @88
- glEdgeFlagPointer=glEdgeFlagPointer @89
- glEvalMesh2=glEvalMesh2 @90
- glFeedbackBuffer=glFeedbackBuffer @91
- glFinish=glFinish @92
- glFlush=glFlush @93
- glFogf=glFogf @94
- glFogi=glFogi @95
- glFogfv=glFogfv @96
- glFogiv=glFogiv @97
- glFrontFace=glFrontFace @98
- glFrustum=glFrustum @99
- glGenLists=glGenLists @100
- glGenTextures=glGenTextures @101
- glGetBooleanv=glGetBooleanv @102
- glGetClipPlane=glGetClipPlane @103
- glGetColorTableEXT=glGetColorTableEXT @104
- glGetColorTableParameterivEXT=glGetColorTableParameterivEXT @105
- glGetColorTableParameterfvEXT=glGetColorTableParameterfvEXT @106
- glGetDoublev=glGetDoublev @107
- glGetError=glGetError @108
- glGetFloatv=glGetFloatv @109
- glGetIntegerv=glGetIntegerv @110
- glGetLightfv=glGetLightfv @111
- glGetLightiv=glGetLightiv @112
- glGetMapdv=glGetMapdv @113
- glGetMapfv=glGetMapfv @114
- glGetMapiv=glGetMapiv @115
- glGetMaterialfv=glGetMaterialfv @116
- glGetMaterialiv=glGetMaterialiv @117
- glGetPixelMapfv=glGetPixelMapfv @118
- glGetPixelMapuiv=glGetPixelMapuiv @119
- glGetPixelMapusv=glGetPixelMapusv @120
- glGetPointerv=glGetPointerv @121
- glGetPolygonStipple=glGetPolygonStipple @122
- glGetString=glGetString @123
- glGetTexEnvfv=glGetTexEnvfv @124
- glGetTexEnviv=glGetTexEnviv @125
- glGetTexGeniv=glGetTexGeniv @126
- glGetTexGendv=glGetTexGendv @127
- glGetTexGenfv=glGetTexGenfv @128
- glGetTexImage=glGetTexImage @129
- glGetTexLevelParameterfv=glGetTexLevelParameterfv @130
- glGetTexLevelParameteriv=glGetTexLevelParameteriv @131
- glGetTexParameterfv=glGetTexParameterfv @132
- glGetTexParameteriv=glGetTexParameteriv @133
- glHint=glHint @134
- glIndexd=glIndexd @135
- glIndexf=glIndexf @136
- glIndexi=glIndexi @137
- glIndexs=glIndexs @138
- glIndexub=glIndexub @139
- glIndexdv=glIndexdv @140
- glIndexfv=glIndexfv @141
- glIndexiv=glIndexiv @142
- glIndexsv=glIndexsv @143
- glIndexubv=glIndexubv @144
- glIndexMask=glIndexMask @145
- glIndexPointer=glIndexPointer @146
- glInterleavedArrays=glInterleavedArrays @147
- glInitNames=glInitNames @148
- glIsList=glIsList @149
- glIsTexture=glIsTexture @150
- glLightf=glLightf @151
- glLighti=glLighti @152
- glLightfv=glLightfv @153
- glLightiv=glLightiv @154
- glLightModelf=glLightModelf @155
- glLightModeli=glLightModeli @156
- glLightModelfv=glLightModelfv @157
- glLightModeliv=glLightModeliv @158
- glLineWidth=glLineWidth @159
- glLineStipple=glLineStipple @160
- glListBase=glListBase @161
- glLoadIdentity=glLoadIdentity @162
- glLoadMatrixd=glLoadMatrixd @163
- glLoadMatrixf=glLoadMatrixf @164
- glLoadName=glLoadName @165
- glLogicOp=glLogicOp @166
- glMap1d=glMap1d @167
- glMap1f=glMap1f @168
- glMap2d=glMap2d @169
- glMap2f=glMap2f @170
- glMapGrid1d=glMapGrid1d @171
- glMapGrid1f=glMapGrid1f @172
- glMapGrid2d=glMapGrid2d @173
- glMapGrid2f=glMapGrid2f @174
- glMaterialf=glMaterialf @175
- glMateriali=glMateriali @176
- glMaterialfv=glMaterialfv @177
- glMaterialiv=glMaterialiv @178
- glMatrixMode=glMatrixMode @179
- glMultMatrixd=glMultMatrixd @180
- glMultMatrixf=glMultMatrixf @181
- glNewList=glNewList @182
- glNormal3b=glNormal3b @183
- glNormal3d=glNormal3d @184
- glNormal3f=glNormal3f @185
- glNormal3i=glNormal3i @186
- glNormal3s=glNormal3s @187
- glNormal3bv=glNormal3bv @188
- glNormal3dv=glNormal3dv @189
- glNormal3fv=glNormal3fv @190
- glNormal3iv=glNormal3iv @191
- glNormal3sv=glNormal3sv @192
- glNormalPointer=glNormalPointer @193
- glOrtho=glOrtho @194
- glPassThrough=glPassThrough @195
- glPixelMapfv=glPixelMapfv @196
- glPixelMapuiv=glPixelMapuiv @197
- glPixelMapusv=glPixelMapusv @198
- glPixelStoref=glPixelStoref @199
- glPixelStorei=glPixelStorei @200
- glPixelTransferf=glPixelTransferf @201
- glPixelTransferi=glPixelTransferi @202
- glPixelZoom=glPixelZoom @203
- glPointSize=glPointSize @204
- glPolygonMode=glPolygonMode @205
- glPolygonOffset=glPolygonOffset @206
- glPolygonOffsetEXT=glPolygonOffsetEXT @207
- glPolygonStipple=glPolygonStipple @208
- glPopAttrib=glPopAttrib @209
- glPopClientAttrib=glPopClientAttrib @210
- glPopMatrix=glPopMatrix @211
- glPopName=glPopName @212
- glPrioritizeTextures=glPrioritizeTextures @213
- glPushMatrix=glPushMatrix @214
- glRasterPos2d=glRasterPos2d @215
- glRasterPos2f=glRasterPos2f @216
- glRasterPos2i=glRasterPos2i @217
- glRasterPos2s=glRasterPos2s @218
- glRasterPos3d=glRasterPos3d @219
- glRasterPos3f=glRasterPos3f @220
- glRasterPos3i=glRasterPos3i @221
- glRasterPos3s=glRasterPos3s @222
- glRasterPos4d=glRasterPos4d @223
- glRasterPos4f=glRasterPos4f @224
- glRasterPos4i=glRasterPos4i @225
- glRasterPos4s=glRasterPos4s @226
- glRasterPos2dv=glRasterPos2dv @227
- glRasterPos2fv=glRasterPos2fv @228
- glRasterPos2iv=glRasterPos2iv @229
- glRasterPos2sv=glRasterPos2sv @230
- glRasterPos3dv=glRasterPos3dv @231
- glRasterPos3fv=glRasterPos3fv @232
- glRasterPos3iv=glRasterPos3iv @233
- glRasterPos3sv=glRasterPos3sv @234
- glRasterPos4dv=glRasterPos4dv @235
- glRasterPos4fv=glRasterPos4fv @236
- glRasterPos4iv=glRasterPos4iv @237
- glRasterPos4sv=glRasterPos4sv @238
- glReadBuffer=glReadBuffer @239
- glReadPixels=glReadPixels @240
- glRectd=glRectd @241
- glRectf=glRectf @242
- glRecti=glRecti @243
- glRects=glRects @244
- glRectdv=glRectdv @245
- glRectfv=glRectfv @246
- glRectiv=glRectiv @247
- glRectsv=glRectsv @248
- glScissor=glScissor @249
- glIsEnabled=glIsEnabled @250
- glPushAttrib=glPushAttrib @251
- glPushClientAttrib=glPushClientAttrib @252
- glPushName=glPushName @253
- glRenderMode=glRenderMode @254
- glRotated=glRotated @255
- glRotatef=glRotatef @256
- glSelectBuffer=glSelectBuffer @257
- glScaled=glScaled @258
- glScalef=glScalef @259
- glShadeModel=glShadeModel @260
- glStencilFunc=glStencilFunc @261
- glStencilMask=glStencilMask @262
- glStencilOp=glStencilOp @263
- glTexCoord1d=glTexCoord1d @264
- glTexCoord1f=glTexCoord1f @265
- glTexCoord1i=glTexCoord1i @266
- glTexCoord1s=glTexCoord1s @267
- glTexCoord2d=glTexCoord2d @268
- glTexCoord2f=glTexCoord2f @269
- glTexCoord2i=glTexCoord2i @270
- glTexCoord2s=glTexCoord2s @271
- glTexCoord3d=glTexCoord3d @272
- glTexCoord3f=glTexCoord3f @273
- glTexCoord3i=glTexCoord3i @274
- glTexCoord3s=glTexCoord3s @275
- glTexCoord4d=glTexCoord4d @276
- glTexCoord4f=glTexCoord4f @277
- glTexCoord4i=glTexCoord4i @278
- glTexCoord4s=glTexCoord4s @279
- glTexCoord1dv=glTexCoord1dv @280
- glTexCoord1fv=glTexCoord1fv @281
- glTexCoord1iv=glTexCoord1iv @282
- glTexCoord1sv=glTexCoord1sv @283
- glTexCoord2dv=glTexCoord2dv @284
- glTexCoord2fv=glTexCoord2fv @285
- glTexCoord2iv=glTexCoord2iv @286
- glTexCoord2sv=glTexCoord2sv @287
- glTexCoord3dv=glTexCoord3dv @288
- glTexCoord3fv=glTexCoord3fv @289
- glTexCoord3iv=glTexCoord3iv @290
- glTexCoord3sv=glTexCoord3sv @291
- glTexCoord4dv=glTexCoord4dv @292
- glTexCoord4fv=glTexCoord4fv @293
- glTexCoord4iv=glTexCoord4iv @294
- glTexCoord4sv=glTexCoord4sv @295
- glTexCoordPointer=glTexCoordPointer @296
- glTexGend=glTexGend @297
- glTexGenf=glTexGenf @298
- glTexGeni=glTexGeni @299
- glTexGendv=glTexGendv @300
- glTexGeniv=glTexGeniv @301
- glTexGenfv=glTexGenfv @302
- glTexEnvf=glTexEnvf @303
- glTexEnvi=glTexEnvi @304
- glTexEnvfv=glTexEnvfv @305
- glTexEnviv=glTexEnviv @306
- glTexImage1D=glTexImage1D @307
- glTexImage2D=glTexImage2D @308
- glTexParameterf=glTexParameterf @309
- glTexParameteri=glTexParameteri @310
- glTexParameterfv=glTexParameterfv @311
- glTexParameteriv=glTexParameteriv @312
- glTexSubImage1D=glTexSubImage1D @313
- glTexSubImage2D=glTexSubImage2D @314
- glTranslated=glTranslated @315
- glTranslatef=glTranslatef @316
- glVertex2d=glVertex2d @317
- glVertex2f=glVertex2f @318
- glVertex2i=glVertex2i @319
- glVertex2s=glVertex2s @320
- glVertex3d=glVertex3d @321
- glVertex3f=glVertex3f @322
- glVertex3i=glVertex3i @323
- glVertex3s=glVertex3s @324
- glVertex4d=glVertex4d @325
- glVertex4f=glVertex4f @326
- glVertex4i=glVertex4i @327
- glVertex4s=glVertex4s @328
- glVertex2dv=glVertex2dv @329
- glVertex2fv=glVertex2fv @330
- glVertex2iv=glVertex2iv @331
- glVertex2sv=glVertex2sv @332
- glVertex3dv=glVertex3dv @333
- glVertex3fv=glVertex3fv @334
- glVertex3iv=glVertex3iv @335
- glVertex3sv=glVertex3sv @336
- glVertex4dv=glVertex4dv @337
- glVertex4fv=glVertex4fv @338
- glVertex4iv=glVertex4iv @339
- glVertex4sv=glVertex4sv @340
- glVertexPointer=glVertexPointer @341
- glViewport=glViewport @342
- glBlendEquationEXT=glBlendEquationEXT @343
- glBlendColorEXT=glBlendColorEXT @344
- glVertexPointerEXT=glVertexPointerEXT @345
- glNormalPointerEXT=glNormalPointerEXT @346
- glColorPointerEXT=glColorPointerEXT @347
- glIndexPointerEXT=glIndexPointerEXT @348
- glTexCoordPointerEXT=glTexCoordPointerEXT @349
- glEdgeFlagPointerEXT=glEdgeFlagPointerEXT @350
- glGetPointervEXT=glGetPointervEXT @351
- glArrayElementEXT=glArrayElementEXT @352
- glDrawArraysEXT=glDrawArraysEXT @353
- glBindTextureEXT=glBindTextureEXT @354
- glDeleteTexturesEXT=glDeleteTexturesEXT @355
- glGenTexturesEXT=glGenTexturesEXT @356
- glPrioritizeTexturesEXT=glPrioritizeTexturesEXT @357
- glCopyTexSubImage3DEXT=glCopyTexSubImage3DEXT @358
- glTexImage3DEXT=glTexImage3DEXT @359
- glTexSubImage3DEXT=glTexSubImage3DEXT @360
- glWindowPos4fMESA=glWindowPos4fMESA @361
- glWindowPos2iMESA=glWindowPos2iMESA @362
- glWindowPos2sMESA=glWindowPos2sMESA @363
- glWindowPos2fMESA=glWindowPos2fMESA @364
- glWindowPos2dMESA=glWindowPos2dMESA @365
- glWindowPos2ivMESA=glWindowPos2ivMESA @366
- glWindowPos2svMESA=glWindowPos2svMESA @367
- glWindowPos2fvMESA=glWindowPos2fvMESA @368
- glWindowPos2dvMESA=glWindowPos2dvMESA @369
- glWindowPos3iMESA=glWindowPos3iMESA @370
- glWindowPos3sMESA=glWindowPos3sMESA @371
- glWindowPos3fMESA=glWindowPos3fMESA @372
- glWindowPos3dMESA=glWindowPos3dMESA @373
- glWindowPos3ivMESA=glWindowPos3ivMESA @374
- glWindowPos3svMESA=glWindowPos3svMESA @375
- glWindowPos3fvMESA=glWindowPos3fvMESA @376
- glWindowPos3dvMESA=glWindowPos3dvMESA @377
- glWindowPos4iMESA=glWindowPos4iMESA @378
- glWindowPos4sMESA=glWindowPos4sMESA @379
- glWindowPos4dMESA=glWindowPos4dMESA @380
- glWindowPos4ivMESA=glWindowPos4ivMESA @381
- glWindowPos4svMESA=glWindowPos4svMESA @382
- glWindowPos4fvMESA=glWindowPos4fvMESA @383
- glWindowPos4dvMESA=glWindowPos4dvMESA @384
- glResizeBuffersMESA=glResizeBuffersMESA @385
- wglCopyContext=wglCopyContext @386
- wglCreateContext=wglCreateContext @387
- wglCreateLayerContext=wglCreateLayerContext @388
- wglDeleteContext=wglDeleteContext @389
- wglDescribeLayerPlane=wglDescribeLayerPlane @390
- wglGetCurrentContext=wglGetCurrentContext @391
- wglGetCurrentDC=wglGetCurrentDC @392
- wglGetLayerPaletteEntries=wglGetLayerPaletteEntries @393
- wglGetProcAddress=wglGetProcAddress @394
- wglMakeCurrent=wglMakeCurrent @395
- wglRealizeLayerPalette=wglRealizeLayerPalette @396
- wglSetLayerPaletteEntries=wglSetLayerPaletteEntries @397
- wglShareLists=wglShareLists @398
- wglSwapLayerBuffers=wglSwapLayerBuffers @399
- wglUseFontBitmapsA=wglUseFontBitmapsA @400
- wglUseFontBitmapsW=wglUseFontBitmapsW @401
- wglUseFontOutlinesA=wglUseFontOutlinesA @402
- wglUseFontOutlinesW=wglUseFontOutlinesW @403
- ChoosePixelFormat=ChoosePixelFormat @404
- DescribePixelFormat=DescribePixelFormat @405
- GetPixelFormat=GetPixelFormat @406
- SetPixelFormat=SetPixelFormat @407
- SwapBuffers=SwapBuffers @408
- wglChoosePixelFormat=wglChoosePixelFormat @409
- wglDescribePixelFormat=wglDescribePixelFormat @410
- wglGetPixelFormat=wglGetPixelFormat @411
- wglSetPixelFormat=wglSetPixelFormat @412
- wglSwapBuffers=wglSwapBuffers @413
- glActiveTextureARB=glActiveTextureARB @414
- glClientActiveTextureARB=glClientActiveTextureARB @415
- glMultiTexCoord1dARB=glMultiTexCoord1dARB @416
- glMultiTexCoord1dvARB=glMultiTexCoord1dvARB @417
- glMultiTexCoord1fARB=glMultiTexCoord1fARB @418
- glMultiTexCoord1fvARB=glMultiTexCoord1fvARB @419
- glMultiTexCoord1iARB=glMultiTexCoord1iARB @420
- glMultiTexCoord1ivARB=glMultiTexCoord1ivARB @421
- glMultiTexCoord1sARB=glMultiTexCoord1sARB @422
- glMultiTexCoord1svARB=glMultiTexCoord1svARB @423
- glMultiTexCoord2dARB=glMultiTexCoord2dARB @424
- glMultiTexCoord2dvARB=glMultiTexCoord2dvARB @425
- glMultiTexCoord2fARB=glMultiTexCoord2fARB @426
- glMultiTexCoord2fvARB=glMultiTexCoord2fvARB @427
- glMultiTexCoord2iARB=glMultiTexCoord2iARB @428
- glMultiTexCoord2ivARB=glMultiTexCoord2ivARB @429
- glMultiTexCoord2sARB=glMultiTexCoord2sARB @430
- glMultiTexCoord2svARB=glMultiTexCoord2svARB @431
- glMultiTexCoord3dARB=glMultiTexCoord3dARB @432
- glMultiTexCoord3dvARB=glMultiTexCoord3dvARB @433
- glMultiTexCoord3fARB=glMultiTexCoord3fARB @434
- glMultiTexCoord3fvARB=glMultiTexCoord3fvARB @435
- glMultiTexCoord3iARB=glMultiTexCoord3iARB @436
- glMultiTexCoord3ivARB=glMultiTexCoord3ivARB @437
- glMultiTexCoord3sARB=glMultiTexCoord3sARB @438
- glMultiTexCoord3svARB=glMultiTexCoord3svARB @439
- glMultiTexCoord4dARB=glMultiTexCoord4dARB @440
- glMultiTexCoord4dvARB=glMultiTexCoord4dvARB @441
- glMultiTexCoord4fARB=glMultiTexCoord4fARB @442
- glMultiTexCoord4fvARB=glMultiTexCoord4fvARB @443
- glMultiTexCoord4iARB=glMultiTexCoord4iARB @444
- glMultiTexCoord4ivARB=glMultiTexCoord4ivARB @445
- glMultiTexCoord4sARB=glMultiTexCoord4sARB @446
- glMultiTexCoord4svARB=glMultiTexCoord4svARB @447
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref b/mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref
deleted file mode 100644
index 3a4933e54..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref
+++ /dev/null
@@ -1,495 +0,0 @@
-;****************************************************************************
-;*
-;* Mesa 3-D graphics library
-;* Direct3D Driver Interface
-;*
-;* ========================================================================
-;*
-;* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-;* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-;* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-;* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-;* SOFTWARE.
-;*
-;* ======================================================================
-;*
-;* Language: ANSI C
-;* Environment: Windows 9x/2000/XP/XBox (Win32)
-;*
-;* Description: DLL Module definition file
-;*
-;****************************************************************************/
-
-DESCRIPTION 'GLDirect'
-
-VERSION 3.0
-
-EXPORTS
- glAccum
- glAlphaFunc
- glAreTexturesResident
- glArrayElement
- glBegin
- glBindTexture
- glBitmap
- glBlendFunc
- glCallList
- glCallLists
- glClear
- glClearAccum
- glClearIndex
- glClearColor
- glClearDepth
- glClearStencil
- glClipPlane
- glColor3b
- glColor3d
- glColor3f
- glColor3i
- glColor3s
- glColor3ub
- glColor3ui
- glColor3us
- glColor4b
- glColor4d
- glColor4f
- glColor4i
- glColor4s
- glColor4ub
- glColor4ui
- glColor4us
- glColor3bv
- glColor3dv
- glColor3fv
- glColor3iv
- glColor3sv
- glColor3ubv
- glColor3uiv
- glColor3usv
- glColor4bv
- glColor4dv
- glColor4fv
- glColor4iv
- glColor4sv
- glColor4ubv
- glColor4uiv
- glColor4usv
- glColorMask
- glColorMaterial
- glColorPointer
- glColorTableEXT
- glColorSubTableEXT
- glCopyPixels
- glCopyTexImage1D
- glCopyTexImage2D
- glCopyTexSubImage1D
- glCopyTexSubImage2D
- glCullFace
- glDepthFunc
- glDepthMask
- glDepthRange
- glDeleteLists
- glDeleteTextures
- glDisable
- glDisableClientState
- glDrawArrays
- glDrawBuffer
- glDrawElements
- glDrawPixels
- glEnable
- glEnableClientState
- glEnd
- glEndList
- glEvalCoord1d
- glEvalCoord1f
- glEvalCoord1dv
- glEvalCoord1fv
- glEvalCoord2d
- glEvalCoord2f
- glEvalCoord2dv
- glEvalCoord2fv
- glEvalPoint1
- glEvalPoint2
- glEvalMesh1
- glEdgeFlag
- glEdgeFlagv
- glEdgeFlagPointer
- glEvalMesh2
- glFeedbackBuffer
- glFinish
- glFlush
- glFogf
- glFogi
- glFogfv
- glFogiv
- glFrontFace
- glFrustum
- glGenLists
- glGenTextures
- glGetBooleanv
- glGetClipPlane
- glGetColorTableEXT
- glGetColorTableParameterivEXT
- glGetColorTableParameterfvEXT
- glGetDoublev
- glGetError
- glGetFloatv
- glGetIntegerv
- glGetLightfv
- glGetLightiv
- glGetMapdv
- glGetMapfv
- glGetMapiv
- glGetMaterialfv
- glGetMaterialiv
- glGetPixelMapfv
- glGetPixelMapuiv
- glGetPixelMapusv
- glGetPointerv
- glGetPolygonStipple
- glGetString
- glGetTexEnvfv
- glGetTexEnviv
- glGetTexGeniv
- glGetTexGendv
- glGetTexGenfv
- glGetTexImage
- glGetTexLevelParameterfv
- glGetTexLevelParameteriv
- glGetTexParameterfv
- glGetTexParameteriv
- glHint
- glIndexd
- glIndexf
- glIndexi
- glIndexs
- glIndexub
- glIndexdv
- glIndexfv
- glIndexiv
- glIndexsv
- glIndexubv
- glIndexMask
- glIndexPointer
- glInterleavedArrays
- glInitNames
- glIsList
- glIsTexture
- glLightf
- glLighti
- glLightfv
- glLightiv
- glLightModelf
- glLightModeli
- glLightModelfv
- glLightModeliv
- glLineWidth
- glLineStipple
- glListBase
- glLoadIdentity
- glLoadMatrixd
- glLoadMatrixf
- glLoadName
- glLogicOp
- glMap1d
- glMap1f
- glMap2d
- glMap2f
- glMapGrid1d
- glMapGrid1f
- glMapGrid2d
- glMapGrid2f
- glMaterialf
- glMateriali
- glMaterialfv
- glMaterialiv
- glMatrixMode
- glMultMatrixd
- glMultMatrixf
- glNewList
- glNormal3b
- glNormal3d
- glNormal3f
- glNormal3i
- glNormal3s
- glNormal3bv
- glNormal3dv
- glNormal3fv
- glNormal3iv
- glNormal3sv
- glNormalPointer
- glOrtho
- glPassThrough
- glPixelMapfv
- glPixelMapuiv
- glPixelMapusv
- glPixelStoref
- glPixelStorei
- glPixelTransferf
- glPixelTransferi
- glPixelZoom
- glPointSize
- glPolygonMode
- glPolygonOffset
- glPolygonOffsetEXT
- glPolygonStipple
- glPopAttrib
- glPopClientAttrib
- glPopMatrix
- glPopName
- glPrioritizeTextures
- glPushMatrix
- glRasterPos2d
- glRasterPos2f
- glRasterPos2i
- glRasterPos2s
- glRasterPos3d
- glRasterPos3f
- glRasterPos3i
- glRasterPos3s
- glRasterPos4d
- glRasterPos4f
- glRasterPos4i
- glRasterPos4s
- glRasterPos2dv
- glRasterPos2fv
- glRasterPos2iv
- glRasterPos2sv
- glRasterPos3dv
- glRasterPos3fv
- glRasterPos3iv
- glRasterPos3sv
- glRasterPos4dv
- glRasterPos4fv
- glRasterPos4iv
- glRasterPos4sv
- glReadBuffer
- glReadPixels
- glRectd
- glRectf
- glRecti
- glRects
- glRectdv
- glRectfv
- glRectiv
- glRectsv
- glScissor
- glIsEnabled
- glPushAttrib
- glPushClientAttrib
- glPushName
- glRenderMode
- glRotated
- glRotatef
- glSelectBuffer
- glScaled
- glScalef
- glShadeModel
- glStencilFunc
- glStencilMask
- glStencilOp
- glTexCoord1d
- glTexCoord1f
- glTexCoord1i
- glTexCoord1s
- glTexCoord2d
- glTexCoord2f
- glTexCoord2i
- glTexCoord2s
- glTexCoord3d
- glTexCoord3f
- glTexCoord3i
- glTexCoord3s
- glTexCoord4d
- glTexCoord4f
- glTexCoord4i
- glTexCoord4s
- glTexCoord1dv
- glTexCoord1fv
- glTexCoord1iv
- glTexCoord1sv
- glTexCoord2dv
- glTexCoord2fv
- glTexCoord2iv
- glTexCoord2sv
- glTexCoord3dv
- glTexCoord3fv
- glTexCoord3iv
- glTexCoord3sv
- glTexCoord4dv
- glTexCoord4fv
- glTexCoord4iv
- glTexCoord4sv
- glTexCoordPointer
- glTexGend
- glTexGenf
- glTexGeni
- glTexGendv
- glTexGeniv
- glTexGenfv
- glTexEnvf
- glTexEnvi
- glTexEnvfv
- glTexEnviv
- glTexImage1D
- glTexImage2D
- glTexParameterf
- glTexParameteri
- glTexParameterfv
- glTexParameteriv
- glTexSubImage1D
- glTexSubImage2D
- glTranslated
- glTranslatef
- glVertex2d
- glVertex2f
- glVertex2i
- glVertex2s
- glVertex3d
- glVertex3f
- glVertex3i
- glVertex3s
- glVertex4d
- glVertex4f
- glVertex4i
- glVertex4s
- glVertex2dv
- glVertex2fv
- glVertex2iv
- glVertex2sv
- glVertex3dv
- glVertex3fv
- glVertex3iv
- glVertex3sv
- glVertex4dv
- glVertex4fv
- glVertex4iv
- glVertex4sv
- glVertexPointer
- glViewport
-
- glBlendEquationEXT
- glBlendColorEXT
- glVertexPointerEXT
- glNormalPointerEXT
- glColorPointerEXT
- glIndexPointerEXT
- glTexCoordPointerEXT
- glEdgeFlagPointerEXT
- glGetPointervEXT
- glArrayElementEXT
- glDrawArraysEXT
- glBindTextureEXT
- glDeleteTexturesEXT
- glGenTexturesEXT
- glPrioritizeTexturesEXT
- glCopyTexSubImage3DEXT
- glTexImage3DEXT
- glTexSubImage3DEXT
-
- glWindowPos4fMESA
- glWindowPos2iMESA
- glWindowPos2sMESA
- glWindowPos2fMESA
- glWindowPos2dMESA
- glWindowPos2ivMESA
- glWindowPos2svMESA
- glWindowPos2fvMESA
- glWindowPos2dvMESA
- glWindowPos3iMESA
- glWindowPos3sMESA
- glWindowPos3fMESA
- glWindowPos3dMESA
- glWindowPos3ivMESA
- glWindowPos3svMESA
- glWindowPos3fvMESA
- glWindowPos3dvMESA
- glWindowPos4iMESA
- glWindowPos4sMESA
- glWindowPos4dMESA
- glWindowPos4ivMESA
- glWindowPos4svMESA
- glWindowPos4fvMESA
- glWindowPos4dvMESA
- glResizeBuffersMESA
-
- wglCopyContext
- wglCreateContext
- wglCreateLayerContext
- wglDeleteContext
- wglDescribeLayerPlane
- wglGetCurrentContext
- wglGetCurrentDC
- wglGetLayerPaletteEntries
- wglGetProcAddress
- wglMakeCurrent
- wglRealizeLayerPalette
- wglSetLayerPaletteEntries
- wglShareLists
- wglSwapLayerBuffers
- wglUseFontBitmapsA
- wglUseFontBitmapsW
- wglUseFontOutlinesA
- wglUseFontOutlinesW
-
-;These functions are identical and therefore share the same addresses
- ChoosePixelFormat = wglChoosePixelFormat
- DescribePixelFormat = wglDescribePixelFormat
- GetPixelFormat = wglGetPixelFormat
- SetPixelFormat = wglSetPixelFormat
- SwapBuffers = wglSwapBuffers
-
- wglChoosePixelFormat
- wglDescribePixelFormat
- wglGetPixelFormat
- wglSetPixelFormat
- wglSwapBuffers
-
- glActiveTextureARB
- glClientActiveTextureARB
- glMultiTexCoord1dARB
- glMultiTexCoord1dvARB
- glMultiTexCoord1fARB
- glMultiTexCoord1fvARB
- glMultiTexCoord1iARB
- glMultiTexCoord1ivARB
- glMultiTexCoord1sARB
- glMultiTexCoord1svARB
- glMultiTexCoord2dARB
- glMultiTexCoord2dvARB
- glMultiTexCoord2fARB
- glMultiTexCoord2fvARB
- glMultiTexCoord2iARB
- glMultiTexCoord2ivARB
- glMultiTexCoord2sARB
- glMultiTexCoord2svARB
- glMultiTexCoord3dARB
- glMultiTexCoord3dvARB
- glMultiTexCoord3fARB
- glMultiTexCoord3fvARB
- glMultiTexCoord3iARB
- glMultiTexCoord3ivARB
- glMultiTexCoord3sARB
- glMultiTexCoord3svARB
- glMultiTexCoord4dARB
- glMultiTexCoord4dvARB
- glMultiTexCoord4fARB
- glMultiTexCoord4fvARB
- glMultiTexCoord4iARB
- glMultiTexCoord4ivARB
- glMultiTexCoord4sARB
- glMultiTexCoord4svARB
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/pixpack.h b/mesalib/src/mesa/drivers/windows/gldirect/pixpack.h
deleted file mode 100644
index ec848d455..000000000
--- a/mesalib/src/mesa/drivers/windows/gldirect/pixpack.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. 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
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Pixel packing functions.
-*
-****************************************************************************/
-
-#ifndef __PIXPACK_H
-#define __PIXPACK_H
-
-#include <GL\gl.h>
-#include <ddraw.h>
-
-#include "ddlog.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#define PXAPI
-
-// Typedef that can be used for pixel packing function pointers.
-#define PX_PACK_FUNC(a) void PXAPI (a)(unsigned char *pixdata, void *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2)
-typedef void (PXAPI *PX_packFunc)(unsigned char *pixdata, void *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2);
-
-// Typedef that can be used for pixel unpacking function pointers.
-#define PX_UNPACK_FUNC(a) void PXAPI (a)(unsigned char *pixdata, void *src, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2)
-typedef void (PXAPI *PX_unpackFunc)(unsigned char *pixdata, void *src, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2);
-
-// Typedef that can be used for pixel span packing function pointers.
-#define PX_PACK_SPAN_FUNC(a) void PXAPI (a)(GLuint n, unsigned char *pixdata, unsigned char *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2)
-typedef void (PXAPI *PX_packSpanFunc)(GLuint n, unsigned char *pixdata, unsigned char *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2);
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Function that examines a pixel format and returns the relevent
-// pixel-packing function
-void PXAPI pxClassifyPixelFormat(const LPDDPIXELFORMAT lpddpf, PX_packFunc *lpPackFn ,PX_unpackFunc *lpUnpackFn, PX_packSpanFunc *lpPackSpanFn);
-
-// Packing functions
-PX_PACK_FUNC(pxPackGeneric);
-PX_PACK_FUNC(pxPackRGB555);
-PX_PACK_FUNC(pxPackARGB4444);
-PX_PACK_FUNC(pxPackARGB1555);
-PX_PACK_FUNC(pxPackRGB565);
-PX_PACK_FUNC(pxPackRGB332);
-PX_PACK_FUNC(pxPackRGB888);
-PX_PACK_FUNC(pxPackARGB8888);
-PX_PACK_FUNC(pxPackPAL8);
-
-// Unpacking functions
-PX_UNPACK_FUNC(pxUnpackGeneric);
-PX_UNPACK_FUNC(pxUnpackRGB555);
-PX_UNPACK_FUNC(pxUnpackARGB4444);
-PX_UNPACK_FUNC(pxUnpackARGB1555);
-PX_UNPACK_FUNC(pxUnpackRGB565);
-PX_UNPACK_FUNC(pxUnpackRGB332);
-PX_UNPACK_FUNC(pxUnpackRGB888);
-PX_UNPACK_FUNC(pxUnpackARGB8888);
-PX_UNPACK_FUNC(pxUnpackPAL8);
-
-// Span Packing functions
-PX_PACK_SPAN_FUNC(pxPackSpanGeneric);
-PX_PACK_SPAN_FUNC(pxPackSpanRGB555);
-PX_PACK_SPAN_FUNC(pxPackSpanARGB4444);
-PX_PACK_SPAN_FUNC(pxPackSpanARGB1555);
-PX_PACK_SPAN_FUNC(pxPackSpanRGB565);
-PX_PACK_SPAN_FUNC(pxPackSpanRGB332);
-PX_PACK_SPAN_FUNC(pxPackSpanRGB888);
-PX_PACK_SPAN_FUNC(pxPackSpanARGB8888);
-PX_PACK_SPAN_FUNC(pxPackSpanPAL8);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/mesalib/src/mesa/drivers/windows/icd/icd.c b/mesalib/src/mesa/drivers/windows/icd/icd.c
deleted file mode 100644
index 4bc6176b1..000000000
--- a/mesalib/src/mesa/drivers/windows/icd/icd.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 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 name: icd.c
- * Author: Gregor Anich
- *
- * ICD (Installable Client Driver) interface.
- * Based on the windows GDI/WGL driver.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <windows.h>
-#define GL_GLEXT_PROTOTYPES
-#include "GL/gl.h"
-#include "GL/glext.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <stdio.h>
-#include <tchar.h>
-#include "GL/wmesa.h"
-#include "mtypes.h"
-#include "glapi.h"
-
-#define MAX_MESA_ATTRS 20
-
-typedef struct wmesa_context *PWMC;
-
-typedef struct _icdTable {
- DWORD size;
- PROC table[336];
-} ICDTABLE, *PICDTABLE;
-
-#ifdef USE_MGL_NAMESPACE
-# define GL_FUNC(func) mgl##func
-#else
-# define GL_FUNC(func) gl##func
-#endif
-
-static ICDTABLE icdTable = { 336, {
-#define ICD_ENTRY(func) (PROC)GL_FUNC(func),
-#include "icdlist.h"
-#undef ICD_ENTRY
-} };
-
-struct __pixelformat__
-{
- PIXELFORMATDESCRIPTOR pfd;
- GLboolean doubleBuffered;
-};
-
-struct __pixelformat__ pix[] =
-{
- /* Double Buffer, alpha */
- { { sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
- PFD_TYPE_RGBA,
- 24, 8, 0, 8, 8, 8, 16, 8, 24,
- 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
- GL_TRUE
- },
- /* Single Buffer, alpha */
- { { sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL, /* | PFD_SUPPORT_GDI ? */
- PFD_TYPE_RGBA,
- 24, 8, 0, 8, 8, 8, 16, 8, 24,
- 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
- GL_FALSE
- },
- /* Double Buffer, no alpha */
- { { sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
- PFD_TYPE_RGBA,
- 24, 8, 0, 8, 8, 8, 16, 0, 0,
- 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
- GL_TRUE
- },
- /* Single Buffer, no alpha */
- { { sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL, /* | PFD_SUPPORT_GDI ? */
- PFD_TYPE_RGBA,
- 24, 8, 0, 8, 8, 8, 16, 0, 0,
- 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
- GL_FALSE
- },
-};
-
-int qt_pix = sizeof(pix) / sizeof(pix[0]);
-
-typedef struct {
- WMesaContext ctx;
- HDC hdc;
-} MesaWglCtx;
-
-#define MESAWGL_CTX_MAX_COUNT 20
-
-static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT];
-
-static unsigned ctx_count = 0;
-static int ctx_current = -1;
-static unsigned curPFD = 0;
-
-WGLAPI BOOL GLAPIENTRY DrvCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask)
-{
- (void) hglrcSrc; (void) hglrcDst; (void) mask;
- return(FALSE);
-}
-
-WGLAPI HGLRC GLAPIENTRY DrvCreateContext(HDC hdc)
-{
- HWND hWnd;
- int i = 0;
-
- if(!(hWnd = WindowFromDC(hdc)))
- {
- SetLastError(0);
- return(NULL);
- }
- if (!ctx_count)
- {
- for(i=0;i<MESAWGL_CTX_MAX_COUNT;i++)
- {
- wgl_ctx[i].ctx = NULL;
- wgl_ctx[i].hdc = NULL;
- }
- }
- for( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )
- {
- if ( wgl_ctx[i].ctx == NULL )
- {
- wgl_ctx[i].ctx = WMesaCreateContext( hWnd, NULL, GL_TRUE,
- pix[curPFD-1].doubleBuffered,
- pix[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE);
- if (wgl_ctx[i].ctx == NULL)
- break;
- wgl_ctx[i].hdc = hdc;
- ctx_count++;
- return ((HGLRC)wgl_ctx[i].ctx);
- }
- }
- SetLastError(0);
- return(NULL);
-}
-
-WGLAPI BOOL GLAPIENTRY DrvDeleteContext(HGLRC hglrc)
-{
- int i;
- for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )
- {
- if ( wgl_ctx[i].ctx == (PWMC) hglrc )
- {
- WMesaMakeCurrent((PWMC) hglrc);
- WMesaDestroyContext();
- wgl_ctx[i].ctx = NULL;
- wgl_ctx[i].hdc = NULL;
- ctx_count--;
- return(TRUE);
- }
- }
- SetLastError(0);
- return(FALSE);
-}
-
-WGLAPI HGLRC GLAPIENTRY DrvCreateLayerContext(HDC hdc,int iLayerPlane)
-{
- if (iLayerPlane == 0)
- return DrvCreateContext(hdc);
- SetLastError(0);
- return(NULL);
-}
-
-WGLAPI PICDTABLE GLAPIENTRY DrvSetContext(HDC hdc,HGLRC hglrc,void *callback)
-{
- int i;
- (void) callback;
-
- /* new code suggested by Andy Sy */
- if (!hdc || !hglrc) {
- WMesaMakeCurrent(NULL);
- ctx_current = -1;
- return NULL;
- }
-
- for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )
- {
- if ( wgl_ctx[i].ctx == (PWMC) hglrc )
- {
- wgl_ctx[i].hdc = hdc;
- WMesaMakeCurrent( (PWMC) hglrc );
- ctx_current = i;
- return &icdTable;
- }
- }
- return NULL;
-}
-
-WGLAPI void GLAPIENTRY DrvReleaseContext(HGLRC hglrc)
-{
- (void) hglrc;
- WMesaMakeCurrent(NULL);
- ctx_current = -1;
-}
-
-WGLAPI BOOL GLAPIENTRY DrvShareLists(HGLRC hglrc1,HGLRC hglrc2)
-{
- (void) hglrc1; (void) hglrc2;
- return(TRUE);
-}
-
-WGLAPI BOOL GLAPIENTRY DrvDescribeLayerPlane(HDC hdc,int iPixelFormat,
- int iLayerPlane,UINT nBytes,
- LPLAYERPLANEDESCRIPTOR plpd)
-{
- (void) hdc; (void) iPixelFormat; (void) iLayerPlane; (void) nBytes; (void) plpd;
- SetLastError(0);
- return(FALSE);
-}
-
-WGLAPI int GLAPIENTRY DrvSetLayerPaletteEntries(HDC hdc,int iLayerPlane,
- int iStart,int cEntries,
- CONST COLORREF *pcr)
-{
- (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
- SetLastError(0);
- return(0);
-}
-
-WGLAPI int GLAPIENTRY DrvGetLayerPaletteEntries(HDC hdc,int iLayerPlane,
- int iStart,int cEntries,
- COLORREF *pcr)
-{
- (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
- SetLastError(0);
- return(0);
-}
-
-WGLAPI BOOL GLAPIENTRY DrvRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize)
-{
- (void) hdc; (void) iLayerPlane; (void) bRealize;
- SetLastError(0);
- return(FALSE);
-}
-
-WGLAPI BOOL GLAPIENTRY DrvSwapLayerBuffers(HDC hdc,UINT fuPlanes)
-{
- (void) fuPlanes;
- if( !hdc )
- {
- WMesaSwapBuffers();
- return(TRUE);
- }
- SetLastError(0);
- return(FALSE);
-}
-
-WGLAPI int GLAPIENTRY DrvDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes,
- LPPIXELFORMATDESCRIPTOR ppfd)
-{
- int qt_valid_pix;
- (void) hdc;
-
- qt_valid_pix = qt_pix;
- if(ppfd == NULL)
- return(qt_valid_pix);
- if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR))
- {
- SetLastError(0);
- return(0);
- }
- *ppfd = pix[iPixelFormat - 1].pfd;
- return(qt_valid_pix);
-}
-
-/*
-* GetProcAddress - return the address of an appropriate extension
-*/
-WGLAPI PROC GLAPIENTRY DrvGetProcAddress(LPCSTR lpszProc)
-{
- PROC p = (PROC) (int) _glapi_get_proc_address((const char *) lpszProc);
- if (p)
- return p;
-
- SetLastError(0);
- return(NULL);
-}
-
-WGLAPI BOOL GLAPIENTRY DrvSetPixelFormat(HDC hdc,int iPixelFormat)
-{
- int qt_valid_pix;
- (void) hdc;
-
- qt_valid_pix = qt_pix;
- if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix)
- {
- SetLastError(0);
- return(FALSE);
- }
- curPFD = iPixelFormat;
- return(TRUE);
-}
-
-WGLAPI BOOL GLAPIENTRY DrvSwapBuffers(HDC hdc)
-{
- (void) hdc;
- if (ctx_current < 0)
- return FALSE;
-
- if(wgl_ctx[ctx_current].ctx == NULL) {
- SetLastError(0);
- return(FALSE);
- }
- WMesaSwapBuffers();
- return(TRUE);
-}
-
-WGLAPI BOOL GLAPIENTRY DrvValidateVersion(DWORD version)
-{
- (void) version;
- return TRUE;
-}
diff --git a/mesalib/src/mesa/drivers/windows/icd/icdlist.h b/mesalib/src/mesa/drivers/windows/icd/icdlist.h
deleted file mode 100644
index 1318804cf..000000000
--- a/mesalib/src/mesa/drivers/windows/icd/icdlist.h
+++ /dev/null
@@ -1,336 +0,0 @@
-ICD_ENTRY(NewList) /* 0 */
-ICD_ENTRY(EndList) /* 1 */
-ICD_ENTRY(CallList) /* 2 */
-ICD_ENTRY(CallLists) /* 3 */
-ICD_ENTRY(DeleteLists) /* 4 */
-ICD_ENTRY(GenLists) /* 5 */
-ICD_ENTRY(ListBase) /* 6 */
-ICD_ENTRY(Begin) /* 7 */
-ICD_ENTRY(Bitmap) /* 8 */
-ICD_ENTRY(Color3b) /* 9 */
-ICD_ENTRY(Color3bv) /* 10 */
-ICD_ENTRY(Color3d) /* 11 */
-ICD_ENTRY(Color3dv) /* 12 */
-ICD_ENTRY(Color3f) /* 13 */
-ICD_ENTRY(Color3fv) /* 14 */
-ICD_ENTRY(Color3i) /* 15 */
-ICD_ENTRY(Color3iv) /* 16 */
-ICD_ENTRY(Color3s) /* 17 */
-ICD_ENTRY(Color3sv) /* 18 */
-ICD_ENTRY(Color3ub) /* 19 */
-ICD_ENTRY(Color3ubv) /* 20 */
-ICD_ENTRY(Color3ui) /* 21 */
-ICD_ENTRY(Color3uiv) /* 22 */
-ICD_ENTRY(Color3us) /* 23 */
-ICD_ENTRY(Color3usv) /* 24 */
-ICD_ENTRY(Color4b) /* 25 */
-ICD_ENTRY(Color4bv) /* 26 */
-ICD_ENTRY(Color4d) /* 27 */
-ICD_ENTRY(Color4dv) /* 28 */
-ICD_ENTRY(Color4f) /* 29 */
-ICD_ENTRY(Color4fv) /* 30 */
-ICD_ENTRY(Color4i) /* 31 */
-ICD_ENTRY(Color4iv) /* 32 */
-ICD_ENTRY(Color4s) /* 33 */
-ICD_ENTRY(Color4sv) /* 34 */
-ICD_ENTRY(Color4ub) /* 35 */
-ICD_ENTRY(Color4ubv) /* 36 */
-ICD_ENTRY(Color4ui) /* 37 */
-ICD_ENTRY(Color4uiv) /* 38 */
-ICD_ENTRY(Color4us) /* 39 */
-ICD_ENTRY(Color4usv) /* 40 */
-ICD_ENTRY(EdgeFlag) /* 41 */
-ICD_ENTRY(EdgeFlagv) /* 42 */
-ICD_ENTRY(End) /* 43 */
-ICD_ENTRY(Indexd) /* 44 */
-ICD_ENTRY(Indexdv) /* 45 */
-ICD_ENTRY(Indexf) /* 46 */
-ICD_ENTRY(Indexfv) /* 47 */
-ICD_ENTRY(Indexi) /* 48 */
-ICD_ENTRY(Indexiv) /* 49 */
-ICD_ENTRY(Indexs) /* 50 */
-ICD_ENTRY(Indexsv) /* 51 */
-ICD_ENTRY(Normal3b) /* 52 */
-ICD_ENTRY(Normal3bv) /* 53 */
-ICD_ENTRY(Normal3d) /* 54 */
-ICD_ENTRY(Normal3dv) /* 55 */
-ICD_ENTRY(Normal3f) /* 56 */
-ICD_ENTRY(Normal3fv) /* 57 */
-ICD_ENTRY(Normal3i) /* 58 */
-ICD_ENTRY(Normal3iv) /* 59 */
-ICD_ENTRY(Normal3s) /* 60 */
-ICD_ENTRY(Normal3sv) /* 61 */
-ICD_ENTRY(RasterPos2d) /* 62 */
-ICD_ENTRY(RasterPos2dv) /* 63 */
-ICD_ENTRY(RasterPos2f) /* 64 */
-ICD_ENTRY(RasterPos2fv) /* 65 */
-ICD_ENTRY(RasterPos2i) /* 66 */
-ICD_ENTRY(RasterPos2iv) /* 67 */
-ICD_ENTRY(RasterPos2s) /* 68 */
-ICD_ENTRY(RasterPos2sv) /* 69 */
-ICD_ENTRY(RasterPos3d) /* 70 */
-ICD_ENTRY(RasterPos3dv) /* 71 */
-ICD_ENTRY(RasterPos3f) /* 72 */
-ICD_ENTRY(RasterPos3fv) /* 73 */
-ICD_ENTRY(RasterPos3i) /* 74 */
-ICD_ENTRY(RasterPos3iv) /* 75 */
-ICD_ENTRY(RasterPos3s) /* 76 */
-ICD_ENTRY(RasterPos3sv) /* 77 */
-ICD_ENTRY(RasterPos4d) /* 78 */
-ICD_ENTRY(RasterPos4dv) /* 79 */
-ICD_ENTRY(RasterPos4f) /* 80 */
-ICD_ENTRY(RasterPos4fv) /* 81 */
-ICD_ENTRY(RasterPos4i) /* 82 */
-ICD_ENTRY(RasterPos4iv) /* 83 */
-ICD_ENTRY(RasterPos4s) /* 84 */
-ICD_ENTRY(RasterPos4sv) /* 85 */
-ICD_ENTRY(Rectd) /* 86 */
-ICD_ENTRY(Rectdv) /* 87 */
-ICD_ENTRY(Rectf) /* 88 */
-ICD_ENTRY(Rectfv) /* 89 */
-ICD_ENTRY(Recti) /* 90 */
-ICD_ENTRY(Rectiv) /* 91 */
-ICD_ENTRY(Rects) /* 92 */
-ICD_ENTRY(Rectsv) /* 93 */
-ICD_ENTRY(TexCoord1d) /* 94 */
-ICD_ENTRY(TexCoord1dv) /* 95 */
-ICD_ENTRY(TexCoord1f) /* 96 */
-ICD_ENTRY(TexCoord1fv) /* 97 */
-ICD_ENTRY(TexCoord1i) /* 98 */
-ICD_ENTRY(TexCoord1iv) /* 99 */
-ICD_ENTRY(TexCoord1s) /* 100 */
-ICD_ENTRY(TexCoord1sv) /* 101 */
-ICD_ENTRY(TexCoord2d) /* 102 */
-ICD_ENTRY(TexCoord2dv) /* 103 */
-ICD_ENTRY(TexCoord2f) /* 104 */
-ICD_ENTRY(TexCoord2fv) /* 105 */
-ICD_ENTRY(TexCoord2i) /* 106 */
-ICD_ENTRY(TexCoord2iv) /* 107 */
-ICD_ENTRY(TexCoord2s) /* 108 */
-ICD_ENTRY(TexCoord2sv) /* 109 */
-ICD_ENTRY(TexCoord3d) /* 110 */
-ICD_ENTRY(TexCoord3dv) /* 111 */
-ICD_ENTRY(TexCoord3f) /* 112 */
-ICD_ENTRY(TexCoord3fv) /* 113 */
-ICD_ENTRY(TexCoord3i) /* 114 */
-ICD_ENTRY(TexCoord3iv) /* 115 */
-ICD_ENTRY(TexCoord3s) /* 116 */
-ICD_ENTRY(TexCoord3sv) /* 117 */
-ICD_ENTRY(TexCoord4d) /* 118 */
-ICD_ENTRY(TexCoord4dv) /* 119 */
-ICD_ENTRY(TexCoord4f) /* 120 */
-ICD_ENTRY(TexCoord4fv) /* 121 */
-ICD_ENTRY(TexCoord4i) /* 122 */
-ICD_ENTRY(TexCoord4iv) /* 123 */
-ICD_ENTRY(TexCoord4s) /* 124 */
-ICD_ENTRY(TexCoord4sv) /* 125 */
-ICD_ENTRY(Vertex2d) /* 126 */
-ICD_ENTRY(Vertex2dv) /* 127 */
-ICD_ENTRY(Vertex2f) /* 128 */
-ICD_ENTRY(Vertex2fv) /* 129 */
-ICD_ENTRY(Vertex2i) /* 130 */
-ICD_ENTRY(Vertex2iv) /* 131 */
-ICD_ENTRY(Vertex2s) /* 132 */
-ICD_ENTRY(Vertex2sv) /* 133 */
-ICD_ENTRY(Vertex3d) /* 134 */
-ICD_ENTRY(Vertex3dv) /* 135 */
-ICD_ENTRY(Vertex3f) /* 136 */
-ICD_ENTRY(Vertex3fv) /* 137 */
-ICD_ENTRY(Vertex3i) /* 138 */
-ICD_ENTRY(Vertex3iv) /* 139 */
-ICD_ENTRY(Vertex3s) /* 140 */
-ICD_ENTRY(Vertex3sv) /* 141 */
-ICD_ENTRY(Vertex4d) /* 142 */
-ICD_ENTRY(Vertex4dv) /* 143 */
-ICD_ENTRY(Vertex4f) /* 144 */
-ICD_ENTRY(Vertex4fv) /* 145 */
-ICD_ENTRY(Vertex4i) /* 146 */
-ICD_ENTRY(Vertex4iv) /* 147 */
-ICD_ENTRY(Vertex4s) /* 148 */
-ICD_ENTRY(Vertex4sv) /* 149 */
-ICD_ENTRY(ClipPlane) /* 150 */
-ICD_ENTRY(ColorMaterial) /* 151 */
-ICD_ENTRY(CullFace) /* 152 */
-ICD_ENTRY(Fogf) /* 153 */
-ICD_ENTRY(Fogfv) /* 154 */
-ICD_ENTRY(Fogi) /* 155 */
-ICD_ENTRY(Fogiv) /* 156 */
-ICD_ENTRY(FrontFace) /* 157 */
-ICD_ENTRY(Hint) /* 158 */
-ICD_ENTRY(Lightf) /* 159 */
-ICD_ENTRY(Lightfv) /* 160 */
-ICD_ENTRY(Lighti) /* 161 */
-ICD_ENTRY(Lightiv) /* 162 */
-ICD_ENTRY(LightModelf) /* 163 */
-ICD_ENTRY(LightModelfv) /* 164 */
-ICD_ENTRY(LightModeli) /* 165 */
-ICD_ENTRY(LightModeliv) /* 166 */
-ICD_ENTRY(LineStipple) /* 167 */
-ICD_ENTRY(LineWidth) /* 168 */
-ICD_ENTRY(Materialf) /* 169 */
-ICD_ENTRY(Materialfv) /* 170 */
-ICD_ENTRY(Materiali) /* 171 */
-ICD_ENTRY(Materialiv) /* 172 */
-ICD_ENTRY(PointSize) /* 173 */
-ICD_ENTRY(PolygonMode) /* 174 */
-ICD_ENTRY(PolygonStipple) /* 175 */
-ICD_ENTRY(Scissor) /* 176 */
-ICD_ENTRY(ShadeModel) /* 177 */
-ICD_ENTRY(TexParameterf) /* 178 */
-ICD_ENTRY(TexParameterfv) /* 179 */
-ICD_ENTRY(TexParameteri) /* 180 */
-ICD_ENTRY(TexParameteriv) /* 181 */
-ICD_ENTRY(TexImage1D) /* 182 */
-ICD_ENTRY(TexImage2D) /* 183 */
-ICD_ENTRY(TexEnvf) /* 184 */
-ICD_ENTRY(TexEnvfv) /* 185 */
-ICD_ENTRY(TexEnvi) /* 186 */
-ICD_ENTRY(TexEnviv) /* 187 */
-ICD_ENTRY(TexGend) /* 188 */
-ICD_ENTRY(TexGendv) /* 189 */
-ICD_ENTRY(TexGenf) /* 190 */
-ICD_ENTRY(TexGenfv) /* 191 */
-ICD_ENTRY(TexGeni) /* 192 */
-ICD_ENTRY(TexGeniv) /* 193 */
-ICD_ENTRY(FeedbackBuffer) /* 194 */
-ICD_ENTRY(SelectBuffer) /* 195 */
-ICD_ENTRY(RenderMode) /* 196 */
-ICD_ENTRY(InitNames) /* 197 */
-ICD_ENTRY(LoadName) /* 198 */
-ICD_ENTRY(PassThrough) /* 199 */
-ICD_ENTRY(PopName) /* 200 */
-ICD_ENTRY(PushName) /* 201 */
-ICD_ENTRY(DrawBuffer) /* 202 */
-ICD_ENTRY(Clear) /* 203 */
-ICD_ENTRY(ClearAccum) /* 204 */
-ICD_ENTRY(ClearIndex) /* 205 */
-ICD_ENTRY(ClearColor) /* 206 */
-ICD_ENTRY(ClearStencil) /* 207 */
-ICD_ENTRY(ClearDepth) /* 208 */
-ICD_ENTRY(StencilMask) /* 209 */
-ICD_ENTRY(ColorMask) /* 210 */
-ICD_ENTRY(DepthMask) /* 211 */
-ICD_ENTRY(IndexMask) /* 212 */
-ICD_ENTRY(Accum) /* 213 */
-ICD_ENTRY(Disable) /* 214 */
-ICD_ENTRY(Enable) /* 215 */
-ICD_ENTRY(Finish) /* 216 */
-ICD_ENTRY(Flush) /* 217 */
-ICD_ENTRY(PopAttrib) /* 218 */
-ICD_ENTRY(PushAttrib) /* 219 */
-ICD_ENTRY(Map1d) /* 220 */
-ICD_ENTRY(Map1f) /* 221 */
-ICD_ENTRY(Map2d) /* 222 */
-ICD_ENTRY(Map2f) /* 223 */
-ICD_ENTRY(MapGrid1d) /* 224 */
-ICD_ENTRY(MapGrid1f) /* 225 */
-ICD_ENTRY(MapGrid2d) /* 226 */
-ICD_ENTRY(MapGrid2f) /* 227 */
-ICD_ENTRY(EvalCoord1d) /* 228 */
-ICD_ENTRY(EvalCoord1dv) /* 229 */
-ICD_ENTRY(EvalCoord1f) /* 230 */
-ICD_ENTRY(EvalCoord1fv) /* 231 */
-ICD_ENTRY(EvalCoord2d) /* 232 */
-ICD_ENTRY(EvalCoord2dv) /* 233 */
-ICD_ENTRY(EvalCoord2f) /* 234 */
-ICD_ENTRY(EvalCoord2fv) /* 235 */
-ICD_ENTRY(EvalMesh1) /* 236 */
-ICD_ENTRY(EvalPoint1) /* 237 */
-ICD_ENTRY(EvalMesh2) /* 238 */
-ICD_ENTRY(EvalPoint2) /* 239 */
-ICD_ENTRY(AlphaFunc) /* 240 */
-ICD_ENTRY(BlendFunc) /* 241 */
-ICD_ENTRY(LogicOp) /* 242 */
-ICD_ENTRY(StencilFunc) /* 243 */
-ICD_ENTRY(StencilOp) /* 244 */
-ICD_ENTRY(DepthFunc) /* 245 */
-ICD_ENTRY(PixelZoom) /* 246 */
-ICD_ENTRY(PixelTransferf) /* 247 */
-ICD_ENTRY(PixelTransferi) /* 248 */
-ICD_ENTRY(PixelStoref) /* 249 */
-ICD_ENTRY(PixelStorei) /* 250 */
-ICD_ENTRY(PixelMapfv) /* 251 */
-ICD_ENTRY(PixelMapuiv) /* 252 */
-ICD_ENTRY(PixelMapusv) /* 253 */
-ICD_ENTRY(ReadBuffer) /* 254 */
-ICD_ENTRY(CopyPixels) /* 255 */
-ICD_ENTRY(ReadPixels) /* 256 */
-ICD_ENTRY(DrawPixels) /* 257 */
-ICD_ENTRY(GetBooleanv) /* 258 */
-ICD_ENTRY(GetClipPlane) /* 259 */
-ICD_ENTRY(GetDoublev) /* 260 */
-ICD_ENTRY(GetError) /* 261 */
-ICD_ENTRY(GetFloatv) /* 262 */
-ICD_ENTRY(GetIntegerv) /* 263 */
-ICD_ENTRY(GetLightfv) /* 264 */
-ICD_ENTRY(GetLightiv) /* 265 */
-ICD_ENTRY(GetMapdv) /* 266 */
-ICD_ENTRY(GetMapfv) /* 267 */
-ICD_ENTRY(GetMapiv) /* 268 */
-ICD_ENTRY(GetMaterialfv) /* 269 */
-ICD_ENTRY(GetMaterialiv) /* 270 */
-ICD_ENTRY(GetPixelMapfv) /* 271 */
-ICD_ENTRY(GetPixelMapuiv) /* 272 */
-ICD_ENTRY(GetPixelMapusv) /* 273 */
-ICD_ENTRY(GetPolygonStipple) /* 274 */
-ICD_ENTRY(GetString) /* 275 */
-ICD_ENTRY(GetTexEnvfv) /* 276 */
-ICD_ENTRY(GetTexEnviv) /* 277 */
-ICD_ENTRY(GetTexGendv) /* 278 */
-ICD_ENTRY(GetTexGenfv) /* 279 */
-ICD_ENTRY(GetTexGeniv) /* 280 */
-ICD_ENTRY(GetTexImage) /* 281 */
-ICD_ENTRY(GetTexParameterfv) /* 282 */
-ICD_ENTRY(GetTexParameteriv) /* 283 */
-ICD_ENTRY(GetTexLevelParameterfv) /* 284 */
-ICD_ENTRY(GetTexLevelParameteriv) /* 285 */
-ICD_ENTRY(IsEnabled) /* 286 */
-ICD_ENTRY(IsList) /* 287 */
-ICD_ENTRY(DepthRange) /* 288 */
-ICD_ENTRY(Frustum) /* 289 */
-ICD_ENTRY(LoadIdentity) /* 290 */
-ICD_ENTRY(LoadMatrixf) /* 291 */
-ICD_ENTRY(LoadMatrixd) /* 292 */
-ICD_ENTRY(MatrixMode) /* 293 */
-ICD_ENTRY(MultMatrixf) /* 294 */
-ICD_ENTRY(MultMatrixd) /* 295 */
-ICD_ENTRY(Ortho) /* 296 */
-ICD_ENTRY(PopMatrix) /* 297 */
-ICD_ENTRY(PushMatrix) /* 298 */
-ICD_ENTRY(Rotated) /* 299 */
-ICD_ENTRY(Rotatef) /* 300 */
-ICD_ENTRY(Scaled) /* 301 */
-ICD_ENTRY(Scalef) /* 302 */
-ICD_ENTRY(Translated) /* 303 */
-ICD_ENTRY(Translatef) /* 304 */
-ICD_ENTRY(Viewport) /* 305 */
-ICD_ENTRY(ArrayElement) /* 306 */
-ICD_ENTRY(BindTexture) /* 307 */
-ICD_ENTRY(ColorPointer) /* 308 */
-ICD_ENTRY(DisableClientState) /* 309 */
-ICD_ENTRY(DrawArrays) /* 310 */
-ICD_ENTRY(DrawElements) /* 311 */
-ICD_ENTRY(EdgeFlagPointer) /* 312 */
-ICD_ENTRY(EnableClientState) /* 313 */
-ICD_ENTRY(IndexPointer) /* 314 */
-ICD_ENTRY(Indexub) /* 315 */
-ICD_ENTRY(Indexubv) /* 316 */
-ICD_ENTRY(InterleavedArrays) /* 317 */
-ICD_ENTRY(NormalPointer) /* 318 */
-ICD_ENTRY(PolygonOffset) /* 319 */
-ICD_ENTRY(TexCoordPointer) /* 320 */
-ICD_ENTRY(VertexPointer) /* 321 */
-ICD_ENTRY(AreTexturesResident) /* 322 */
-ICD_ENTRY(CopyTexImage1D) /* 323 */
-ICD_ENTRY(CopyTexImage2D) /* 324 */
-ICD_ENTRY(CopyTexSubImage1D) /* 325 */
-ICD_ENTRY(CopyTexSubImage2D) /* 326 */
-ICD_ENTRY(DeleteTextures) /* 327 */
-ICD_ENTRY(GenTextures) /* 328 */
-ICD_ENTRY(GetPointerv) /* 329 */
-ICD_ENTRY(IsTexture) /* 330 */
-ICD_ENTRY(PrioritizeTextures) /* 331 */
-ICD_ENTRY(TexSubImage1D) /* 332 */
-ICD_ENTRY(TexSubImage2D) /* 333 */
-ICD_ENTRY(PopClientAttrib) /* 334 */
-ICD_ENTRY(PushClientAttrib) /* 335 */
diff --git a/mesalib/src/mesa/drivers/windows/icd/mesa.def b/mesalib/src/mesa/drivers/windows/icd/mesa.def
deleted file mode 100644
index 6f33d170f..000000000
--- a/mesalib/src/mesa/drivers/windows/icd/mesa.def
+++ /dev/null
@@ -1,102 +0,0 @@
-DESCRIPTION 'Mesa (OpenGL driver) for Win32'
-VERSION 6.1
-
-EXPORTS
-;
-; ICD API
- DrvCopyContext
- DrvCreateContext
- DrvCreateLayerContext
- DrvDeleteContext
- DrvDescribeLayerPlane
- DrvDescribePixelFormat
- DrvGetLayerPaletteEntries
- DrvGetProcAddress
- DrvReleaseContext
- DrvRealizeLayerPalette
- DrvSetContext
- DrvSetLayerPaletteEntries
- DrvSetPixelFormat
- DrvShareLists
- DrvSwapBuffers
- DrvSwapLayerBuffers
- DrvValidateVersion
-
-;
-; Mesa internals - mostly for OSMESA
- _vbo_CreateContext
- _vbo_DestroyContext
- _vbo_InvalidateState
- _glapi_get_context
- _glapi_get_proc_address
- _mesa_buffer_data
- _mesa_buffer_map
- _mesa_buffer_subdata
- _mesa_choose_tex_format
- _mesa_compressed_texture_size
- _mesa_create_framebuffer
- _mesa_create_visual
- _mesa_delete_buffer_object
- _mesa_delete_texture_object
- _mesa_destroy_framebuffer
- _mesa_destroy_visual
- _mesa_enable_1_3_extensions
- _mesa_enable_1_4_extensions
- _mesa_enable_1_5_extensions
- _mesa_enable_sw_extensions
- _mesa_error
- _mesa_free_context_data
- _mesa_get_current_context
- _mesa_init_default_imports
- _mesa_init_driver_functions
- _mesa_initialize_context
- _mesa_make_current
- _mesa_new_buffer_object
- _mesa_new_texture_object
- _mesa_problem
- _mesa_ResizeBuffersMESA
- _mesa_store_compressed_teximage1d
- _mesa_store_compressed_teximage2d
- _mesa_store_compressed_teximage3d
- _mesa_store_compressed_texsubimage1d
- _mesa_store_compressed_texsubimage2d
- _mesa_store_compressed_texsubimage3d
- _mesa_store_teximage1d
- _mesa_store_teximage2d
- _mesa_store_teximage3d
- _mesa_store_texsubimage1d
- _mesa_store_texsubimage2d
- _mesa_store_texsubimage3d
- _mesa_test_proxy_teximage
- _mesa_Viewport
- _mesa_meta_CopyColorSubTable
- _mesa_meta_CopyColorTable
- _mesa_meta_CopyConvolutionFilter1D
- _mesa_meta_CopyConvolutionFilter2D
- _mesa_meta_CopyTexImage1D
- _mesa_meta_CopyTexImage2D
- _mesa_meta_CopyTexSubImage1D
- _mesa_meta_CopyTexSubImage2D
- _mesa_meta_CopyTexSubImage3D
- _swrast_Accum
- _swrast_Bitmap
- _swrast_CopyPixels
- _swrast_DrawBuffer
- _swrast_DrawPixels
- _swrast_GetDeviceDriverReference
- _swrast_Clear
- _swrast_choose_line
- _swrast_choose_triangle
- _swrast_CreateContext
- _swrast_DestroyContext
- _swrast_InvalidateState
- _swrast_ReadPixels
- _swsetup_Wakeup
- _swsetup_CreateContext
- _swsetup_DestroyContext
- _swsetup_InvalidateState
- _tnl_CreateContext
- _tnl_DestroyContext
- _tnl_InvalidateState
- _tnl_MakeCurrent
- _tnl_run_pipeline
diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c
index f88da8458..b93a057e6 100644
--- a/mesalib/src/mesa/main/api_arrayelt.c
+++ b/mesalib/src/mesa/main/api_arrayelt.c
@@ -1602,10 +1602,10 @@ void _ae_map_vbos( struct gl_context *ctx )
_ae_update_state(ctx);
for (i = 0; i < actx->nr_vbos; i++)
- ctx->Driver.MapBuffer(ctx,
- GL_ARRAY_BUFFER_ARB,
- GL_DYNAMIC_DRAW_ARB,
- actx->vbo[i]);
+ ctx->Driver.MapBufferRange(ctx, 0,
+ actx->vbo[i]->Size,
+ GL_MAP_READ_BIT,
+ actx->vbo[i]);
if (actx->nr_vbos)
actx->mapped_vbos = GL_TRUE;
@@ -1622,9 +1622,7 @@ void _ae_unmap_vbos( struct gl_context *ctx )
assert (!actx->NewState);
for (i = 0; i < actx->nr_vbos; i++)
- ctx->Driver.UnmapBuffer(ctx,
- GL_ARRAY_BUFFER_ARB,
- actx->vbo[i]);
+ ctx->Driver.UnmapBuffer(ctx, actx->vbo[i]);
actx->mapped_vbos = GL_FALSE;
}
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index 2981d4229..699b414f5 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/src/mesa/main/api_validate.c
@@ -65,8 +65,8 @@ _mesa_max_buffer_index(struct gl_context *ctx, GLuint count, GLenum type,
if (_mesa_is_bufferobj(elementBuf)) {
/* elements are in a user-defined buffer object. need to map it */
- map = ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER,
- GL_READ_ONLY, elementBuf);
+ map = ctx->Driver.MapBufferRange(ctx, 0, elementBuf->Size,
+ GL_MAP_READ_BIT, elementBuf);
/* Actual address is the sum of pointers */
indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices);
}
@@ -89,7 +89,7 @@ _mesa_max_buffer_index(struct gl_context *ctx, GLuint count, GLenum type,
}
if (map) {
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, elementBuf);
+ ctx->Driver.UnmapBuffer(ctx, elementBuf);
}
return max;
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index c52358ecb..c453f9c85 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -386,11 +386,11 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
* \sa glBufferSubDataARB, dd_function_table::BufferSubData.
*/
static void
-_mesa_buffer_subdata( struct gl_context *ctx, GLenum target, GLintptrARB offset,
+_mesa_buffer_subdata( struct gl_context *ctx, GLintptrARB offset,
GLsizeiptrARB size, const GLvoid * data,
struct gl_buffer_object * bufObj )
{
- (void) ctx; (void) target;
+ (void) ctx;
/* this should have been caught in _mesa_BufferSubData() */
ASSERT(size + offset <= bufObj->Size);
@@ -419,12 +419,11 @@ _mesa_buffer_subdata( struct gl_context *ctx, GLenum target, GLintptrARB offset,
* \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData.
*/
static void
-_mesa_buffer_get_subdata( struct gl_context *ctx,
- GLenum target, GLintptrARB offset,
+_mesa_buffer_get_subdata( struct gl_context *ctx, GLintptrARB offset,
GLsizeiptrARB size, GLvoid * data,
struct gl_buffer_object * bufObj )
{
- (void) ctx; (void) target;
+ (void) ctx;
if (bufObj->Data && ((GLsizeiptrARB) (size + offset) <= bufObj->Size)) {
memcpy( data, (GLubyte *) bufObj->Data + offset, size );
@@ -433,49 +432,15 @@ _mesa_buffer_get_subdata( struct gl_context *ctx,
/**
- * Default callback for \c dd_function_tabel::MapBuffer().
- *
- * The function parameters will have been already tested for errors.
- *
- * \param ctx GL context.
- * \param target Buffer object target on which to operate.
- * \param access Information about how the buffer will be accessed.
- * \param bufObj Object to be mapped.
- * \return A pointer to the object's internal data store that can be accessed
- * by the processor
- *
- * \sa glMapBufferARB, dd_function_table::MapBuffer
- */
-static void *
-_mesa_buffer_map( struct gl_context *ctx, GLenum target, GLenum access,
- struct gl_buffer_object *bufObj )
-{
- (void) ctx;
- (void) target;
- (void) access;
- /* Just return a direct pointer to the data */
- if (_mesa_bufferobj_mapped(bufObj)) {
- /* already mapped! */
- return NULL;
- }
- bufObj->Pointer = bufObj->Data;
- bufObj->Length = bufObj->Size;
- bufObj->Offset = 0;
- return bufObj->Pointer;
-}
-
-
-/**
* Default fallback for \c dd_function_table::MapBufferRange().
* Called via glMapBufferRange().
*/
static void *
-_mesa_buffer_map_range( struct gl_context *ctx, GLenum target, GLintptr offset,
+_mesa_buffer_map_range( struct gl_context *ctx, GLintptr offset,
GLsizeiptr length, GLbitfield access,
struct gl_buffer_object *bufObj )
{
(void) ctx;
- (void) target;
assert(!_mesa_bufferobj_mapped(bufObj));
/* Just return a direct pointer to the data */
bufObj->Pointer = bufObj->Data + offset;
@@ -491,12 +456,11 @@ _mesa_buffer_map_range( struct gl_context *ctx, GLenum target, GLintptr offset,
* Called via glFlushMappedBufferRange().
*/
static void
-_mesa_buffer_flush_mapped_range( struct gl_context *ctx, GLenum target,
+_mesa_buffer_flush_mapped_range( struct gl_context *ctx,
GLintptr offset, GLsizeiptr length,
struct gl_buffer_object *obj )
{
(void) ctx;
- (void) target;
(void) offset;
(void) length;
(void) obj;
@@ -512,11 +476,9 @@ _mesa_buffer_flush_mapped_range( struct gl_context *ctx, GLenum target,
* \sa glUnmapBufferARB, dd_function_table::UnmapBuffer
*/
static GLboolean
-_mesa_buffer_unmap( struct gl_context *ctx, GLenum target,
- struct gl_buffer_object *bufObj )
+_mesa_buffer_unmap( struct gl_context *ctx, struct gl_buffer_object *bufObj )
{
(void) ctx;
- (void) target;
/* XXX we might assert here that bufObj->Pointer is non-null */
bufObj->Pointer = NULL;
bufObj->Length = 0;
@@ -543,16 +505,16 @@ _mesa_copy_buffer_subdata(struct gl_context *ctx,
assert(!_mesa_bufferobj_mapped(src));
assert(!_mesa_bufferobj_mapped(dst));
- srcPtr = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_COPY_READ_BUFFER,
- GL_READ_ONLY, src);
- dstPtr = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_COPY_WRITE_BUFFER,
- GL_WRITE_ONLY, dst);
+ srcPtr = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, src->Size,
+ GL_MAP_READ_BIT, src);
+ dstPtr = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, dst->Size,
+ GL_MAP_WRITE_BIT, dst);
if (srcPtr && dstPtr)
memcpy(dstPtr + writeOffset, srcPtr + readOffset, size);
- ctx->Driver.UnmapBuffer(ctx, GL_COPY_READ_BUFFER, src);
- ctx->Driver.UnmapBuffer(ctx, GL_COPY_WRITE_BUFFER, dst);
+ ctx->Driver.UnmapBuffer(ctx, src);
+ ctx->Driver.UnmapBuffer(ctx, dst);
}
@@ -712,7 +674,6 @@ _mesa_init_buffer_object_functions(struct dd_function_table *driver)
driver->BufferData = _mesa_buffer_data;
driver->BufferSubData = _mesa_buffer_subdata;
driver->GetBufferSubData = _mesa_buffer_get_subdata;
- driver->MapBuffer = _mesa_buffer_map;
driver->UnmapBuffer = _mesa_buffer_unmap;
/* GL_ARB_map_buffer_range */
@@ -774,7 +735,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
if (_mesa_bufferobj_mapped(bufObj)) {
/* if mapped, unmap it now */
- ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
+ ctx->Driver.UnmapBuffer(ctx, bufObj);
bufObj->AccessFlags = DEFAULT_ACCESS;
bufObj->Pointer = NULL;
}
@@ -934,7 +895,7 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size,
if (_mesa_bufferobj_mapped(bufObj)) {
/* Unmap the existing buffer. We'll replace it now. Not an error. */
- ctx->Driver.UnmapBuffer(ctx, target, bufObj);
+ ctx->Driver.UnmapBuffer(ctx, bufObj);
bufObj->AccessFlags = DEFAULT_ACCESS;
ASSERT(bufObj->Pointer == NULL);
}
@@ -980,7 +941,7 @@ _mesa_BufferSubDataARB(GLenum target, GLintptrARB offset,
bufObj->Written = GL_TRUE;
ASSERT(ctx->Driver.BufferSubData);
- ctx->Driver.BufferSubData( ctx, target, offset, size, data, bufObj );
+ ctx->Driver.BufferSubData( ctx, offset, size, data, bufObj );
}
@@ -1000,7 +961,7 @@ _mesa_GetBufferSubDataARB(GLenum target, GLintptrARB offset,
}
ASSERT(ctx->Driver.GetBufferSubData);
- ctx->Driver.GetBufferSubData( ctx, target, offset, size, data, bufObj );
+ ctx->Driver.GetBufferSubData( ctx, offset, size, data, bufObj );
}
@@ -1043,8 +1004,8 @@ _mesa_MapBufferARB(GLenum target, GLenum access)
return NULL;
}
- ASSERT(ctx->Driver.MapBuffer);
- map = ctx->Driver.MapBuffer( ctx, target, access, bufObj );
+ ASSERT(ctx->Driver.MapBufferRange);
+ map = ctx->Driver.MapBufferRange(ctx, 0, bufObj->Size, accessFlags, bufObj);
if (!map) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)");
return NULL;
@@ -1147,7 +1108,7 @@ _mesa_UnmapBufferARB(GLenum target)
}
#endif
- status = ctx->Driver.UnmapBuffer( ctx, target, bufObj );
+ status = ctx->Driver.UnmapBuffer( ctx, bufObj );
bufObj->AccessFlags = DEFAULT_ACCESS;
ASSERT(bufObj->Pointer == NULL);
ASSERT(bufObj->Offset == 0);
@@ -1451,8 +1412,7 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
}
ASSERT(ctx->Driver.MapBufferRange);
- map = ctx->Driver.MapBufferRange(ctx, target, offset, length,
- access, bufObj);
+ map = ctx->Driver.MapBufferRange(ctx, offset, length, access, bufObj);
if (!map) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)");
}
@@ -1535,7 +1495,7 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
ASSERT(bufObj->AccessFlags & GL_MAP_WRITE_BIT);
if (ctx->Driver.FlushMappedBufferRange)
- ctx->Driver.FlushMappedBufferRange(ctx, target, offset, length, bufObj);
+ ctx->Driver.FlushMappedBufferRange(ctx, offset, length, bufObj);
}
diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h
index ee7d0b2f8..8ed1c6fa6 100644
--- a/mesalib/src/mesa/main/compiler.h
+++ b/mesalib/src/mesa/main/compiler.h
@@ -45,9 +45,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#if defined(__linux__) && defined(__i386__)
-#include <fpu_control.h>
-#endif
#include <float.h>
#include <stdarg.h>
diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h
index e0c5844e1..fcf40ecf1 100644
--- a/mesalib/src/mesa/main/dd.h
+++ b/mesalib/src/mesa/main/dd.h
@@ -194,7 +194,7 @@ struct dd_function_table {
* cases, srcFormat and srcType can be GL_NONE.
* Called by glTexImage(), etc.
*/
- GLuint (*ChooseTextureFormat)( struct gl_context *ctx, GLint internalFormat,
+ gl_format (*ChooseTextureFormat)( struct gl_context *ctx, GLint internalFormat,
GLenum srcFormat, GLenum srcType );
/**
@@ -698,17 +698,14 @@ struct dd_function_table {
const GLvoid *data, GLenum usage,
struct gl_buffer_object *obj );
- void (*BufferSubData)( struct gl_context *ctx, GLenum target, GLintptrARB offset,
+ void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
GLsizeiptrARB size, const GLvoid *data,
struct gl_buffer_object *obj );
- void (*GetBufferSubData)( struct gl_context *ctx, GLenum target,
+ void (*GetBufferSubData)( struct gl_context *ctx,
GLintptrARB offset, GLsizeiptrARB size,
GLvoid *data, struct gl_buffer_object *obj );
- void * (*MapBuffer)( struct gl_context *ctx, GLenum target, GLenum access,
- struct gl_buffer_object *obj );
-
void (*CopyBufferSubData)( struct gl_context *ctx,
struct gl_buffer_object *src,
struct gl_buffer_object *dst,
@@ -717,15 +714,15 @@ struct dd_function_table {
/* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
*/
- void * (*MapBufferRange)( struct gl_context *ctx, GLenum target, GLintptr offset,
+ void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
GLsizeiptr length, GLbitfield access,
struct gl_buffer_object *obj);
- void (*FlushMappedBufferRange)(struct gl_context *ctx, GLenum target,
+ void (*FlushMappedBufferRange)(struct gl_context *ctx,
GLintptr offset, GLsizeiptr length,
struct gl_buffer_object *obj);
- GLboolean (*UnmapBuffer)( struct gl_context *ctx, GLenum target,
+ GLboolean (*UnmapBuffer)( struct gl_context *ctx,
struct gl_buffer_object *obj );
/*@}*/
diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c
index 99030ac8e..b1fc096f2 100644
--- a/mesalib/src/mesa/main/debug.c
+++ b/mesalib/src/mesa/main/debug.c
@@ -1,634 +1,623 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. 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.
- */
-
-#include "mtypes.h"
-#include "attrib.h"
-#include "colormac.h"
-#include "enums.h"
-#include "formats.h"
-#include "hash.h"
-#include "imports.h"
-#include "debug.h"
-#include "get.h"
-#include "pixelstore.h"
-#include "readpix.h"
-#include "texobj.h"
-
-
-static const char *
-tex_target_name(GLenum tgt)
-{
- static const struct {
- GLenum target;
- const char *name;
- } tex_targets[] = {
- { GL_TEXTURE_1D, "GL_TEXTURE_1D" },
- { GL_TEXTURE_2D, "GL_TEXTURE_2D" },
- { GL_TEXTURE_3D, "GL_TEXTURE_3D" },
- { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" },
- { GL_TEXTURE_RECTANGLE, "GL_TEXTURE_RECTANGLE" },
- { GL_TEXTURE_1D_ARRAY_EXT, "GL_TEXTURE_1D_ARRAY" },
- { GL_TEXTURE_2D_ARRAY_EXT, "GL_TEXTURE_2D_ARRAY" }
- };
- GLuint i;
- for (i = 0; i < Elements(tex_targets); i++) {
- if (tex_targets[i].target == tgt)
- return tex_targets[i].name;
- }
- return "UNKNOWN TEX TARGET";
-}
-
-
-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",
- msg,
- state,
- (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
- (state & _NEW_PROJECTION) ? "ctx->Projection, " : "",
- (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "",
- (state & _NEW_COLOR) ? "ctx->Color, " : "",
- (state & _NEW_DEPTH) ? "ctx->Depth, " : "",
- (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "",
- (state & _NEW_FOG) ? "ctx->Fog, " : "",
- (state & _NEW_HINT) ? "ctx->Hint, " : "",
- (state & _NEW_LIGHT) ? "ctx->Light, " : "",
- (state & _NEW_LINE) ? "ctx->Line, " : "",
- (state & _NEW_PIXEL) ? "ctx->Pixel, " : "",
- (state & _NEW_POINT) ? "ctx->Point, " : "",
- (state & _NEW_POLYGON) ? "ctx->Polygon, " : "",
- (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "",
- (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "",
- (state & _NEW_STENCIL) ? "ctx->Stencil, " : "",
- (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,, " : "");
-}
-
-
-
-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%s%s%s\n",
- name,
- flags,
- (flags & DD_FLATSHADE) ? "flat-shade, " : "",
- (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "",
- (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "",
- (flags & DD_TRI_TWOSTENCIL) ? "tri-twostencil, " : "",
- (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, " : "",
- (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : ""
- );
-}
-
-
-/**
- * Print information about this Mesa version and build options.
- */
-void _mesa_print_info( void )
-{
- _mesa_debug(NULL, "Mesa GL_VERSION = %s\n",
- (char *) _mesa_GetString(GL_VERSION));
- _mesa_debug(NULL, "Mesa GL_RENDERER = %s\n",
- (char *) _mesa_GetString(GL_RENDERER));
- _mesa_debug(NULL, "Mesa GL_VENDOR = %s\n",
- (char *) _mesa_GetString(GL_VENDOR));
- _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n",
- (char *) _mesa_GetString(GL_EXTENSIONS));
-#if defined(THREADS)
- _mesa_debug(NULL, "Mesa thread-safe: YES\n");
-#else
- _mesa_debug(NULL, "Mesa thread-safe: NO\n");
-#endif
-#if defined(USE_X86_ASM)
- _mesa_debug(NULL, "Mesa x86-optimized: YES\n");
-#else
- _mesa_debug(NULL, "Mesa x86-optimized: NO\n");
-#endif
-#if defined(USE_SPARC_ASM)
- _mesa_debug(NULL, "Mesa sparc-optimized: YES\n");
-#else
- _mesa_debug(NULL, "Mesa sparc-optimized: NO\n");
-#endif
-}
-
-
-/**
- * Set the debugging flags.
- *
- * \param debug debug string
- *
- * If compiled with debugging support then search for keywords in \p debug and
- * enables the verbose debug output of the respective feature.
- */
-static void add_debug_flags( const char *debug )
-{
-#ifdef DEBUG
- struct debug_option {
- const char *name;
- GLbitfield flag;
- };
- static const struct debug_option debug_opt[] = {
- { "varray", VERBOSE_VARRAY },
- { "tex", VERBOSE_TEXTURE },
- { "mat", VERBOSE_MATERIAL },
- { "pipe", VERBOSE_PIPELINE },
- { "driver", VERBOSE_DRIVER },
- { "state", VERBOSE_STATE },
- { "api", VERBOSE_API },
- { "list", VERBOSE_DISPLAY_LIST },
- { "lighting", VERBOSE_LIGHTING },
- { "disassem", VERBOSE_DISASSEM },
- { "draw", VERBOSE_DRAW },
- { "swap", VERBOSE_SWAPBUFFERS }
- };
- GLuint i;
-
- MESA_VERBOSE = 0x0;
- for (i = 0; i < Elements(debug_opt); i++) {
- if (strstr(debug, debug_opt[i].name) || strcmp(debug, "all") == 0)
- MESA_VERBOSE |= debug_opt[i].flag;
- }
-
- /* Debug flag:
- */
- if (strstr(debug, "flush"))
- MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH;
-
-#if defined(_FPU_GETCW) && defined(_FPU_SETCW)
- if (strstr(debug, "fpexceptions")) {
- /* raise FP exceptions */
- fpu_control_t mask;
- _FPU_GETCW(mask);
- mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM
- | _FPU_MASK_OM | _FPU_MASK_UM);
- _FPU_SETCW(mask);
- }
-#endif
-
-#else
- (void) debug;
-#endif
-}
-
-
-void
-_mesa_init_debug( struct gl_context *ctx )
-{
- char *c;
- c = _mesa_getenv("MESA_DEBUG");
- if (c)
- add_debug_flags(c);
-
- c = _mesa_getenv("MESA_VERBOSE");
- if (c)
- add_debug_flags(c);
-}
-
-
-/*
- * Write ppm file
- */
-static void
-write_ppm(const char *filename, const GLubyte *buffer, int width, int height,
- int comps, int rcomp, int gcomp, int bcomp, GLboolean invert)
-{
- FILE *f = fopen( filename, "w" );
- if (f) {
- int x, y;
- const GLubyte *ptr = buffer;
- fprintf(f,"P6\n");
- fprintf(f,"# ppm-file created by osdemo.c\n");
- fprintf(f,"%i %i\n", width,height);
- fprintf(f,"255\n");
- fclose(f);
- f = fopen( filename, "ab" ); /* reopen in binary append mode */
- for (y=0; y < height; y++) {
- for (x = 0; x < width; x++) {
- int yy = invert ? (height - 1 - y) : y;
- int i = (yy * width + x) * comps;
- fputc(ptr[i+rcomp], f); /* write red */
- fputc(ptr[i+gcomp], f); /* write green */
- fputc(ptr[i+bcomp], f); /* write blue */
- }
- }
- fclose(f);
- }
- else {
- fprintf(stderr, "Unable to create %s in write_ppm()\n", filename);
- }
-}
-
-
-/**
- * Write a texture image to a ppm file.
- * \param face cube face in [0,5]
- * \param level mipmap level
- */
-static void
-write_texture_image(struct gl_texture_object *texObj,
- GLuint face, GLuint level)
-{
- struct gl_texture_image *img = texObj->Image[face][level];
- if (img) {
- GET_CURRENT_CONTEXT(ctx);
- struct gl_pixelstore_attrib store;
- GLubyte *buffer;
- char s[100];
-
- buffer = (GLubyte *) malloc(img->Width * img->Height
- * img->Depth * 4);
-
- store = ctx->Pack; /* save */
- ctx->Pack = ctx->DefaultPacking;
-
- ctx->Driver.GetTexImage(ctx, texObj->Target, level,
- GL_RGBA, GL_UNSIGNED_BYTE,
- buffer, texObj, img);
-
- /* make filename */
- _mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face);
-
- printf(" Writing image level %u to %s\n", level, s);
- write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE);
-
- ctx->Pack = store; /* restore */
-
- free(buffer);
- }
-}
-
-
-/**
- * Write renderbuffer image to a ppm file.
- */
-void
-_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLubyte *buffer;
- char s[100];
- GLenum format, type;
-
- if (rb->_BaseFormat == GL_RGB ||
- rb->_BaseFormat == GL_RGBA) {
- format = GL_RGBA;
- type = GL_UNSIGNED_BYTE;
- }
- else if (rb->_BaseFormat == GL_DEPTH_STENCIL) {
- format = GL_DEPTH_STENCIL;
- type = GL_UNSIGNED_INT_24_8;
- }
- else {
- _mesa_debug(NULL,
- "Unsupported BaseFormat 0x%x in "
- "_mesa_write_renderbuffer_image()\n",
- rb->_BaseFormat);
- return;
- }
-
- buffer = (GLubyte *) malloc(rb->Width * rb->Height * 4);
-
- ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height,
- format, type, &ctx->DefaultPacking, buffer);
-
- /* make filename */
- _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name);
- _mesa_snprintf(s, sizeof(s), "C:\\renderbuffer%u.ppm", rb->Name);
-
- printf(" Writing renderbuffer image to %s\n", s);
-
- _mesa_debug(NULL, " Writing renderbuffer image to %s\n", s);
-
- write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE);
-
- free(buffer);
-}
-
-
-/** How many texture images (mipmap levels, faces) to write to files */
-#define WRITE_NONE 0
-#define WRITE_ONE 1
-#define WRITE_ALL 2
-
-static GLuint WriteImages;
-
-
-static void
-dump_texture(struct gl_texture_object *texObj, GLuint writeImages)
-{
- const GLuint numFaces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1;
- GLboolean written = GL_FALSE;
- GLuint i, j;
-
- printf("Texture %u\n", texObj->Name);
- printf(" Target %s\n", tex_target_name(texObj->Target));
- for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
- for (j = 0; j < numFaces; j++) {
- struct gl_texture_image *texImg = texObj->Image[j][i];
- if (texImg) {
- printf(" Face %u level %u: %d x %d x %d, format %s at %p\n",
- j, i,
- texImg->Width, texImg->Height, texImg->Depth,
- _mesa_get_format_name(texImg->TexFormat),
- texImg->Data);
- if (writeImages == WRITE_ALL ||
- (writeImages == WRITE_ONE && !written)) {
- write_texture_image(texObj, j, i);
- written = GL_TRUE;
- }
- }
- }
- }
-}
-
-
-/**
- * Dump a single texture.
- */
-void
-_mesa_dump_texture(GLuint texture, GLuint writeImages)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture);
- if (texObj) {
- dump_texture(texObj, writeImages);
- }
-}
-
-
-static void
-dump_texture_cb(GLuint id, void *data, void *userData)
-{
- struct gl_texture_object *texObj = (struct gl_texture_object *) data;
- (void) userData;
- dump_texture(texObj, WriteImages);
-}
-
-
-/**
- * Print basic info about all texture objext to stdout.
- * If dumpImages is true, write PPM of level[0] image to a file.
- */
-void
-_mesa_dump_textures(GLuint writeImages)
-{
- GET_CURRENT_CONTEXT(ctx);
- WriteImages = writeImages;
- _mesa_HashWalk(ctx->Shared->TexObjects, dump_texture_cb, ctx);
-}
-
-
-static void
-dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage)
-{
- printf("Renderbuffer %u: %u x %u IntFormat = %s\n",
- rb->Name, rb->Width, rb->Height,
- _mesa_lookup_enum_by_nr(rb->InternalFormat));
- if (writeImage) {
- _mesa_write_renderbuffer_image(rb);
- }
-}
-
-
-static void
-dump_renderbuffer_cb(GLuint id, void *data, void *userData)
-{
- const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data;
- (void) userData;
- dump_renderbuffer(rb, WriteImages);
-}
-
-
-/**
- * Print basic info about all renderbuffers to stdout.
- * If dumpImages is true, write PPM of level[0] image to a file.
- */
-void
-_mesa_dump_renderbuffers(GLboolean writeImages)
-{
- GET_CURRENT_CONTEXT(ctx);
- WriteImages = writeImages;
- _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx);
-}
-
-
-
-void
-_mesa_dump_color_buffer(const char *filename)
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLuint w = ctx->DrawBuffer->Width;
- const GLuint h = ctx->DrawBuffer->Height;
- GLubyte *buf;
-
- buf = (GLubyte *) malloc(w * h * 4);
-
- _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
- _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
-
- _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf);
-
- printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n",
- (void *) ctx->ReadBuffer->_ColorReadBuffer,
- ctx->ReadBuffer->ColorReadBuffer,
- (void *) ctx->DrawBuffer->_ColorDrawBuffers[0],
- ctx->DrawBuffer->ColorDrawBuffer[0]);
- printf("Writing %d x %d color buffer to %s\n", w, h, filename);
- write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE);
-
- _mesa_PopClientAttrib();
-
- free(buf);
-}
-
-
-void
-_mesa_dump_depth_buffer(const char *filename)
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLuint w = ctx->DrawBuffer->Width;
- const GLuint h = ctx->DrawBuffer->Height;
- GLuint *buf;
- GLubyte *buf2;
- GLuint i;
-
- buf = (GLuint *) malloc(w * h * 4); /* 4 bpp */
- buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */
-
- _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
- _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
-
- _mesa_ReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, buf);
-
- /* spread 24 bits of Z across R, G, B */
- for (i = 0; i < w * h; i++) {
- buf2[i*3+0] = (buf[i] >> 24) & 0xff;
- buf2[i*3+1] = (buf[i] >> 16) & 0xff;
- buf2[i*3+2] = (buf[i] >> 8) & 0xff;
- }
-
- printf("Writing %d x %d depth buffer to %s\n", w, h, filename);
- write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE);
-
- _mesa_PopClientAttrib();
-
- free(buf);
- free(buf2);
-}
-
-
-void
-_mesa_dump_stencil_buffer(const char *filename)
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLuint w = ctx->DrawBuffer->Width;
- const GLuint h = ctx->DrawBuffer->Height;
- GLubyte *buf;
- GLubyte *buf2;
- GLuint i;
-
- buf = (GLubyte *) malloc(w * h); /* 1 bpp */
- buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */
-
- _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
- _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
-
- _mesa_ReadPixels(0, 0, w, h, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, buf);
-
- for (i = 0; i < w * h; i++) {
- buf2[i*3+0] = buf[i];
- buf2[i*3+1] = (buf[i] & 127) * 2;
- buf2[i*3+2] = (buf[i] - 128) * 2;
- }
-
- printf("Writing %d x %d stencil buffer to %s\n", w, h, filename);
- write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE);
-
- _mesa_PopClientAttrib();
-
- free(buf);
- free(buf2);
-}
-
-
-void
-_mesa_dump_image(const char *filename, const void *image, GLuint w, GLuint h,
- GLenum format, GLenum type)
-{
- GLboolean invert = GL_TRUE;
-
- if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- write_ppm(filename, image, w, h, 4, 0, 1, 2, invert);
- }
- else if (format == GL_BGRA && type == GL_UNSIGNED_BYTE) {
- write_ppm(filename, image, w, h, 4, 2, 1, 0, invert);
- }
- else if (format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_BYTE) {
- write_ppm(filename, image, w, h, 2, 1, 0, 0, invert);
- }
- else {
- _mesa_problem(NULL, "Unsupported format/type in _mesa_dump_image()");
- }
-}
-
-
-/**
- * Quick and dirty function to "print" a texture to stdout.
- */
-void
-_mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img)
-{
-#if CHAN_TYPE != GL_UNSIGNED_BYTE
- _mesa_problem(NULL, "PrintTexture not supported");
-#else
- GLuint i, j, c;
- const GLubyte *data = (const GLubyte *) img->Data;
-
- if (!data) {
- printf("No texture data\n");
- return;
- }
-
- /* XXX add more formats or make into a new format utility function */
- switch (img->TexFormat) {
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
- c = 1;
- break;
- case MESA_FORMAT_AL88:
- case MESA_FORMAT_AL88_REV:
- c = 2;
- break;
- case MESA_FORMAT_RGB888:
- case MESA_FORMAT_BGR888:
- c = 3;
- break;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_ARGB8888:
- c = 4;
- break;
- default:
- _mesa_problem(NULL, "error in PrintTexture\n");
- return;
- }
-
- for (i = 0; i < img->Height; i++) {
- for (j = 0; j < img->Width; j++) {
- if (c==1)
- printf("%02x ", data[0]);
- else if (c==2)
- printf("%02x%02x ", data[0], data[1]);
- else if (c==3)
- printf("%02x%02x%02x ", data[0], data[1], data[2]);
- else if (c==4)
- printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
- data += (img->RowStride - img->Width) * c;
- }
- /* XXX use img->ImageStride here */
- printf("\n");
- }
-#endif
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. 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.
+ */
+
+#include "mtypes.h"
+#include "attrib.h"
+#include "colormac.h"
+#include "enums.h"
+#include "formats.h"
+#include "hash.h"
+#include "imports.h"
+#include "debug.h"
+#include "get.h"
+#include "pixelstore.h"
+#include "readpix.h"
+#include "texobj.h"
+
+
+static const char *
+tex_target_name(GLenum tgt)
+{
+ static const struct {
+ GLenum target;
+ const char *name;
+ } tex_targets[] = {
+ { GL_TEXTURE_1D, "GL_TEXTURE_1D" },
+ { GL_TEXTURE_2D, "GL_TEXTURE_2D" },
+ { GL_TEXTURE_3D, "GL_TEXTURE_3D" },
+ { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" },
+ { GL_TEXTURE_RECTANGLE, "GL_TEXTURE_RECTANGLE" },
+ { GL_TEXTURE_1D_ARRAY_EXT, "GL_TEXTURE_1D_ARRAY" },
+ { GL_TEXTURE_2D_ARRAY_EXT, "GL_TEXTURE_2D_ARRAY" }
+ };
+ GLuint i;
+ for (i = 0; i < Elements(tex_targets); i++) {
+ if (tex_targets[i].target == tgt)
+ return tex_targets[i].name;
+ }
+ return "UNKNOWN TEX TARGET";
+}
+
+
+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",
+ msg,
+ state,
+ (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
+ (state & _NEW_PROJECTION) ? "ctx->Projection, " : "",
+ (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "",
+ (state & _NEW_COLOR) ? "ctx->Color, " : "",
+ (state & _NEW_DEPTH) ? "ctx->Depth, " : "",
+ (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "",
+ (state & _NEW_FOG) ? "ctx->Fog, " : "",
+ (state & _NEW_HINT) ? "ctx->Hint, " : "",
+ (state & _NEW_LIGHT) ? "ctx->Light, " : "",
+ (state & _NEW_LINE) ? "ctx->Line, " : "",
+ (state & _NEW_PIXEL) ? "ctx->Pixel, " : "",
+ (state & _NEW_POINT) ? "ctx->Point, " : "",
+ (state & _NEW_POLYGON) ? "ctx->Polygon, " : "",
+ (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "",
+ (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "",
+ (state & _NEW_STENCIL) ? "ctx->Stencil, " : "",
+ (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,, " : "");
+}
+
+
+
+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%s%s%s\n",
+ name,
+ flags,
+ (flags & DD_FLATSHADE) ? "flat-shade, " : "",
+ (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "",
+ (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "",
+ (flags & DD_TRI_TWOSTENCIL) ? "tri-twostencil, " : "",
+ (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, " : "",
+ (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : ""
+ );
+}
+
+
+/**
+ * Print information about this Mesa version and build options.
+ */
+void _mesa_print_info( void )
+{
+ _mesa_debug(NULL, "Mesa GL_VERSION = %s\n",
+ (char *) _mesa_GetString(GL_VERSION));
+ _mesa_debug(NULL, "Mesa GL_RENDERER = %s\n",
+ (char *) _mesa_GetString(GL_RENDERER));
+ _mesa_debug(NULL, "Mesa GL_VENDOR = %s\n",
+ (char *) _mesa_GetString(GL_VENDOR));
+ _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n",
+ (char *) _mesa_GetString(GL_EXTENSIONS));
+#if defined(THREADS)
+ _mesa_debug(NULL, "Mesa thread-safe: YES\n");
+#else
+ _mesa_debug(NULL, "Mesa thread-safe: NO\n");
+#endif
+#if defined(USE_X86_ASM)
+ _mesa_debug(NULL, "Mesa x86-optimized: YES\n");
+#else
+ _mesa_debug(NULL, "Mesa x86-optimized: NO\n");
+#endif
+#if defined(USE_SPARC_ASM)
+ _mesa_debug(NULL, "Mesa sparc-optimized: YES\n");
+#else
+ _mesa_debug(NULL, "Mesa sparc-optimized: NO\n");
+#endif
+}
+
+
+/**
+ * Set the debugging flags.
+ *
+ * \param debug debug string
+ *
+ * If compiled with debugging support then search for keywords in \p debug and
+ * enables the verbose debug output of the respective feature.
+ */
+static void add_debug_flags( const char *debug )
+{
+#ifdef DEBUG
+ struct debug_option {
+ const char *name;
+ GLbitfield flag;
+ };
+ static const struct debug_option debug_opt[] = {
+ { "varray", VERBOSE_VARRAY },
+ { "tex", VERBOSE_TEXTURE },
+ { "mat", VERBOSE_MATERIAL },
+ { "pipe", VERBOSE_PIPELINE },
+ { "driver", VERBOSE_DRIVER },
+ { "state", VERBOSE_STATE },
+ { "api", VERBOSE_API },
+ { "list", VERBOSE_DISPLAY_LIST },
+ { "lighting", VERBOSE_LIGHTING },
+ { "disassem", VERBOSE_DISASSEM },
+ { "draw", VERBOSE_DRAW },
+ { "swap", VERBOSE_SWAPBUFFERS }
+ };
+ GLuint i;
+
+ MESA_VERBOSE = 0x0;
+ for (i = 0; i < Elements(debug_opt); i++) {
+ if (strstr(debug, debug_opt[i].name) || strcmp(debug, "all") == 0)
+ MESA_VERBOSE |= debug_opt[i].flag;
+ }
+
+ /* Debug flag:
+ */
+ if (strstr(debug, "flush"))
+ MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH;
+
+#else
+ (void) debug;
+#endif
+}
+
+
+void
+_mesa_init_debug( struct gl_context *ctx )
+{
+ char *c;
+ c = _mesa_getenv("MESA_DEBUG");
+ if (c)
+ add_debug_flags(c);
+
+ c = _mesa_getenv("MESA_VERBOSE");
+ if (c)
+ add_debug_flags(c);
+}
+
+
+/*
+ * Write ppm file
+ */
+static void
+write_ppm(const char *filename, const GLubyte *buffer, int width, int height,
+ int comps, int rcomp, int gcomp, int bcomp, GLboolean invert)
+{
+ FILE *f = fopen( filename, "w" );
+ if (f) {
+ int x, y;
+ const GLubyte *ptr = buffer;
+ fprintf(f,"P6\n");
+ fprintf(f,"# ppm-file created by osdemo.c\n");
+ fprintf(f,"%i %i\n", width,height);
+ fprintf(f,"255\n");
+ fclose(f);
+ f = fopen( filename, "ab" ); /* reopen in binary append mode */
+ for (y=0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ int yy = invert ? (height - 1 - y) : y;
+ int i = (yy * width + x) * comps;
+ fputc(ptr[i+rcomp], f); /* write red */
+ fputc(ptr[i+gcomp], f); /* write green */
+ fputc(ptr[i+bcomp], f); /* write blue */
+ }
+ }
+ fclose(f);
+ }
+ else {
+ fprintf(stderr, "Unable to create %s in write_ppm()\n", filename);
+ }
+}
+
+
+/**
+ * Write a texture image to a ppm file.
+ * \param face cube face in [0,5]
+ * \param level mipmap level
+ */
+static void
+write_texture_image(struct gl_texture_object *texObj,
+ GLuint face, GLuint level)
+{
+ struct gl_texture_image *img = texObj->Image[face][level];
+ if (img) {
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_pixelstore_attrib store;
+ GLubyte *buffer;
+ char s[100];
+
+ buffer = (GLubyte *) malloc(img->Width * img->Height
+ * img->Depth * 4);
+
+ store = ctx->Pack; /* save */
+ ctx->Pack = ctx->DefaultPacking;
+
+ ctx->Driver.GetTexImage(ctx, texObj->Target, level,
+ GL_RGBA, GL_UNSIGNED_BYTE,
+ buffer, texObj, img);
+
+ /* make filename */
+ _mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face);
+
+ printf(" Writing image level %u to %s\n", level, s);
+ write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE);
+
+ ctx->Pack = store; /* restore */
+
+ free(buffer);
+ }
+}
+
+
+/**
+ * Write renderbuffer image to a ppm file.
+ */
+void
+_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLubyte *buffer;
+ char s[100];
+ GLenum format, type;
+
+ if (rb->_BaseFormat == GL_RGB ||
+ rb->_BaseFormat == GL_RGBA) {
+ format = GL_RGBA;
+ type = GL_UNSIGNED_BYTE;
+ }
+ else if (rb->_BaseFormat == GL_DEPTH_STENCIL) {
+ format = GL_DEPTH_STENCIL;
+ type = GL_UNSIGNED_INT_24_8;
+ }
+ else {
+ _mesa_debug(NULL,
+ "Unsupported BaseFormat 0x%x in "
+ "_mesa_write_renderbuffer_image()\n",
+ rb->_BaseFormat);
+ return;
+ }
+
+ buffer = (GLubyte *) malloc(rb->Width * rb->Height * 4);
+
+ ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height,
+ format, type, &ctx->DefaultPacking, buffer);
+
+ /* make filename */
+ _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name);
+ _mesa_snprintf(s, sizeof(s), "C:\\renderbuffer%u.ppm", rb->Name);
+
+ printf(" Writing renderbuffer image to %s\n", s);
+
+ _mesa_debug(NULL, " Writing renderbuffer image to %s\n", s);
+
+ write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE);
+
+ free(buffer);
+}
+
+
+/** How many texture images (mipmap levels, faces) to write to files */
+#define WRITE_NONE 0
+#define WRITE_ONE 1
+#define WRITE_ALL 2
+
+static GLuint WriteImages;
+
+
+static void
+dump_texture(struct gl_texture_object *texObj, GLuint writeImages)
+{
+ const GLuint numFaces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1;
+ GLboolean written = GL_FALSE;
+ GLuint i, j;
+
+ printf("Texture %u\n", texObj->Name);
+ printf(" Target %s\n", tex_target_name(texObj->Target));
+ for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+ for (j = 0; j < numFaces; j++) {
+ struct gl_texture_image *texImg = texObj->Image[j][i];
+ if (texImg) {
+ printf(" Face %u level %u: %d x %d x %d, format %s at %p\n",
+ j, i,
+ texImg->Width, texImg->Height, texImg->Depth,
+ _mesa_get_format_name(texImg->TexFormat),
+ texImg->Data);
+ if (writeImages == WRITE_ALL ||
+ (writeImages == WRITE_ONE && !written)) {
+ write_texture_image(texObj, j, i);
+ written = GL_TRUE;
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * Dump a single texture.
+ */
+void
+_mesa_dump_texture(GLuint texture, GLuint writeImages)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture);
+ if (texObj) {
+ dump_texture(texObj, writeImages);
+ }
+}
+
+
+static void
+dump_texture_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_texture_object *texObj = (struct gl_texture_object *) data;
+ (void) userData;
+ dump_texture(texObj, WriteImages);
+}
+
+
+/**
+ * Print basic info about all texture objext to stdout.
+ * If dumpImages is true, write PPM of level[0] image to a file.
+ */
+void
+_mesa_dump_textures(GLuint writeImages)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ WriteImages = writeImages;
+ _mesa_HashWalk(ctx->Shared->TexObjects, dump_texture_cb, ctx);
+}
+
+
+static void
+dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage)
+{
+ printf("Renderbuffer %u: %u x %u IntFormat = %s\n",
+ rb->Name, rb->Width, rb->Height,
+ _mesa_lookup_enum_by_nr(rb->InternalFormat));
+ if (writeImage) {
+ _mesa_write_renderbuffer_image(rb);
+ }
+}
+
+
+static void
+dump_renderbuffer_cb(GLuint id, void *data, void *userData)
+{
+ const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data;
+ (void) userData;
+ dump_renderbuffer(rb, WriteImages);
+}
+
+
+/**
+ * Print basic info about all renderbuffers to stdout.
+ * If dumpImages is true, write PPM of level[0] image to a file.
+ */
+void
+_mesa_dump_renderbuffers(GLboolean writeImages)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ WriteImages = writeImages;
+ _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx);
+}
+
+
+
+void
+_mesa_dump_color_buffer(const char *filename)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLuint w = ctx->DrawBuffer->Width;
+ const GLuint h = ctx->DrawBuffer->Height;
+ GLubyte *buf;
+
+ buf = (GLubyte *) malloc(w * h * 4);
+
+ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
+ _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
+
+ _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf);
+
+ printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n",
+ (void *) ctx->ReadBuffer->_ColorReadBuffer,
+ ctx->ReadBuffer->ColorReadBuffer,
+ (void *) ctx->DrawBuffer->_ColorDrawBuffers[0],
+ ctx->DrawBuffer->ColorDrawBuffer[0]);
+ printf("Writing %d x %d color buffer to %s\n", w, h, filename);
+ write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE);
+
+ _mesa_PopClientAttrib();
+
+ free(buf);
+}
+
+
+void
+_mesa_dump_depth_buffer(const char *filename)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLuint w = ctx->DrawBuffer->Width;
+ const GLuint h = ctx->DrawBuffer->Height;
+ GLuint *buf;
+ GLubyte *buf2;
+ GLuint i;
+
+ buf = (GLuint *) malloc(w * h * 4); /* 4 bpp */
+ buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */
+
+ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
+ _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
+
+ _mesa_ReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, buf);
+
+ /* spread 24 bits of Z across R, G, B */
+ for (i = 0; i < w * h; i++) {
+ buf2[i*3+0] = (buf[i] >> 24) & 0xff;
+ buf2[i*3+1] = (buf[i] >> 16) & 0xff;
+ buf2[i*3+2] = (buf[i] >> 8) & 0xff;
+ }
+
+ printf("Writing %d x %d depth buffer to %s\n", w, h, filename);
+ write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE);
+
+ _mesa_PopClientAttrib();
+
+ free(buf);
+ free(buf2);
+}
+
+
+void
+_mesa_dump_stencil_buffer(const char *filename)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLuint w = ctx->DrawBuffer->Width;
+ const GLuint h = ctx->DrawBuffer->Height;
+ GLubyte *buf;
+ GLubyte *buf2;
+ GLuint i;
+
+ buf = (GLubyte *) malloc(w * h); /* 1 bpp */
+ buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */
+
+ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
+ _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
+
+ _mesa_ReadPixels(0, 0, w, h, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, buf);
+
+ for (i = 0; i < w * h; i++) {
+ buf2[i*3+0] = buf[i];
+ buf2[i*3+1] = (buf[i] & 127) * 2;
+ buf2[i*3+2] = (buf[i] - 128) * 2;
+ }
+
+ printf("Writing %d x %d stencil buffer to %s\n", w, h, filename);
+ write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE);
+
+ _mesa_PopClientAttrib();
+
+ free(buf);
+ free(buf2);
+}
+
+
+void
+_mesa_dump_image(const char *filename, const void *image, GLuint w, GLuint h,
+ GLenum format, GLenum type)
+{
+ GLboolean invert = GL_TRUE;
+
+ if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
+ write_ppm(filename, image, w, h, 4, 0, 1, 2, invert);
+ }
+ else if (format == GL_BGRA && type == GL_UNSIGNED_BYTE) {
+ write_ppm(filename, image, w, h, 4, 2, 1, 0, invert);
+ }
+ else if (format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_BYTE) {
+ write_ppm(filename, image, w, h, 2, 1, 0, 0, invert);
+ }
+ else {
+ _mesa_problem(NULL, "Unsupported format/type in _mesa_dump_image()");
+ }
+}
+
+
+/**
+ * Quick and dirty function to "print" a texture to stdout.
+ */
+void
+_mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img)
+{
+#if CHAN_TYPE != GL_UNSIGNED_BYTE
+ _mesa_problem(NULL, "PrintTexture not supported");
+#else
+ GLuint i, j, c;
+ const GLubyte *data = (const GLubyte *) img->Data;
+
+ if (!data) {
+ printf("No texture data\n");
+ return;
+ }
+
+ /* XXX add more formats or make into a new format utility function */
+ switch (img->TexFormat) {
+ case MESA_FORMAT_A8:
+ case MESA_FORMAT_L8:
+ case MESA_FORMAT_I8:
+ case MESA_FORMAT_CI8:
+ c = 1;
+ break;
+ case MESA_FORMAT_AL88:
+ case MESA_FORMAT_AL88_REV:
+ c = 2;
+ break;
+ case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR888:
+ c = 3;
+ break;
+ case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ARGB8888:
+ c = 4;
+ break;
+ default:
+ _mesa_problem(NULL, "error in PrintTexture\n");
+ return;
+ }
+
+ for (i = 0; i < img->Height; i++) {
+ for (j = 0; j < img->Width; j++) {
+ if (c==1)
+ printf("%02x ", data[0]);
+ else if (c==2)
+ printf("%02x%02x ", data[0], data[1]);
+ else if (c==3)
+ printf("%02x%02x%02x ", data[0], data[1], data[2]);
+ else if (c==4)
+ printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
+ data += (img->RowStride - img->Width) * c;
+ }
+ /* XXX use img->ImageStride here */
+ printf("\n");
+ }
+#endif
+}
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index f9282398c..6e075b4e5 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -894,8 +894,8 @@ unpack_image(struct gl_context *ctx, GLuint dimensions,
GLvoid *image;
map = (GLubyte *)
- ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, unpack->BufferObj);
+ ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size,
+ GL_MAP_READ_BIT, unpack->BufferObj);
if (!map) {
/* unable to map src buffer! */
_mesa_error(ctx, GL_INVALID_OPERATION, "unable to map PBO");
@@ -906,8 +906,7 @@ unpack_image(struct gl_context *ctx, GLuint dimensions,
image = _mesa_unpack_image(dimensions, width, height, depth,
format, type, src, unpack);
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- unpack->BufferObj);
+ ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
diff --git a/mesalib/src/mesa/main/drawtex.c b/mesalib/src/mesa/main/drawtex.c
index e386e90f6..83485a928 100644
--- a/mesalib/src/mesa/main/drawtex.c
+++ b/mesalib/src/mesa/main/drawtex.c
@@ -1,133 +1,137 @@
-/*
- * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
- *
- * 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.
- */
-
-#include "main/drawtex.h"
-#include "main/state.h"
-#include "main/imports.h"
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-
-
-#if FEATURE_OES_draw_texture
-
-
-static void
-draw_texture(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
- GLfloat width, GLfloat height)
-{
- if (!ctx->Extensions.OES_draw_texture) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glDrawTex(unsupported)");
- return;
- }
- if (width <= 0.0f || height <= 0.0f) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTex(width or height <= 0)");
- return;
- }
-
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
- ASSERT(ctx->Driver.DrawTex);
- ctx->Driver.DrawTex(ctx, x, y, z, width, height);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx, x, y, z, width, height);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexfv(const GLfloat *coords)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx, coords[0], coords[1], coords[2], coords[3], coords[4]);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z,
- (GLfloat) width, (GLfloat) height);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexiv(const GLint *coords)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1],
- (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z,
- (GLfloat) width, (GLfloat) height);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexsv(const GLshort *coords)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1],
- (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx,
- (GLfloat) x / 65536.0f,
- (GLfloat) y / 65536.0f,
- (GLfloat) z / 65536.0f,
- (GLfloat) width / 65536.0f,
- (GLfloat) height / 65536.0f);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTexxv(const GLfixed *coords)
-{
- GET_CURRENT_CONTEXT(ctx);
- draw_texture(ctx,
- (GLfloat) coords[0] / 65536.0f,
- (GLfloat) coords[1] / 65536.0f,
- (GLfloat) coords[2] / 65536.0f,
- (GLfloat) coords[3] / 65536.0f,
- (GLfloat) coords[4] / 65536.0f);
-}
-
-#endif /* FEATURE_OES_draw_texture */
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * 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.
+ */
+
+#include "main/drawtex.h"
+#include "main/state.h"
+#include "main/imports.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+
+
+#if FEATURE_OES_draw_texture
+
+
+static void
+draw_texture(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat width, GLfloat height)
+{
+ if (!ctx->Extensions.OES_draw_texture) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawTex(unsupported)");
+ return;
+ }
+ if (width <= 0.0f || height <= 0.0f) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTex(width or height <= 0)");
+ return;
+ }
+
+ _mesa_set_vp_override(ctx, GL_TRUE);
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ ASSERT(ctx->Driver.DrawTex);
+ ctx->Driver.DrawTex(ctx, x, y, z, width, height);
+
+ _mesa_set_vp_override(ctx, GL_FALSE);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, x, y, z, width, height);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexfv(const GLfloat *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, coords[0], coords[1], coords[2], coords[3], coords[4]);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z,
+ (GLfloat) width, (GLfloat) height);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexiv(const GLint *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1],
+ (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z,
+ (GLfloat) width, (GLfloat) height);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexsv(const GLshort *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1],
+ (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx,
+ (GLfloat) x / 65536.0f,
+ (GLfloat) y / 65536.0f,
+ (GLfloat) z / 65536.0f,
+ (GLfloat) width / 65536.0f,
+ (GLfloat) height / 65536.0f);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexxv(const GLfixed *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx,
+ (GLfloat) coords[0] / 65536.0f,
+ (GLfloat) coords[1] / 65536.0f,
+ (GLfloat) coords[2] / 65536.0f,
+ (GLfloat) coords[3] / 65536.0f,
+ (GLfloat) coords[4] / 65536.0f);
+}
+
+#endif /* FEATURE_OES_draw_texture */
diff --git a/mesalib/src/mesa/main/enums.c b/mesalib/src/mesa/main/enums.c
index 8a50e2656..f55a23ada 100644
--- a/mesalib/src/mesa/main/enums.c
+++ b/mesalib/src/mesa/main/enums.c
@@ -1285,6 +1285,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_NUM_COMPRESSED_TEXTURE_FORMATS\0"
"GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB\0"
"GL_NUM_EXTENSIONS\0"
+ "GL_NUM_PROGRAM_BINARY_FORMATS\0"
"GL_NUM_PROGRAM_BINARY_FORMATS_OES\0"
"GL_NUM_SHADER_BINARY_FORMATS\0"
"GL_OBJECT_ACTIVE_ATTRIBUTES_ARB\0"
@@ -1493,8 +1494,11 @@ LONGSTRING static const char enum_string_table[] =
"GL_PROGRAM_ADDRESS_REGISTERS_ARB\0"
"GL_PROGRAM_ALU_INSTRUCTIONS_ARB\0"
"GL_PROGRAM_ATTRIBS_ARB\0"
+ "GL_PROGRAM_BINARY_FORMATS\0"
"GL_PROGRAM_BINARY_FORMATS_OES\0"
+ "GL_PROGRAM_BINARY_LENGTH\0"
"GL_PROGRAM_BINARY_LENGTH_OES\0"
+ "GL_PROGRAM_BINARY_RETRIEVABLE_HINT\0"
"GL_PROGRAM_BINDING_ARB\0"
"GL_PROGRAM_ERROR_POSITION_ARB\0"
"GL_PROGRAM_ERROR_POSITION_NV\0"
@@ -2352,7 +2356,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_ZOOM_Y\0"
;
-static const enum_elt all_enums[2313] =
+static const enum_elt all_enums[2317] =
{
{ 0, 0x00000600 }, /* GL_2D */
{ 6, 0x00001407 }, /* GL_2_BYTES */
@@ -3602,1096 +3606,1100 @@ static const enum_elt all_enums[2313] =
{ 27636, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
{ 27670, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */
{ 27708, 0x0000821D }, /* GL_NUM_EXTENSIONS */
- { 27726, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
- { 27760, 0x00008DF9 }, /* GL_NUM_SHADER_BINARY_FORMATS */
- { 27789, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- { 27821, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- { 27863, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- { 27893, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- { 27933, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- { 27964, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
- { 27993, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
- { 28021, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- { 28051, 0x00002401 }, /* GL_OBJECT_LINEAR */
- { 28068, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
- { 28094, 0x00002501 }, /* GL_OBJECT_PLANE */
- { 28110, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- { 28145, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
- { 28167, 0x00009112 }, /* GL_OBJECT_TYPE */
- { 28182, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
- { 28201, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- { 28231, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
- { 28252, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
- { 28280, 0x00000001 }, /* GL_ONE */
- { 28287, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- { 28315, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
- { 28347, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
- { 28375, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
- { 28407, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
- { 28430, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
- { 28453, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
- { 28476, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
- { 28499, 0x00008598 }, /* GL_OPERAND0_ALPHA */
- { 28517, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
- { 28539, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
- { 28561, 0x00008590 }, /* GL_OPERAND0_RGB */
- { 28577, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
- { 28597, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
- { 28617, 0x00008599 }, /* GL_OPERAND1_ALPHA */
- { 28635, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
- { 28657, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
- { 28679, 0x00008591 }, /* GL_OPERAND1_RGB */
- { 28695, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
- { 28715, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
- { 28735, 0x0000859A }, /* GL_OPERAND2_ALPHA */
- { 28753, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
- { 28775, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
- { 28797, 0x00008592 }, /* GL_OPERAND2_RGB */
- { 28813, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
- { 28833, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
- { 28853, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
- { 28874, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
- { 28893, 0x00001507 }, /* GL_OR */
- { 28899, 0x00000A01 }, /* GL_ORDER */
- { 28908, 0x0000150D }, /* GL_OR_INVERTED */
- { 28923, 0x0000150B }, /* GL_OR_REVERSE */
- { 28937, 0x00000505 }, /* GL_OUT_OF_MEMORY */
- { 28954, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
- { 28972, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
- { 28993, 0x00008758 }, /* GL_PACK_INVERT_MESA */
- { 29013, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
- { 29031, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
- { 29050, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
- { 29070, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
- { 29090, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
- { 29108, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
- { 29127, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
- { 29152, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
- { 29176, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
- { 29197, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
- { 29219, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
- { 29241, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
- { 29266, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
- { 29290, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
- { 29311, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
- { 29333, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
- { 29355, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
- { 29377, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
- { 29408, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
- { 29428, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- { 29453, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
- { 29473, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- { 29498, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
- { 29518, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- { 29543, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
- { 29563, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- { 29588, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
- { 29608, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- { 29633, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
- { 29653, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- { 29678, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
- { 29698, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- { 29723, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
- { 29743, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- { 29768, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
- { 29788, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- { 29813, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
- { 29833, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- { 29858, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
- { 29876, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */
- { 29897, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */
- { 29926, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- { 29959, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
- { 29984, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */
- { 30007, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
- { 30038, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- { 30073, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- { 30100, 0x00001B00 }, /* GL_POINT */
- { 30109, 0x00000000 }, /* GL_POINTS */
- { 30119, 0x00000002 }, /* GL_POINT_BIT */
- { 30132, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
- { 30162, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
- { 30196, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
- { 30230, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
- { 30265, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
- { 30294, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
- { 30327, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
- { 30360, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
- { 30394, 0x00000B11 }, /* GL_POINT_SIZE */
- { 30408, 0x00008B9F }, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
- { 30447, 0x00008B9C }, /* GL_POINT_SIZE_ARRAY_OES */
- { 30471, 0x0000898C }, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
- { 30503, 0x0000898B }, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
- { 30534, 0x0000898A }, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
- { 30563, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
- { 30589, 0x00008127 }, /* GL_POINT_SIZE_MAX */
- { 30607, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
- { 30629, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
- { 30651, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
- { 30674, 0x00008126 }, /* GL_POINT_SIZE_MIN */
- { 30692, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
- { 30714, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
- { 30736, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
- { 30759, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
- { 30779, 0x00000B10 }, /* GL_POINT_SMOOTH */
- { 30795, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
- { 30816, 0x00008861 }, /* GL_POINT_SPRITE */
- { 30832, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
- { 30852, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
- { 30881, 0x00008861 }, /* GL_POINT_SPRITE_NV */
- { 30900, 0x00008861 }, /* GL_POINT_SPRITE_OES */
- { 30920, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
- { 30946, 0x00000701 }, /* GL_POINT_TOKEN */
- { 30961, 0x00000009 }, /* GL_POLYGON */
- { 30972, 0x00000008 }, /* GL_POLYGON_BIT */
- { 30987, 0x00000B40 }, /* GL_POLYGON_MODE */
- { 31003, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
- { 31026, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
- { 31051, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
- { 31074, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
- { 31097, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
- { 31121, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
- { 31145, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
- { 31163, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
- { 31186, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
- { 31205, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
- { 31228, 0x00000703 }, /* GL_POLYGON_TOKEN */
- { 31245, 0x00001203 }, /* GL_POSITION */
- { 31257, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- { 31289, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
- { 31325, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- { 31358, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
- { 31395, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- { 31426, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
- { 31461, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- { 31493, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
- { 31529, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- { 31562, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- { 31594, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
- { 31630, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- { 31663, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
- { 31700, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- { 31730, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
- { 31764, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- { 31795, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
- { 31830, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- { 31861, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
- { 31896, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- { 31928, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
- { 31964, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- { 31994, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
- { 32028, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- { 32059, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
- { 32094, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- { 32126, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- { 32157, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
- { 32192, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- { 32224, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
- { 32260, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
- { 32289, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
- { 32322, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
- { 32352, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
- { 32386, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- { 32425, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- { 32458, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- { 32498, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- { 32532, 0x00008578 }, /* GL_PREVIOUS */
- { 32544, 0x00008578 }, /* GL_PREVIOUS_ARB */
- { 32560, 0x00008578 }, /* GL_PREVIOUS_EXT */
- { 32576, 0x00008577 }, /* GL_PRIMARY_COLOR */
- { 32593, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
- { 32614, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
- { 32635, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED */
- { 32659, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED_EXT */
- { 32687, 0x00008F9D }, /* GL_PRIMITIVE_RESTART */
- { 32708, 0x00008F9E }, /* GL_PRIMITIVE_RESTART_INDEX */
- { 32735, 0x00008559 }, /* GL_PRIMITIVE_RESTART_INDEX_NV */
- { 32765, 0x00008558 }, /* GL_PRIMITIVE_RESTART_NV */
- { 32789, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 32822, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 32854, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
- { 32877, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS_OES */
- { 32907, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH_OES */
- { 32936, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
- { 32959, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
- { 32989, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
- { 33018, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
- { 33046, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
- { 33068, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- { 33096, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- { 33124, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
- { 33146, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
- { 33167, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 33207, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 33246, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 33276, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 33311, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 33344, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 33378, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 33417, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 33456, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
- { 33478, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
- { 33504, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
- { 33528, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE */
- { 33550, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE_ARB */
- { 33576, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
- { 33599, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
- { 33621, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
- { 33642, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
- { 33663, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
- { 33690, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 33722, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 33754, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- { 33789, 0x00001701 }, /* GL_PROJECTION */
- { 33803, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
- { 33824, 0x0000898E }, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 33867, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
- { 33893, 0x00008E4F }, /* GL_PROVOKING_VERTEX */
- { 33913, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */
- { 33937, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
- { 33958, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
- { 33977, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
- { 34000, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- { 34039, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- { 34077, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
- { 34097, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY */
- { 34123, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
- { 34153, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
- { 34177, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
- { 34197, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY */
- { 34223, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
- { 34253, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
- { 34277, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
- { 34297, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- { 34330, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
- { 34356, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
- { 34386, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE */
- { 34413, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- { 34444, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
- { 34474, 0x00008A1D }, /* GL_PURGEABLE_APPLE */
- { 34493, 0x00002003 }, /* GL_Q */
- { 34498, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
- { 34523, 0x00000007 }, /* GL_QUADS */
- { 34532, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
- { 34576, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */
- { 34624, 0x00008614 }, /* GL_QUAD_MESH_SUN */
- { 34641, 0x00000008 }, /* GL_QUAD_STRIP */
- { 34655, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT */
- { 34682, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */
- { 34712, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT */
- { 34736, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */
- { 34763, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
- { 34785, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
- { 34811, 0x00008E14 }, /* GL_QUERY_NO_WAIT */
- { 34828, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */
- { 34848, 0x00008866 }, /* GL_QUERY_RESULT */
- { 34864, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
- { 34884, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
- { 34910, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
- { 34940, 0x00008E13 }, /* GL_QUERY_WAIT */
- { 34954, 0x00008E13 }, /* GL_QUERY_WAIT_NV */
- { 34971, 0x00002002 }, /* GL_R */
- { 34976, 0x00008C3A }, /* GL_R11F_G11F_B10F */
- { 34994, 0x00008F98 }, /* GL_R16_SNORM */
- { 35007, 0x00002A10 }, /* GL_R3_G3_B2 */
- { 35019, 0x00008F94 }, /* GL_R8_SNORM */
- { 35031, 0x00008C89 }, /* GL_RASTERIZER_DISCARD */
- { 35053, 0x00008C89 }, /* GL_RASTERIZER_DISCARD_EXT */
- { 35079, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- { 35112, 0x00000C02 }, /* GL_READ_BUFFER */
- { 35127, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */
- { 35147, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */
- { 35175, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- { 35207, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
- { 35231, 0x000088B8 }, /* GL_READ_ONLY */
- { 35244, 0x000088B8 }, /* GL_READ_ONLY_ARB */
- { 35261, 0x000088BA }, /* GL_READ_WRITE */
- { 35275, 0x000088BA }, /* GL_READ_WRITE_ARB */
- { 35293, 0x00001903 }, /* GL_RED */
- { 35300, 0x00008016 }, /* GL_REDUCE */
- { 35310, 0x00008016 }, /* GL_REDUCE_EXT */
- { 35324, 0x00000D15 }, /* GL_RED_BIAS */
- { 35336, 0x00000D52 }, /* GL_RED_BITS */
- { 35348, 0x00008D94 }, /* GL_RED_INTEGER */
- { 35363, 0x00008D94 }, /* GL_RED_INTEGER_EXT */
- { 35382, 0x00000D14 }, /* GL_RED_SCALE */
- { 35395, 0x00008F90 }, /* GL_RED_SNORM */
- { 35408, 0x00008512 }, /* GL_REFLECTION_MAP */
- { 35426, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
- { 35448, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
- { 35469, 0x00008512 }, /* GL_REFLECTION_MAP_OES */
- { 35491, 0x00008A19 }, /* GL_RELEASED_APPLE */
- { 35509, 0x00001C00 }, /* GL_RENDER */
- { 35519, 0x00008D41 }, /* GL_RENDERBUFFER */
- { 35535, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */
- { 35562, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE_OES */
- { 35593, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */
- { 35617, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
- { 35645, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_OES */
- { 35673, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */
- { 35699, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE_OES */
- { 35729, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */
- { 35756, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE_OES */
- { 35787, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
- { 35807, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */
- { 35834, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE_OES */
- { 35865, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */
- { 35888, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
- { 35915, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_OES */
- { 35942, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
- { 35974, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- { 36010, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
- { 36046, 0x00008D41 }, /* GL_RENDERBUFFER_OES */
- { 36066, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */
- { 36091, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE_OES */
- { 36120, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */
- { 36144, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */
- { 36172, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */
- { 36201, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE_OES */
- { 36234, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */
- { 36256, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
- { 36282, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_OES */
- { 36308, 0x00001F01 }, /* GL_RENDERER */
- { 36320, 0x00000C40 }, /* GL_RENDER_MODE */
- { 36335, 0x00002901 }, /* GL_REPEAT */
- { 36345, 0x00001E01 }, /* GL_REPLACE */
- { 36356, 0x00008062 }, /* GL_REPLACE_EXT */
- { 36371, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
- { 36394, 0x0000803A }, /* GL_RESCALE_NORMAL */
- { 36412, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
- { 36434, 0x00008256 }, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
- { 36469, 0x00008A1B }, /* GL_RETAINED_APPLE */
- { 36487, 0x00000102 }, /* GL_RETURN */
- { 36497, 0x00008F99 }, /* GL_RG16_SNORM */
- { 36511, 0x00008F95 }, /* GL_RG8_SNORM */
- { 36524, 0x00001907 }, /* GL_RGB */
- { 36531, 0x00008052 }, /* GL_RGB10 */
- { 36540, 0x00008059 }, /* GL_RGB10_A2 */
- { 36552, 0x00008059 }, /* GL_RGB10_A2_EXT */
- { 36568, 0x00008052 }, /* GL_RGB10_EXT */
- { 36581, 0x00008053 }, /* GL_RGB12 */
- { 36590, 0x00008053 }, /* GL_RGB12_EXT */
- { 36603, 0x00008054 }, /* GL_RGB16 */
- { 36612, 0x0000881B }, /* GL_RGB16F */
- { 36622, 0x00008D89 }, /* GL_RGB16I */
- { 36632, 0x00008D89 }, /* GL_RGB16I_EXT */
- { 36646, 0x00008D77 }, /* GL_RGB16UI */
- { 36657, 0x00008D77 }, /* GL_RGB16UI_EXT */
- { 36672, 0x00008054 }, /* GL_RGB16_EXT */
- { 36685, 0x00008F9A }, /* GL_RGB16_SNORM */
- { 36700, 0x0000804E }, /* GL_RGB2_EXT */
- { 36712, 0x00008815 }, /* GL_RGB32F */
- { 36722, 0x00008D83 }, /* GL_RGB32I */
- { 36732, 0x00008D83 }, /* GL_RGB32I_EXT */
- { 36746, 0x00008D71 }, /* GL_RGB32UI */
- { 36757, 0x00008D71 }, /* GL_RGB32UI_EXT */
- { 36772, 0x0000804F }, /* GL_RGB4 */
- { 36780, 0x0000804F }, /* GL_RGB4_EXT */
- { 36792, 0x000083A1 }, /* GL_RGB4_S3TC */
- { 36805, 0x00008050 }, /* GL_RGB5 */
- { 36813, 0x00008D62 }, /* GL_RGB565 */
- { 36823, 0x00008D62 }, /* GL_RGB565_OES */
- { 36837, 0x00008057 }, /* GL_RGB5_A1 */
- { 36848, 0x00008057 }, /* GL_RGB5_A1_EXT */
- { 36863, 0x00008057 }, /* GL_RGB5_A1_OES */
- { 36878, 0x00008050 }, /* GL_RGB5_EXT */
- { 36890, 0x00008051 }, /* GL_RGB8 */
- { 36898, 0x00008D8F }, /* GL_RGB8I */
- { 36907, 0x00008D8F }, /* GL_RGB8I_EXT */
- { 36920, 0x00008D7D }, /* GL_RGB8UI */
- { 36930, 0x00008D7D }, /* GL_RGB8UI_EXT */
- { 36944, 0x00008051 }, /* GL_RGB8_EXT */
- { 36956, 0x00008051 }, /* GL_RGB8_OES */
- { 36968, 0x00008F96 }, /* GL_RGB8_SNORM */
- { 36982, 0x00008C3D }, /* GL_RGB9_E5 */
- { 36993, 0x00001908 }, /* GL_RGBA */
- { 37001, 0x0000805A }, /* GL_RGBA12 */
- { 37011, 0x0000805A }, /* GL_RGBA12_EXT */
- { 37025, 0x0000805B }, /* GL_RGBA16 */
- { 37035, 0x0000881A }, /* GL_RGBA16F */
- { 37046, 0x00008D88 }, /* GL_RGBA16I */
- { 37057, 0x00008D88 }, /* GL_RGBA16I_EXT */
- { 37072, 0x00008D76 }, /* GL_RGBA16UI */
- { 37084, 0x00008D76 }, /* GL_RGBA16UI_EXT */
- { 37100, 0x0000805B }, /* GL_RGBA16_EXT */
- { 37114, 0x00008F9B }, /* GL_RGBA16_SNORM */
- { 37130, 0x00008055 }, /* GL_RGBA2 */
- { 37139, 0x00008055 }, /* GL_RGBA2_EXT */
- { 37152, 0x00008814 }, /* GL_RGBA32F */
- { 37163, 0x00008D82 }, /* GL_RGBA32I */
- { 37174, 0x00008D82 }, /* GL_RGBA32I_EXT */
- { 37189, 0x00008D70 }, /* GL_RGBA32UI */
- { 37201, 0x00008D70 }, /* GL_RGBA32UI_EXT */
- { 37217, 0x00008056 }, /* GL_RGBA4 */
- { 37226, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
- { 37245, 0x00008056 }, /* GL_RGBA4_EXT */
- { 37258, 0x00008056 }, /* GL_RGBA4_OES */
- { 37271, 0x000083A3 }, /* GL_RGBA4_S3TC */
- { 37285, 0x00008058 }, /* GL_RGBA8 */
- { 37294, 0x00008D8E }, /* GL_RGBA8I */
- { 37304, 0x00008D8E }, /* GL_RGBA8I_EXT */
- { 37318, 0x00008D7C }, /* GL_RGBA8UI */
- { 37329, 0x00008D7C }, /* GL_RGBA8UI_EXT */
- { 37344, 0x00008058 }, /* GL_RGBA8_EXT */
- { 37357, 0x00008058 }, /* GL_RGBA8_OES */
- { 37370, 0x00008F97 }, /* GL_RGBA8_SNORM */
- { 37385, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
- { 37403, 0x00008820 }, /* GL_RGBA_FLOAT_MODE_ARB */
- { 37426, 0x00008D99 }, /* GL_RGBA_INTEGER */
- { 37442, 0x00008D99 }, /* GL_RGBA_INTEGER_EXT */
- { 37462, 0x00008D9E }, /* GL_RGBA_INTEGER_MODE_EXT */
- { 37487, 0x00000C31 }, /* GL_RGBA_MODE */
- { 37500, 0x000083A2 }, /* GL_RGBA_S3TC */
- { 37513, 0x00008F93 }, /* GL_RGBA_SNORM */
- { 37527, 0x00008D98 }, /* GL_RGB_INTEGER */
- { 37542, 0x00008D98 }, /* GL_RGB_INTEGER_EXT */
- { 37561, 0x000083A0 }, /* GL_RGB_S3TC */
- { 37573, 0x00008573 }, /* GL_RGB_SCALE */
- { 37586, 0x00008573 }, /* GL_RGB_SCALE_ARB */
- { 37603, 0x00008573 }, /* GL_RGB_SCALE_EXT */
- { 37620, 0x00008F92 }, /* GL_RGB_SNORM */
- { 37633, 0x00008F91 }, /* GL_RG_SNORM */
- { 37645, 0x00000407 }, /* GL_RIGHT */
- { 37654, 0x00002000 }, /* GL_S */
- { 37659, 0x00008B5D }, /* GL_SAMPLER_1D */
- { 37673, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY */
- { 37693, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY_EXT */
- { 37717, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW */
- { 37744, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW_EXT */
- { 37775, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
- { 37796, 0x00008B5E }, /* GL_SAMPLER_2D */
- { 37810, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY */
- { 37830, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY_EXT */
- { 37854, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW */
- { 37881, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW_EXT */
- { 37912, 0x00008B63 }, /* GL_SAMPLER_2D_RECT */
- { 37931, 0x00008B64 }, /* GL_SAMPLER_2D_RECT_SHADOW */
- { 37957, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
- { 37978, 0x00008B5F }, /* GL_SAMPLER_3D */
- { 37992, 0x00008B5F }, /* GL_SAMPLER_3D_OES */
- { 38010, 0x00008919 }, /* GL_SAMPLER_BINDING */
- { 38029, 0x00008DC2 }, /* GL_SAMPLER_BUFFER */
- { 38047, 0x00008DC2 }, /* GL_SAMPLER_BUFFER_EXT */
- { 38069, 0x00008B60 }, /* GL_SAMPLER_CUBE */
- { 38085, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW */
- { 38108, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW_EXT */
- { 38135, 0x000080A9 }, /* GL_SAMPLES */
- { 38146, 0x000086B4 }, /* GL_SAMPLES_3DFX */
- { 38162, 0x000080A9 }, /* GL_SAMPLES_ARB */
- { 38177, 0x00008914 }, /* GL_SAMPLES_PASSED */
- { 38195, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
- { 38217, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- { 38245, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
- { 38277, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
- { 38300, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
- { 38327, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
- { 38345, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
- { 38368, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
- { 38390, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
- { 38409, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
- { 38432, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
- { 38458, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
- { 38488, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
- { 38513, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
- { 38542, 0x00080000 }, /* GL_SCISSOR_BIT */
- { 38557, 0x00000C10 }, /* GL_SCISSOR_BOX */
- { 38572, 0x00000C11 }, /* GL_SCISSOR_TEST */
- { 38588, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
- { 38613, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- { 38653, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 38697, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- { 38730, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- { 38760, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- { 38792, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- { 38822, 0x00001C02 }, /* GL_SELECT */
- { 38832, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
- { 38860, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
- { 38885, 0x00008012 }, /* GL_SEPARABLE_2D */
- { 38901, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS */
- { 38921, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS_EXT */
- { 38945, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
- { 38972, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
- { 39003, 0x0000150F }, /* GL_SET */
- { 39010, 0x00008DF8 }, /* GL_SHADER_BINARY_FORMATS */
- { 39035, 0x00008DFA }, /* GL_SHADER_COMPILER */
- { 39054, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
- { 39075, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
- { 39099, 0x00008B4F }, /* GL_SHADER_TYPE */
- { 39114, 0x00000B54 }, /* GL_SHADE_MODEL */
- { 39129, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
- { 39157, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
- { 39180, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- { 39210, 0x00001601 }, /* GL_SHININESS */
- { 39223, 0x00001402 }, /* GL_SHORT */
- { 39232, 0x00009119 }, /* GL_SIGNALED */
- { 39244, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */
- { 39265, 0x000081F9 }, /* GL_SINGLE_COLOR */
- { 39281, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
- { 39301, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
- { 39320, 0x00008C46 }, /* GL_SLUMINANCE */
- { 39334, 0x00008C47 }, /* GL_SLUMINANCE8 */
- { 39349, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */
- { 39371, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */
- { 39391, 0x00001D01 }, /* GL_SMOOTH */
- { 39401, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
- { 39434, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
- { 39461, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
- { 39494, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
- { 39521, 0x00008588 }, /* GL_SOURCE0_ALPHA */
- { 39538, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
- { 39559, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
- { 39580, 0x00008580 }, /* GL_SOURCE0_RGB */
- { 39595, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
- { 39614, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
- { 39633, 0x00008589 }, /* GL_SOURCE1_ALPHA */
- { 39650, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
- { 39671, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
- { 39692, 0x00008581 }, /* GL_SOURCE1_RGB */
- { 39707, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
- { 39726, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
- { 39745, 0x0000858A }, /* GL_SOURCE2_ALPHA */
- { 39762, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
- { 39783, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
- { 39804, 0x00008582 }, /* GL_SOURCE2_RGB */
- { 39819, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
- { 39838, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
- { 39857, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
- { 39877, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
- { 39895, 0x00001202 }, /* GL_SPECULAR */
- { 39907, 0x00002402 }, /* GL_SPHERE_MAP */
- { 39921, 0x00001206 }, /* GL_SPOT_CUTOFF */
- { 39936, 0x00001204 }, /* GL_SPOT_DIRECTION */
- { 39954, 0x00001205 }, /* GL_SPOT_EXPONENT */
- { 39971, 0x00008588 }, /* GL_SRC0_ALPHA */
- { 39985, 0x00008580 }, /* GL_SRC0_RGB */
- { 39997, 0x00008589 }, /* GL_SRC1_ALPHA */
- { 40011, 0x00008581 }, /* GL_SRC1_RGB */
- { 40023, 0x0000858A }, /* GL_SRC2_ALPHA */
- { 40037, 0x00008582 }, /* GL_SRC2_RGB */
- { 40049, 0x00000302 }, /* GL_SRC_ALPHA */
- { 40062, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
- { 40084, 0x00000300 }, /* GL_SRC_COLOR */
- { 40097, 0x00008C40 }, /* GL_SRGB */
- { 40105, 0x00008C41 }, /* GL_SRGB8 */
- { 40114, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */
- { 40130, 0x00008C42 }, /* GL_SRGB_ALPHA */
- { 40144, 0x00000503 }, /* GL_STACK_OVERFLOW */
- { 40162, 0x00000504 }, /* GL_STACK_UNDERFLOW */
- { 40181, 0x000088E6 }, /* GL_STATIC_COPY */
- { 40196, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
- { 40215, 0x000088E4 }, /* GL_STATIC_DRAW */
- { 40230, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
- { 40249, 0x000088E5 }, /* GL_STATIC_READ */
- { 40264, 0x000088E5 }, /* GL_STATIC_READ_ARB */
- { 40283, 0x00001802 }, /* GL_STENCIL */
- { 40294, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */
- { 40316, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
- { 40342, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_OES */
- { 40368, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
- { 40389, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
- { 40414, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
- { 40435, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
- { 40460, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- { 40492, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
- { 40528, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
- { 40560, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
- { 40596, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
- { 40616, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
- { 40643, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
- { 40669, 0x00000D57 }, /* GL_STENCIL_BITS */
- { 40685, 0x00008224 }, /* GL_STENCIL_BUFFER */
- { 40703, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
- { 40725, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
- { 40748, 0x00000B94 }, /* GL_STENCIL_FAIL */
- { 40764, 0x00000B92 }, /* GL_STENCIL_FUNC */
- { 40780, 0x00001901 }, /* GL_STENCIL_INDEX */
- { 40797, 0x00008D46 }, /* GL_STENCIL_INDEX1 */
- { 40815, 0x00008D49 }, /* GL_STENCIL_INDEX16 */
- { 40834, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
- { 40857, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
- { 40879, 0x00008D46 }, /* GL_STENCIL_INDEX1_OES */
- { 40901, 0x00008D47 }, /* GL_STENCIL_INDEX4 */
- { 40919, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
- { 40941, 0x00008D47 }, /* GL_STENCIL_INDEX4_OES */
- { 40963, 0x00008D48 }, /* GL_STENCIL_INDEX8 */
- { 40981, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
- { 41003, 0x00008D48 }, /* GL_STENCIL_INDEX8_OES */
- { 41025, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
- { 41046, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
- { 41073, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
- { 41100, 0x00000B97 }, /* GL_STENCIL_REF */
- { 41115, 0x00000B90 }, /* GL_STENCIL_TEST */
- { 41131, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- { 41160, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
- { 41182, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
- { 41203, 0x00000C33 }, /* GL_STEREO */
- { 41213, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */
- { 41237, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */
- { 41262, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */
- { 41286, 0x000088E2 }, /* GL_STREAM_COPY */
- { 41301, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
- { 41320, 0x000088E0 }, /* GL_STREAM_DRAW */
- { 41335, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
- { 41354, 0x000088E1 }, /* GL_STREAM_READ */
- { 41369, 0x000088E1 }, /* GL_STREAM_READ_ARB */
- { 41388, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
- { 41405, 0x000084E7 }, /* GL_SUBTRACT */
- { 41417, 0x000084E7 }, /* GL_SUBTRACT_ARB */
- { 41433, 0x00009113 }, /* GL_SYNC_CONDITION */
- { 41451, 0x00009116 }, /* GL_SYNC_FENCE */
- { 41465, 0x00009115 }, /* GL_SYNC_FLAGS */
- { 41479, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */
- { 41506, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
- { 41536, 0x00009114 }, /* GL_SYNC_STATUS */
- { 41551, 0x00002001 }, /* GL_T */
- { 41556, 0x00002A2A }, /* GL_T2F_C3F_V3F */
- { 41571, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
- { 41590, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
- { 41606, 0x00002A2B }, /* GL_T2F_N3F_V3F */
- { 41621, 0x00002A27 }, /* GL_T2F_V3F */
- { 41632, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
- { 41651, 0x00002A28 }, /* GL_T4F_V4F */
- { 41662, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
- { 41685, 0x00001702 }, /* GL_TEXTURE */
- { 41696, 0x000084C0 }, /* GL_TEXTURE0 */
- { 41708, 0x000084C0 }, /* GL_TEXTURE0_ARB */
- { 41724, 0x000084C1 }, /* GL_TEXTURE1 */
- { 41736, 0x000084CA }, /* GL_TEXTURE10 */
- { 41749, 0x000084CA }, /* GL_TEXTURE10_ARB */
- { 41766, 0x000084CB }, /* GL_TEXTURE11 */
- { 41779, 0x000084CB }, /* GL_TEXTURE11_ARB */
- { 41796, 0x000084CC }, /* GL_TEXTURE12 */
- { 41809, 0x000084CC }, /* GL_TEXTURE12_ARB */
- { 41826, 0x000084CD }, /* GL_TEXTURE13 */
- { 41839, 0x000084CD }, /* GL_TEXTURE13_ARB */
- { 41856, 0x000084CE }, /* GL_TEXTURE14 */
- { 41869, 0x000084CE }, /* GL_TEXTURE14_ARB */
- { 41886, 0x000084CF }, /* GL_TEXTURE15 */
- { 41899, 0x000084CF }, /* GL_TEXTURE15_ARB */
- { 41916, 0x000084D0 }, /* GL_TEXTURE16 */
- { 41929, 0x000084D0 }, /* GL_TEXTURE16_ARB */
- { 41946, 0x000084D1 }, /* GL_TEXTURE17 */
- { 41959, 0x000084D1 }, /* GL_TEXTURE17_ARB */
- { 41976, 0x000084D2 }, /* GL_TEXTURE18 */
- { 41989, 0x000084D2 }, /* GL_TEXTURE18_ARB */
- { 42006, 0x000084D3 }, /* GL_TEXTURE19 */
- { 42019, 0x000084D3 }, /* GL_TEXTURE19_ARB */
- { 42036, 0x000084C1 }, /* GL_TEXTURE1_ARB */
- { 42052, 0x000084C2 }, /* GL_TEXTURE2 */
- { 42064, 0x000084D4 }, /* GL_TEXTURE20 */
- { 42077, 0x000084D4 }, /* GL_TEXTURE20_ARB */
- { 42094, 0x000084D5 }, /* GL_TEXTURE21 */
- { 42107, 0x000084D5 }, /* GL_TEXTURE21_ARB */
- { 42124, 0x000084D6 }, /* GL_TEXTURE22 */
- { 42137, 0x000084D6 }, /* GL_TEXTURE22_ARB */
- { 42154, 0x000084D7 }, /* GL_TEXTURE23 */
- { 42167, 0x000084D7 }, /* GL_TEXTURE23_ARB */
- { 42184, 0x000084D8 }, /* GL_TEXTURE24 */
- { 42197, 0x000084D8 }, /* GL_TEXTURE24_ARB */
- { 42214, 0x000084D9 }, /* GL_TEXTURE25 */
- { 42227, 0x000084D9 }, /* GL_TEXTURE25_ARB */
- { 42244, 0x000084DA }, /* GL_TEXTURE26 */
- { 42257, 0x000084DA }, /* GL_TEXTURE26_ARB */
- { 42274, 0x000084DB }, /* GL_TEXTURE27 */
- { 42287, 0x000084DB }, /* GL_TEXTURE27_ARB */
- { 42304, 0x000084DC }, /* GL_TEXTURE28 */
- { 42317, 0x000084DC }, /* GL_TEXTURE28_ARB */
- { 42334, 0x000084DD }, /* GL_TEXTURE29 */
- { 42347, 0x000084DD }, /* GL_TEXTURE29_ARB */
- { 42364, 0x000084C2 }, /* GL_TEXTURE2_ARB */
- { 42380, 0x000084C3 }, /* GL_TEXTURE3 */
- { 42392, 0x000084DE }, /* GL_TEXTURE30 */
- { 42405, 0x000084DE }, /* GL_TEXTURE30_ARB */
- { 42422, 0x000084DF }, /* GL_TEXTURE31 */
- { 42435, 0x000084DF }, /* GL_TEXTURE31_ARB */
- { 42452, 0x000084C3 }, /* GL_TEXTURE3_ARB */
- { 42468, 0x000084C4 }, /* GL_TEXTURE4 */
- { 42480, 0x000084C4 }, /* GL_TEXTURE4_ARB */
- { 42496, 0x000084C5 }, /* GL_TEXTURE5 */
- { 42508, 0x000084C5 }, /* GL_TEXTURE5_ARB */
- { 42524, 0x000084C6 }, /* GL_TEXTURE6 */
- { 42536, 0x000084C6 }, /* GL_TEXTURE6_ARB */
- { 42552, 0x000084C7 }, /* GL_TEXTURE7 */
- { 42564, 0x000084C7 }, /* GL_TEXTURE7_ARB */
- { 42580, 0x000084C8 }, /* GL_TEXTURE8 */
- { 42592, 0x000084C8 }, /* GL_TEXTURE8_ARB */
- { 42608, 0x000084C9 }, /* GL_TEXTURE9 */
- { 42620, 0x000084C9 }, /* GL_TEXTURE9_ARB */
- { 42636, 0x00000DE0 }, /* GL_TEXTURE_1D */
- { 42650, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY */
- { 42670, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
- { 42694, 0x00000DE1 }, /* GL_TEXTURE_2D */
- { 42708, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY */
- { 42728, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
- { 42752, 0x0000806F }, /* GL_TEXTURE_3D */
- { 42766, 0x0000806F }, /* GL_TEXTURE_3D_OES */
- { 42784, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
- { 42806, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
- { 42832, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
- { 42854, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
- { 42876, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY */
- { 42904, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
- { 42936, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
- { 42958, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY */
- { 42986, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
- { 43018, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
- { 43040, 0x0000806A }, /* GL_TEXTURE_BINDING_3D_OES */
- { 43066, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER */
- { 43092, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER_ARB */
- { 43122, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
- { 43150, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
- { 43182, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_OES */
- { 43214, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE */
- { 43243, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- { 43276, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
- { 43308, 0x00040000 }, /* GL_TEXTURE_BIT */
- { 43323, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
- { 43344, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
- { 43369, 0x00001005 }, /* GL_TEXTURE_BORDER */
- { 43387, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
- { 43411, 0x00008C2A }, /* GL_TEXTURE_BUFFER */
- { 43429, 0x00008C2A }, /* GL_TEXTURE_BUFFER_ARB */
- { 43451, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
- { 43488, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB */
- { 43529, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT */
- { 43554, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT_ARB */
- { 43583, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- { 43614, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- { 43644, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- { 43674, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- { 43709, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- { 43740, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 43778, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
- { 43805, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- { 43837, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- { 43871, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
- { 43895, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
- { 43923, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
- { 43947, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
- { 43975, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- { 44008, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
- { 44032, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
- { 44054, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
- { 44076, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
- { 44102, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 44136, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- { 44169, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
- { 44206, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
- { 44234, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
- { 44266, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
- { 44289, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- { 44327, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
- { 44369, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- { 44400, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- { 44428, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- { 44458, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- { 44486, 0x00008B9D }, /* GL_TEXTURE_CROP_RECT_OES */
- { 44511, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
- { 44531, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
- { 44555, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- { 44586, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
- { 44621, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES */
- { 44656, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- { 44687, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
- { 44722, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES */
- { 44757, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- { 44788, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
- { 44823, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES */
- { 44858, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_OES */
- { 44882, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- { 44913, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
- { 44948, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES */
- { 44983, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- { 45014, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
- { 45049, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES */
- { 45084, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- { 45115, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
- { 45150, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES */
- { 45185, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
- { 45214, 0x00008071 }, /* GL_TEXTURE_DEPTH */
- { 45231, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
- { 45253, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
- { 45279, 0x00002300 }, /* GL_TEXTURE_ENV */
- { 45294, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
- { 45315, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
- { 45335, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
- { 45361, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL_EXT */
- { 45391, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
- { 45411, 0x00002500 }, /* GL_TEXTURE_GEN_MODE_OES */
- { 45435, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
- { 45452, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
- { 45469, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
- { 45486, 0x00008D60 }, /* GL_TEXTURE_GEN_STR_OES */
- { 45509, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
- { 45526, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
- { 45551, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
- { 45573, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
- { 45599, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
- { 45617, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
- { 45643, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
- { 45669, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
- { 45699, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
- { 45726, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
- { 45751, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
- { 45771, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
- { 45795, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- { 45822, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- { 45849, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- { 45876, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
- { 45902, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
- { 45932, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
- { 45954, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
- { 45972, 0x0000898F }, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 46012, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- { 46042, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- { 46070, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- { 46098, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- { 46126, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
- { 46147, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
- { 46166, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
- { 46188, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
- { 46207, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
- { 46227, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
- { 46257, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */
- { 46288, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE */
- { 46309, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
- { 46334, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
- { 46358, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
- { 46378, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
- { 46402, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
- { 46422, 0x00008C3F }, /* GL_TEXTURE_SHARED_SIZE */
- { 46445, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
- { 46468, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */
- { 46492, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */
- { 46520, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */
- { 46550, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
- { 46575, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- { 46609, 0x00001000 }, /* GL_TEXTURE_WIDTH */
- { 46626, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
- { 46644, 0x00008072 }, /* GL_TEXTURE_WRAP_R_OES */
- { 46666, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
- { 46684, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
- { 46702, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */
- { 46721, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
- { 46741, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 46760, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 46789, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 46806, 0x00008E22 }, /* GL_TRANSFORM_FEEDBACK */
- { 46828, 0x00008E25 }, /* GL_TRANSFORM_FEEDBACK_BINDING */
- { 46858, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER */
- { 46887, 0x00008E24 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
- { 46923, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
- { 46960, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT */
- { 47001, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER_EXT */
- { 47034, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
- { 47068, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT */
- { 47106, 0x00008E23 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
- { 47142, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
- { 47176, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT */
- { 47214, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
- { 47249, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT */
- { 47288, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
- { 47329, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT */
- { 47374, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
- { 47405, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS_EXT */
- { 47440, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
- { 47481, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT */
- { 47526, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 47552, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 47582, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 47614, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 47644, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 47678, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 47694, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 47725, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 47760, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 47788, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 47820, 0x00000004 }, /* GL_TRIANGLES */
- { 47833, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY */
- { 47856, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY_ARB */
- { 47883, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 47899, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 47920, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 47938, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY */
- { 47966, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY_ARB */
- { 47998, 0x00000001 }, /* GL_TRUE */
- { 48006, 0x00008A1C }, /* GL_UNDEFINED_APPLE */
- { 48025, 0x00008255 }, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
- { 48054, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 48074, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 48097, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 48117, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 48138, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 48160, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 48182, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 48202, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 48223, 0x00009118 }, /* GL_UNSIGNALED */
- { 48237, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 48254, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 48281, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 48304, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 48320, 0x00008C3B }, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
- { 48352, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 48379, 0x00008DF6 }, /* GL_UNSIGNED_INT_10_10_10_2_OES */
- { 48410, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
- { 48431, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
- { 48456, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 48480, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_OES */
- { 48505, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 48536, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV_EXT */
- { 48571, 0x00008C3E }, /* GL_UNSIGNED_INT_5_9_9_9_REV */
- { 48599, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 48623, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 48651, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D */
- { 48678, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
- { 48711, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT */
- { 48748, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D_EXT */
- { 48779, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D */
- { 48806, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
- { 48839, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT */
- { 48876, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D_EXT */
- { 48907, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
- { 48939, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT */
- { 48975, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D */
- { 49002, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D_EXT */
- { 49033, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
- { 49064, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT */
- { 49099, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
- { 49128, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE_EXT */
- { 49161, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2 */
- { 49182, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2_EXT */
- { 49207, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3 */
- { 49228, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3_EXT */
- { 49253, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4 */
- { 49274, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4_EXT */
- { 49299, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
- { 49322, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 49340, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 49370, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT */
- { 49404, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 49430, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 49460, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT */
- { 49494, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 49520, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 49544, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 49572, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 49600, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 49627, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 49659, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 49690, 0x00008CA2 }, /* GL_UPPER_LEFT */
- { 49704, 0x00002A20 }, /* GL_V2F */
- { 49711, 0x00002A21 }, /* GL_V3F */
- { 49718, 0x00008B83 }, /* GL_VALIDATE_STATUS */
- { 49737, 0x00001F00 }, /* GL_VENDOR */
- { 49747, 0x00001F02 }, /* GL_VERSION */
- { 49758, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 49774, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
- { 49798, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- { 49828, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 49859, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 49894, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 49918, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 49939, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 49962, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 49983, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 50010, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 50038, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 50066, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 50094, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 50122, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 50150, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 50178, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 50205, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 50232, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 50259, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 50286, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 50313, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 50340, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 50367, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 50394, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 50421, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 50459, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 50501, 0x000088FE }, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
- { 50536, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- { 50567, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 50602, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
- { 50633, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT */
- { 50668, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
- { 50702, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 50740, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- { 50771, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 50806, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- { 50834, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 50866, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- { 50896, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 50930, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
- { 50958, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 50990, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 51010, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 51032, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 51061, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 51082, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
- { 51111, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 51144, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 51176, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- { 51203, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 51234, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 51264, 0x00008B31 }, /* GL_VERTEX_SHADER */
- { 51281, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 51302, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 51329, 0x00000BA2 }, /* GL_VIEWPORT */
- { 51341, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 51357, 0x00008A1A }, /* GL_VOLATILE_APPLE */
- { 51375, 0x0000911D }, /* GL_WAIT_FAILED */
- { 51390, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 51410, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 51441, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 51476, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_OES */
- { 51511, 0x000086AD }, /* GL_WEIGHT_ARRAY_OES */
- { 51531, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 51559, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_OES */
- { 51587, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 51612, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_OES */
- { 51637, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 51664, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_OES */
- { 51691, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 51716, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_OES */
- { 51741, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 51765, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 51784, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 51798, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 51816, 0x000088B9 }, /* GL_WRITE_ONLY_OES */
- { 51834, 0x00001506 }, /* GL_XOR */
- { 51841, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 51860, 0x00008757 }, /* GL_YCBCR_MESA */
- { 51874, 0x00000000 }, /* GL_ZERO */
- { 51882, 0x00000D16 }, /* GL_ZOOM_X */
- { 51892, 0x00000D17 }, /* GL_ZOOM_Y */
+ { 27726, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS */
+ { 27756, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
+ { 27790, 0x00008DF9 }, /* GL_NUM_SHADER_BINARY_FORMATS */
+ { 27819, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ { 27851, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ { 27893, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ { 27923, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ { 27963, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ { 27994, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ { 28023, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
+ { 28051, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ { 28081, 0x00002401 }, /* GL_OBJECT_LINEAR */
+ { 28098, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
+ { 28124, 0x00002501 }, /* GL_OBJECT_PLANE */
+ { 28140, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ { 28175, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
+ { 28197, 0x00009112 }, /* GL_OBJECT_TYPE */
+ { 28212, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
+ { 28231, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ { 28261, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
+ { 28282, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
+ { 28310, 0x00000001 }, /* GL_ONE */
+ { 28317, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ { 28345, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
+ { 28377, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ { 28405, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
+ { 28437, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
+ { 28460, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
+ { 28483, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
+ { 28506, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
+ { 28529, 0x00008598 }, /* GL_OPERAND0_ALPHA */
+ { 28547, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
+ { 28569, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
+ { 28591, 0x00008590 }, /* GL_OPERAND0_RGB */
+ { 28607, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
+ { 28627, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
+ { 28647, 0x00008599 }, /* GL_OPERAND1_ALPHA */
+ { 28665, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
+ { 28687, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
+ { 28709, 0x00008591 }, /* GL_OPERAND1_RGB */
+ { 28725, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
+ { 28745, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
+ { 28765, 0x0000859A }, /* GL_OPERAND2_ALPHA */
+ { 28783, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
+ { 28805, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
+ { 28827, 0x00008592 }, /* GL_OPERAND2_RGB */
+ { 28843, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
+ { 28863, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
+ { 28883, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
+ { 28904, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
+ { 28923, 0x00001507 }, /* GL_OR */
+ { 28929, 0x00000A01 }, /* GL_ORDER */
+ { 28938, 0x0000150D }, /* GL_OR_INVERTED */
+ { 28953, 0x0000150B }, /* GL_OR_REVERSE */
+ { 28967, 0x00000505 }, /* GL_OUT_OF_MEMORY */
+ { 28984, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
+ { 29002, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
+ { 29023, 0x00008758 }, /* GL_PACK_INVERT_MESA */
+ { 29043, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
+ { 29061, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
+ { 29080, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
+ { 29100, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
+ { 29120, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
+ { 29138, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
+ { 29157, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
+ { 29182, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
+ { 29206, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
+ { 29227, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
+ { 29249, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
+ { 29271, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
+ { 29296, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
+ { 29320, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
+ { 29341, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
+ { 29363, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
+ { 29385, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
+ { 29407, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ { 29438, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
+ { 29458, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ { 29483, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
+ { 29503, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ { 29528, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
+ { 29548, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ { 29573, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
+ { 29593, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ { 29618, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
+ { 29638, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ { 29663, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
+ { 29683, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ { 29708, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
+ { 29728, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ { 29753, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
+ { 29773, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ { 29798, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
+ { 29818, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ { 29843, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
+ { 29863, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ { 29888, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
+ { 29906, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */
+ { 29927, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */
+ { 29956, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ { 29989, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
+ { 30014, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */
+ { 30037, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
+ { 30068, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ { 30103, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ { 30130, 0x00001B00 }, /* GL_POINT */
+ { 30139, 0x00000000 }, /* GL_POINTS */
+ { 30149, 0x00000002 }, /* GL_POINT_BIT */
+ { 30162, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
+ { 30192, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
+ { 30226, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
+ { 30260, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
+ { 30295, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ { 30324, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
+ { 30357, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
+ { 30390, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
+ { 30424, 0x00000B11 }, /* GL_POINT_SIZE */
+ { 30438, 0x00008B9F }, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
+ { 30477, 0x00008B9C }, /* GL_POINT_SIZE_ARRAY_OES */
+ { 30501, 0x0000898C }, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
+ { 30533, 0x0000898B }, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
+ { 30564, 0x0000898A }, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
+ { 30593, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
+ { 30619, 0x00008127 }, /* GL_POINT_SIZE_MAX */
+ { 30637, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
+ { 30659, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
+ { 30681, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
+ { 30704, 0x00008126 }, /* GL_POINT_SIZE_MIN */
+ { 30722, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
+ { 30744, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
+ { 30766, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
+ { 30789, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
+ { 30809, 0x00000B10 }, /* GL_POINT_SMOOTH */
+ { 30825, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
+ { 30846, 0x00008861 }, /* GL_POINT_SPRITE */
+ { 30862, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
+ { 30882, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ { 30911, 0x00008861 }, /* GL_POINT_SPRITE_NV */
+ { 30930, 0x00008861 }, /* GL_POINT_SPRITE_OES */
+ { 30950, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
+ { 30976, 0x00000701 }, /* GL_POINT_TOKEN */
+ { 30991, 0x00000009 }, /* GL_POLYGON */
+ { 31002, 0x00000008 }, /* GL_POLYGON_BIT */
+ { 31017, 0x00000B40 }, /* GL_POLYGON_MODE */
+ { 31033, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
+ { 31056, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
+ { 31081, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
+ { 31104, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
+ { 31127, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
+ { 31151, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
+ { 31175, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
+ { 31193, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
+ { 31216, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
+ { 31235, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
+ { 31258, 0x00000703 }, /* GL_POLYGON_TOKEN */
+ { 31275, 0x00001203 }, /* GL_POSITION */
+ { 31287, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ { 31319, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
+ { 31355, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ { 31388, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
+ { 31425, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ { 31456, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
+ { 31491, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ { 31523, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
+ { 31559, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 31592, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ { 31624, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
+ { 31660, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ { 31693, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
+ { 31730, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ { 31760, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
+ { 31794, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ { 31825, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
+ { 31860, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ { 31891, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
+ { 31926, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ { 31958, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
+ { 31994, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ { 32024, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
+ { 32058, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ { 32089, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
+ { 32124, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ { 32156, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ { 32187, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
+ { 32222, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ { 32254, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
+ { 32290, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
+ { 32319, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
+ { 32352, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
+ { 32382, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
+ { 32416, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ { 32455, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ { 32488, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ { 32528, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ { 32562, 0x00008578 }, /* GL_PREVIOUS */
+ { 32574, 0x00008578 }, /* GL_PREVIOUS_ARB */
+ { 32590, 0x00008578 }, /* GL_PREVIOUS_EXT */
+ { 32606, 0x00008577 }, /* GL_PRIMARY_COLOR */
+ { 32623, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
+ { 32644, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
+ { 32665, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED */
+ { 32689, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED_EXT */
+ { 32717, 0x00008F9D }, /* GL_PRIMITIVE_RESTART */
+ { 32738, 0x00008F9E }, /* GL_PRIMITIVE_RESTART_INDEX */
+ { 32765, 0x00008559 }, /* GL_PRIMITIVE_RESTART_INDEX_NV */
+ { 32795, 0x00008558 }, /* GL_PRIMITIVE_RESTART_NV */
+ { 32819, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 32852, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 32884, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
+ { 32907, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS */
+ { 32933, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS_OES */
+ { 32963, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH */
+ { 32988, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH_OES */
+ { 33017, 0x00008257 }, /* GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
+ { 33052, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
+ { 33075, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ { 33105, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
+ { 33134, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
+ { 33162, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
+ { 33184, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ { 33212, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ { 33240, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
+ { 33262, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
+ { 33283, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 33323, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 33362, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 33392, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 33427, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 33460, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 33494, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 33533, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 33572, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
+ { 33594, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
+ { 33620, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
+ { 33644, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE */
+ { 33666, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE_ARB */
+ { 33692, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
+ { 33715, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
+ { 33737, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
+ { 33758, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
+ { 33779, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
+ { 33806, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 33838, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 33870, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ { 33905, 0x00001701 }, /* GL_PROJECTION */
+ { 33919, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
+ { 33940, 0x0000898E }, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 33983, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
+ { 34009, 0x00008E4F }, /* GL_PROVOKING_VERTEX */
+ { 34029, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */
+ { 34053, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
+ { 34074, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
+ { 34093, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
+ { 34116, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 34155, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ { 34193, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
+ { 34213, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY */
+ { 34239, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
+ { 34269, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
+ { 34293, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
+ { 34313, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY */
+ { 34339, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
+ { 34369, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
+ { 34393, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
+ { 34413, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ { 34446, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ { 34472, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
+ { 34502, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE */
+ { 34529, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ { 34560, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
+ { 34590, 0x00008A1D }, /* GL_PURGEABLE_APPLE */
+ { 34609, 0x00002003 }, /* GL_Q */
+ { 34614, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
+ { 34639, 0x00000007 }, /* GL_QUADS */
+ { 34648, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+ { 34692, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */
+ { 34740, 0x00008614 }, /* GL_QUAD_MESH_SUN */
+ { 34757, 0x00000008 }, /* GL_QUAD_STRIP */
+ { 34771, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT */
+ { 34798, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */
+ { 34828, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT */
+ { 34852, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */
+ { 34879, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
+ { 34901, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
+ { 34927, 0x00008E14 }, /* GL_QUERY_NO_WAIT */
+ { 34944, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */
+ { 34964, 0x00008866 }, /* GL_QUERY_RESULT */
+ { 34980, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
+ { 35000, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
+ { 35026, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
+ { 35056, 0x00008E13 }, /* GL_QUERY_WAIT */
+ { 35070, 0x00008E13 }, /* GL_QUERY_WAIT_NV */
+ { 35087, 0x00002002 }, /* GL_R */
+ { 35092, 0x00008C3A }, /* GL_R11F_G11F_B10F */
+ { 35110, 0x00008F98 }, /* GL_R16_SNORM */
+ { 35123, 0x00002A10 }, /* GL_R3_G3_B2 */
+ { 35135, 0x00008F94 }, /* GL_R8_SNORM */
+ { 35147, 0x00008C89 }, /* GL_RASTERIZER_DISCARD */
+ { 35169, 0x00008C89 }, /* GL_RASTERIZER_DISCARD_EXT */
+ { 35195, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ { 35228, 0x00000C02 }, /* GL_READ_BUFFER */
+ { 35243, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */
+ { 35263, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */
+ { 35291, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ { 35323, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
+ { 35347, 0x000088B8 }, /* GL_READ_ONLY */
+ { 35360, 0x000088B8 }, /* GL_READ_ONLY_ARB */
+ { 35377, 0x000088BA }, /* GL_READ_WRITE */
+ { 35391, 0x000088BA }, /* GL_READ_WRITE_ARB */
+ { 35409, 0x00001903 }, /* GL_RED */
+ { 35416, 0x00008016 }, /* GL_REDUCE */
+ { 35426, 0x00008016 }, /* GL_REDUCE_EXT */
+ { 35440, 0x00000D15 }, /* GL_RED_BIAS */
+ { 35452, 0x00000D52 }, /* GL_RED_BITS */
+ { 35464, 0x00008D94 }, /* GL_RED_INTEGER */
+ { 35479, 0x00008D94 }, /* GL_RED_INTEGER_EXT */
+ { 35498, 0x00000D14 }, /* GL_RED_SCALE */
+ { 35511, 0x00008F90 }, /* GL_RED_SNORM */
+ { 35524, 0x00008512 }, /* GL_REFLECTION_MAP */
+ { 35542, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
+ { 35564, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
+ { 35585, 0x00008512 }, /* GL_REFLECTION_MAP_OES */
+ { 35607, 0x00008A19 }, /* GL_RELEASED_APPLE */
+ { 35625, 0x00001C00 }, /* GL_RENDER */
+ { 35635, 0x00008D41 }, /* GL_RENDERBUFFER */
+ { 35651, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ { 35678, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE_OES */
+ { 35709, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */
+ { 35733, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
+ { 35761, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_OES */
+ { 35789, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */
+ { 35815, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE_OES */
+ { 35845, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ { 35872, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE_OES */
+ { 35903, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
+ { 35923, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */
+ { 35950, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE_OES */
+ { 35981, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */
+ { 36004, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ { 36031, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_OES */
+ { 36058, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ { 36090, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ { 36126, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
+ { 36162, 0x00008D41 }, /* GL_RENDERBUFFER_OES */
+ { 36182, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */
+ { 36207, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE_OES */
+ { 36236, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */
+ { 36260, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */
+ { 36288, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ { 36317, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE_OES */
+ { 36350, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */
+ { 36372, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
+ { 36398, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_OES */
+ { 36424, 0x00001F01 }, /* GL_RENDERER */
+ { 36436, 0x00000C40 }, /* GL_RENDER_MODE */
+ { 36451, 0x00002901 }, /* GL_REPEAT */
+ { 36461, 0x00001E01 }, /* GL_REPLACE */
+ { 36472, 0x00008062 }, /* GL_REPLACE_EXT */
+ { 36487, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
+ { 36510, 0x0000803A }, /* GL_RESCALE_NORMAL */
+ { 36528, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
+ { 36550, 0x00008256 }, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
+ { 36585, 0x00008A1B }, /* GL_RETAINED_APPLE */
+ { 36603, 0x00000102 }, /* GL_RETURN */
+ { 36613, 0x00008F99 }, /* GL_RG16_SNORM */
+ { 36627, 0x00008F95 }, /* GL_RG8_SNORM */
+ { 36640, 0x00001907 }, /* GL_RGB */
+ { 36647, 0x00008052 }, /* GL_RGB10 */
+ { 36656, 0x00008059 }, /* GL_RGB10_A2 */
+ { 36668, 0x00008059 }, /* GL_RGB10_A2_EXT */
+ { 36684, 0x00008052 }, /* GL_RGB10_EXT */
+ { 36697, 0x00008053 }, /* GL_RGB12 */
+ { 36706, 0x00008053 }, /* GL_RGB12_EXT */
+ { 36719, 0x00008054 }, /* GL_RGB16 */
+ { 36728, 0x0000881B }, /* GL_RGB16F */
+ { 36738, 0x00008D89 }, /* GL_RGB16I */
+ { 36748, 0x00008D89 }, /* GL_RGB16I_EXT */
+ { 36762, 0x00008D77 }, /* GL_RGB16UI */
+ { 36773, 0x00008D77 }, /* GL_RGB16UI_EXT */
+ { 36788, 0x00008054 }, /* GL_RGB16_EXT */
+ { 36801, 0x00008F9A }, /* GL_RGB16_SNORM */
+ { 36816, 0x0000804E }, /* GL_RGB2_EXT */
+ { 36828, 0x00008815 }, /* GL_RGB32F */
+ { 36838, 0x00008D83 }, /* GL_RGB32I */
+ { 36848, 0x00008D83 }, /* GL_RGB32I_EXT */
+ { 36862, 0x00008D71 }, /* GL_RGB32UI */
+ { 36873, 0x00008D71 }, /* GL_RGB32UI_EXT */
+ { 36888, 0x0000804F }, /* GL_RGB4 */
+ { 36896, 0x0000804F }, /* GL_RGB4_EXT */
+ { 36908, 0x000083A1 }, /* GL_RGB4_S3TC */
+ { 36921, 0x00008050 }, /* GL_RGB5 */
+ { 36929, 0x00008D62 }, /* GL_RGB565 */
+ { 36939, 0x00008D62 }, /* GL_RGB565_OES */
+ { 36953, 0x00008057 }, /* GL_RGB5_A1 */
+ { 36964, 0x00008057 }, /* GL_RGB5_A1_EXT */
+ { 36979, 0x00008057 }, /* GL_RGB5_A1_OES */
+ { 36994, 0x00008050 }, /* GL_RGB5_EXT */
+ { 37006, 0x00008051 }, /* GL_RGB8 */
+ { 37014, 0x00008D8F }, /* GL_RGB8I */
+ { 37023, 0x00008D8F }, /* GL_RGB8I_EXT */
+ { 37036, 0x00008D7D }, /* GL_RGB8UI */
+ { 37046, 0x00008D7D }, /* GL_RGB8UI_EXT */
+ { 37060, 0x00008051 }, /* GL_RGB8_EXT */
+ { 37072, 0x00008051 }, /* GL_RGB8_OES */
+ { 37084, 0x00008F96 }, /* GL_RGB8_SNORM */
+ { 37098, 0x00008C3D }, /* GL_RGB9_E5 */
+ { 37109, 0x00001908 }, /* GL_RGBA */
+ { 37117, 0x0000805A }, /* GL_RGBA12 */
+ { 37127, 0x0000805A }, /* GL_RGBA12_EXT */
+ { 37141, 0x0000805B }, /* GL_RGBA16 */
+ { 37151, 0x0000881A }, /* GL_RGBA16F */
+ { 37162, 0x00008D88 }, /* GL_RGBA16I */
+ { 37173, 0x00008D88 }, /* GL_RGBA16I_EXT */
+ { 37188, 0x00008D76 }, /* GL_RGBA16UI */
+ { 37200, 0x00008D76 }, /* GL_RGBA16UI_EXT */
+ { 37216, 0x0000805B }, /* GL_RGBA16_EXT */
+ { 37230, 0x00008F9B }, /* GL_RGBA16_SNORM */
+ { 37246, 0x00008055 }, /* GL_RGBA2 */
+ { 37255, 0x00008055 }, /* GL_RGBA2_EXT */
+ { 37268, 0x00008814 }, /* GL_RGBA32F */
+ { 37279, 0x00008D82 }, /* GL_RGBA32I */
+ { 37290, 0x00008D82 }, /* GL_RGBA32I_EXT */
+ { 37305, 0x00008D70 }, /* GL_RGBA32UI */
+ { 37317, 0x00008D70 }, /* GL_RGBA32UI_EXT */
+ { 37333, 0x00008056 }, /* GL_RGBA4 */
+ { 37342, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
+ { 37361, 0x00008056 }, /* GL_RGBA4_EXT */
+ { 37374, 0x00008056 }, /* GL_RGBA4_OES */
+ { 37387, 0x000083A3 }, /* GL_RGBA4_S3TC */
+ { 37401, 0x00008058 }, /* GL_RGBA8 */
+ { 37410, 0x00008D8E }, /* GL_RGBA8I */
+ { 37420, 0x00008D8E }, /* GL_RGBA8I_EXT */
+ { 37434, 0x00008D7C }, /* GL_RGBA8UI */
+ { 37445, 0x00008D7C }, /* GL_RGBA8UI_EXT */
+ { 37460, 0x00008058 }, /* GL_RGBA8_EXT */
+ { 37473, 0x00008058 }, /* GL_RGBA8_OES */
+ { 37486, 0x00008F97 }, /* GL_RGBA8_SNORM */
+ { 37501, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
+ { 37519, 0x00008820 }, /* GL_RGBA_FLOAT_MODE_ARB */
+ { 37542, 0x00008D99 }, /* GL_RGBA_INTEGER */
+ { 37558, 0x00008D99 }, /* GL_RGBA_INTEGER_EXT */
+ { 37578, 0x00008D9E }, /* GL_RGBA_INTEGER_MODE_EXT */
+ { 37603, 0x00000C31 }, /* GL_RGBA_MODE */
+ { 37616, 0x000083A2 }, /* GL_RGBA_S3TC */
+ { 37629, 0x00008F93 }, /* GL_RGBA_SNORM */
+ { 37643, 0x00008D98 }, /* GL_RGB_INTEGER */
+ { 37658, 0x00008D98 }, /* GL_RGB_INTEGER_EXT */
+ { 37677, 0x000083A0 }, /* GL_RGB_S3TC */
+ { 37689, 0x00008573 }, /* GL_RGB_SCALE */
+ { 37702, 0x00008573 }, /* GL_RGB_SCALE_ARB */
+ { 37719, 0x00008573 }, /* GL_RGB_SCALE_EXT */
+ { 37736, 0x00008F92 }, /* GL_RGB_SNORM */
+ { 37749, 0x00008F91 }, /* GL_RG_SNORM */
+ { 37761, 0x00000407 }, /* GL_RIGHT */
+ { 37770, 0x00002000 }, /* GL_S */
+ { 37775, 0x00008B5D }, /* GL_SAMPLER_1D */
+ { 37789, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY */
+ { 37809, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY_EXT */
+ { 37833, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW */
+ { 37860, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW_EXT */
+ { 37891, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
+ { 37912, 0x00008B5E }, /* GL_SAMPLER_2D */
+ { 37926, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY */
+ { 37946, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY_EXT */
+ { 37970, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW */
+ { 37997, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW_EXT */
+ { 38028, 0x00008B63 }, /* GL_SAMPLER_2D_RECT */
+ { 38047, 0x00008B64 }, /* GL_SAMPLER_2D_RECT_SHADOW */
+ { 38073, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
+ { 38094, 0x00008B5F }, /* GL_SAMPLER_3D */
+ { 38108, 0x00008B5F }, /* GL_SAMPLER_3D_OES */
+ { 38126, 0x00008919 }, /* GL_SAMPLER_BINDING */
+ { 38145, 0x00008DC2 }, /* GL_SAMPLER_BUFFER */
+ { 38163, 0x00008DC2 }, /* GL_SAMPLER_BUFFER_EXT */
+ { 38185, 0x00008B60 }, /* GL_SAMPLER_CUBE */
+ { 38201, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW */
+ { 38224, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW_EXT */
+ { 38251, 0x000080A9 }, /* GL_SAMPLES */
+ { 38262, 0x000086B4 }, /* GL_SAMPLES_3DFX */
+ { 38278, 0x000080A9 }, /* GL_SAMPLES_ARB */
+ { 38293, 0x00008914 }, /* GL_SAMPLES_PASSED */
+ { 38311, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
+ { 38333, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ { 38361, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
+ { 38393, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
+ { 38416, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
+ { 38443, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
+ { 38461, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
+ { 38484, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
+ { 38506, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
+ { 38525, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
+ { 38548, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
+ { 38574, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
+ { 38604, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
+ { 38629, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
+ { 38658, 0x00080000 }, /* GL_SCISSOR_BIT */
+ { 38673, 0x00000C10 }, /* GL_SCISSOR_BOX */
+ { 38688, 0x00000C11 }, /* GL_SCISSOR_TEST */
+ { 38704, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
+ { 38729, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ { 38769, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 38813, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ { 38846, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ { 38876, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ { 38908, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ { 38938, 0x00001C02 }, /* GL_SELECT */
+ { 38948, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
+ { 38976, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
+ { 39001, 0x00008012 }, /* GL_SEPARABLE_2D */
+ { 39017, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS */
+ { 39037, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS_EXT */
+ { 39061, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
+ { 39088, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
+ { 39119, 0x0000150F }, /* GL_SET */
+ { 39126, 0x00008DF8 }, /* GL_SHADER_BINARY_FORMATS */
+ { 39151, 0x00008DFA }, /* GL_SHADER_COMPILER */
+ { 39170, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
+ { 39191, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
+ { 39215, 0x00008B4F }, /* GL_SHADER_TYPE */
+ { 39230, 0x00000B54 }, /* GL_SHADE_MODEL */
+ { 39245, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
+ { 39273, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
+ { 39296, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ { 39326, 0x00001601 }, /* GL_SHININESS */
+ { 39339, 0x00001402 }, /* GL_SHORT */
+ { 39348, 0x00009119 }, /* GL_SIGNALED */
+ { 39360, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */
+ { 39381, 0x000081F9 }, /* GL_SINGLE_COLOR */
+ { 39397, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
+ { 39417, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
+ { 39436, 0x00008C46 }, /* GL_SLUMINANCE */
+ { 39450, 0x00008C47 }, /* GL_SLUMINANCE8 */
+ { 39465, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */
+ { 39487, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */
+ { 39507, 0x00001D01 }, /* GL_SMOOTH */
+ { 39517, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+ { 39550, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
+ { 39577, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
+ { 39610, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
+ { 39637, 0x00008588 }, /* GL_SOURCE0_ALPHA */
+ { 39654, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
+ { 39675, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
+ { 39696, 0x00008580 }, /* GL_SOURCE0_RGB */
+ { 39711, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
+ { 39730, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
+ { 39749, 0x00008589 }, /* GL_SOURCE1_ALPHA */
+ { 39766, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
+ { 39787, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
+ { 39808, 0x00008581 }, /* GL_SOURCE1_RGB */
+ { 39823, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
+ { 39842, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
+ { 39861, 0x0000858A }, /* GL_SOURCE2_ALPHA */
+ { 39878, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
+ { 39899, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
+ { 39920, 0x00008582 }, /* GL_SOURCE2_RGB */
+ { 39935, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
+ { 39954, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
+ { 39973, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
+ { 39993, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
+ { 40011, 0x00001202 }, /* GL_SPECULAR */
+ { 40023, 0x00002402 }, /* GL_SPHERE_MAP */
+ { 40037, 0x00001206 }, /* GL_SPOT_CUTOFF */
+ { 40052, 0x00001204 }, /* GL_SPOT_DIRECTION */
+ { 40070, 0x00001205 }, /* GL_SPOT_EXPONENT */
+ { 40087, 0x00008588 }, /* GL_SRC0_ALPHA */
+ { 40101, 0x00008580 }, /* GL_SRC0_RGB */
+ { 40113, 0x00008589 }, /* GL_SRC1_ALPHA */
+ { 40127, 0x00008581 }, /* GL_SRC1_RGB */
+ { 40139, 0x0000858A }, /* GL_SRC2_ALPHA */
+ { 40153, 0x00008582 }, /* GL_SRC2_RGB */
+ { 40165, 0x00000302 }, /* GL_SRC_ALPHA */
+ { 40178, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
+ { 40200, 0x00000300 }, /* GL_SRC_COLOR */
+ { 40213, 0x00008C40 }, /* GL_SRGB */
+ { 40221, 0x00008C41 }, /* GL_SRGB8 */
+ { 40230, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */
+ { 40246, 0x00008C42 }, /* GL_SRGB_ALPHA */
+ { 40260, 0x00000503 }, /* GL_STACK_OVERFLOW */
+ { 40278, 0x00000504 }, /* GL_STACK_UNDERFLOW */
+ { 40297, 0x000088E6 }, /* GL_STATIC_COPY */
+ { 40312, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
+ { 40331, 0x000088E4 }, /* GL_STATIC_DRAW */
+ { 40346, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
+ { 40365, 0x000088E5 }, /* GL_STATIC_READ */
+ { 40380, 0x000088E5 }, /* GL_STATIC_READ_ARB */
+ { 40399, 0x00001802 }, /* GL_STENCIL */
+ { 40410, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */
+ { 40432, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
+ { 40458, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_OES */
+ { 40484, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
+ { 40505, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
+ { 40530, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
+ { 40551, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
+ { 40576, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ { 40608, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
+ { 40644, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ { 40676, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
+ { 40712, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
+ { 40732, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
+ { 40759, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
+ { 40785, 0x00000D57 }, /* GL_STENCIL_BITS */
+ { 40801, 0x00008224 }, /* GL_STENCIL_BUFFER */
+ { 40819, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
+ { 40841, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
+ { 40864, 0x00000B94 }, /* GL_STENCIL_FAIL */
+ { 40880, 0x00000B92 }, /* GL_STENCIL_FUNC */
+ { 40896, 0x00001901 }, /* GL_STENCIL_INDEX */
+ { 40913, 0x00008D46 }, /* GL_STENCIL_INDEX1 */
+ { 40931, 0x00008D49 }, /* GL_STENCIL_INDEX16 */
+ { 40950, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
+ { 40973, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
+ { 40995, 0x00008D46 }, /* GL_STENCIL_INDEX1_OES */
+ { 41017, 0x00008D47 }, /* GL_STENCIL_INDEX4 */
+ { 41035, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
+ { 41057, 0x00008D47 }, /* GL_STENCIL_INDEX4_OES */
+ { 41079, 0x00008D48 }, /* GL_STENCIL_INDEX8 */
+ { 41097, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
+ { 41119, 0x00008D48 }, /* GL_STENCIL_INDEX8_OES */
+ { 41141, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
+ { 41162, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ { 41189, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
+ { 41216, 0x00000B97 }, /* GL_STENCIL_REF */
+ { 41231, 0x00000B90 }, /* GL_STENCIL_TEST */
+ { 41247, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ { 41276, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
+ { 41298, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
+ { 41319, 0x00000C33 }, /* GL_STEREO */
+ { 41329, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */
+ { 41353, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */
+ { 41378, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */
+ { 41402, 0x000088E2 }, /* GL_STREAM_COPY */
+ { 41417, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
+ { 41436, 0x000088E0 }, /* GL_STREAM_DRAW */
+ { 41451, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
+ { 41470, 0x000088E1 }, /* GL_STREAM_READ */
+ { 41485, 0x000088E1 }, /* GL_STREAM_READ_ARB */
+ { 41504, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
+ { 41521, 0x000084E7 }, /* GL_SUBTRACT */
+ { 41533, 0x000084E7 }, /* GL_SUBTRACT_ARB */
+ { 41549, 0x00009113 }, /* GL_SYNC_CONDITION */
+ { 41567, 0x00009116 }, /* GL_SYNC_FENCE */
+ { 41581, 0x00009115 }, /* GL_SYNC_FLAGS */
+ { 41595, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */
+ { 41622, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
+ { 41652, 0x00009114 }, /* GL_SYNC_STATUS */
+ { 41667, 0x00002001 }, /* GL_T */
+ { 41672, 0x00002A2A }, /* GL_T2F_C3F_V3F */
+ { 41687, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
+ { 41706, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
+ { 41722, 0x00002A2B }, /* GL_T2F_N3F_V3F */
+ { 41737, 0x00002A27 }, /* GL_T2F_V3F */
+ { 41748, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
+ { 41767, 0x00002A28 }, /* GL_T4F_V4F */
+ { 41778, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
+ { 41801, 0x00001702 }, /* GL_TEXTURE */
+ { 41812, 0x000084C0 }, /* GL_TEXTURE0 */
+ { 41824, 0x000084C0 }, /* GL_TEXTURE0_ARB */
+ { 41840, 0x000084C1 }, /* GL_TEXTURE1 */
+ { 41852, 0x000084CA }, /* GL_TEXTURE10 */
+ { 41865, 0x000084CA }, /* GL_TEXTURE10_ARB */
+ { 41882, 0x000084CB }, /* GL_TEXTURE11 */
+ { 41895, 0x000084CB }, /* GL_TEXTURE11_ARB */
+ { 41912, 0x000084CC }, /* GL_TEXTURE12 */
+ { 41925, 0x000084CC }, /* GL_TEXTURE12_ARB */
+ { 41942, 0x000084CD }, /* GL_TEXTURE13 */
+ { 41955, 0x000084CD }, /* GL_TEXTURE13_ARB */
+ { 41972, 0x000084CE }, /* GL_TEXTURE14 */
+ { 41985, 0x000084CE }, /* GL_TEXTURE14_ARB */
+ { 42002, 0x000084CF }, /* GL_TEXTURE15 */
+ { 42015, 0x000084CF }, /* GL_TEXTURE15_ARB */
+ { 42032, 0x000084D0 }, /* GL_TEXTURE16 */
+ { 42045, 0x000084D0 }, /* GL_TEXTURE16_ARB */
+ { 42062, 0x000084D1 }, /* GL_TEXTURE17 */
+ { 42075, 0x000084D1 }, /* GL_TEXTURE17_ARB */
+ { 42092, 0x000084D2 }, /* GL_TEXTURE18 */
+ { 42105, 0x000084D2 }, /* GL_TEXTURE18_ARB */
+ { 42122, 0x000084D3 }, /* GL_TEXTURE19 */
+ { 42135, 0x000084D3 }, /* GL_TEXTURE19_ARB */
+ { 42152, 0x000084C1 }, /* GL_TEXTURE1_ARB */
+ { 42168, 0x000084C2 }, /* GL_TEXTURE2 */
+ { 42180, 0x000084D4 }, /* GL_TEXTURE20 */
+ { 42193, 0x000084D4 }, /* GL_TEXTURE20_ARB */
+ { 42210, 0x000084D5 }, /* GL_TEXTURE21 */
+ { 42223, 0x000084D5 }, /* GL_TEXTURE21_ARB */
+ { 42240, 0x000084D6 }, /* GL_TEXTURE22 */
+ { 42253, 0x000084D6 }, /* GL_TEXTURE22_ARB */
+ { 42270, 0x000084D7 }, /* GL_TEXTURE23 */
+ { 42283, 0x000084D7 }, /* GL_TEXTURE23_ARB */
+ { 42300, 0x000084D8 }, /* GL_TEXTURE24 */
+ { 42313, 0x000084D8 }, /* GL_TEXTURE24_ARB */
+ { 42330, 0x000084D9 }, /* GL_TEXTURE25 */
+ { 42343, 0x000084D9 }, /* GL_TEXTURE25_ARB */
+ { 42360, 0x000084DA }, /* GL_TEXTURE26 */
+ { 42373, 0x000084DA }, /* GL_TEXTURE26_ARB */
+ { 42390, 0x000084DB }, /* GL_TEXTURE27 */
+ { 42403, 0x000084DB }, /* GL_TEXTURE27_ARB */
+ { 42420, 0x000084DC }, /* GL_TEXTURE28 */
+ { 42433, 0x000084DC }, /* GL_TEXTURE28_ARB */
+ { 42450, 0x000084DD }, /* GL_TEXTURE29 */
+ { 42463, 0x000084DD }, /* GL_TEXTURE29_ARB */
+ { 42480, 0x000084C2 }, /* GL_TEXTURE2_ARB */
+ { 42496, 0x000084C3 }, /* GL_TEXTURE3 */
+ { 42508, 0x000084DE }, /* GL_TEXTURE30 */
+ { 42521, 0x000084DE }, /* GL_TEXTURE30_ARB */
+ { 42538, 0x000084DF }, /* GL_TEXTURE31 */
+ { 42551, 0x000084DF }, /* GL_TEXTURE31_ARB */
+ { 42568, 0x000084C3 }, /* GL_TEXTURE3_ARB */
+ { 42584, 0x000084C4 }, /* GL_TEXTURE4 */
+ { 42596, 0x000084C4 }, /* GL_TEXTURE4_ARB */
+ { 42612, 0x000084C5 }, /* GL_TEXTURE5 */
+ { 42624, 0x000084C5 }, /* GL_TEXTURE5_ARB */
+ { 42640, 0x000084C6 }, /* GL_TEXTURE6 */
+ { 42652, 0x000084C6 }, /* GL_TEXTURE6_ARB */
+ { 42668, 0x000084C7 }, /* GL_TEXTURE7 */
+ { 42680, 0x000084C7 }, /* GL_TEXTURE7_ARB */
+ { 42696, 0x000084C8 }, /* GL_TEXTURE8 */
+ { 42708, 0x000084C8 }, /* GL_TEXTURE8_ARB */
+ { 42724, 0x000084C9 }, /* GL_TEXTURE9 */
+ { 42736, 0x000084C9 }, /* GL_TEXTURE9_ARB */
+ { 42752, 0x00000DE0 }, /* GL_TEXTURE_1D */
+ { 42766, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY */
+ { 42786, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
+ { 42810, 0x00000DE1 }, /* GL_TEXTURE_2D */
+ { 42824, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY */
+ { 42844, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
+ { 42868, 0x0000806F }, /* GL_TEXTURE_3D */
+ { 42882, 0x0000806F }, /* GL_TEXTURE_3D_OES */
+ { 42900, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
+ { 42922, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
+ { 42948, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
+ { 42970, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
+ { 42992, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY */
+ { 43020, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
+ { 43052, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
+ { 43074, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY */
+ { 43102, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
+ { 43134, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
+ { 43156, 0x0000806A }, /* GL_TEXTURE_BINDING_3D_OES */
+ { 43182, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER */
+ { 43208, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER_ARB */
+ { 43238, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ { 43266, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
+ { 43298, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_OES */
+ { 43330, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE */
+ { 43359, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ { 43392, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
+ { 43424, 0x00040000 }, /* GL_TEXTURE_BIT */
+ { 43439, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
+ { 43460, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
+ { 43485, 0x00001005 }, /* GL_TEXTURE_BORDER */
+ { 43503, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
+ { 43527, 0x00008C2A }, /* GL_TEXTURE_BUFFER */
+ { 43545, 0x00008C2A }, /* GL_TEXTURE_BUFFER_ARB */
+ { 43567, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
+ { 43604, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB */
+ { 43645, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT */
+ { 43670, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT_ARB */
+ { 43699, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ { 43730, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ { 43760, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ { 43790, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ { 43825, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ { 43856, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 43894, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ { 43921, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ { 43953, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ { 43987, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
+ { 44011, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
+ { 44039, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
+ { 44063, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
+ { 44091, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ { 44124, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
+ { 44148, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
+ { 44170, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
+ { 44192, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
+ { 44218, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 44252, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ { 44285, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
+ { 44322, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
+ { 44350, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
+ { 44382, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
+ { 44405, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ { 44443, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
+ { 44485, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ { 44516, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ { 44544, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ { 44574, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ { 44602, 0x00008B9D }, /* GL_TEXTURE_CROP_RECT_OES */
+ { 44627, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
+ { 44647, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
+ { 44671, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ { 44702, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
+ { 44737, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES */
+ { 44772, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ { 44803, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
+ { 44838, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES */
+ { 44873, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ { 44904, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
+ { 44939, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES */
+ { 44974, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_OES */
+ { 44998, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ { 45029, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
+ { 45064, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES */
+ { 45099, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ { 45130, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
+ { 45165, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES */
+ { 45200, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ { 45231, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
+ { 45266, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES */
+ { 45301, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
+ { 45330, 0x00008071 }, /* GL_TEXTURE_DEPTH */
+ { 45347, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
+ { 45369, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
+ { 45395, 0x00002300 }, /* GL_TEXTURE_ENV */
+ { 45410, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
+ { 45431, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
+ { 45451, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
+ { 45477, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL_EXT */
+ { 45507, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
+ { 45527, 0x00002500 }, /* GL_TEXTURE_GEN_MODE_OES */
+ { 45551, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
+ { 45568, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
+ { 45585, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
+ { 45602, 0x00008D60 }, /* GL_TEXTURE_GEN_STR_OES */
+ { 45625, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
+ { 45642, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ { 45667, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
+ { 45689, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
+ { 45715, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
+ { 45733, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ { 45759, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
+ { 45785, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
+ { 45815, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
+ { 45842, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ { 45867, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
+ { 45887, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
+ { 45911, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ { 45938, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ { 45965, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ { 45992, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
+ { 46018, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
+ { 46048, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
+ { 46070, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
+ { 46088, 0x0000898F }, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 46128, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 46158, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ { 46186, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ { 46214, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ { 46242, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
+ { 46263, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
+ { 46282, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
+ { 46304, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
+ { 46323, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
+ { 46343, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
+ { 46373, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */
+ { 46404, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE */
+ { 46425, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
+ { 46450, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
+ { 46474, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
+ { 46494, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
+ { 46518, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
+ { 46538, 0x00008C3F }, /* GL_TEXTURE_SHARED_SIZE */
+ { 46561, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
+ { 46584, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */
+ { 46608, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */
+ { 46636, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */
+ { 46666, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
+ { 46691, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ { 46725, 0x00001000 }, /* GL_TEXTURE_WIDTH */
+ { 46742, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
+ { 46760, 0x00008072 }, /* GL_TEXTURE_WRAP_R_OES */
+ { 46782, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
+ { 46800, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
+ { 46818, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */
+ { 46837, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
+ { 46857, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 46876, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 46905, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 46922, 0x00008E22 }, /* GL_TRANSFORM_FEEDBACK */
+ { 46944, 0x00008E25 }, /* GL_TRANSFORM_FEEDBACK_BINDING */
+ { 46974, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER */
+ { 47003, 0x00008E24 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+ { 47039, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
+ { 47076, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT */
+ { 47117, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER_EXT */
+ { 47150, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
+ { 47184, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT */
+ { 47222, 0x00008E23 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+ { 47258, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
+ { 47292, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT */
+ { 47330, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
+ { 47365, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT */
+ { 47404, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
+ { 47445, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT */
+ { 47490, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
+ { 47521, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS_EXT */
+ { 47556, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
+ { 47597, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT */
+ { 47642, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 47668, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 47698, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 47730, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 47760, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 47794, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 47810, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 47841, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 47876, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 47904, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 47936, 0x00000004 }, /* GL_TRIANGLES */
+ { 47949, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY */
+ { 47972, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY_ARB */
+ { 47999, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 48015, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 48036, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 48054, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY */
+ { 48082, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY_ARB */
+ { 48114, 0x00000001 }, /* GL_TRUE */
+ { 48122, 0x00008A1C }, /* GL_UNDEFINED_APPLE */
+ { 48141, 0x00008255 }, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
+ { 48170, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 48190, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 48213, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 48233, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 48254, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 48276, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 48298, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 48318, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 48339, 0x00009118 }, /* GL_UNSIGNALED */
+ { 48353, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 48370, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 48397, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 48420, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 48436, 0x00008C3B }, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
+ { 48468, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 48495, 0x00008DF6 }, /* GL_UNSIGNED_INT_10_10_10_2_OES */
+ { 48526, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
+ { 48547, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
+ { 48572, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 48596, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_OES */
+ { 48621, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 48652, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV_EXT */
+ { 48687, 0x00008C3E }, /* GL_UNSIGNED_INT_5_9_9_9_REV */
+ { 48715, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 48739, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 48767, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D */
+ { 48794, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
+ { 48827, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT */
+ { 48864, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D_EXT */
+ { 48895, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D */
+ { 48922, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
+ { 48955, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT */
+ { 48992, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D_EXT */
+ { 49023, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
+ { 49055, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT */
+ { 49091, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D */
+ { 49118, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D_EXT */
+ { 49149, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
+ { 49180, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT */
+ { 49215, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
+ { 49244, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE_EXT */
+ { 49277, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2 */
+ { 49298, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2_EXT */
+ { 49323, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3 */
+ { 49344, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3_EXT */
+ { 49369, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4 */
+ { 49390, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4_EXT */
+ { 49415, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
+ { 49438, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 49456, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 49486, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT */
+ { 49520, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 49546, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 49576, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT */
+ { 49610, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 49636, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 49660, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 49688, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 49716, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 49743, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 49775, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 49806, 0x00008CA2 }, /* GL_UPPER_LEFT */
+ { 49820, 0x00002A20 }, /* GL_V2F */
+ { 49827, 0x00002A21 }, /* GL_V3F */
+ { 49834, 0x00008B83 }, /* GL_VALIDATE_STATUS */
+ { 49853, 0x00001F00 }, /* GL_VENDOR */
+ { 49863, 0x00001F02 }, /* GL_VERSION */
+ { 49874, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 49890, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
+ { 49914, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ { 49944, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 49975, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 50010, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 50034, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 50055, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 50078, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 50099, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 50126, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 50154, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 50182, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 50210, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 50238, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 50266, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 50294, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 50321, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 50348, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 50375, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 50402, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 50429, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 50456, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 50483, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 50510, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 50537, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 50575, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 50617, 0x000088FE }, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
+ { 50652, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ { 50683, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 50718, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
+ { 50749, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT */
+ { 50784, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ { 50818, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 50856, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ { 50887, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 50922, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ { 50950, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 50982, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ { 51012, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 51046, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ { 51074, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 51106, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 51126, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 51148, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 51177, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 51198, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ { 51227, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 51260, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 51292, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ { 51319, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 51350, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 51380, 0x00008B31 }, /* GL_VERTEX_SHADER */
+ { 51397, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 51418, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 51445, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 51457, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 51473, 0x00008A1A }, /* GL_VOLATILE_APPLE */
+ { 51491, 0x0000911D }, /* GL_WAIT_FAILED */
+ { 51506, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 51526, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 51557, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 51592, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_OES */
+ { 51627, 0x000086AD }, /* GL_WEIGHT_ARRAY_OES */
+ { 51647, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 51675, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_OES */
+ { 51703, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 51728, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_OES */
+ { 51753, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 51780, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_OES */
+ { 51807, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 51832, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_OES */
+ { 51857, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 51881, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 51900, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 51914, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 51932, 0x000088B9 }, /* GL_WRITE_ONLY_OES */
+ { 51950, 0x00001506 }, /* GL_XOR */
+ { 51957, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 51976, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 51990, 0x00000000 }, /* GL_ZERO */
+ { 51998, 0x00000D16 }, /* GL_ZOOM_X */
+ { 52008, 0x00000D17 }, /* GL_ZOOM_Y */
};
-static const unsigned reduced_enums[1562] =
+static const unsigned reduced_enums[1563] =
{
539, /* GL_FALSE */
834, /* GL_LINES */
838, /* GL_LINE_LOOP */
845, /* GL_LINE_STRIP */
- 2152, /* GL_TRIANGLES */
- 2157, /* GL_TRIANGLE_STRIP */
- 2155, /* GL_TRIANGLE_FAN */
- 1517, /* GL_QUADS */
- 1521, /* GL_QUAD_STRIP */
- 1388, /* GL_POLYGON */
+ 2156, /* GL_TRIANGLES */
+ 2161, /* GL_TRIANGLE_STRIP */
+ 2159, /* GL_TRIANGLE_FAN */
+ 1521, /* GL_QUADS */
+ 1525, /* GL_QUAD_STRIP */
+ 1389, /* GL_POLYGON */
835, /* GL_LINES_ADJACENCY */
846, /* GL_LINE_STRIP_ADJACENCY */
- 2153, /* GL_TRIANGLES_ADJACENCY */
- 2158, /* GL_TRIANGLE_STRIP_ADJACENCY */
- 1400, /* GL_POLYGON_STIPPLE_BIT */
- 1343, /* GL_PIXEL_MODE_BIT */
+ 2157, /* GL_TRIANGLES_ADJACENCY */
+ 2162, /* GL_TRIANGLE_STRIP_ADJACENCY */
+ 1401, /* GL_POLYGON_STIPPLE_BIT */
+ 1344, /* GL_PIXEL_MODE_BIT */
821, /* GL_LIGHTING_BIT */
573, /* GL_FOG_BIT */
8, /* GL_ACCUM */
857, /* GL_LOAD */
- 1607, /* GL_RETURN */
+ 1611, /* GL_RETURN */
1209, /* GL_MULT */
24, /* GL_ADD */
1225, /* GL_NEVER */
@@ -4702,15 +4710,15 @@ static const unsigned reduced_enums[1562] =
1242, /* GL_NOTEQUAL */
695, /* GL_GEQUAL */
55, /* GL_ALWAYS */
- 1816, /* GL_SRC_COLOR */
- 1276, /* GL_ONE_MINUS_SRC_COLOR */
- 1814, /* GL_SRC_ALPHA */
- 1275, /* GL_ONE_MINUS_SRC_ALPHA */
+ 1820, /* GL_SRC_COLOR */
+ 1277, /* GL_ONE_MINUS_SRC_COLOR */
+ 1818, /* GL_SRC_ALPHA */
+ 1276, /* GL_ONE_MINUS_SRC_ALPHA */
508, /* GL_DST_ALPHA */
- 1273, /* GL_ONE_MINUS_DST_ALPHA */
+ 1274, /* GL_ONE_MINUS_DST_ALPHA */
509, /* GL_DST_COLOR */
- 1274, /* GL_ONE_MINUS_DST_COLOR */
- 1815, /* GL_SRC_ALPHA_SATURATE */
+ 1275, /* GL_ONE_MINUS_DST_COLOR */
+ 1819, /* GL_SRC_ALPHA_SATURATE */
672, /* GL_FRONT_LEFT */
673, /* GL_FRONT_RIGHT */
77, /* GL_BACK_LEFT */
@@ -4718,7 +4726,7 @@ static const unsigned reduced_enums[1562] =
669, /* GL_FRONT */
76, /* GL_BACK */
809, /* GL_LEFT */
- 1697, /* GL_RIGHT */
+ 1701, /* GL_RIGHT */
670, /* GL_FRONT_AND_BACK */
71, /* GL_AUX0 */
72, /* GL_AUX1 */
@@ -4727,19 +4735,19 @@ static const unsigned reduced_enums[1562] =
797, /* GL_INVALID_ENUM */
802, /* GL_INVALID_VALUE */
801, /* GL_INVALID_OPERATION */
- 1821, /* GL_STACK_OVERFLOW */
- 1822, /* GL_STACK_UNDERFLOW */
- 1301, /* GL_OUT_OF_MEMORY */
+ 1825, /* GL_STACK_OVERFLOW */
+ 1826, /* GL_STACK_UNDERFLOW */
+ 1302, /* GL_OUT_OF_MEMORY */
798, /* GL_INVALID_FRAMEBUFFER_OPERATION */
0, /* GL_2D */
2, /* GL_3D */
3, /* GL_3D_COLOR */
4, /* GL_3D_COLOR_TEXTURE */
6, /* GL_4D_COLOR_TEXTURE */
- 1321, /* GL_PASS_THROUGH_TOKEN */
- 1387, /* GL_POINT_TOKEN */
+ 1322, /* GL_PASS_THROUGH_TOKEN */
+ 1388, /* GL_POINT_TOKEN */
848, /* GL_LINE_TOKEN */
- 1401, /* GL_POLYGON_TOKEN */
+ 1402, /* GL_POLYGON_TOKEN */
87, /* GL_BITMAP_TOKEN */
507, /* GL_DRAW_PIXEL_TOKEN */
353, /* GL_COPY_PIXEL_TOKEN */
@@ -4749,7 +4757,7 @@ static const unsigned reduced_enums[1562] =
390, /* GL_CW */
154, /* GL_CCW */
187, /* GL_COEFF */
- 1298, /* GL_ORDER */
+ 1299, /* GL_ORDER */
444, /* GL_DOMAIN */
363, /* GL_CURRENT_COLOR */
366, /* GL_CURRENT_INDEX */
@@ -4761,10 +4769,10 @@ static const unsigned reduced_enums[1562] =
381, /* GL_CURRENT_RASTER_POSITION */
382, /* GL_CURRENT_RASTER_POSITION_VALID */
379, /* GL_CURRENT_RASTER_DISTANCE */
- 1379, /* GL_POINT_SMOOTH */
- 1363, /* GL_POINT_SIZE */
- 1378, /* GL_POINT_SIZE_RANGE */
- 1369, /* GL_POINT_SIZE_GRANULARITY */
+ 1380, /* GL_POINT_SMOOTH */
+ 1364, /* GL_POINT_SIZE */
+ 1379, /* GL_POINT_SIZE_RANGE */
+ 1370, /* GL_POINT_SIZE_GRANULARITY */
840, /* GL_LINE_SMOOTH */
849, /* GL_LINE_WIDTH */
851, /* GL_LINE_WIDTH_RANGE */
@@ -4776,9 +4784,9 @@ static const unsigned reduced_enums[1562] =
1064, /* GL_MAX_LIST_NESTING */
853, /* GL_LIST_BASE */
855, /* GL_LIST_INDEX */
- 1390, /* GL_POLYGON_MODE */
- 1397, /* GL_POLYGON_SMOOTH */
- 1399, /* GL_POLYGON_STIPPLE */
+ 1391, /* GL_POLYGON_MODE */
+ 1398, /* GL_POLYGON_SMOOTH */
+ 1400, /* GL_POLYGON_STIPPLE */
518, /* GL_EDGE_FLAG */
356, /* GL_CULL_FACE */
357, /* GL_CULL_FACE_MODE */
@@ -4787,7 +4795,7 @@ static const unsigned reduced_enums[1562] =
825, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
826, /* GL_LIGHT_MODEL_TWO_SIDE */
822, /* GL_LIGHT_MODEL_AMBIENT */
- 1763, /* GL_SHADE_MODEL */
+ 1767, /* GL_SHADE_MODEL */
235, /* GL_COLOR_MATERIAL_FACE */
236, /* GL_COLOR_MATERIAL_PARAMETER */
234, /* GL_COLOR_MATERIAL */
@@ -4804,24 +4812,24 @@ static const unsigned reduced_enums[1562] =
414, /* GL_DEPTH_CLEAR_VALUE */
428, /* GL_DEPTH_FUNC */
12, /* GL_ACCUM_CLEAR_VALUE */
- 1866, /* GL_STENCIL_TEST */
- 1847, /* GL_STENCIL_CLEAR_VALUE */
- 1849, /* GL_STENCIL_FUNC */
- 1868, /* GL_STENCIL_VALUE_MASK */
- 1848, /* GL_STENCIL_FAIL */
- 1863, /* GL_STENCIL_PASS_DEPTH_FAIL */
- 1864, /* GL_STENCIL_PASS_DEPTH_PASS */
- 1865, /* GL_STENCIL_REF */
- 1869, /* GL_STENCIL_WRITEMASK */
+ 1870, /* GL_STENCIL_TEST */
+ 1851, /* GL_STENCIL_CLEAR_VALUE */
+ 1853, /* GL_STENCIL_FUNC */
+ 1872, /* GL_STENCIL_VALUE_MASK */
+ 1852, /* GL_STENCIL_FAIL */
+ 1867, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ 1868, /* GL_STENCIL_PASS_DEPTH_PASS */
+ 1869, /* GL_STENCIL_REF */
+ 1873, /* GL_STENCIL_WRITEMASK */
1014, /* GL_MATRIX_MODE */
1231, /* GL_NORMALIZE */
- 2285, /* GL_VIEWPORT */
+ 2289, /* GL_VIEWPORT */
1204, /* GL_MODELVIEW_STACK_DEPTH */
- 1491, /* GL_PROJECTION_STACK_DEPTH */
- 2106, /* GL_TEXTURE_STACK_DEPTH */
+ 1495, /* GL_PROJECTION_STACK_DEPTH */
+ 2110, /* GL_TEXTURE_STACK_DEPTH */
1201, /* GL_MODELVIEW_MATRIX */
- 1489, /* GL_PROJECTION_MATRIX */
- 2086, /* GL_TEXTURE_MATRIX */
+ 1493, /* GL_PROJECTION_MATRIX */
+ 2090, /* GL_TEXTURE_MATRIX */
69, /* GL_ATTRIB_STACK_DEPTH */
169, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
51, /* GL_ALPHA_TEST */
@@ -4836,67 +4844,67 @@ static const unsigned reduced_enums[1562] =
233, /* GL_COLOR_LOGIC_OP */
75, /* GL_AUX_BUFFERS */
454, /* GL_DRAW_BUFFER */
- 1544, /* GL_READ_BUFFER */
- 1740, /* GL_SCISSOR_BOX */
- 1741, /* GL_SCISSOR_TEST */
+ 1548, /* GL_READ_BUFFER */
+ 1744, /* GL_SCISSOR_BOX */
+ 1745, /* GL_SCISSOR_TEST */
744, /* GL_INDEX_CLEAR_VALUE */
749, /* GL_INDEX_WRITEMASK */
230, /* GL_COLOR_CLEAR_VALUE */
272, /* GL_COLOR_WRITEMASK */
746, /* GL_INDEX_MODE */
- 1686, /* GL_RGBA_MODE */
+ 1690, /* GL_RGBA_MODE */
453, /* GL_DOUBLEBUFFER */
- 1870, /* GL_STEREO */
- 1598, /* GL_RENDER_MODE */
- 1322, /* GL_PERSPECTIVE_CORRECTION_HINT */
- 1380, /* GL_POINT_SMOOTH_HINT */
+ 1874, /* GL_STEREO */
+ 1602, /* GL_RENDER_MODE */
+ 1323, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ 1381, /* GL_POINT_SMOOTH_HINT */
841, /* GL_LINE_SMOOTH_HINT */
- 1398, /* GL_POLYGON_SMOOTH_HINT */
+ 1399, /* GL_POLYGON_SMOOTH_HINT */
593, /* GL_FOG_HINT */
- 2066, /* GL_TEXTURE_GEN_S */
- 2068, /* GL_TEXTURE_GEN_T */
- 2065, /* GL_TEXTURE_GEN_R */
- 2064, /* GL_TEXTURE_GEN_Q */
- 1335, /* GL_PIXEL_MAP_I_TO_I */
- 1341, /* GL_PIXEL_MAP_S_TO_S */
- 1337, /* GL_PIXEL_MAP_I_TO_R */
- 1333, /* GL_PIXEL_MAP_I_TO_G */
- 1331, /* GL_PIXEL_MAP_I_TO_B */
- 1329, /* GL_PIXEL_MAP_I_TO_A */
- 1339, /* GL_PIXEL_MAP_R_TO_R */
- 1327, /* GL_PIXEL_MAP_G_TO_G */
- 1325, /* GL_PIXEL_MAP_B_TO_B */
- 1323, /* GL_PIXEL_MAP_A_TO_A */
- 1336, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- 1342, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- 1338, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- 1334, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- 1332, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- 1330, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- 1340, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- 1328, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- 1326, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- 1324, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 2170, /* GL_UNPACK_SWAP_BYTES */
- 2165, /* GL_UNPACK_LSB_FIRST */
- 2166, /* GL_UNPACK_ROW_LENGTH */
- 2169, /* GL_UNPACK_SKIP_ROWS */
- 2168, /* GL_UNPACK_SKIP_PIXELS */
- 2163, /* GL_UNPACK_ALIGNMENT */
- 1310, /* GL_PACK_SWAP_BYTES */
- 1305, /* GL_PACK_LSB_FIRST */
- 1306, /* GL_PACK_ROW_LENGTH */
- 1309, /* GL_PACK_SKIP_ROWS */
- 1308, /* GL_PACK_SKIP_PIXELS */
- 1302, /* GL_PACK_ALIGNMENT */
+ 2070, /* GL_TEXTURE_GEN_S */
+ 2072, /* GL_TEXTURE_GEN_T */
+ 2069, /* GL_TEXTURE_GEN_R */
+ 2068, /* GL_TEXTURE_GEN_Q */
+ 1336, /* GL_PIXEL_MAP_I_TO_I */
+ 1342, /* GL_PIXEL_MAP_S_TO_S */
+ 1338, /* GL_PIXEL_MAP_I_TO_R */
+ 1334, /* GL_PIXEL_MAP_I_TO_G */
+ 1332, /* GL_PIXEL_MAP_I_TO_B */
+ 1330, /* GL_PIXEL_MAP_I_TO_A */
+ 1340, /* GL_PIXEL_MAP_R_TO_R */
+ 1328, /* GL_PIXEL_MAP_G_TO_G */
+ 1326, /* GL_PIXEL_MAP_B_TO_B */
+ 1324, /* GL_PIXEL_MAP_A_TO_A */
+ 1337, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ 1343, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ 1339, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ 1335, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ 1333, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ 1331, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ 1341, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ 1329, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ 1327, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ 1325, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ 2174, /* GL_UNPACK_SWAP_BYTES */
+ 2169, /* GL_UNPACK_LSB_FIRST */
+ 2170, /* GL_UNPACK_ROW_LENGTH */
+ 2173, /* GL_UNPACK_SKIP_ROWS */
+ 2172, /* GL_UNPACK_SKIP_PIXELS */
+ 2167, /* GL_UNPACK_ALIGNMENT */
+ 1311, /* GL_PACK_SWAP_BYTES */
+ 1306, /* GL_PACK_LSB_FIRST */
+ 1307, /* GL_PACK_ROW_LENGTH */
+ 1310, /* GL_PACK_SKIP_ROWS */
+ 1309, /* GL_PACK_SKIP_PIXELS */
+ 1303, /* GL_PACK_ALIGNMENT */
955, /* GL_MAP_COLOR */
960, /* GL_MAP_STENCIL */
748, /* GL_INDEX_SHIFT */
747, /* GL_INDEX_OFFSET */
- 1560, /* GL_RED_SCALE */
- 1556, /* GL_RED_BIAS */
- 2311, /* GL_ZOOM_X */
- 2312, /* GL_ZOOM_Y */
+ 1564, /* GL_RED_SCALE */
+ 1560, /* GL_RED_BIAS */
+ 2315, /* GL_ZOOM_X */
+ 2316, /* GL_ZOOM_Y */
702, /* GL_GREEN_SCALE */
698, /* GL_GREEN_BIAS */
115, /* GL_BLUE_SCALE */
@@ -4917,14 +4925,14 @@ static const unsigned reduced_enums[1562] =
1120, /* GL_MAX_TEXTURE_STACK_DEPTH */
1146, /* GL_MAX_VIEWPORT_DIMS */
1023, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- 1880, /* GL_SUBPIXEL_BITS */
+ 1884, /* GL_SUBPIXEL_BITS */
743, /* GL_INDEX_BITS */
- 1557, /* GL_RED_BITS */
+ 1561, /* GL_RED_BITS */
699, /* GL_GREEN_BITS */
112, /* GL_BLUE_BITS */
48, /* GL_ALPHA_BITS */
407, /* GL_DEPTH_BITS */
- 1844, /* GL_STENCIL_BITS */
+ 1848, /* GL_STENCIL_BITS */
14, /* GL_ACCUM_RED_BITS */
13, /* GL_ACCUM_GREEN_BITS */
10, /* GL_ACCUM_BLUE_BITS */
@@ -4953,39 +4961,39 @@ static const unsigned reduced_enums[1562] =
903, /* GL_MAP1_GRID_SEGMENTS */
929, /* GL_MAP2_GRID_DOMAIN */
930, /* GL_MAP2_GRID_SEGMENTS */
- 1963, /* GL_TEXTURE_1D */
- 1966, /* GL_TEXTURE_2D */
+ 1967, /* GL_TEXTURE_1D */
+ 1970, /* GL_TEXTURE_2D */
542, /* GL_FEEDBACK_BUFFER_POINTER */
543, /* GL_FEEDBACK_BUFFER_SIZE */
544, /* GL_FEEDBACK_BUFFER_TYPE */
- 1750, /* GL_SELECTION_BUFFER_POINTER */
- 1751, /* GL_SELECTION_BUFFER_SIZE */
- 2112, /* GL_TEXTURE_WIDTH */
- 2072, /* GL_TEXTURE_HEIGHT */
- 2016, /* GL_TEXTURE_COMPONENTS */
- 1994, /* GL_TEXTURE_BORDER_COLOR */
- 1993, /* GL_TEXTURE_BORDER */
+ 1754, /* GL_SELECTION_BUFFER_POINTER */
+ 1755, /* GL_SELECTION_BUFFER_SIZE */
+ 2116, /* GL_TEXTURE_WIDTH */
+ 2076, /* GL_TEXTURE_HEIGHT */
+ 2020, /* GL_TEXTURE_COMPONENTS */
+ 1998, /* GL_TEXTURE_BORDER_COLOR */
+ 1997, /* GL_TEXTURE_BORDER */
445, /* GL_DONT_CARE */
540, /* GL_FASTEST */
1226, /* GL_NICEST */
56, /* GL_AMBIENT */
442, /* GL_DIFFUSE */
- 1803, /* GL_SPECULAR */
- 1402, /* GL_POSITION */
- 1806, /* GL_SPOT_DIRECTION */
- 1807, /* GL_SPOT_EXPONENT */
- 1805, /* GL_SPOT_CUTOFF */
+ 1807, /* GL_SPECULAR */
+ 1403, /* GL_POSITION */
+ 1810, /* GL_SPOT_DIRECTION */
+ 1811, /* GL_SPOT_EXPONENT */
+ 1809, /* GL_SPOT_CUTOFF */
320, /* GL_CONSTANT_ATTENUATION */
829, /* GL_LINEAR_ATTENUATION */
- 1516, /* GL_QUADRATIC_ATTENUATION */
+ 1520, /* GL_QUADRATIC_ATTENUATION */
287, /* GL_COMPILE */
288, /* GL_COMPILE_AND_EXECUTE */
149, /* GL_BYTE */
- 2172, /* GL_UNSIGNED_BYTE */
- 1768, /* GL_SHORT */
- 2211, /* GL_UNSIGNED_SHORT */
+ 2176, /* GL_UNSIGNED_BYTE */
+ 1772, /* GL_SHORT */
+ 2215, /* GL_UNSIGNED_SHORT */
752, /* GL_INT */
- 2175, /* GL_UNSIGNED_INT */
+ 2179, /* GL_UNSIGNED_INT */
553, /* GL_FLOAT */
1, /* GL_2_BYTES */
5, /* GL_3_BYTES */
@@ -4999,68 +5007,68 @@ static const unsigned reduced_enums[1562] =
351, /* GL_COPY */
59, /* GL_AND_INVERTED */
1229, /* GL_NOOP */
- 2307, /* GL_XOR */
- 1297, /* GL_OR */
+ 2311, /* GL_XOR */
+ 1298, /* GL_OR */
1230, /* GL_NOR */
530, /* GL_EQUIV */
805, /* GL_INVERT */
- 1300, /* GL_OR_REVERSE */
+ 1301, /* GL_OR_REVERSE */
352, /* GL_COPY_INVERTED */
- 1299, /* GL_OR_INVERTED */
+ 1300, /* GL_OR_INVERTED */
1219, /* GL_NAND */
- 1757, /* GL_SET */
+ 1761, /* GL_SET */
527, /* GL_EMISSION */
- 1767, /* GL_SHININESS */
+ 1771, /* GL_SHININESS */
57, /* GL_AMBIENT_AND_DIFFUSE */
232, /* GL_COLOR_INDEXES */
1168, /* GL_MODELVIEW */
- 1488, /* GL_PROJECTION */
- 1898, /* GL_TEXTURE */
+ 1492, /* GL_PROJECTION */
+ 1902, /* GL_TEXTURE */
188, /* GL_COLOR */
399, /* GL_DEPTH */
- 1829, /* GL_STENCIL */
+ 1833, /* GL_STENCIL */
231, /* GL_COLOR_INDEX */
- 1850, /* GL_STENCIL_INDEX */
+ 1854, /* GL_STENCIL_INDEX */
415, /* GL_DEPTH_COMPONENT */
- 1553, /* GL_RED */
+ 1557, /* GL_RED */
697, /* GL_GREEN */
110, /* GL_BLUE */
32, /* GL_ALPHA */
- 1610, /* GL_RGB */
- 1650, /* GL_RGBA */
+ 1614, /* GL_RGB */
+ 1654, /* GL_RGBA */
864, /* GL_LUMINANCE */
891, /* GL_LUMINANCE_ALPHA */
86, /* GL_BITMAP */
- 1352, /* GL_POINT */
+ 1353, /* GL_POINT */
827, /* GL_LINE */
545, /* GL_FILL */
- 1567, /* GL_RENDER */
+ 1571, /* GL_RENDER */
541, /* GL_FEEDBACK */
- 1749, /* GL_SELECT */
+ 1753, /* GL_SELECT */
552, /* GL_FLAT */
- 1778, /* GL_SMOOTH */
+ 1782, /* GL_SMOOTH */
806, /* GL_KEEP */
- 1600, /* GL_REPLACE */
+ 1604, /* GL_REPLACE */
733, /* GL_INCR */
395, /* GL_DECR */
- 2228, /* GL_VENDOR */
- 1597, /* GL_RENDERER */
- 2229, /* GL_VERSION */
+ 2232, /* GL_VENDOR */
+ 1601, /* GL_RENDERER */
+ 2233, /* GL_VERSION */
534, /* GL_EXTENSIONS */
- 1698, /* GL_S */
- 1889, /* GL_T */
- 1536, /* GL_R */
- 1515, /* GL_Q */
+ 1702, /* GL_S */
+ 1893, /* GL_T */
+ 1540, /* GL_R */
+ 1519, /* GL_Q */
1205, /* GL_MODULATE */
394, /* GL_DECAL */
- 2059, /* GL_TEXTURE_ENV_MODE */
- 2058, /* GL_TEXTURE_ENV_COLOR */
- 2057, /* GL_TEXTURE_ENV */
+ 2063, /* GL_TEXTURE_ENV_MODE */
+ 2062, /* GL_TEXTURE_ENV_COLOR */
+ 2061, /* GL_TEXTURE_ENV */
535, /* GL_EYE_LINEAR */
- 1258, /* GL_OBJECT_LINEAR */
- 1804, /* GL_SPHERE_MAP */
- 2062, /* GL_TEXTURE_GEN_MODE */
- 1260, /* GL_OBJECT_PLANE */
+ 1259, /* GL_OBJECT_LINEAR */
+ 1808, /* GL_SPHERE_MAP */
+ 2066, /* GL_TEXTURE_GEN_MODE */
+ 1261, /* GL_OBJECT_PLANE */
536, /* GL_EYE_PLANE */
1220, /* GL_NEAREST */
828, /* GL_LINEAR */
@@ -5068,30 +5076,30 @@ static const unsigned reduced_enums[1562] =
833, /* GL_LINEAR_MIPMAP_NEAREST */
1223, /* GL_NEAREST_MIPMAP_LINEAR */
832, /* GL_LINEAR_MIPMAP_LINEAR */
- 2085, /* GL_TEXTURE_MAG_FILTER */
- 2094, /* GL_TEXTURE_MIN_FILTER */
- 2115, /* GL_TEXTURE_WRAP_S */
- 2116, /* GL_TEXTURE_WRAP_T */
+ 2089, /* GL_TEXTURE_MAG_FILTER */
+ 2098, /* GL_TEXTURE_MIN_FILTER */
+ 2119, /* GL_TEXTURE_WRAP_S */
+ 2120, /* GL_TEXTURE_WRAP_T */
155, /* GL_CLAMP */
- 1599, /* GL_REPEAT */
- 1396, /* GL_POLYGON_OFFSET_UNITS */
- 1395, /* GL_POLYGON_OFFSET_POINT */
- 1394, /* GL_POLYGON_OFFSET_LINE */
- 1539, /* GL_R3_G3_B2 */
- 2225, /* GL_V2F */
- 2226, /* GL_V3F */
+ 1603, /* GL_REPEAT */
+ 1397, /* GL_POLYGON_OFFSET_UNITS */
+ 1396, /* GL_POLYGON_OFFSET_POINT */
+ 1395, /* GL_POLYGON_OFFSET_LINE */
+ 1543, /* GL_R3_G3_B2 */
+ 2229, /* GL_V2F */
+ 2230, /* GL_V3F */
152, /* GL_C4UB_V2F */
153, /* GL_C4UB_V3F */
150, /* GL_C3F_V3F */
1217, /* GL_N3F_V3F */
151, /* GL_C4F_N3F_V3F */
- 1894, /* GL_T2F_V3F */
- 1896, /* GL_T4F_V4F */
- 1892, /* GL_T2F_C4UB_V3F */
- 1890, /* GL_T2F_C3F_V3F */
- 1893, /* GL_T2F_N3F_V3F */
- 1891, /* GL_T2F_C4F_N3F_V3F */
- 1895, /* GL_T4F_C4F_N3F_V4F */
+ 1898, /* GL_T2F_V3F */
+ 1900, /* GL_T4F_V4F */
+ 1896, /* GL_T2F_C4UB_V3F */
+ 1894, /* GL_T2F_C3F_V3F */
+ 1897, /* GL_T2F_N3F_V3F */
+ 1895, /* GL_T2F_C4F_N3F_V3F */
+ 1899, /* GL_T4F_C4F_N3F_V4F */
172, /* GL_CLIP_DISTANCE0 */
173, /* GL_CLIP_DISTANCE1 */
174, /* GL_CLIP_DISTANCE2 */
@@ -5110,9 +5118,9 @@ static const unsigned reduced_enums[1562] =
819, /* GL_LIGHT7 */
708, /* GL_HINT_BIT */
322, /* GL_CONSTANT_COLOR */
- 1271, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ 1272, /* GL_ONE_MINUS_CONSTANT_COLOR */
317, /* GL_CONSTANT_ALPHA */
- 1269, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ 1270, /* GL_ONE_MINUS_CONSTANT_ALPHA */
89, /* GL_BLEND_COLOR */
674, /* GL_FUNC_ADD */
1149, /* GL_MIN */
@@ -5122,26 +5130,26 @@ static const unsigned reduced_enums[1562] =
677, /* GL_FUNC_REVERSE_SUBTRACT */
331, /* GL_CONVOLUTION_1D */
332, /* GL_CONVOLUTION_2D */
- 1752, /* GL_SEPARABLE_2D */
+ 1756, /* GL_SEPARABLE_2D */
335, /* GL_CONVOLUTION_BORDER_MODE */
339, /* GL_CONVOLUTION_FILTER_SCALE */
337, /* GL_CONVOLUTION_FILTER_BIAS */
- 1554, /* GL_REDUCE */
+ 1558, /* GL_REDUCE */
341, /* GL_CONVOLUTION_FORMAT */
345, /* GL_CONVOLUTION_WIDTH */
343, /* GL_CONVOLUTION_HEIGHT */
1036, /* GL_MAX_CONVOLUTION_WIDTH */
1034, /* GL_MAX_CONVOLUTION_HEIGHT */
- 1435, /* GL_POST_CONVOLUTION_RED_SCALE */
- 1431, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- 1426, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- 1422, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- 1433, /* GL_POST_CONVOLUTION_RED_BIAS */
- 1429, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- 1424, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- 1420, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ 1436, /* GL_POST_CONVOLUTION_RED_SCALE */
+ 1432, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ 1427, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ 1423, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ 1434, /* GL_POST_CONVOLUTION_RED_BIAS */
+ 1430, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ 1425, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ 1421, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
709, /* GL_HISTOGRAM */
- 1495, /* GL_PROXY_HISTOGRAM */
+ 1499, /* GL_PROXY_HISTOGRAM */
725, /* GL_HISTOGRAM_WIDTH */
715, /* GL_HISTOGRAM_FORMAT */
721, /* GL_HISTOGRAM_RED_SIZE */
@@ -5153,16 +5161,16 @@ static const unsigned reduced_enums[1562] =
1150, /* GL_MINMAX */
1152, /* GL_MINMAX_FORMAT */
1154, /* GL_MINMAX_SINK */
- 1897, /* GL_TABLE_TOO_LARGE_EXT */
- 2174, /* GL_UNSIGNED_BYTE_3_3_2 */
- 2214, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 2217, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 2186, /* GL_UNSIGNED_INT_8_8_8_8 */
- 2177, /* GL_UNSIGNED_INT_10_10_10_2 */
- 1393, /* GL_POLYGON_OFFSET_FILL */
- 1392, /* GL_POLYGON_OFFSET_FACTOR */
- 1391, /* GL_POLYGON_OFFSET_BIAS */
- 1603, /* GL_RESCALE_NORMAL */
+ 1901, /* GL_TABLE_TOO_LARGE_EXT */
+ 2178, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 2218, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 2221, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 2190, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 2181, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1394, /* GL_POLYGON_OFFSET_FILL */
+ 1393, /* GL_POLYGON_OFFSET_FACTOR */
+ 1392, /* GL_POLYGON_OFFSET_BIAS */
+ 1607, /* GL_RESCALE_NORMAL */
41, /* GL_ALPHA4 */
43, /* GL_ALPHA8 */
33, /* GL_ALPHA12 */
@@ -5182,53 +5190,53 @@ static const unsigned reduced_enums[1562] =
764, /* GL_INTENSITY8 */
754, /* GL_INTENSITY12 */
756, /* GL_INTENSITY16 */
- 1625, /* GL_RGB2_EXT */
- 1631, /* GL_RGB4 */
- 1634, /* GL_RGB5 */
- 1641, /* GL_RGB8 */
- 1611, /* GL_RGB10 */
- 1615, /* GL_RGB12 */
- 1617, /* GL_RGB16 */
- 1661, /* GL_RGBA2 */
- 1668, /* GL_RGBA4 */
- 1637, /* GL_RGB5_A1 */
- 1673, /* GL_RGBA8 */
- 1612, /* GL_RGB10_A2 */
- 1651, /* GL_RGBA12 */
- 1653, /* GL_RGBA16 */
- 2102, /* GL_TEXTURE_RED_SIZE */
- 2070, /* GL_TEXTURE_GREEN_SIZE */
- 1991, /* GL_TEXTURE_BLUE_SIZE */
- 1971, /* GL_TEXTURE_ALPHA_SIZE */
- 2083, /* GL_TEXTURE_LUMINANCE_SIZE */
- 2074, /* GL_TEXTURE_INTENSITY_SIZE */
- 1601, /* GL_REPLACE_EXT */
- 1499, /* GL_PROXY_TEXTURE_1D */
- 1503, /* GL_PROXY_TEXTURE_2D */
- 2110, /* GL_TEXTURE_TOO_LARGE_EXT */
- 2096, /* GL_TEXTURE_PRIORITY */
- 2104, /* GL_TEXTURE_RESIDENT */
- 1974, /* GL_TEXTURE_BINDING_1D */
- 1977, /* GL_TEXTURE_BINDING_2D */
- 1980, /* GL_TEXTURE_BINDING_3D */
- 1307, /* GL_PACK_SKIP_IMAGES */
- 1303, /* GL_PACK_IMAGE_HEIGHT */
- 2167, /* GL_UNPACK_SKIP_IMAGES */
- 2164, /* GL_UNPACK_IMAGE_HEIGHT */
- 1969, /* GL_TEXTURE_3D */
- 1507, /* GL_PROXY_TEXTURE_3D */
- 2054, /* GL_TEXTURE_DEPTH */
- 2113, /* GL_TEXTURE_WRAP_R */
+ 1629, /* GL_RGB2_EXT */
+ 1635, /* GL_RGB4 */
+ 1638, /* GL_RGB5 */
+ 1645, /* GL_RGB8 */
+ 1615, /* GL_RGB10 */
+ 1619, /* GL_RGB12 */
+ 1621, /* GL_RGB16 */
+ 1665, /* GL_RGBA2 */
+ 1672, /* GL_RGBA4 */
+ 1641, /* GL_RGB5_A1 */
+ 1677, /* GL_RGBA8 */
+ 1616, /* GL_RGB10_A2 */
+ 1655, /* GL_RGBA12 */
+ 1657, /* GL_RGBA16 */
+ 2106, /* GL_TEXTURE_RED_SIZE */
+ 2074, /* GL_TEXTURE_GREEN_SIZE */
+ 1995, /* GL_TEXTURE_BLUE_SIZE */
+ 1975, /* GL_TEXTURE_ALPHA_SIZE */
+ 2087, /* GL_TEXTURE_LUMINANCE_SIZE */
+ 2078, /* GL_TEXTURE_INTENSITY_SIZE */
+ 1605, /* GL_REPLACE_EXT */
+ 1503, /* GL_PROXY_TEXTURE_1D */
+ 1507, /* GL_PROXY_TEXTURE_2D */
+ 2114, /* GL_TEXTURE_TOO_LARGE_EXT */
+ 2100, /* GL_TEXTURE_PRIORITY */
+ 2108, /* GL_TEXTURE_RESIDENT */
+ 1978, /* GL_TEXTURE_BINDING_1D */
+ 1981, /* GL_TEXTURE_BINDING_2D */
+ 1984, /* GL_TEXTURE_BINDING_3D */
+ 1308, /* GL_PACK_SKIP_IMAGES */
+ 1304, /* GL_PACK_IMAGE_HEIGHT */
+ 2171, /* GL_UNPACK_SKIP_IMAGES */
+ 2168, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1973, /* GL_TEXTURE_3D */
+ 1511, /* GL_PROXY_TEXTURE_3D */
+ 2058, /* GL_TEXTURE_DEPTH */
+ 2117, /* GL_TEXTURE_WRAP_R */
1018, /* GL_MAX_3D_TEXTURE_SIZE */
- 2230, /* GL_VERTEX_ARRAY */
+ 2234, /* GL_VERTEX_ARRAY */
1232, /* GL_NORMAL_ARRAY */
189, /* GL_COLOR_ARRAY */
737, /* GL_INDEX_ARRAY */
- 2024, /* GL_TEXTURE_COORD_ARRAY */
+ 2028, /* GL_TEXTURE_COORD_ARRAY */
519, /* GL_EDGE_FLAG_ARRAY */
- 2236, /* GL_VERTEX_ARRAY_SIZE */
- 2238, /* GL_VERTEX_ARRAY_TYPE */
- 2237, /* GL_VERTEX_ARRAY_STRIDE */
+ 2240, /* GL_VERTEX_ARRAY_SIZE */
+ 2242, /* GL_VERTEX_ARRAY_TYPE */
+ 2241, /* GL_VERTEX_ARRAY_STRIDE */
1237, /* GL_NORMAL_ARRAY_TYPE */
1236, /* GL_NORMAL_ARRAY_STRIDE */
193, /* GL_COLOR_ARRAY_SIZE */
@@ -5236,48 +5244,48 @@ static const unsigned reduced_enums[1562] =
194, /* GL_COLOR_ARRAY_STRIDE */
742, /* GL_INDEX_ARRAY_TYPE */
741, /* GL_INDEX_ARRAY_STRIDE */
- 2028, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- 2030, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- 2029, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ 2032, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ 2034, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ 2033, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
523, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 2235, /* GL_VERTEX_ARRAY_POINTER */
+ 2239, /* GL_VERTEX_ARRAY_POINTER */
1235, /* GL_NORMAL_ARRAY_POINTER */
192, /* GL_COLOR_ARRAY_POINTER */
740, /* GL_INDEX_ARRAY_POINTER */
- 2027, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ 2031, /* GL_TEXTURE_COORD_ARRAY_POINTER */
522, /* GL_EDGE_FLAG_ARRAY_POINTER */
1210, /* GL_MULTISAMPLE */
- 1726, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- 1728, /* GL_SAMPLE_ALPHA_TO_ONE */
- 1733, /* GL_SAMPLE_COVERAGE */
- 1730, /* GL_SAMPLE_BUFFERS */
- 1721, /* GL_SAMPLES */
- 1737, /* GL_SAMPLE_COVERAGE_VALUE */
- 1735, /* GL_SAMPLE_COVERAGE_INVERT */
+ 1730, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ 1732, /* GL_SAMPLE_ALPHA_TO_ONE */
+ 1737, /* GL_SAMPLE_COVERAGE */
+ 1734, /* GL_SAMPLE_BUFFERS */
+ 1725, /* GL_SAMPLES */
+ 1741, /* GL_SAMPLE_COVERAGE_VALUE */
+ 1739, /* GL_SAMPLE_COVERAGE_INVERT */
237, /* GL_COLOR_MATRIX */
239, /* GL_COLOR_MATRIX_STACK_DEPTH */
1030, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- 1418, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- 1414, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- 1409, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- 1405, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- 1416, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- 1412, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- 1407, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- 1403, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- 2007, /* GL_TEXTURE_COLOR_TABLE_SGI */
- 1508, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- 2009, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ 1419, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ 1415, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ 1410, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ 1406, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ 1417, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ 1413, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ 1408, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ 1404, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ 2011, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ 1512, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ 2013, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
94, /* GL_BLEND_DST_RGB */
108, /* GL_BLEND_SRC_RGB */
92, /* GL_BLEND_DST_ALPHA */
106, /* GL_BLEND_SRC_ALPHA */
243, /* GL_COLOR_TABLE */
- 1428, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- 1411, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- 1494, /* GL_PROXY_COLOR_TABLE */
- 1498, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- 1497, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1429, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ 1412, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1498, /* GL_PROXY_COLOR_TABLE */
+ 1502, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ 1501, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
267, /* GL_COLOR_TABLE_SCALE */
247, /* GL_COLOR_TABLE_BIAS */
252, /* GL_COLOR_TABLE_FORMAT */
@@ -5292,60 +5300,60 @@ static const unsigned reduced_enums[1562] =
80, /* GL_BGRA */
1045, /* GL_MAX_ELEMENTS_VERTICES */
1044, /* GL_MAX_ELEMENTS_INDICES */
- 2073, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ 2077, /* GL_TEXTURE_INDEX_SIZE_EXT */
186, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- 1374, /* GL_POINT_SIZE_MIN */
- 1370, /* GL_POINT_SIZE_MAX */
- 1359, /* GL_POINT_FADE_THRESHOLD_SIZE */
- 1355, /* GL_POINT_DISTANCE_ATTENUATION */
+ 1375, /* GL_POINT_SIZE_MIN */
+ 1371, /* GL_POINT_SIZE_MAX */
+ 1360, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ 1356, /* GL_POINT_DISTANCE_ATTENUATION */
159, /* GL_CLAMP_TO_BORDER */
162, /* GL_CLAMP_TO_EDGE */
- 2095, /* GL_TEXTURE_MIN_LOD */
- 2093, /* GL_TEXTURE_MAX_LOD */
- 1973, /* GL_TEXTURE_BASE_LEVEL */
- 2092, /* GL_TEXTURE_MAX_LEVEL */
+ 2099, /* GL_TEXTURE_MIN_LOD */
+ 2097, /* GL_TEXTURE_MAX_LOD */
+ 1977, /* GL_TEXTURE_BASE_LEVEL */
+ 2096, /* GL_TEXTURE_MAX_LEVEL */
728, /* GL_IGNORE_BORDER_HP */
321, /* GL_CONSTANT_BORDER_HP */
- 1602, /* GL_REPLICATE_BORDER_HP */
+ 1606, /* GL_REPLICATE_BORDER_HP */
333, /* GL_CONVOLUTION_BORDER_COLOR */
- 1266, /* GL_OCCLUSION_TEST_HP */
- 1267, /* GL_OCCLUSION_TEST_RESULT_HP */
+ 1267, /* GL_OCCLUSION_TEST_HP */
+ 1268, /* GL_OCCLUSION_TEST_RESULT_HP */
830, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- 2001, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- 2003, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- 2005, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- 2006, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 2004, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- 2002, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ 2005, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ 2007, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ 2009, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ 2010, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 2008, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ 2006, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
1024, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
1025, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1438, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- 1440, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- 1437, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- 1439, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- 2081, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- 2082, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- 2080, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ 1439, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ 1441, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ 1438, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ 1440, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ 2085, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ 2086, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ 2084, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
683, /* GL_GENERATE_MIPMAP */
684, /* GL_GENERATE_MIPMAP_HINT */
596, /* GL_FOG_OFFSET_SGIX */
597, /* GL_FOG_OFFSET_VALUE_SGIX */
- 2015, /* GL_TEXTURE_COMPARE_SGIX */
- 2014, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- 2077, /* GL_TEXTURE_LEQUAL_R_SGIX */
- 2069, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ 2019, /* GL_TEXTURE_COMPARE_SGIX */
+ 2018, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ 2081, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ 2073, /* GL_TEXTURE_GEQUAL_R_SGIX */
416, /* GL_DEPTH_COMPONENT16 */
420, /* GL_DEPTH_COMPONENT24 */
424, /* GL_DEPTH_COMPONENT32 */
358, /* GL_CULL_VERTEX_EXT */
360, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
359, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 2303, /* GL_WRAP_BORDER_SUN */
- 2008, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ 2307, /* GL_WRAP_BORDER_SUN */
+ 2012, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
823, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- 1771, /* GL_SINGLE_COLOR */
- 1755, /* GL_SEPARATE_SPECULAR_COLOR */
- 1766, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ 1775, /* GL_SINGLE_COLOR */
+ 1759, /* GL_SEPARATE_SPECULAR_COLOR */
+ 1770, /* GL_SHARED_TEXTURE_PALETTE_EXT */
608, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
609, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
620, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
@@ -5363,32 +5371,33 @@ static const unsigned reduced_enums[1562] =
327, /* GL_CONTEXT_FLAGS */
736, /* GL_INDEX */
410, /* GL_DEPTH_BUFFER */
- 1845, /* GL_STENCIL_BUFFER */
+ 1849, /* GL_STENCIL_BUFFER */
298, /* GL_COMPRESSED_RED */
299, /* GL_COMPRESSED_RG */
860, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
703, /* GL_GUILTY_CONTEXT_RESET_ARB */
751, /* GL_INNOCENT_CONTEXT_RESET_ARB */
- 2162, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
- 1605, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
+ 2166, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
+ 1609, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
+ 1461, /* GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
1244, /* GL_NO_RESET_NOTIFICATION_ARB */
- 2173, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 2218, /* GL_UNSIGNED_SHORT_5_6_5 */
- 2219, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 2215, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 2212, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 2187, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 2183, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- 2090, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- 2091, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- 2089, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ 2177, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 2222, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 2223, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 2219, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 2216, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 2191, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 2187, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 2094, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ 2095, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ 2093, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
1160, /* GL_MIRRORED_REPEAT */
- 1691, /* GL_RGB_S3TC */
- 1633, /* GL_RGB4_S3TC */
- 1687, /* GL_RGBA_S3TC */
- 1672, /* GL_RGBA4_S3TC */
- 1681, /* GL_RGBA_DXT5_S3TC */
- 1669, /* GL_RGBA4_DXT5_S3TC */
+ 1695, /* GL_RGB_S3TC */
+ 1637, /* GL_RGB4_S3TC */
+ 1691, /* GL_RGBA_S3TC */
+ 1676, /* GL_RGBA4_S3TC */
+ 1685, /* GL_RGBA_DXT5_S3TC */
+ 1673, /* GL_RGBA4_DXT5_S3TC */
309, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
304, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
305, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
@@ -5406,54 +5415,54 @@ static const unsigned reduced_enums[1562] =
577, /* GL_FOG_COORDINATE_ARRAY */
241, /* GL_COLOR_SUM */
385, /* GL_CURRENT_SECONDARY_COLOR */
- 1746, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- 1748, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- 1747, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- 1745, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- 1742, /* GL_SECONDARY_COLOR_ARRAY */
+ 1750, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ 1752, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ 1751, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ 1749, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ 1746, /* GL_SECONDARY_COLOR_ARRAY */
383, /* GL_CURRENT_RASTER_SECONDARY_COLOR */
29, /* GL_ALIASED_POINT_SIZE_RANGE */
28, /* GL_ALIASED_LINE_WIDTH_RANGE */
- 1899, /* GL_TEXTURE0 */
- 1901, /* GL_TEXTURE1 */
- 1923, /* GL_TEXTURE2 */
- 1945, /* GL_TEXTURE3 */
- 1951, /* GL_TEXTURE4 */
- 1953, /* GL_TEXTURE5 */
- 1955, /* GL_TEXTURE6 */
- 1957, /* GL_TEXTURE7 */
- 1959, /* GL_TEXTURE8 */
- 1961, /* GL_TEXTURE9 */
- 1902, /* GL_TEXTURE10 */
- 1904, /* GL_TEXTURE11 */
- 1906, /* GL_TEXTURE12 */
- 1908, /* GL_TEXTURE13 */
- 1910, /* GL_TEXTURE14 */
- 1912, /* GL_TEXTURE15 */
- 1914, /* GL_TEXTURE16 */
- 1916, /* GL_TEXTURE17 */
- 1918, /* GL_TEXTURE18 */
- 1920, /* GL_TEXTURE19 */
- 1924, /* GL_TEXTURE20 */
- 1926, /* GL_TEXTURE21 */
- 1928, /* GL_TEXTURE22 */
- 1930, /* GL_TEXTURE23 */
- 1932, /* GL_TEXTURE24 */
- 1934, /* GL_TEXTURE25 */
- 1936, /* GL_TEXTURE26 */
- 1938, /* GL_TEXTURE27 */
- 1940, /* GL_TEXTURE28 */
- 1942, /* GL_TEXTURE29 */
- 1946, /* GL_TEXTURE30 */
- 1948, /* GL_TEXTURE31 */
+ 1903, /* GL_TEXTURE0 */
+ 1905, /* GL_TEXTURE1 */
+ 1927, /* GL_TEXTURE2 */
+ 1949, /* GL_TEXTURE3 */
+ 1955, /* GL_TEXTURE4 */
+ 1957, /* GL_TEXTURE5 */
+ 1959, /* GL_TEXTURE6 */
+ 1961, /* GL_TEXTURE7 */
+ 1963, /* GL_TEXTURE8 */
+ 1965, /* GL_TEXTURE9 */
+ 1906, /* GL_TEXTURE10 */
+ 1908, /* GL_TEXTURE11 */
+ 1910, /* GL_TEXTURE12 */
+ 1912, /* GL_TEXTURE13 */
+ 1914, /* GL_TEXTURE14 */
+ 1916, /* GL_TEXTURE15 */
+ 1918, /* GL_TEXTURE16 */
+ 1920, /* GL_TEXTURE17 */
+ 1922, /* GL_TEXTURE18 */
+ 1924, /* GL_TEXTURE19 */
+ 1928, /* GL_TEXTURE20 */
+ 1930, /* GL_TEXTURE21 */
+ 1932, /* GL_TEXTURE22 */
+ 1934, /* GL_TEXTURE23 */
+ 1936, /* GL_TEXTURE24 */
+ 1938, /* GL_TEXTURE25 */
+ 1940, /* GL_TEXTURE26 */
+ 1942, /* GL_TEXTURE27 */
+ 1944, /* GL_TEXTURE28 */
+ 1946, /* GL_TEXTURE29 */
+ 1950, /* GL_TEXTURE30 */
+ 1952, /* GL_TEXTURE31 */
19, /* GL_ACTIVE_TEXTURE */
166, /* GL_CLIENT_ACTIVE_TEXTURE */
1121, /* GL_MAX_TEXTURE_UNITS */
- 2145, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 2148, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 2150, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 2142, /* GL_TRANSPOSE_COLOR_MATRIX */
- 1881, /* GL_SUBTRACT */
+ 2149, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 2152, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 2154, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 2146, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1885, /* GL_SUBTRACT */
1102, /* GL_MAX_RENDERBUFFER_SIZE */
290, /* GL_COMPRESSED_ALPHA */
294, /* GL_COMPRESSED_LUMINANCE */
@@ -5461,18 +5470,18 @@ static const unsigned reduced_enums[1562] =
292, /* GL_COMPRESSED_INTENSITY */
300, /* GL_COMPRESSED_RGB */
301, /* GL_COMPRESSED_RGBA */
- 2022, /* GL_TEXTURE_COMPRESSION_HINT */
- 2099, /* GL_TEXTURE_RECTANGLE */
- 1987, /* GL_TEXTURE_BINDING_RECTANGLE */
- 1511, /* GL_PROXY_TEXTURE_RECTANGLE */
+ 2026, /* GL_TEXTURE_COMPRESSION_HINT */
+ 2103, /* GL_TEXTURE_RECTANGLE */
+ 1991, /* GL_TEXTURE_BINDING_RECTANGLE */
+ 1515, /* GL_PROXY_TEXTURE_RECTANGLE */
1099, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
431, /* GL_DEPTH_STENCIL */
- 2179, /* GL_UNSIGNED_INT_24_8 */
+ 2183, /* GL_UNSIGNED_INT_24_8 */
1116, /* GL_MAX_TEXTURE_LOD_BIAS */
- 2088, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ 2092, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
1118, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- 2060, /* GL_TEXTURE_FILTER_CONTROL */
- 2078, /* GL_TEXTURE_LOD_BIAS */
+ 2064, /* GL_TEXTURE_FILTER_CONTROL */
+ 2082, /* GL_TEXTURE_LOD_BIAS */
274, /* GL_COMBINE4 */
1108, /* GL_MAX_SHININESS_NV */
1109, /* GL_MAX_SPOT_EXPONENT_NV */
@@ -5480,75 +5489,75 @@ static const unsigned reduced_enums[1562] =
396, /* GL_DECR_WRAP */
1180, /* GL_MODELVIEW1_ARB */
1238, /* GL_NORMAL_MAP */
- 1562, /* GL_REFLECTION_MAP */
- 2032, /* GL_TEXTURE_CUBE_MAP */
- 1984, /* GL_TEXTURE_BINDING_CUBE_MAP */
- 2044, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- 2034, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- 2047, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- 2037, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- 2050, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- 2040, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- 1509, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ 1566, /* GL_REFLECTION_MAP */
+ 2036, /* GL_TEXTURE_CUBE_MAP */
+ 1988, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ 2048, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ 2038, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ 2051, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ 2041, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ 2054, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ 2044, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ 1513, /* GL_PROXY_TEXTURE_CUBE_MAP */
1038, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
1216, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- 1452, /* GL_PRIMITIVE_RESTART_NV */
- 1451, /* GL_PRIMITIVE_RESTART_INDEX_NV */
+ 1453, /* GL_PRIMITIVE_RESTART_NV */
+ 1452, /* GL_PRIMITIVE_RESTART_INDEX_NV */
591, /* GL_FOG_DISTANCE_MODE_NV */
538, /* GL_EYE_RADIAL_NV */
537, /* GL_EYE_PLANE_ABSOLUTE_NV */
273, /* GL_COMBINE */
280, /* GL_COMBINE_RGB */
275, /* GL_COMBINE_ALPHA */
- 1692, /* GL_RGB_SCALE */
+ 1696, /* GL_RGB_SCALE */
25, /* GL_ADD_SIGNED */
771, /* GL_INTERPOLATE */
316, /* GL_CONSTANT */
- 1444, /* GL_PRIMARY_COLOR */
- 1441, /* GL_PREVIOUS */
- 1786, /* GL_SOURCE0_RGB */
- 1792, /* GL_SOURCE1_RGB */
- 1798, /* GL_SOURCE2_RGB */
- 1802, /* GL_SOURCE3_RGB_NV */
- 1783, /* GL_SOURCE0_ALPHA */
- 1789, /* GL_SOURCE1_ALPHA */
- 1795, /* GL_SOURCE2_ALPHA */
- 1801, /* GL_SOURCE3_ALPHA_NV */
- 1280, /* GL_OPERAND0_RGB */
- 1286, /* GL_OPERAND1_RGB */
- 1292, /* GL_OPERAND2_RGB */
- 1296, /* GL_OPERAND3_RGB_NV */
- 1277, /* GL_OPERAND0_ALPHA */
- 1283, /* GL_OPERAND1_ALPHA */
- 1289, /* GL_OPERAND2_ALPHA */
- 1295, /* GL_OPERAND3_ALPHA_NV */
+ 1445, /* GL_PRIMARY_COLOR */
+ 1442, /* GL_PREVIOUS */
+ 1790, /* GL_SOURCE0_RGB */
+ 1796, /* GL_SOURCE1_RGB */
+ 1802, /* GL_SOURCE2_RGB */
+ 1806, /* GL_SOURCE3_RGB_NV */
+ 1787, /* GL_SOURCE0_ALPHA */
+ 1793, /* GL_SOURCE1_ALPHA */
+ 1799, /* GL_SOURCE2_ALPHA */
+ 1805, /* GL_SOURCE3_ALPHA_NV */
+ 1281, /* GL_OPERAND0_RGB */
+ 1287, /* GL_OPERAND1_RGB */
+ 1293, /* GL_OPERAND2_RGB */
+ 1297, /* GL_OPERAND3_RGB_NV */
+ 1278, /* GL_OPERAND0_ALPHA */
+ 1284, /* GL_OPERAND1_ALPHA */
+ 1290, /* GL_OPERAND2_ALPHA */
+ 1296, /* GL_OPERAND3_ALPHA_NV */
137, /* GL_BUFFER_OBJECT_APPLE */
- 2231, /* GL_VERTEX_ARRAY_BINDING */
- 2097, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
- 2098, /* GL_TEXTURE_RANGE_POINTER_APPLE */
- 2308, /* GL_YCBCR_422_APPLE */
- 2220, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 2222, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- 2109, /* GL_TEXTURE_STORAGE_HINT_APPLE */
- 1872, /* GL_STORAGE_PRIVATE_APPLE */
- 1871, /* GL_STORAGE_CACHED_APPLE */
- 1873, /* GL_STORAGE_SHARED_APPLE */
- 1773, /* GL_SLICE_ACCUM_SUN */
- 1520, /* GL_QUAD_MESH_SUN */
- 2156, /* GL_TRIANGLE_MESH_SUN */
- 2273, /* GL_VERTEX_PROGRAM_ARB */
- 2284, /* GL_VERTEX_STATE_PROGRAM_NV */
- 2258, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- 2266, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- 2268, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- 2270, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ 2235, /* GL_VERTEX_ARRAY_BINDING */
+ 2101, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
+ 2102, /* GL_TEXTURE_RANGE_POINTER_APPLE */
+ 2312, /* GL_YCBCR_422_APPLE */
+ 2224, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 2226, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 2113, /* GL_TEXTURE_STORAGE_HINT_APPLE */
+ 1876, /* GL_STORAGE_PRIVATE_APPLE */
+ 1875, /* GL_STORAGE_CACHED_APPLE */
+ 1877, /* GL_STORAGE_SHARED_APPLE */
+ 1777, /* GL_SLICE_ACCUM_SUN */
+ 1524, /* GL_QUAD_MESH_SUN */
+ 2160, /* GL_TRIANGLE_MESH_SUN */
+ 2277, /* GL_VERTEX_PROGRAM_ARB */
+ 2288, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 2262, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ 2270, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ 2272, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ 2274, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
387, /* GL_CURRENT_VERTEX_ATTRIB */
- 1465, /* GL_PROGRAM_LENGTH_ARB */
- 1481, /* GL_PROGRAM_STRING_ARB */
+ 1469, /* GL_PROGRAM_LENGTH_ARB */
+ 1485, /* GL_PROGRAM_STRING_ARB */
1203, /* GL_MODELVIEW_PROJECTION_NV */
727, /* GL_IDENTITY_NV */
803, /* GL_INVERSE_NV */
- 2147, /* GL_TRANSPOSE_NV */
+ 2151, /* GL_TRANSPOSE_NV */
804, /* GL_INVERSE_TRANSPOSE_NV */
1083, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
1082, /* GL_MAX_PROGRAM_MATRICES_ARB */
@@ -5562,33 +5571,33 @@ static const unsigned reduced_enums[1562] =
1000, /* GL_MATRIX7_NV */
370, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
367, /* GL_CURRENT_MATRIX_ARB */
- 1478, /* GL_PROGRAM_POINT_SIZE */
- 2279, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- 1477, /* GL_PROGRAM_PARAMETER_NV */
- 2264, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- 1483, /* GL_PROGRAM_TARGET_NV */
- 1480, /* GL_PROGRAM_RESIDENT_NV */
- 2119, /* GL_TRACK_MATRIX_NV */
- 2120, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 2274, /* GL_VERTEX_PROGRAM_BINDING_NV */
- 1459, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ 1482, /* GL_PROGRAM_POINT_SIZE */
+ 2283, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ 1481, /* GL_PROGRAM_PARAMETER_NV */
+ 2268, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ 1487, /* GL_PROGRAM_TARGET_NV */
+ 1484, /* GL_PROGRAM_RESIDENT_NV */
+ 2123, /* GL_TRACK_MATRIX_NV */
+ 2124, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 2278, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1463, /* GL_PROGRAM_ERROR_POSITION_ARB */
412, /* GL_DEPTH_CLAMP */
- 2239, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 2246, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 2247, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 2248, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 2249, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 2250, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 2251, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 2252, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 2253, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 2254, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 2240, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 2241, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 2242, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 2243, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 2244, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 2245, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 2243, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 2250, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 2251, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 2252, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 2253, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 2254, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 2255, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 2256, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 2257, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 2258, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 2244, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 2245, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 2246, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 2247, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 2248, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 2249, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
912, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
919, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
920, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
@@ -5612,7 +5621,7 @@ static const unsigned reduced_enums[1562] =
949, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
950, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
951, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- 1458, /* GL_PROGRAM_BINDING_ARB */
+ 1462, /* GL_PROGRAM_BINDING_ARB */
953, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
954, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
940, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
@@ -5621,27 +5630,27 @@ static const unsigned reduced_enums[1562] =
943, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
944, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
945, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- 2020, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- 2017, /* GL_TEXTURE_COMPRESSED */
+ 2024, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ 2021, /* GL_TEXTURE_COMPRESSED */
1245, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
314, /* GL_COMPRESSED_TEXTURE_FORMATS */
1143, /* GL_MAX_VERTEX_UNITS_ARB */
23, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 2302, /* GL_WEIGHT_SUM_UNITY_ARB */
- 2272, /* GL_VERTEX_BLEND_ARB */
+ 2306, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 2276, /* GL_VERTEX_BLEND_ARB */
389, /* GL_CURRENT_WEIGHT_ARB */
- 2300, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 2298, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 2296, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 2294, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 2289, /* GL_WEIGHT_ARRAY_ARB */
+ 2304, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 2302, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 2300, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 2298, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 2293, /* GL_WEIGHT_ARRAY_ARB */
446, /* GL_DOT3_RGB */
447, /* GL_DOT3_RGBA */
308, /* GL_COMPRESSED_RGB_FXT1_3DFX */
303, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
1211, /* GL_MULTISAMPLE_3DFX */
- 1731, /* GL_SAMPLE_BUFFERS_3DFX */
- 1722, /* GL_SAMPLES_3DFX */
+ 1735, /* GL_SAMPLE_BUFFERS_3DFX */
+ 1726, /* GL_SAMPLES_3DFX */
1191, /* GL_MODELVIEW2_ARB */
1194, /* GL_MODELVIEW3_ARB */
1195, /* GL_MODELVIEW4_ARB */
@@ -5673,14 +5682,14 @@ static const unsigned reduced_enums[1562] =
1192, /* GL_MODELVIEW30_ARB */
1193, /* GL_MODELVIEW31_ARB */
451, /* GL_DOT3_RGB_EXT */
- 449, /* GL_DOT3_RGBA_EXT */
+ 1459, /* GL_PROGRAM_BINARY_LENGTH */
1164, /* GL_MIRROR_CLAMP_EXT */
1167, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
1206, /* GL_MODULATE_ADD_ATI */
1207, /* GL_MODULATE_SIGNED_ADD_ATI */
1208, /* GL_MODULATE_SUBTRACT_ATI */
- 2309, /* GL_YCBCR_MESA */
- 1304, /* GL_PACK_INVERT_MESA */
+ 2313, /* GL_YCBCR_MESA */
+ 1305, /* GL_PACK_INVERT_MESA */
392, /* GL_DEBUG_OBJECT_MESA */
393, /* GL_DEBUG_PRINT_MESA */
391, /* GL_DEBUG_ASSERT_MESA */
@@ -5694,30 +5703,30 @@ static const unsigned reduced_enums[1562] =
510, /* GL_DU8DV8_ATI */
143, /* GL_BUMP_ENVMAP_ATI */
147, /* GL_BUMP_TARGET_ATI */
- 1248, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
- 1456, /* GL_PROGRAM_BINARY_FORMATS_OES */
- 1835, /* GL_STENCIL_BACK_FUNC */
- 1833, /* GL_STENCIL_BACK_FAIL */
- 1837, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- 1839, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ 1248, /* GL_NUM_PROGRAM_BINARY_FORMATS */
+ 1457, /* GL_PROGRAM_BINARY_FORMATS */
+ 1839, /* GL_STENCIL_BACK_FUNC */
+ 1837, /* GL_STENCIL_BACK_FAIL */
+ 1841, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ 1843, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
600, /* GL_FRAGMENT_PROGRAM_ARB */
- 1454, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1486, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1485, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1468, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1474, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1473, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 1455, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1490, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1489, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1472, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1478, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1477, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
1072, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
1097, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
1096, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
1085, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
1091, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
1090, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 1663, /* GL_RGBA32F */
- 1626, /* GL_RGB32F */
- 1654, /* GL_RGBA16F */
- 1618, /* GL_RGB16F */
- 1682, /* GL_RGBA_FLOAT_MODE_ARB */
+ 1667, /* GL_RGBA32F */
+ 1630, /* GL_RGB32F */
+ 1658, /* GL_RGBA16F */
+ 1622, /* GL_RGB16F */
+ 1686, /* GL_RGBA_FLOAT_MODE_ARB */
1041, /* GL_MAX_DRAW_BUFFERS */
455, /* GL_DRAW_BUFFER0 */
458, /* GL_DRAW_BUFFER1 */
@@ -5746,75 +5755,75 @@ static const unsigned reduced_enums[1562] =
1012, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
1010, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
1006, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- 2055, /* GL_TEXTURE_DEPTH_SIZE */
+ 2059, /* GL_TEXTURE_DEPTH_SIZE */
439, /* GL_DEPTH_TEXTURE_MODE */
- 2012, /* GL_TEXTURE_COMPARE_MODE */
- 2010, /* GL_TEXTURE_COMPARE_FUNC */
+ 2016, /* GL_TEXTURE_COMPARE_MODE */
+ 2014, /* GL_TEXTURE_COMPARE_FUNC */
284, /* GL_COMPARE_REF_TO_TEXTURE */
- 1381, /* GL_POINT_SPRITE */
+ 1382, /* GL_POINT_SPRITE */
347, /* GL_COORD_REPLACE */
- 1386, /* GL_POINT_SPRITE_R_MODE_NV */
- 1526, /* GL_QUERY_COUNTER_BITS */
+ 1387, /* GL_POINT_SPRITE_R_MODE_NV */
+ 1530, /* GL_QUERY_COUNTER_BITS */
376, /* GL_CURRENT_QUERY */
- 1530, /* GL_QUERY_RESULT */
- 1532, /* GL_QUERY_RESULT_AVAILABLE */
+ 1534, /* GL_QUERY_RESULT */
+ 1536, /* GL_QUERY_RESULT_AVAILABLE */
1135, /* GL_MAX_VERTEX_ATTRIBS */
- 2262, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ 2266, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
437, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
436, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
1112, /* GL_MAX_TEXTURE_COORDS */
1114, /* GL_MAX_TEXTURE_IMAGE_UNITS */
- 1461, /* GL_PROGRAM_ERROR_STRING_ARB */
- 1463, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- 1462, /* GL_PROGRAM_FORMAT_ARB */
- 2111, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ 1465, /* GL_PROGRAM_ERROR_STRING_ARB */
+ 1467, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ 1466, /* GL_PROGRAM_FORMAT_ARB */
+ 2115, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
409, /* GL_DEPTH_BOUNDS_TEST_EXT */
408, /* GL_DEPTH_BOUNDS_EXT */
61, /* GL_ARRAY_BUFFER */
524, /* GL_ELEMENT_ARRAY_BUFFER */
62, /* GL_ARRAY_BUFFER_BINDING */
525, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 2233, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 2237, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
1233, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
190, /* GL_COLOR_ARRAY_BUFFER_BINDING */
738, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- 2025, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ 2029, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
520, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- 1743, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ 1747, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
578, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 2290, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 2255, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- 1464, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ 2294, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 2259, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1468, /* GL_PROGRAM_INSTRUCTIONS_ARB */
1078, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- 1470, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1474, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
1087, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1484, /* GL_PROGRAM_TEMPORARIES_ARB */
+ 1488, /* GL_PROGRAM_TEMPORARIES_ARB */
1093, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- 1472, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1476, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
1089, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1476, /* GL_PROGRAM_PARAMETERS_ARB */
+ 1480, /* GL_PROGRAM_PARAMETERS_ARB */
1092, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- 1471, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1475, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
1088, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1455, /* GL_PROGRAM_ATTRIBS_ARB */
+ 1456, /* GL_PROGRAM_ATTRIBS_ARB */
1073, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- 1469, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1473, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
1086, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1453, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1454, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
1071, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1467, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 1471, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
1084, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
1079, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
1075, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- 1487, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 2144, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- 1549, /* GL_READ_ONLY */
- 2304, /* GL_WRITE_ONLY */
- 1551, /* GL_READ_WRITE */
+ 1491, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ 2148, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1553, /* GL_READ_ONLY */
+ 2308, /* GL_WRITE_ONLY */
+ 1555, /* GL_READ_WRITE */
124, /* GL_BUFFER_ACCESS */
129, /* GL_BUFFER_MAPPED */
134, /* GL_BUFFER_MAP_POINTER */
- 2118, /* GL_TIME_ELAPSED_EXT */
+ 2122, /* GL_TIME_ELAPSED_EXT */
963, /* GL_MATRIX0_ARB */
975, /* GL_MATRIX1_ARB */
987, /* GL_MATRIX2_ARB */
@@ -5847,67 +5856,67 @@ static const unsigned reduced_enums[1562] =
986, /* GL_MATRIX29_ARB */
989, /* GL_MATRIX30_ARB */
990, /* GL_MATRIX31_ARB */
- 1876, /* GL_STREAM_DRAW */
- 1878, /* GL_STREAM_READ */
- 1874, /* GL_STREAM_COPY */
- 1825, /* GL_STATIC_DRAW */
- 1827, /* GL_STATIC_READ */
- 1823, /* GL_STATIC_COPY */
+ 1880, /* GL_STREAM_DRAW */
+ 1882, /* GL_STREAM_READ */
+ 1878, /* GL_STREAM_COPY */
+ 1829, /* GL_STATIC_DRAW */
+ 1831, /* GL_STATIC_READ */
+ 1827, /* GL_STATIC_COPY */
514, /* GL_DYNAMIC_DRAW */
516, /* GL_DYNAMIC_READ */
512, /* GL_DYNAMIC_COPY */
- 1344, /* GL_PIXEL_PACK_BUFFER */
- 1348, /* GL_PIXEL_UNPACK_BUFFER */
- 1345, /* GL_PIXEL_PACK_BUFFER_BINDING */
- 1349, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
+ 1345, /* GL_PIXEL_PACK_BUFFER */
+ 1349, /* GL_PIXEL_UNPACK_BUFFER */
+ 1346, /* GL_PIXEL_PACK_BUFFER_BINDING */
+ 1350, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
400, /* GL_DEPTH24_STENCIL8 */
- 2107, /* GL_TEXTURE_STENCIL_SIZE */
- 2053, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
+ 2111, /* GL_TEXTURE_STENCIL_SIZE */
+ 2057, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
1074, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
1077, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
1081, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
1080, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- 2260, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
- 2257, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
+ 2264, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
+ 2261, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
1020, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
1158, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
1094, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
- 1867, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ 1871, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
18, /* GL_ACTIVE_STENCIL_FACE_EXT */
1165, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- 1724, /* GL_SAMPLES_PASSED */
+ 1728, /* GL_SAMPLES_PASSED */
693, /* GL_GEOMETRY_VERTICES_OUT */
687, /* GL_GEOMETRY_INPUT_TYPE */
689, /* GL_GEOMETRY_OUTPUT_TYPE */
- 1715, /* GL_SAMPLER_BINDING */
+ 1719, /* GL_SAMPLER_BINDING */
164, /* GL_CLAMP_VERTEX_COLOR_ARB */
156, /* GL_CLAMP_FRAGMENT_COLOR_ARB */
157, /* GL_CLAMP_READ_COLOR */
550, /* GL_FIXED_ONLY */
- 1368, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
- 1367, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
- 1366, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
+ 1369, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
+ 1368, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
+ 1367, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
1202, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
- 1490, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
- 2087, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 1494, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 2091, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
138, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */
128, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */
- 1566, /* GL_RELEASED_APPLE */
- 2287, /* GL_VOLATILE_APPLE */
- 1606, /* GL_RETAINED_APPLE */
- 2161, /* GL_UNDEFINED_APPLE */
- 1514, /* GL_PURGEABLE_APPLE */
+ 1570, /* GL_RELEASED_APPLE */
+ 2291, /* GL_VOLATILE_APPLE */
+ 1610, /* GL_RETAINED_APPLE */
+ 2165, /* GL_UNDEFINED_APPLE */
+ 1518, /* GL_PURGEABLE_APPLE */
601, /* GL_FRAGMENT_SHADER */
- 2282, /* GL_VERTEX_SHADER */
- 1475, /* GL_PROGRAM_OBJECT_ARB */
- 1760, /* GL_SHADER_OBJECT_ARB */
+ 2286, /* GL_VERTEX_SHADER */
+ 1479, /* GL_PROGRAM_OBJECT_ARB */
+ 1764, /* GL_SHADER_OBJECT_ARB */
1049, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
1140, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
1131, /* GL_MAX_VARYING_COMPONENTS */
1138, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
1032, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
- 1264, /* GL_OBJECT_TYPE_ARB */
- 1762, /* GL_SHADER_TYPE */
+ 1265, /* GL_OBJECT_TYPE_ARB */
+ 1766, /* GL_SHADER_TYPE */
566, /* GL_FLOAT_VEC2 */
568, /* GL_FLOAT_VEC3 */
570, /* GL_FLOAT_VEC4 */
@@ -5921,14 +5930,14 @@ static const unsigned reduced_enums[1562] =
554, /* GL_FLOAT_MAT2 */
558, /* GL_FLOAT_MAT3 */
562, /* GL_FLOAT_MAT4 */
- 1699, /* GL_SAMPLER_1D */
- 1705, /* GL_SAMPLER_2D */
- 1713, /* GL_SAMPLER_3D */
- 1718, /* GL_SAMPLER_CUBE */
- 1704, /* GL_SAMPLER_1D_SHADOW */
- 1712, /* GL_SAMPLER_2D_SHADOW */
- 1710, /* GL_SAMPLER_2D_RECT */
- 1711, /* GL_SAMPLER_2D_RECT_SHADOW */
+ 1703, /* GL_SAMPLER_1D */
+ 1709, /* GL_SAMPLER_2D */
+ 1717, /* GL_SAMPLER_3D */
+ 1722, /* GL_SAMPLER_CUBE */
+ 1708, /* GL_SAMPLER_1D_SHADOW */
+ 1716, /* GL_SAMPLER_2D_SHADOW */
+ 1714, /* GL_SAMPLER_2D_RECT */
+ 1715, /* GL_SAMPLER_2D_RECT_SHADOW */
556, /* GL_FLOAT_MAT2x3 */
557, /* GL_FLOAT_MAT2x4 */
560, /* GL_FLOAT_MAT3x2 */
@@ -5938,90 +5947,90 @@ static const unsigned reduced_enums[1562] =
398, /* GL_DELETE_STATUS */
289, /* GL_COMPILE_STATUS */
852, /* GL_LINK_STATUS */
- 2227, /* GL_VALIDATE_STATUS */
+ 2231, /* GL_VALIDATE_STATUS */
750, /* GL_INFO_LOG_LENGTH */
64, /* GL_ATTACHED_SHADERS */
21, /* GL_ACTIVE_UNIFORMS */
22, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
- 1761, /* GL_SHADER_SOURCE_LENGTH */
+ 1765, /* GL_SHADER_SOURCE_LENGTH */
15, /* GL_ACTIVE_ATTRIBUTES */
16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
603, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
- 1764, /* GL_SHADING_LANGUAGE_VERSION */
+ 1768, /* GL_SHADING_LANGUAGE_VERSION */
375, /* GL_CURRENT_PROGRAM */
- 1313, /* GL_PALETTE4_RGB8_OES */
- 1315, /* GL_PALETTE4_RGBA8_OES */
- 1311, /* GL_PALETTE4_R5_G6_B5_OES */
- 1314, /* GL_PALETTE4_RGBA4_OES */
- 1312, /* GL_PALETTE4_RGB5_A1_OES */
- 1318, /* GL_PALETTE8_RGB8_OES */
- 1320, /* GL_PALETTE8_RGBA8_OES */
- 1316, /* GL_PALETTE8_R5_G6_B5_OES */
- 1319, /* GL_PALETTE8_RGBA4_OES */
- 1317, /* GL_PALETTE8_RGB5_A1_OES */
+ 1314, /* GL_PALETTE4_RGB8_OES */
+ 1316, /* GL_PALETTE4_RGBA8_OES */
+ 1312, /* GL_PALETTE4_R5_G6_B5_OES */
+ 1315, /* GL_PALETTE4_RGBA4_OES */
+ 1313, /* GL_PALETTE4_RGB5_A1_OES */
+ 1319, /* GL_PALETTE8_RGB8_OES */
+ 1321, /* GL_PALETTE8_RGBA8_OES */
+ 1317, /* GL_PALETTE8_R5_G6_B5_OES */
+ 1320, /* GL_PALETTE8_RGBA4_OES */
+ 1318, /* GL_PALETTE8_RGB5_A1_OES */
731, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
729, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
- 1365, /* GL_POINT_SIZE_ARRAY_OES */
- 2031, /* GL_TEXTURE_CROP_RECT_OES */
+ 1366, /* GL_POINT_SIZE_ARRAY_OES */
+ 2035, /* GL_TEXTURE_CROP_RECT_OES */
1004, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
- 1364, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
- 2210, /* GL_UNSIGNED_NORMALIZED */
- 1964, /* GL_TEXTURE_1D_ARRAY */
- 1500, /* GL_PROXY_TEXTURE_1D_ARRAY */
- 1967, /* GL_TEXTURE_2D_ARRAY */
- 1504, /* GL_PROXY_TEXTURE_2D_ARRAY */
- 1975, /* GL_TEXTURE_BINDING_1D_ARRAY */
- 1978, /* GL_TEXTURE_BINDING_2D_ARRAY */
+ 1365, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
+ 2214, /* GL_UNSIGNED_NORMALIZED */
+ 1968, /* GL_TEXTURE_1D_ARRAY */
+ 1504, /* GL_PROXY_TEXTURE_1D_ARRAY */
+ 1971, /* GL_TEXTURE_2D_ARRAY */
+ 1508, /* GL_PROXY_TEXTURE_2D_ARRAY */
+ 1979, /* GL_TEXTURE_BINDING_1D_ARRAY */
+ 1982, /* GL_TEXTURE_BINDING_2D_ARRAY */
1056, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
- 1995, /* GL_TEXTURE_BUFFER */
+ 1999, /* GL_TEXTURE_BUFFER */
1110, /* GL_MAX_TEXTURE_BUFFER_SIZE */
- 1982, /* GL_TEXTURE_BINDING_BUFFER */
- 1997, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
- 1999, /* GL_TEXTURE_BUFFER_FORMAT */
- 1537, /* GL_R11F_G11F_B10F */
- 2176, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
- 1649, /* GL_RGB9_E5 */
- 2185, /* GL_UNSIGNED_INT_5_9_9_9_REV */
- 2105, /* GL_TEXTURE_SHARED_SIZE */
- 1817, /* GL_SRGB */
- 1818, /* GL_SRGB8 */
- 1820, /* GL_SRGB_ALPHA */
- 1819, /* GL_SRGB8_ALPHA8 */
- 1777, /* GL_SLUMINANCE_ALPHA */
- 1776, /* GL_SLUMINANCE8_ALPHA8 */
- 1774, /* GL_SLUMINANCE */
- 1775, /* GL_SLUMINANCE8 */
+ 1986, /* GL_TEXTURE_BINDING_BUFFER */
+ 2001, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
+ 2003, /* GL_TEXTURE_BUFFER_FORMAT */
+ 1541, /* GL_R11F_G11F_B10F */
+ 2180, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
+ 1653, /* GL_RGB9_E5 */
+ 2189, /* GL_UNSIGNED_INT_5_9_9_9_REV */
+ 2109, /* GL_TEXTURE_SHARED_SIZE */
+ 1821, /* GL_SRGB */
+ 1822, /* GL_SRGB8 */
+ 1824, /* GL_SRGB_ALPHA */
+ 1823, /* GL_SRGB8_ALPHA8 */
+ 1781, /* GL_SLUMINANCE_ALPHA */
+ 1780, /* GL_SLUMINANCE8_ALPHA8 */
+ 1778, /* GL_SLUMINANCE */
+ 1779, /* GL_SLUMINANCE8 */
312, /* GL_COMPRESSED_SRGB */
313, /* GL_COMPRESSED_SRGB_ALPHA */
310, /* GL_COMPRESSED_SLUMINANCE */
311, /* GL_COMPRESSED_SLUMINANCE_ALPHA */
- 2140, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
- 2129, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
+ 2144, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
+ 2133, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
1129, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
- 2138, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
- 2134, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
- 2132, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
- 1447, /* GL_PRIMITIVES_GENERATED */
- 2136, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
- 1541, /* GL_RASTERIZER_DISCARD */
+ 2142, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
+ 2138, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
+ 2136, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
+ 1448, /* GL_PRIMITIVES_GENERATED */
+ 2140, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
+ 1545, /* GL_RASTERIZER_DISCARD */
1125, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
1127, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
769, /* GL_INTERLEAVED_ATTRIBS */
- 1753, /* GL_SEPARATE_ATTRIBS */
- 2124, /* GL_TRANSFORM_FEEDBACK_BUFFER */
- 2126, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
- 1383, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ 1757, /* GL_SEPARATE_ATTRIBS */
+ 2128, /* GL_TRANSFORM_FEEDBACK_BUFFER */
+ 2130, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
+ 1384, /* GL_POINT_SPRITE_COORD_ORIGIN */
861, /* GL_LOWER_LEFT */
- 2224, /* GL_UPPER_LEFT */
- 1841, /* GL_STENCIL_BACK_REF */
- 1842, /* GL_STENCIL_BACK_VALUE_MASK */
- 1843, /* GL_STENCIL_BACK_WRITEMASK */
+ 2228, /* GL_UPPER_LEFT */
+ 1845, /* GL_STENCIL_BACK_REF */
+ 1846, /* GL_STENCIL_BACK_VALUE_MASK */
+ 1847, /* GL_STENCIL_BACK_WRITEMASK */
504, /* GL_DRAW_FRAMEBUFFER_BINDING */
- 1571, /* GL_RENDERBUFFER_BINDING */
- 1545, /* GL_READ_FRAMEBUFFER */
+ 1575, /* GL_RENDERBUFFER_BINDING */
+ 1549, /* GL_READ_FRAMEBUFFER */
503, /* GL_DRAW_FRAMEBUFFER */
- 1546, /* GL_READ_FRAMEBUFFER_BINDING */
- 1590, /* GL_RENDERBUFFER_SAMPLES */
+ 1550, /* GL_READ_FRAMEBUFFER_BINDING */
+ 1594, /* GL_RENDERBUFFER_SAMPLES */
617, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
614, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
629, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
@@ -6055,87 +6064,87 @@ static const unsigned reduced_enums[1562] =
208, /* GL_COLOR_ATTACHMENT14 */
210, /* GL_COLOR_ATTACHMENT15 */
403, /* GL_DEPTH_ATTACHMENT */
- 1830, /* GL_STENCIL_ATTACHMENT */
+ 1834, /* GL_STENCIL_ATTACHMENT */
605, /* GL_FRAMEBUFFER */
- 1568, /* GL_RENDERBUFFER */
- 1594, /* GL_RENDERBUFFER_WIDTH */
- 1581, /* GL_RENDERBUFFER_HEIGHT */
- 1584, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
- 1862, /* GL_STENCIL_INDEX_EXT */
- 1851, /* GL_STENCIL_INDEX1 */
- 1856, /* GL_STENCIL_INDEX4 */
- 1859, /* GL_STENCIL_INDEX8 */
- 1852, /* GL_STENCIL_INDEX16 */
- 1588, /* GL_RENDERBUFFER_RED_SIZE */
- 1579, /* GL_RENDERBUFFER_GREEN_SIZE */
- 1574, /* GL_RENDERBUFFER_BLUE_SIZE */
- 1569, /* GL_RENDERBUFFER_ALPHA_SIZE */
- 1576, /* GL_RENDERBUFFER_DEPTH_SIZE */
- 1592, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ 1572, /* GL_RENDERBUFFER */
+ 1598, /* GL_RENDERBUFFER_WIDTH */
+ 1585, /* GL_RENDERBUFFER_HEIGHT */
+ 1588, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ 1866, /* GL_STENCIL_INDEX_EXT */
+ 1855, /* GL_STENCIL_INDEX1 */
+ 1860, /* GL_STENCIL_INDEX4 */
+ 1863, /* GL_STENCIL_INDEX8 */
+ 1856, /* GL_STENCIL_INDEX16 */
+ 1592, /* GL_RENDERBUFFER_RED_SIZE */
+ 1583, /* GL_RENDERBUFFER_GREEN_SIZE */
+ 1578, /* GL_RENDERBUFFER_BLUE_SIZE */
+ 1573, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ 1580, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ 1596, /* GL_RENDERBUFFER_STENCIL_SIZE */
658, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
1105, /* GL_MAX_SAMPLES */
- 2067, /* GL_TEXTURE_GEN_STR_OES */
+ 2071, /* GL_TEXTURE_GEN_STR_OES */
705, /* GL_HALF_FLOAT_OES */
- 1636, /* GL_RGB565_OES */
- 1666, /* GL_RGBA32UI */
- 1629, /* GL_RGB32UI */
+ 1639, /* GL_RGB565 */
+ 1670, /* GL_RGBA32UI */
+ 1633, /* GL_RGB32UI */
40, /* GL_ALPHA32UI_EXT */
761, /* GL_INTENSITY32UI_EXT */
878, /* GL_LUMINANCE32UI_EXT */
895, /* GL_LUMINANCE_ALPHA32UI_EXT */
- 1657, /* GL_RGBA16UI */
- 1621, /* GL_RGB16UI */
+ 1661, /* GL_RGBA16UI */
+ 1625, /* GL_RGB16UI */
37, /* GL_ALPHA16UI_EXT */
758, /* GL_INTENSITY16UI_EXT */
873, /* GL_LUMINANCE16UI_EXT */
893, /* GL_LUMINANCE_ALPHA16UI_EXT */
- 1676, /* GL_RGBA8UI */
- 1644, /* GL_RGB8UI */
+ 1680, /* GL_RGBA8UI */
+ 1648, /* GL_RGB8UI */
45, /* GL_ALPHA8UI_EXT */
766, /* GL_INTENSITY8UI_EXT */
887, /* GL_LUMINANCE8UI_EXT */
897, /* GL_LUMINANCE_ALPHA8UI_EXT */
- 1664, /* GL_RGBA32I */
- 1627, /* GL_RGB32I */
+ 1668, /* GL_RGBA32I */
+ 1631, /* GL_RGB32I */
39, /* GL_ALPHA32I_EXT */
760, /* GL_INTENSITY32I_EXT */
877, /* GL_LUMINANCE32I_EXT */
894, /* GL_LUMINANCE_ALPHA32I_EXT */
- 1655, /* GL_RGBA16I */
- 1619, /* GL_RGB16I */
+ 1659, /* GL_RGBA16I */
+ 1623, /* GL_RGB16I */
36, /* GL_ALPHA16I_EXT */
757, /* GL_INTENSITY16I_EXT */
872, /* GL_LUMINANCE16I_EXT */
892, /* GL_LUMINANCE_ALPHA16I_EXT */
- 1674, /* GL_RGBA8I */
- 1642, /* GL_RGB8I */
+ 1678, /* GL_RGBA8I */
+ 1646, /* GL_RGB8I */
44, /* GL_ALPHA8I_EXT */
765, /* GL_INTENSITY8I_EXT */
886, /* GL_LUMINANCE8I_EXT */
896, /* GL_LUMINANCE_ALPHA8I_EXT */
- 1558, /* GL_RED_INTEGER */
+ 1562, /* GL_RED_INTEGER */
700, /* GL_GREEN_INTEGER */
113, /* GL_BLUE_INTEGER */
49, /* GL_ALPHA_INTEGER_EXT */
- 1689, /* GL_RGB_INTEGER */
- 1683, /* GL_RGBA_INTEGER */
+ 1693, /* GL_RGB_INTEGER */
+ 1687, /* GL_RGBA_INTEGER */
84, /* GL_BGR_INTEGER */
82, /* GL_BGRA_INTEGER */
899, /* GL_LUMINANCE_INTEGER_EXT */
898, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
- 1685, /* GL_RGBA_INTEGER_MODE_EXT */
+ 1689, /* GL_RGBA_INTEGER_MODE_EXT */
612, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
653, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
652, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
- 1700, /* GL_SAMPLER_1D_ARRAY */
- 1706, /* GL_SAMPLER_2D_ARRAY */
- 1716, /* GL_SAMPLER_BUFFER */
- 1702, /* GL_SAMPLER_1D_ARRAY_SHADOW */
- 1708, /* GL_SAMPLER_2D_ARRAY_SHADOW */
- 1719, /* GL_SAMPLER_CUBE_SHADOW */
- 2204, /* GL_UNSIGNED_INT_VEC2 */
- 2206, /* GL_UNSIGNED_INT_VEC3 */
- 2208, /* GL_UNSIGNED_INT_VEC4 */
+ 1704, /* GL_SAMPLER_1D_ARRAY */
+ 1710, /* GL_SAMPLER_2D_ARRAY */
+ 1720, /* GL_SAMPLER_BUFFER */
+ 1706, /* GL_SAMPLER_1D_ARRAY_SHADOW */
+ 1712, /* GL_SAMPLER_2D_ARRAY_SHADOW */
+ 1723, /* GL_SAMPLER_CUBE_SHADOW */
+ 2208, /* GL_UNSIGNED_INT_VEC2 */
+ 2210, /* GL_UNSIGNED_INT_VEC3 */
+ 2212, /* GL_UNSIGNED_INT_VEC4 */
775, /* GL_INT_SAMPLER_1D */
779, /* GL_INT_SAMPLER_2D */
785, /* GL_INT_SAMPLER_3D */
@@ -6144,14 +6153,14 @@ static const unsigned reduced_enums[1562] =
776, /* GL_INT_SAMPLER_1D_ARRAY */
780, /* GL_INT_SAMPLER_2D_ARRAY */
787, /* GL_INT_SAMPLER_BUFFER */
- 2188, /* GL_UNSIGNED_INT_SAMPLER_1D */
- 2192, /* GL_UNSIGNED_INT_SAMPLER_2D */
- 2198, /* GL_UNSIGNED_INT_SAMPLER_3D */
- 2202, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
- 2196, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
- 2189, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
- 2193, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
- 2200, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
+ 2192, /* GL_UNSIGNED_INT_SAMPLER_1D */
+ 2196, /* GL_UNSIGNED_INT_SAMPLER_2D */
+ 2202, /* GL_UNSIGNED_INT_SAMPLER_3D */
+ 2206, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
+ 2200, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
+ 2193, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
+ 2197, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
+ 2204, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
691, /* GL_GEOMETRY_SHADER */
694, /* GL_GEOMETRY_VERTICES_OUT_ARB */
688, /* GL_GEOMETRY_INPUT_TYPE_ARB */
@@ -6167,56 +6176,56 @@ static const unsigned reduced_enums[1562] =
863, /* GL_LOW_INT */
1148, /* GL_MEDIUM_INT */
707, /* GL_HIGH_INT */
- 2178, /* GL_UNSIGNED_INT_10_10_10_2_OES */
+ 2182, /* GL_UNSIGNED_INT_10_10_10_2_OES */
774, /* GL_INT_10_10_10_2_OES */
- 1758, /* GL_SHADER_BINARY_FORMATS */
- 1249, /* GL_NUM_SHADER_BINARY_FORMATS */
- 1759, /* GL_SHADER_COMPILER */
+ 1762, /* GL_SHADER_BINARY_FORMATS */
+ 1250, /* GL_NUM_SHADER_BINARY_FORMATS */
+ 1763, /* GL_SHADER_COMPILER */
1142, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
1134, /* GL_MAX_VARYING_VECTORS */
1051, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
- 1534, /* GL_QUERY_WAIT */
- 1528, /* GL_QUERY_NO_WAIT */
- 1524, /* GL_QUERY_BY_REGION_WAIT */
- 1522, /* GL_QUERY_BY_REGION_NO_WAIT */
- 2122, /* GL_TRANSFORM_FEEDBACK */
- 2131, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
- 2125, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
- 2123, /* GL_TRANSFORM_FEEDBACK_BINDING */
- 1518, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+ 1538, /* GL_QUERY_WAIT */
+ 1532, /* GL_QUERY_NO_WAIT */
+ 1528, /* GL_QUERY_BY_REGION_WAIT */
+ 1526, /* GL_QUERY_BY_REGION_NO_WAIT */
+ 2126, /* GL_TRANSFORM_FEEDBACK */
+ 2135, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+ 2129, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+ 2127, /* GL_TRANSFORM_FEEDBACK_BINDING */
+ 1522, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
546, /* GL_FIRST_VERTEX_CONVENTION */
807, /* GL_LAST_VERTEX_CONVENTION */
- 1492, /* GL_PROVOKING_VERTEX */
+ 1496, /* GL_PROVOKING_VERTEX */
354, /* GL_COPY_READ_BUFFER */
355, /* GL_COPY_WRITE_BUFFER */
- 1561, /* GL_RED_SNORM */
- 1696, /* GL_RG_SNORM */
- 1695, /* GL_RGB_SNORM */
- 1688, /* GL_RGBA_SNORM */
- 1540, /* GL_R8_SNORM */
- 1609, /* GL_RG8_SNORM */
- 1648, /* GL_RGB8_SNORM */
- 1680, /* GL_RGBA8_SNORM */
- 1538, /* GL_R16_SNORM */
- 1608, /* GL_RG16_SNORM */
- 1624, /* GL_RGB16_SNORM */
- 1660, /* GL_RGBA16_SNORM */
- 1770, /* GL_SIGNED_NORMALIZED */
- 1449, /* GL_PRIMITIVE_RESTART */
- 1450, /* GL_PRIMITIVE_RESTART_INDEX */
+ 1565, /* GL_RED_SNORM */
+ 1700, /* GL_RG_SNORM */
+ 1699, /* GL_RGB_SNORM */
+ 1692, /* GL_RGBA_SNORM */
+ 1544, /* GL_R8_SNORM */
+ 1613, /* GL_RG8_SNORM */
+ 1652, /* GL_RGB8_SNORM */
+ 1684, /* GL_RGBA8_SNORM */
+ 1542, /* GL_R16_SNORM */
+ 1612, /* GL_RG16_SNORM */
+ 1628, /* GL_RGB16_SNORM */
+ 1664, /* GL_RGBA16_SNORM */
+ 1774, /* GL_SIGNED_NORMALIZED */
+ 1450, /* GL_PRIMITIVE_RESTART */
+ 1451, /* GL_PRIMITIVE_RESTART_INDEX */
1107, /* GL_MAX_SERVER_WAIT_TIMEOUT */
- 1263, /* GL_OBJECT_TYPE */
- 1883, /* GL_SYNC_CONDITION */
- 1888, /* GL_SYNC_STATUS */
- 1885, /* GL_SYNC_FLAGS */
- 1884, /* GL_SYNC_FENCE */
- 1887, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
- 2171, /* GL_UNSIGNALED */
- 1769, /* GL_SIGNALED */
+ 1264, /* GL_OBJECT_TYPE */
+ 1887, /* GL_SYNC_CONDITION */
+ 1892, /* GL_SYNC_STATUS */
+ 1889, /* GL_SYNC_FLAGS */
+ 1888, /* GL_SYNC_FENCE */
+ 1891, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
+ 2175, /* GL_UNSIGNALED */
+ 1773, /* GL_SIGNALED */
54, /* GL_ALREADY_SIGNALED */
- 2117, /* GL_TIMEOUT_EXPIRED */
+ 2121, /* GL_TIMEOUT_EXPIRED */
315, /* GL_CONDITION_SATISFIED */
- 2288, /* GL_WAIT_FAILED */
+ 2292, /* GL_WAIT_FAILED */
126, /* GL_BUFFER_ACCESS_FLAGS */
132, /* GL_BUFFER_MAP_LENGTH */
133, /* GL_BUFFER_MAP_OFFSET */
@@ -6226,10 +6235,10 @@ static const unsigned reduced_enums[1562] =
1048, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
330, /* GL_CONTEXT_PROFILE_MASK */
531, /* GL_EVAL_BIT */
- 1543, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ 1547, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
854, /* GL_LIST_BIT */
- 1990, /* GL_TEXTURE_BIT */
- 1739, /* GL_SCISSOR_BIT */
+ 1994, /* GL_TEXTURE_BIT */
+ 1743, /* GL_SCISSOR_BIT */
30, /* GL_ALL_ATTRIB_BITS */
1213, /* GL_MULTISAMPLE_BIT */
31, /* GL_ALL_CLIENT_ATTRIB_BITS */
diff --git a/mesalib/src/mesa/main/es_generator.py b/mesalib/src/mesa/main/es_generator.py
index c0b0a4458..cad3deaef 100644
--- a/mesalib/src/mesa/main/es_generator.py
+++ b/mesalib/src/mesa/main/es_generator.py
@@ -681,10 +681,10 @@ print """
#if FEATURE_remap_table
/* define esLocalRemapTable */
-#include "%sapi/main/dispatch.h"
+#include "main/api_exec_%s_dispatch.h"
#define need_MESA_remap_table
-#include "%sapi/main/remap_helper.h"
+#include "main/api_exec_%s_remap_helper.h"
static void
init_remap_table(void)
diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c
index 267620a20..14b0cf9ac 100644
--- a/mesalib/src/mesa/main/extensions.c
+++ b/mesalib/src/mesa/main/extensions.c
@@ -1,1004 +1,1005 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.6
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. 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
- * \brief Extension handling
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "extensions.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-
-enum {
- DISABLE = 0,
- GL = 1 << API_OPENGL,
- ES1 = 1 << API_OPENGLES,
- ES2 = 1 << API_OPENGLES2,
-};
-
-/**
- * \brief An element of the \c extension_table.
- */
-struct extension {
- /** Name of extension, such as "GL_ARB_depth_clamp". */
- const char *name;
-
- /** Offset (in bytes) of the corresponding member in struct gl_extensions. */
- size_t offset;
-
- /** Set of API's in which the extension exists, as a bitset. */
- uint8_t api_set;
-
- /** Year the extension was proposed or approved. Used to sort the
- * extension string chronologically. */
- uint16_t year;
-};
-
-
-/**
- * Given a member \c x of struct gl_extensions, return offset of
- * \c x in bytes.
- */
-#define o(x) offsetof(struct gl_extensions, x)
-
-
-/**
- * \brief Table of supported OpenGL extensions for all API's.
- *
- * Note: The GL_MESAX_* extensions are placeholders for future ARB extensions.
- */
-static const struct extension extension_table[] = {
- /* ARB Extensions */
- { "GL_ARB_ES2_compatibility", o(ARB_ES2_compatibility), GL, 2009 },
- { "GL_ARB_blend_func_extended", o(ARB_blend_func_extended), GL, 2009 },
- { "GL_ARB_color_buffer_float", o(ARB_color_buffer_float), GL, 2004 },
- { "GL_ARB_copy_buffer", o(ARB_copy_buffer), GL, 2008 },
- { "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL, 2008 },
- { "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 },
- { "GL_ARB_depth_texture", o(ARB_depth_texture), GL, 2001 },
- { "GL_ARB_draw_buffers", o(ARB_draw_buffers), GL, 2002 },
- { "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 },
- { "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 },
- { "GL_ARB_draw_instanced", o(ARB_draw_instanced), GL, 2008 },
- { "GL_ARB_explicit_attrib_location", o(ARB_explicit_attrib_location), GL, 2009 },
- { "GL_ARB_fragment_coord_conventions", o(ARB_fragment_coord_conventions), GL, 2009 },
- { "GL_ARB_fragment_program", o(ARB_fragment_program), GL, 2002 },
- { "GL_ARB_fragment_program_shadow", o(ARB_fragment_program_shadow), GL, 2003 },
- { "GL_ARB_fragment_shader", o(ARB_fragment_shader), GL, 2002 },
- { "GL_ARB_framebuffer_object", o(ARB_framebuffer_object), GL, 2005 },
- { "GL_ARB_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 },
- { "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 },
- { "GL_ARB_map_buffer_range", o(ARB_map_buffer_range), GL, 2008 },
- { "GL_ARB_multisample", o(ARB_multisample), GL, 1994 },
- { "GL_ARB_multitexture", o(ARB_multitexture), GL, 1998 },
- { "GL_ARB_occlusion_query2", o(ARB_occlusion_query2), GL, 2003 },
- { "GL_ARB_occlusion_query", o(ARB_occlusion_query), GL, 2001 },
- { "GL_ARB_pixel_buffer_object", o(EXT_pixel_buffer_object), GL, 2004 },
- { "GL_ARB_point_parameters", o(EXT_point_parameters), GL, 1997 },
- { "GL_ARB_point_sprite", o(ARB_point_sprite), GL, 2003 },
- { "GL_ARB_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 },
- { "GL_ARB_robustness", o(dummy_true), GL, 2010 },
- { "GL_ARB_sampler_objects", o(ARB_sampler_objects), GL, 2009 },
- { "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL, 2009 },
- { "GL_ARB_shader_objects", o(ARB_shader_objects), GL, 2002 },
- { "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 },
- { "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 },
- { "GL_ARB_shading_language_100", o(ARB_shading_language_100), GL, 2003 },
- { "GL_ARB_shadow_ambient", o(ARB_shadow_ambient), GL, 2001 },
- { "GL_ARB_shadow", o(ARB_shadow), GL, 2001 },
- { "GL_ARB_sync", o(ARB_sync), GL, 2003 },
- { "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GL, 2000 },
- { "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GL, 2008 },
- { "GL_ARB_texture_compression", o(ARB_texture_compression), GL, 2000 },
- { "GL_ARB_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 },
- { "GL_ARB_texture_cube_map", o(ARB_texture_cube_map), GL, 1999 },
- { "GL_ARB_texture_env_add", o(EXT_texture_env_add), GL, 1999 },
- { "GL_ARB_texture_env_combine", o(ARB_texture_env_combine), GL, 2001 },
- { "GL_ARB_texture_env_crossbar", o(ARB_texture_env_crossbar), GL, 2001 },
- { "GL_ARB_texture_env_dot3", o(ARB_texture_env_dot3), GL, 2001 },
- { "GL_ARB_texture_float", o(ARB_texture_float), GL, 2004 },
- { "GL_ARB_texture_mirrored_repeat", o(ARB_texture_mirrored_repeat), GL, 2001 },
- { "GL_ARB_texture_multisample", o(ARB_texture_multisample), GL, 2009 },
- { "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), GL, 2003 },
- { "GL_ARB_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
- { "GL_ARB_texture_rgb10_a2ui", o(ARB_texture_rgb10_a2ui), GL, 2009 },
- { "GL_ARB_texture_rg", o(ARB_texture_rg), GL, 2008 },
- { "GL_ARB_texture_swizzle", o(EXT_texture_swizzle), GL, 2008 },
- { "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 },
- { "GL_ARB_transpose_matrix", o(ARB_transpose_matrix), GL, 1999 },
- { "GL_ARB_uniform_buffer_object", o(ARB_uniform_buffer_object), GL, 2002 },
- { "GL_ARB_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 },
- { "GL_ARB_vertex_array_object", o(ARB_vertex_array_object), GL, 2006 },
- { "GL_ARB_vertex_buffer_object", o(ARB_vertex_buffer_object), GL, 2003 },
- { "GL_ARB_vertex_program", o(ARB_vertex_program), GL, 2002 },
- { "GL_ARB_vertex_shader", o(ARB_vertex_shader), GL, 2002 },
- { "GL_ARB_vertex_type_2_10_10_10_rev", o(ARB_vertex_type_2_10_10_10_rev), GL, 2009 },
- { "GL_ARB_window_pos", o(ARB_window_pos), GL, 2001 },
- /* EXT extensions */
- { "GL_EXT_abgr", o(EXT_abgr), GL, 1995 },
- { "GL_EXT_bgra", o(EXT_bgra), GL, 1995 },
- { "GL_EXT_blend_color", o(EXT_blend_color), GL, 1995 },
- { "GL_EXT_blend_equation_separate", o(EXT_blend_equation_separate), GL, 2003 },
- { "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), GL, 1999 },
- { "GL_EXT_blend_logic_op", o(EXT_blend_logic_op), GL, 1995 },
- { "GL_EXT_blend_minmax", o(EXT_blend_minmax), GL | ES1 | ES2, 1995 },
- { "GL_EXT_blend_subtract", o(EXT_blend_subtract), GL, 1995 },
- { "GL_EXT_clip_volume_hint", o(EXT_clip_volume_hint), GL, 1996 },
- { "GL_EXT_compiled_vertex_array", o(EXT_compiled_vertex_array), GL, 1996 },
- { "GL_EXT_copy_texture", o(EXT_copy_texture), GL, 1995 },
- { "GL_EXT_depth_bounds_test", o(EXT_depth_bounds_test), GL, 2002 },
- { "GL_EXT_draw_buffers2", o(EXT_draw_buffers2), GL, 2006 },
- { "GL_EXT_draw_instanced", o(ARB_draw_instanced), GL, 2006 },
- { "GL_EXT_draw_range_elements", o(EXT_draw_range_elements), GL, 1997 },
- { "GL_EXT_fog_coord", o(EXT_fog_coord), GL, 1999 },
- { "GL_EXT_framebuffer_blit", o(EXT_framebuffer_blit), GL, 2005 },
- { "GL_EXT_framebuffer_multisample", o(EXT_framebuffer_multisample), GL, 2005 },
- { "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), GL, 2006 },
- { "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL, 2006 },
- { "GL_EXT_multi_draw_arrays", o(EXT_multi_draw_arrays), GL | ES1 | ES2, 1999 },
- { "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2005 },
- { "GL_EXT_packed_float", o(EXT_packed_float), GL, 2004 },
- { "GL_EXT_packed_pixels", o(EXT_packed_pixels), GL, 1997 },
- { "GL_EXT_paletted_texture", o(EXT_paletted_texture), GL, 1995 },
- { "GL_EXT_pixel_buffer_object", o(EXT_pixel_buffer_object), GL, 2004 },
- { "GL_EXT_point_parameters", o(EXT_point_parameters), GL, 1997 },
- { "GL_EXT_polygon_offset", o(EXT_polygon_offset), GL, 1995 },
- { "GL_EXT_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 },
- { "GL_EXT_rescale_normal", o(EXT_rescale_normal), GL, 1997 },
- { "GL_EXT_secondary_color", o(EXT_secondary_color), GL, 1999 },
- { "GL_EXT_separate_shader_objects", o(EXT_separate_shader_objects), GL, 2008 },
- { "GL_EXT_separate_specular_color", o(EXT_separate_specular_color), GL, 1997 },
- { "GL_EXT_shadow_funcs", o(EXT_shadow_funcs), GL, 2002 },
- { "GL_EXT_shared_texture_palette", o(EXT_shared_texture_palette), GL, 2000 },
- { "GL_EXT_stencil_two_side", o(EXT_stencil_two_side), GL, 2001 },
- { "GL_EXT_stencil_wrap", o(EXT_stencil_wrap), GL, 2002 },
- { "GL_EXT_subtexture", o(EXT_subtexture), GL, 1995 },
- { "GL_EXT_texture3D", o(EXT_texture3D), GL, 1996 },
- { "GL_EXT_texture_array", o(EXT_texture_array), GL, 2006 },
- { "GL_EXT_texture_compression_dxt1", o(EXT_texture_compression_s3tc), GL | ES1 | ES2, 2004 },
- { "GL_EXT_texture_compression_latc", o(EXT_texture_compression_latc), GL, 2006 },
- { "GL_EXT_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 },
- { "GL_EXT_texture_compression_s3tc", o(EXT_texture_compression_s3tc), GL, 2000 },
- { "GL_EXT_texture_cube_map", o(ARB_texture_cube_map), GL, 2001 },
- { "GL_EXT_texture_edge_clamp", o(SGIS_texture_edge_clamp), GL, 1997 },
- { "GL_EXT_texture_env_add", o(EXT_texture_env_add), GL, 1999 },
- { "GL_EXT_texture_env_combine", o(EXT_texture_env_combine), GL, 2006 },
- { "GL_EXT_texture_env_dot3", o(EXT_texture_env_dot3), GL, 2000 },
- { "GL_EXT_texture_filter_anisotropic", o(EXT_texture_filter_anisotropic), GL | ES1 | ES2, 1999 },
- { "GL_EXT_texture_format_BGRA8888", o(EXT_texture_format_BGRA8888), ES1 | ES2, 2009 },
- { "GL_EXT_texture_integer", o(EXT_texture_integer), GL, 2006 },
- { "GL_EXT_texture_lod_bias", o(EXT_texture_lod_bias), GL | ES1, 1999 },
- { "GL_EXT_texture_mirror_clamp", o(EXT_texture_mirror_clamp), GL, 2004 },
- { "GL_EXT_texture_object", o(EXT_texture_object), GL, 1995 },
- { "GL_EXT_texture", o(EXT_texture), GL, 1996 },
- { "GL_EXT_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
- { "GL_EXT_texture_shared_exponent", o(EXT_texture_shared_exponent), GL, 2004 },
- { "GL_EXT_texture_snorm", o(EXT_texture_snorm), GL, 2009 },
- { "GL_EXT_texture_sRGB", o(EXT_texture_sRGB), GL, 2004 },
- { "GL_EXT_texture_sRGB_decode", o(EXT_texture_sRGB_decode), GL, 2006 },
- { "GL_EXT_texture_swizzle", o(EXT_texture_swizzle), GL, 2008 },
- { "GL_EXT_texture_type_2_10_10_10_REV", o(dummy_true), ES2, 2008 },
- { "GL_EXT_timer_query", o(EXT_timer_query), GL, 2006 },
- { "GL_EXT_transform_feedback", o(EXT_transform_feedback), GL, 2011 },
- { "GL_EXT_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 },
- { "GL_EXT_vertex_array", o(EXT_vertex_array), GL, 1995 },
- { "GL_EXT_vertex_array_set", o(EXT_vertex_array_set), GL, 1997 },
-
- /* OES extensions */
- { "GL_OES_blend_equation_separate", o(EXT_blend_equation_separate), ES1, 2009 },
- { "GL_OES_blend_func_separate", o(EXT_blend_func_separate), ES1, 2009 },
- { "GL_OES_blend_subtract", o(EXT_blend_subtract), ES1, 2009 },
- { "GL_OES_byte_coordinates", o(dummy_true), ES1, 2002 },
- { "GL_OES_compressed_paletted_texture", o(dummy_false), DISABLE, 2003 },
- { "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
- { "GL_OES_depth32", o(dummy_false), DISABLE, 2005 },
- { "GL_OES_depth_texture", o(ARB_depth_texture), ES2, 2006 },
-#if FEATURE_OES_draw_texture
- { "GL_OES_draw_texture", o(OES_draw_texture), ES1 | ES2, 2004 },
-#endif
-#if FEATURE_OES_EGL_image
- /* FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL contexts. */
- { "GL_OES_EGL_image", o(OES_EGL_image), GL | ES1 | ES2, 2006 },
-#endif
- { "GL_OES_element_index_uint", o(EXT_vertex_array), ES1 | ES2, 2005 },
- { "GL_OES_fbo_render_mipmap", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
- { "GL_OES_fixed_point", o(dummy_true), ES1, 2002 },
- { "GL_OES_framebuffer_object", o(EXT_framebuffer_object), ES1, 2005 },
- { "GL_OES_mapbuffer", o(ARB_vertex_buffer_object), ES1 | ES2, 2005 },
- { "GL_OES_matrix_get", o(dummy_true), ES1, 2004 },
- { "GL_OES_packed_depth_stencil", o(EXT_packed_depth_stencil), ES1 | ES2, 2007 },
- { "GL_OES_point_size_array", o(dummy_true), ES1, 2004 },
- { "GL_OES_point_sprite", o(ARB_point_sprite), ES1, 2004 },
- { "GL_OES_query_matrix", o(dummy_true), ES1, 2003 },
- { "GL_OES_read_format", o(OES_read_format), GL | ES1, 2003 },
- { "GL_OES_rgb8_rgba8", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
- { "GL_OES_single_precision", o(dummy_true), ES1, 2003 },
- { "GL_OES_standard_derivatives", o(OES_standard_derivatives), ES2, 2005 },
- { "GL_OES_stencil1", o(dummy_false), DISABLE, 2005 },
- { "GL_OES_stencil4", o(dummy_false), DISABLE, 2005 },
- { "GL_OES_stencil8", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
- { "GL_OES_stencil_wrap", o(EXT_stencil_wrap), ES1, 2002 },
- { "GL_OES_texture_3D", o(EXT_texture3D), ES2, 2005 },
- { "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(ARB_texture_mirrored_repeat), ES1, 2005 },
- { "GL_OES_texture_npot", o(ARB_texture_non_power_of_two), ES2, 2005 },
-
- /* Vendor extensions */
- { "GL_3DFX_texture_compression_FXT1", o(TDFX_texture_compression_FXT1), GL, 1999 },
- { "GL_AMD_conservative_depth", o(AMD_conservative_depth), GL, 2009 },
- { "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_APPLE_client_storage", o(APPLE_client_storage), GL, 2002 },
- { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), GL, 2006 },
- { "GL_APPLE_packed_pixels", o(APPLE_packed_pixels), GL, 2002 },
- { "GL_APPLE_vertex_array_object", o(APPLE_vertex_array_object), GL, 2002 },
- { "GL_ATI_blend_equation_separate", o(EXT_blend_equation_separate), GL, 2003 },
- { "GL_ATI_draw_buffers", o(ARB_draw_buffers), GL, 2002 },
- { "GL_ATI_envmap_bumpmap", o(ATI_envmap_bumpmap), GL, 2001 },
- { "GL_ATI_fragment_shader", o(ATI_fragment_shader), GL, 2001 },
- { "GL_ATI_separate_stencil", o(ATI_separate_stencil), GL, 2006 },
- { "GL_ATI_texture_compression_3dc", o(ATI_texture_compression_3dc), GL, 2004 },
- { "GL_ATI_texture_env_combine3", o(ATI_texture_env_combine3), GL, 2002 },
- { "GL_ATI_texture_float", o(ARB_texture_float), GL, 2002 },
- { "GL_ATI_texture_mirror_once", o(ATI_texture_mirror_once), GL, 2006 },
- { "GL_IBM_multimode_draw_arrays", o(IBM_multimode_draw_arrays), GL, 1998 },
- { "GL_IBM_rasterpos_clip", o(IBM_rasterpos_clip), GL, 1996 },
- { "GL_IBM_texture_mirrored_repeat", o(ARB_texture_mirrored_repeat), GL, 1998 },
- { "GL_INGR_blend_func_separate", o(EXT_blend_func_separate), GL, 1999 },
- { "GL_MESA_pack_invert", o(MESA_pack_invert), GL, 2002 },
- { "GL_MESA_resize_buffers", o(MESA_resize_buffers), GL, 1999 },
- { "GL_MESA_texture_array", o(MESA_texture_array), GL, 2007 },
- { "GL_MESA_texture_signed_rgba", o(EXT_texture_snorm), GL, 2009 },
- { "GL_MESA_window_pos", o(ARB_window_pos), GL, 2000 },
- { "GL_MESA_ycbcr_texture", o(MESA_ycbcr_texture), GL, 2002 },
- { "GL_NV_blend_square", o(NV_blend_square), GL, 1999 },
- { "GL_NV_conditional_render", o(NV_conditional_render), GL, 2008 },
- { "GL_NV_depth_clamp", o(ARB_depth_clamp), GL, 2001 },
- { "GL_NV_fragment_program", o(NV_fragment_program), GL, 2001 },
- { "GL_NV_fragment_program_option", o(NV_fragment_program_option), GL, 2005 },
- { "GL_NV_light_max_exponent", o(NV_light_max_exponent), GL, 1999 },
- { "GL_NV_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2000 },
- { "GL_NV_point_sprite", o(NV_point_sprite), GL, 2001 },
- { "GL_NV_primitive_restart", o(NV_primitive_restart), GL, 2002 },
- { "GL_NV_texgen_reflection", o(NV_texgen_reflection), GL, 1999 },
- { "GL_NV_texture_barrier", o(NV_texture_barrier), GL, 2009 },
- { "GL_NV_texture_env_combine4", o(NV_texture_env_combine4), GL, 1999 },
- { "GL_NV_texture_rectangle", o(NV_texture_rectangle), GL, 2000 },
- { "GL_NV_vertex_program1_1", o(NV_vertex_program1_1), GL, 2001 },
- { "GL_NV_vertex_program", o(NV_vertex_program), GL, 2000 },
- { "GL_S3_s3tc", o(S3_s3tc), GL, 1999 },
- { "GL_SGIS_generate_mipmap", o(SGIS_generate_mipmap), GL, 1997 },
- { "GL_SGIS_texture_border_clamp", o(ARB_texture_border_clamp), GL, 1997 },
- { "GL_SGIS_texture_edge_clamp", o(SGIS_texture_edge_clamp), GL, 1997 },
- { "GL_SGIS_texture_lod", o(SGIS_texture_lod), GL, 1997 },
- { "GL_SUN_multi_draw_arrays", o(EXT_multi_draw_arrays), GL, 1999 },
-
- { 0, 0, 0, 0 },
-};
-
-
-/**
- * Given an extension name, lookup up the corresponding member of struct
- * gl_extensions and return that member's offset (in bytes). If the name is
- * not found in the \c extension_table, return 0.
- *
- * \param name Name of extension.
- * \return Offset of member in struct gl_extensions.
- */
-static size_t
-name_to_offset(const char* name)
-{
- const struct extension *i;
-
- if (name == 0)
- return 0;
-
- for (i = extension_table; i->name != 0; ++i) {
- if (strcmp(name, i->name) == 0)
- return i->offset;
- }
-
- return 0;
-}
-
-
-/**
- * \brief Extensions enabled by default.
- *
- * These extensions are enabled by _mesa_init_extensions().
- *
- * XXX: Should these defaults also apply to GLES?
- */
-static const size_t default_extensions[] = {
- o(ARB_copy_buffer),
- o(ARB_draw_buffers),
- o(ARB_multisample),
- o(ARB_texture_compression),
- o(ARB_transpose_matrix),
- o(ARB_vertex_buffer_object),
- o(ARB_window_pos),
-
- o(EXT_abgr),
- o(EXT_bgra),
- o(EXT_compiled_vertex_array),
- o(EXT_copy_texture),
- o(EXT_draw_range_elements),
- o(EXT_multi_draw_arrays),
- o(EXT_packed_pixels),
- o(EXT_polygon_offset),
- o(EXT_rescale_normal),
- o(EXT_separate_specular_color),
- o(EXT_subtexture),
- o(EXT_texture),
- o(EXT_texture3D),
- o(EXT_texture_object),
- o(EXT_vertex_array),
-
- o(OES_read_format),
- o(OES_standard_derivatives),
-
- /* Vendor Extensions */
- o(APPLE_packed_pixels),
- o(IBM_multimode_draw_arrays),
- o(IBM_rasterpos_clip),
- o(NV_light_max_exponent),
- o(NV_texgen_reflection),
- o(SGIS_generate_mipmap),
- o(SGIS_texture_edge_clamp),
- o(SGIS_texture_lod),
-
- 0,
-};
-
-
-/**
- * Enable all extensions suitable for a software-only renderer.
- * This is a convenience function used by the XMesa, OSMesa, GGI drivers, etc.
- */
-void
-_mesa_enable_sw_extensions(struct gl_context *ctx)
-{
- /*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/
- ctx->Extensions.ARB_depth_clamp = GL_TRUE;
- ctx->Extensions.ARB_depth_texture = GL_TRUE;
- /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
- ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
- ctx->Extensions.ARB_draw_instanced = GL_TRUE;
- ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
- ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
-#if FEATURE_ARB_fragment_program
- ctx->Extensions.ARB_fragment_program = GL_TRUE;
- ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
-#endif
-#if FEATURE_ARB_fragment_shader
- ctx->Extensions.ARB_fragment_shader = GL_TRUE;
-#endif
-#if FEATURE_ARB_framebuffer_object
- ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
-#endif
-#if FEATURE_ARB_geometry_shader4 && 0
- /* XXX re-enable when GLSL compiler again supports geometry shaders */
- ctx->Extensions.ARB_geometry_shader4 = GL_TRUE;
-#endif
- ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
- ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
- ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
- ctx->Extensions.ARB_multitexture = GL_TRUE;
-#if FEATURE_queryobj
- ctx->Extensions.ARB_occlusion_query = GL_TRUE;
- ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
-#endif
- ctx->Extensions.ARB_point_sprite = GL_TRUE;
-#if FEATURE_ARB_shader_objects
- ctx->Extensions.ARB_shader_objects = GL_TRUE;
- ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
-#endif
-#if FEATURE_ARB_shading_language_100
- ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
-#endif
- ctx->Extensions.ARB_shadow = GL_TRUE;
- ctx->Extensions.ARB_shadow_ambient = GL_TRUE;
- ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
- ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
- 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;*/
- ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE;
- 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;
- ctx->Extensions.ARB_vertex_array_object = GL_TRUE;
-#if FEATURE_ARB_vertex_program
- ctx->Extensions.ARB_vertex_program = GL_TRUE;
-#endif
-#if FEATURE_ARB_vertex_shader
- ctx->Extensions.ARB_vertex_shader = GL_TRUE;
-#endif
-#if FEATURE_ARB_vertex_buffer_object
- /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/
-#endif
-#if FEATURE_ARB_sync
- ctx->Extensions.ARB_sync = GL_TRUE;
-#endif
- ctx->Extensions.APPLE_vertex_array_object = GL_TRUE;
-#if FEATURE_APPLE_object_purgeable
- ctx->Extensions.APPLE_object_purgeable = GL_TRUE;
-#endif
- ctx->Extensions.ATI_envmap_bumpmap = GL_TRUE;
-#if FEATURE_ATI_fragment_shader
- ctx->Extensions.ATI_fragment_shader = GL_TRUE;
-#endif
- ctx->Extensions.ATI_texture_compression_3dc = GL_TRUE;
- ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE;
- ctx->Extensions.ATI_texture_mirror_once = GL_TRUE;
- ctx->Extensions.ATI_separate_stencil = GL_TRUE;
- ctx->Extensions.EXT_blend_color = GL_TRUE;
- ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
- ctx->Extensions.EXT_blend_func_separate = GL_TRUE;
- ctx->Extensions.EXT_blend_logic_op = GL_TRUE;
- ctx->Extensions.EXT_blend_minmax = GL_TRUE;
- ctx->Extensions.EXT_blend_subtract = GL_TRUE;
- ctx->Extensions.EXT_depth_bounds_test = GL_TRUE;
- ctx->Extensions.EXT_draw_buffers2 = GL_TRUE;
- ctx->Extensions.EXT_fog_coord = GL_TRUE;
-#if FEATURE_EXT_framebuffer_object
- ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
-#endif
-#if FEATURE_EXT_framebuffer_blit
- ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
-#endif
-#if FEATURE_ARB_framebuffer_object
- ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
-#endif
- /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/
- ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
- ctx->Extensions.EXT_paletted_texture = GL_TRUE;
-#if FEATURE_EXT_pixel_buffer_object
- ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
-#endif
- ctx->Extensions.EXT_point_parameters = GL_TRUE;
- ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
- ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
- ctx->Extensions.EXT_secondary_color = GL_TRUE;
- ctx->Extensions.EXT_shared_texture_palette = GL_TRUE;
- ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
- ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
- ctx->Extensions.EXT_texture_array = GL_TRUE;
- ctx->Extensions.EXT_texture_compression_latc = GL_TRUE;
- ctx->Extensions.EXT_texture_env_add = GL_TRUE;
- ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
- ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
- ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
- ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
- ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
- ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE;
-#if FEATURE_EXT_texture_sRGB
- ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
- ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE;
-#endif
- ctx->Extensions.EXT_texture_swizzle = GL_TRUE;
-#if FEATURE_EXT_transform_feedback
- /*ctx->Extensions.EXT_transform_feedback = GL_TRUE;*/
-#endif
- ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
- /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/
- ctx->Extensions.MESA_pack_invert = GL_TRUE;
- ctx->Extensions.MESA_resize_buffers = GL_TRUE;
- ctx->Extensions.MESA_texture_array = GL_TRUE;
- ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
- ctx->Extensions.NV_blend_square = GL_TRUE;
- ctx->Extensions.NV_conditional_render = GL_TRUE;
- /*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/
- ctx->Extensions.NV_point_sprite = GL_TRUE;
- ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
- ctx->Extensions.NV_texture_rectangle = GL_TRUE;
- /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/
-#if FEATURE_NV_vertex_program
- ctx->Extensions.NV_vertex_program = GL_TRUE;
- ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
-#endif
-#if FEATURE_NV_fragment_program
- ctx->Extensions.NV_fragment_program = GL_TRUE;
-#endif
-#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program
- ctx->Extensions.NV_fragment_program_option = GL_TRUE;
-#endif
- /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/
- ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE;
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
-#endif
-#if FEATURE_texture_fxt1
- _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
-#endif
-#if FEATURE_texture_s3tc
- if (ctx->Mesa_DXTn) {
- _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
- _mesa_enable_extension(ctx, "GL_S3_s3tc");
- }
-#endif
-}
-
-
-/**
- * Enable common EXT extensions in the ARB_imaging subset.
- */
-void
-_mesa_enable_imaging_extensions(struct gl_context *ctx)
-{
- ctx->Extensions.EXT_blend_color = GL_TRUE;
- ctx->Extensions.EXT_blend_logic_op = GL_TRUE;
- ctx->Extensions.EXT_blend_minmax = GL_TRUE;
- ctx->Extensions.EXT_blend_subtract = GL_TRUE;
-}
-
-
-
-/**
- * Enable all OpenGL 1.3 features and extensions.
- * A convenience function to be called by drivers.
- */
-void
-_mesa_enable_1_3_extensions(struct gl_context *ctx)
-{
- /*ctx->Extensions.ARB_multisample = GL_TRUE;*/
- ctx->Extensions.ARB_multitexture = GL_TRUE;
- ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
- /*ctx->Extensions.ARB_texture_compression = GL_TRUE;*/
- ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
- ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
- ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
- ctx->Extensions.EXT_texture_env_add = GL_TRUE;
- /*ctx->Extensions.ARB_transpose_matrix = GL_TRUE;*/
-}
-
-
-
-/**
- * Enable all OpenGL 1.4 features and extensions.
- * A convenience function to be called by drivers.
- */
-void
-_mesa_enable_1_4_extensions(struct gl_context *ctx)
-{
- ctx->Extensions.ARB_depth_texture = GL_TRUE;
- ctx->Extensions.ARB_shadow = GL_TRUE;
- ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
- ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE;
- ctx->Extensions.ARB_window_pos = GL_TRUE;
- ctx->Extensions.EXT_blend_color = GL_TRUE;
- ctx->Extensions.EXT_blend_func_separate = GL_TRUE;
- ctx->Extensions.EXT_blend_minmax = GL_TRUE;
- ctx->Extensions.EXT_blend_subtract = GL_TRUE;
- ctx->Extensions.EXT_fog_coord = GL_TRUE;
- /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/
- ctx->Extensions.EXT_point_parameters = GL_TRUE;
- ctx->Extensions.EXT_secondary_color = GL_TRUE;
- ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
- ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
- /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/
-}
-
-
-/**
- * Enable all OpenGL 1.5 features and extensions.
- * A convenience function to be called by drivers.
- */
-void
-_mesa_enable_1_5_extensions(struct gl_context *ctx)
-{
- ctx->Extensions.ARB_occlusion_query = GL_TRUE;
- /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/
- ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
-}
-
-
-/**
- * Enable all OpenGL 2.0 features and extensions.
- * A convenience function to be called by drivers.
- */
-void
-_mesa_enable_2_0_extensions(struct gl_context *ctx)
-{
- /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
-#if FEATURE_ARB_fragment_shader
- ctx->Extensions.ARB_fragment_shader = GL_TRUE;
-#endif
- ctx->Extensions.ARB_point_sprite = GL_TRUE;
- ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
- ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
-#if FEATURE_ARB_shader_objects
- ctx->Extensions.ARB_shader_objects = GL_TRUE;
-#endif
-#if FEATURE_ARB_shading_language_100
- ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
-#endif
- ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
-#if FEATURE_ARB_vertex_shader
- ctx->Extensions.ARB_vertex_shader = GL_TRUE;
-#endif
-}
-
-
-/**
- * Enable all OpenGL 2.1 features and extensions.
- * A convenience function to be called by drivers.
- */
-void
-_mesa_enable_2_1_extensions(struct gl_context *ctx)
-{
-#if FEATURE_EXT_pixel_buffer_object
- ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
-#endif
-#if FEATURE_EXT_texture_sRGB
- ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
-#endif
-}
-
-
-/**
- * Either enable or disable the named extension.
- * \return GL_TRUE for success, GL_FALSE if invalid extension name
- */
-static GLboolean
-set_extension( struct gl_context *ctx, const char *name, GLboolean state )
-{
- size_t offset;
-
- if (ctx->Extensions.String) {
- /* The string was already queried - can't change it now! */
- _mesa_problem(ctx, "Trying to enable/disable extension after glGetString(GL_EXTENSIONS): %s", name);
- return GL_FALSE;
- }
-
- offset = name_to_offset(name);
- if (offset == 0) {
- _mesa_problem(ctx, "Trying to enable/disable unknown extension %s",
- name);
- return GL_FALSE;
- } else if (offset == o(dummy_true) && state == GL_FALSE) {
- _mesa_problem(ctx, "Trying to disable a permanently enabled extension: "
- "%s", name);
- return GL_FALSE;
- } else {
- GLboolean *base = (GLboolean *) &ctx->Extensions;
- base[offset] = state;
- return GL_TRUE;
- }
-}
-
-
-/**
- * Enable the named extension.
- * Typically called by drivers.
- */
-void
-_mesa_enable_extension( struct gl_context *ctx, const char *name )
-{
- if (!set_extension(ctx, name, GL_TRUE))
- _mesa_problem(ctx, "Trying to enable unknown extension: %s", name);
-}
-
-
-/**
- * Disable the named extension.
- * XXX is this really needed???
- */
-void
-_mesa_disable_extension( struct gl_context *ctx, const char *name )
-{
- if (!set_extension(ctx, name, GL_FALSE))
- _mesa_problem(ctx, "Trying to disable unknown extension: %s", name);
-}
-
-
-/**
- * Test if the named extension is enabled in this context.
- */
-GLboolean
-_mesa_extension_is_enabled( struct gl_context *ctx, const char *name )
-{
- size_t offset;
- GLboolean *base;
-
- if (name == 0)
- return GL_FALSE;
-
- offset = name_to_offset(name);
- if (offset == 0)
- return GL_FALSE;
- base = (GLboolean *) &ctx->Extensions;
- return base[offset];
-}
-
-
-/**
- * \brief Apply the \c MESA_EXTENSION_OVERRIDE environment variable.
- *
- * \c MESA_EXTENSION_OVERRIDE is a space-separated list of extensions to
- * enable or disable. The list is processed thus:
- * - Enable recognized extension names that are prefixed with '+'.
- * - Disable recognized extension names that are prefixed with '-'.
- * - Enable recognized extension names that are not prefixed.
- * - Collect unrecognized extension names in a new string.
- *
- * \return Space-separated list of unrecognized extension names (which must
- * be freed). Does not return \c NULL.
- */
-static char *
-get_extension_override( struct gl_context *ctx )
-{
- const char *env_const = _mesa_getenv("MESA_EXTENSION_OVERRIDE");
- char *env;
- char *ext;
- char *extra_exts;
- int len;
-
- if (env_const == NULL) {
- /* Return the empty string rather than NULL. This simplifies the logic
- * of client functions. */
- return calloc(1, sizeof(char));
- }
-
- /* extra_exts: List of unrecognized extensions. */
- extra_exts = calloc(strlen(env_const), sizeof(char));
-
- /* Copy env_const because strtok() is destructive. */
- env = strdup(env_const);
- for (ext = strtok(env, " "); ext != NULL; ext = strtok(NULL, " ")) {
- int enable;
- int recognized;
- switch (ext[0]) {
- case '+':
- enable = 1;
- ++ext;
- break;
- case '-':
- enable = 0;
- ++ext;
- break;
- default:
- enable = 1;
- break;
- }
- recognized = set_extension(ctx, ext, enable);
- if (!recognized) {
- strcat(extra_exts, ext);
- strcat(extra_exts, " ");
- }
- }
-
- /* Remove trailing space. */
- len = strlen(extra_exts);
- if (extra_exts[len - 1] == ' ')
- extra_exts[len - 1] = '\0';
-
- return extra_exts;
-}
-
-
-/**
- * \brief Initialize extension tables and enable default extensions.
- *
- * This should be called during context initialization.
- * Note: Sets gl_extensions.dummy_true to true.
- */
-void
-_mesa_init_extensions( struct gl_context *ctx )
-{
- GLboolean *base = (GLboolean *) &ctx->Extensions;
- GLboolean *sentinel = base + o(extension_sentinel);
- GLboolean *i;
- const size_t *j;
-
- /* First, turn all extensions off. */
- for (i = base; i != sentinel; ++i)
- *i = GL_FALSE;
-
- /* Then, selectively turn default extensions on. */
- ctx->Extensions.dummy_true = GL_TRUE;
- for (j = default_extensions; *j != 0; ++j)
- base[*j] = GL_TRUE;
-}
-
-
-typedef unsigned short extension_index;
-
-
-/**
- * Compare two entries of the extensions table. Sorts first by year,
- * then by name.
- *
- * Arguments are indices into extension_table.
- */
-static int
-extension_compare(const void *p1, const void *p2)
-{
- extension_index i1 = * (const extension_index *) p1;
- extension_index i2 = * (const extension_index *) p2;
- const struct extension *e1 = &extension_table[i1];
- const struct extension *e2 = &extension_table[i2];
- int res;
-
- res = (int)e1->year - (int)e2->year;
-
- if (res == 0) {
- res = strcmp(e1->name, e2->name);
- }
-
- return res;
-}
-
-
-/**
- * Construct the GL_EXTENSIONS string. Called the first time that
- * glGetString(GL_EXTENSIONS) is called.
- */
-GLubyte*
-_mesa_make_extension_string(struct gl_context *ctx)
-{
- /* The extension string. */
- char *exts = 0;
- /* Length of extension string. */
- size_t length = 0;
- /* Number of extensions */
- unsigned count;
- /* Indices of the extensions sorted by year */
- extension_index *extension_indices;
- /* String of extra extensions. */
- char *extra_extensions = get_extension_override(ctx);
- GLboolean *base = (GLboolean *) &ctx->Extensions;
- const struct extension *i;
- unsigned j;
- unsigned maxYear = ~0;
-
- /* Check if the MESA_EXTENSION_MAX_YEAR env var is set */
- {
- const char *env = getenv("MESA_EXTENSION_MAX_YEAR");
- if (env) {
- maxYear = atoi(env);
- _mesa_debug(ctx, "Note: limiting GL extensions to %u or earlier\n",
- maxYear);
- }
- }
-
- /* Compute length of the extension string. */
- count = 0;
- for (i = extension_table; i->name != 0; ++i) {
- if (base[i->offset] &&
- i->year <= maxYear &&
- (i->api_set & (1 << ctx->API))) {
- length += strlen(i->name) + 1; /* +1 for space */
- ++count;
- }
- }
- if (extra_extensions != NULL)
- length += 1 + strlen(extra_extensions); /* +1 for space */
-
- exts = (char *) calloc(length + 1, sizeof(char));
- if (exts == NULL) {
- free(extra_extensions);
- return NULL;
- }
-
- extension_indices = malloc(count * sizeof(extension_index));
- if (extension_indices == NULL) {
- free(exts);
- free(extra_extensions);
- return NULL;
- }
-
- /* Sort extensions in chronological order because certain old applications (e.g.,
- * Quake3 demo) store the extension list in a static size buffer so chronologically
- * order ensure that the extensions that such applications expect will fit into
- * that buffer.
- */
- j = 0;
- for (i = extension_table; i->name != 0; ++i) {
- if (base[i->offset] &&
- i->year <= maxYear &&
- (i->api_set & (1 << ctx->API))) {
- extension_indices[j++] = i - extension_table;
- }
- }
- assert(j == count);
- qsort(extension_indices, count, sizeof *extension_indices, extension_compare);
-
- /* Build the extension string.*/
- for (j = 0; j < count; ++j) {
- i = &extension_table[extension_indices[j]];
- assert(base[i->offset] && (i->api_set & (1 << ctx->API)));
- strcat(exts, i->name);
- strcat(exts, " ");
- }
- free(extension_indices);
- if (extra_extensions != 0) {
- strcat(exts, extra_extensions);
- free(extra_extensions);
- }
-
- return (GLubyte *) exts;
-}
-
-/**
- * Return number of enabled extensions.
- */
-GLuint
-_mesa_get_extension_count(struct gl_context *ctx)
-{
- GLboolean *base;
- const struct extension *i;
-
- /* only count once */
- if (ctx->Extensions.Count != 0)
- return ctx->Extensions.Count;
-
- base = (GLboolean *) &ctx->Extensions;
- for (i = extension_table; i->name != 0; ++i) {
- if (base[i->offset]) {
- ctx->Extensions.Count++;
- }
- }
- return ctx->Extensions.Count;
-}
-
-/**
- * Return name of i-th enabled extension
- */
-const GLubyte *
-_mesa_get_enabled_extension(struct gl_context *ctx, GLuint index)
-{
- const GLboolean *base;
- size_t n;
- const struct extension *i;
-
- if (index < 0)
- return NULL;
-
- base = (GLboolean*) &ctx->Extensions;
- n = 0;
- for (i = extension_table; i->name != 0; ++i) {
- if (n == index && base[i->offset]) {
- return (GLubyte*) i->name;
- } else if (base[i->offset]) {
- ++n;
- }
- }
-
- return NULL;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. 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
+ * \brief Extension handling
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "extensions.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+
+enum {
+ DISABLE = 0,
+ GL = 1 << API_OPENGL,
+ ES1 = 1 << API_OPENGLES,
+ ES2 = 1 << API_OPENGLES2,
+};
+
+/**
+ * \brief An element of the \c extension_table.
+ */
+struct extension {
+ /** Name of extension, such as "GL_ARB_depth_clamp". */
+ const char *name;
+
+ /** Offset (in bytes) of the corresponding member in struct gl_extensions. */
+ size_t offset;
+
+ /** Set of API's in which the extension exists, as a bitset. */
+ uint8_t api_set;
+
+ /** Year the extension was proposed or approved. Used to sort the
+ * extension string chronologically. */
+ uint16_t year;
+};
+
+
+/**
+ * Given a member \c x of struct gl_extensions, return offset of
+ * \c x in bytes.
+ */
+#define o(x) offsetof(struct gl_extensions, x)
+
+
+/**
+ * \brief Table of supported OpenGL extensions for all API's.
+ *
+ * Note: The GL_MESAX_* extensions are placeholders for future ARB extensions.
+ */
+static const struct extension extension_table[] = {
+ /* ARB Extensions */
+ { "GL_ARB_ES2_compatibility", o(ARB_ES2_compatibility), GL, 2009 },
+ { "GL_ARB_blend_func_extended", o(ARB_blend_func_extended), GL, 2009 },
+ { "GL_ARB_color_buffer_float", o(ARB_color_buffer_float), GL, 2004 },
+ { "GL_ARB_copy_buffer", o(ARB_copy_buffer), GL, 2008 },
+ { "GL_ARB_conservative_depth", o(AMD_conservative_depth), GL, 2011 },
+ { "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL, 2008 },
+ { "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 },
+ { "GL_ARB_depth_texture", o(ARB_depth_texture), GL, 2001 },
+ { "GL_ARB_draw_buffers", o(ARB_draw_buffers), GL, 2002 },
+ { "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 },
+ { "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 },
+ { "GL_ARB_draw_instanced", o(ARB_draw_instanced), GL, 2008 },
+ { "GL_ARB_explicit_attrib_location", o(ARB_explicit_attrib_location), GL, 2009 },
+ { "GL_ARB_fragment_coord_conventions", o(ARB_fragment_coord_conventions), GL, 2009 },
+ { "GL_ARB_fragment_program", o(ARB_fragment_program), GL, 2002 },
+ { "GL_ARB_fragment_program_shadow", o(ARB_fragment_program_shadow), GL, 2003 },
+ { "GL_ARB_fragment_shader", o(ARB_fragment_shader), GL, 2002 },
+ { "GL_ARB_framebuffer_object", o(ARB_framebuffer_object), GL, 2005 },
+ { "GL_ARB_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 },
+ { "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 },
+ { "GL_ARB_map_buffer_range", o(ARB_map_buffer_range), GL, 2008 },
+ { "GL_ARB_multisample", o(ARB_multisample), GL, 1994 },
+ { "GL_ARB_multitexture", o(ARB_multitexture), GL, 1998 },
+ { "GL_ARB_occlusion_query2", o(ARB_occlusion_query2), GL, 2003 },
+ { "GL_ARB_occlusion_query", o(ARB_occlusion_query), GL, 2001 },
+ { "GL_ARB_pixel_buffer_object", o(EXT_pixel_buffer_object), GL, 2004 },
+ { "GL_ARB_point_parameters", o(EXT_point_parameters), GL, 1997 },
+ { "GL_ARB_point_sprite", o(ARB_point_sprite), GL, 2003 },
+ { "GL_ARB_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 },
+ { "GL_ARB_robustness", o(dummy_true), GL, 2010 },
+ { "GL_ARB_sampler_objects", o(ARB_sampler_objects), GL, 2009 },
+ { "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL, 2009 },
+ { "GL_ARB_shader_objects", o(ARB_shader_objects), GL, 2002 },
+ { "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 },
+ { "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 },
+ { "GL_ARB_shading_language_100", o(ARB_shading_language_100), GL, 2003 },
+ { "GL_ARB_shadow_ambient", o(ARB_shadow_ambient), GL, 2001 },
+ { "GL_ARB_shadow", o(ARB_shadow), GL, 2001 },
+ { "GL_ARB_sync", o(ARB_sync), GL, 2003 },
+ { "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GL, 2000 },
+ { "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GL, 2008 },
+ { "GL_ARB_texture_compression", o(ARB_texture_compression), GL, 2000 },
+ { "GL_ARB_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 },
+ { "GL_ARB_texture_cube_map", o(ARB_texture_cube_map), GL, 1999 },
+ { "GL_ARB_texture_env_add", o(EXT_texture_env_add), GL, 1999 },
+ { "GL_ARB_texture_env_combine", o(ARB_texture_env_combine), GL, 2001 },
+ { "GL_ARB_texture_env_crossbar", o(ARB_texture_env_crossbar), GL, 2001 },
+ { "GL_ARB_texture_env_dot3", o(ARB_texture_env_dot3), GL, 2001 },
+ { "GL_ARB_texture_float", o(ARB_texture_float), GL, 2004 },
+ { "GL_ARB_texture_mirrored_repeat", o(ARB_texture_mirrored_repeat), GL, 2001 },
+ { "GL_ARB_texture_multisample", o(ARB_texture_multisample), GL, 2009 },
+ { "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), GL, 2003 },
+ { "GL_ARB_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
+ { "GL_ARB_texture_rgb10_a2ui", o(ARB_texture_rgb10_a2ui), GL, 2009 },
+ { "GL_ARB_texture_rg", o(ARB_texture_rg), GL, 2008 },
+ { "GL_ARB_texture_swizzle", o(EXT_texture_swizzle), GL, 2008 },
+ { "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 },
+ { "GL_ARB_transpose_matrix", o(ARB_transpose_matrix), GL, 1999 },
+ { "GL_ARB_uniform_buffer_object", o(ARB_uniform_buffer_object), GL, 2002 },
+ { "GL_ARB_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 },
+ { "GL_ARB_vertex_array_object", o(ARB_vertex_array_object), GL, 2006 },
+ { "GL_ARB_vertex_buffer_object", o(ARB_vertex_buffer_object), GL, 2003 },
+ { "GL_ARB_vertex_program", o(ARB_vertex_program), GL, 2002 },
+ { "GL_ARB_vertex_shader", o(ARB_vertex_shader), GL, 2002 },
+ { "GL_ARB_vertex_type_2_10_10_10_rev", o(ARB_vertex_type_2_10_10_10_rev), GL, 2009 },
+ { "GL_ARB_window_pos", o(ARB_window_pos), GL, 2001 },
+ /* EXT extensions */
+ { "GL_EXT_abgr", o(EXT_abgr), GL, 1995 },
+ { "GL_EXT_bgra", o(EXT_bgra), GL, 1995 },
+ { "GL_EXT_blend_color", o(EXT_blend_color), GL, 1995 },
+ { "GL_EXT_blend_equation_separate", o(EXT_blend_equation_separate), GL, 2003 },
+ { "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), GL, 1999 },
+ { "GL_EXT_blend_logic_op", o(EXT_blend_logic_op), GL, 1995 },
+ { "GL_EXT_blend_minmax", o(EXT_blend_minmax), GL | ES1 | ES2, 1995 },
+ { "GL_EXT_blend_subtract", o(EXT_blend_subtract), GL, 1995 },
+ { "GL_EXT_clip_volume_hint", o(EXT_clip_volume_hint), GL, 1996 },
+ { "GL_EXT_compiled_vertex_array", o(EXT_compiled_vertex_array), GL, 1996 },
+ { "GL_EXT_copy_texture", o(EXT_copy_texture), GL, 1995 },
+ { "GL_EXT_depth_bounds_test", o(EXT_depth_bounds_test), GL, 2002 },
+ { "GL_EXT_draw_buffers2", o(EXT_draw_buffers2), GL, 2006 },
+ { "GL_EXT_draw_instanced", o(ARB_draw_instanced), GL, 2006 },
+ { "GL_EXT_draw_range_elements", o(EXT_draw_range_elements), GL, 1997 },
+ { "GL_EXT_fog_coord", o(EXT_fog_coord), GL, 1999 },
+ { "GL_EXT_framebuffer_blit", o(EXT_framebuffer_blit), GL, 2005 },
+ { "GL_EXT_framebuffer_multisample", o(EXT_framebuffer_multisample), GL, 2005 },
+ { "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), GL, 2006 },
+ { "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL, 2006 },
+ { "GL_EXT_multi_draw_arrays", o(EXT_multi_draw_arrays), GL | ES1 | ES2, 1999 },
+ { "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2005 },
+ { "GL_EXT_packed_float", o(EXT_packed_float), GL, 2004 },
+ { "GL_EXT_packed_pixels", o(EXT_packed_pixels), GL, 1997 },
+ { "GL_EXT_paletted_texture", o(EXT_paletted_texture), GL, 1995 },
+ { "GL_EXT_pixel_buffer_object", o(EXT_pixel_buffer_object), GL, 2004 },
+ { "GL_EXT_point_parameters", o(EXT_point_parameters), GL, 1997 },
+ { "GL_EXT_polygon_offset", o(EXT_polygon_offset), GL, 1995 },
+ { "GL_EXT_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 },
+ { "GL_EXT_rescale_normal", o(EXT_rescale_normal), GL, 1997 },
+ { "GL_EXT_secondary_color", o(EXT_secondary_color), GL, 1999 },
+ { "GL_EXT_separate_shader_objects", o(EXT_separate_shader_objects), GL, 2008 },
+ { "GL_EXT_separate_specular_color", o(EXT_separate_specular_color), GL, 1997 },
+ { "GL_EXT_shadow_funcs", o(EXT_shadow_funcs), GL, 2002 },
+ { "GL_EXT_shared_texture_palette", o(EXT_shared_texture_palette), GL, 2000 },
+ { "GL_EXT_stencil_two_side", o(EXT_stencil_two_side), GL, 2001 },
+ { "GL_EXT_stencil_wrap", o(EXT_stencil_wrap), GL, 2002 },
+ { "GL_EXT_subtexture", o(EXT_subtexture), GL, 1995 },
+ { "GL_EXT_texture3D", o(EXT_texture3D), GL, 1996 },
+ { "GL_EXT_texture_array", o(EXT_texture_array), GL, 2006 },
+ { "GL_EXT_texture_compression_dxt1", o(EXT_texture_compression_s3tc), GL | ES1 | ES2, 2004 },
+ { "GL_EXT_texture_compression_latc", o(EXT_texture_compression_latc), GL, 2006 },
+ { "GL_EXT_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 },
+ { "GL_EXT_texture_compression_s3tc", o(EXT_texture_compression_s3tc), GL, 2000 },
+ { "GL_EXT_texture_cube_map", o(ARB_texture_cube_map), GL, 2001 },
+ { "GL_EXT_texture_edge_clamp", o(SGIS_texture_edge_clamp), GL, 1997 },
+ { "GL_EXT_texture_env_add", o(EXT_texture_env_add), GL, 1999 },
+ { "GL_EXT_texture_env_combine", o(EXT_texture_env_combine), GL, 2006 },
+ { "GL_EXT_texture_env_dot3", o(EXT_texture_env_dot3), GL, 2000 },
+ { "GL_EXT_texture_filter_anisotropic", o(EXT_texture_filter_anisotropic), GL | ES1 | ES2, 1999 },
+ { "GL_EXT_texture_format_BGRA8888", o(EXT_texture_format_BGRA8888), ES1 | ES2, 2009 },
+ { "GL_EXT_texture_integer", o(EXT_texture_integer), GL, 2006 },
+ { "GL_EXT_texture_lod_bias", o(EXT_texture_lod_bias), GL | ES1, 1999 },
+ { "GL_EXT_texture_mirror_clamp", o(EXT_texture_mirror_clamp), GL, 2004 },
+ { "GL_EXT_texture_object", o(EXT_texture_object), GL, 1995 },
+ { "GL_EXT_texture", o(EXT_texture), GL, 1996 },
+ { "GL_EXT_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
+ { "GL_EXT_texture_shared_exponent", o(EXT_texture_shared_exponent), GL, 2004 },
+ { "GL_EXT_texture_snorm", o(EXT_texture_snorm), GL, 2009 },
+ { "GL_EXT_texture_sRGB", o(EXT_texture_sRGB), GL, 2004 },
+ { "GL_EXT_texture_sRGB_decode", o(EXT_texture_sRGB_decode), GL, 2006 },
+ { "GL_EXT_texture_swizzle", o(EXT_texture_swizzle), GL, 2008 },
+ { "GL_EXT_texture_type_2_10_10_10_REV", o(dummy_true), ES2, 2008 },
+ { "GL_EXT_timer_query", o(EXT_timer_query), GL, 2006 },
+ { "GL_EXT_transform_feedback", o(EXT_transform_feedback), GL, 2011 },
+ { "GL_EXT_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 },
+ { "GL_EXT_vertex_array", o(EXT_vertex_array), GL, 1995 },
+ { "GL_EXT_vertex_array_set", o(EXT_vertex_array_set), GL, 1997 },
+
+ /* OES extensions */
+ { "GL_OES_blend_equation_separate", o(EXT_blend_equation_separate), ES1, 2009 },
+ { "GL_OES_blend_func_separate", o(EXT_blend_func_separate), ES1, 2009 },
+ { "GL_OES_blend_subtract", o(EXT_blend_subtract), ES1, 2009 },
+ { "GL_OES_byte_coordinates", o(dummy_true), ES1, 2002 },
+ { "GL_OES_compressed_paletted_texture", o(dummy_false), DISABLE, 2003 },
+ { "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
+ { "GL_OES_depth32", o(dummy_false), DISABLE, 2005 },
+ { "GL_OES_depth_texture", o(ARB_depth_texture), ES2, 2006 },
+#if FEATURE_OES_draw_texture
+ { "GL_OES_draw_texture", o(OES_draw_texture), ES1 | ES2, 2004 },
+#endif
+#if FEATURE_OES_EGL_image
+ /* FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL contexts. */
+ { "GL_OES_EGL_image", o(OES_EGL_image), GL | ES1 | ES2, 2006 },
+#endif
+ { "GL_OES_element_index_uint", o(EXT_vertex_array), ES1 | ES2, 2005 },
+ { "GL_OES_fbo_render_mipmap", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
+ { "GL_OES_fixed_point", o(dummy_true), ES1, 2002 },
+ { "GL_OES_framebuffer_object", o(EXT_framebuffer_object), ES1, 2005 },
+ { "GL_OES_mapbuffer", o(ARB_vertex_buffer_object), ES1 | ES2, 2005 },
+ { "GL_OES_matrix_get", o(dummy_true), ES1, 2004 },
+ { "GL_OES_packed_depth_stencil", o(EXT_packed_depth_stencil), ES1 | ES2, 2007 },
+ { "GL_OES_point_size_array", o(dummy_true), ES1, 2004 },
+ { "GL_OES_point_sprite", o(ARB_point_sprite), ES1, 2004 },
+ { "GL_OES_query_matrix", o(dummy_true), ES1, 2003 },
+ { "GL_OES_read_format", o(OES_read_format), GL | ES1, 2003 },
+ { "GL_OES_rgb8_rgba8", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
+ { "GL_OES_single_precision", o(dummy_true), ES1, 2003 },
+ { "GL_OES_standard_derivatives", o(OES_standard_derivatives), ES2, 2005 },
+ { "GL_OES_stencil1", o(dummy_false), DISABLE, 2005 },
+ { "GL_OES_stencil4", o(dummy_false), DISABLE, 2005 },
+ { "GL_OES_stencil8", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
+ { "GL_OES_stencil_wrap", o(EXT_stencil_wrap), ES1, 2002 },
+ { "GL_OES_texture_3D", o(EXT_texture3D), ES2, 2005 },
+ { "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(ARB_texture_mirrored_repeat), ES1, 2005 },
+ { "GL_OES_texture_npot", o(ARB_texture_non_power_of_two), ES2, 2005 },
+
+ /* Vendor extensions */
+ { "GL_3DFX_texture_compression_FXT1", o(TDFX_texture_compression_FXT1), GL, 1999 },
+ { "GL_AMD_conservative_depth", o(AMD_conservative_depth), GL, 2009 },
+ { "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_APPLE_client_storage", o(APPLE_client_storage), GL, 2002 },
+ { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), GL, 2006 },
+ { "GL_APPLE_packed_pixels", o(APPLE_packed_pixels), GL, 2002 },
+ { "GL_APPLE_vertex_array_object", o(APPLE_vertex_array_object), GL, 2002 },
+ { "GL_ATI_blend_equation_separate", o(EXT_blend_equation_separate), GL, 2003 },
+ { "GL_ATI_draw_buffers", o(ARB_draw_buffers), GL, 2002 },
+ { "GL_ATI_envmap_bumpmap", o(ATI_envmap_bumpmap), GL, 2001 },
+ { "GL_ATI_fragment_shader", o(ATI_fragment_shader), GL, 2001 },
+ { "GL_ATI_separate_stencil", o(ATI_separate_stencil), GL, 2006 },
+ { "GL_ATI_texture_compression_3dc", o(ATI_texture_compression_3dc), GL, 2004 },
+ { "GL_ATI_texture_env_combine3", o(ATI_texture_env_combine3), GL, 2002 },
+ { "GL_ATI_texture_float", o(ARB_texture_float), GL, 2002 },
+ { "GL_ATI_texture_mirror_once", o(ATI_texture_mirror_once), GL, 2006 },
+ { "GL_IBM_multimode_draw_arrays", o(IBM_multimode_draw_arrays), GL, 1998 },
+ { "GL_IBM_rasterpos_clip", o(IBM_rasterpos_clip), GL, 1996 },
+ { "GL_IBM_texture_mirrored_repeat", o(ARB_texture_mirrored_repeat), GL, 1998 },
+ { "GL_INGR_blend_func_separate", o(EXT_blend_func_separate), GL, 1999 },
+ { "GL_MESA_pack_invert", o(MESA_pack_invert), GL, 2002 },
+ { "GL_MESA_resize_buffers", o(MESA_resize_buffers), GL, 1999 },
+ { "GL_MESA_texture_array", o(MESA_texture_array), GL, 2007 },
+ { "GL_MESA_texture_signed_rgba", o(EXT_texture_snorm), GL, 2009 },
+ { "GL_MESA_window_pos", o(ARB_window_pos), GL, 2000 },
+ { "GL_MESA_ycbcr_texture", o(MESA_ycbcr_texture), GL, 2002 },
+ { "GL_NV_blend_square", o(NV_blend_square), GL, 1999 },
+ { "GL_NV_conditional_render", o(NV_conditional_render), GL, 2008 },
+ { "GL_NV_depth_clamp", o(ARB_depth_clamp), GL, 2001 },
+ { "GL_NV_fragment_program", o(NV_fragment_program), GL, 2001 },
+ { "GL_NV_fragment_program_option", o(NV_fragment_program_option), GL, 2005 },
+ { "GL_NV_light_max_exponent", o(NV_light_max_exponent), GL, 1999 },
+ { "GL_NV_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2000 },
+ { "GL_NV_point_sprite", o(NV_point_sprite), GL, 2001 },
+ { "GL_NV_primitive_restart", o(NV_primitive_restart), GL, 2002 },
+ { "GL_NV_texgen_reflection", o(NV_texgen_reflection), GL, 1999 },
+ { "GL_NV_texture_barrier", o(NV_texture_barrier), GL, 2009 },
+ { "GL_NV_texture_env_combine4", o(NV_texture_env_combine4), GL, 1999 },
+ { "GL_NV_texture_rectangle", o(NV_texture_rectangle), GL, 2000 },
+ { "GL_NV_vertex_program1_1", o(NV_vertex_program1_1), GL, 2001 },
+ { "GL_NV_vertex_program", o(NV_vertex_program), GL, 2000 },
+ { "GL_S3_s3tc", o(S3_s3tc), GL, 1999 },
+ { "GL_SGIS_generate_mipmap", o(SGIS_generate_mipmap), GL, 1997 },
+ { "GL_SGIS_texture_border_clamp", o(ARB_texture_border_clamp), GL, 1997 },
+ { "GL_SGIS_texture_edge_clamp", o(SGIS_texture_edge_clamp), GL, 1997 },
+ { "GL_SGIS_texture_lod", o(SGIS_texture_lod), GL, 1997 },
+ { "GL_SUN_multi_draw_arrays", o(EXT_multi_draw_arrays), GL, 1999 },
+
+ { 0, 0, 0, 0 },
+};
+
+
+/**
+ * Given an extension name, lookup up the corresponding member of struct
+ * gl_extensions and return that member's offset (in bytes). If the name is
+ * not found in the \c extension_table, return 0.
+ *
+ * \param name Name of extension.
+ * \return Offset of member in struct gl_extensions.
+ */
+static size_t
+name_to_offset(const char* name)
+{
+ const struct extension *i;
+
+ if (name == 0)
+ return 0;
+
+ for (i = extension_table; i->name != 0; ++i) {
+ if (strcmp(name, i->name) == 0)
+ return i->offset;
+ }
+
+ return 0;
+}
+
+
+/**
+ * \brief Extensions enabled by default.
+ *
+ * These extensions are enabled by _mesa_init_extensions().
+ *
+ * XXX: Should these defaults also apply to GLES?
+ */
+static const size_t default_extensions[] = {
+ o(ARB_copy_buffer),
+ o(ARB_draw_buffers),
+ o(ARB_multisample),
+ o(ARB_texture_compression),
+ o(ARB_transpose_matrix),
+ o(ARB_vertex_buffer_object),
+ o(ARB_window_pos),
+
+ o(EXT_abgr),
+ o(EXT_bgra),
+ o(EXT_compiled_vertex_array),
+ o(EXT_copy_texture),
+ o(EXT_draw_range_elements),
+ o(EXT_multi_draw_arrays),
+ o(EXT_packed_pixels),
+ o(EXT_polygon_offset),
+ o(EXT_rescale_normal),
+ o(EXT_separate_specular_color),
+ o(EXT_subtexture),
+ o(EXT_texture),
+ o(EXT_texture3D),
+ o(EXT_texture_object),
+ o(EXT_vertex_array),
+
+ o(OES_read_format),
+ o(OES_standard_derivatives),
+
+ /* Vendor Extensions */
+ o(APPLE_packed_pixels),
+ o(IBM_multimode_draw_arrays),
+ o(IBM_rasterpos_clip),
+ o(NV_light_max_exponent),
+ o(NV_texgen_reflection),
+ o(SGIS_generate_mipmap),
+ o(SGIS_texture_edge_clamp),
+ o(SGIS_texture_lod),
+
+ 0,
+};
+
+
+/**
+ * Enable all extensions suitable for a software-only renderer.
+ * This is a convenience function used by the XMesa, OSMesa, GGI drivers, etc.
+ */
+void
+_mesa_enable_sw_extensions(struct gl_context *ctx)
+{
+ /*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/
+ ctx->Extensions.ARB_depth_clamp = GL_TRUE;
+ ctx->Extensions.ARB_depth_texture = GL_TRUE;
+ /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
+ ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
+ ctx->Extensions.ARB_draw_instanced = GL_TRUE;
+ ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
+ ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
+#if FEATURE_ARB_fragment_program
+ ctx->Extensions.ARB_fragment_program = GL_TRUE;
+ ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
+#endif
+#if FEATURE_ARB_fragment_shader
+ ctx->Extensions.ARB_fragment_shader = GL_TRUE;
+#endif
+#if FEATURE_ARB_framebuffer_object
+ ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
+#endif
+#if FEATURE_ARB_geometry_shader4 && 0
+ /* XXX re-enable when GLSL compiler again supports geometry shaders */
+ ctx->Extensions.ARB_geometry_shader4 = GL_TRUE;
+#endif
+ ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
+ ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
+ ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
+ ctx->Extensions.ARB_multitexture = GL_TRUE;
+#if FEATURE_queryobj
+ ctx->Extensions.ARB_occlusion_query = GL_TRUE;
+ ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
+#endif
+ ctx->Extensions.ARB_point_sprite = GL_TRUE;
+#if FEATURE_ARB_shader_objects
+ ctx->Extensions.ARB_shader_objects = GL_TRUE;
+ ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
+#endif
+#if FEATURE_ARB_shading_language_100
+ ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
+#endif
+ ctx->Extensions.ARB_shadow = GL_TRUE;
+ ctx->Extensions.ARB_shadow_ambient = GL_TRUE;
+ ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
+ ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
+ 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;*/
+ ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE;
+ 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;
+ ctx->Extensions.ARB_vertex_array_object = GL_TRUE;
+#if FEATURE_ARB_vertex_program
+ ctx->Extensions.ARB_vertex_program = GL_TRUE;
+#endif
+#if FEATURE_ARB_vertex_shader
+ ctx->Extensions.ARB_vertex_shader = GL_TRUE;
+#endif
+#if FEATURE_ARB_vertex_buffer_object
+ /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/
+#endif
+#if FEATURE_ARB_sync
+ ctx->Extensions.ARB_sync = GL_TRUE;
+#endif
+ ctx->Extensions.APPLE_vertex_array_object = GL_TRUE;
+#if FEATURE_APPLE_object_purgeable
+ ctx->Extensions.APPLE_object_purgeable = GL_TRUE;
+#endif
+ ctx->Extensions.ATI_envmap_bumpmap = GL_TRUE;
+#if FEATURE_ATI_fragment_shader
+ ctx->Extensions.ATI_fragment_shader = GL_TRUE;
+#endif
+ ctx->Extensions.ATI_texture_compression_3dc = GL_TRUE;
+ ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE;
+ ctx->Extensions.ATI_texture_mirror_once = GL_TRUE;
+ ctx->Extensions.ATI_separate_stencil = GL_TRUE;
+ ctx->Extensions.EXT_blend_color = GL_TRUE;
+ ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
+ ctx->Extensions.EXT_blend_func_separate = GL_TRUE;
+ ctx->Extensions.EXT_blend_logic_op = GL_TRUE;
+ ctx->Extensions.EXT_blend_minmax = GL_TRUE;
+ ctx->Extensions.EXT_blend_subtract = GL_TRUE;
+ ctx->Extensions.EXT_depth_bounds_test = GL_TRUE;
+ ctx->Extensions.EXT_draw_buffers2 = GL_TRUE;
+ ctx->Extensions.EXT_fog_coord = GL_TRUE;
+#if FEATURE_EXT_framebuffer_object
+ ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
+#endif
+#if FEATURE_EXT_framebuffer_blit
+ ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
+#endif
+#if FEATURE_ARB_framebuffer_object
+ ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
+#endif
+ /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/
+ ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
+ ctx->Extensions.EXT_paletted_texture = GL_TRUE;
+#if FEATURE_EXT_pixel_buffer_object
+ ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
+#endif
+ ctx->Extensions.EXT_point_parameters = GL_TRUE;
+ ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
+ ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
+ ctx->Extensions.EXT_secondary_color = GL_TRUE;
+ ctx->Extensions.EXT_shared_texture_palette = GL_TRUE;
+ ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
+ ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
+ ctx->Extensions.EXT_texture_array = GL_TRUE;
+ ctx->Extensions.EXT_texture_compression_latc = GL_TRUE;
+ ctx->Extensions.EXT_texture_env_add = GL_TRUE;
+ ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
+ ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
+ ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
+ ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
+ ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
+ ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE;
+#if FEATURE_EXT_texture_sRGB
+ ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
+ ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE;
+#endif
+ ctx->Extensions.EXT_texture_swizzle = GL_TRUE;
+#if FEATURE_EXT_transform_feedback
+ /*ctx->Extensions.EXT_transform_feedback = GL_TRUE;*/
+#endif
+ ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
+ /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/
+ ctx->Extensions.MESA_pack_invert = GL_TRUE;
+ ctx->Extensions.MESA_resize_buffers = GL_TRUE;
+ ctx->Extensions.MESA_texture_array = GL_TRUE;
+ ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
+ ctx->Extensions.NV_blend_square = GL_TRUE;
+ ctx->Extensions.NV_conditional_render = GL_TRUE;
+ /*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/
+ ctx->Extensions.NV_point_sprite = GL_TRUE;
+ ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
+ ctx->Extensions.NV_texture_rectangle = GL_TRUE;
+ /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/
+#if FEATURE_NV_vertex_program
+ ctx->Extensions.NV_vertex_program = GL_TRUE;
+ ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
+#endif
+#if FEATURE_NV_fragment_program
+ ctx->Extensions.NV_fragment_program = GL_TRUE;
+#endif
+#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program
+ ctx->Extensions.NV_fragment_program_option = GL_TRUE;
+#endif
+ /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/
+ ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE;
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
+#endif
+#if FEATURE_texture_fxt1
+ _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
+#endif
+#if FEATURE_texture_s3tc
+ if (ctx->Mesa_DXTn) {
+ _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
+ _mesa_enable_extension(ctx, "GL_S3_s3tc");
+ }
+#endif
+}
+
+
+/**
+ * Enable common EXT extensions in the ARB_imaging subset.
+ */
+void
+_mesa_enable_imaging_extensions(struct gl_context *ctx)
+{
+ ctx->Extensions.EXT_blend_color = GL_TRUE;
+ ctx->Extensions.EXT_blend_logic_op = GL_TRUE;
+ ctx->Extensions.EXT_blend_minmax = GL_TRUE;
+ ctx->Extensions.EXT_blend_subtract = GL_TRUE;
+}
+
+
+
+/**
+ * Enable all OpenGL 1.3 features and extensions.
+ * A convenience function to be called by drivers.
+ */
+void
+_mesa_enable_1_3_extensions(struct gl_context *ctx)
+{
+ /*ctx->Extensions.ARB_multisample = GL_TRUE;*/
+ ctx->Extensions.ARB_multitexture = GL_TRUE;
+ ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
+ /*ctx->Extensions.ARB_texture_compression = GL_TRUE;*/
+ ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
+ ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
+ ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
+ ctx->Extensions.EXT_texture_env_add = GL_TRUE;
+ /*ctx->Extensions.ARB_transpose_matrix = GL_TRUE;*/
+}
+
+
+
+/**
+ * Enable all OpenGL 1.4 features and extensions.
+ * A convenience function to be called by drivers.
+ */
+void
+_mesa_enable_1_4_extensions(struct gl_context *ctx)
+{
+ ctx->Extensions.ARB_depth_texture = GL_TRUE;
+ ctx->Extensions.ARB_shadow = GL_TRUE;
+ ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
+ ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE;
+ ctx->Extensions.ARB_window_pos = GL_TRUE;
+ ctx->Extensions.EXT_blend_color = GL_TRUE;
+ ctx->Extensions.EXT_blend_func_separate = GL_TRUE;
+ ctx->Extensions.EXT_blend_minmax = GL_TRUE;
+ ctx->Extensions.EXT_blend_subtract = GL_TRUE;
+ ctx->Extensions.EXT_fog_coord = GL_TRUE;
+ /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/
+ ctx->Extensions.EXT_point_parameters = GL_TRUE;
+ ctx->Extensions.EXT_secondary_color = GL_TRUE;
+ ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
+ ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
+ /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/
+}
+
+
+/**
+ * Enable all OpenGL 1.5 features and extensions.
+ * A convenience function to be called by drivers.
+ */
+void
+_mesa_enable_1_5_extensions(struct gl_context *ctx)
+{
+ ctx->Extensions.ARB_occlusion_query = GL_TRUE;
+ /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/
+ ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
+}
+
+
+/**
+ * Enable all OpenGL 2.0 features and extensions.
+ * A convenience function to be called by drivers.
+ */
+void
+_mesa_enable_2_0_extensions(struct gl_context *ctx)
+{
+ /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
+#if FEATURE_ARB_fragment_shader
+ ctx->Extensions.ARB_fragment_shader = GL_TRUE;
+#endif
+ ctx->Extensions.ARB_point_sprite = GL_TRUE;
+ ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
+ ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
+#if FEATURE_ARB_shader_objects
+ ctx->Extensions.ARB_shader_objects = GL_TRUE;
+#endif
+#if FEATURE_ARB_shading_language_100
+ ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
+#endif
+ ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
+#if FEATURE_ARB_vertex_shader
+ ctx->Extensions.ARB_vertex_shader = GL_TRUE;
+#endif
+}
+
+
+/**
+ * Enable all OpenGL 2.1 features and extensions.
+ * A convenience function to be called by drivers.
+ */
+void
+_mesa_enable_2_1_extensions(struct gl_context *ctx)
+{
+#if FEATURE_EXT_pixel_buffer_object
+ ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
+#endif
+#if FEATURE_EXT_texture_sRGB
+ ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
+#endif
+}
+
+
+/**
+ * Either enable or disable the named extension.
+ * \return GL_TRUE for success, GL_FALSE if invalid extension name
+ */
+static GLboolean
+set_extension( struct gl_context *ctx, const char *name, GLboolean state )
+{
+ size_t offset;
+
+ if (ctx->Extensions.String) {
+ /* The string was already queried - can't change it now! */
+ _mesa_problem(ctx, "Trying to enable/disable extension after glGetString(GL_EXTENSIONS): %s", name);
+ return GL_FALSE;
+ }
+
+ offset = name_to_offset(name);
+ if (offset == 0) {
+ _mesa_problem(ctx, "Trying to enable/disable unknown extension %s",
+ name);
+ return GL_FALSE;
+ } else if (offset == o(dummy_true) && state == GL_FALSE) {
+ _mesa_problem(ctx, "Trying to disable a permanently enabled extension: "
+ "%s", name);
+ return GL_FALSE;
+ } else {
+ GLboolean *base = (GLboolean *) &ctx->Extensions;
+ base[offset] = state;
+ return GL_TRUE;
+ }
+}
+
+
+/**
+ * Enable the named extension.
+ * Typically called by drivers.
+ */
+void
+_mesa_enable_extension( struct gl_context *ctx, const char *name )
+{
+ if (!set_extension(ctx, name, GL_TRUE))
+ _mesa_problem(ctx, "Trying to enable unknown extension: %s", name);
+}
+
+
+/**
+ * Disable the named extension.
+ * XXX is this really needed???
+ */
+void
+_mesa_disable_extension( struct gl_context *ctx, const char *name )
+{
+ if (!set_extension(ctx, name, GL_FALSE))
+ _mesa_problem(ctx, "Trying to disable unknown extension: %s", name);
+}
+
+
+/**
+ * Test if the named extension is enabled in this context.
+ */
+GLboolean
+_mesa_extension_is_enabled( struct gl_context *ctx, const char *name )
+{
+ size_t offset;
+ GLboolean *base;
+
+ if (name == 0)
+ return GL_FALSE;
+
+ offset = name_to_offset(name);
+ if (offset == 0)
+ return GL_FALSE;
+ base = (GLboolean *) &ctx->Extensions;
+ return base[offset];
+}
+
+
+/**
+ * \brief Apply the \c MESA_EXTENSION_OVERRIDE environment variable.
+ *
+ * \c MESA_EXTENSION_OVERRIDE is a space-separated list of extensions to
+ * enable or disable. The list is processed thus:
+ * - Enable recognized extension names that are prefixed with '+'.
+ * - Disable recognized extension names that are prefixed with '-'.
+ * - Enable recognized extension names that are not prefixed.
+ * - Collect unrecognized extension names in a new string.
+ *
+ * \return Space-separated list of unrecognized extension names (which must
+ * be freed). Does not return \c NULL.
+ */
+static char *
+get_extension_override( struct gl_context *ctx )
+{
+ const char *env_const = _mesa_getenv("MESA_EXTENSION_OVERRIDE");
+ char *env;
+ char *ext;
+ char *extra_exts;
+ int len;
+
+ if (env_const == NULL) {
+ /* Return the empty string rather than NULL. This simplifies the logic
+ * of client functions. */
+ return calloc(1, sizeof(char));
+ }
+
+ /* extra_exts: List of unrecognized extensions. */
+ extra_exts = calloc(strlen(env_const), sizeof(char));
+
+ /* Copy env_const because strtok() is destructive. */
+ env = strdup(env_const);
+ for (ext = strtok(env, " "); ext != NULL; ext = strtok(NULL, " ")) {
+ int enable;
+ int recognized;
+ switch (ext[0]) {
+ case '+':
+ enable = 1;
+ ++ext;
+ break;
+ case '-':
+ enable = 0;
+ ++ext;
+ break;
+ default:
+ enable = 1;
+ break;
+ }
+ recognized = set_extension(ctx, ext, enable);
+ if (!recognized) {
+ strcat(extra_exts, ext);
+ strcat(extra_exts, " ");
+ }
+ }
+
+ /* Remove trailing space. */
+ len = strlen(extra_exts);
+ if (extra_exts[len - 1] == ' ')
+ extra_exts[len - 1] = '\0';
+
+ return extra_exts;
+}
+
+
+/**
+ * \brief Initialize extension tables and enable default extensions.
+ *
+ * This should be called during context initialization.
+ * Note: Sets gl_extensions.dummy_true to true.
+ */
+void
+_mesa_init_extensions( struct gl_context *ctx )
+{
+ GLboolean *base = (GLboolean *) &ctx->Extensions;
+ GLboolean *sentinel = base + o(extension_sentinel);
+ GLboolean *i;
+ const size_t *j;
+
+ /* First, turn all extensions off. */
+ for (i = base; i != sentinel; ++i)
+ *i = GL_FALSE;
+
+ /* Then, selectively turn default extensions on. */
+ ctx->Extensions.dummy_true = GL_TRUE;
+ for (j = default_extensions; *j != 0; ++j)
+ base[*j] = GL_TRUE;
+}
+
+
+typedef unsigned short extension_index;
+
+
+/**
+ * Compare two entries of the extensions table. Sorts first by year,
+ * then by name.
+ *
+ * Arguments are indices into extension_table.
+ */
+static int
+extension_compare(const void *p1, const void *p2)
+{
+ extension_index i1 = * (const extension_index *) p1;
+ extension_index i2 = * (const extension_index *) p2;
+ const struct extension *e1 = &extension_table[i1];
+ const struct extension *e2 = &extension_table[i2];
+ int res;
+
+ res = (int)e1->year - (int)e2->year;
+
+ if (res == 0) {
+ res = strcmp(e1->name, e2->name);
+ }
+
+ return res;
+}
+
+
+/**
+ * Construct the GL_EXTENSIONS string. Called the first time that
+ * glGetString(GL_EXTENSIONS) is called.
+ */
+GLubyte*
+_mesa_make_extension_string(struct gl_context *ctx)
+{
+ /* The extension string. */
+ char *exts = 0;
+ /* Length of extension string. */
+ size_t length = 0;
+ /* Number of extensions */
+ unsigned count;
+ /* Indices of the extensions sorted by year */
+ extension_index *extension_indices;
+ /* String of extra extensions. */
+ char *extra_extensions = get_extension_override(ctx);
+ GLboolean *base = (GLboolean *) &ctx->Extensions;
+ const struct extension *i;
+ unsigned j;
+ unsigned maxYear = ~0;
+
+ /* Check if the MESA_EXTENSION_MAX_YEAR env var is set */
+ {
+ const char *env = getenv("MESA_EXTENSION_MAX_YEAR");
+ if (env) {
+ maxYear = atoi(env);
+ _mesa_debug(ctx, "Note: limiting GL extensions to %u or earlier\n",
+ maxYear);
+ }
+ }
+
+ /* Compute length of the extension string. */
+ count = 0;
+ for (i = extension_table; i->name != 0; ++i) {
+ if (base[i->offset] &&
+ i->year <= maxYear &&
+ (i->api_set & (1 << ctx->API))) {
+ length += strlen(i->name) + 1; /* +1 for space */
+ ++count;
+ }
+ }
+ if (extra_extensions != NULL)
+ length += 1 + strlen(extra_extensions); /* +1 for space */
+
+ exts = (char *) calloc(length + 1, sizeof(char));
+ if (exts == NULL) {
+ free(extra_extensions);
+ return NULL;
+ }
+
+ extension_indices = malloc(count * sizeof(extension_index));
+ if (extension_indices == NULL) {
+ free(exts);
+ free(extra_extensions);
+ return NULL;
+ }
+
+ /* Sort extensions in chronological order because certain old applications (e.g.,
+ * Quake3 demo) store the extension list in a static size buffer so chronologically
+ * order ensure that the extensions that such applications expect will fit into
+ * that buffer.
+ */
+ j = 0;
+ for (i = extension_table; i->name != 0; ++i) {
+ if (base[i->offset] &&
+ i->year <= maxYear &&
+ (i->api_set & (1 << ctx->API))) {
+ extension_indices[j++] = i - extension_table;
+ }
+ }
+ assert(j == count);
+ qsort(extension_indices, count, sizeof *extension_indices, extension_compare);
+
+ /* Build the extension string.*/
+ for (j = 0; j < count; ++j) {
+ i = &extension_table[extension_indices[j]];
+ assert(base[i->offset] && (i->api_set & (1 << ctx->API)));
+ strcat(exts, i->name);
+ strcat(exts, " ");
+ }
+ free(extension_indices);
+ if (extra_extensions != 0) {
+ strcat(exts, extra_extensions);
+ free(extra_extensions);
+ }
+
+ return (GLubyte *) exts;
+}
+
+/**
+ * Return number of enabled extensions.
+ */
+GLuint
+_mesa_get_extension_count(struct gl_context *ctx)
+{
+ GLboolean *base;
+ const struct extension *i;
+
+ /* only count once */
+ if (ctx->Extensions.Count != 0)
+ return ctx->Extensions.Count;
+
+ base = (GLboolean *) &ctx->Extensions;
+ for (i = extension_table; i->name != 0; ++i) {
+ if (base[i->offset]) {
+ ctx->Extensions.Count++;
+ }
+ }
+ return ctx->Extensions.Count;
+}
+
+/**
+ * Return name of i-th enabled extension
+ */
+const GLubyte *
+_mesa_get_enabled_extension(struct gl_context *ctx, GLuint index)
+{
+ const GLboolean *base;
+ size_t n;
+ const struct extension *i;
+
+ if (index < 0)
+ return NULL;
+
+ base = (GLboolean*) &ctx->Extensions;
+ n = 0;
+ for (i = extension_table; i->name != 0; ++i) {
+ if (n == index && base[i->offset]) {
+ return (GLubyte*) i->name;
+ } else if (base[i->offset]) {
+ ++n;
+ }
+ }
+
+ return NULL;
+}
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 82eb7fb71..0b48fc7ea 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -1984,10 +1984,26 @@ _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment,
{
GET_CURRENT_CONTEXT(ctx);
- if ((texture != 0) && (textarget != GL_TEXTURE_1D)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferTexture1DEXT(textarget)");
- return;
+ if (texture != 0) {
+ GLboolean error;
+
+ switch (textarget) {
+ case GL_TEXTURE_1D:
+ error = GL_FALSE;
+ break;
+ case GL_TEXTURE_1D_ARRAY:
+ error = !ctx->Extensions.EXT_texture_array;
+ break;
+ default:
+ error = GL_TRUE;
+ }
+
+ if (error) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTexture1DEXT(textarget=%s)",
+ _mesa_lookup_enum_by_nr(textarget));
+ return;
+ }
}
framebuffer_texture(ctx, "1D", target, attachment, textarget, texture,
@@ -2001,13 +2017,37 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
{
GET_CURRENT_CONTEXT(ctx);
- if ((texture != 0) &&
- (textarget != GL_TEXTURE_2D) &&
- (textarget != GL_TEXTURE_RECTANGLE_ARB) &&
- (!is_cube_face(textarget))) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture2DEXT(textarget=0x%x)", textarget);
- return;
+ if (texture != 0) {
+ GLboolean error;
+
+ switch (textarget) {
+ case GL_TEXTURE_2D:
+ error = GL_FALSE;
+ break;
+ case GL_TEXTURE_RECTANGLE:
+ error = !ctx->Extensions.NV_texture_rectangle;
+ break;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ error = !ctx->Extensions.ARB_texture_cube_map;
+ break;
+ case GL_TEXTURE_2D_ARRAY:
+ error = !ctx->Extensions.EXT_texture_array;
+ break;
+ default:
+ error = GL_FALSE;
+ }
+
+ if (error) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTexture2DEXT(textarget=%s)",
+ _mesa_lookup_enum_by_nr(textarget));
+ return;
+ }
}
framebuffer_texture(ctx, "2D", target, attachment, textarget, texture,
@@ -2023,7 +2063,7 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment,
GET_CURRENT_CONTEXT(ctx);
if ((texture != 0) && (textarget != GL_TEXTURE_3D)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
+ _mesa_error(ctx, GL_INVALID_OPERATION,
"glFramebufferTexture3DEXT(textarget)");
return;
}
@@ -2346,6 +2386,8 @@ void GLAPIENTRY
_mesa_GenerateMipmapEXT(GLenum target)
{
struct gl_texture_object *texObj;
+ GLboolean error;
+
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -2355,12 +2397,22 @@ _mesa_GenerateMipmapEXT(GLenum target)
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_3D:
+ error = GL_FALSE;
+ break;
case GL_TEXTURE_CUBE_MAP:
- /* OK, legal value */
+ error = !ctx->Extensions.ARB_texture_cube_map;
+ break;
+ case GL_TEXTURE_1D_ARRAY:
+ case GL_TEXTURE_2D_ARRAY:
+ error = !ctx->Extensions.EXT_texture_array;
break;
default:
- /* XXX need to implement GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY */
- _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)");
+ error = GL_TRUE;
+ }
+
+ if (error) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target=%s)",
+ _mesa_lookup_enum_by_nr(target));
return;
}
diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c
index 0a572ec22..8f0971959 100644
--- a/mesalib/src/mesa/main/imports.c
+++ b/mesalib/src/mesa/main/imports.c
@@ -753,7 +753,8 @@ _mesa_strdup( const char *s )
float
_mesa_strtof( const char *s, char **end )
{
-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
+#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
+ !defined(ANDROID)
static locale_t loc = NULL;
if (!loc) {
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h
index 3fa1db02a..70defdc43 100644
--- a/mesalib/src/mesa/main/imports.h
+++ b/mesalib/src/mesa/main/imports.h
@@ -134,7 +134,13 @@ typedef union { GLfloat f; GLint i; } fi_type;
#define exp2f(f) ((float) exp2(f))
#define floorf(f) ((float) floor(f))
#define logf(f) ((float) log(f))
+
+#ifdef ANDROID
+#define log2f(f) (logf(f) * (float) (1.0 / M_LN2))
+#else
#define log2f(f) ((float) log2(f))
+#endif
+
#define powf(x,y) ((float) pow(x,y))
#define sinf(f) ((float) sin(f))
#define sinhf(f) ((float) sinh(f))
@@ -562,7 +568,7 @@ _mesa_init_sqrt_table(void);
#ifdef __GNUC__
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(ANDROID)
#define ffs __builtin_ffs
#define ffsll __builtin_ffsll
#endif
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index 2d5f44c1e..f2eb889fe 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -1279,6 +1279,9 @@ struct gl_texture_image
GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */
struct gl_texture_object *TexObject; /**< Pointer back to parent object */
+ GLuint Level; /**< Which mipmap level am I? */
+ /** Cube map face: index into gl_texture_object::Image[] array */
+ GLuint Face;
FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */
FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */
@@ -2717,6 +2720,12 @@ struct gl_constants
GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */
+ /**
+ * Does the driver support real 32-bit integers? (Otherwise, integers are
+ * simulated via floats.)
+ */
+ GLboolean NativeIntegers;
+
/** Which texture units support GL_ATI_envmap_bumpmap as targets */
GLbitfield SupportedBumpUnits;
diff --git a/mesalib/src/mesa/main/pbo.c b/mesalib/src/mesa/main/pbo.c
index 15e0480e9..4e7e6f925 100644
--- a/mesalib/src/mesa/main/pbo.c
+++ b/mesalib/src/mesa/main/pbo.c
@@ -128,9 +128,10 @@ _mesa_map_pbo_source(struct gl_context *ctx,
if (_mesa_is_bufferobj(unpack->BufferObj)) {
/* unpack from PBO */
- buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB,
- unpack->BufferObj);
+ buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0,
+ unpack->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ unpack->BufferObj);
if (!buf)
return NULL;
@@ -201,8 +202,7 @@ _mesa_unmap_pbo_source(struct gl_context *ctx,
{
ASSERT(unpack != &ctx->Pack); /* catch pack/unpack mismatch */
if (_mesa_is_bufferobj(unpack->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- unpack->BufferObj);
+ ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
}
}
@@ -224,9 +224,10 @@ _mesa_map_pbo_dest(struct gl_context *ctx,
if (_mesa_is_bufferobj(pack->BufferObj)) {
/* pack into PBO */
- buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
- GL_WRITE_ONLY_ARB,
- pack->BufferObj);
+ buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0,
+ pack->BufferObj->Size,
+ GL_MAP_WRITE_BIT,
+ pack->BufferObj);
if (!buf)
return NULL;
@@ -297,7 +298,7 @@ _mesa_unmap_pbo_dest(struct gl_context *ctx,
{
ASSERT(pack != &ctx->Unpack); /* catch pack/unpack mismatch */
if (_mesa_is_bufferobj(pack->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, pack->BufferObj);
+ ctx->Driver.UnmapBuffer(ctx, pack->BufferObj);
}
}
@@ -327,8 +328,9 @@ _mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions,
return NULL;
}
- buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, unpack->BufferObj);
+ buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ unpack->BufferObj);
if (!buf) {
_mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped)");
return NULL;
@@ -364,8 +366,10 @@ _mesa_validate_pbo_compressed_teximage(struct gl_context *ctx,
return NULL;
}
- buf = (GLubyte*) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, packing->BufferObj);
+ buf = (GLubyte*) ctx->Driver.MapBufferRange(ctx, 0,
+ packing->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ packing->BufferObj);
if (!buf) {
_mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped");
return NULL;
@@ -384,8 +388,7 @@ _mesa_unmap_teximage_pbo(struct gl_context *ctx,
const struct gl_pixelstore_attrib *unpack)
{
if (_mesa_is_bufferobj(unpack->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- unpack->BufferObj);
+ ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
}
}
diff --git a/mesalib/src/mesa/main/querymatrix.c b/mesalib/src/mesa/main/querymatrix.c
index aade8a614..eaedf7cd2 100644
--- a/mesalib/src/mesa/main/querymatrix.c
+++ b/mesalib/src/mesa/main/querymatrix.c
@@ -1,212 +1,212 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- **************************************************************************/
-
-
-/**
- * Code to implement GL_OES_query_matrix. See the spec at:
- * http://www.khronos.org/registry/gles/extensions/OES/OES_query_matrix.txt
- */
-
-
-#include <stdlib.h>
-#include <math.h>
-#include "GLES/gl.h"
-#include "GLES/glext.h"
-
-
-/**
- * This is from the GL_OES_query_matrix extension specification:
- *
- * GLbitfield glQueryMatrixxOES( GLfixed mantissa[16],
- * GLint exponent[16] )
- * mantissa[16] contains the contents of the current matrix in GLfixed
- * format. exponent[16] contains the unbiased exponents applied to the
- * matrix components, so that the internal representation of component i
- * is close to mantissa[i] * 2^exponent[i]. The function returns a status
- * word which is zero if all the components are valid. If
- * status & (1<<i) != 0, the component i is invalid (e.g., NaN, Inf).
- * The implementations are not required to keep track of overflows. In
- * that case, the invalid bits are never set.
- */
-
-#define INT_TO_FIXED(x) ((GLfixed) ((x) << 16))
-#define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0))
-
-#if defined(_MSC_VER)
-/* Oddly, the fpclassify() function doesn't exist in such a form
- * on MSVC. This is an implementation using slightly different
- * lower-level Windows functions.
- */
-#include <float.h>
-
-enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
-fpclassify(double x)
-{
- switch(_fpclass(x)) {
- case _FPCLASS_SNAN: /* signaling NaN */
- case _FPCLASS_QNAN: /* quiet NaN */
- return FP_NAN;
- case _FPCLASS_NINF: /* negative infinity */
- case _FPCLASS_PINF: /* positive infinity */
- return FP_INFINITE;
- case _FPCLASS_NN: /* negative normal */
- case _FPCLASS_PN: /* positive normal */
- return FP_NORMAL;
- case _FPCLASS_ND: /* negative denormalized */
- case _FPCLASS_PD: /* positive denormalized */
- return FP_SUBNORMAL;
- case _FPCLASS_NZ: /* negative zero */
- case _FPCLASS_PZ: /* positive zero */
- return FP_ZERO;
- default:
- /* Should never get here; but if we do, this will guarantee
- * that the pattern is not treated like a number.
- */
- return FP_NAN;
- }
-}
-
-#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \
- defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \
- (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \
- (defined(__sun) && defined(__GNUC__))
-
-/* fpclassify is available. */
-
-#elif !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600
-
-enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
-fpclassify(double x)
-{
- /* XXX do something better someday */
- return FP_NORMAL;
-}
-
-#endif
-
-extern GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
-
-/* The Mesa functions we'll need */
-extern void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params);
-extern void GL_APIENTRY _mesa_GetFloatv(GLenum pname, GLfloat *params);
-
-GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16])
-{
- GLfloat matrix[16];
- GLint tmp;
- GLenum currentMode = GL_FALSE;
- GLenum desiredMatrix = GL_FALSE;
- /* The bitfield returns 1 for each component that is invalid (i.e.
- * NaN or Inf). In case of error, everything is invalid.
- */
- GLbitfield rv;
- register unsigned int i;
- unsigned int bit;
-
- /* This data structure defines the mapping between the current matrix
- * mode and the desired matrix identifier.
- */
- static struct {
- GLenum currentMode;
- GLenum desiredMatrix;
- } modes[] = {
- {GL_MODELVIEW, GL_MODELVIEW_MATRIX},
- {GL_PROJECTION, GL_PROJECTION_MATRIX},
- {GL_TEXTURE, GL_TEXTURE_MATRIX},
- };
-
- /* Call Mesa to get the current matrix in floating-point form. First,
- * we have to figure out what the current matrix mode is.
- */
- _mesa_GetIntegerv(GL_MATRIX_MODE, &tmp);
- currentMode = (GLenum) tmp;
-
- /* The mode is either GL_FALSE, if for some reason we failed to query
- * the mode, or a given mode from the above table. Search for the
- * returned mode to get the desired matrix; if we don't find it,
- * we can return immediately, as _mesa_GetInteger() will have
- * logged the necessary error already.
- */
- for (i = 0; i < sizeof(modes)/sizeof(modes[0]); i++) {
- if (modes[i].currentMode == currentMode) {
- desiredMatrix = modes[i].desiredMatrix;
- break;
- }
- }
- if (desiredMatrix == GL_FALSE) {
- /* Early error means all values are invalid. */
- return 0xffff;
- }
-
- /* Now pull the matrix itself. */
- _mesa_GetFloatv(desiredMatrix, matrix);
-
- rv = 0;
- for (i = 0, bit = 1; i < 16; i++, bit<<=1) {
- float normalizedFraction;
- int exp;
-
- switch (fpclassify(matrix[i])) {
- /* A "subnormal" or denormalized number is too small to be
- * represented in normal format; but despite that it's a
- * valid floating point number. FP_ZERO and FP_NORMAL
- * are both valid as well. We should be fine treating
- * these three cases as legitimate floating-point numbers.
- */
- case FP_SUBNORMAL:
- case FP_NORMAL:
- case FP_ZERO:
- normalizedFraction = (GLfloat)frexp(matrix[i], &exp);
- mantissa[i] = FLOAT_TO_FIXED(normalizedFraction);
- exponent[i] = (GLint) exp;
- break;
-
- /* If the entry is not-a-number or an infinity, then the
- * matrix component is invalid. The invalid flag for
- * the component is already set; might as well set the
- * other return values to known values. We'll set
- * distinct values so that a savvy end user could determine
- * whether the matrix component was a NaN or an infinity,
- * but this is more useful for debugging than anything else
- * since the standard doesn't specify any such magic
- * values to return.
- */
- case FP_NAN:
- mantissa[i] = INT_TO_FIXED(0);
- exponent[i] = (GLint) 0;
- rv |= bit;
- break;
-
- case FP_INFINITE:
- /* Return +/- 1 based on whether it's a positive or
- * negative infinity.
- */
- if (matrix[i] > 0) {
- mantissa[i] = INT_TO_FIXED(1);
- }
- else {
- mantissa[i] = -INT_TO_FIXED(1);
- }
- exponent[i] = (GLint) 0;
- rv |= bit;
- break;
-
- /* We should never get here; but here's a catching case
- * in case fpclassify() is returnings something unexpected.
- */
- default:
- mantissa[i] = INT_TO_FIXED(2);
- exponent[i] = (GLint) 0;
- rv |= bit;
- break;
- }
-
- } /* for each component */
-
- /* All done */
- return rv;
-}
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+/**
+ * Code to implement GL_OES_query_matrix. See the spec at:
+ * http://www.khronos.org/registry/gles/extensions/OES/OES_query_matrix.txt
+ */
+
+
+#include <stdlib.h>
+#include <math.h>
+#include "GLES/gl.h"
+#include "GLES/glext.h"
+
+
+/**
+ * This is from the GL_OES_query_matrix extension specification:
+ *
+ * GLbitfield glQueryMatrixxOES( GLfixed mantissa[16],
+ * GLint exponent[16] )
+ * mantissa[16] contains the contents of the current matrix in GLfixed
+ * format. exponent[16] contains the unbiased exponents applied to the
+ * matrix components, so that the internal representation of component i
+ * is close to mantissa[i] * 2^exponent[i]. The function returns a status
+ * word which is zero if all the components are valid. If
+ * status & (1<<i) != 0, the component i is invalid (e.g., NaN, Inf).
+ * The implementations are not required to keep track of overflows. In
+ * that case, the invalid bits are never set.
+ */
+
+#define INT_TO_FIXED(x) ((GLfixed) ((x) << 16))
+#define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0))
+
+#if defined(_MSC_VER)
+/* Oddly, the fpclassify() function doesn't exist in such a form
+ * on MSVC. This is an implementation using slightly different
+ * lower-level Windows functions.
+ */
+#include <float.h>
+
+enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
+fpclassify(double x)
+{
+ switch(_fpclass(x)) {
+ case _FPCLASS_SNAN: /* signaling NaN */
+ case _FPCLASS_QNAN: /* quiet NaN */
+ return FP_NAN;
+ case _FPCLASS_NINF: /* negative infinity */
+ case _FPCLASS_PINF: /* positive infinity */
+ return FP_INFINITE;
+ case _FPCLASS_NN: /* negative normal */
+ case _FPCLASS_PN: /* positive normal */
+ return FP_NORMAL;
+ case _FPCLASS_ND: /* negative denormalized */
+ case _FPCLASS_PD: /* positive denormalized */
+ return FP_SUBNORMAL;
+ case _FPCLASS_NZ: /* negative zero */
+ case _FPCLASS_PZ: /* positive zero */
+ return FP_ZERO;
+ default:
+ /* Should never get here; but if we do, this will guarantee
+ * that the pattern is not treated like a number.
+ */
+ return FP_NAN;
+ }
+}
+
+#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \
+ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \
+ (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \
+ (defined(__sun) && defined(__GNUC__)) || defined(ANDROID)
+
+/* fpclassify is available. */
+
+#elif !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600
+
+enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
+fpclassify(double x)
+{
+ /* XXX do something better someday */
+ return FP_NORMAL;
+}
+
+#endif
+
+extern GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
+
+/* The Mesa functions we'll need */
+extern void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params);
+extern void GL_APIENTRY _mesa_GetFloatv(GLenum pname, GLfloat *params);
+
+GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16])
+{
+ GLfloat matrix[16];
+ GLint tmp;
+ GLenum currentMode = GL_FALSE;
+ GLenum desiredMatrix = GL_FALSE;
+ /* The bitfield returns 1 for each component that is invalid (i.e.
+ * NaN or Inf). In case of error, everything is invalid.
+ */
+ GLbitfield rv;
+ register unsigned int i;
+ unsigned int bit;
+
+ /* This data structure defines the mapping between the current matrix
+ * mode and the desired matrix identifier.
+ */
+ static struct {
+ GLenum currentMode;
+ GLenum desiredMatrix;
+ } modes[] = {
+ {GL_MODELVIEW, GL_MODELVIEW_MATRIX},
+ {GL_PROJECTION, GL_PROJECTION_MATRIX},
+ {GL_TEXTURE, GL_TEXTURE_MATRIX},
+ };
+
+ /* Call Mesa to get the current matrix in floating-point form. First,
+ * we have to figure out what the current matrix mode is.
+ */
+ _mesa_GetIntegerv(GL_MATRIX_MODE, &tmp);
+ currentMode = (GLenum) tmp;
+
+ /* The mode is either GL_FALSE, if for some reason we failed to query
+ * the mode, or a given mode from the above table. Search for the
+ * returned mode to get the desired matrix; if we don't find it,
+ * we can return immediately, as _mesa_GetInteger() will have
+ * logged the necessary error already.
+ */
+ for (i = 0; i < sizeof(modes)/sizeof(modes[0]); i++) {
+ if (modes[i].currentMode == currentMode) {
+ desiredMatrix = modes[i].desiredMatrix;
+ break;
+ }
+ }
+ if (desiredMatrix == GL_FALSE) {
+ /* Early error means all values are invalid. */
+ return 0xffff;
+ }
+
+ /* Now pull the matrix itself. */
+ _mesa_GetFloatv(desiredMatrix, matrix);
+
+ rv = 0;
+ for (i = 0, bit = 1; i < 16; i++, bit<<=1) {
+ float normalizedFraction;
+ int exp;
+
+ switch (fpclassify(matrix[i])) {
+ /* A "subnormal" or denormalized number is too small to be
+ * represented in normal format; but despite that it's a
+ * valid floating point number. FP_ZERO and FP_NORMAL
+ * are both valid as well. We should be fine treating
+ * these three cases as legitimate floating-point numbers.
+ */
+ case FP_SUBNORMAL:
+ case FP_NORMAL:
+ case FP_ZERO:
+ normalizedFraction = (GLfloat)frexp(matrix[i], &exp);
+ mantissa[i] = FLOAT_TO_FIXED(normalizedFraction);
+ exponent[i] = (GLint) exp;
+ break;
+
+ /* If the entry is not-a-number or an infinity, then the
+ * matrix component is invalid. The invalid flag for
+ * the component is already set; might as well set the
+ * other return values to known values. We'll set
+ * distinct values so that a savvy end user could determine
+ * whether the matrix component was a NaN or an infinity,
+ * but this is more useful for debugging than anything else
+ * since the standard doesn't specify any such magic
+ * values to return.
+ */
+ case FP_NAN:
+ mantissa[i] = INT_TO_FIXED(0);
+ exponent[i] = (GLint) 0;
+ rv |= bit;
+ break;
+
+ case FP_INFINITE:
+ /* Return +/- 1 based on whether it's a positive or
+ * negative infinity.
+ */
+ if (matrix[i] > 0) {
+ mantissa[i] = INT_TO_FIXED(1);
+ }
+ else {
+ mantissa[i] = -INT_TO_FIXED(1);
+ }
+ exponent[i] = (GLint) 0;
+ rv |= bit;
+ break;
+
+ /* We should never get here; but here's a catching case
+ * in case fpclassify() is returnings something unexpected.
+ */
+ default:
+ mantissa[i] = INT_TO_FIXED(2);
+ exponent[i] = (GLint) 0;
+ rv |= bit;
+ break;
+ }
+
+ } /* for each component */
+
+ /* All done */
+ return rv;
+}
diff --git a/mesalib/src/mesa/main/remap_helper.h b/mesalib/src/mesa/main/remap_helper.h
index dca6b4987..bb714e8d2 100644
--- a/mesalib/src/mesa/main/remap_helper.h
+++ b/mesalib/src/mesa/main/remap_helper.h
@@ -475,4457 +475,4454 @@ static const char _mesa_function_pool[] =
/* _mesa_function_pool[3103]: FramebufferTextureLayerEXT (will be remapped) */
"iiiii\0"
"glFramebufferTextureLayer\0"
+ "glFramebufferTextureLayerARB\0"
"glFramebufferTextureLayerEXT\0"
"\0"
- /* _mesa_function_pool[3165]: GetListParameterfvSGIX (dynamic) */
+ /* _mesa_function_pool[3194]: GetListParameterfvSGIX (dynamic) */
"iip\0"
"glGetListParameterfvSGIX\0"
"\0"
- /* _mesa_function_pool[3195]: Viewport (offset 305) */
+ /* _mesa_function_pool[3224]: Viewport (offset 305) */
"iiii\0"
"glViewport\0"
"\0"
- /* _mesa_function_pool[3212]: VertexAttrib4NusvARB (will be remapped) */
+ /* _mesa_function_pool[3241]: VertexAttrib4NusvARB (will be remapped) */
"ip\0"
"glVertexAttrib4Nusv\0"
"glVertexAttrib4NusvARB\0"
"\0"
- /* _mesa_function_pool[3259]: WindowPos4svMESA (will be remapped) */
+ /* _mesa_function_pool[3288]: WindowPos4svMESA (will be remapped) */
"p\0"
"glWindowPos4svMESA\0"
"\0"
- /* _mesa_function_pool[3281]: CreateProgramObjectARB (will be remapped) */
+ /* _mesa_function_pool[3310]: CreateProgramObjectARB (will be remapped) */
"\0"
"glCreateProgramObjectARB\0"
"\0"
- /* _mesa_function_pool[3308]: DeleteTransformFeedbacks (will be remapped) */
+ /* _mesa_function_pool[3337]: DeleteTransformFeedbacks (will be remapped) */
"ip\0"
"glDeleteTransformFeedbacks\0"
"\0"
- /* _mesa_function_pool[3339]: UniformMatrix4x3fv (will be remapped) */
+ /* _mesa_function_pool[3368]: UniformMatrix4x3fv (will be remapped) */
"iiip\0"
"glUniformMatrix4x3fv\0"
"\0"
- /* _mesa_function_pool[3366]: PrioritizeTextures (offset 331) */
+ /* _mesa_function_pool[3395]: PrioritizeTextures (offset 331) */
"ipp\0"
"glPrioritizeTextures\0"
"glPrioritizeTexturesEXT\0"
"\0"
- /* _mesa_function_pool[3416]: VertexAttribI3uiEXT (will be remapped) */
+ /* _mesa_function_pool[3445]: VertexAttribI3uiEXT (will be remapped) */
"iiii\0"
"glVertexAttribI3uiEXT\0"
"glVertexAttribI3ui\0"
"\0"
- /* _mesa_function_pool[3463]: AsyncMarkerSGIX (dynamic) */
+ /* _mesa_function_pool[3492]: AsyncMarkerSGIX (dynamic) */
"i\0"
"glAsyncMarkerSGIX\0"
"\0"
- /* _mesa_function_pool[3484]: GlobalAlphaFactorubSUN (dynamic) */
+ /* _mesa_function_pool[3513]: GlobalAlphaFactorubSUN (dynamic) */
"i\0"
"glGlobalAlphaFactorubSUN\0"
"\0"
- /* _mesa_function_pool[3512]: ClearColorIuiEXT (will be remapped) */
+ /* _mesa_function_pool[3541]: ClearColorIuiEXT (will be remapped) */
"iiii\0"
"glClearColorIuiEXT\0"
"\0"
- /* _mesa_function_pool[3537]: ClearDebugLogMESA (dynamic) */
+ /* _mesa_function_pool[3566]: ClearDebugLogMESA (dynamic) */
"iii\0"
"glClearDebugLogMESA\0"
"\0"
- /* _mesa_function_pool[3562]: Uniform4uiEXT (will be remapped) */
+ /* _mesa_function_pool[3591]: Uniform4uiEXT (will be remapped) */
"iiiii\0"
"glUniform4uiEXT\0"
"glUniform4ui\0"
"\0"
- /* _mesa_function_pool[3598]: ResetHistogram (offset 369) */
+ /* _mesa_function_pool[3627]: ResetHistogram (offset 369) */
"i\0"
"glResetHistogram\0"
"glResetHistogramEXT\0"
"\0"
- /* _mesa_function_pool[3638]: GetProgramNamedParameterfvNV (will be remapped) */
+ /* _mesa_function_pool[3667]: GetProgramNamedParameterfvNV (will be remapped) */
"iipp\0"
"glGetProgramNamedParameterfvNV\0"
"\0"
- /* _mesa_function_pool[3675]: PointParameterfEXT (will be remapped) */
+ /* _mesa_function_pool[3704]: PointParameterfEXT (will be remapped) */
"if\0"
"glPointParameterf\0"
"glPointParameterfARB\0"
"glPointParameterfEXT\0"
"glPointParameterfSGIS\0"
"\0"
- /* _mesa_function_pool[3761]: LoadIdentityDeformationMapSGIX (dynamic) */
+ /* _mesa_function_pool[3790]: LoadIdentityDeformationMapSGIX (dynamic) */
"i\0"
"glLoadIdentityDeformationMapSGIX\0"
"\0"
- /* _mesa_function_pool[3797]: GenFencesNV (will be remapped) */
+ /* _mesa_function_pool[3826]: GenFencesNV (will be remapped) */
"ip\0"
"glGenFencesNV\0"
"\0"
- /* _mesa_function_pool[3815]: ImageTransformParameterfHP (dynamic) */
+ /* _mesa_function_pool[3844]: ImageTransformParameterfHP (dynamic) */
"iif\0"
"glImageTransformParameterfHP\0"
"\0"
- /* _mesa_function_pool[3849]: MatrixIndexusvARB (dynamic) */
+ /* _mesa_function_pool[3878]: MatrixIndexusvARB (dynamic) */
"ip\0"
"glMatrixIndexusvARB\0"
"\0"
- /* _mesa_function_pool[3873]: DrawElementsBaseVertex (will be remapped) */
+ /* _mesa_function_pool[3902]: DrawElementsBaseVertex (will be remapped) */
"iiipi\0"
"glDrawElementsBaseVertex\0"
"\0"
- /* _mesa_function_pool[3905]: DisableVertexAttribArrayARB (will be remapped) */
+ /* _mesa_function_pool[3934]: DisableVertexAttribArrayARB (will be remapped) */
"i\0"
"glDisableVertexAttribArray\0"
"glDisableVertexAttribArrayARB\0"
"\0"
- /* _mesa_function_pool[3965]: GetnConvolutionFilterARB (will be remapped) */
+ /* _mesa_function_pool[3994]: GetnConvolutionFilterARB (will be remapped) */
"iiiip\0"
"glGetnConvolutionFilterARB\0"
"\0"
- /* _mesa_function_pool[3999]: TexCoord2sv (offset 109) */
+ /* _mesa_function_pool[4028]: TexCoord2sv (offset 109) */
"p\0"
"glTexCoord2sv\0"
"\0"
- /* _mesa_function_pool[4016]: Vertex4dv (offset 143) */
+ /* _mesa_function_pool[4045]: Vertex4dv (offset 143) */
"p\0"
"glVertex4dv\0"
"\0"
- /* _mesa_function_pool[4031]: StencilMaskSeparate (will be remapped) */
+ /* _mesa_function_pool[4060]: StencilMaskSeparate (will be remapped) */
"ii\0"
"glStencilMaskSeparate\0"
"\0"
- /* _mesa_function_pool[4057]: ProgramLocalParameter4dARB (will be remapped) */
+ /* _mesa_function_pool[4086]: ProgramLocalParameter4dARB (will be remapped) */
"iidddd\0"
"glProgramLocalParameter4dARB\0"
"\0"
- /* _mesa_function_pool[4094]: CompressedTexImage3DARB (will be remapped) */
+ /* _mesa_function_pool[4123]: CompressedTexImage3DARB (will be remapped) */
"iiiiiiiip\0"
"glCompressedTexImage3D\0"
"glCompressedTexImage3DARB\0"
"\0"
- /* _mesa_function_pool[4154]: Color3sv (offset 18) */
+ /* _mesa_function_pool[4183]: Color3sv (offset 18) */
"p\0"
"glColor3sv\0"
"\0"
- /* _mesa_function_pool[4168]: GetConvolutionParameteriv (offset 358) */
+ /* _mesa_function_pool[4197]: GetConvolutionParameteriv (offset 358) */
"iip\0"
"glGetConvolutionParameteriv\0"
"glGetConvolutionParameterivEXT\0"
"\0"
- /* _mesa_function_pool[4232]: DeleteSamplers (will be remapped) */
+ /* _mesa_function_pool[4261]: DeleteSamplers (will be remapped) */
"ip\0"
"glDeleteSamplers\0"
"\0"
- /* _mesa_function_pool[4253]: VertexAttrib1fARB (will be remapped) */
+ /* _mesa_function_pool[4282]: VertexAttrib1fARB (will be remapped) */
"if\0"
"glVertexAttrib1f\0"
"glVertexAttrib1fARB\0"
"\0"
- /* _mesa_function_pool[4294]: Vertex2dv (offset 127) */
+ /* _mesa_function_pool[4323]: Vertex2dv (offset 127) */
"p\0"
"glVertex2dv\0"
"\0"
- /* _mesa_function_pool[4309]: TestFenceNV (will be remapped) */
+ /* _mesa_function_pool[4338]: TestFenceNV (will be remapped) */
"i\0"
"glTestFenceNV\0"
"\0"
- /* _mesa_function_pool[4326]: GetVertexAttribIuivEXT (will be remapped) */
+ /* _mesa_function_pool[4355]: GetVertexAttribIuivEXT (will be remapped) */
"iip\0"
"glGetVertexAttribIuivEXT\0"
"glGetVertexAttribIuiv\0"
"\0"
- /* _mesa_function_pool[4378]: MultiTexCoord1fvARB (offset 379) */
+ /* _mesa_function_pool[4407]: MultiTexCoord1fvARB (offset 379) */
"ip\0"
"glMultiTexCoord1fv\0"
"glMultiTexCoord1fvARB\0"
"\0"
- /* _mesa_function_pool[4423]: TexCoord3iv (offset 115) */
+ /* _mesa_function_pool[4452]: TexCoord3iv (offset 115) */
"p\0"
"glTexCoord3iv\0"
"\0"
- /* _mesa_function_pool[4440]: Uniform2uivEXT (will be remapped) */
+ /* _mesa_function_pool[4469]: Uniform2uivEXT (will be remapped) */
"iip\0"
"glUniform2uivEXT\0"
"glUniform2uiv\0"
"\0"
- /* _mesa_function_pool[4476]: ColorFragmentOp2ATI (will be remapped) */
+ /* _mesa_function_pool[4505]: ColorFragmentOp2ATI (will be remapped) */
"iiiiiiiiii\0"
"glColorFragmentOp2ATI\0"
"\0"
- /* _mesa_function_pool[4510]: SecondaryColorPointerListIBM (dynamic) */
+ /* _mesa_function_pool[4539]: SecondaryColorPointerListIBM (dynamic) */
"iiipi\0"
"glSecondaryColorPointerListIBM\0"
"\0"
- /* _mesa_function_pool[4548]: GetPixelTexGenParameterivSGIS (will be remapped) */
+ /* _mesa_function_pool[4577]: GetPixelTexGenParameterivSGIS (will be remapped) */
"ip\0"
"glGetPixelTexGenParameterivSGIS\0"
"\0"
- /* _mesa_function_pool[4584]: Color3fv (offset 14) */
+ /* _mesa_function_pool[4613]: Color3fv (offset 14) */
"p\0"
"glColor3fv\0"
"\0"
- /* _mesa_function_pool[4598]: GetnPixelMapfvARB (will be remapped) */
+ /* _mesa_function_pool[4627]: GetnPixelMapfvARB (will be remapped) */
"iip\0"
"glGetnPixelMapfvARB\0"
"\0"
- /* _mesa_function_pool[4623]: ReplacementCodeubSUN (dynamic) */
+ /* _mesa_function_pool[4652]: ReplacementCodeubSUN (dynamic) */
"i\0"
"glReplacementCodeubSUN\0"
"\0"
- /* _mesa_function_pool[4649]: FinishAsyncSGIX (dynamic) */
+ /* _mesa_function_pool[4678]: FinishAsyncSGIX (dynamic) */
"p\0"
"glFinishAsyncSGIX\0"
"\0"
- /* _mesa_function_pool[4670]: GetnUniformfvARB (will be remapped) */
+ /* _mesa_function_pool[4699]: GetnUniformfvARB (will be remapped) */
"iiip\0"
"glGetnUniformfvARB\0"
"\0"
- /* _mesa_function_pool[4695]: GetDebugLogMESA (dynamic) */
+ /* _mesa_function_pool[4724]: GetDebugLogMESA (dynamic) */
"iiiipp\0"
"glGetDebugLogMESA\0"
"\0"
- /* _mesa_function_pool[4721]: FogCoorddEXT (will be remapped) */
+ /* _mesa_function_pool[4750]: FogCoorddEXT (will be remapped) */
"d\0"
"glFogCoordd\0"
"glFogCoorddEXT\0"
"\0"
- /* _mesa_function_pool[4751]: BeginConditionalRenderNV (will be remapped) */
+ /* _mesa_function_pool[4780]: BeginConditionalRenderNV (will be remapped) */
"ii\0"
"glBeginConditionalRenderNV\0"
"glBeginConditionalRender\0"
"\0"
- /* _mesa_function_pool[4807]: Color4ubVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[4836]: Color4ubVertex3fSUN (dynamic) */
"iiiifff\0"
"glColor4ubVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[4838]: FogCoordfEXT (will be remapped) */
+ /* _mesa_function_pool[4867]: FogCoordfEXT (will be remapped) */
"f\0"
"glFogCoordf\0"
"glFogCoordfEXT\0"
"\0"
- /* _mesa_function_pool[4868]: PointSize (offset 173) */
+ /* _mesa_function_pool[4897]: PointSize (offset 173) */
"f\0"
"glPointSize\0"
"\0"
- /* _mesa_function_pool[4883]: VertexAttribI2uivEXT (will be remapped) */
+ /* _mesa_function_pool[4912]: VertexAttribI2uivEXT (will be remapped) */
"ip\0"
"glVertexAttribI2uivEXT\0"
"glVertexAttribI2uiv\0"
"\0"
- /* _mesa_function_pool[4930]: TexCoord2fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[4959]: TexCoord2fVertex3fSUN (dynamic) */
"fffff\0"
"glTexCoord2fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[4961]: PopName (offset 200) */
+ /* _mesa_function_pool[4990]: PopName (offset 200) */
"\0"
"glPopName\0"
"\0"
- /* _mesa_function_pool[4973]: GetSamplerParameterfv (will be remapped) */
+ /* _mesa_function_pool[5002]: GetSamplerParameterfv (will be remapped) */
"iip\0"
"glGetSamplerParameterfv\0"
"\0"
- /* _mesa_function_pool[5002]: GlobalAlphaFactoriSUN (dynamic) */
+ /* _mesa_function_pool[5031]: GlobalAlphaFactoriSUN (dynamic) */
"i\0"
"glGlobalAlphaFactoriSUN\0"
"\0"
- /* _mesa_function_pool[5029]: VertexAttrib2dNV (will be remapped) */
+ /* _mesa_function_pool[5058]: VertexAttrib2dNV (will be remapped) */
"idd\0"
"glVertexAttrib2dNV\0"
"\0"
- /* _mesa_function_pool[5053]: GetProgramInfoLog (will be remapped) */
+ /* _mesa_function_pool[5082]: GetProgramInfoLog (will be remapped) */
"iipp\0"
"glGetProgramInfoLog\0"
"\0"
- /* _mesa_function_pool[5079]: VertexAttrib4NbvARB (will be remapped) */
+ /* _mesa_function_pool[5108]: VertexAttrib4NbvARB (will be remapped) */
"ip\0"
"glVertexAttrib4Nbv\0"
"glVertexAttrib4NbvARB\0"
"\0"
- /* _mesa_function_pool[5124]: GetActiveAttribARB (will be remapped) */
+ /* _mesa_function_pool[5153]: GetActiveAttribARB (will be remapped) */
"iiipppp\0"
"glGetActiveAttrib\0"
"glGetActiveAttribARB\0"
"\0"
- /* _mesa_function_pool[5172]: Vertex4sv (offset 149) */
+ /* _mesa_function_pool[5201]: Vertex4sv (offset 149) */
"p\0"
"glVertex4sv\0"
"\0"
- /* _mesa_function_pool[5187]: VertexAttrib4ubNV (will be remapped) */
+ /* _mesa_function_pool[5216]: VertexAttrib4ubNV (will be remapped) */
"iiiii\0"
"glVertexAttrib4ubNV\0"
"\0"
- /* _mesa_function_pool[5214]: VertexAttribI1ivEXT (will be remapped) */
+ /* _mesa_function_pool[5243]: VertexAttribI1ivEXT (will be remapped) */
"ip\0"
"glVertexAttribI1ivEXT\0"
"glVertexAttribI1iv\0"
"\0"
- /* _mesa_function_pool[5259]: ClampColor (will be remapped) */
+ /* _mesa_function_pool[5288]: ClampColor (will be remapped) */
"ii\0"
"glClampColor\0"
"\0"
- /* _mesa_function_pool[5276]: TextureRangeAPPLE (will be remapped) */
+ /* _mesa_function_pool[5305]: TextureRangeAPPLE (will be remapped) */
"iip\0"
"glTextureRangeAPPLE\0"
"\0"
- /* _mesa_function_pool[5301]: GetTexEnvfv (offset 276) */
+ /* _mesa_function_pool[5330]: GetTexEnvfv (offset 276) */
"iip\0"
"glGetTexEnvfv\0"
"\0"
- /* _mesa_function_pool[5320]: BindTransformFeedback (will be remapped) */
+ /* _mesa_function_pool[5349]: BindTransformFeedback (will be remapped) */
"ii\0"
"glBindTransformFeedback\0"
"\0"
- /* _mesa_function_pool[5348]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[5377]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
"ffffffffffff\0"
"glTexCoord2fColor4fNormal3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[5401]: Indexub (offset 315) */
+ /* _mesa_function_pool[5430]: Indexub (offset 315) */
"i\0"
"glIndexub\0"
"\0"
- /* _mesa_function_pool[5414]: VertexAttrib4fNV (will be remapped) */
+ /* _mesa_function_pool[5443]: VertexAttrib4fNV (will be remapped) */
"iffff\0"
"glVertexAttrib4fNV\0"
"\0"
- /* _mesa_function_pool[5440]: TexEnvi (offset 186) */
+ /* _mesa_function_pool[5469]: TexEnvi (offset 186) */
"iii\0"
"glTexEnvi\0"
"\0"
- /* _mesa_function_pool[5455]: GetClipPlane (offset 259) */
+ /* _mesa_function_pool[5484]: GetClipPlane (offset 259) */
"ip\0"
"glGetClipPlane\0"
"\0"
- /* _mesa_function_pool[5474]: CombinerParameterfvNV (will be remapped) */
+ /* _mesa_function_pool[5503]: CombinerParameterfvNV (will be remapped) */
"ip\0"
"glCombinerParameterfvNV\0"
"\0"
- /* _mesa_function_pool[5502]: VertexAttribs3dvNV (will be remapped) */
+ /* _mesa_function_pool[5531]: VertexAttribs3dvNV (will be remapped) */
"iip\0"
"glVertexAttribs3dvNV\0"
"\0"
- /* _mesa_function_pool[5528]: VertexAttribI2uiEXT (will be remapped) */
+ /* _mesa_function_pool[5557]: VertexAttribI2uiEXT (will be remapped) */
"iii\0"
"glVertexAttribI2uiEXT\0"
"glVertexAttribI2ui\0"
"\0"
- /* _mesa_function_pool[5574]: VertexAttribs4fvNV (will be remapped) */
+ /* _mesa_function_pool[5603]: VertexAttribs4fvNV (will be remapped) */
"iip\0"
"glVertexAttribs4fvNV\0"
"\0"
- /* _mesa_function_pool[5600]: VertexArrayRangeNV (will be remapped) */
+ /* _mesa_function_pool[5629]: VertexArrayRangeNV (will be remapped) */
"ip\0"
"glVertexArrayRangeNV\0"
"\0"
- /* _mesa_function_pool[5625]: FragmentLightiSGIX (dynamic) */
+ /* _mesa_function_pool[5654]: FragmentLightiSGIX (dynamic) */
"iii\0"
"glFragmentLightiSGIX\0"
"\0"
- /* _mesa_function_pool[5651]: PolygonOffsetEXT (will be remapped) */
+ /* _mesa_function_pool[5680]: PolygonOffsetEXT (will be remapped) */
"ff\0"
"glPolygonOffsetEXT\0"
"\0"
- /* _mesa_function_pool[5674]: VertexAttribI4uivEXT (will be remapped) */
+ /* _mesa_function_pool[5703]: VertexAttribI4uivEXT (will be remapped) */
"ip\0"
"glVertexAttribI4uivEXT\0"
"glVertexAttribI4uiv\0"
"\0"
- /* _mesa_function_pool[5721]: PollAsyncSGIX (dynamic) */
+ /* _mesa_function_pool[5750]: PollAsyncSGIX (dynamic) */
"p\0"
"glPollAsyncSGIX\0"
"\0"
- /* _mesa_function_pool[5740]: DeleteFragmentShaderATI (will be remapped) */
+ /* _mesa_function_pool[5769]: DeleteFragmentShaderATI (will be remapped) */
"i\0"
"glDeleteFragmentShaderATI\0"
"\0"
- /* _mesa_function_pool[5769]: Scaled (offset 301) */
+ /* _mesa_function_pool[5798]: Scaled (offset 301) */
"ddd\0"
"glScaled\0"
"\0"
- /* _mesa_function_pool[5783]: ResumeTransformFeedback (will be remapped) */
+ /* _mesa_function_pool[5812]: ResumeTransformFeedback (will be remapped) */
"\0"
"glResumeTransformFeedback\0"
"\0"
- /* _mesa_function_pool[5811]: Scalef (offset 302) */
+ /* _mesa_function_pool[5840]: Scalef (offset 302) */
"fff\0"
"glScalef\0"
"\0"
- /* _mesa_function_pool[5825]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[5854]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */
"ppp\0"
"glTexCoord2fNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[5863]: ProgramEnvParameters4fvEXT (will be remapped) */
+ /* _mesa_function_pool[5892]: ProgramEnvParameters4fvEXT (will be remapped) */
"iiip\0"
"glProgramEnvParameters4fvEXT\0"
"\0"
- /* _mesa_function_pool[5898]: MultTransposeMatrixdARB (will be remapped) */
+ /* _mesa_function_pool[5927]: MultTransposeMatrixdARB (will be remapped) */
"p\0"
"glMultTransposeMatrixd\0"
"glMultTransposeMatrixdARB\0"
"\0"
- /* _mesa_function_pool[5950]: ColorMaskIndexedEXT (will be remapped) */
+ /* _mesa_function_pool[5979]: ColorMaskIndexedEXT (will be remapped) */
"iiiii\0"
"glColorMaskIndexedEXT\0"
"glColorMaski\0"
"\0"
- /* _mesa_function_pool[5992]: ObjectUnpurgeableAPPLE (will be remapped) */
+ /* _mesa_function_pool[6021]: ObjectUnpurgeableAPPLE (will be remapped) */
"iii\0"
"glObjectUnpurgeableAPPLE\0"
"\0"
- /* _mesa_function_pool[6022]: AlphaFunc (offset 240) */
+ /* _mesa_function_pool[6051]: AlphaFunc (offset 240) */
"if\0"
"glAlphaFunc\0"
"\0"
- /* _mesa_function_pool[6038]: WindowPos2svMESA (will be remapped) */
+ /* _mesa_function_pool[6067]: WindowPos2svMESA (will be remapped) */
"p\0"
"glWindowPos2sv\0"
"glWindowPos2svARB\0"
"glWindowPos2svMESA\0"
"\0"
- /* _mesa_function_pool[6093]: EdgeFlag (offset 41) */
+ /* _mesa_function_pool[6122]: EdgeFlag (offset 41) */
"i\0"
"glEdgeFlag\0"
"\0"
- /* _mesa_function_pool[6107]: TexCoord2iv (offset 107) */
+ /* _mesa_function_pool[6136]: TexCoord2iv (offset 107) */
"p\0"
"glTexCoord2iv\0"
"\0"
- /* _mesa_function_pool[6124]: CompressedTexImage1DARB (will be remapped) */
+ /* _mesa_function_pool[6153]: CompressedTexImage1DARB (will be remapped) */
"iiiiiip\0"
"glCompressedTexImage1D\0"
"glCompressedTexImage1DARB\0"
"\0"
- /* _mesa_function_pool[6182]: Rotated (offset 299) */
+ /* _mesa_function_pool[6211]: Rotated (offset 299) */
"dddd\0"
"glRotated\0"
"\0"
- /* _mesa_function_pool[6198]: GetTexParameterIuivEXT (will be remapped) */
+ /* _mesa_function_pool[6227]: GetTexParameterIuivEXT (will be remapped) */
"iip\0"
"glGetTexParameterIuivEXT\0"
"glGetTexParameterIuiv\0"
"\0"
- /* _mesa_function_pool[6250]: VertexAttrib2sNV (will be remapped) */
+ /* _mesa_function_pool[6279]: VertexAttrib2sNV (will be remapped) */
"iii\0"
"glVertexAttrib2sNV\0"
"\0"
- /* _mesa_function_pool[6274]: ReadPixels (offset 256) */
+ /* _mesa_function_pool[6303]: ReadPixels (offset 256) */
"iiiiiip\0"
"glReadPixels\0"
"\0"
- /* _mesa_function_pool[6296]: VertexAttribDivisorARB (will be remapped) */
+ /* _mesa_function_pool[6325]: VertexAttribDivisorARB (will be remapped) */
"ii\0"
"glVertexAttribDivisorARB\0"
"\0"
- /* _mesa_function_pool[6325]: EdgeFlagv (offset 42) */
+ /* _mesa_function_pool[6354]: EdgeFlagv (offset 42) */
"p\0"
"glEdgeFlagv\0"
"\0"
- /* _mesa_function_pool[6340]: NormalPointerListIBM (dynamic) */
+ /* _mesa_function_pool[6369]: NormalPointerListIBM (dynamic) */
"iipi\0"
"glNormalPointerListIBM\0"
"\0"
- /* _mesa_function_pool[6369]: IndexPointerEXT (will be remapped) */
+ /* _mesa_function_pool[6398]: IndexPointerEXT (will be remapped) */
"iiip\0"
"glIndexPointerEXT\0"
"\0"
- /* _mesa_function_pool[6393]: Color4iv (offset 32) */
+ /* _mesa_function_pool[6422]: Color4iv (offset 32) */
"p\0"
"glColor4iv\0"
"\0"
- /* _mesa_function_pool[6407]: TexParameterf (offset 178) */
+ /* _mesa_function_pool[6436]: TexParameterf (offset 178) */
"iif\0"
"glTexParameterf\0"
"\0"
- /* _mesa_function_pool[6428]: TexParameteri (offset 180) */
+ /* _mesa_function_pool[6457]: TexParameteri (offset 180) */
"iii\0"
"glTexParameteri\0"
"\0"
- /* _mesa_function_pool[6449]: NormalPointerEXT (will be remapped) */
+ /* _mesa_function_pool[6478]: NormalPointerEXT (will be remapped) */
"iiip\0"
"glNormalPointerEXT\0"
"\0"
- /* _mesa_function_pool[6474]: MultiTexCoord3dARB (offset 392) */
+ /* _mesa_function_pool[6503]: MultiTexCoord3dARB (offset 392) */
"iddd\0"
"glMultiTexCoord3d\0"
"glMultiTexCoord3dARB\0"
"\0"
- /* _mesa_function_pool[6519]: MultiTexCoord2iARB (offset 388) */
+ /* _mesa_function_pool[6548]: MultiTexCoord2iARB (offset 388) */
"iii\0"
"glMultiTexCoord2i\0"
"glMultiTexCoord2iARB\0"
"\0"
- /* _mesa_function_pool[6563]: DrawPixels (offset 257) */
+ /* _mesa_function_pool[6592]: DrawPixels (offset 257) */
"iiiip\0"
"glDrawPixels\0"
"\0"
- /* _mesa_function_pool[6583]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[6612]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */
"iffffffff\0"
"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[6643]: MultiTexCoord2svARB (offset 391) */
+ /* _mesa_function_pool[6672]: MultiTexCoord2svARB (offset 391) */
"ip\0"
"glMultiTexCoord2sv\0"
"glMultiTexCoord2svARB\0"
"\0"
- /* _mesa_function_pool[6688]: ReplacementCodeubvSUN (dynamic) */
+ /* _mesa_function_pool[6717]: ReplacementCodeubvSUN (dynamic) */
"p\0"
"glReplacementCodeubvSUN\0"
"\0"
- /* _mesa_function_pool[6715]: Uniform3iARB (will be remapped) */
+ /* _mesa_function_pool[6744]: Uniform3iARB (will be remapped) */
"iiii\0"
"glUniform3i\0"
"glUniform3iARB\0"
"\0"
- /* _mesa_function_pool[6748]: DrawTransformFeedback (will be remapped) */
+ /* _mesa_function_pool[6777]: DrawTransformFeedback (will be remapped) */
"ii\0"
"glDrawTransformFeedback\0"
"\0"
- /* _mesa_function_pool[6776]: DrawElementsInstancedARB (will be remapped) */
+ /* _mesa_function_pool[6805]: DrawElementsInstancedARB (will be remapped) */
"iiipi\0"
"glDrawElementsInstancedARB\0"
"glDrawElementsInstancedEXT\0"
"glDrawElementsInstanced\0"
"\0"
- /* _mesa_function_pool[6861]: GetShaderInfoLog (will be remapped) */
+ /* _mesa_function_pool[6890]: GetShaderInfoLog (will be remapped) */
"iipp\0"
"glGetShaderInfoLog\0"
"\0"
- /* _mesa_function_pool[6886]: WeightivARB (dynamic) */
+ /* _mesa_function_pool[6915]: WeightivARB (dynamic) */
"ip\0"
"glWeightivARB\0"
"\0"
- /* _mesa_function_pool[6904]: PollInstrumentsSGIX (dynamic) */
+ /* _mesa_function_pool[6933]: PollInstrumentsSGIX (dynamic) */
"p\0"
"glPollInstrumentsSGIX\0"
"\0"
- /* _mesa_function_pool[6929]: GlobalAlphaFactordSUN (dynamic) */
+ /* _mesa_function_pool[6958]: GlobalAlphaFactordSUN (dynamic) */
"d\0"
"glGlobalAlphaFactordSUN\0"
"\0"
- /* _mesa_function_pool[6956]: GetFinalCombinerInputParameterfvNV (will be remapped) */
+ /* _mesa_function_pool[6985]: GetFinalCombinerInputParameterfvNV (will be remapped) */
"iip\0"
"glGetFinalCombinerInputParameterfvNV\0"
"\0"
- /* _mesa_function_pool[6998]: GenerateMipmapEXT (will be remapped) */
+ /* _mesa_function_pool[7027]: GenerateMipmapEXT (will be remapped) */
"i\0"
"glGenerateMipmap\0"
"glGenerateMipmapEXT\0"
"\0"
- /* _mesa_function_pool[7038]: GenLists (offset 5) */
+ /* _mesa_function_pool[7067]: GenLists (offset 5) */
"i\0"
"glGenLists\0"
"\0"
- /* _mesa_function_pool[7052]: DepthRangef (will be remapped) */
+ /* _mesa_function_pool[7081]: DepthRangef (will be remapped) */
"ff\0"
"glDepthRangef\0"
"\0"
- /* _mesa_function_pool[7070]: GetMapAttribParameterivNV (dynamic) */
+ /* _mesa_function_pool[7099]: GetMapAttribParameterivNV (dynamic) */
"iiip\0"
"glGetMapAttribParameterivNV\0"
"\0"
- /* _mesa_function_pool[7104]: CreateShaderObjectARB (will be remapped) */
+ /* _mesa_function_pool[7133]: CreateShaderObjectARB (will be remapped) */
"i\0"
"glCreateShaderObjectARB\0"
"\0"
- /* _mesa_function_pool[7131]: GetSharpenTexFuncSGIS (dynamic) */
+ /* _mesa_function_pool[7160]: GetSharpenTexFuncSGIS (dynamic) */
"ip\0"
"glGetSharpenTexFuncSGIS\0"
"\0"
- /* _mesa_function_pool[7159]: BufferDataARB (will be remapped) */
+ /* _mesa_function_pool[7188]: BufferDataARB (will be remapped) */
"iipi\0"
"glBufferData\0"
"glBufferDataARB\0"
"\0"
- /* _mesa_function_pool[7194]: FlushVertexArrayRangeNV (will be remapped) */
+ /* _mesa_function_pool[7223]: FlushVertexArrayRangeNV (will be remapped) */
"\0"
"glFlushVertexArrayRangeNV\0"
"\0"
- /* _mesa_function_pool[7222]: MapGrid2d (offset 226) */
+ /* _mesa_function_pool[7251]: MapGrid2d (offset 226) */
"iddidd\0"
"glMapGrid2d\0"
"\0"
- /* _mesa_function_pool[7242]: MapGrid2f (offset 227) */
+ /* _mesa_function_pool[7271]: MapGrid2f (offset 227) */
"iffiff\0"
"glMapGrid2f\0"
"\0"
- /* _mesa_function_pool[7262]: SampleMapATI (will be remapped) */
+ /* _mesa_function_pool[7291]: SampleMapATI (will be remapped) */
"iii\0"
"glSampleMapATI\0"
"\0"
- /* _mesa_function_pool[7282]: VertexPointerEXT (will be remapped) */
+ /* _mesa_function_pool[7311]: VertexPointerEXT (will be remapped) */
"iiiip\0"
"glVertexPointerEXT\0"
"\0"
- /* _mesa_function_pool[7308]: GetTexFilterFuncSGIS (dynamic) */
+ /* _mesa_function_pool[7337]: GetTexFilterFuncSGIS (dynamic) */
"iip\0"
"glGetTexFilterFuncSGIS\0"
"\0"
- /* _mesa_function_pool[7336]: Scissor (offset 176) */
+ /* _mesa_function_pool[7365]: Scissor (offset 176) */
"iiii\0"
"glScissor\0"
"\0"
- /* _mesa_function_pool[7352]: Fogf (offset 153) */
+ /* _mesa_function_pool[7381]: Fogf (offset 153) */
"if\0"
"glFogf\0"
"\0"
- /* _mesa_function_pool[7363]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[7392]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */
"ppp\0"
"glReplacementCodeuiColor4ubVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[7408]: TexSubImage1D (offset 332) */
+ /* _mesa_function_pool[7437]: TexSubImage1D (offset 332) */
"iiiiiip\0"
"glTexSubImage1D\0"
"glTexSubImage1DEXT\0"
"\0"
- /* _mesa_function_pool[7452]: VertexAttrib1sARB (will be remapped) */
+ /* _mesa_function_pool[7481]: VertexAttrib1sARB (will be remapped) */
"ii\0"
"glVertexAttrib1s\0"
"glVertexAttrib1sARB\0"
"\0"
- /* _mesa_function_pool[7493]: FenceSync (will be remapped) */
+ /* _mesa_function_pool[7522]: FenceSync (will be remapped) */
"ii\0"
"glFenceSync\0"
"\0"
- /* _mesa_function_pool[7509]: Color4usv (offset 40) */
+ /* _mesa_function_pool[7538]: Color4usv (offset 40) */
"p\0"
"glColor4usv\0"
"\0"
- /* _mesa_function_pool[7524]: Fogi (offset 155) */
+ /* _mesa_function_pool[7553]: Fogi (offset 155) */
"ii\0"
"glFogi\0"
"\0"
- /* _mesa_function_pool[7535]: DepthRange (offset 288) */
+ /* _mesa_function_pool[7564]: DepthRange (offset 288) */
"dd\0"
"glDepthRange\0"
"\0"
- /* _mesa_function_pool[7552]: RasterPos3iv (offset 75) */
+ /* _mesa_function_pool[7581]: RasterPos3iv (offset 75) */
"p\0"
"glRasterPos3iv\0"
"\0"
- /* _mesa_function_pool[7570]: FinalCombinerInputNV (will be remapped) */
+ /* _mesa_function_pool[7599]: FinalCombinerInputNV (will be remapped) */
"iiii\0"
"glFinalCombinerInputNV\0"
"\0"
- /* _mesa_function_pool[7599]: TexCoord2i (offset 106) */
+ /* _mesa_function_pool[7628]: TexCoord2i (offset 106) */
"ii\0"
"glTexCoord2i\0"
"\0"
- /* _mesa_function_pool[7616]: PixelMapfv (offset 251) */
+ /* _mesa_function_pool[7645]: PixelMapfv (offset 251) */
"iip\0"
"glPixelMapfv\0"
"\0"
- /* _mesa_function_pool[7634]: Color4ui (offset 37) */
+ /* _mesa_function_pool[7663]: Color4ui (offset 37) */
"iiii\0"
"glColor4ui\0"
"\0"
- /* _mesa_function_pool[7651]: RasterPos3s (offset 76) */
+ /* _mesa_function_pool[7680]: RasterPos3s (offset 76) */
"iii\0"
"glRasterPos3s\0"
"\0"
- /* _mesa_function_pool[7670]: Color3usv (offset 24) */
+ /* _mesa_function_pool[7699]: Color3usv (offset 24) */
"p\0"
"glColor3usv\0"
"\0"
- /* _mesa_function_pool[7685]: FlushRasterSGIX (dynamic) */
+ /* _mesa_function_pool[7714]: FlushRasterSGIX (dynamic) */
"\0"
"glFlushRasterSGIX\0"
"\0"
- /* _mesa_function_pool[7705]: TexCoord2f (offset 104) */
+ /* _mesa_function_pool[7734]: TexCoord2f (offset 104) */
"ff\0"
"glTexCoord2f\0"
"\0"
- /* _mesa_function_pool[7722]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[7751]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */
"ifffff\0"
"glReplacementCodeuiTexCoord2fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[7771]: TexCoord2d (offset 102) */
+ /* _mesa_function_pool[7800]: TexCoord2d (offset 102) */
"dd\0"
"glTexCoord2d\0"
"\0"
- /* _mesa_function_pool[7788]: RasterPos3d (offset 70) */
+ /* _mesa_function_pool[7817]: RasterPos3d (offset 70) */
"ddd\0"
"glRasterPos3d\0"
"\0"
- /* _mesa_function_pool[7807]: RasterPos3f (offset 72) */
+ /* _mesa_function_pool[7836]: RasterPos3f (offset 72) */
"fff\0"
"glRasterPos3f\0"
"\0"
- /* _mesa_function_pool[7826]: Uniform1fARB (will be remapped) */
+ /* _mesa_function_pool[7855]: Uniform1fARB (will be remapped) */
"if\0"
"glUniform1f\0"
"glUniform1fARB\0"
"\0"
- /* _mesa_function_pool[7857]: AreTexturesResident (offset 322) */
+ /* _mesa_function_pool[7886]: AreTexturesResident (offset 322) */
"ipp\0"
"glAreTexturesResident\0"
"glAreTexturesResidentEXT\0"
"\0"
- /* _mesa_function_pool[7909]: TexCoord2s (offset 108) */
+ /* _mesa_function_pool[7938]: TexCoord2s (offset 108) */
"ii\0"
"glTexCoord2s\0"
"\0"
- /* _mesa_function_pool[7926]: StencilOpSeparate (will be remapped) */
+ /* _mesa_function_pool[7955]: StencilOpSeparate (will be remapped) */
"iiii\0"
"glStencilOpSeparate\0"
"glStencilOpSeparateATI\0"
"\0"
- /* _mesa_function_pool[7975]: ColorTableParameteriv (offset 341) */
+ /* _mesa_function_pool[8004]: ColorTableParameteriv (offset 341) */
"iip\0"
"glColorTableParameteriv\0"
"glColorTableParameterivSGI\0"
"\0"
- /* _mesa_function_pool[8031]: FogCoordPointerListIBM (dynamic) */
+ /* _mesa_function_pool[8060]: FogCoordPointerListIBM (dynamic) */
"iipi\0"
"glFogCoordPointerListIBM\0"
"\0"
- /* _mesa_function_pool[8062]: WindowPos3dMESA (will be remapped) */
+ /* _mesa_function_pool[8091]: WindowPos3dMESA (will be remapped) */
"ddd\0"
"glWindowPos3d\0"
"glWindowPos3dARB\0"
"glWindowPos3dMESA\0"
"\0"
- /* _mesa_function_pool[8116]: Color4us (offset 39) */
+ /* _mesa_function_pool[8145]: Color4us (offset 39) */
"iiii\0"
"glColor4us\0"
"\0"
- /* _mesa_function_pool[8133]: PointParameterfvEXT (will be remapped) */
+ /* _mesa_function_pool[8162]: PointParameterfvEXT (will be remapped) */
"ip\0"
"glPointParameterfv\0"
"glPointParameterfvARB\0"
"glPointParameterfvEXT\0"
"glPointParameterfvSGIS\0"
"\0"
- /* _mesa_function_pool[8223]: Color3bv (offset 10) */
+ /* _mesa_function_pool[8252]: Color3bv (offset 10) */
"p\0"
"glColor3bv\0"
"\0"
- /* _mesa_function_pool[8237]: GetnCompressedTexImageARB (will be remapped) */
+ /* _mesa_function_pool[8266]: GetnCompressedTexImageARB (will be remapped) */
"iiip\0"
"glGetnCompressedTexImageARB\0"
"\0"
- /* _mesa_function_pool[8271]: WindowPos2fvMESA (will be remapped) */
+ /* _mesa_function_pool[8300]: WindowPos2fvMESA (will be remapped) */
"p\0"
"glWindowPos2fv\0"
"glWindowPos2fvARB\0"
"glWindowPos2fvMESA\0"
"\0"
- /* _mesa_function_pool[8326]: SecondaryColor3bvEXT (will be remapped) */
+ /* _mesa_function_pool[8355]: SecondaryColor3bvEXT (will be remapped) */
"p\0"
"glSecondaryColor3bv\0"
"glSecondaryColor3bvEXT\0"
"\0"
- /* _mesa_function_pool[8372]: VertexPointerListIBM (dynamic) */
+ /* _mesa_function_pool[8401]: VertexPointerListIBM (dynamic) */
"iiipi\0"
"glVertexPointerListIBM\0"
"\0"
- /* _mesa_function_pool[8402]: GetProgramLocalParameterfvARB (will be remapped) */
+ /* _mesa_function_pool[8431]: GetProgramLocalParameterfvARB (will be remapped) */
"iip\0"
"glGetProgramLocalParameterfvARB\0"
"\0"
- /* _mesa_function_pool[8439]: FragmentMaterialfSGIX (dynamic) */
+ /* _mesa_function_pool[8468]: FragmentMaterialfSGIX (dynamic) */
"iif\0"
"glFragmentMaterialfSGIX\0"
"\0"
- /* _mesa_function_pool[8468]: BindSampler (will be remapped) */
+ /* _mesa_function_pool[8497]: BindSampler (will be remapped) */
"ii\0"
"glBindSampler\0"
"\0"
- /* _mesa_function_pool[8486]: RenderbufferStorageEXT (will be remapped) */
+ /* _mesa_function_pool[8515]: RenderbufferStorageEXT (will be remapped) */
"iiii\0"
"glRenderbufferStorage\0"
"glRenderbufferStorageEXT\0"
"\0"
- /* _mesa_function_pool[8539]: IsFenceNV (will be remapped) */
+ /* _mesa_function_pool[8568]: IsFenceNV (will be remapped) */
"i\0"
"glIsFenceNV\0"
"\0"
- /* _mesa_function_pool[8554]: AttachObjectARB (will be remapped) */
+ /* _mesa_function_pool[8583]: AttachObjectARB (will be remapped) */
"ii\0"
"glAttachObjectARB\0"
"\0"
- /* _mesa_function_pool[8576]: GetFragmentLightivSGIX (dynamic) */
+ /* _mesa_function_pool[8605]: GetFragmentLightivSGIX (dynamic) */
"iip\0"
"glGetFragmentLightivSGIX\0"
"\0"
- /* _mesa_function_pool[8606]: UniformMatrix2fvARB (will be remapped) */
+ /* _mesa_function_pool[8635]: UniformMatrix2fvARB (will be remapped) */
"iiip\0"
"glUniformMatrix2fv\0"
"glUniformMatrix2fvARB\0"
"\0"
- /* _mesa_function_pool[8653]: MultiTexCoord2fARB (offset 386) */
+ /* _mesa_function_pool[8682]: MultiTexCoord2fARB (offset 386) */
"iff\0"
"glMultiTexCoord2f\0"
"glMultiTexCoord2fARB\0"
"\0"
- /* _mesa_function_pool[8697]: ColorTable (offset 339) */
+ /* _mesa_function_pool[8726]: ColorTable (offset 339) */
"iiiiip\0"
"glColorTable\0"
"glColorTableSGI\0"
"glColorTableEXT\0"
"\0"
- /* _mesa_function_pool[8750]: IndexPointer (offset 314) */
+ /* _mesa_function_pool[8779]: IndexPointer (offset 314) */
"iip\0"
"glIndexPointer\0"
"\0"
- /* _mesa_function_pool[8770]: Accum (offset 213) */
+ /* _mesa_function_pool[8799]: Accum (offset 213) */
"if\0"
"glAccum\0"
"\0"
- /* _mesa_function_pool[8782]: GetTexImage (offset 281) */
+ /* _mesa_function_pool[8811]: GetTexImage (offset 281) */
"iiiip\0"
"glGetTexImage\0"
"\0"
- /* _mesa_function_pool[8803]: MapControlPointsNV (dynamic) */
+ /* _mesa_function_pool[8832]: MapControlPointsNV (dynamic) */
"iiiiiiiip\0"
"glMapControlPointsNV\0"
"\0"
- /* _mesa_function_pool[8835]: ConvolutionFilter2D (offset 349) */
+ /* _mesa_function_pool[8864]: ConvolutionFilter2D (offset 349) */
"iiiiiip\0"
"glConvolutionFilter2D\0"
"glConvolutionFilter2DEXT\0"
"\0"
- /* _mesa_function_pool[8891]: Finish (offset 216) */
+ /* _mesa_function_pool[8920]: Finish (offset 216) */
"\0"
"glFinish\0"
"\0"
- /* _mesa_function_pool[8902]: MapParameterfvNV (dynamic) */
+ /* _mesa_function_pool[8931]: MapParameterfvNV (dynamic) */
"iip\0"
"glMapParameterfvNV\0"
"\0"
- /* _mesa_function_pool[8926]: ClearStencil (offset 207) */
+ /* _mesa_function_pool[8955]: ClearStencil (offset 207) */
"i\0"
"glClearStencil\0"
"\0"
- /* _mesa_function_pool[8944]: VertexAttrib3dvARB (will be remapped) */
+ /* _mesa_function_pool[8973]: VertexAttrib3dvARB (will be remapped) */
"ip\0"
"glVertexAttrib3dv\0"
"glVertexAttrib3dvARB\0"
"\0"
- /* _mesa_function_pool[8987]: Uniform4uivEXT (will be remapped) */
+ /* _mesa_function_pool[9016]: Uniform4uivEXT (will be remapped) */
"iip\0"
"glUniform4uivEXT\0"
"glUniform4uiv\0"
"\0"
- /* _mesa_function_pool[9023]: HintPGI (dynamic) */
+ /* _mesa_function_pool[9052]: HintPGI (dynamic) */
"ii\0"
"glHintPGI\0"
"\0"
- /* _mesa_function_pool[9037]: ConvolutionParameteriv (offset 353) */
+ /* _mesa_function_pool[9066]: ConvolutionParameteriv (offset 353) */
"iip\0"
"glConvolutionParameteriv\0"
"glConvolutionParameterivEXT\0"
"\0"
- /* _mesa_function_pool[9095]: Color4s (offset 33) */
+ /* _mesa_function_pool[9124]: Color4s (offset 33) */
"iiii\0"
"glColor4s\0"
"\0"
- /* _mesa_function_pool[9111]: InterleavedArrays (offset 317) */
+ /* _mesa_function_pool[9140]: InterleavedArrays (offset 317) */
"iip\0"
"glInterleavedArrays\0"
"\0"
- /* _mesa_function_pool[9136]: RasterPos2fv (offset 65) */
+ /* _mesa_function_pool[9165]: RasterPos2fv (offset 65) */
"p\0"
"glRasterPos2fv\0"
"\0"
- /* _mesa_function_pool[9154]: TexCoord1fv (offset 97) */
+ /* _mesa_function_pool[9183]: TexCoord1fv (offset 97) */
"p\0"
"glTexCoord1fv\0"
"\0"
- /* _mesa_function_pool[9171]: Vertex2d (offset 126) */
+ /* _mesa_function_pool[9200]: Vertex2d (offset 126) */
"dd\0"
"glVertex2d\0"
"\0"
- /* _mesa_function_pool[9186]: CullParameterdvEXT (dynamic) */
+ /* _mesa_function_pool[9215]: CullParameterdvEXT (dynamic) */
"ip\0"
"glCullParameterdvEXT\0"
"\0"
- /* _mesa_function_pool[9211]: ProgramNamedParameter4fNV (will be remapped) */
+ /* _mesa_function_pool[9240]: ProgramNamedParameter4fNV (will be remapped) */
"iipffff\0"
"glProgramNamedParameter4fNV\0"
"\0"
- /* _mesa_function_pool[9248]: Color3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[9277]: Color3fVertex3fSUN (dynamic) */
"ffffff\0"
"glColor3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[9277]: ProgramEnvParameter4fvARB (will be remapped) */
+ /* _mesa_function_pool[9306]: ProgramEnvParameter4fvARB (will be remapped) */
"iip\0"
"glProgramEnvParameter4fvARB\0"
"glProgramParameter4fvNV\0"
"\0"
- /* _mesa_function_pool[9334]: Color4i (offset 31) */
+ /* _mesa_function_pool[9363]: Color4i (offset 31) */
"iiii\0"
"glColor4i\0"
"\0"
- /* _mesa_function_pool[9350]: Color4f (offset 29) */
+ /* _mesa_function_pool[9379]: Color4f (offset 29) */
"ffff\0"
"glColor4f\0"
"\0"
- /* _mesa_function_pool[9366]: RasterPos4fv (offset 81) */
+ /* _mesa_function_pool[9395]: RasterPos4fv (offset 81) */
"p\0"
"glRasterPos4fv\0"
"\0"
- /* _mesa_function_pool[9384]: Color4d (offset 27) */
+ /* _mesa_function_pool[9413]: Color4d (offset 27) */
"dddd\0"
"glColor4d\0"
"\0"
- /* _mesa_function_pool[9400]: ClearIndex (offset 205) */
+ /* _mesa_function_pool[9429]: ClearIndex (offset 205) */
"f\0"
"glClearIndex\0"
"\0"
- /* _mesa_function_pool[9416]: Color4b (offset 25) */
+ /* _mesa_function_pool[9445]: Color4b (offset 25) */
"iiii\0"
"glColor4b\0"
"\0"
- /* _mesa_function_pool[9432]: LoadMatrixd (offset 292) */
+ /* _mesa_function_pool[9461]: LoadMatrixd (offset 292) */
"p\0"
"glLoadMatrixd\0"
"\0"
- /* _mesa_function_pool[9449]: FragmentLightModeliSGIX (dynamic) */
+ /* _mesa_function_pool[9478]: FragmentLightModeliSGIX (dynamic) */
"ii\0"
"glFragmentLightModeliSGIX\0"
"\0"
- /* _mesa_function_pool[9479]: RasterPos2dv (offset 63) */
+ /* _mesa_function_pool[9508]: RasterPos2dv (offset 63) */
"p\0"
"glRasterPos2dv\0"
"\0"
- /* _mesa_function_pool[9497]: ConvolutionParameterfv (offset 351) */
+ /* _mesa_function_pool[9526]: ConvolutionParameterfv (offset 351) */
"iip\0"
"glConvolutionParameterfv\0"
"glConvolutionParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[9555]: TbufferMask3DFX (dynamic) */
+ /* _mesa_function_pool[9584]: TbufferMask3DFX (dynamic) */
"i\0"
"glTbufferMask3DFX\0"
"\0"
- /* _mesa_function_pool[9576]: GetTexGendv (offset 278) */
+ /* _mesa_function_pool[9605]: GetTexGendv (offset 278) */
"iip\0"
"glGetTexGendv\0"
"\0"
- /* _mesa_function_pool[9595]: GetVertexAttribfvNV (will be remapped) */
+ /* _mesa_function_pool[9624]: GetVertexAttribfvNV (will be remapped) */
"iip\0"
"glGetVertexAttribfvNV\0"
"\0"
- /* _mesa_function_pool[9622]: BeginTransformFeedbackEXT (will be remapped) */
+ /* _mesa_function_pool[9651]: BeginTransformFeedbackEXT (will be remapped) */
"i\0"
"glBeginTransformFeedbackEXT\0"
"glBeginTransformFeedback\0"
"\0"
- /* _mesa_function_pool[9678]: LoadProgramNV (will be remapped) */
+ /* _mesa_function_pool[9707]: LoadProgramNV (will be remapped) */
"iiip\0"
"glLoadProgramNV\0"
"\0"
- /* _mesa_function_pool[9700]: WaitSync (will be remapped) */
+ /* _mesa_function_pool[9729]: WaitSync (will be remapped) */
"iii\0"
"glWaitSync\0"
"\0"
- /* _mesa_function_pool[9716]: EndList (offset 1) */
+ /* _mesa_function_pool[9745]: EndList (offset 1) */
"\0"
"glEndList\0"
"\0"
- /* _mesa_function_pool[9728]: VertexAttrib4fvNV (will be remapped) */
+ /* _mesa_function_pool[9757]: VertexAttrib4fvNV (will be remapped) */
"ip\0"
"glVertexAttrib4fvNV\0"
"\0"
- /* _mesa_function_pool[9752]: GetAttachedObjectsARB (will be remapped) */
+ /* _mesa_function_pool[9781]: GetAttachedObjectsARB (will be remapped) */
"iipp\0"
"glGetAttachedObjectsARB\0"
"\0"
- /* _mesa_function_pool[9782]: Uniform3fvARB (will be remapped) */
+ /* _mesa_function_pool[9811]: Uniform3fvARB (will be remapped) */
"iip\0"
"glUniform3fv\0"
"glUniform3fvARB\0"
"\0"
- /* _mesa_function_pool[9816]: EvalCoord1fv (offset 231) */
+ /* _mesa_function_pool[9845]: EvalCoord1fv (offset 231) */
"p\0"
"glEvalCoord1fv\0"
"\0"
- /* _mesa_function_pool[9834]: DrawRangeElements (offset 338) */
+ /* _mesa_function_pool[9863]: DrawRangeElements (offset 338) */
"iiiiip\0"
"glDrawRangeElements\0"
"glDrawRangeElementsEXT\0"
"\0"
- /* _mesa_function_pool[9885]: EvalMesh2 (offset 238) */
+ /* _mesa_function_pool[9914]: EvalMesh2 (offset 238) */
"iiiii\0"
"glEvalMesh2\0"
"\0"
- /* _mesa_function_pool[9904]: Vertex4fv (offset 145) */
+ /* _mesa_function_pool[9933]: Vertex4fv (offset 145) */
"p\0"
"glVertex4fv\0"
"\0"
- /* _mesa_function_pool[9919]: GenTransformFeedbacks (will be remapped) */
+ /* _mesa_function_pool[9948]: GenTransformFeedbacks (will be remapped) */
"ip\0"
"glGenTransformFeedbacks\0"
"\0"
- /* _mesa_function_pool[9947]: SpriteParameterfvSGIX (dynamic) */
+ /* _mesa_function_pool[9976]: SpriteParameterfvSGIX (dynamic) */
"ip\0"
"glSpriteParameterfvSGIX\0"
"\0"
- /* _mesa_function_pool[9975]: CheckFramebufferStatusEXT (will be remapped) */
+ /* _mesa_function_pool[10004]: CheckFramebufferStatusEXT (will be remapped) */
"i\0"
"glCheckFramebufferStatus\0"
"glCheckFramebufferStatusEXT\0"
"\0"
- /* _mesa_function_pool[10031]: GlobalAlphaFactoruiSUN (dynamic) */
+ /* _mesa_function_pool[10060]: GlobalAlphaFactoruiSUN (dynamic) */
"i\0"
"glGlobalAlphaFactoruiSUN\0"
"\0"
- /* _mesa_function_pool[10059]: GetHandleARB (will be remapped) */
+ /* _mesa_function_pool[10088]: GetHandleARB (will be remapped) */
"i\0"
"glGetHandleARB\0"
"\0"
- /* _mesa_function_pool[10077]: GetVertexAttribivARB (will be remapped) */
+ /* _mesa_function_pool[10106]: GetVertexAttribivARB (will be remapped) */
"iip\0"
"glGetVertexAttribiv\0"
"glGetVertexAttribivARB\0"
"\0"
- /* _mesa_function_pool[10125]: BlendFunciARB (will be remapped) */
+ /* _mesa_function_pool[10154]: BlendFunciARB (will be remapped) */
"iii\0"
"glBlendFunciARB\0"
"glBlendFuncIndexedAMD\0"
"\0"
- /* _mesa_function_pool[10168]: GetnUniformivARB (will be remapped) */
+ /* _mesa_function_pool[10197]: GetnUniformivARB (will be remapped) */
"iiip\0"
"glGetnUniformivARB\0"
"\0"
- /* _mesa_function_pool[10193]: GetTexParameterIivEXT (will be remapped) */
+ /* _mesa_function_pool[10222]: GetTexParameterIivEXT (will be remapped) */
"iip\0"
"glGetTexParameterIivEXT\0"
"glGetTexParameterIiv\0"
"\0"
- /* _mesa_function_pool[10243]: CreateProgram (will be remapped) */
+ /* _mesa_function_pool[10272]: CreateProgram (will be remapped) */
"\0"
"glCreateProgram\0"
"\0"
- /* _mesa_function_pool[10261]: LoadTransposeMatrixdARB (will be remapped) */
+ /* _mesa_function_pool[10290]: LoadTransposeMatrixdARB (will be remapped) */
"p\0"
"glLoadTransposeMatrixd\0"
"glLoadTransposeMatrixdARB\0"
"\0"
- /* _mesa_function_pool[10313]: ReleaseShaderCompiler (will be remapped) */
+ /* _mesa_function_pool[10342]: ReleaseShaderCompiler (will be remapped) */
"\0"
"glReleaseShaderCompiler\0"
"\0"
- /* _mesa_function_pool[10339]: GetMinmax (offset 364) */
+ /* _mesa_function_pool[10368]: GetMinmax (offset 364) */
"iiiip\0"
"glGetMinmax\0"
"glGetMinmaxEXT\0"
"\0"
- /* _mesa_function_pool[10373]: StencilFuncSeparate (will be remapped) */
+ /* _mesa_function_pool[10402]: StencilFuncSeparate (will be remapped) */
"iiii\0"
"glStencilFuncSeparate\0"
"\0"
- /* _mesa_function_pool[10401]: SecondaryColor3sEXT (will be remapped) */
+ /* _mesa_function_pool[10430]: SecondaryColor3sEXT (will be remapped) */
"iii\0"
"glSecondaryColor3s\0"
"glSecondaryColor3sEXT\0"
"\0"
- /* _mesa_function_pool[10447]: Color3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[10476]: Color3fVertex3fvSUN (dynamic) */
"pp\0"
"glColor3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[10473]: GetInteger64i_v (will be remapped) */
+ /* _mesa_function_pool[10502]: GetInteger64i_v (will be remapped) */
"iip\0"
"glGetInteger64i_v\0"
"\0"
- /* _mesa_function_pool[10496]: GetVertexAttribdvNV (will be remapped) */
+ /* _mesa_function_pool[10525]: GetVertexAttribdvNV (will be remapped) */
"iip\0"
"glGetVertexAttribdvNV\0"
"\0"
- /* _mesa_function_pool[10523]: Normal3fv (offset 57) */
+ /* _mesa_function_pool[10552]: Normal3fv (offset 57) */
"p\0"
"glNormal3fv\0"
"\0"
- /* _mesa_function_pool[10538]: GlobalAlphaFactorbSUN (dynamic) */
+ /* _mesa_function_pool[10567]: GlobalAlphaFactorbSUN (dynamic) */
"i\0"
"glGlobalAlphaFactorbSUN\0"
"\0"
- /* _mesa_function_pool[10565]: Color3us (offset 23) */
+ /* _mesa_function_pool[10594]: Color3us (offset 23) */
"iii\0"
"glColor3us\0"
"\0"
- /* _mesa_function_pool[10581]: ImageTransformParameterfvHP (dynamic) */
+ /* _mesa_function_pool[10610]: ImageTransformParameterfvHP (dynamic) */
"iip\0"
"glImageTransformParameterfvHP\0"
"\0"
- /* _mesa_function_pool[10616]: VertexAttrib4ivARB (will be remapped) */
+ /* _mesa_function_pool[10645]: VertexAttrib4ivARB (will be remapped) */
"ip\0"
"glVertexAttrib4iv\0"
"glVertexAttrib4ivARB\0"
"\0"
- /* _mesa_function_pool[10659]: End (offset 43) */
+ /* _mesa_function_pool[10688]: End (offset 43) */
"\0"
"glEnd\0"
"\0"
- /* _mesa_function_pool[10667]: VertexAttrib3fNV (will be remapped) */
+ /* _mesa_function_pool[10696]: VertexAttrib3fNV (will be remapped) */
"ifff\0"
"glVertexAttrib3fNV\0"
"\0"
- /* _mesa_function_pool[10692]: VertexAttribs2dvNV (will be remapped) */
+ /* _mesa_function_pool[10721]: VertexAttribs2dvNV (will be remapped) */
"iip\0"
"glVertexAttribs2dvNV\0"
"\0"
- /* _mesa_function_pool[10718]: GetQueryObjectui64vEXT (will be remapped) */
+ /* _mesa_function_pool[10747]: GetQueryObjectui64vEXT (will be remapped) */
"iip\0"
"glGetQueryObjectui64vEXT\0"
"\0"
- /* _mesa_function_pool[10748]: MultiTexCoord3fvARB (offset 395) */
+ /* _mesa_function_pool[10777]: MultiTexCoord3fvARB (offset 395) */
"ip\0"
"glMultiTexCoord3fv\0"
"glMultiTexCoord3fvARB\0"
"\0"
- /* _mesa_function_pool[10793]: SecondaryColor3dEXT (will be remapped) */
+ /* _mesa_function_pool[10822]: SecondaryColor3dEXT (will be remapped) */
"ddd\0"
"glSecondaryColor3d\0"
"glSecondaryColor3dEXT\0"
"\0"
- /* _mesa_function_pool[10839]: Color3ub (offset 19) */
+ /* _mesa_function_pool[10868]: Color3ub (offset 19) */
"iii\0"
"glColor3ub\0"
"\0"
- /* _mesa_function_pool[10855]: GetProgramParameterfvNV (will be remapped) */
+ /* _mesa_function_pool[10884]: GetProgramParameterfvNV (will be remapped) */
"iiip\0"
"glGetProgramParameterfvNV\0"
"\0"
- /* _mesa_function_pool[10887]: TangentPointerEXT (dynamic) */
+ /* _mesa_function_pool[10916]: TangentPointerEXT (dynamic) */
"iip\0"
"glTangentPointerEXT\0"
"\0"
- /* _mesa_function_pool[10912]: Color4fNormal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[10941]: Color4fNormal3fVertex3fvSUN (dynamic) */
"ppp\0"
"glColor4fNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[10947]: GetInstrumentsSGIX (dynamic) */
+ /* _mesa_function_pool[10976]: GetInstrumentsSGIX (dynamic) */
"\0"
"glGetInstrumentsSGIX\0"
"\0"
- /* _mesa_function_pool[10970]: GetUniformuivEXT (will be remapped) */
+ /* _mesa_function_pool[10999]: GetUniformuivEXT (will be remapped) */
"iip\0"
"glGetUniformuivEXT\0"
"glGetUniformuiv\0"
"\0"
- /* _mesa_function_pool[11010]: Color3ui (offset 21) */
+ /* _mesa_function_pool[11039]: Color3ui (offset 21) */
"iii\0"
"glColor3ui\0"
"\0"
- /* _mesa_function_pool[11026]: EvalMapsNV (dynamic) */
+ /* _mesa_function_pool[11055]: EvalMapsNV (dynamic) */
"ii\0"
"glEvalMapsNV\0"
"\0"
- /* _mesa_function_pool[11043]: TexSubImage2D (offset 333) */
+ /* _mesa_function_pool[11072]: TexSubImage2D (offset 333) */
"iiiiiiiip\0"
"glTexSubImage2D\0"
"glTexSubImage2DEXT\0"
"\0"
- /* _mesa_function_pool[11089]: FragmentLightivSGIX (dynamic) */
+ /* _mesa_function_pool[11118]: FragmentLightivSGIX (dynamic) */
"iip\0"
"glFragmentLightivSGIX\0"
"\0"
- /* _mesa_function_pool[11116]: GetTexParameterPointervAPPLE (will be remapped) */
+ /* _mesa_function_pool[11145]: GetTexParameterPointervAPPLE (will be remapped) */
"iip\0"
"glGetTexParameterPointervAPPLE\0"
"\0"
- /* _mesa_function_pool[11152]: TexGenfv (offset 191) */
+ /* _mesa_function_pool[11181]: TexGenfv (offset 191) */
"iip\0"
"glTexGenfv\0"
"\0"
- /* _mesa_function_pool[11168]: GetTransformFeedbackVaryingEXT (will be remapped) */
+ /* _mesa_function_pool[11197]: GetTransformFeedbackVaryingEXT (will be remapped) */
"iiipppp\0"
"glGetTransformFeedbackVaryingEXT\0"
"glGetTransformFeedbackVarying\0"
"\0"
- /* _mesa_function_pool[11240]: VertexAttrib4bvARB (will be remapped) */
+ /* _mesa_function_pool[11269]: VertexAttrib4bvARB (will be remapped) */
"ip\0"
"glVertexAttrib4bv\0"
"glVertexAttrib4bvARB\0"
"\0"
- /* _mesa_function_pool[11283]: ShaderBinary (will be remapped) */
+ /* _mesa_function_pool[11312]: ShaderBinary (will be remapped) */
"ipipi\0"
"glShaderBinary\0"
"\0"
- /* _mesa_function_pool[11305]: GetIntegerIndexedvEXT (will be remapped) */
+ /* _mesa_function_pool[11334]: GetIntegerIndexedvEXT (will be remapped) */
"iip\0"
"glGetIntegerIndexedvEXT\0"
"glGetIntegeri_v\0"
"\0"
- /* _mesa_function_pool[11350]: MultiTexCoord4sARB (offset 406) */
+ /* _mesa_function_pool[11379]: MultiTexCoord4sARB (offset 406) */
"iiiii\0"
"glMultiTexCoord4s\0"
"glMultiTexCoord4sARB\0"
"\0"
- /* _mesa_function_pool[11396]: GetFragmentMaterialivSGIX (dynamic) */
+ /* _mesa_function_pool[11425]: GetFragmentMaterialivSGIX (dynamic) */
"iip\0"
"glGetFragmentMaterialivSGIX\0"
"\0"
- /* _mesa_function_pool[11429]: WindowPos4dMESA (will be remapped) */
+ /* _mesa_function_pool[11458]: WindowPos4dMESA (will be remapped) */
"dddd\0"
"glWindowPos4dMESA\0"
"\0"
- /* _mesa_function_pool[11453]: WeightPointerARB (dynamic) */
+ /* _mesa_function_pool[11482]: WeightPointerARB (dynamic) */
"iiip\0"
"glWeightPointerARB\0"
"\0"
- /* _mesa_function_pool[11478]: WindowPos2dMESA (will be remapped) */
+ /* _mesa_function_pool[11507]: WindowPos2dMESA (will be remapped) */
"dd\0"
"glWindowPos2d\0"
"glWindowPos2dARB\0"
"glWindowPos2dMESA\0"
"\0"
- /* _mesa_function_pool[11531]: FramebufferTexture3DEXT (will be remapped) */
+ /* _mesa_function_pool[11560]: FramebufferTexture3DEXT (will be remapped) */
"iiiiii\0"
"glFramebufferTexture3D\0"
"glFramebufferTexture3DEXT\0"
"\0"
- /* _mesa_function_pool[11588]: BlendEquation (offset 337) */
+ /* _mesa_function_pool[11617]: BlendEquation (offset 337) */
"i\0"
"glBlendEquation\0"
"glBlendEquationEXT\0"
"\0"
- /* _mesa_function_pool[11626]: VertexAttrib3dNV (will be remapped) */
+ /* _mesa_function_pool[11655]: VertexAttrib3dNV (will be remapped) */
"iddd\0"
"glVertexAttrib3dNV\0"
"\0"
- /* _mesa_function_pool[11651]: VertexAttrib3dARB (will be remapped) */
+ /* _mesa_function_pool[11680]: VertexAttrib3dARB (will be remapped) */
"iddd\0"
"glVertexAttrib3d\0"
"glVertexAttrib3dARB\0"
"\0"
- /* _mesa_function_pool[11694]: VertexAttribI4usvEXT (will be remapped) */
+ /* _mesa_function_pool[11723]: VertexAttribI4usvEXT (will be remapped) */
"ip\0"
"glVertexAttribI4usvEXT\0"
"glVertexAttribI4usv\0"
"\0"
- /* _mesa_function_pool[11741]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[11770]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
"ppppp\0"
"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[11805]: VertexAttrib4fARB (will be remapped) */
+ /* _mesa_function_pool[11834]: VertexAttrib4fARB (will be remapped) */
"iffff\0"
"glVertexAttrib4f\0"
"glVertexAttrib4fARB\0"
"\0"
- /* _mesa_function_pool[11849]: GetError (offset 261) */
+ /* _mesa_function_pool[11878]: GetError (offset 261) */
"\0"
"glGetError\0"
"\0"
- /* _mesa_function_pool[11862]: IndexFuncEXT (dynamic) */
+ /* _mesa_function_pool[11891]: IndexFuncEXT (dynamic) */
"if\0"
"glIndexFuncEXT\0"
"\0"
- /* _mesa_function_pool[11881]: TexCoord3dv (offset 111) */
+ /* _mesa_function_pool[11910]: TexCoord3dv (offset 111) */
"p\0"
"glTexCoord3dv\0"
"\0"
- /* _mesa_function_pool[11898]: Indexdv (offset 45) */
+ /* _mesa_function_pool[11927]: Indexdv (offset 45) */
"p\0"
"glIndexdv\0"
"\0"
- /* _mesa_function_pool[11911]: FramebufferTexture2DEXT (will be remapped) */
+ /* _mesa_function_pool[11940]: FramebufferTexture2DEXT (will be remapped) */
"iiiii\0"
"glFramebufferTexture2D\0"
"glFramebufferTexture2DEXT\0"
"\0"
- /* _mesa_function_pool[11967]: Normal3s (offset 60) */
+ /* _mesa_function_pool[11996]: Normal3s (offset 60) */
"iii\0"
"glNormal3s\0"
"\0"
- /* _mesa_function_pool[11983]: GetObjectParameterivAPPLE (will be remapped) */
+ /* _mesa_function_pool[12012]: GetObjectParameterivAPPLE (will be remapped) */
"iiip\0"
"glGetObjectParameterivAPPLE\0"
"\0"
- /* _mesa_function_pool[12017]: PushName (offset 201) */
+ /* _mesa_function_pool[12046]: PushName (offset 201) */
"i\0"
"glPushName\0"
"\0"
- /* _mesa_function_pool[12031]: MultiTexCoord2dvARB (offset 385) */
+ /* _mesa_function_pool[12060]: MultiTexCoord2dvARB (offset 385) */
"ip\0"
"glMultiTexCoord2dv\0"
"glMultiTexCoord2dvARB\0"
"\0"
- /* _mesa_function_pool[12076]: CullParameterfvEXT (dynamic) */
+ /* _mesa_function_pool[12105]: CullParameterfvEXT (dynamic) */
"ip\0"
"glCullParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[12101]: Normal3i (offset 58) */
+ /* _mesa_function_pool[12130]: Normal3i (offset 58) */
"iii\0"
"glNormal3i\0"
"\0"
- /* _mesa_function_pool[12117]: ProgramNamedParameter4fvNV (will be remapped) */
+ /* _mesa_function_pool[12146]: ProgramNamedParameter4fvNV (will be remapped) */
"iipp\0"
"glProgramNamedParameter4fvNV\0"
"\0"
- /* _mesa_function_pool[12152]: SecondaryColorPointerEXT (will be remapped) */
+ /* _mesa_function_pool[12181]: SecondaryColorPointerEXT (will be remapped) */
"iiip\0"
"glSecondaryColorPointer\0"
"glSecondaryColorPointerEXT\0"
"\0"
- /* _mesa_function_pool[12209]: VertexAttrib4fvARB (will be remapped) */
+ /* _mesa_function_pool[12238]: VertexAttrib4fvARB (will be remapped) */
"ip\0"
"glVertexAttrib4fv\0"
"glVertexAttrib4fvARB\0"
"\0"
- /* _mesa_function_pool[12252]: PixelTexGenSGIX (will be remapped) */
+ /* _mesa_function_pool[12281]: PixelTexGenSGIX (will be remapped) */
"i\0"
"glPixelTexGenSGIX\0"
"\0"
- /* _mesa_function_pool[12273]: GetActiveUniformARB (will be remapped) */
+ /* _mesa_function_pool[12302]: GetActiveUniformARB (will be remapped) */
"iiipppp\0"
"glGetActiveUniform\0"
"glGetActiveUniformARB\0"
"\0"
- /* _mesa_function_pool[12323]: ImageTransformParameteriHP (dynamic) */
+ /* _mesa_function_pool[12352]: ImageTransformParameteriHP (dynamic) */
"iii\0"
"glImageTransformParameteriHP\0"
"\0"
- /* _mesa_function_pool[12357]: Normal3b (offset 52) */
+ /* _mesa_function_pool[12386]: Normal3b (offset 52) */
"iii\0"
"glNormal3b\0"
"\0"
- /* _mesa_function_pool[12373]: Normal3d (offset 54) */
+ /* _mesa_function_pool[12402]: Normal3d (offset 54) */
"ddd\0"
"glNormal3d\0"
"\0"
- /* _mesa_function_pool[12389]: Uniform1uiEXT (will be remapped) */
+ /* _mesa_function_pool[12418]: Uniform1uiEXT (will be remapped) */
"ii\0"
"glUniform1uiEXT\0"
"glUniform1ui\0"
"\0"
- /* _mesa_function_pool[12422]: Normal3f (offset 56) */
+ /* _mesa_function_pool[12451]: Normal3f (offset 56) */
"fff\0"
"glNormal3f\0"
"\0"
- /* _mesa_function_pool[12438]: MultiTexCoord1svARB (offset 383) */
+ /* _mesa_function_pool[12467]: MultiTexCoord1svARB (offset 383) */
"ip\0"
"glMultiTexCoord1sv\0"
"glMultiTexCoord1svARB\0"
"\0"
- /* _mesa_function_pool[12483]: Indexi (offset 48) */
+ /* _mesa_function_pool[12512]: Indexi (offset 48) */
"i\0"
"glIndexi\0"
"\0"
- /* _mesa_function_pool[12495]: EGLImageTargetTexture2DOES (will be remapped) */
+ /* _mesa_function_pool[12524]: EGLImageTargetTexture2DOES (will be remapped) */
"ip\0"
"glEGLImageTargetTexture2DOES\0"
"\0"
- /* _mesa_function_pool[12528]: EndQueryARB (will be remapped) */
+ /* _mesa_function_pool[12557]: EndQueryARB (will be remapped) */
"i\0"
"glEndQuery\0"
"glEndQueryARB\0"
"\0"
- /* _mesa_function_pool[12556]: DeleteFencesNV (will be remapped) */
+ /* _mesa_function_pool[12585]: DeleteFencesNV (will be remapped) */
"ip\0"
"glDeleteFencesNV\0"
"\0"
- /* _mesa_function_pool[12577]: ColorPointerListIBM (dynamic) */
+ /* _mesa_function_pool[12606]: ColorPointerListIBM (dynamic) */
"iiipi\0"
"glColorPointerListIBM\0"
"\0"
- /* _mesa_function_pool[12606]: BindBufferRangeEXT (will be remapped) */
+ /* _mesa_function_pool[12635]: BindBufferRangeEXT (will be remapped) */
"iiiii\0"
"glBindBufferRangeEXT\0"
"glBindBufferRange\0"
"\0"
- /* _mesa_function_pool[12652]: DepthMask (offset 211) */
+ /* _mesa_function_pool[12681]: DepthMask (offset 211) */
"i\0"
"glDepthMask\0"
"\0"
- /* _mesa_function_pool[12667]: IsShader (will be remapped) */
+ /* _mesa_function_pool[12696]: IsShader (will be remapped) */
"i\0"
"glIsShader\0"
"\0"
- /* _mesa_function_pool[12681]: Indexf (offset 46) */
+ /* _mesa_function_pool[12710]: Indexf (offset 46) */
"f\0"
"glIndexf\0"
"\0"
- /* _mesa_function_pool[12693]: GetImageTransformParameterivHP (dynamic) */
+ /* _mesa_function_pool[12722]: GetImageTransformParameterivHP (dynamic) */
"iip\0"
"glGetImageTransformParameterivHP\0"
"\0"
- /* _mesa_function_pool[12731]: Indexd (offset 44) */
+ /* _mesa_function_pool[12760]: Indexd (offset 44) */
"d\0"
"glIndexd\0"
"\0"
- /* _mesa_function_pool[12743]: GetMaterialiv (offset 270) */
+ /* _mesa_function_pool[12772]: GetMaterialiv (offset 270) */
"iip\0"
"glGetMaterialiv\0"
"\0"
- /* _mesa_function_pool[12764]: StencilOp (offset 244) */
+ /* _mesa_function_pool[12793]: StencilOp (offset 244) */
"iii\0"
"glStencilOp\0"
"\0"
- /* _mesa_function_pool[12781]: WindowPos4ivMESA (will be remapped) */
+ /* _mesa_function_pool[12810]: WindowPos4ivMESA (will be remapped) */
"p\0"
"glWindowPos4ivMESA\0"
"\0"
- /* _mesa_function_pool[12803]: FramebufferTextureLayer (dynamic) */
- "iiiii\0"
- "glFramebufferTextureLayerARB\0"
- "\0"
- /* _mesa_function_pool[12839]: MultiTexCoord3svARB (offset 399) */
+ /* _mesa_function_pool[12832]: MultiTexCoord3svARB (offset 399) */
"ip\0"
"glMultiTexCoord3sv\0"
"glMultiTexCoord3svARB\0"
"\0"
- /* _mesa_function_pool[12884]: TexEnvfv (offset 185) */
+ /* _mesa_function_pool[12877]: TexEnvfv (offset 185) */
"iip\0"
"glTexEnvfv\0"
"\0"
- /* _mesa_function_pool[12900]: MultiTexCoord4iARB (offset 404) */
+ /* _mesa_function_pool[12893]: MultiTexCoord4iARB (offset 404) */
"iiiii\0"
"glMultiTexCoord4i\0"
"glMultiTexCoord4iARB\0"
"\0"
- /* _mesa_function_pool[12946]: Indexs (offset 50) */
+ /* _mesa_function_pool[12939]: Indexs (offset 50) */
"i\0"
"glIndexs\0"
"\0"
- /* _mesa_function_pool[12958]: Binormal3ivEXT (dynamic) */
+ /* _mesa_function_pool[12951]: Binormal3ivEXT (dynamic) */
"p\0"
"glBinormal3ivEXT\0"
"\0"
- /* _mesa_function_pool[12978]: ResizeBuffersMESA (will be remapped) */
+ /* _mesa_function_pool[12971]: ResizeBuffersMESA (will be remapped) */
"\0"
"glResizeBuffersMESA\0"
"\0"
- /* _mesa_function_pool[13000]: BlendFuncSeparateiARB (will be remapped) */
+ /* _mesa_function_pool[12993]: BlendFuncSeparateiARB (will be remapped) */
"iiiii\0"
"glBlendFuncSeparateiARB\0"
"glBlendFuncSeparateIndexedAMD\0"
"\0"
- /* _mesa_function_pool[13061]: GetUniformivARB (will be remapped) */
+ /* _mesa_function_pool[13054]: GetUniformivARB (will be remapped) */
"iip\0"
"glGetUniformiv\0"
"glGetUniformivARB\0"
"\0"
- /* _mesa_function_pool[13099]: PixelTexGenParameteriSGIS (will be remapped) */
+ /* _mesa_function_pool[13092]: PixelTexGenParameteriSGIS (will be remapped) */
"ii\0"
"glPixelTexGenParameteriSGIS\0"
"\0"
- /* _mesa_function_pool[13131]: VertexPointervINTEL (dynamic) */
+ /* _mesa_function_pool[13124]: VertexPointervINTEL (dynamic) */
"iip\0"
"glVertexPointervINTEL\0"
"\0"
- /* _mesa_function_pool[13158]: Vertex2i (offset 130) */
+ /* _mesa_function_pool[13151]: Vertex2i (offset 130) */
"ii\0"
"glVertex2i\0"
"\0"
- /* _mesa_function_pool[13173]: LoadMatrixf (offset 291) */
+ /* _mesa_function_pool[13166]: LoadMatrixf (offset 291) */
"p\0"
"glLoadMatrixf\0"
"\0"
- /* _mesa_function_pool[13190]: VertexAttribI1uivEXT (will be remapped) */
+ /* _mesa_function_pool[13183]: VertexAttribI1uivEXT (will be remapped) */
"ip\0"
"glVertexAttribI1uivEXT\0"
"glVertexAttribI1uiv\0"
"\0"
- /* _mesa_function_pool[13237]: Vertex2f (offset 128) */
+ /* _mesa_function_pool[13230]: Vertex2f (offset 128) */
"ff\0"
"glVertex2f\0"
"\0"
- /* _mesa_function_pool[13252]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[13245]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */
"pppp\0"
"glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[13305]: Color4bv (offset 26) */
+ /* _mesa_function_pool[13298]: Color4bv (offset 26) */
"p\0"
"glColor4bv\0"
"\0"
- /* _mesa_function_pool[13319]: VertexPointer (offset 321) */
+ /* _mesa_function_pool[13312]: VertexPointer (offset 321) */
"iiip\0"
"glVertexPointer\0"
"\0"
- /* _mesa_function_pool[13341]: SecondaryColor3uiEXT (will be remapped) */
+ /* _mesa_function_pool[13334]: SecondaryColor3uiEXT (will be remapped) */
"iii\0"
"glSecondaryColor3ui\0"
"glSecondaryColor3uiEXT\0"
"\0"
- /* _mesa_function_pool[13389]: StartInstrumentsSGIX (dynamic) */
+ /* _mesa_function_pool[13382]: StartInstrumentsSGIX (dynamic) */
"\0"
"glStartInstrumentsSGIX\0"
"\0"
- /* _mesa_function_pool[13414]: SecondaryColor3usvEXT (will be remapped) */
+ /* _mesa_function_pool[13407]: SecondaryColor3usvEXT (will be remapped) */
"p\0"
"glSecondaryColor3usv\0"
"glSecondaryColor3usvEXT\0"
"\0"
- /* _mesa_function_pool[13462]: VertexAttrib2fvNV (will be remapped) */
+ /* _mesa_function_pool[13455]: VertexAttrib2fvNV (will be remapped) */
"ip\0"
"glVertexAttrib2fvNV\0"
"\0"
- /* _mesa_function_pool[13486]: ProgramLocalParameter4dvARB (will be remapped) */
+ /* _mesa_function_pool[13479]: ProgramLocalParameter4dvARB (will be remapped) */
"iip\0"
"glProgramLocalParameter4dvARB\0"
"\0"
- /* _mesa_function_pool[13521]: DeleteLists (offset 4) */
+ /* _mesa_function_pool[13514]: DeleteLists (offset 4) */
"ii\0"
"glDeleteLists\0"
"\0"
- /* _mesa_function_pool[13539]: LogicOp (offset 242) */
+ /* _mesa_function_pool[13532]: LogicOp (offset 242) */
"i\0"
"glLogicOp\0"
"\0"
- /* _mesa_function_pool[13552]: MatrixIndexuivARB (dynamic) */
+ /* _mesa_function_pool[13545]: MatrixIndexuivARB (dynamic) */
"ip\0"
"glMatrixIndexuivARB\0"
"\0"
- /* _mesa_function_pool[13576]: Vertex2s (offset 132) */
+ /* _mesa_function_pool[13569]: Vertex2s (offset 132) */
"ii\0"
"glVertex2s\0"
"\0"
- /* _mesa_function_pool[13591]: RenderbufferStorageMultisample (will be remapped) */
+ /* _mesa_function_pool[13584]: RenderbufferStorageMultisample (will be remapped) */
"iiiii\0"
"glRenderbufferStorageMultisample\0"
"glRenderbufferStorageMultisampleEXT\0"
"\0"
- /* _mesa_function_pool[13667]: TexCoord4fv (offset 121) */
+ /* _mesa_function_pool[13660]: TexCoord4fv (offset 121) */
"p\0"
"glTexCoord4fv\0"
"\0"
- /* _mesa_function_pool[13684]: Tangent3sEXT (dynamic) */
+ /* _mesa_function_pool[13677]: Tangent3sEXT (dynamic) */
"iii\0"
"glTangent3sEXT\0"
"\0"
- /* _mesa_function_pool[13704]: GlobalAlphaFactorfSUN (dynamic) */
+ /* _mesa_function_pool[13697]: GlobalAlphaFactorfSUN (dynamic) */
"f\0"
"glGlobalAlphaFactorfSUN\0"
"\0"
- /* _mesa_function_pool[13731]: MultiTexCoord3iARB (offset 396) */
+ /* _mesa_function_pool[13724]: MultiTexCoord3iARB (offset 396) */
"iiii\0"
"glMultiTexCoord3i\0"
"glMultiTexCoord3iARB\0"
"\0"
- /* _mesa_function_pool[13776]: IsProgram (will be remapped) */
+ /* _mesa_function_pool[13769]: IsProgram (will be remapped) */
"i\0"
"glIsProgram\0"
"\0"
- /* _mesa_function_pool[13791]: TexCoordPointerListIBM (dynamic) */
+ /* _mesa_function_pool[13784]: TexCoordPointerListIBM (dynamic) */
"iiipi\0"
"glTexCoordPointerListIBM\0"
"\0"
- /* _mesa_function_pool[13823]: VertexAttribI4svEXT (will be remapped) */
+ /* _mesa_function_pool[13816]: VertexAttribI4svEXT (will be remapped) */
"ip\0"
"glVertexAttribI4svEXT\0"
"glVertexAttribI4sv\0"
"\0"
- /* _mesa_function_pool[13868]: GlobalAlphaFactorusSUN (dynamic) */
+ /* _mesa_function_pool[13861]: GlobalAlphaFactorusSUN (dynamic) */
"i\0"
"glGlobalAlphaFactorusSUN\0"
"\0"
- /* _mesa_function_pool[13896]: VertexAttrib2dvNV (will be remapped) */
+ /* _mesa_function_pool[13889]: VertexAttrib2dvNV (will be remapped) */
"ip\0"
"glVertexAttrib2dvNV\0"
"\0"
- /* _mesa_function_pool[13920]: FramebufferRenderbufferEXT (will be remapped) */
+ /* _mesa_function_pool[13913]: FramebufferRenderbufferEXT (will be remapped) */
"iiii\0"
"glFramebufferRenderbuffer\0"
"glFramebufferRenderbufferEXT\0"
"\0"
- /* _mesa_function_pool[13981]: ClearBufferuiv (will be remapped) */
+ /* _mesa_function_pool[13974]: ClearBufferuiv (will be remapped) */
"iip\0"
"glClearBufferuiv\0"
"\0"
- /* _mesa_function_pool[14003]: VertexAttrib1dvNV (will be remapped) */
+ /* _mesa_function_pool[13996]: VertexAttrib1dvNV (will be remapped) */
"ip\0"
"glVertexAttrib1dvNV\0"
"\0"
- /* _mesa_function_pool[14027]: GenTextures (offset 328) */
+ /* _mesa_function_pool[14020]: GenTextures (offset 328) */
"ip\0"
"glGenTextures\0"
"glGenTexturesEXT\0"
"\0"
- /* _mesa_function_pool[14062]: FramebufferTextureARB (will be remapped) */
+ /* _mesa_function_pool[14055]: FramebufferTextureARB (will be remapped) */
"iiii\0"
"glFramebufferTextureARB\0"
"\0"
- /* _mesa_function_pool[14092]: SetFenceNV (will be remapped) */
+ /* _mesa_function_pool[14085]: SetFenceNV (will be remapped) */
"ii\0"
"glSetFenceNV\0"
"\0"
- /* _mesa_function_pool[14109]: FramebufferTexture1DEXT (will be remapped) */
+ /* _mesa_function_pool[14102]: FramebufferTexture1DEXT (will be remapped) */
"iiiii\0"
"glFramebufferTexture1D\0"
"glFramebufferTexture1DEXT\0"
"\0"
- /* _mesa_function_pool[14165]: GetCombinerOutputParameterivNV (will be remapped) */
+ /* _mesa_function_pool[14158]: GetCombinerOutputParameterivNV (will be remapped) */
"iiip\0"
"glGetCombinerOutputParameterivNV\0"
"\0"
- /* _mesa_function_pool[14204]: MultiModeDrawArraysIBM (will be remapped) */
+ /* _mesa_function_pool[14197]: MultiModeDrawArraysIBM (will be remapped) */
"pppii\0"
"glMultiModeDrawArraysIBM\0"
"\0"
- /* _mesa_function_pool[14236]: PixelTexGenParameterivSGIS (will be remapped) */
+ /* _mesa_function_pool[14229]: PixelTexGenParameterivSGIS (will be remapped) */
"ip\0"
"glPixelTexGenParameterivSGIS\0"
"\0"
- /* _mesa_function_pool[14269]: TextureNormalEXT (dynamic) */
+ /* _mesa_function_pool[14262]: TextureNormalEXT (dynamic) */
"i\0"
"glTextureNormalEXT\0"
"\0"
- /* _mesa_function_pool[14291]: IndexPointerListIBM (dynamic) */
+ /* _mesa_function_pool[14284]: IndexPointerListIBM (dynamic) */
"iipi\0"
"glIndexPointerListIBM\0"
"\0"
- /* _mesa_function_pool[14319]: WeightfvARB (dynamic) */
+ /* _mesa_function_pool[14312]: WeightfvARB (dynamic) */
"ip\0"
"glWeightfvARB\0"
"\0"
- /* _mesa_function_pool[14337]: GetCombinerOutputParameterfvNV (will be remapped) */
+ /* _mesa_function_pool[14330]: GetCombinerOutputParameterfvNV (will be remapped) */
"iiip\0"
"glGetCombinerOutputParameterfvNV\0"
"\0"
- /* _mesa_function_pool[14376]: RasterPos2sv (offset 69) */
+ /* _mesa_function_pool[14369]: RasterPos2sv (offset 69) */
"p\0"
"glRasterPos2sv\0"
"\0"
- /* _mesa_function_pool[14394]: Color4ubv (offset 36) */
+ /* _mesa_function_pool[14387]: Color4ubv (offset 36) */
"p\0"
"glColor4ubv\0"
"\0"
- /* _mesa_function_pool[14409]: DrawBuffer (offset 202) */
+ /* _mesa_function_pool[14402]: DrawBuffer (offset 202) */
"i\0"
"glDrawBuffer\0"
"\0"
- /* _mesa_function_pool[14425]: TexCoord2fv (offset 105) */
+ /* _mesa_function_pool[14418]: TexCoord2fv (offset 105) */
"p\0"
"glTexCoord2fv\0"
"\0"
- /* _mesa_function_pool[14442]: WindowPos4fMESA (will be remapped) */
+ /* _mesa_function_pool[14435]: WindowPos4fMESA (will be remapped) */
"ffff\0"
"glWindowPos4fMESA\0"
"\0"
- /* _mesa_function_pool[14466]: TexCoord1sv (offset 101) */
+ /* _mesa_function_pool[14459]: TexCoord1sv (offset 101) */
"p\0"
"glTexCoord1sv\0"
"\0"
- /* _mesa_function_pool[14483]: WindowPos3dvMESA (will be remapped) */
+ /* _mesa_function_pool[14476]: WindowPos3dvMESA (will be remapped) */
"p\0"
"glWindowPos3dv\0"
"glWindowPos3dvARB\0"
"glWindowPos3dvMESA\0"
"\0"
- /* _mesa_function_pool[14538]: DepthFunc (offset 245) */
+ /* _mesa_function_pool[14531]: DepthFunc (offset 245) */
"i\0"
"glDepthFunc\0"
"\0"
- /* _mesa_function_pool[14553]: PixelMapusv (offset 253) */
+ /* _mesa_function_pool[14546]: PixelMapusv (offset 253) */
"iip\0"
"glPixelMapusv\0"
"\0"
- /* _mesa_function_pool[14572]: GetQueryObjecti64vEXT (will be remapped) */
+ /* _mesa_function_pool[14565]: GetQueryObjecti64vEXT (will be remapped) */
"iip\0"
"glGetQueryObjecti64vEXT\0"
"\0"
- /* _mesa_function_pool[14601]: MultiTexCoord1dARB (offset 376) */
+ /* _mesa_function_pool[14594]: MultiTexCoord1dARB (offset 376) */
"id\0"
"glMultiTexCoord1d\0"
"glMultiTexCoord1dARB\0"
"\0"
- /* _mesa_function_pool[14644]: PointParameterivNV (will be remapped) */
+ /* _mesa_function_pool[14637]: PointParameterivNV (will be remapped) */
"ip\0"
"glPointParameteriv\0"
"glPointParameterivNV\0"
"\0"
- /* _mesa_function_pool[14688]: IsSampler (will be remapped) */
+ /* _mesa_function_pool[14681]: IsSampler (will be remapped) */
"i\0"
"glIsSampler\0"
"\0"
- /* _mesa_function_pool[14703]: BlendFunc (offset 241) */
+ /* _mesa_function_pool[14696]: BlendFunc (offset 241) */
"ii\0"
"glBlendFunc\0"
"\0"
- /* _mesa_function_pool[14719]: EndTransformFeedbackEXT (will be remapped) */
+ /* _mesa_function_pool[14712]: EndTransformFeedbackEXT (will be remapped) */
"\0"
"glEndTransformFeedbackEXT\0"
"glEndTransformFeedback\0"
"\0"
- /* _mesa_function_pool[14770]: Uniform2fvARB (will be remapped) */
+ /* _mesa_function_pool[14763]: Uniform2fvARB (will be remapped) */
"iip\0"
"glUniform2fv\0"
"glUniform2fvARB\0"
"\0"
- /* _mesa_function_pool[14804]: BufferParameteriAPPLE (will be remapped) */
+ /* _mesa_function_pool[14797]: BufferParameteriAPPLE (will be remapped) */
"iii\0"
"glBufferParameteriAPPLE\0"
"\0"
- /* _mesa_function_pool[14833]: MultiTexCoord3dvARB (offset 393) */
+ /* _mesa_function_pool[14826]: MultiTexCoord3dvARB (offset 393) */
"ip\0"
"glMultiTexCoord3dv\0"
"glMultiTexCoord3dvARB\0"
"\0"
- /* _mesa_function_pool[14878]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[14871]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */
"pppp\0"
"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[14934]: DeleteObjectARB (will be remapped) */
+ /* _mesa_function_pool[14927]: DeleteObjectARB (will be remapped) */
"i\0"
"glDeleteObjectARB\0"
"\0"
- /* _mesa_function_pool[14955]: GetShaderPrecisionFormat (will be remapped) */
+ /* _mesa_function_pool[14948]: GetShaderPrecisionFormat (will be remapped) */
"iipp\0"
"glGetShaderPrecisionFormat\0"
"\0"
- /* _mesa_function_pool[14988]: MatrixIndexPointerARB (dynamic) */
+ /* _mesa_function_pool[14981]: MatrixIndexPointerARB (dynamic) */
"iiip\0"
"glMatrixIndexPointerARB\0"
"\0"
- /* _mesa_function_pool[15018]: ProgramNamedParameter4dvNV (will be remapped) */
+ /* _mesa_function_pool[15011]: ProgramNamedParameter4dvNV (will be remapped) */
"iipp\0"
"glProgramNamedParameter4dvNV\0"
"\0"
- /* _mesa_function_pool[15053]: Tangent3fvEXT (dynamic) */
+ /* _mesa_function_pool[15046]: Tangent3fvEXT (dynamic) */
"p\0"
"glTangent3fvEXT\0"
"\0"
- /* _mesa_function_pool[15072]: Flush (offset 217) */
+ /* _mesa_function_pool[15065]: Flush (offset 217) */
"\0"
"glFlush\0"
"\0"
- /* _mesa_function_pool[15082]: Color4uiv (offset 38) */
+ /* _mesa_function_pool[15075]: Color4uiv (offset 38) */
"p\0"
"glColor4uiv\0"
"\0"
- /* _mesa_function_pool[15097]: VertexAttribI4iEXT (will be remapped) */
+ /* _mesa_function_pool[15090]: VertexAttribI4iEXT (will be remapped) */
"iiiii\0"
"glVertexAttribI4iEXT\0"
"glVertexAttribI4i\0"
"\0"
- /* _mesa_function_pool[15143]: GenVertexArrays (will be remapped) */
+ /* _mesa_function_pool[15136]: GenVertexArrays (will be remapped) */
"ip\0"
"glGenVertexArrays\0"
"\0"
- /* _mesa_function_pool[15165]: Uniform3uivEXT (will be remapped) */
+ /* _mesa_function_pool[15158]: Uniform3uivEXT (will be remapped) */
"iip\0"
"glUniform3uivEXT\0"
"glUniform3uiv\0"
"\0"
- /* _mesa_function_pool[15201]: RasterPos3sv (offset 77) */
+ /* _mesa_function_pool[15194]: RasterPos3sv (offset 77) */
"p\0"
"glRasterPos3sv\0"
"\0"
- /* _mesa_function_pool[15219]: BindFramebufferEXT (will be remapped) */
+ /* _mesa_function_pool[15212]: BindFramebufferEXT (will be remapped) */
"ii\0"
"glBindFramebuffer\0"
"glBindFramebufferEXT\0"
"\0"
- /* _mesa_function_pool[15262]: ReferencePlaneSGIX (dynamic) */
+ /* _mesa_function_pool[15255]: ReferencePlaneSGIX (dynamic) */
"p\0"
"glReferencePlaneSGIX\0"
"\0"
- /* _mesa_function_pool[15286]: PushAttrib (offset 219) */
+ /* _mesa_function_pool[15279]: PushAttrib (offset 219) */
"i\0"
"glPushAttrib\0"
"\0"
- /* _mesa_function_pool[15302]: RasterPos2i (offset 66) */
+ /* _mesa_function_pool[15295]: RasterPos2i (offset 66) */
"ii\0"
"glRasterPos2i\0"
"\0"
- /* _mesa_function_pool[15320]: ValidateProgramARB (will be remapped) */
+ /* _mesa_function_pool[15313]: ValidateProgramARB (will be remapped) */
"i\0"
"glValidateProgram\0"
"glValidateProgramARB\0"
"\0"
- /* _mesa_function_pool[15362]: TexParameteriv (offset 181) */
+ /* _mesa_function_pool[15355]: TexParameteriv (offset 181) */
"iip\0"
"glTexParameteriv\0"
"\0"
- /* _mesa_function_pool[15384]: UnlockArraysEXT (will be remapped) */
+ /* _mesa_function_pool[15377]: UnlockArraysEXT (will be remapped) */
"\0"
"glUnlockArraysEXT\0"
"\0"
- /* _mesa_function_pool[15404]: TexCoord2fColor3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[15397]: TexCoord2fColor3fVertex3fSUN (dynamic) */
"ffffffff\0"
"glTexCoord2fColor3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[15445]: WindowPos3fvMESA (will be remapped) */
+ /* _mesa_function_pool[15438]: WindowPos3fvMESA (will be remapped) */
"p\0"
"glWindowPos3fv\0"
"glWindowPos3fvARB\0"
"glWindowPos3fvMESA\0"
"\0"
- /* _mesa_function_pool[15500]: RasterPos2f (offset 64) */
+ /* _mesa_function_pool[15493]: RasterPos2f (offset 64) */
"ff\0"
"glRasterPos2f\0"
"\0"
- /* _mesa_function_pool[15518]: VertexAttrib1svNV (will be remapped) */
+ /* _mesa_function_pool[15511]: VertexAttrib1svNV (will be remapped) */
"ip\0"
"glVertexAttrib1svNV\0"
"\0"
- /* _mesa_function_pool[15542]: RasterPos2d (offset 62) */
+ /* _mesa_function_pool[15535]: RasterPos2d (offset 62) */
"dd\0"
"glRasterPos2d\0"
"\0"
- /* _mesa_function_pool[15560]: RasterPos3fv (offset 73) */
+ /* _mesa_function_pool[15553]: RasterPos3fv (offset 73) */
"p\0"
"glRasterPos3fv\0"
"\0"
- /* _mesa_function_pool[15578]: CopyTexSubImage3D (offset 373) */
+ /* _mesa_function_pool[15571]: CopyTexSubImage3D (offset 373) */
"iiiiiiiii\0"
"glCopyTexSubImage3D\0"
"glCopyTexSubImage3DEXT\0"
"\0"
- /* _mesa_function_pool[15632]: VertexAttrib2dARB (will be remapped) */
+ /* _mesa_function_pool[15625]: VertexAttrib2dARB (will be remapped) */
"idd\0"
"glVertexAttrib2d\0"
"glVertexAttrib2dARB\0"
"\0"
- /* _mesa_function_pool[15674]: Color4ub (offset 35) */
+ /* _mesa_function_pool[15667]: Color4ub (offset 35) */
"iiii\0"
"glColor4ub\0"
"\0"
- /* _mesa_function_pool[15691]: GetInteger64v (will be remapped) */
+ /* _mesa_function_pool[15684]: GetInteger64v (will be remapped) */
"ip\0"
"glGetInteger64v\0"
"\0"
- /* _mesa_function_pool[15711]: TextureColorMaskSGIS (dynamic) */
+ /* _mesa_function_pool[15704]: TextureColorMaskSGIS (dynamic) */
"iiii\0"
"glTextureColorMaskSGIS\0"
"\0"
- /* _mesa_function_pool[15740]: RasterPos2s (offset 68) */
+ /* _mesa_function_pool[15733]: RasterPos2s (offset 68) */
"ii\0"
"glRasterPos2s\0"
"\0"
- /* _mesa_function_pool[15758]: GetColorTable (offset 343) */
+ /* _mesa_function_pool[15751]: GetColorTable (offset 343) */
"iiip\0"
"glGetColorTable\0"
"glGetColorTableSGI\0"
"glGetColorTableEXT\0"
"\0"
- /* _mesa_function_pool[15818]: SelectBuffer (offset 195) */
+ /* _mesa_function_pool[15811]: SelectBuffer (offset 195) */
"ip\0"
"glSelectBuffer\0"
"\0"
- /* _mesa_function_pool[15837]: Indexiv (offset 49) */
+ /* _mesa_function_pool[15830]: Indexiv (offset 49) */
"p\0"
"glIndexiv\0"
"\0"
- /* _mesa_function_pool[15850]: TexCoord3i (offset 114) */
+ /* _mesa_function_pool[15843]: TexCoord3i (offset 114) */
"iii\0"
"glTexCoord3i\0"
"\0"
- /* _mesa_function_pool[15868]: CopyColorTable (offset 342) */
+ /* _mesa_function_pool[15861]: CopyColorTable (offset 342) */
"iiiii\0"
"glCopyColorTable\0"
"glCopyColorTableSGI\0"
"\0"
- /* _mesa_function_pool[15912]: GetHistogramParameterfv (offset 362) */
+ /* _mesa_function_pool[15905]: GetHistogramParameterfv (offset 362) */
"iip\0"
"glGetHistogramParameterfv\0"
"glGetHistogramParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[15972]: Frustum (offset 289) */
+ /* _mesa_function_pool[15965]: Frustum (offset 289) */
"dddddd\0"
"glFrustum\0"
"\0"
- /* _mesa_function_pool[15990]: GetString (offset 275) */
+ /* _mesa_function_pool[15983]: GetString (offset 275) */
"i\0"
"glGetString\0"
"\0"
- /* _mesa_function_pool[16005]: ColorPointervINTEL (dynamic) */
+ /* _mesa_function_pool[15998]: ColorPointervINTEL (dynamic) */
"iip\0"
"glColorPointervINTEL\0"
"\0"
- /* _mesa_function_pool[16031]: TexEnvf (offset 184) */
+ /* _mesa_function_pool[16024]: TexEnvf (offset 184) */
"iif\0"
"glTexEnvf\0"
"\0"
- /* _mesa_function_pool[16046]: TexCoord3d (offset 110) */
+ /* _mesa_function_pool[16039]: TexCoord3d (offset 110) */
"ddd\0"
"glTexCoord3d\0"
"\0"
- /* _mesa_function_pool[16064]: AlphaFragmentOp1ATI (will be remapped) */
+ /* _mesa_function_pool[16057]: AlphaFragmentOp1ATI (will be remapped) */
"iiiiii\0"
"glAlphaFragmentOp1ATI\0"
"\0"
- /* _mesa_function_pool[16094]: TexCoord3f (offset 112) */
+ /* _mesa_function_pool[16087]: TexCoord3f (offset 112) */
"fff\0"
"glTexCoord3f\0"
"\0"
- /* _mesa_function_pool[16112]: MultiTexCoord3ivARB (offset 397) */
+ /* _mesa_function_pool[16105]: MultiTexCoord3ivARB (offset 397) */
"ip\0"
"glMultiTexCoord3iv\0"
"glMultiTexCoord3ivARB\0"
"\0"
- /* _mesa_function_pool[16157]: MultiTexCoord2sARB (offset 390) */
+ /* _mesa_function_pool[16150]: MultiTexCoord2sARB (offset 390) */
"iii\0"
"glMultiTexCoord2s\0"
"glMultiTexCoord2sARB\0"
"\0"
- /* _mesa_function_pool[16201]: VertexAttrib1dvARB (will be remapped) */
+ /* _mesa_function_pool[16194]: VertexAttrib1dvARB (will be remapped) */
"ip\0"
"glVertexAttrib1dv\0"
"glVertexAttrib1dvARB\0"
"\0"
- /* _mesa_function_pool[16244]: GetnHistogramARB (will be remapped) */
+ /* _mesa_function_pool[16237]: GetnHistogramARB (will be remapped) */
"iiiiip\0"
"glGetnHistogramARB\0"
"\0"
- /* _mesa_function_pool[16271]: DeleteTextures (offset 327) */
+ /* _mesa_function_pool[16264]: DeleteTextures (offset 327) */
"ip\0"
"glDeleteTextures\0"
"glDeleteTexturesEXT\0"
"\0"
- /* _mesa_function_pool[16312]: TexCoordPointerEXT (will be remapped) */
+ /* _mesa_function_pool[16305]: TexCoordPointerEXT (will be remapped) */
"iiiip\0"
"glTexCoordPointerEXT\0"
"\0"
- /* _mesa_function_pool[16340]: TexSubImage4DSGIS (dynamic) */
+ /* _mesa_function_pool[16333]: TexSubImage4DSGIS (dynamic) */
"iiiiiiiiiiiip\0"
"glTexSubImage4DSGIS\0"
"\0"
- /* _mesa_function_pool[16375]: TexCoord3s (offset 116) */
+ /* _mesa_function_pool[16368]: TexCoord3s (offset 116) */
"iii\0"
"glTexCoord3s\0"
"\0"
- /* _mesa_function_pool[16393]: GetTexLevelParameteriv (offset 285) */
+ /* _mesa_function_pool[16386]: GetTexLevelParameteriv (offset 285) */
"iiip\0"
"glGetTexLevelParameteriv\0"
"\0"
- /* _mesa_function_pool[16424]: CombinerStageParameterfvNV (dynamic) */
+ /* _mesa_function_pool[16417]: CombinerStageParameterfvNV (dynamic) */
"iip\0"
"glCombinerStageParameterfvNV\0"
"\0"
- /* _mesa_function_pool[16458]: StopInstrumentsSGIX (dynamic) */
+ /* _mesa_function_pool[16451]: StopInstrumentsSGIX (dynamic) */
"i\0"
"glStopInstrumentsSGIX\0"
"\0"
- /* _mesa_function_pool[16483]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */
+ /* _mesa_function_pool[16476]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */
"fffffffffffffff\0"
"glTexCoord4fColor4fNormal3fVertex4fSUN\0"
"\0"
- /* _mesa_function_pool[16539]: ClearAccum (offset 204) */
+ /* _mesa_function_pool[16532]: ClearAccum (offset 204) */
"ffff\0"
"glClearAccum\0"
"\0"
- /* _mesa_function_pool[16558]: DeformSGIX (dynamic) */
+ /* _mesa_function_pool[16551]: DeformSGIX (dynamic) */
"i\0"
"glDeformSGIX\0"
"\0"
- /* _mesa_function_pool[16574]: GetVertexAttribfvARB (will be remapped) */
+ /* _mesa_function_pool[16567]: GetVertexAttribfvARB (will be remapped) */
"iip\0"
"glGetVertexAttribfv\0"
"glGetVertexAttribfvARB\0"
"\0"
- /* _mesa_function_pool[16622]: SecondaryColor3ivEXT (will be remapped) */
+ /* _mesa_function_pool[16615]: SecondaryColor3ivEXT (will be remapped) */
"p\0"
"glSecondaryColor3iv\0"
"glSecondaryColor3ivEXT\0"
"\0"
- /* _mesa_function_pool[16668]: TexCoord4iv (offset 123) */
+ /* _mesa_function_pool[16661]: TexCoord4iv (offset 123) */
"p\0"
"glTexCoord4iv\0"
"\0"
- /* _mesa_function_pool[16685]: VertexAttribI4uiEXT (will be remapped) */
+ /* _mesa_function_pool[16678]: VertexAttribI4uiEXT (will be remapped) */
"iiiii\0"
"glVertexAttribI4uiEXT\0"
"glVertexAttribI4ui\0"
"\0"
- /* _mesa_function_pool[16733]: GetFragmentMaterialfvSGIX (dynamic) */
+ /* _mesa_function_pool[16726]: GetFragmentMaterialfvSGIX (dynamic) */
"iip\0"
"glGetFragmentMaterialfvSGIX\0"
"\0"
- /* _mesa_function_pool[16766]: UniformMatrix4x2fv (will be remapped) */
+ /* _mesa_function_pool[16759]: UniformMatrix4x2fv (will be remapped) */
"iiip\0"
"glUniformMatrix4x2fv\0"
"\0"
- /* _mesa_function_pool[16793]: GetDetailTexFuncSGIS (dynamic) */
+ /* _mesa_function_pool[16786]: GetDetailTexFuncSGIS (dynamic) */
"ip\0"
"glGetDetailTexFuncSGIS\0"
"\0"
- /* _mesa_function_pool[16820]: GetCombinerStageParameterfvNV (dynamic) */
+ /* _mesa_function_pool[16813]: GetCombinerStageParameterfvNV (dynamic) */
"iip\0"
"glGetCombinerStageParameterfvNV\0"
"\0"
- /* _mesa_function_pool[16857]: SamplerParameterIiv (will be remapped) */
+ /* _mesa_function_pool[16850]: SamplerParameterIiv (will be remapped) */
"iip\0"
"glSamplerParameterIiv\0"
"\0"
- /* _mesa_function_pool[16884]: PolygonOffset (offset 319) */
+ /* _mesa_function_pool[16877]: PolygonOffset (offset 319) */
"ff\0"
"glPolygonOffset\0"
"\0"
- /* _mesa_function_pool[16904]: BindVertexArray (will be remapped) */
+ /* _mesa_function_pool[16897]: BindVertexArray (will be remapped) */
"i\0"
"glBindVertexArray\0"
"\0"
- /* _mesa_function_pool[16925]: Color4ubVertex2fvSUN (dynamic) */
+ /* _mesa_function_pool[16918]: Color4ubVertex2fvSUN (dynamic) */
"pp\0"
"glColor4ubVertex2fvSUN\0"
"\0"
- /* _mesa_function_pool[16952]: Rectd (offset 86) */
+ /* _mesa_function_pool[16945]: Rectd (offset 86) */
"dddd\0"
"glRectd\0"
"\0"
- /* _mesa_function_pool[16966]: TexFilterFuncSGIS (dynamic) */
+ /* _mesa_function_pool[16959]: TexFilterFuncSGIS (dynamic) */
"iiip\0"
"glTexFilterFuncSGIS\0"
"\0"
- /* _mesa_function_pool[16992]: TextureBarrierNV (will be remapped) */
+ /* _mesa_function_pool[16985]: TextureBarrierNV (will be remapped) */
"\0"
"glTextureBarrierNV\0"
"\0"
- /* _mesa_function_pool[17013]: SamplerParameterfv (will be remapped) */
+ /* _mesa_function_pool[17006]: SamplerParameterfv (will be remapped) */
"iip\0"
"glSamplerParameterfv\0"
"\0"
- /* _mesa_function_pool[17039]: VertexAttribI4ubvEXT (will be remapped) */
+ /* _mesa_function_pool[17032]: VertexAttribI4ubvEXT (will be remapped) */
"ip\0"
"glVertexAttribI4ubvEXT\0"
"glVertexAttribI4ubv\0"
"\0"
- /* _mesa_function_pool[17086]: GetAttribLocationARB (will be remapped) */
+ /* _mesa_function_pool[17079]: GetAttribLocationARB (will be remapped) */
"ip\0"
"glGetAttribLocation\0"
"glGetAttribLocationARB\0"
"\0"
- /* _mesa_function_pool[17133]: RasterPos3i (offset 74) */
+ /* _mesa_function_pool[17126]: RasterPos3i (offset 74) */
"iii\0"
"glRasterPos3i\0"
"\0"
- /* _mesa_function_pool[17152]: BlendEquationSeparateiARB (will be remapped) */
+ /* _mesa_function_pool[17145]: BlendEquationSeparateiARB (will be remapped) */
"iii\0"
"glBlendEquationSeparateiARB\0"
"glBlendEquationSeparateIndexedAMD\0"
"\0"
- /* _mesa_function_pool[17219]: VertexAttrib4ubvARB (will be remapped) */
+ /* _mesa_function_pool[17212]: VertexAttrib4ubvARB (will be remapped) */
"ip\0"
"glVertexAttrib4ubv\0"
"glVertexAttrib4ubvARB\0"
"\0"
- /* _mesa_function_pool[17264]: DetailTexFuncSGIS (dynamic) */
+ /* _mesa_function_pool[17257]: DetailTexFuncSGIS (dynamic) */
"iip\0"
"glDetailTexFuncSGIS\0"
"\0"
- /* _mesa_function_pool[17289]: Normal3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[17282]: Normal3fVertex3fSUN (dynamic) */
"ffffff\0"
"glNormal3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[17319]: CopyTexImage2D (offset 324) */
+ /* _mesa_function_pool[17312]: CopyTexImage2D (offset 324) */
"iiiiiiii\0"
"glCopyTexImage2D\0"
"glCopyTexImage2DEXT\0"
"\0"
- /* _mesa_function_pool[17366]: GetBufferPointervARB (will be remapped) */
+ /* _mesa_function_pool[17359]: GetBufferPointervARB (will be remapped) */
"iip\0"
"glGetBufferPointerv\0"
"glGetBufferPointervARB\0"
"\0"
- /* _mesa_function_pool[17414]: ProgramEnvParameter4fARB (will be remapped) */
+ /* _mesa_function_pool[17407]: ProgramEnvParameter4fARB (will be remapped) */
"iiffff\0"
"glProgramEnvParameter4fARB\0"
"glProgramParameter4fNV\0"
"\0"
- /* _mesa_function_pool[17472]: Uniform3ivARB (will be remapped) */
+ /* _mesa_function_pool[17465]: Uniform3ivARB (will be remapped) */
"iip\0"
"glUniform3iv\0"
"glUniform3ivARB\0"
"\0"
- /* _mesa_function_pool[17506]: Lightfv (offset 160) */
+ /* _mesa_function_pool[17499]: Lightfv (offset 160) */
"iip\0"
"glLightfv\0"
"\0"
- /* _mesa_function_pool[17521]: PrimitiveRestartIndexNV (will be remapped) */
+ /* _mesa_function_pool[17514]: PrimitiveRestartIndexNV (will be remapped) */
"i\0"
"glPrimitiveRestartIndexNV\0"
"glPrimitiveRestartIndex\0"
"\0"
- /* _mesa_function_pool[17574]: ClearDepth (offset 208) */
+ /* _mesa_function_pool[17567]: ClearDepth (offset 208) */
"d\0"
"glClearDepth\0"
"\0"
- /* _mesa_function_pool[17590]: GetFenceivNV (will be remapped) */
+ /* _mesa_function_pool[17583]: GetFenceivNV (will be remapped) */
"iip\0"
"glGetFenceivNV\0"
"\0"
- /* _mesa_function_pool[17610]: WindowPos4dvMESA (will be remapped) */
+ /* _mesa_function_pool[17603]: WindowPos4dvMESA (will be remapped) */
"p\0"
"glWindowPos4dvMESA\0"
"\0"
- /* _mesa_function_pool[17632]: ColorSubTable (offset 346) */
+ /* _mesa_function_pool[17625]: ColorSubTable (offset 346) */
"iiiiip\0"
"glColorSubTable\0"
"glColorSubTableEXT\0"
"\0"
- /* _mesa_function_pool[17675]: Color4fv (offset 30) */
+ /* _mesa_function_pool[17668]: Color4fv (offset 30) */
"p\0"
"glColor4fv\0"
"\0"
- /* _mesa_function_pool[17689]: MultiTexCoord4ivARB (offset 405) */
+ /* _mesa_function_pool[17682]: MultiTexCoord4ivARB (offset 405) */
"ip\0"
"glMultiTexCoord4iv\0"
"glMultiTexCoord4ivARB\0"
"\0"
- /* _mesa_function_pool[17734]: GetnMinmaxARB (will be remapped) */
+ /* _mesa_function_pool[17727]: GetnMinmaxARB (will be remapped) */
"iiiiip\0"
"glGetnMinmaxARB\0"
"\0"
- /* _mesa_function_pool[17758]: ProgramLocalParameters4fvEXT (will be remapped) */
+ /* _mesa_function_pool[17751]: ProgramLocalParameters4fvEXT (will be remapped) */
"iiip\0"
"glProgramLocalParameters4fvEXT\0"
"\0"
- /* _mesa_function_pool[17795]: ColorPointer (offset 308) */
+ /* _mesa_function_pool[17788]: ColorPointer (offset 308) */
"iiip\0"
"glColorPointer\0"
"\0"
- /* _mesa_function_pool[17816]: Rects (offset 92) */
+ /* _mesa_function_pool[17809]: Rects (offset 92) */
"iiii\0"
"glRects\0"
"\0"
- /* _mesa_function_pool[17830]: GetMapAttribParameterfvNV (dynamic) */
+ /* _mesa_function_pool[17823]: GetMapAttribParameterfvNV (dynamic) */
"iiip\0"
"glGetMapAttribParameterfvNV\0"
"\0"
- /* _mesa_function_pool[17864]: CreateShaderProgramEXT (will be remapped) */
+ /* _mesa_function_pool[17857]: CreateShaderProgramEXT (will be remapped) */
"ip\0"
"glCreateShaderProgramEXT\0"
"\0"
- /* _mesa_function_pool[17893]: ActiveProgramEXT (will be remapped) */
+ /* _mesa_function_pool[17886]: ActiveProgramEXT (will be remapped) */
"i\0"
"glActiveProgramEXT\0"
"\0"
- /* _mesa_function_pool[17915]: Lightiv (offset 162) */
+ /* _mesa_function_pool[17908]: Lightiv (offset 162) */
"iip\0"
"glLightiv\0"
"\0"
- /* _mesa_function_pool[17930]: VertexAttrib4sARB (will be remapped) */
+ /* _mesa_function_pool[17923]: VertexAttrib4sARB (will be remapped) */
"iiiii\0"
"glVertexAttrib4s\0"
"glVertexAttrib4sARB\0"
"\0"
- /* _mesa_function_pool[17974]: GetQueryObjectuivARB (will be remapped) */
+ /* _mesa_function_pool[17967]: GetQueryObjectuivARB (will be remapped) */
"iip\0"
"glGetQueryObjectuiv\0"
"glGetQueryObjectuivARB\0"
"\0"
- /* _mesa_function_pool[18022]: GetTexParameteriv (offset 283) */
+ /* _mesa_function_pool[18015]: GetTexParameteriv (offset 283) */
"iip\0"
"glGetTexParameteriv\0"
"\0"
- /* _mesa_function_pool[18047]: MapParameterivNV (dynamic) */
+ /* _mesa_function_pool[18040]: MapParameterivNV (dynamic) */
"iip\0"
"glMapParameterivNV\0"
"\0"
- /* _mesa_function_pool[18071]: GenRenderbuffersEXT (will be remapped) */
+ /* _mesa_function_pool[18064]: GenRenderbuffersEXT (will be remapped) */
"ip\0"
"glGenRenderbuffers\0"
"glGenRenderbuffersEXT\0"
"\0"
- /* _mesa_function_pool[18116]: ClearBufferfv (will be remapped) */
+ /* _mesa_function_pool[18109]: ClearBufferfv (will be remapped) */
"iip\0"
"glClearBufferfv\0"
"\0"
- /* _mesa_function_pool[18137]: VertexAttrib2dvARB (will be remapped) */
+ /* _mesa_function_pool[18130]: VertexAttrib2dvARB (will be remapped) */
"ip\0"
"glVertexAttrib2dv\0"
"glVertexAttrib2dvARB\0"
"\0"
- /* _mesa_function_pool[18180]: EdgeFlagPointerEXT (will be remapped) */
+ /* _mesa_function_pool[18173]: EdgeFlagPointerEXT (will be remapped) */
"iip\0"
"glEdgeFlagPointerEXT\0"
"\0"
- /* _mesa_function_pool[18206]: VertexAttribs2svNV (will be remapped) */
+ /* _mesa_function_pool[18199]: VertexAttribs2svNV (will be remapped) */
"iip\0"
"glVertexAttribs2svNV\0"
"\0"
- /* _mesa_function_pool[18232]: WeightbvARB (dynamic) */
+ /* _mesa_function_pool[18225]: WeightbvARB (dynamic) */
"ip\0"
"glWeightbvARB\0"
"\0"
- /* _mesa_function_pool[18250]: VertexAttrib2fvARB (will be remapped) */
+ /* _mesa_function_pool[18243]: VertexAttrib2fvARB (will be remapped) */
"ip\0"
"glVertexAttrib2fv\0"
"glVertexAttrib2fvARB\0"
"\0"
- /* _mesa_function_pool[18293]: GetBufferParameterivARB (will be remapped) */
+ /* _mesa_function_pool[18286]: GetBufferParameterivARB (will be remapped) */
"iip\0"
"glGetBufferParameteriv\0"
"glGetBufferParameterivARB\0"
"\0"
- /* _mesa_function_pool[18347]: Rectdv (offset 87) */
+ /* _mesa_function_pool[18340]: Rectdv (offset 87) */
"pp\0"
"glRectdv\0"
"\0"
- /* _mesa_function_pool[18360]: ListParameteriSGIX (dynamic) */
+ /* _mesa_function_pool[18353]: ListParameteriSGIX (dynamic) */
"iii\0"
"glListParameteriSGIX\0"
"\0"
- /* _mesa_function_pool[18386]: BlendEquationiARB (will be remapped) */
+ /* _mesa_function_pool[18379]: BlendEquationiARB (will be remapped) */
"ii\0"
"glBlendEquationiARB\0"
"glBlendEquationIndexedAMD\0"
"\0"
- /* _mesa_function_pool[18436]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[18429]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */
"iffffffffff\0"
"glReplacementCodeuiColor4fNormal3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[18495]: InstrumentsBufferSGIX (dynamic) */
+ /* _mesa_function_pool[18488]: InstrumentsBufferSGIX (dynamic) */
"ip\0"
"glInstrumentsBufferSGIX\0"
"\0"
- /* _mesa_function_pool[18523]: VertexAttrib4NivARB (will be remapped) */
+ /* _mesa_function_pool[18516]: VertexAttrib4NivARB (will be remapped) */
"ip\0"
"glVertexAttrib4Niv\0"
"glVertexAttrib4NivARB\0"
"\0"
- /* _mesa_function_pool[18568]: DrawArraysInstancedARB (will be remapped) */
+ /* _mesa_function_pool[18561]: DrawArraysInstancedARB (will be remapped) */
"iiii\0"
"glDrawArraysInstancedARB\0"
"glDrawArraysInstancedEXT\0"
"glDrawArraysInstanced\0"
"\0"
- /* _mesa_function_pool[18646]: GetAttachedShaders (will be remapped) */
+ /* _mesa_function_pool[18639]: GetAttachedShaders (will be remapped) */
"iipp\0"
"glGetAttachedShaders\0"
"\0"
- /* _mesa_function_pool[18673]: GenVertexArraysAPPLE (will be remapped) */
+ /* _mesa_function_pool[18666]: GenVertexArraysAPPLE (will be remapped) */
"ip\0"
"glGenVertexArraysAPPLE\0"
"\0"
- /* _mesa_function_pool[18700]: ClearBufferfi (will be remapped) */
+ /* _mesa_function_pool[18693]: ClearBufferfi (will be remapped) */
"iifi\0"
"glClearBufferfi\0"
"\0"
- /* _mesa_function_pool[18722]: Materialiv (offset 172) */
+ /* _mesa_function_pool[18715]: Materialiv (offset 172) */
"iip\0"
"glMaterialiv\0"
"\0"
- /* _mesa_function_pool[18740]: PushClientAttrib (offset 335) */
+ /* _mesa_function_pool[18733]: PushClientAttrib (offset 335) */
"i\0"
"glPushClientAttrib\0"
"\0"
- /* _mesa_function_pool[18762]: SamplerParameteriv (will be remapped) */
+ /* _mesa_function_pool[18755]: SamplerParameteriv (will be remapped) */
"iip\0"
"glSamplerParameteriv\0"
"\0"
- /* _mesa_function_pool[18788]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[18781]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
"pppp\0"
"glTexCoord2fColor4fNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[18834]: WindowPos2iMESA (will be remapped) */
+ /* _mesa_function_pool[18827]: WindowPos2iMESA (will be remapped) */
"ii\0"
"glWindowPos2i\0"
"glWindowPos2iARB\0"
"glWindowPos2iMESA\0"
"\0"
- /* _mesa_function_pool[18887]: SampleMaskSGIS (will be remapped) */
+ /* _mesa_function_pool[18880]: SampleMaskSGIS (will be remapped) */
"fi\0"
"glSampleMaskSGIS\0"
"glSampleMaskEXT\0"
"\0"
- /* _mesa_function_pool[18924]: SecondaryColor3fvEXT (will be remapped) */
+ /* _mesa_function_pool[18917]: SecondaryColor3fvEXT (will be remapped) */
"p\0"
"glSecondaryColor3fv\0"
"glSecondaryColor3fvEXT\0"
"\0"
- /* _mesa_function_pool[18970]: PolygonMode (offset 174) */
+ /* _mesa_function_pool[18963]: PolygonMode (offset 174) */
"ii\0"
"glPolygonMode\0"
"\0"
- /* _mesa_function_pool[18988]: CompressedTexSubImage1DARB (will be remapped) */
+ /* _mesa_function_pool[18981]: CompressedTexSubImage1DARB (will be remapped) */
"iiiiiip\0"
"glCompressedTexSubImage1D\0"
"glCompressedTexSubImage1DARB\0"
"\0"
- /* _mesa_function_pool[19052]: VertexAttribI1iEXT (will be remapped) */
+ /* _mesa_function_pool[19045]: VertexAttribI1iEXT (will be remapped) */
"ii\0"
"glVertexAttribI1iEXT\0"
"glVertexAttribI1i\0"
"\0"
- /* _mesa_function_pool[19095]: TexCoord2fNormal3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[19088]: TexCoord2fNormal3fVertex3fSUN (dynamic) */
"ffffffff\0"
"glTexCoord2fNormal3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[19137]: GetVertexAttribivNV (will be remapped) */
+ /* _mesa_function_pool[19130]: GetVertexAttribivNV (will be remapped) */
"iip\0"
"glGetVertexAttribivNV\0"
"\0"
- /* _mesa_function_pool[19164]: GetProgramStringARB (will be remapped) */
+ /* _mesa_function_pool[19157]: GetProgramStringARB (will be remapped) */
"iip\0"
"glGetProgramStringARB\0"
"\0"
- /* _mesa_function_pool[19191]: GetnUniformdvARB (will be remapped) */
+ /* _mesa_function_pool[19184]: GetnUniformdvARB (will be remapped) */
"iiip\0"
"glGetnUniformdvARB\0"
"\0"
- /* _mesa_function_pool[19216]: DrawElementsInstancedBaseVertex (will be remapped) */
+ /* _mesa_function_pool[19209]: DrawElementsInstancedBaseVertex (will be remapped) */
"iiipii\0"
"glDrawElementsInstancedBaseVertex\0"
"\0"
- /* _mesa_function_pool[19258]: VertexAttribIPointerEXT (will be remapped) */
+ /* _mesa_function_pool[19251]: VertexAttribIPointerEXT (will be remapped) */
"iiiip\0"
"glVertexAttribIPointerEXT\0"
"glVertexAttribIPointer\0"
"\0"
- /* _mesa_function_pool[19314]: TexBumpParameterfvATI (will be remapped) */
+ /* _mesa_function_pool[19307]: TexBumpParameterfvATI (will be remapped) */
"ip\0"
"glTexBumpParameterfvATI\0"
"\0"
- /* _mesa_function_pool[19342]: Tangent3ivEXT (dynamic) */
+ /* _mesa_function_pool[19335]: Tangent3ivEXT (dynamic) */
"p\0"
"glTangent3ivEXT\0"
"\0"
- /* _mesa_function_pool[19361]: CompileShaderARB (will be remapped) */
+ /* _mesa_function_pool[19354]: CompileShaderARB (will be remapped) */
"i\0"
"glCompileShader\0"
"glCompileShaderARB\0"
"\0"
- /* _mesa_function_pool[19399]: DeleteShader (will be remapped) */
+ /* _mesa_function_pool[19392]: DeleteShader (will be remapped) */
"i\0"
"glDeleteShader\0"
"\0"
- /* _mesa_function_pool[19417]: DisableClientState (offset 309) */
+ /* _mesa_function_pool[19410]: DisableClientState (offset 309) */
"i\0"
"glDisableClientState\0"
"\0"
- /* _mesa_function_pool[19441]: TexGeni (offset 192) */
+ /* _mesa_function_pool[19434]: TexGeni (offset 192) */
"iii\0"
"glTexGeni\0"
"\0"
- /* _mesa_function_pool[19456]: TexGenf (offset 190) */
+ /* _mesa_function_pool[19449]: TexGenf (offset 190) */
"iif\0"
"glTexGenf\0"
"\0"
- /* _mesa_function_pool[19471]: Uniform3fARB (will be remapped) */
+ /* _mesa_function_pool[19464]: Uniform3fARB (will be remapped) */
"ifff\0"
"glUniform3f\0"
"glUniform3fARB\0"
"\0"
- /* _mesa_function_pool[19504]: TexGend (offset 188) */
+ /* _mesa_function_pool[19497]: TexGend (offset 188) */
"iid\0"
"glTexGend\0"
"\0"
- /* _mesa_function_pool[19519]: ListParameterfvSGIX (dynamic) */
+ /* _mesa_function_pool[19512]: ListParameterfvSGIX (dynamic) */
"iip\0"
"glListParameterfvSGIX\0"
"\0"
- /* _mesa_function_pool[19546]: GetPolygonStipple (offset 274) */
+ /* _mesa_function_pool[19539]: GetPolygonStipple (offset 274) */
"p\0"
"glGetPolygonStipple\0"
"\0"
- /* _mesa_function_pool[19569]: Tangent3dvEXT (dynamic) */
+ /* _mesa_function_pool[19562]: Tangent3dvEXT (dynamic) */
"p\0"
"glTangent3dvEXT\0"
"\0"
- /* _mesa_function_pool[19588]: BindBufferOffsetEXT (will be remapped) */
+ /* _mesa_function_pool[19581]: BindBufferOffsetEXT (will be remapped) */
"iiii\0"
"glBindBufferOffsetEXT\0"
"\0"
- /* _mesa_function_pool[19616]: WindowPos3sMESA (will be remapped) */
+ /* _mesa_function_pool[19609]: WindowPos3sMESA (will be remapped) */
"iii\0"
"glWindowPos3s\0"
"glWindowPos3sARB\0"
"glWindowPos3sMESA\0"
"\0"
- /* _mesa_function_pool[19670]: VertexAttrib2svNV (will be remapped) */
+ /* _mesa_function_pool[19663]: VertexAttrib2svNV (will be remapped) */
"ip\0"
"glVertexAttrib2svNV\0"
"\0"
- /* _mesa_function_pool[19694]: DisableIndexedEXT (will be remapped) */
+ /* _mesa_function_pool[19687]: DisableIndexedEXT (will be remapped) */
"ii\0"
"glDisableIndexedEXT\0"
"glDisablei\0"
"\0"
- /* _mesa_function_pool[19729]: BindBufferBaseEXT (will be remapped) */
+ /* _mesa_function_pool[19722]: BindBufferBaseEXT (will be remapped) */
"iii\0"
"glBindBufferBaseEXT\0"
"glBindBufferBase\0"
"\0"
- /* _mesa_function_pool[19771]: TexCoord2fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[19764]: TexCoord2fVertex3fvSUN (dynamic) */
"pp\0"
"glTexCoord2fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[19800]: WindowPos4sMESA (will be remapped) */
+ /* _mesa_function_pool[19793]: WindowPos4sMESA (will be remapped) */
"iiii\0"
"glWindowPos4sMESA\0"
"\0"
- /* _mesa_function_pool[19824]: GetnPixelMapuivARB (will be remapped) */
+ /* _mesa_function_pool[19817]: GetnPixelMapuivARB (will be remapped) */
"iip\0"
"glGetnPixelMapuivARB\0"
"\0"
- /* _mesa_function_pool[19850]: VertexAttrib4NuivARB (will be remapped) */
+ /* _mesa_function_pool[19843]: VertexAttrib4NuivARB (will be remapped) */
"ip\0"
"glVertexAttrib4Nuiv\0"
"glVertexAttrib4NuivARB\0"
"\0"
- /* _mesa_function_pool[19897]: ClientActiveTextureARB (offset 375) */
+ /* _mesa_function_pool[19890]: ClientActiveTextureARB (offset 375) */
"i\0"
"glClientActiveTexture\0"
"glClientActiveTextureARB\0"
"\0"
- /* _mesa_function_pool[19947]: GetSamplerParameterIuiv (will be remapped) */
+ /* _mesa_function_pool[19940]: GetSamplerParameterIuiv (will be remapped) */
"iip\0"
"glGetSamplerParameterIuiv\0"
"\0"
- /* _mesa_function_pool[19978]: ReplacementCodeusvSUN (dynamic) */
+ /* _mesa_function_pool[19971]: ReplacementCodeusvSUN (dynamic) */
"p\0"
"glReplacementCodeusvSUN\0"
"\0"
- /* _mesa_function_pool[20005]: Uniform4fARB (will be remapped) */
+ /* _mesa_function_pool[19998]: Uniform4fARB (will be remapped) */
"iffff\0"
"glUniform4f\0"
"glUniform4fARB\0"
"\0"
- /* _mesa_function_pool[20039]: Color4sv (offset 34) */
+ /* _mesa_function_pool[20032]: Color4sv (offset 34) */
"p\0"
"glColor4sv\0"
"\0"
- /* _mesa_function_pool[20053]: FlushMappedBufferRange (will be remapped) */
+ /* _mesa_function_pool[20046]: FlushMappedBufferRange (will be remapped) */
"iii\0"
"glFlushMappedBufferRange\0"
"\0"
- /* _mesa_function_pool[20083]: IsProgramNV (will be remapped) */
+ /* _mesa_function_pool[20076]: IsProgramNV (will be remapped) */
"i\0"
"glIsProgramARB\0"
"glIsProgramNV\0"
"\0"
- /* _mesa_function_pool[20115]: FlushMappedBufferRangeAPPLE (will be remapped) */
+ /* _mesa_function_pool[20108]: FlushMappedBufferRangeAPPLE (will be remapped) */
"iii\0"
"glFlushMappedBufferRangeAPPLE\0"
"\0"
- /* _mesa_function_pool[20150]: PixelZoom (offset 246) */
+ /* _mesa_function_pool[20143]: PixelZoom (offset 246) */
"ff\0"
"glPixelZoom\0"
"\0"
- /* _mesa_function_pool[20166]: ReplacementCodePointerSUN (dynamic) */
+ /* _mesa_function_pool[20159]: ReplacementCodePointerSUN (dynamic) */
"iip\0"
"glReplacementCodePointerSUN\0"
"\0"
- /* _mesa_function_pool[20199]: ProgramEnvParameter4dARB (will be remapped) */
+ /* _mesa_function_pool[20192]: ProgramEnvParameter4dARB (will be remapped) */
"iidddd\0"
"glProgramEnvParameter4dARB\0"
"glProgramParameter4dNV\0"
"\0"
- /* _mesa_function_pool[20257]: ColorTableParameterfv (offset 340) */
+ /* _mesa_function_pool[20250]: ColorTableParameterfv (offset 340) */
"iip\0"
"glColorTableParameterfv\0"
"glColorTableParameterfvSGI\0"
"\0"
- /* _mesa_function_pool[20313]: FragmentLightModelfSGIX (dynamic) */
+ /* _mesa_function_pool[20306]: FragmentLightModelfSGIX (dynamic) */
"if\0"
"glFragmentLightModelfSGIX\0"
"\0"
- /* _mesa_function_pool[20343]: Binormal3bvEXT (dynamic) */
+ /* _mesa_function_pool[20336]: Binormal3bvEXT (dynamic) */
"p\0"
"glBinormal3bvEXT\0"
"\0"
- /* _mesa_function_pool[20363]: PixelMapuiv (offset 252) */
+ /* _mesa_function_pool[20356]: PixelMapuiv (offset 252) */
"iip\0"
"glPixelMapuiv\0"
"\0"
- /* _mesa_function_pool[20382]: Color3dv (offset 12) */
+ /* _mesa_function_pool[20375]: Color3dv (offset 12) */
"p\0"
"glColor3dv\0"
"\0"
- /* _mesa_function_pool[20396]: IsTexture (offset 330) */
+ /* _mesa_function_pool[20389]: IsTexture (offset 330) */
"i\0"
"glIsTexture\0"
"glIsTextureEXT\0"
"\0"
- /* _mesa_function_pool[20426]: GenSamplers (will be remapped) */
+ /* _mesa_function_pool[20419]: GenSamplers (will be remapped) */
"ip\0"
"glGenSamplers\0"
"\0"
- /* _mesa_function_pool[20444]: VertexWeightfvEXT (dynamic) */
+ /* _mesa_function_pool[20437]: VertexWeightfvEXT (dynamic) */
"p\0"
"glVertexWeightfvEXT\0"
"\0"
- /* _mesa_function_pool[20467]: VertexAttrib1dARB (will be remapped) */
+ /* _mesa_function_pool[20460]: VertexAttrib1dARB (will be remapped) */
"id\0"
"glVertexAttrib1d\0"
"glVertexAttrib1dARB\0"
"\0"
- /* _mesa_function_pool[20508]: ImageTransformParameterivHP (dynamic) */
+ /* _mesa_function_pool[20501]: ImageTransformParameterivHP (dynamic) */
"iip\0"
"glImageTransformParameterivHP\0"
"\0"
- /* _mesa_function_pool[20543]: TexCoord4i (offset 122) */
+ /* _mesa_function_pool[20536]: TexCoord4i (offset 122) */
"iiii\0"
"glTexCoord4i\0"
"\0"
- /* _mesa_function_pool[20562]: DeleteQueriesARB (will be remapped) */
+ /* _mesa_function_pool[20555]: DeleteQueriesARB (will be remapped) */
"ip\0"
"glDeleteQueries\0"
"glDeleteQueriesARB\0"
"\0"
- /* _mesa_function_pool[20601]: Color4ubVertex2fSUN (dynamic) */
+ /* _mesa_function_pool[20594]: Color4ubVertex2fSUN (dynamic) */
"iiiiff\0"
"glColor4ubVertex2fSUN\0"
"\0"
- /* _mesa_function_pool[20631]: FragmentColorMaterialSGIX (dynamic) */
+ /* _mesa_function_pool[20624]: FragmentColorMaterialSGIX (dynamic) */
"ii\0"
"glFragmentColorMaterialSGIX\0"
"\0"
- /* _mesa_function_pool[20663]: CurrentPaletteMatrixARB (dynamic) */
+ /* _mesa_function_pool[20656]: CurrentPaletteMatrixARB (dynamic) */
"i\0"
"glCurrentPaletteMatrixARB\0"
"\0"
- /* _mesa_function_pool[20692]: GetMapdv (offset 266) */
+ /* _mesa_function_pool[20685]: GetMapdv (offset 266) */
"iip\0"
"glGetMapdv\0"
"\0"
- /* _mesa_function_pool[20708]: ObjectPurgeableAPPLE (will be remapped) */
+ /* _mesa_function_pool[20701]: ObjectPurgeableAPPLE (will be remapped) */
"iii\0"
"glObjectPurgeableAPPLE\0"
"\0"
- /* _mesa_function_pool[20736]: GetStringi (will be remapped) */
+ /* _mesa_function_pool[20729]: GetStringi (will be remapped) */
"ii\0"
"glGetStringi\0"
"\0"
- /* _mesa_function_pool[20753]: SamplePatternSGIS (will be remapped) */
+ /* _mesa_function_pool[20746]: SamplePatternSGIS (will be remapped) */
"i\0"
"glSamplePatternSGIS\0"
"glSamplePatternEXT\0"
"\0"
- /* _mesa_function_pool[20795]: PixelStoref (offset 249) */
+ /* _mesa_function_pool[20788]: PixelStoref (offset 249) */
"if\0"
"glPixelStoref\0"
"\0"
- /* _mesa_function_pool[20813]: IsQueryARB (will be remapped) */
+ /* _mesa_function_pool[20806]: IsQueryARB (will be remapped) */
"i\0"
"glIsQuery\0"
"glIsQueryARB\0"
"\0"
- /* _mesa_function_pool[20839]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[20832]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */
"iiiiifff\0"
"glReplacementCodeuiColor4ubVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[20888]: PixelStorei (offset 250) */
+ /* _mesa_function_pool[20881]: PixelStorei (offset 250) */
"ii\0"
"glPixelStorei\0"
"\0"
- /* _mesa_function_pool[20906]: VertexAttrib4usvARB (will be remapped) */
+ /* _mesa_function_pool[20899]: VertexAttrib4usvARB (will be remapped) */
"ip\0"
"glVertexAttrib4usv\0"
"glVertexAttrib4usvARB\0"
"\0"
- /* _mesa_function_pool[20951]: LinkProgramARB (will be remapped) */
+ /* _mesa_function_pool[20944]: LinkProgramARB (will be remapped) */
"i\0"
"glLinkProgram\0"
"glLinkProgramARB\0"
"\0"
- /* _mesa_function_pool[20985]: VertexAttrib2fNV (will be remapped) */
+ /* _mesa_function_pool[20978]: VertexAttrib2fNV (will be remapped) */
"iff\0"
"glVertexAttrib2fNV\0"
"\0"
- /* _mesa_function_pool[21009]: ShaderSourceARB (will be remapped) */
+ /* _mesa_function_pool[21002]: ShaderSourceARB (will be remapped) */
"iipp\0"
"glShaderSource\0"
"glShaderSourceARB\0"
"\0"
- /* _mesa_function_pool[21048]: FragmentMaterialiSGIX (dynamic) */
+ /* _mesa_function_pool[21041]: FragmentMaterialiSGIX (dynamic) */
"iii\0"
"glFragmentMaterialiSGIX\0"
"\0"
- /* _mesa_function_pool[21077]: EvalCoord2dv (offset 233) */
+ /* _mesa_function_pool[21070]: EvalCoord2dv (offset 233) */
"p\0"
"glEvalCoord2dv\0"
"\0"
- /* _mesa_function_pool[21095]: VertexAttrib3svARB (will be remapped) */
+ /* _mesa_function_pool[21088]: VertexAttrib3svARB (will be remapped) */
"ip\0"
"glVertexAttrib3sv\0"
"glVertexAttrib3svARB\0"
"\0"
- /* _mesa_function_pool[21138]: ColorMaterial (offset 151) */
+ /* _mesa_function_pool[21131]: ColorMaterial (offset 151) */
"ii\0"
"glColorMaterial\0"
"\0"
- /* _mesa_function_pool[21158]: CompressedTexSubImage3DARB (will be remapped) */
+ /* _mesa_function_pool[21151]: CompressedTexSubImage3DARB (will be remapped) */
"iiiiiiiiiip\0"
"glCompressedTexSubImage3D\0"
"glCompressedTexSubImage3DARB\0"
"\0"
- /* _mesa_function_pool[21226]: WindowPos2ivMESA (will be remapped) */
+ /* _mesa_function_pool[21219]: WindowPos2ivMESA (will be remapped) */
"p\0"
"glWindowPos2iv\0"
"glWindowPos2ivARB\0"
"glWindowPos2ivMESA\0"
"\0"
- /* _mesa_function_pool[21281]: IsFramebufferEXT (will be remapped) */
+ /* _mesa_function_pool[21274]: IsFramebufferEXT (will be remapped) */
"i\0"
"glIsFramebuffer\0"
"glIsFramebufferEXT\0"
"\0"
- /* _mesa_function_pool[21319]: Uniform4ivARB (will be remapped) */
+ /* _mesa_function_pool[21312]: Uniform4ivARB (will be remapped) */
"iip\0"
"glUniform4iv\0"
"glUniform4ivARB\0"
"\0"
- /* _mesa_function_pool[21353]: GetVertexAttribdvARB (will be remapped) */
+ /* _mesa_function_pool[21346]: GetVertexAttribdvARB (will be remapped) */
"iip\0"
"glGetVertexAttribdv\0"
"glGetVertexAttribdvARB\0"
"\0"
- /* _mesa_function_pool[21401]: TexBumpParameterivATI (will be remapped) */
+ /* _mesa_function_pool[21394]: TexBumpParameterivATI (will be remapped) */
"ip\0"
"glTexBumpParameterivATI\0"
"\0"
- /* _mesa_function_pool[21429]: GetSeparableFilter (offset 359) */
+ /* _mesa_function_pool[21422]: GetSeparableFilter (offset 359) */
"iiippp\0"
"glGetSeparableFilter\0"
"glGetSeparableFilterEXT\0"
"\0"
- /* _mesa_function_pool[21482]: Binormal3dEXT (dynamic) */
+ /* _mesa_function_pool[21475]: Binormal3dEXT (dynamic) */
"ddd\0"
"glBinormal3dEXT\0"
"\0"
- /* _mesa_function_pool[21503]: SpriteParameteriSGIX (dynamic) */
+ /* _mesa_function_pool[21496]: SpriteParameteriSGIX (dynamic) */
"ii\0"
"glSpriteParameteriSGIX\0"
"\0"
- /* _mesa_function_pool[21530]: RequestResidentProgramsNV (will be remapped) */
+ /* _mesa_function_pool[21523]: RequestResidentProgramsNV (will be remapped) */
"ip\0"
"glRequestResidentProgramsNV\0"
"\0"
- /* _mesa_function_pool[21562]: TagSampleBufferSGIX (dynamic) */
+ /* _mesa_function_pool[21555]: TagSampleBufferSGIX (dynamic) */
"\0"
"glTagSampleBufferSGIX\0"
"\0"
- /* _mesa_function_pool[21586]: TransformFeedbackVaryingsEXT (will be remapped) */
+ /* _mesa_function_pool[21579]: TransformFeedbackVaryingsEXT (will be remapped) */
"iipi\0"
"glTransformFeedbackVaryingsEXT\0"
"glTransformFeedbackVaryings\0"
"\0"
- /* _mesa_function_pool[21651]: FeedbackBuffer (offset 194) */
+ /* _mesa_function_pool[21644]: FeedbackBuffer (offset 194) */
"iip\0"
"glFeedbackBuffer\0"
"\0"
- /* _mesa_function_pool[21673]: RasterPos2iv (offset 67) */
+ /* _mesa_function_pool[21666]: RasterPos2iv (offset 67) */
"p\0"
"glRasterPos2iv\0"
"\0"
- /* _mesa_function_pool[21691]: TexImage1D (offset 182) */
+ /* _mesa_function_pool[21684]: TexImage1D (offset 182) */
"iiiiiiip\0"
"glTexImage1D\0"
"\0"
- /* _mesa_function_pool[21714]: ListParameterivSGIX (dynamic) */
+ /* _mesa_function_pool[21707]: ListParameterivSGIX (dynamic) */
"iip\0"
"glListParameterivSGIX\0"
"\0"
- /* _mesa_function_pool[21741]: MultiDrawElementsEXT (will be remapped) */
+ /* _mesa_function_pool[21734]: MultiDrawElementsEXT (will be remapped) */
"ipipi\0"
"glMultiDrawElements\0"
"glMultiDrawElementsEXT\0"
"\0"
- /* _mesa_function_pool[21791]: Color3s (offset 17) */
+ /* _mesa_function_pool[21784]: Color3s (offset 17) */
"iii\0"
"glColor3s\0"
"\0"
- /* _mesa_function_pool[21806]: Uniform1ivARB (will be remapped) */
+ /* _mesa_function_pool[21799]: Uniform1ivARB (will be remapped) */
"iip\0"
"glUniform1iv\0"
"glUniform1ivARB\0"
"\0"
- /* _mesa_function_pool[21840]: WindowPos2sMESA (will be remapped) */
+ /* _mesa_function_pool[21833]: WindowPos2sMESA (will be remapped) */
"ii\0"
"glWindowPos2s\0"
"glWindowPos2sARB\0"
"glWindowPos2sMESA\0"
"\0"
- /* _mesa_function_pool[21893]: WeightusvARB (dynamic) */
+ /* _mesa_function_pool[21886]: WeightusvARB (dynamic) */
"ip\0"
"glWeightusvARB\0"
"\0"
- /* _mesa_function_pool[21912]: TexCoordPointer (offset 320) */
+ /* _mesa_function_pool[21905]: TexCoordPointer (offset 320) */
"iiip\0"
"glTexCoordPointer\0"
"\0"
- /* _mesa_function_pool[21936]: FogCoordPointerEXT (will be remapped) */
+ /* _mesa_function_pool[21929]: FogCoordPointerEXT (will be remapped) */
"iip\0"
"glFogCoordPointer\0"
"glFogCoordPointerEXT\0"
"\0"
- /* _mesa_function_pool[21980]: GetnSeparableFilterARB (will be remapped) */
+ /* _mesa_function_pool[21973]: GetnSeparableFilterARB (will be remapped) */
"iiiipipp\0"
"glGetnSeparableFilterARB\0"
"\0"
- /* _mesa_function_pool[22015]: IndexMaterialEXT (dynamic) */
+ /* _mesa_function_pool[22008]: IndexMaterialEXT (dynamic) */
"ii\0"
"glIndexMaterialEXT\0"
"\0"
- /* _mesa_function_pool[22038]: Color3i (offset 15) */
+ /* _mesa_function_pool[22031]: Color3i (offset 15) */
"iii\0"
"glColor3i\0"
"\0"
- /* _mesa_function_pool[22053]: FrontFace (offset 157) */
+ /* _mesa_function_pool[22046]: FrontFace (offset 157) */
"i\0"
"glFrontFace\0"
"\0"
- /* _mesa_function_pool[22068]: EvalCoord2d (offset 232) */
+ /* _mesa_function_pool[22061]: EvalCoord2d (offset 232) */
"dd\0"
"glEvalCoord2d\0"
"\0"
- /* _mesa_function_pool[22086]: SecondaryColor3ubvEXT (will be remapped) */
+ /* _mesa_function_pool[22079]: SecondaryColor3ubvEXT (will be remapped) */
"p\0"
"glSecondaryColor3ubv\0"
"glSecondaryColor3ubvEXT\0"
"\0"
- /* _mesa_function_pool[22134]: EvalCoord2f (offset 234) */
+ /* _mesa_function_pool[22127]: EvalCoord2f (offset 234) */
"ff\0"
"glEvalCoord2f\0"
"\0"
- /* _mesa_function_pool[22152]: VertexAttrib4dvARB (will be remapped) */
+ /* _mesa_function_pool[22145]: VertexAttrib4dvARB (will be remapped) */
"ip\0"
"glVertexAttrib4dv\0"
"glVertexAttrib4dvARB\0"
"\0"
- /* _mesa_function_pool[22195]: BindAttribLocationARB (will be remapped) */
+ /* _mesa_function_pool[22188]: BindAttribLocationARB (will be remapped) */
"iip\0"
"glBindAttribLocation\0"
"glBindAttribLocationARB\0"
"\0"
- /* _mesa_function_pool[22245]: Color3b (offset 9) */
+ /* _mesa_function_pool[22238]: Color3b (offset 9) */
"iii\0"
"glColor3b\0"
"\0"
- /* _mesa_function_pool[22260]: MultiTexCoord2dARB (offset 384) */
+ /* _mesa_function_pool[22253]: MultiTexCoord2dARB (offset 384) */
"idd\0"
"glMultiTexCoord2d\0"
"glMultiTexCoord2dARB\0"
"\0"
- /* _mesa_function_pool[22304]: ExecuteProgramNV (will be remapped) */
+ /* _mesa_function_pool[22297]: ExecuteProgramNV (will be remapped) */
"iip\0"
"glExecuteProgramNV\0"
"\0"
- /* _mesa_function_pool[22328]: Color3f (offset 13) */
+ /* _mesa_function_pool[22321]: Color3f (offset 13) */
"fff\0"
"glColor3f\0"
"\0"
- /* _mesa_function_pool[22343]: LightEnviSGIX (dynamic) */
+ /* _mesa_function_pool[22336]: LightEnviSGIX (dynamic) */
"ii\0"
"glLightEnviSGIX\0"
"\0"
- /* _mesa_function_pool[22363]: Color3d (offset 11) */
+ /* _mesa_function_pool[22356]: Color3d (offset 11) */
"ddd\0"
"glColor3d\0"
"\0"
- /* _mesa_function_pool[22378]: Normal3dv (offset 55) */
+ /* _mesa_function_pool[22371]: Normal3dv (offset 55) */
"p\0"
"glNormal3dv\0"
"\0"
- /* _mesa_function_pool[22393]: Lightf (offset 159) */
+ /* _mesa_function_pool[22386]: Lightf (offset 159) */
"iif\0"
"glLightf\0"
"\0"
- /* _mesa_function_pool[22407]: ReplacementCodeuiSUN (dynamic) */
+ /* _mesa_function_pool[22400]: ReplacementCodeuiSUN (dynamic) */
"i\0"
"glReplacementCodeuiSUN\0"
"\0"
- /* _mesa_function_pool[22433]: MatrixMode (offset 293) */
+ /* _mesa_function_pool[22426]: MatrixMode (offset 293) */
"i\0"
"glMatrixMode\0"
"\0"
- /* _mesa_function_pool[22449]: GetPixelMapusv (offset 273) */
+ /* _mesa_function_pool[22442]: GetPixelMapusv (offset 273) */
"ip\0"
"glGetPixelMapusv\0"
"\0"
- /* _mesa_function_pool[22470]: Lighti (offset 161) */
+ /* _mesa_function_pool[22463]: Lighti (offset 161) */
"iii\0"
"glLighti\0"
"\0"
- /* _mesa_function_pool[22484]: VertexAttribPointerNV (will be remapped) */
+ /* _mesa_function_pool[22477]: VertexAttribPointerNV (will be remapped) */
"iiiip\0"
"glVertexAttribPointerNV\0"
"\0"
- /* _mesa_function_pool[22515]: ClearDepthf (will be remapped) */
+ /* _mesa_function_pool[22508]: ClearDepthf (will be remapped) */
"f\0"
"glClearDepthf\0"
"\0"
- /* _mesa_function_pool[22532]: GetBooleanIndexedvEXT (will be remapped) */
+ /* _mesa_function_pool[22525]: GetBooleanIndexedvEXT (will be remapped) */
"iip\0"
"glGetBooleanIndexedvEXT\0"
"glGetBooleani_v\0"
"\0"
- /* _mesa_function_pool[22577]: GetFramebufferAttachmentParameterivEXT (will be remapped) */
+ /* _mesa_function_pool[22570]: GetFramebufferAttachmentParameterivEXT (will be remapped) */
"iiip\0"
"glGetFramebufferAttachmentParameteriv\0"
"glGetFramebufferAttachmentParameterivEXT\0"
"\0"
- /* _mesa_function_pool[22662]: PixelTransformParameterfEXT (dynamic) */
+ /* _mesa_function_pool[22655]: PixelTransformParameterfEXT (dynamic) */
"iif\0"
"glPixelTransformParameterfEXT\0"
"\0"
- /* _mesa_function_pool[22697]: MultiTexCoord4dvARB (offset 401) */
+ /* _mesa_function_pool[22690]: MultiTexCoord4dvARB (offset 401) */
"ip\0"
"glMultiTexCoord4dv\0"
"glMultiTexCoord4dvARB\0"
"\0"
- /* _mesa_function_pool[22742]: PixelTransformParameteriEXT (dynamic) */
+ /* _mesa_function_pool[22735]: PixelTransformParameteriEXT (dynamic) */
"iii\0"
"glPixelTransformParameteriEXT\0"
"\0"
- /* _mesa_function_pool[22777]: GetDoublev (offset 260) */
+ /* _mesa_function_pool[22770]: GetDoublev (offset 260) */
"ip\0"
"glGetDoublev\0"
"\0"
- /* _mesa_function_pool[22794]: MultMatrixd (offset 295) */
+ /* _mesa_function_pool[22787]: MultMatrixd (offset 295) */
"p\0"
"glMultMatrixd\0"
"\0"
- /* _mesa_function_pool[22811]: MultMatrixf (offset 294) */
+ /* _mesa_function_pool[22804]: MultMatrixf (offset 294) */
"p\0"
"glMultMatrixf\0"
"\0"
- /* _mesa_function_pool[22828]: VertexAttribI4bvEXT (will be remapped) */
+ /* _mesa_function_pool[22821]: VertexAttribI4bvEXT (will be remapped) */
"ip\0"
"glVertexAttribI4bvEXT\0"
"glVertexAttribI4bv\0"
"\0"
- /* _mesa_function_pool[22873]: TexCoord2fColor4ubVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[22866]: TexCoord2fColor4ubVertex3fSUN (dynamic) */
"ffiiiifff\0"
"glTexCoord2fColor4ubVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[22916]: Uniform1iARB (will be remapped) */
+ /* _mesa_function_pool[22909]: Uniform1iARB (will be remapped) */
"ii\0"
"glUniform1i\0"
"glUniform1iARB\0"
"\0"
- /* _mesa_function_pool[22947]: GetnMapfvARB (will be remapped) */
+ /* _mesa_function_pool[22940]: GetnMapfvARB (will be remapped) */
"iiip\0"
"glGetnMapfvARB\0"
"\0"
- /* _mesa_function_pool[22968]: VertexAttribPointerARB (will be remapped) */
+ /* _mesa_function_pool[22961]: VertexAttribPointerARB (will be remapped) */
"iiiiip\0"
"glVertexAttribPointer\0"
"glVertexAttribPointerARB\0"
"\0"
- /* _mesa_function_pool[23023]: VertexAttrib3sNV (will be remapped) */
+ /* _mesa_function_pool[23016]: VertexAttrib3sNV (will be remapped) */
"iiii\0"
"glVertexAttrib3sNV\0"
"\0"
- /* _mesa_function_pool[23048]: SharpenTexFuncSGIS (dynamic) */
+ /* _mesa_function_pool[23041]: SharpenTexFuncSGIS (dynamic) */
"iip\0"
"glSharpenTexFuncSGIS\0"
"\0"
- /* _mesa_function_pool[23074]: MultiTexCoord4fvARB (offset 403) */
+ /* _mesa_function_pool[23067]: MultiTexCoord4fvARB (offset 403) */
"ip\0"
"glMultiTexCoord4fv\0"
"glMultiTexCoord4fvARB\0"
"\0"
- /* _mesa_function_pool[23119]: Uniform2uiEXT (will be remapped) */
+ /* _mesa_function_pool[23112]: Uniform2uiEXT (will be remapped) */
"iii\0"
"glUniform2uiEXT\0"
"glUniform2ui\0"
"\0"
- /* _mesa_function_pool[23153]: UniformMatrix2x3fv (will be remapped) */
+ /* _mesa_function_pool[23146]: UniformMatrix2x3fv (will be remapped) */
"iiip\0"
"glUniformMatrix2x3fv\0"
"\0"
- /* _mesa_function_pool[23180]: SamplerParameteri (will be remapped) */
+ /* _mesa_function_pool[23173]: SamplerParameteri (will be remapped) */
"iii\0"
"glSamplerParameteri\0"
"\0"
- /* _mesa_function_pool[23205]: SamplerParameterf (will be remapped) */
+ /* _mesa_function_pool[23198]: SamplerParameterf (will be remapped) */
"iif\0"
"glSamplerParameterf\0"
"\0"
- /* _mesa_function_pool[23230]: CombinerParameteriNV (will be remapped) */
+ /* _mesa_function_pool[23223]: CombinerParameteriNV (will be remapped) */
"ii\0"
"glCombinerParameteriNV\0"
"\0"
- /* _mesa_function_pool[23257]: DeleteAsyncMarkersSGIX (dynamic) */
+ /* _mesa_function_pool[23250]: DeleteAsyncMarkersSGIX (dynamic) */
"ii\0"
"glDeleteAsyncMarkersSGIX\0"
"\0"
- /* _mesa_function_pool[23286]: ReplacementCodeusSUN (dynamic) */
+ /* _mesa_function_pool[23279]: ReplacementCodeusSUN (dynamic) */
"i\0"
"glReplacementCodeusSUN\0"
"\0"
- /* _mesa_function_pool[23312]: IsAsyncMarkerSGIX (dynamic) */
+ /* _mesa_function_pool[23305]: IsAsyncMarkerSGIX (dynamic) */
"i\0"
"glIsAsyncMarkerSGIX\0"
"\0"
- /* _mesa_function_pool[23335]: FrameZoomSGIX (dynamic) */
+ /* _mesa_function_pool[23328]: FrameZoomSGIX (dynamic) */
"i\0"
"glFrameZoomSGIX\0"
"\0"
- /* _mesa_function_pool[23354]: Normal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[23347]: Normal3fVertex3fvSUN (dynamic) */
"pp\0"
"glNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[23381]: GetnUniformuivARB (will be remapped) */
+ /* _mesa_function_pool[23374]: GetnUniformuivARB (will be remapped) */
"iiip\0"
"glGetnUniformuivARB\0"
"\0"
- /* _mesa_function_pool[23407]: RasterPos4sv (offset 85) */
+ /* _mesa_function_pool[23400]: RasterPos4sv (offset 85) */
"p\0"
"glRasterPos4sv\0"
"\0"
- /* _mesa_function_pool[23425]: VertexAttrib4NsvARB (will be remapped) */
+ /* _mesa_function_pool[23418]: VertexAttrib4NsvARB (will be remapped) */
"ip\0"
"glVertexAttrib4Nsv\0"
"glVertexAttrib4NsvARB\0"
"\0"
- /* _mesa_function_pool[23470]: VertexAttrib3fvARB (will be remapped) */
+ /* _mesa_function_pool[23463]: VertexAttrib3fvARB (will be remapped) */
"ip\0"
"glVertexAttrib3fv\0"
"glVertexAttrib3fvARB\0"
"\0"
- /* _mesa_function_pool[23513]: ClearColor (offset 206) */
+ /* _mesa_function_pool[23506]: ClearColor (offset 206) */
"ffff\0"
"glClearColor\0"
"\0"
- /* _mesa_function_pool[23532]: GetSynciv (will be remapped) */
+ /* _mesa_function_pool[23525]: GetSynciv (will be remapped) */
"iiipp\0"
"glGetSynciv\0"
"\0"
- /* _mesa_function_pool[23551]: ClearColorIiEXT (will be remapped) */
+ /* _mesa_function_pool[23544]: ClearColorIiEXT (will be remapped) */
"iiii\0"
"glClearColorIiEXT\0"
"\0"
- /* _mesa_function_pool[23575]: DeleteFramebuffersEXT (will be remapped) */
+ /* _mesa_function_pool[23568]: DeleteFramebuffersEXT (will be remapped) */
"ip\0"
"glDeleteFramebuffers\0"
"glDeleteFramebuffersEXT\0"
"\0"
- /* _mesa_function_pool[23624]: GlobalAlphaFactorsSUN (dynamic) */
+ /* _mesa_function_pool[23617]: GlobalAlphaFactorsSUN (dynamic) */
"i\0"
"glGlobalAlphaFactorsSUN\0"
"\0"
- /* _mesa_function_pool[23651]: IsEnabledIndexedEXT (will be remapped) */
+ /* _mesa_function_pool[23644]: IsEnabledIndexedEXT (will be remapped) */
"ii\0"
"glIsEnabledIndexedEXT\0"
"glIsEnabledi\0"
"\0"
- /* _mesa_function_pool[23690]: TexEnviv (offset 187) */
+ /* _mesa_function_pool[23683]: TexEnviv (offset 187) */
"iip\0"
"glTexEnviv\0"
"\0"
- /* _mesa_function_pool[23706]: TexSubImage3D (offset 372) */
+ /* _mesa_function_pool[23699]: TexSubImage3D (offset 372) */
"iiiiiiiiiip\0"
"glTexSubImage3D\0"
"glTexSubImage3DEXT\0"
"\0"
- /* _mesa_function_pool[23754]: Tangent3fEXT (dynamic) */
+ /* _mesa_function_pool[23747]: Tangent3fEXT (dynamic) */
"fff\0"
"glTangent3fEXT\0"
"\0"
- /* _mesa_function_pool[23774]: SecondaryColor3uivEXT (will be remapped) */
+ /* _mesa_function_pool[23767]: SecondaryColor3uivEXT (will be remapped) */
"p\0"
"glSecondaryColor3uiv\0"
"glSecondaryColor3uivEXT\0"
"\0"
- /* _mesa_function_pool[23822]: MatrixIndexubvARB (dynamic) */
+ /* _mesa_function_pool[23815]: MatrixIndexubvARB (dynamic) */
"ip\0"
"glMatrixIndexubvARB\0"
"\0"
- /* _mesa_function_pool[23846]: Color4fNormal3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[23839]: Color4fNormal3fVertex3fSUN (dynamic) */
"ffffffffff\0"
"glColor4fNormal3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[23887]: PixelTexGenParameterfSGIS (will be remapped) */
+ /* _mesa_function_pool[23880]: PixelTexGenParameterfSGIS (will be remapped) */
"if\0"
"glPixelTexGenParameterfSGIS\0"
"\0"
- /* _mesa_function_pool[23919]: CreateShader (will be remapped) */
+ /* _mesa_function_pool[23912]: CreateShader (will be remapped) */
"i\0"
"glCreateShader\0"
"\0"
- /* _mesa_function_pool[23937]: GetColorTableParameterfv (offset 344) */
+ /* _mesa_function_pool[23930]: GetColorTableParameterfv (offset 344) */
"iip\0"
"glGetColorTableParameterfv\0"
"glGetColorTableParameterfvSGI\0"
"glGetColorTableParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[24029]: FragmentLightModelfvSGIX (dynamic) */
+ /* _mesa_function_pool[24022]: FragmentLightModelfvSGIX (dynamic) */
"ip\0"
"glFragmentLightModelfvSGIX\0"
"\0"
- /* _mesa_function_pool[24060]: Bitmap (offset 8) */
+ /* _mesa_function_pool[24053]: Bitmap (offset 8) */
"iiffffp\0"
"glBitmap\0"
"\0"
- /* _mesa_function_pool[24078]: MultiTexCoord3fARB (offset 394) */
+ /* _mesa_function_pool[24071]: MultiTexCoord3fARB (offset 394) */
"ifff\0"
"glMultiTexCoord3f\0"
"glMultiTexCoord3fARB\0"
"\0"
- /* _mesa_function_pool[24123]: GetTexLevelParameterfv (offset 284) */
+ /* _mesa_function_pool[24116]: GetTexLevelParameterfv (offset 284) */
"iiip\0"
"glGetTexLevelParameterfv\0"
"\0"
- /* _mesa_function_pool[24154]: GetPixelTexGenParameterfvSGIS (will be remapped) */
+ /* _mesa_function_pool[24147]: GetPixelTexGenParameterfvSGIS (will be remapped) */
"ip\0"
"glGetPixelTexGenParameterfvSGIS\0"
"\0"
- /* _mesa_function_pool[24190]: GenFramebuffersEXT (will be remapped) */
+ /* _mesa_function_pool[24183]: GenFramebuffersEXT (will be remapped) */
"ip\0"
"glGenFramebuffers\0"
"glGenFramebuffersEXT\0"
"\0"
- /* _mesa_function_pool[24233]: VertexAttribDivisor (will be remapped) */
+ /* _mesa_function_pool[24226]: VertexAttribDivisor (will be remapped) */
"ii\0"
"glVertexAttribDivisor\0"
"\0"
- /* _mesa_function_pool[24259]: GetProgramParameterdvNV (will be remapped) */
+ /* _mesa_function_pool[24252]: GetProgramParameterdvNV (will be remapped) */
"iiip\0"
"glGetProgramParameterdvNV\0"
"\0"
- /* _mesa_function_pool[24291]: Vertex2sv (offset 133) */
+ /* _mesa_function_pool[24284]: Vertex2sv (offset 133) */
"p\0"
"glVertex2sv\0"
"\0"
- /* _mesa_function_pool[24306]: GetIntegerv (offset 263) */
+ /* _mesa_function_pool[24299]: GetIntegerv (offset 263) */
"ip\0"
"glGetIntegerv\0"
"\0"
- /* _mesa_function_pool[24324]: IsVertexArrayAPPLE (will be remapped) */
+ /* _mesa_function_pool[24317]: IsVertexArrayAPPLE (will be remapped) */
"i\0"
"glIsVertexArray\0"
"glIsVertexArrayAPPLE\0"
"\0"
- /* _mesa_function_pool[24364]: FragmentLightfvSGIX (dynamic) */
+ /* _mesa_function_pool[24357]: FragmentLightfvSGIX (dynamic) */
"iip\0"
"glFragmentLightfvSGIX\0"
"\0"
- /* _mesa_function_pool[24391]: GetnMapdvARB (will be remapped) */
+ /* _mesa_function_pool[24384]: GetnMapdvARB (will be remapped) */
"iiip\0"
"glGetnMapdvARB\0"
"\0"
- /* _mesa_function_pool[24412]: DetachShader (will be remapped) */
+ /* _mesa_function_pool[24405]: DetachShader (will be remapped) */
"ii\0"
"glDetachShader\0"
"\0"
- /* _mesa_function_pool[24431]: VertexAttrib4NubARB (will be remapped) */
+ /* _mesa_function_pool[24424]: VertexAttrib4NubARB (will be remapped) */
"iiiii\0"
"glVertexAttrib4Nub\0"
"glVertexAttrib4NubARB\0"
"\0"
- /* _mesa_function_pool[24479]: GetProgramEnvParameterfvARB (will be remapped) */
+ /* _mesa_function_pool[24472]: GetProgramEnvParameterfvARB (will be remapped) */
"iip\0"
"glGetProgramEnvParameterfvARB\0"
"\0"
- /* _mesa_function_pool[24514]: GetTrackMatrixivNV (will be remapped) */
+ /* _mesa_function_pool[24507]: GetTrackMatrixivNV (will be remapped) */
"iiip\0"
"glGetTrackMatrixivNV\0"
"\0"
- /* _mesa_function_pool[24541]: VertexAttrib3svNV (will be remapped) */
+ /* _mesa_function_pool[24534]: VertexAttrib3svNV (will be remapped) */
"ip\0"
"glVertexAttrib3svNV\0"
"\0"
- /* _mesa_function_pool[24565]: Uniform4fvARB (will be remapped) */
+ /* _mesa_function_pool[24558]: Uniform4fvARB (will be remapped) */
"iip\0"
"glUniform4fv\0"
"glUniform4fvARB\0"
"\0"
- /* _mesa_function_pool[24599]: MultTransposeMatrixfARB (will be remapped) */
+ /* _mesa_function_pool[24592]: MultTransposeMatrixfARB (will be remapped) */
"p\0"
"glMultTransposeMatrixf\0"
"glMultTransposeMatrixfARB\0"
"\0"
- /* _mesa_function_pool[24651]: GetTexEnviv (offset 277) */
+ /* _mesa_function_pool[24644]: GetTexEnviv (offset 277) */
"iip\0"
"glGetTexEnviv\0"
"\0"
- /* _mesa_function_pool[24670]: ColorFragmentOp1ATI (will be remapped) */
+ /* _mesa_function_pool[24663]: ColorFragmentOp1ATI (will be remapped) */
"iiiiiii\0"
"glColorFragmentOp1ATI\0"
"\0"
- /* _mesa_function_pool[24701]: GetUniformfvARB (will be remapped) */
+ /* _mesa_function_pool[24694]: GetUniformfvARB (will be remapped) */
"iip\0"
"glGetUniformfv\0"
"glGetUniformfvARB\0"
"\0"
- /* _mesa_function_pool[24739]: EGLImageTargetRenderbufferStorageOES (will be remapped) */
+ /* _mesa_function_pool[24732]: EGLImageTargetRenderbufferStorageOES (will be remapped) */
"ip\0"
"glEGLImageTargetRenderbufferStorageOES\0"
"\0"
- /* _mesa_function_pool[24782]: VertexAttribI2ivEXT (will be remapped) */
+ /* _mesa_function_pool[24775]: VertexAttribI2ivEXT (will be remapped) */
"ip\0"
"glVertexAttribI2ivEXT\0"
"glVertexAttribI2iv\0"
"\0"
- /* _mesa_function_pool[24827]: PopClientAttrib (offset 334) */
+ /* _mesa_function_pool[24820]: PopClientAttrib (offset 334) */
"\0"
"glPopClientAttrib\0"
"\0"
- /* _mesa_function_pool[24847]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[24840]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
"iffffffffffff\0"
"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[24918]: DetachObjectARB (will be remapped) */
+ /* _mesa_function_pool[24911]: DetachObjectARB (will be remapped) */
"ii\0"
"glDetachObjectARB\0"
"\0"
- /* _mesa_function_pool[24940]: VertexBlendARB (dynamic) */
+ /* _mesa_function_pool[24933]: VertexBlendARB (dynamic) */
"i\0"
"glVertexBlendARB\0"
"\0"
- /* _mesa_function_pool[24960]: WindowPos3iMESA (will be remapped) */
+ /* _mesa_function_pool[24953]: WindowPos3iMESA (will be remapped) */
"iii\0"
"glWindowPos3i\0"
"glWindowPos3iARB\0"
"glWindowPos3iMESA\0"
"\0"
- /* _mesa_function_pool[25014]: SeparableFilter2D (offset 360) */
+ /* _mesa_function_pool[25007]: SeparableFilter2D (offset 360) */
"iiiiiipp\0"
"glSeparableFilter2D\0"
"glSeparableFilter2DEXT\0"
"\0"
- /* _mesa_function_pool[25067]: ProgramParameteriARB (will be remapped) */
+ /* _mesa_function_pool[25060]: ProgramParameteriARB (will be remapped) */
"iii\0"
"glProgramParameteriARB\0"
"\0"
- /* _mesa_function_pool[25095]: Map1d (offset 220) */
+ /* _mesa_function_pool[25088]: Map1d (offset 220) */
"iddiip\0"
"glMap1d\0"
"\0"
- /* _mesa_function_pool[25111]: Map1f (offset 221) */
+ /* _mesa_function_pool[25104]: Map1f (offset 221) */
"iffiip\0"
"glMap1f\0"
"\0"
- /* _mesa_function_pool[25127]: CompressedTexImage2DARB (will be remapped) */
+ /* _mesa_function_pool[25120]: CompressedTexImage2DARB (will be remapped) */
"iiiiiiip\0"
"glCompressedTexImage2D\0"
"glCompressedTexImage2DARB\0"
"\0"
- /* _mesa_function_pool[25186]: ArrayElement (offset 306) */
+ /* _mesa_function_pool[25179]: ArrayElement (offset 306) */
"i\0"
"glArrayElement\0"
"glArrayElementEXT\0"
"\0"
- /* _mesa_function_pool[25222]: TexImage2D (offset 183) */
+ /* _mesa_function_pool[25215]: TexImage2D (offset 183) */
"iiiiiiiip\0"
"glTexImage2D\0"
"\0"
- /* _mesa_function_pool[25246]: DepthBoundsEXT (will be remapped) */
+ /* _mesa_function_pool[25239]: DepthBoundsEXT (will be remapped) */
"dd\0"
"glDepthBoundsEXT\0"
"\0"
- /* _mesa_function_pool[25267]: ProgramParameters4fvNV (will be remapped) */
+ /* _mesa_function_pool[25260]: ProgramParameters4fvNV (will be remapped) */
"iiip\0"
"glProgramParameters4fvNV\0"
"\0"
- /* _mesa_function_pool[25298]: DeformationMap3fSGIX (dynamic) */
+ /* _mesa_function_pool[25291]: DeformationMap3fSGIX (dynamic) */
"iffiiffiiffiip\0"
"glDeformationMap3fSGIX\0"
"\0"
- /* _mesa_function_pool[25337]: GetProgramivNV (will be remapped) */
+ /* _mesa_function_pool[25330]: GetProgramivNV (will be remapped) */
"iip\0"
"glGetProgramivNV\0"
"\0"
- /* _mesa_function_pool[25359]: GetFragDataLocationEXT (will be remapped) */
+ /* _mesa_function_pool[25352]: GetFragDataLocationEXT (will be remapped) */
"ip\0"
"glGetFragDataLocationEXT\0"
"glGetFragDataLocation\0"
"\0"
- /* _mesa_function_pool[25410]: GetMinmaxParameteriv (offset 366) */
+ /* _mesa_function_pool[25403]: GetMinmaxParameteriv (offset 366) */
"iip\0"
"glGetMinmaxParameteriv\0"
"glGetMinmaxParameterivEXT\0"
"\0"
- /* _mesa_function_pool[25464]: PixelTransferf (offset 247) */
+ /* _mesa_function_pool[25457]: PixelTransferf (offset 247) */
"if\0"
"glPixelTransferf\0"
"\0"
- /* _mesa_function_pool[25485]: CopyTexImage1D (offset 323) */
+ /* _mesa_function_pool[25478]: CopyTexImage1D (offset 323) */
"iiiiiii\0"
"glCopyTexImage1D\0"
"glCopyTexImage1DEXT\0"
"\0"
- /* _mesa_function_pool[25531]: PushMatrix (offset 298) */
+ /* _mesa_function_pool[25524]: PushMatrix (offset 298) */
"\0"
"glPushMatrix\0"
"\0"
- /* _mesa_function_pool[25546]: Fogiv (offset 156) */
+ /* _mesa_function_pool[25539]: Fogiv (offset 156) */
"ip\0"
"glFogiv\0"
"\0"
- /* _mesa_function_pool[25558]: TexCoord1dv (offset 95) */
+ /* _mesa_function_pool[25551]: TexCoord1dv (offset 95) */
"p\0"
"glTexCoord1dv\0"
"\0"
- /* _mesa_function_pool[25575]: AlphaFragmentOp3ATI (will be remapped) */
+ /* _mesa_function_pool[25568]: AlphaFragmentOp3ATI (will be remapped) */
"iiiiiiiiiiii\0"
"glAlphaFragmentOp3ATI\0"
"\0"
- /* _mesa_function_pool[25611]: PixelTransferi (offset 248) */
+ /* _mesa_function_pool[25604]: PixelTransferi (offset 248) */
"ii\0"
"glPixelTransferi\0"
"\0"
- /* _mesa_function_pool[25632]: GetnColorTableARB (will be remapped) */
+ /* _mesa_function_pool[25625]: GetnColorTableARB (will be remapped) */
"iiiip\0"
"glGetnColorTableARB\0"
"\0"
- /* _mesa_function_pool[25659]: VertexAttrib3fvNV (will be remapped) */
+ /* _mesa_function_pool[25652]: VertexAttrib3fvNV (will be remapped) */
"ip\0"
"glVertexAttrib3fvNV\0"
"\0"
- /* _mesa_function_pool[25683]: Rotatef (offset 300) */
+ /* _mesa_function_pool[25676]: Rotatef (offset 300) */
"ffff\0"
"glRotatef\0"
"\0"
- /* _mesa_function_pool[25699]: GetFinalCombinerInputParameterivNV (will be remapped) */
+ /* _mesa_function_pool[25692]: GetFinalCombinerInputParameterivNV (will be remapped) */
"iip\0"
"glGetFinalCombinerInputParameterivNV\0"
"\0"
- /* _mesa_function_pool[25741]: Vertex3i (offset 138) */
+ /* _mesa_function_pool[25734]: Vertex3i (offset 138) */
"iii\0"
"glVertex3i\0"
"\0"
- /* _mesa_function_pool[25757]: Vertex3f (offset 136) */
+ /* _mesa_function_pool[25750]: Vertex3f (offset 136) */
"fff\0"
"glVertex3f\0"
"\0"
- /* _mesa_function_pool[25773]: Clear (offset 203) */
+ /* _mesa_function_pool[25766]: Clear (offset 203) */
"i\0"
"glClear\0"
"\0"
- /* _mesa_function_pool[25784]: Vertex3d (offset 134) */
+ /* _mesa_function_pool[25777]: Vertex3d (offset 134) */
"ddd\0"
"glVertex3d\0"
"\0"
- /* _mesa_function_pool[25800]: GetMapParameterivNV (dynamic) */
+ /* _mesa_function_pool[25793]: GetMapParameterivNV (dynamic) */
"iip\0"
"glGetMapParameterivNV\0"
"\0"
- /* _mesa_function_pool[25827]: Uniform4iARB (will be remapped) */
+ /* _mesa_function_pool[25820]: Uniform4iARB (will be remapped) */
"iiiii\0"
"glUniform4i\0"
"glUniform4iARB\0"
"\0"
- /* _mesa_function_pool[25861]: ReadBuffer (offset 254) */
+ /* _mesa_function_pool[25854]: ReadBuffer (offset 254) */
"i\0"
"glReadBuffer\0"
"\0"
- /* _mesa_function_pool[25877]: ConvolutionParameteri (offset 352) */
+ /* _mesa_function_pool[25870]: ConvolutionParameteri (offset 352) */
"iii\0"
"glConvolutionParameteri\0"
"glConvolutionParameteriEXT\0"
"\0"
- /* _mesa_function_pool[25933]: Ortho (offset 296) */
+ /* _mesa_function_pool[25926]: Ortho (offset 296) */
"dddddd\0"
"glOrtho\0"
"\0"
- /* _mesa_function_pool[25949]: Binormal3sEXT (dynamic) */
+ /* _mesa_function_pool[25942]: Binormal3sEXT (dynamic) */
"iii\0"
"glBinormal3sEXT\0"
"\0"
- /* _mesa_function_pool[25970]: ListBase (offset 6) */
+ /* _mesa_function_pool[25963]: ListBase (offset 6) */
"i\0"
"glListBase\0"
"\0"
- /* _mesa_function_pool[25984]: VertexAttribI3ivEXT (will be remapped) */
+ /* _mesa_function_pool[25977]: VertexAttribI3ivEXT (will be remapped) */
"ip\0"
"glVertexAttribI3ivEXT\0"
"glVertexAttribI3iv\0"
"\0"
- /* _mesa_function_pool[26029]: Vertex3s (offset 140) */
+ /* _mesa_function_pool[26022]: Vertex3s (offset 140) */
"iii\0"
"glVertex3s\0"
"\0"
- /* _mesa_function_pool[26045]: ConvolutionParameterf (offset 350) */
+ /* _mesa_function_pool[26038]: ConvolutionParameterf (offset 350) */
"iif\0"
"glConvolutionParameterf\0"
"glConvolutionParameterfEXT\0"
"\0"
- /* _mesa_function_pool[26101]: GetColorTableParameteriv (offset 345) */
+ /* _mesa_function_pool[26094]: GetColorTableParameteriv (offset 345) */
"iip\0"
"glGetColorTableParameteriv\0"
"glGetColorTableParameterivSGI\0"
"glGetColorTableParameterivEXT\0"
"\0"
- /* _mesa_function_pool[26193]: ProgramEnvParameter4dvARB (will be remapped) */
+ /* _mesa_function_pool[26186]: ProgramEnvParameter4dvARB (will be remapped) */
"iip\0"
"glProgramEnvParameter4dvARB\0"
"glProgramParameter4dvNV\0"
"\0"
- /* _mesa_function_pool[26250]: ShadeModel (offset 177) */
+ /* _mesa_function_pool[26243]: ShadeModel (offset 177) */
"i\0"
"glShadeModel\0"
"\0"
- /* _mesa_function_pool[26266]: VertexAttribs2fvNV (will be remapped) */
+ /* _mesa_function_pool[26259]: VertexAttribs2fvNV (will be remapped) */
"iip\0"
"glVertexAttribs2fvNV\0"
"\0"
- /* _mesa_function_pool[26292]: Rectiv (offset 91) */
+ /* _mesa_function_pool[26285]: Rectiv (offset 91) */
"pp\0"
"glRectiv\0"
"\0"
- /* _mesa_function_pool[26305]: UseProgramObjectARB (will be remapped) */
+ /* _mesa_function_pool[26298]: UseProgramObjectARB (will be remapped) */
"i\0"
"glUseProgram\0"
"glUseProgramObjectARB\0"
"\0"
- /* _mesa_function_pool[26343]: GetMapParameterfvNV (dynamic) */
+ /* _mesa_function_pool[26336]: GetMapParameterfvNV (dynamic) */
"iip\0"
"glGetMapParameterfvNV\0"
"\0"
- /* _mesa_function_pool[26370]: EndConditionalRenderNV (will be remapped) */
+ /* _mesa_function_pool[26363]: EndConditionalRenderNV (will be remapped) */
"\0"
"glEndConditionalRenderNV\0"
"glEndConditionalRender\0"
"\0"
- /* _mesa_function_pool[26420]: PassTexCoordATI (will be remapped) */
+ /* _mesa_function_pool[26413]: PassTexCoordATI (will be remapped) */
"iii\0"
"glPassTexCoordATI\0"
"\0"
- /* _mesa_function_pool[26443]: DeleteProgram (will be remapped) */
+ /* _mesa_function_pool[26436]: DeleteProgram (will be remapped) */
"i\0"
"glDeleteProgram\0"
"\0"
- /* _mesa_function_pool[26462]: GetSamplerParameteriv (will be remapped) */
+ /* _mesa_function_pool[26455]: GetSamplerParameteriv (will be remapped) */
"iip\0"
"glGetSamplerParameteriv\0"
"\0"
- /* _mesa_function_pool[26491]: Tangent3dEXT (dynamic) */
+ /* _mesa_function_pool[26484]: Tangent3dEXT (dynamic) */
"ddd\0"
"glTangent3dEXT\0"
"\0"
- /* _mesa_function_pool[26511]: SecondaryColor3dvEXT (will be remapped) */
+ /* _mesa_function_pool[26504]: SecondaryColor3dvEXT (will be remapped) */
"p\0"
"glSecondaryColor3dv\0"
"glSecondaryColor3dvEXT\0"
"\0"
- /* _mesa_function_pool[26557]: AlphaFragmentOp2ATI (will be remapped) */
+ /* _mesa_function_pool[26550]: AlphaFragmentOp2ATI (will be remapped) */
"iiiiiiiii\0"
"glAlphaFragmentOp2ATI\0"
"\0"
- /* _mesa_function_pool[26590]: Vertex2fv (offset 129) */
+ /* _mesa_function_pool[26583]: Vertex2fv (offset 129) */
"p\0"
"glVertex2fv\0"
"\0"
- /* _mesa_function_pool[26605]: MultiDrawArraysEXT (will be remapped) */
+ /* _mesa_function_pool[26598]: MultiDrawArraysEXT (will be remapped) */
"ippi\0"
"glMultiDrawArrays\0"
"glMultiDrawArraysEXT\0"
"\0"
- /* _mesa_function_pool[26650]: BindRenderbufferEXT (will be remapped) */
+ /* _mesa_function_pool[26643]: BindRenderbufferEXT (will be remapped) */
"ii\0"
"glBindRenderbuffer\0"
"glBindRenderbufferEXT\0"
"\0"
- /* _mesa_function_pool[26695]: MultiTexCoord4dARB (offset 400) */
+ /* _mesa_function_pool[26688]: MultiTexCoord4dARB (offset 400) */
"idddd\0"
"glMultiTexCoord4d\0"
"glMultiTexCoord4dARB\0"
"\0"
- /* _mesa_function_pool[26741]: FramebufferTextureFaceARB (will be remapped) */
+ /* _mesa_function_pool[26734]: FramebufferTextureFaceARB (will be remapped) */
"iiiii\0"
"glFramebufferTextureFaceARB\0"
"\0"
- /* _mesa_function_pool[26776]: Vertex3sv (offset 141) */
+ /* _mesa_function_pool[26769]: Vertex3sv (offset 141) */
"p\0"
"glVertex3sv\0"
"\0"
- /* _mesa_function_pool[26791]: SecondaryColor3usEXT (will be remapped) */
+ /* _mesa_function_pool[26784]: SecondaryColor3usEXT (will be remapped) */
"iii\0"
"glSecondaryColor3us\0"
"glSecondaryColor3usEXT\0"
"\0"
- /* _mesa_function_pool[26839]: ProgramLocalParameter4fvARB (will be remapped) */
+ /* _mesa_function_pool[26832]: ProgramLocalParameter4fvARB (will be remapped) */
"iip\0"
"glProgramLocalParameter4fvARB\0"
"\0"
- /* _mesa_function_pool[26874]: DeleteProgramsNV (will be remapped) */
+ /* _mesa_function_pool[26867]: DeleteProgramsNV (will be remapped) */
"ip\0"
"glDeleteProgramsARB\0"
"glDeleteProgramsNV\0"
"\0"
- /* _mesa_function_pool[26917]: EvalMesh1 (offset 236) */
+ /* _mesa_function_pool[26910]: EvalMesh1 (offset 236) */
"iii\0"
"glEvalMesh1\0"
"\0"
- /* _mesa_function_pool[26934]: PauseTransformFeedback (will be remapped) */
+ /* _mesa_function_pool[26927]: PauseTransformFeedback (will be remapped) */
"\0"
"glPauseTransformFeedback\0"
"\0"
- /* _mesa_function_pool[26961]: MultiTexCoord1sARB (offset 382) */
+ /* _mesa_function_pool[26954]: MultiTexCoord1sARB (offset 382) */
"ii\0"
"glMultiTexCoord1s\0"
"glMultiTexCoord1sARB\0"
"\0"
- /* _mesa_function_pool[27004]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[26997]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */
"iffffff\0"
"glReplacementCodeuiColor3fVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[27051]: GetVertexAttribPointervNV (will be remapped) */
+ /* _mesa_function_pool[27044]: GetVertexAttribPointervNV (will be remapped) */
"iip\0"
"glGetVertexAttribPointerv\0"
"glGetVertexAttribPointervARB\0"
"glGetVertexAttribPointervNV\0"
"\0"
- /* _mesa_function_pool[27139]: VertexAttribs1fvNV (will be remapped) */
+ /* _mesa_function_pool[27132]: VertexAttribs1fvNV (will be remapped) */
"iip\0"
"glVertexAttribs1fvNV\0"
"\0"
- /* _mesa_function_pool[27165]: MultiTexCoord1dvARB (offset 377) */
+ /* _mesa_function_pool[27158]: MultiTexCoord1dvARB (offset 377) */
"ip\0"
"glMultiTexCoord1dv\0"
"glMultiTexCoord1dvARB\0"
"\0"
- /* _mesa_function_pool[27210]: Uniform2iARB (will be remapped) */
+ /* _mesa_function_pool[27203]: Uniform2iARB (will be remapped) */
"iii\0"
"glUniform2i\0"
"glUniform2iARB\0"
"\0"
- /* _mesa_function_pool[27242]: Vertex2iv (offset 131) */
+ /* _mesa_function_pool[27235]: Vertex2iv (offset 131) */
"p\0"
"glVertex2iv\0"
"\0"
- /* _mesa_function_pool[27257]: GetProgramStringNV (will be remapped) */
+ /* _mesa_function_pool[27250]: GetProgramStringNV (will be remapped) */
"iip\0"
"glGetProgramStringNV\0"
"\0"
- /* _mesa_function_pool[27283]: ColorPointerEXT (will be remapped) */
+ /* _mesa_function_pool[27276]: ColorPointerEXT (will be remapped) */
"iiiip\0"
"glColorPointerEXT\0"
"\0"
- /* _mesa_function_pool[27308]: LineWidth (offset 168) */
+ /* _mesa_function_pool[27301]: LineWidth (offset 168) */
"f\0"
"glLineWidth\0"
"\0"
- /* _mesa_function_pool[27323]: MapBufferARB (will be remapped) */
+ /* _mesa_function_pool[27316]: MapBufferARB (will be remapped) */
"ii\0"
"glMapBuffer\0"
"glMapBufferARB\0"
"\0"
- /* _mesa_function_pool[27354]: MultiDrawElementsBaseVertex (will be remapped) */
+ /* _mesa_function_pool[27347]: MultiDrawElementsBaseVertex (will be remapped) */
"ipipip\0"
"glMultiDrawElementsBaseVertex\0"
"\0"
- /* _mesa_function_pool[27392]: TexParameterIuivEXT (will be remapped) */
+ /* _mesa_function_pool[27385]: TexParameterIuivEXT (will be remapped) */
"iip\0"
"glTexParameterIuivEXT\0"
"glTexParameterIuiv\0"
"\0"
- /* _mesa_function_pool[27438]: Binormal3svEXT (dynamic) */
+ /* _mesa_function_pool[27431]: Binormal3svEXT (dynamic) */
"p\0"
"glBinormal3svEXT\0"
"\0"
- /* _mesa_function_pool[27458]: ApplyTextureEXT (dynamic) */
+ /* _mesa_function_pool[27451]: ApplyTextureEXT (dynamic) */
"i\0"
"glApplyTextureEXT\0"
"\0"
- /* _mesa_function_pool[27479]: GetBufferParameteri64v (will be remapped) */
+ /* _mesa_function_pool[27472]: GetBufferParameteri64v (will be remapped) */
"iip\0"
"glGetBufferParameteri64v\0"
"\0"
- /* _mesa_function_pool[27509]: TexGendv (offset 189) */
+ /* _mesa_function_pool[27502]: TexGendv (offset 189) */
"iip\0"
"glTexGendv\0"
"\0"
- /* _mesa_function_pool[27525]: VertexAttribI3iEXT (will be remapped) */
+ /* _mesa_function_pool[27518]: VertexAttribI3iEXT (will be remapped) */
"iiii\0"
"glVertexAttribI3iEXT\0"
"glVertexAttribI3i\0"
"\0"
- /* _mesa_function_pool[27570]: EnableIndexedEXT (will be remapped) */
+ /* _mesa_function_pool[27563]: EnableIndexedEXT (will be remapped) */
"ii\0"
"glEnableIndexedEXT\0"
"glEnablei\0"
"\0"
- /* _mesa_function_pool[27603]: TextureMaterialEXT (dynamic) */
+ /* _mesa_function_pool[27596]: TextureMaterialEXT (dynamic) */
"ii\0"
"glTextureMaterialEXT\0"
"\0"
- /* _mesa_function_pool[27628]: TextureLightEXT (dynamic) */
+ /* _mesa_function_pool[27621]: TextureLightEXT (dynamic) */
"i\0"
"glTextureLightEXT\0"
"\0"
- /* _mesa_function_pool[27649]: ResetMinmax (offset 370) */
+ /* _mesa_function_pool[27642]: ResetMinmax (offset 370) */
"i\0"
"glResetMinmax\0"
"glResetMinmaxEXT\0"
"\0"
- /* _mesa_function_pool[27683]: SpriteParameterfSGIX (dynamic) */
+ /* _mesa_function_pool[27676]: SpriteParameterfSGIX (dynamic) */
"if\0"
"glSpriteParameterfSGIX\0"
"\0"
- /* _mesa_function_pool[27710]: EnableClientState (offset 313) */
+ /* _mesa_function_pool[27703]: EnableClientState (offset 313) */
"i\0"
"glEnableClientState\0"
"\0"
- /* _mesa_function_pool[27733]: VertexAttrib4sNV (will be remapped) */
+ /* _mesa_function_pool[27726]: VertexAttrib4sNV (will be remapped) */
"iiiii\0"
"glVertexAttrib4sNV\0"
"\0"
- /* _mesa_function_pool[27759]: GetConvolutionParameterfv (offset 357) */
+ /* _mesa_function_pool[27752]: GetConvolutionParameterfv (offset 357) */
"iip\0"
"glGetConvolutionParameterfv\0"
"glGetConvolutionParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[27823]: VertexAttribs4dvNV (will be remapped) */
+ /* _mesa_function_pool[27816]: VertexAttribs4dvNV (will be remapped) */
"iip\0"
"glVertexAttribs4dvNV\0"
"\0"
- /* _mesa_function_pool[27849]: VertexAttrib4dARB (will be remapped) */
+ /* _mesa_function_pool[27842]: VertexAttrib4dARB (will be remapped) */
"idddd\0"
"glVertexAttrib4d\0"
"glVertexAttrib4dARB\0"
"\0"
- /* _mesa_function_pool[27893]: GetTexBumpParameterfvATI (will be remapped) */
+ /* _mesa_function_pool[27886]: GetTexBumpParameterfvATI (will be remapped) */
"ip\0"
"glGetTexBumpParameterfvATI\0"
"\0"
- /* _mesa_function_pool[27924]: ProgramNamedParameter4dNV (will be remapped) */
+ /* _mesa_function_pool[27917]: ProgramNamedParameter4dNV (will be remapped) */
"iipdddd\0"
"glProgramNamedParameter4dNV\0"
"\0"
- /* _mesa_function_pool[27961]: GetMaterialfv (offset 269) */
+ /* _mesa_function_pool[27954]: GetMaterialfv (offset 269) */
"iip\0"
"glGetMaterialfv\0"
"\0"
- /* _mesa_function_pool[27982]: VertexWeightfEXT (dynamic) */
+ /* _mesa_function_pool[27975]: VertexWeightfEXT (dynamic) */
"f\0"
"glVertexWeightfEXT\0"
"\0"
- /* _mesa_function_pool[28004]: SetFragmentShaderConstantATI (will be remapped) */
+ /* _mesa_function_pool[27997]: SetFragmentShaderConstantATI (will be remapped) */
"ip\0"
"glSetFragmentShaderConstantATI\0"
"\0"
- /* _mesa_function_pool[28039]: Binormal3fEXT (dynamic) */
+ /* _mesa_function_pool[28032]: Binormal3fEXT (dynamic) */
"fff\0"
"glBinormal3fEXT\0"
"\0"
- /* _mesa_function_pool[28060]: CallList (offset 2) */
+ /* _mesa_function_pool[28053]: CallList (offset 2) */
"i\0"
"glCallList\0"
"\0"
- /* _mesa_function_pool[28074]: Materialfv (offset 170) */
+ /* _mesa_function_pool[28067]: Materialfv (offset 170) */
"iip\0"
"glMaterialfv\0"
"\0"
- /* _mesa_function_pool[28092]: TexCoord3fv (offset 113) */
+ /* _mesa_function_pool[28085]: TexCoord3fv (offset 113) */
"p\0"
"glTexCoord3fv\0"
"\0"
- /* _mesa_function_pool[28109]: FogCoordfvEXT (will be remapped) */
+ /* _mesa_function_pool[28102]: FogCoordfvEXT (will be remapped) */
"p\0"
"glFogCoordfv\0"
"glFogCoordfvEXT\0"
"\0"
- /* _mesa_function_pool[28141]: MultiTexCoord1ivARB (offset 381) */
+ /* _mesa_function_pool[28134]: MultiTexCoord1ivARB (offset 381) */
"ip\0"
"glMultiTexCoord1iv\0"
"glMultiTexCoord1ivARB\0"
"\0"
- /* _mesa_function_pool[28186]: SecondaryColor3ubEXT (will be remapped) */
+ /* _mesa_function_pool[28179]: SecondaryColor3ubEXT (will be remapped) */
"iii\0"
"glSecondaryColor3ub\0"
"glSecondaryColor3ubEXT\0"
"\0"
- /* _mesa_function_pool[28234]: MultiTexCoord2ivARB (offset 389) */
+ /* _mesa_function_pool[28227]: MultiTexCoord2ivARB (offset 389) */
"ip\0"
"glMultiTexCoord2iv\0"
"glMultiTexCoord2ivARB\0"
"\0"
- /* _mesa_function_pool[28279]: FogFuncSGIS (dynamic) */
+ /* _mesa_function_pool[28272]: FogFuncSGIS (dynamic) */
"ip\0"
"glFogFuncSGIS\0"
"\0"
- /* _mesa_function_pool[28297]: CopyTexSubImage2D (offset 326) */
+ /* _mesa_function_pool[28290]: CopyTexSubImage2D (offset 326) */
"iiiiiiii\0"
"glCopyTexSubImage2D\0"
"glCopyTexSubImage2DEXT\0"
"\0"
- /* _mesa_function_pool[28350]: GetObjectParameterivARB (will be remapped) */
+ /* _mesa_function_pool[28343]: GetObjectParameterivARB (will be remapped) */
"iip\0"
"glGetObjectParameterivARB\0"
"\0"
- /* _mesa_function_pool[28381]: Color3iv (offset 16) */
+ /* _mesa_function_pool[28374]: Color3iv (offset 16) */
"p\0"
"glColor3iv\0"
"\0"
- /* _mesa_function_pool[28395]: TexCoord4fVertex4fSUN (dynamic) */
+ /* _mesa_function_pool[28388]: TexCoord4fVertex4fSUN (dynamic) */
"ffffffff\0"
"glTexCoord4fVertex4fSUN\0"
"\0"
- /* _mesa_function_pool[28429]: DrawElements (offset 311) */
+ /* _mesa_function_pool[28422]: DrawElements (offset 311) */
"iiip\0"
"glDrawElements\0"
"\0"
- /* _mesa_function_pool[28450]: BindVertexArrayAPPLE (will be remapped) */
+ /* _mesa_function_pool[28443]: BindVertexArrayAPPLE (will be remapped) */
"i\0"
"glBindVertexArrayAPPLE\0"
"\0"
- /* _mesa_function_pool[28476]: GetProgramLocalParameterdvARB (will be remapped) */
+ /* _mesa_function_pool[28469]: GetProgramLocalParameterdvARB (will be remapped) */
"iip\0"
"glGetProgramLocalParameterdvARB\0"
"\0"
- /* _mesa_function_pool[28513]: GetHistogramParameteriv (offset 363) */
+ /* _mesa_function_pool[28506]: GetHistogramParameteriv (offset 363) */
"iip\0"
"glGetHistogramParameteriv\0"
"glGetHistogramParameterivEXT\0"
"\0"
- /* _mesa_function_pool[28573]: MultiTexCoord1iARB (offset 380) */
+ /* _mesa_function_pool[28566]: MultiTexCoord1iARB (offset 380) */
"ii\0"
"glMultiTexCoord1i\0"
"glMultiTexCoord1iARB\0"
"\0"
- /* _mesa_function_pool[28616]: GetConvolutionFilter (offset 356) */
+ /* _mesa_function_pool[28609]: GetConvolutionFilter (offset 356) */
"iiip\0"
"glGetConvolutionFilter\0"
"glGetConvolutionFilterEXT\0"
"\0"
- /* _mesa_function_pool[28671]: GetProgramivARB (will be remapped) */
+ /* _mesa_function_pool[28664]: GetProgramivARB (will be remapped) */
"iip\0"
"glGetProgramivARB\0"
"\0"
- /* _mesa_function_pool[28694]: TexBufferARB (will be remapped) */
+ /* _mesa_function_pool[28687]: TexBufferARB (will be remapped) */
"iii\0"
"glTexBufferARB\0"
"\0"
- /* _mesa_function_pool[28714]: BlendFuncSeparateEXT (will be remapped) */
+ /* _mesa_function_pool[28707]: BlendFuncSeparateEXT (will be remapped) */
"iiii\0"
"glBlendFuncSeparate\0"
"glBlendFuncSeparateEXT\0"
"glBlendFuncSeparateINGR\0"
"\0"
- /* _mesa_function_pool[28787]: MapBufferRange (will be remapped) */
+ /* _mesa_function_pool[28780]: MapBufferRange (will be remapped) */
"iiii\0"
"glMapBufferRange\0"
"\0"
- /* _mesa_function_pool[28810]: ProgramParameters4dvNV (will be remapped) */
+ /* _mesa_function_pool[28803]: ProgramParameters4dvNV (will be remapped) */
"iiip\0"
"glProgramParameters4dvNV\0"
"\0"
- /* _mesa_function_pool[28841]: TexCoord2fColor3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[28834]: TexCoord2fColor3fVertex3fvSUN (dynamic) */
"ppp\0"
"glTexCoord2fColor3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[28878]: EvalPoint2 (offset 239) */
+ /* _mesa_function_pool[28871]: EvalPoint2 (offset 239) */
"ii\0"
"glEvalPoint2\0"
"\0"
- /* _mesa_function_pool[28895]: Uniform1uivEXT (will be remapped) */
+ /* _mesa_function_pool[28888]: Uniform1uivEXT (will be remapped) */
"iip\0"
"glUniform1uivEXT\0"
"glUniform1uiv\0"
"\0"
- /* _mesa_function_pool[28931]: EvalPoint1 (offset 237) */
+ /* _mesa_function_pool[28924]: EvalPoint1 (offset 237) */
"i\0"
"glEvalPoint1\0"
"\0"
- /* _mesa_function_pool[28947]: Binormal3dvEXT (dynamic) */
+ /* _mesa_function_pool[28940]: Binormal3dvEXT (dynamic) */
"p\0"
"glBinormal3dvEXT\0"
"\0"
- /* _mesa_function_pool[28967]: PopMatrix (offset 297) */
+ /* _mesa_function_pool[28960]: PopMatrix (offset 297) */
"\0"
"glPopMatrix\0"
"\0"
- /* _mesa_function_pool[28981]: FinishFenceNV (will be remapped) */
+ /* _mesa_function_pool[28974]: FinishFenceNV (will be remapped) */
"i\0"
"glFinishFenceNV\0"
"\0"
- /* _mesa_function_pool[29000]: GetFogFuncSGIS (dynamic) */
+ /* _mesa_function_pool[28993]: GetFogFuncSGIS (dynamic) */
"p\0"
"glGetFogFuncSGIS\0"
"\0"
- /* _mesa_function_pool[29020]: GetUniformLocationARB (will be remapped) */
+ /* _mesa_function_pool[29013]: GetUniformLocationARB (will be remapped) */
"ip\0"
"glGetUniformLocation\0"
"glGetUniformLocationARB\0"
"\0"
- /* _mesa_function_pool[29069]: SecondaryColor3fEXT (will be remapped) */
+ /* _mesa_function_pool[29062]: SecondaryColor3fEXT (will be remapped) */
"fff\0"
"glSecondaryColor3f\0"
"glSecondaryColor3fEXT\0"
"\0"
- /* _mesa_function_pool[29115]: GetTexGeniv (offset 280) */
+ /* _mesa_function_pool[29108]: GetTexGeniv (offset 280) */
"iip\0"
"glGetTexGeniv\0"
"\0"
- /* _mesa_function_pool[29134]: CombinerInputNV (will be remapped) */
+ /* _mesa_function_pool[29127]: CombinerInputNV (will be remapped) */
"iiiiii\0"
"glCombinerInputNV\0"
"\0"
- /* _mesa_function_pool[29160]: VertexAttrib3sARB (will be remapped) */
+ /* _mesa_function_pool[29153]: VertexAttrib3sARB (will be remapped) */
"iiii\0"
"glVertexAttrib3s\0"
"glVertexAttrib3sARB\0"
"\0"
- /* _mesa_function_pool[29203]: IsTransformFeedback (will be remapped) */
+ /* _mesa_function_pool[29196]: IsTransformFeedback (will be remapped) */
"i\0"
"glIsTransformFeedback\0"
"\0"
- /* _mesa_function_pool[29228]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */
+ /* _mesa_function_pool[29221]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */
"ppp\0"
"glReplacementCodeuiNormal3fVertex3fvSUN\0"
"\0"
- /* _mesa_function_pool[29273]: Map2d (offset 222) */
+ /* _mesa_function_pool[29266]: Map2d (offset 222) */
"iddiiddiip\0"
"glMap2d\0"
"\0"
- /* _mesa_function_pool[29293]: Map2f (offset 223) */
+ /* _mesa_function_pool[29286]: Map2f (offset 223) */
"iffiiffiip\0"
"glMap2f\0"
"\0"
- /* _mesa_function_pool[29313]: ProgramStringARB (will be remapped) */
+ /* _mesa_function_pool[29306]: ProgramStringARB (will be remapped) */
"iiip\0"
"glProgramStringARB\0"
"\0"
- /* _mesa_function_pool[29338]: Vertex4s (offset 148) */
+ /* _mesa_function_pool[29331]: Vertex4s (offset 148) */
"iiii\0"
"glVertex4s\0"
"\0"
- /* _mesa_function_pool[29355]: TexCoord4fVertex4fvSUN (dynamic) */
+ /* _mesa_function_pool[29348]: TexCoord4fVertex4fvSUN (dynamic) */
"pp\0"
"glTexCoord4fVertex4fvSUN\0"
"\0"
- /* _mesa_function_pool[29384]: FragmentLightModelivSGIX (dynamic) */
+ /* _mesa_function_pool[29377]: FragmentLightModelivSGIX (dynamic) */
"ip\0"
"glFragmentLightModelivSGIX\0"
"\0"
- /* _mesa_function_pool[29415]: VertexAttrib1fNV (will be remapped) */
+ /* _mesa_function_pool[29408]: VertexAttrib1fNV (will be remapped) */
"if\0"
"glVertexAttrib1fNV\0"
"\0"
- /* _mesa_function_pool[29438]: Vertex4f (offset 144) */
+ /* _mesa_function_pool[29431]: Vertex4f (offset 144) */
"ffff\0"
"glVertex4f\0"
"\0"
- /* _mesa_function_pool[29455]: EvalCoord1d (offset 228) */
+ /* _mesa_function_pool[29448]: EvalCoord1d (offset 228) */
"d\0"
"glEvalCoord1d\0"
"\0"
- /* _mesa_function_pool[29472]: Vertex4d (offset 142) */
+ /* _mesa_function_pool[29465]: Vertex4d (offset 142) */
"dddd\0"
"glVertex4d\0"
"\0"
- /* _mesa_function_pool[29489]: RasterPos4dv (offset 79) */
+ /* _mesa_function_pool[29482]: RasterPos4dv (offset 79) */
"p\0"
"glRasterPos4dv\0"
"\0"
- /* _mesa_function_pool[29507]: UseShaderProgramEXT (will be remapped) */
+ /* _mesa_function_pool[29500]: UseShaderProgramEXT (will be remapped) */
"ii\0"
"glUseShaderProgramEXT\0"
"\0"
- /* _mesa_function_pool[29533]: FragmentLightfSGIX (dynamic) */
+ /* _mesa_function_pool[29526]: FragmentLightfSGIX (dynamic) */
"iif\0"
"glFragmentLightfSGIX\0"
"\0"
- /* _mesa_function_pool[29559]: GetCompressedTexImageARB (will be remapped) */
+ /* _mesa_function_pool[29552]: GetCompressedTexImageARB (will be remapped) */
"iip\0"
"glGetCompressedTexImage\0"
"glGetCompressedTexImageARB\0"
"\0"
- /* _mesa_function_pool[29615]: GetTexGenfv (offset 279) */
+ /* _mesa_function_pool[29608]: GetTexGenfv (offset 279) */
"iip\0"
"glGetTexGenfv\0"
"\0"
- /* _mesa_function_pool[29634]: Vertex4i (offset 146) */
+ /* _mesa_function_pool[29627]: Vertex4i (offset 146) */
"iiii\0"
"glVertex4i\0"
"\0"
- /* _mesa_function_pool[29651]: VertexWeightPointerEXT (dynamic) */
+ /* _mesa_function_pool[29644]: VertexWeightPointerEXT (dynamic) */
"iiip\0"
"glVertexWeightPointerEXT\0"
"\0"
- /* _mesa_function_pool[29682]: GetHistogram (offset 361) */
+ /* _mesa_function_pool[29675]: GetHistogram (offset 361) */
"iiiip\0"
"glGetHistogram\0"
"glGetHistogramEXT\0"
"\0"
- /* _mesa_function_pool[29722]: ActiveStencilFaceEXT (will be remapped) */
+ /* _mesa_function_pool[29715]: ActiveStencilFaceEXT (will be remapped) */
"i\0"
"glActiveStencilFaceEXT\0"
"\0"
- /* _mesa_function_pool[29748]: StencilFuncSeparateATI (will be remapped) */
+ /* _mesa_function_pool[29741]: StencilFuncSeparateATI (will be remapped) */
"iiii\0"
"glStencilFuncSeparateATI\0"
"\0"
- /* _mesa_function_pool[29779]: Materialf (offset 169) */
+ /* _mesa_function_pool[29772]: Materialf (offset 169) */
"iif\0"
"glMaterialf\0"
"\0"
- /* _mesa_function_pool[29796]: GetShaderSourceARB (will be remapped) */
+ /* _mesa_function_pool[29789]: GetShaderSourceARB (will be remapped) */
"iipp\0"
"glGetShaderSource\0"
"glGetShaderSourceARB\0"
"\0"
- /* _mesa_function_pool[29841]: IglooInterfaceSGIX (dynamic) */
+ /* _mesa_function_pool[29834]: IglooInterfaceSGIX (dynamic) */
"ip\0"
"glIglooInterfaceSGIX\0"
"\0"
- /* _mesa_function_pool[29866]: Materiali (offset 171) */
+ /* _mesa_function_pool[29859]: Materiali (offset 171) */
"iii\0"
"glMateriali\0"
"\0"
- /* _mesa_function_pool[29883]: VertexAttrib4dNV (will be remapped) */
+ /* _mesa_function_pool[29876]: VertexAttrib4dNV (will be remapped) */
"idddd\0"
"glVertexAttrib4dNV\0"
"\0"
- /* _mesa_function_pool[29909]: MultiModeDrawElementsIBM (will be remapped) */
+ /* _mesa_function_pool[29902]: MultiModeDrawElementsIBM (will be remapped) */
"ppipii\0"
"glMultiModeDrawElementsIBM\0"
"\0"
- /* _mesa_function_pool[29944]: Indexsv (offset 51) */
+ /* _mesa_function_pool[29937]: Indexsv (offset 51) */
"p\0"
"glIndexsv\0"
"\0"
- /* _mesa_function_pool[29957]: MultiTexCoord4svARB (offset 407) */
+ /* _mesa_function_pool[29950]: MultiTexCoord4svARB (offset 407) */
"ip\0"
"glMultiTexCoord4sv\0"
"glMultiTexCoord4svARB\0"
"\0"
- /* _mesa_function_pool[30002]: LightModelfv (offset 164) */
+ /* _mesa_function_pool[29995]: LightModelfv (offset 164) */
"ip\0"
"glLightModelfv\0"
"\0"
- /* _mesa_function_pool[30021]: TexCoord2dv (offset 103) */
+ /* _mesa_function_pool[30014]: TexCoord2dv (offset 103) */
"p\0"
"glTexCoord2dv\0"
"\0"
- /* _mesa_function_pool[30038]: GenQueriesARB (will be remapped) */
+ /* _mesa_function_pool[30031]: GenQueriesARB (will be remapped) */
"ip\0"
"glGenQueries\0"
"glGenQueriesARB\0"
"\0"
- /* _mesa_function_pool[30071]: EvalCoord1dv (offset 229) */
+ /* _mesa_function_pool[30064]: EvalCoord1dv (offset 229) */
"p\0"
"glEvalCoord1dv\0"
"\0"
- /* _mesa_function_pool[30089]: ReplacementCodeuiVertex3fSUN (dynamic) */
+ /* _mesa_function_pool[30082]: ReplacementCodeuiVertex3fSUN (dynamic) */
"ifff\0"
"glReplacementCodeuiVertex3fSUN\0"
"\0"
- /* _mesa_function_pool[30126]: Translated (offset 303) */
+ /* _mesa_function_pool[30119]: Translated (offset 303) */
"ddd\0"
"glTranslated\0"
"\0"
- /* _mesa_function_pool[30144]: Translatef (offset 304) */
+ /* _mesa_function_pool[30137]: Translatef (offset 304) */
"fff\0"
"glTranslatef\0"
"\0"
- /* _mesa_function_pool[30162]: Uniform3uiEXT (will be remapped) */
+ /* _mesa_function_pool[30155]: Uniform3uiEXT (will be remapped) */
"iiii\0"
"glUniform3uiEXT\0"
"glUniform3ui\0"
"\0"
- /* _mesa_function_pool[30197]: StencilMask (offset 209) */
+ /* _mesa_function_pool[30190]: StencilMask (offset 209) */
"i\0"
"glStencilMask\0"
"\0"
- /* _mesa_function_pool[30214]: Tangent3iEXT (dynamic) */
+ /* _mesa_function_pool[30207]: Tangent3iEXT (dynamic) */
"iii\0"
"glTangent3iEXT\0"
"\0"
- /* _mesa_function_pool[30234]: ClampColorARB (will be remapped) */
+ /* _mesa_function_pool[30227]: ClampColorARB (will be remapped) */
"ii\0"
"glClampColorARB\0"
"\0"
- /* _mesa_function_pool[30254]: GetLightiv (offset 265) */
+ /* _mesa_function_pool[30247]: GetLightiv (offset 265) */
"iip\0"
"glGetLightiv\0"
"\0"
- /* _mesa_function_pool[30272]: GetSamplerParameterIiv (will be remapped) */
+ /* _mesa_function_pool[30265]: GetSamplerParameterIiv (will be remapped) */
"iip\0"
"glGetSamplerParameterIiv\0"
"\0"
- /* _mesa_function_pool[30302]: DrawMeshArraysSUN (dynamic) */
+ /* _mesa_function_pool[30295]: DrawMeshArraysSUN (dynamic) */
"iiii\0"
"glDrawMeshArraysSUN\0"
"\0"
- /* _mesa_function_pool[30328]: IsList (offset 287) */
+ /* _mesa_function_pool[30321]: IsList (offset 287) */
"i\0"
"glIsList\0"
"\0"
- /* _mesa_function_pool[30340]: IsSync (will be remapped) */
+ /* _mesa_function_pool[30333]: IsSync (will be remapped) */
"i\0"
"glIsSync\0"
"\0"
- /* _mesa_function_pool[30352]: RenderMode (offset 196) */
+ /* _mesa_function_pool[30345]: RenderMode (offset 196) */
"i\0"
"glRenderMode\0"
"\0"
- /* _mesa_function_pool[30368]: GetMapControlPointsNV (dynamic) */
+ /* _mesa_function_pool[30361]: GetMapControlPointsNV (dynamic) */
"iiiiiip\0"
"glGetMapControlPointsNV\0"
"\0"
- /* _mesa_function_pool[30401]: DrawBuffersARB (will be remapped) */
+ /* _mesa_function_pool[30394]: DrawBuffersARB (will be remapped) */
"ip\0"
"glDrawBuffers\0"
"glDrawBuffersARB\0"
"glDrawBuffersATI\0"
"\0"
- /* _mesa_function_pool[30453]: ClearBufferiv (will be remapped) */
+ /* _mesa_function_pool[30446]: ClearBufferiv (will be remapped) */
"iip\0"
"glClearBufferiv\0"
"\0"
- /* _mesa_function_pool[30474]: ProgramLocalParameter4fARB (will be remapped) */
+ /* _mesa_function_pool[30467]: ProgramLocalParameter4fARB (will be remapped) */
"iiffff\0"
"glProgramLocalParameter4fARB\0"
"\0"
- /* _mesa_function_pool[30511]: SpriteParameterivSGIX (dynamic) */
+ /* _mesa_function_pool[30504]: SpriteParameterivSGIX (dynamic) */
"ip\0"
"glSpriteParameterivSGIX\0"
"\0"
- /* _mesa_function_pool[30539]: ProvokingVertexEXT (will be remapped) */
+ /* _mesa_function_pool[30532]: ProvokingVertexEXT (will be remapped) */
"i\0"
"glProvokingVertexEXT\0"
"glProvokingVertex\0"
"\0"
- /* _mesa_function_pool[30581]: MultiTexCoord1fARB (offset 378) */
+ /* _mesa_function_pool[30574]: MultiTexCoord1fARB (offset 378) */
"if\0"
"glMultiTexCoord1f\0"
"glMultiTexCoord1fARB\0"
"\0"
- /* _mesa_function_pool[30624]: LoadName (offset 198) */
+ /* _mesa_function_pool[30617]: LoadName (offset 198) */
"i\0"
"glLoadName\0"
"\0"
- /* _mesa_function_pool[30638]: VertexAttribs4ubvNV (will be remapped) */
+ /* _mesa_function_pool[30631]: VertexAttribs4ubvNV (will be remapped) */
"iip\0"
"glVertexAttribs4ubvNV\0"
"\0"
- /* _mesa_function_pool[30665]: WeightsvARB (dynamic) */
+ /* _mesa_function_pool[30658]: WeightsvARB (dynamic) */
"ip\0"
"glWeightsvARB\0"
"\0"
- /* _mesa_function_pool[30683]: Uniform1fvARB (will be remapped) */
+ /* _mesa_function_pool[30676]: Uniform1fvARB (will be remapped) */
"iip\0"
"glUniform1fv\0"
"glUniform1fvARB\0"
"\0"
- /* _mesa_function_pool[30717]: CopyTexSubImage1D (offset 325) */
+ /* _mesa_function_pool[30710]: CopyTexSubImage1D (offset 325) */
"iiiiii\0"
"glCopyTexSubImage1D\0"
"glCopyTexSubImage1DEXT\0"
"\0"
- /* _mesa_function_pool[30768]: CullFace (offset 152) */
+ /* _mesa_function_pool[30761]: CullFace (offset 152) */
"i\0"
"glCullFace\0"
"\0"
- /* _mesa_function_pool[30782]: BindTexture (offset 307) */
+ /* _mesa_function_pool[30775]: BindTexture (offset 307) */
"ii\0"
"glBindTexture\0"
"glBindTextureEXT\0"
"\0"
- /* _mesa_function_pool[30817]: BeginFragmentShaderATI (will be remapped) */
+ /* _mesa_function_pool[30810]: BeginFragmentShaderATI (will be remapped) */
"\0"
"glBeginFragmentShaderATI\0"
"\0"
- /* _mesa_function_pool[30844]: MultiTexCoord4fARB (offset 402) */
+ /* _mesa_function_pool[30837]: MultiTexCoord4fARB (offset 402) */
"iffff\0"
"glMultiTexCoord4f\0"
"glMultiTexCoord4fARB\0"
"\0"
- /* _mesa_function_pool[30890]: VertexAttribs3svNV (will be remapped) */
+ /* _mesa_function_pool[30883]: VertexAttribs3svNV (will be remapped) */
"iip\0"
"glVertexAttribs3svNV\0"
"\0"
- /* _mesa_function_pool[30916]: StencilFunc (offset 243) */
+ /* _mesa_function_pool[30909]: StencilFunc (offset 243) */
"iii\0"
"glStencilFunc\0"
"\0"
- /* _mesa_function_pool[30935]: CopyPixels (offset 255) */
+ /* _mesa_function_pool[30928]: CopyPixels (offset 255) */
"iiiii\0"
"glCopyPixels\0"
"\0"
- /* _mesa_function_pool[30955]: Rectsv (offset 93) */
+ /* _mesa_function_pool[30948]: Rectsv (offset 93) */
"pp\0"
"glRectsv\0"
"\0"
- /* _mesa_function_pool[30968]: ReplacementCodeuivSUN (dynamic) */
+ /* _mesa_function_pool[30961]: ReplacementCodeuivSUN (dynamic) */
"p\0"
"glReplacementCodeuivSUN\0"
"\0"
- /* _mesa_function_pool[30995]: EnableVertexAttribArrayARB (will be remapped) */
+ /* _mesa_function_pool[30988]: EnableVertexAttribArrayARB (will be remapped) */
"i\0"
"glEnableVertexAttribArray\0"
"glEnableVertexAttribArrayARB\0"
"\0"
- /* _mesa_function_pool[31053]: NormalPointervINTEL (dynamic) */
+ /* _mesa_function_pool[31046]: NormalPointervINTEL (dynamic) */
"ip\0"
"glNormalPointervINTEL\0"
"\0"
- /* _mesa_function_pool[31079]: CopyConvolutionFilter2D (offset 355) */
+ /* _mesa_function_pool[31072]: CopyConvolutionFilter2D (offset 355) */
"iiiiii\0"
"glCopyConvolutionFilter2D\0"
"glCopyConvolutionFilter2DEXT\0"
"\0"
- /* _mesa_function_pool[31142]: WindowPos3ivMESA (will be remapped) */
+ /* _mesa_function_pool[31135]: WindowPos3ivMESA (will be remapped) */
"p\0"
"glWindowPos3iv\0"
"glWindowPos3ivARB\0"
"glWindowPos3ivMESA\0"
"\0"
- /* _mesa_function_pool[31197]: CopyBufferSubData (will be remapped) */
+ /* _mesa_function_pool[31190]: CopyBufferSubData (will be remapped) */
"iiiii\0"
"glCopyBufferSubData\0"
"\0"
- /* _mesa_function_pool[31224]: NormalPointer (offset 318) */
+ /* _mesa_function_pool[31217]: NormalPointer (offset 318) */
"iip\0"
"glNormalPointer\0"
"\0"
- /* _mesa_function_pool[31245]: TexParameterfv (offset 179) */
+ /* _mesa_function_pool[31238]: TexParameterfv (offset 179) */
"iip\0"
"glTexParameterfv\0"
"\0"
- /* _mesa_function_pool[31267]: IsBufferARB (will be remapped) */
+ /* _mesa_function_pool[31260]: IsBufferARB (will be remapped) */
"i\0"
"glIsBuffer\0"
"glIsBufferARB\0"
"\0"
- /* _mesa_function_pool[31295]: WindowPos4iMESA (will be remapped) */
+ /* _mesa_function_pool[31288]: WindowPos4iMESA (will be remapped) */
"iiii\0"
"glWindowPos4iMESA\0"
"\0"
- /* _mesa_function_pool[31319]: VertexAttrib4uivARB (will be remapped) */
+ /* _mesa_function_pool[31312]: VertexAttrib4uivARB (will be remapped) */
"ip\0"
"glVertexAttrib4uiv\0"
"glVertexAttrib4uivARB\0"
"\0"
- /* _mesa_function_pool[31364]: Tangent3bvEXT (dynamic) */
+ /* _mesa_function_pool[31357]: Tangent3bvEXT (dynamic) */
"p\0"
"glTangent3bvEXT\0"
"\0"
- /* _mesa_function_pool[31383]: VertexAttribI3uivEXT (will be remapped) */
+ /* _mesa_function_pool[31376]: VertexAttribI3uivEXT (will be remapped) */
"ip\0"
"glVertexAttribI3uivEXT\0"
"glVertexAttribI3uiv\0"
"\0"
- /* _mesa_function_pool[31430]: UniformMatrix3x4fv (will be remapped) */
+ /* _mesa_function_pool[31423]: UniformMatrix3x4fv (will be remapped) */
"iiip\0"
"glUniformMatrix3x4fv\0"
"\0"
- /* _mesa_function_pool[31457]: ClipPlane (offset 150) */
+ /* _mesa_function_pool[31450]: ClipPlane (offset 150) */
"ip\0"
"glClipPlane\0"
"\0"
- /* _mesa_function_pool[31473]: Recti (offset 90) */
+ /* _mesa_function_pool[31466]: Recti (offset 90) */
"iiii\0"
"glRecti\0"
"\0"
- /* _mesa_function_pool[31487]: TrackMatrixNV (will be remapped) */
+ /* _mesa_function_pool[31480]: TrackMatrixNV (will be remapped) */
"iiii\0"
"glTrackMatrixNV\0"
"\0"
- /* _mesa_function_pool[31509]: DrawRangeElementsBaseVertex (will be remapped) */
+ /* _mesa_function_pool[31502]: DrawRangeElementsBaseVertex (will be remapped) */
"iiiiipi\0"
"glDrawRangeElementsBaseVertex\0"
"\0"
- /* _mesa_function_pool[31548]: SamplerParameterIuiv (will be remapped) */
+ /* _mesa_function_pool[31541]: SamplerParameterIuiv (will be remapped) */
"iip\0"
"glSamplerParameterIuiv\0"
"\0"
- /* _mesa_function_pool[31576]: TexCoordPointervINTEL (dynamic) */
+ /* _mesa_function_pool[31569]: TexCoordPointervINTEL (dynamic) */
"iip\0"
"glTexCoordPointervINTEL\0"
"\0"
- /* _mesa_function_pool[31605]: DeleteBuffersARB (will be remapped) */
+ /* _mesa_function_pool[31598]: DeleteBuffersARB (will be remapped) */
"ip\0"
"glDeleteBuffers\0"
"glDeleteBuffersARB\0"
"\0"
- /* _mesa_function_pool[31644]: PixelTransformParameterfvEXT (dynamic) */
+ /* _mesa_function_pool[31637]: PixelTransformParameterfvEXT (dynamic) */
"iip\0"
"glPixelTransformParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[31680]: PrimitiveRestartNV (will be remapped) */
+ /* _mesa_function_pool[31673]: PrimitiveRestartNV (will be remapped) */
"\0"
"glPrimitiveRestartNV\0"
"\0"
- /* _mesa_function_pool[31703]: WindowPos4fvMESA (will be remapped) */
+ /* _mesa_function_pool[31696]: WindowPos4fvMESA (will be remapped) */
"p\0"
"glWindowPos4fvMESA\0"
"\0"
- /* _mesa_function_pool[31725]: GetPixelMapuiv (offset 272) */
+ /* _mesa_function_pool[31718]: GetPixelMapuiv (offset 272) */
"ip\0"
"glGetPixelMapuiv\0"
"\0"
- /* _mesa_function_pool[31746]: Rectf (offset 88) */
+ /* _mesa_function_pool[31739]: Rectf (offset 88) */
"ffff\0"
"glRectf\0"
"\0"
- /* _mesa_function_pool[31760]: VertexAttrib1sNV (will be remapped) */
+ /* _mesa_function_pool[31753]: VertexAttrib1sNV (will be remapped) */
"ii\0"
"glVertexAttrib1sNV\0"
"\0"
- /* _mesa_function_pool[31783]: Indexfv (offset 47) */
+ /* _mesa_function_pool[31776]: Indexfv (offset 47) */
"p\0"
"glIndexfv\0"
"\0"
- /* _mesa_function_pool[31796]: SecondaryColor3svEXT (will be remapped) */
+ /* _mesa_function_pool[31789]: SecondaryColor3svEXT (will be remapped) */
"p\0"
"glSecondaryColor3sv\0"
"glSecondaryColor3svEXT\0"
"\0"
- /* _mesa_function_pool[31842]: LoadTransposeMatrixfARB (will be remapped) */
+ /* _mesa_function_pool[31835]: LoadTransposeMatrixfARB (will be remapped) */
"p\0"
"glLoadTransposeMatrixf\0"
"glLoadTransposeMatrixfARB\0"
"\0"
- /* _mesa_function_pool[31894]: GetPointerv (offset 329) */
+ /* _mesa_function_pool[31887]: GetPointerv (offset 329) */
"ip\0"
"glGetPointerv\0"
"glGetPointervEXT\0"
"\0"
- /* _mesa_function_pool[31929]: Tangent3bEXT (dynamic) */
+ /* _mesa_function_pool[31922]: Tangent3bEXT (dynamic) */
"iii\0"
"glTangent3bEXT\0"
"\0"
- /* _mesa_function_pool[31949]: CombinerParameterfNV (will be remapped) */
+ /* _mesa_function_pool[31942]: CombinerParameterfNV (will be remapped) */
"if\0"
"glCombinerParameterfNV\0"
"\0"
- /* _mesa_function_pool[31976]: IndexMask (offset 212) */
+ /* _mesa_function_pool[31969]: IndexMask (offset 212) */
"i\0"
"glIndexMask\0"
"\0"
- /* _mesa_function_pool[31991]: BindProgramNV (will be remapped) */
+ /* _mesa_function_pool[31984]: BindProgramNV (will be remapped) */
"ii\0"
"glBindProgramARB\0"
"glBindProgramNV\0"
"\0"
- /* _mesa_function_pool[32028]: VertexAttrib4svARB (will be remapped) */
+ /* _mesa_function_pool[32021]: VertexAttrib4svARB (will be remapped) */
"ip\0"
"glVertexAttrib4sv\0"
"glVertexAttrib4svARB\0"
"\0"
- /* _mesa_function_pool[32071]: GetFloatv (offset 262) */
+ /* _mesa_function_pool[32064]: GetFloatv (offset 262) */
"ip\0"
"glGetFloatv\0"
"\0"
- /* _mesa_function_pool[32087]: CreateDebugObjectMESA (dynamic) */
+ /* _mesa_function_pool[32080]: CreateDebugObjectMESA (dynamic) */
"\0"
"glCreateDebugObjectMESA\0"
"\0"
- /* _mesa_function_pool[32113]: GetShaderiv (will be remapped) */
+ /* _mesa_function_pool[32106]: GetShaderiv (will be remapped) */
"iip\0"
"glGetShaderiv\0"
"\0"
- /* _mesa_function_pool[32132]: ClientWaitSync (will be remapped) */
+ /* _mesa_function_pool[32125]: ClientWaitSync (will be remapped) */
"iii\0"
"glClientWaitSync\0"
"\0"
- /* _mesa_function_pool[32154]: TexCoord4s (offset 124) */
+ /* _mesa_function_pool[32147]: TexCoord4s (offset 124) */
"iiii\0"
"glTexCoord4s\0"
"\0"
- /* _mesa_function_pool[32173]: TexCoord3sv (offset 117) */
+ /* _mesa_function_pool[32166]: TexCoord3sv (offset 117) */
"p\0"
"glTexCoord3sv\0"
"\0"
- /* _mesa_function_pool[32190]: BindFragmentShaderATI (will be remapped) */
+ /* _mesa_function_pool[32183]: BindFragmentShaderATI (will be remapped) */
"i\0"
"glBindFragmentShaderATI\0"
"\0"
- /* _mesa_function_pool[32217]: PopAttrib (offset 218) */
+ /* _mesa_function_pool[32210]: PopAttrib (offset 218) */
"\0"
"glPopAttrib\0"
"\0"
- /* _mesa_function_pool[32231]: Fogfv (offset 154) */
+ /* _mesa_function_pool[32224]: Fogfv (offset 154) */
"ip\0"
"glFogfv\0"
"\0"
- /* _mesa_function_pool[32243]: UnmapBufferARB (will be remapped) */
+ /* _mesa_function_pool[32236]: UnmapBufferARB (will be remapped) */
"i\0"
"glUnmapBuffer\0"
"glUnmapBufferARB\0"
"\0"
- /* _mesa_function_pool[32277]: InitNames (offset 197) */
+ /* _mesa_function_pool[32270]: InitNames (offset 197) */
"\0"
"glInitNames\0"
"\0"
- /* _mesa_function_pool[32291]: Normal3sv (offset 61) */
+ /* _mesa_function_pool[32284]: Normal3sv (offset 61) */
"p\0"
"glNormal3sv\0"
"\0"
- /* _mesa_function_pool[32306]: Minmax (offset 368) */
+ /* _mesa_function_pool[32299]: Minmax (offset 368) */
"iii\0"
"glMinmax\0"
"glMinmaxEXT\0"
"\0"
- /* _mesa_function_pool[32332]: TexCoord4d (offset 118) */
+ /* _mesa_function_pool[32325]: TexCoord4d (offset 118) */
"dddd\0"
"glTexCoord4d\0"
"\0"
- /* _mesa_function_pool[32351]: DeformationMap3dSGIX (dynamic) */
+ /* _mesa_function_pool[32344]: DeformationMap3dSGIX (dynamic) */
"iddiiddiiddiip\0"
"glDeformationMap3dSGIX\0"
"\0"
- /* _mesa_function_pool[32390]: TexCoord4f (offset 120) */
+ /* _mesa_function_pool[32383]: TexCoord4f (offset 120) */
"ffff\0"
"glTexCoord4f\0"
"\0"
- /* _mesa_function_pool[32409]: FogCoorddvEXT (will be remapped) */
+ /* _mesa_function_pool[32402]: FogCoorddvEXT (will be remapped) */
"p\0"
"glFogCoorddv\0"
"glFogCoorddvEXT\0"
"\0"
- /* _mesa_function_pool[32441]: FinishTextureSUNX (dynamic) */
+ /* _mesa_function_pool[32434]: FinishTextureSUNX (dynamic) */
"\0"
"glFinishTextureSUNX\0"
"\0"
- /* _mesa_function_pool[32463]: GetFragmentLightfvSGIX (dynamic) */
+ /* _mesa_function_pool[32456]: GetFragmentLightfvSGIX (dynamic) */
"iip\0"
"glGetFragmentLightfvSGIX\0"
"\0"
- /* _mesa_function_pool[32493]: Binormal3fvEXT (dynamic) */
+ /* _mesa_function_pool[32486]: Binormal3fvEXT (dynamic) */
"p\0"
"glBinormal3fvEXT\0"
"\0"
- /* _mesa_function_pool[32513]: GetBooleanv (offset 258) */
+ /* _mesa_function_pool[32506]: GetBooleanv (offset 258) */
"ip\0"
"glGetBooleanv\0"
"\0"
- /* _mesa_function_pool[32531]: ColorFragmentOp3ATI (will be remapped) */
+ /* _mesa_function_pool[32524]: ColorFragmentOp3ATI (will be remapped) */
"iiiiiiiiiiiii\0"
"glColorFragmentOp3ATI\0"
"\0"
- /* _mesa_function_pool[32568]: Hint (offset 158) */
+ /* _mesa_function_pool[32561]: Hint (offset 158) */
"ii\0"
"glHint\0"
"\0"
- /* _mesa_function_pool[32579]: Color4dv (offset 28) */
+ /* _mesa_function_pool[32572]: Color4dv (offset 28) */
"p\0"
"glColor4dv\0"
"\0"
- /* _mesa_function_pool[32593]: VertexAttrib2svARB (will be remapped) */
+ /* _mesa_function_pool[32586]: VertexAttrib2svARB (will be remapped) */
"ip\0"
"glVertexAttrib2sv\0"
"glVertexAttrib2svARB\0"
"\0"
- /* _mesa_function_pool[32636]: AreProgramsResidentNV (will be remapped) */
+ /* _mesa_function_pool[32629]: AreProgramsResidentNV (will be remapped) */
"ipp\0"
"glAreProgramsResidentNV\0"
"\0"
- /* _mesa_function_pool[32665]: WindowPos3svMESA (will be remapped) */
+ /* _mesa_function_pool[32658]: WindowPos3svMESA (will be remapped) */
"p\0"
"glWindowPos3sv\0"
"glWindowPos3svARB\0"
"glWindowPos3svMESA\0"
"\0"
- /* _mesa_function_pool[32720]: CopyColorSubTable (offset 347) */
+ /* _mesa_function_pool[32713]: CopyColorSubTable (offset 347) */
"iiiii\0"
"glCopyColorSubTable\0"
"glCopyColorSubTableEXT\0"
"\0"
- /* _mesa_function_pool[32770]: WeightdvARB (dynamic) */
+ /* _mesa_function_pool[32763]: WeightdvARB (dynamic) */
"ip\0"
"glWeightdvARB\0"
"\0"
- /* _mesa_function_pool[32788]: DeleteRenderbuffersEXT (will be remapped) */
+ /* _mesa_function_pool[32781]: DeleteRenderbuffersEXT (will be remapped) */
"ip\0"
"glDeleteRenderbuffers\0"
"glDeleteRenderbuffersEXT\0"
"\0"
- /* _mesa_function_pool[32839]: VertexAttrib4NubvARB (will be remapped) */
+ /* _mesa_function_pool[32832]: VertexAttrib4NubvARB (will be remapped) */
"ip\0"
"glVertexAttrib4Nubv\0"
"glVertexAttrib4NubvARB\0"
"\0"
- /* _mesa_function_pool[32886]: VertexAttrib3dvNV (will be remapped) */
+ /* _mesa_function_pool[32879]: VertexAttrib3dvNV (will be remapped) */
"ip\0"
"glVertexAttrib3dvNV\0"
"\0"
- /* _mesa_function_pool[32910]: GetObjectParameterfvARB (will be remapped) */
+ /* _mesa_function_pool[32903]: GetObjectParameterfvARB (will be remapped) */
"iip\0"
"glGetObjectParameterfvARB\0"
"\0"
- /* _mesa_function_pool[32941]: Vertex4iv (offset 147) */
+ /* _mesa_function_pool[32934]: Vertex4iv (offset 147) */
"p\0"
"glVertex4iv\0"
"\0"
- /* _mesa_function_pool[32956]: GetProgramEnvParameterdvARB (will be remapped) */
+ /* _mesa_function_pool[32949]: GetProgramEnvParameterdvARB (will be remapped) */
"iip\0"
"glGetProgramEnvParameterdvARB\0"
"\0"
- /* _mesa_function_pool[32991]: TexCoord4dv (offset 119) */
+ /* _mesa_function_pool[32984]: TexCoord4dv (offset 119) */
"p\0"
"glTexCoord4dv\0"
"\0"
- /* _mesa_function_pool[33008]: LockArraysEXT (will be remapped) */
+ /* _mesa_function_pool[33001]: LockArraysEXT (will be remapped) */
"ii\0"
"glLockArraysEXT\0"
"\0"
- /* _mesa_function_pool[33028]: Begin (offset 7) */
+ /* _mesa_function_pool[33021]: Begin (offset 7) */
"i\0"
"glBegin\0"
"\0"
- /* _mesa_function_pool[33039]: LightModeli (offset 165) */
+ /* _mesa_function_pool[33032]: LightModeli (offset 165) */
"ii\0"
"glLightModeli\0"
"\0"
- /* _mesa_function_pool[33057]: VertexAttribI4ivEXT (will be remapped) */
+ /* _mesa_function_pool[33050]: VertexAttribI4ivEXT (will be remapped) */
"ip\0"
"glVertexAttribI4ivEXT\0"
"glVertexAttribI4iv\0"
"\0"
- /* _mesa_function_pool[33102]: Rectfv (offset 89) */
+ /* _mesa_function_pool[33095]: Rectfv (offset 89) */
"pp\0"
"glRectfv\0"
"\0"
- /* _mesa_function_pool[33115]: LightModelf (offset 163) */
+ /* _mesa_function_pool[33108]: LightModelf (offset 163) */
"if\0"
"glLightModelf\0"
"\0"
- /* _mesa_function_pool[33133]: GetTexParameterfv (offset 282) */
+ /* _mesa_function_pool[33126]: GetTexParameterfv (offset 282) */
"iip\0"
"glGetTexParameterfv\0"
"\0"
- /* _mesa_function_pool[33158]: GetLightfv (offset 264) */
+ /* _mesa_function_pool[33151]: GetLightfv (offset 264) */
"iip\0"
"glGetLightfv\0"
"\0"
- /* _mesa_function_pool[33176]: PixelTransformParameterivEXT (dynamic) */
+ /* _mesa_function_pool[33169]: PixelTransformParameterivEXT (dynamic) */
"iip\0"
"glPixelTransformParameterivEXT\0"
"\0"
- /* _mesa_function_pool[33212]: BinormalPointerEXT (dynamic) */
+ /* _mesa_function_pool[33205]: BinormalPointerEXT (dynamic) */
"iip\0"
"glBinormalPointerEXT\0"
"\0"
- /* _mesa_function_pool[33238]: VertexAttrib1dNV (will be remapped) */
+ /* _mesa_function_pool[33231]: VertexAttrib1dNV (will be remapped) */
"id\0"
"glVertexAttrib1dNV\0"
"\0"
- /* _mesa_function_pool[33261]: GetCombinerInputParameterivNV (will be remapped) */
+ /* _mesa_function_pool[33254]: GetCombinerInputParameterivNV (will be remapped) */
"iiiip\0"
"glGetCombinerInputParameterivNV\0"
"\0"
- /* _mesa_function_pool[33300]: Disable (offset 214) */
+ /* _mesa_function_pool[33293]: Disable (offset 214) */
"i\0"
"glDisable\0"
"\0"
- /* _mesa_function_pool[33313]: MultiTexCoord2fvARB (offset 387) */
+ /* _mesa_function_pool[33306]: MultiTexCoord2fvARB (offset 387) */
"ip\0"
"glMultiTexCoord2fv\0"
"glMultiTexCoord2fvARB\0"
"\0"
- /* _mesa_function_pool[33358]: GetRenderbufferParameterivEXT (will be remapped) */
+ /* _mesa_function_pool[33351]: GetRenderbufferParameterivEXT (will be remapped) */
"iip\0"
"glGetRenderbufferParameteriv\0"
"glGetRenderbufferParameterivEXT\0"
"\0"
- /* _mesa_function_pool[33424]: CombinerParameterivNV (will be remapped) */
+ /* _mesa_function_pool[33417]: CombinerParameterivNV (will be remapped) */
"ip\0"
"glCombinerParameterivNV\0"
"\0"
- /* _mesa_function_pool[33452]: GenFragmentShadersATI (will be remapped) */
+ /* _mesa_function_pool[33445]: GenFragmentShadersATI (will be remapped) */
"i\0"
"glGenFragmentShadersATI\0"
"\0"
- /* _mesa_function_pool[33479]: DrawArrays (offset 310) */
+ /* _mesa_function_pool[33472]: DrawArrays (offset 310) */
"iii\0"
"glDrawArrays\0"
"glDrawArraysEXT\0"
"\0"
- /* _mesa_function_pool[33513]: WeightuivARB (dynamic) */
+ /* _mesa_function_pool[33506]: WeightuivARB (dynamic) */
"ip\0"
"glWeightuivARB\0"
"\0"
- /* _mesa_function_pool[33532]: GetVertexAttribIivEXT (will be remapped) */
+ /* _mesa_function_pool[33525]: GetVertexAttribIivEXT (will be remapped) */
"iip\0"
"glGetVertexAttribIivEXT\0"
"glGetVertexAttribIiv\0"
"\0"
- /* _mesa_function_pool[33582]: VertexAttrib2sARB (will be remapped) */
+ /* _mesa_function_pool[33575]: VertexAttrib2sARB (will be remapped) */
"iii\0"
"glVertexAttrib2s\0"
"glVertexAttrib2sARB\0"
"\0"
- /* _mesa_function_pool[33624]: GetnTexImageARB (will be remapped) */
+ /* _mesa_function_pool[33617]: GetnTexImageARB (will be remapped) */
"iiiiip\0"
"glGetnTexImageARB\0"
"\0"
- /* _mesa_function_pool[33650]: ColorMask (offset 210) */
+ /* _mesa_function_pool[33643]: ColorMask (offset 210) */
"iiii\0"
"glColorMask\0"
"\0"
- /* _mesa_function_pool[33668]: GenAsyncMarkersSGIX (dynamic) */
+ /* _mesa_function_pool[33661]: GenAsyncMarkersSGIX (dynamic) */
"i\0"
"glGenAsyncMarkersSGIX\0"
"\0"
- /* _mesa_function_pool[33693]: Tangent3svEXT (dynamic) */
+ /* _mesa_function_pool[33686]: Tangent3svEXT (dynamic) */
"p\0"
"glTangent3svEXT\0"
"\0"
- /* _mesa_function_pool[33712]: GetListParameterivSGIX (dynamic) */
+ /* _mesa_function_pool[33705]: GetListParameterivSGIX (dynamic) */
"iip\0"
"glGetListParameterivSGIX\0"
"\0"
- /* _mesa_function_pool[33742]: BindBufferARB (will be remapped) */
+ /* _mesa_function_pool[33735]: BindBufferARB (will be remapped) */
"ii\0"
"glBindBuffer\0"
"glBindBufferARB\0"
"\0"
- /* _mesa_function_pool[33775]: GetInfoLogARB (will be remapped) */
+ /* _mesa_function_pool[33768]: GetInfoLogARB (will be remapped) */
"iipp\0"
"glGetInfoLogARB\0"
"\0"
- /* _mesa_function_pool[33797]: RasterPos4iv (offset 83) */
+ /* _mesa_function_pool[33790]: RasterPos4iv (offset 83) */
"p\0"
"glRasterPos4iv\0"
"\0"
- /* _mesa_function_pool[33815]: Enable (offset 215) */
+ /* _mesa_function_pool[33808]: Enable (offset 215) */
"i\0"
"glEnable\0"
"\0"
- /* _mesa_function_pool[33827]: LineStipple (offset 167) */
+ /* _mesa_function_pool[33820]: LineStipple (offset 167) */
"ii\0"
"glLineStipple\0"
"\0"
- /* _mesa_function_pool[33845]: VertexAttribs4svNV (will be remapped) */
+ /* _mesa_function_pool[33838]: VertexAttribs4svNV (will be remapped) */
"iip\0"
"glVertexAttribs4svNV\0"
"\0"
- /* _mesa_function_pool[33871]: EdgeFlagPointerListIBM (dynamic) */
+ /* _mesa_function_pool[33864]: EdgeFlagPointerListIBM (dynamic) */
"ipi\0"
"glEdgeFlagPointerListIBM\0"
"\0"
- /* _mesa_function_pool[33901]: UniformMatrix3x2fv (will be remapped) */
+ /* _mesa_function_pool[33894]: UniformMatrix3x2fv (will be remapped) */
"iiip\0"
"glUniformMatrix3x2fv\0"
"\0"
- /* _mesa_function_pool[33928]: GetMinmaxParameterfv (offset 365) */
+ /* _mesa_function_pool[33921]: GetMinmaxParameterfv (offset 365) */
"iip\0"
"glGetMinmaxParameterfv\0"
"glGetMinmaxParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[33982]: VertexAttrib1fvARB (will be remapped) */
+ /* _mesa_function_pool[33975]: VertexAttrib1fvARB (will be remapped) */
"ip\0"
"glVertexAttrib1fv\0"
"glVertexAttrib1fvARB\0"
"\0"
- /* _mesa_function_pool[34025]: GenBuffersARB (will be remapped) */
+ /* _mesa_function_pool[34018]: GenBuffersARB (will be remapped) */
"ip\0"
"glGenBuffers\0"
"glGenBuffersARB\0"
"\0"
- /* _mesa_function_pool[34058]: VertexAttribs1svNV (will be remapped) */
+ /* _mesa_function_pool[34051]: VertexAttribs1svNV (will be remapped) */
"iip\0"
"glVertexAttribs1svNV\0"
"\0"
- /* _mesa_function_pool[34084]: Vertex3fv (offset 137) */
+ /* _mesa_function_pool[34077]: Vertex3fv (offset 137) */
"p\0"
"glVertex3fv\0"
"\0"
- /* _mesa_function_pool[34099]: GetTexBumpParameterivATI (will be remapped) */
+ /* _mesa_function_pool[34092]: GetTexBumpParameterivATI (will be remapped) */
"ip\0"
"glGetTexBumpParameterivATI\0"
"\0"
- /* _mesa_function_pool[34130]: Binormal3bEXT (dynamic) */
+ /* _mesa_function_pool[34123]: Binormal3bEXT (dynamic) */
"iii\0"
"glBinormal3bEXT\0"
"\0"
- /* _mesa_function_pool[34151]: FragmentMaterialivSGIX (dynamic) */
+ /* _mesa_function_pool[34144]: FragmentMaterialivSGIX (dynamic) */
"iip\0"
"glFragmentMaterialivSGIX\0"
"\0"
- /* _mesa_function_pool[34181]: IsRenderbufferEXT (will be remapped) */
+ /* _mesa_function_pool[34174]: IsRenderbufferEXT (will be remapped) */
"i\0"
"glIsRenderbuffer\0"
"glIsRenderbufferEXT\0"
"\0"
- /* _mesa_function_pool[34221]: GenProgramsNV (will be remapped) */
+ /* _mesa_function_pool[34214]: GenProgramsNV (will be remapped) */
"ip\0"
"glGenProgramsARB\0"
"glGenProgramsNV\0"
"\0"
- /* _mesa_function_pool[34258]: VertexAttrib4dvNV (will be remapped) */
+ /* _mesa_function_pool[34251]: VertexAttrib4dvNV (will be remapped) */
"ip\0"
"glVertexAttrib4dvNV\0"
"\0"
- /* _mesa_function_pool[34282]: EndFragmentShaderATI (will be remapped) */
+ /* _mesa_function_pool[34275]: EndFragmentShaderATI (will be remapped) */
"\0"
"glEndFragmentShaderATI\0"
"\0"
- /* _mesa_function_pool[34307]: Binormal3iEXT (dynamic) */
+ /* _mesa_function_pool[34300]: Binormal3iEXT (dynamic) */
"iii\0"
"glBinormal3iEXT\0"
"\0"
- /* _mesa_function_pool[34328]: WindowPos2fMESA (will be remapped) */
+ /* _mesa_function_pool[34321]: WindowPos2fMESA (will be remapped) */
"ff\0"
"glWindowPos2f\0"
"glWindowPos2fARB\0"
@@ -4936,526 +4933,526 @@ static const char _mesa_function_pool[] =
/* these functions need to be remapped */
static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 1590, AttachShader_remap_index },
- { 10243, CreateProgram_remap_index },
- { 23919, CreateShader_remap_index },
- { 26443, DeleteProgram_remap_index },
- { 19399, DeleteShader_remap_index },
- { 24412, DetachShader_remap_index },
- { 18646, GetAttachedShaders_remap_index },
- { 5053, GetProgramInfoLog_remap_index },
+ { 10272, CreateProgram_remap_index },
+ { 23912, CreateShader_remap_index },
+ { 26436, DeleteProgram_remap_index },
+ { 19392, DeleteShader_remap_index },
+ { 24405, DetachShader_remap_index },
+ { 18639, GetAttachedShaders_remap_index },
+ { 5082, GetProgramInfoLog_remap_index },
{ 405, GetProgramiv_remap_index },
- { 6861, GetShaderInfoLog_remap_index },
- { 32113, GetShaderiv_remap_index },
- { 13776, IsProgram_remap_index },
- { 12667, IsShader_remap_index },
- { 10373, StencilFuncSeparate_remap_index },
- { 4031, StencilMaskSeparate_remap_index },
- { 7926, StencilOpSeparate_remap_index },
- { 23153, UniformMatrix2x3fv_remap_index },
+ { 6890, GetShaderInfoLog_remap_index },
+ { 32106, GetShaderiv_remap_index },
+ { 13769, IsProgram_remap_index },
+ { 12696, IsShader_remap_index },
+ { 10402, StencilFuncSeparate_remap_index },
+ { 4060, StencilMaskSeparate_remap_index },
+ { 7955, StencilOpSeparate_remap_index },
+ { 23146, UniformMatrix2x3fv_remap_index },
{ 2920, UniformMatrix2x4fv_remap_index },
- { 33901, UniformMatrix3x2fv_remap_index },
- { 31430, UniformMatrix3x4fv_remap_index },
- { 16766, UniformMatrix4x2fv_remap_index },
- { 3339, UniformMatrix4x3fv_remap_index },
- { 5259, ClampColor_remap_index },
- { 18700, ClearBufferfi_remap_index },
- { 18116, ClearBufferfv_remap_index },
- { 30453, ClearBufferiv_remap_index },
- { 13981, ClearBufferuiv_remap_index },
- { 20736, GetStringi_remap_index },
+ { 33894, UniformMatrix3x2fv_remap_index },
+ { 31423, UniformMatrix3x4fv_remap_index },
+ { 16759, UniformMatrix4x2fv_remap_index },
+ { 3368, UniformMatrix4x3fv_remap_index },
+ { 5288, ClampColor_remap_index },
+ { 18693, ClearBufferfi_remap_index },
+ { 18109, ClearBufferfv_remap_index },
+ { 30446, ClearBufferiv_remap_index },
+ { 13974, ClearBufferuiv_remap_index },
+ { 20729, GetStringi_remap_index },
{ 2861, TexBuffer_remap_index },
{ 938, FramebufferTexture_remap_index },
- { 27479, GetBufferParameteri64v_remap_index },
- { 10473, GetInteger64i_v_remap_index },
- { 24233, VertexAttribDivisor_remap_index },
- { 10261, LoadTransposeMatrixdARB_remap_index },
- { 31842, LoadTransposeMatrixfARB_remap_index },
- { 5898, MultTransposeMatrixdARB_remap_index },
- { 24599, MultTransposeMatrixfARB_remap_index },
+ { 27472, GetBufferParameteri64v_remap_index },
+ { 10502, GetInteger64i_v_remap_index },
+ { 24226, VertexAttribDivisor_remap_index },
+ { 10290, LoadTransposeMatrixdARB_remap_index },
+ { 31835, LoadTransposeMatrixfARB_remap_index },
+ { 5927, MultTransposeMatrixdARB_remap_index },
+ { 24592, MultTransposeMatrixfARB_remap_index },
{ 216, SampleCoverageARB_remap_index },
- { 6124, CompressedTexImage1DARB_remap_index },
- { 25127, CompressedTexImage2DARB_remap_index },
- { 4094, CompressedTexImage3DARB_remap_index },
- { 18988, CompressedTexSubImage1DARB_remap_index },
+ { 6153, CompressedTexImage1DARB_remap_index },
+ { 25120, CompressedTexImage2DARB_remap_index },
+ { 4123, CompressedTexImage3DARB_remap_index },
+ { 18981, CompressedTexSubImage1DARB_remap_index },
{ 2102, CompressedTexSubImage2DARB_remap_index },
- { 21158, CompressedTexSubImage3DARB_remap_index },
- { 29559, GetCompressedTexImageARB_remap_index },
- { 3905, DisableVertexAttribArrayARB_remap_index },
- { 30995, EnableVertexAttribArrayARB_remap_index },
- { 32956, GetProgramEnvParameterdvARB_remap_index },
- { 24479, GetProgramEnvParameterfvARB_remap_index },
- { 28476, GetProgramLocalParameterdvARB_remap_index },
- { 8402, GetProgramLocalParameterfvARB_remap_index },
- { 19164, GetProgramStringARB_remap_index },
- { 28671, GetProgramivARB_remap_index },
- { 21353, GetVertexAttribdvARB_remap_index },
- { 16574, GetVertexAttribfvARB_remap_index },
- { 10077, GetVertexAttribivARB_remap_index },
- { 20199, ProgramEnvParameter4dARB_remap_index },
- { 26193, ProgramEnvParameter4dvARB_remap_index },
- { 17414, ProgramEnvParameter4fARB_remap_index },
- { 9277, ProgramEnvParameter4fvARB_remap_index },
- { 4057, ProgramLocalParameter4dARB_remap_index },
- { 13486, ProgramLocalParameter4dvARB_remap_index },
- { 30474, ProgramLocalParameter4fARB_remap_index },
- { 26839, ProgramLocalParameter4fvARB_remap_index },
- { 29313, ProgramStringARB_remap_index },
- { 20467, VertexAttrib1dARB_remap_index },
- { 16201, VertexAttrib1dvARB_remap_index },
- { 4253, VertexAttrib1fARB_remap_index },
- { 33982, VertexAttrib1fvARB_remap_index },
- { 7452, VertexAttrib1sARB_remap_index },
+ { 21151, CompressedTexSubImage3DARB_remap_index },
+ { 29552, GetCompressedTexImageARB_remap_index },
+ { 3934, DisableVertexAttribArrayARB_remap_index },
+ { 30988, EnableVertexAttribArrayARB_remap_index },
+ { 32949, GetProgramEnvParameterdvARB_remap_index },
+ { 24472, GetProgramEnvParameterfvARB_remap_index },
+ { 28469, GetProgramLocalParameterdvARB_remap_index },
+ { 8431, GetProgramLocalParameterfvARB_remap_index },
+ { 19157, GetProgramStringARB_remap_index },
+ { 28664, GetProgramivARB_remap_index },
+ { 21346, GetVertexAttribdvARB_remap_index },
+ { 16567, GetVertexAttribfvARB_remap_index },
+ { 10106, GetVertexAttribivARB_remap_index },
+ { 20192, ProgramEnvParameter4dARB_remap_index },
+ { 26186, ProgramEnvParameter4dvARB_remap_index },
+ { 17407, ProgramEnvParameter4fARB_remap_index },
+ { 9306, ProgramEnvParameter4fvARB_remap_index },
+ { 4086, ProgramLocalParameter4dARB_remap_index },
+ { 13479, ProgramLocalParameter4dvARB_remap_index },
+ { 30467, ProgramLocalParameter4fARB_remap_index },
+ { 26832, ProgramLocalParameter4fvARB_remap_index },
+ { 29306, ProgramStringARB_remap_index },
+ { 20460, VertexAttrib1dARB_remap_index },
+ { 16194, VertexAttrib1dvARB_remap_index },
+ { 4282, VertexAttrib1fARB_remap_index },
+ { 33975, VertexAttrib1fvARB_remap_index },
+ { 7481, VertexAttrib1sARB_remap_index },
{ 2297, VertexAttrib1svARB_remap_index },
- { 15632, VertexAttrib2dARB_remap_index },
- { 18137, VertexAttrib2dvARB_remap_index },
+ { 15625, VertexAttrib2dARB_remap_index },
+ { 18130, VertexAttrib2dvARB_remap_index },
{ 1648, VertexAttrib2fARB_remap_index },
- { 18250, VertexAttrib2fvARB_remap_index },
- { 33582, VertexAttrib2sARB_remap_index },
- { 32593, VertexAttrib2svARB_remap_index },
- { 11651, VertexAttrib3dARB_remap_index },
- { 8944, VertexAttrib3dvARB_remap_index },
+ { 18243, VertexAttrib2fvARB_remap_index },
+ { 33575, VertexAttrib2sARB_remap_index },
+ { 32586, VertexAttrib2svARB_remap_index },
+ { 11680, VertexAttrib3dARB_remap_index },
+ { 8973, VertexAttrib3dvARB_remap_index },
{ 1735, VertexAttrib3fARB_remap_index },
- { 23470, VertexAttrib3fvARB_remap_index },
- { 29160, VertexAttrib3sARB_remap_index },
- { 21095, VertexAttrib3svARB_remap_index },
- { 5079, VertexAttrib4NbvARB_remap_index },
- { 18523, VertexAttrib4NivARB_remap_index },
- { 23425, VertexAttrib4NsvARB_remap_index },
- { 24431, VertexAttrib4NubARB_remap_index },
- { 32839, VertexAttrib4NubvARB_remap_index },
- { 19850, VertexAttrib4NuivARB_remap_index },
- { 3212, VertexAttrib4NusvARB_remap_index },
- { 11240, VertexAttrib4bvARB_remap_index },
- { 27849, VertexAttrib4dARB_remap_index },
- { 22152, VertexAttrib4dvARB_remap_index },
- { 11805, VertexAttrib4fARB_remap_index },
- { 12209, VertexAttrib4fvARB_remap_index },
- { 10616, VertexAttrib4ivARB_remap_index },
- { 17930, VertexAttrib4sARB_remap_index },
- { 32028, VertexAttrib4svARB_remap_index },
- { 17219, VertexAttrib4ubvARB_remap_index },
- { 31319, VertexAttrib4uivARB_remap_index },
- { 20906, VertexAttrib4usvARB_remap_index },
- { 22968, VertexAttribPointerARB_remap_index },
- { 33742, BindBufferARB_remap_index },
- { 7159, BufferDataARB_remap_index },
+ { 23463, VertexAttrib3fvARB_remap_index },
+ { 29153, VertexAttrib3sARB_remap_index },
+ { 21088, VertexAttrib3svARB_remap_index },
+ { 5108, VertexAttrib4NbvARB_remap_index },
+ { 18516, VertexAttrib4NivARB_remap_index },
+ { 23418, VertexAttrib4NsvARB_remap_index },
+ { 24424, VertexAttrib4NubARB_remap_index },
+ { 32832, VertexAttrib4NubvARB_remap_index },
+ { 19843, VertexAttrib4NuivARB_remap_index },
+ { 3241, VertexAttrib4NusvARB_remap_index },
+ { 11269, VertexAttrib4bvARB_remap_index },
+ { 27842, VertexAttrib4dARB_remap_index },
+ { 22145, VertexAttrib4dvARB_remap_index },
+ { 11834, VertexAttrib4fARB_remap_index },
+ { 12238, VertexAttrib4fvARB_remap_index },
+ { 10645, VertexAttrib4ivARB_remap_index },
+ { 17923, VertexAttrib4sARB_remap_index },
+ { 32021, VertexAttrib4svARB_remap_index },
+ { 17212, VertexAttrib4ubvARB_remap_index },
+ { 31312, VertexAttrib4uivARB_remap_index },
+ { 20899, VertexAttrib4usvARB_remap_index },
+ { 22961, VertexAttribPointerARB_remap_index },
+ { 33735, BindBufferARB_remap_index },
+ { 7188, BufferDataARB_remap_index },
{ 1511, BufferSubDataARB_remap_index },
- { 31605, DeleteBuffersARB_remap_index },
- { 34025, GenBuffersARB_remap_index },
- { 18293, GetBufferParameterivARB_remap_index },
- { 17366, GetBufferPointervARB_remap_index },
+ { 31598, DeleteBuffersARB_remap_index },
+ { 34018, GenBuffersARB_remap_index },
+ { 18286, GetBufferParameterivARB_remap_index },
+ { 17359, GetBufferPointervARB_remap_index },
{ 1464, GetBufferSubDataARB_remap_index },
- { 31267, IsBufferARB_remap_index },
- { 27323, MapBufferARB_remap_index },
- { 32243, UnmapBufferARB_remap_index },
+ { 31260, IsBufferARB_remap_index },
+ { 27316, MapBufferARB_remap_index },
+ { 32236, UnmapBufferARB_remap_index },
{ 312, BeginQueryARB_remap_index },
- { 20562, DeleteQueriesARB_remap_index },
- { 12528, EndQueryARB_remap_index },
- { 30038, GenQueriesARB_remap_index },
+ { 20555, DeleteQueriesARB_remap_index },
+ { 12557, EndQueryARB_remap_index },
+ { 30031, GenQueriesARB_remap_index },
{ 1994, GetQueryObjectivARB_remap_index },
- { 17974, GetQueryObjectuivARB_remap_index },
+ { 17967, GetQueryObjectuivARB_remap_index },
{ 1792, GetQueryivARB_remap_index },
- { 20813, IsQueryARB_remap_index },
- { 8554, AttachObjectARB_remap_index },
- { 19361, CompileShaderARB_remap_index },
- { 3281, CreateProgramObjectARB_remap_index },
- { 7104, CreateShaderObjectARB_remap_index },
- { 14934, DeleteObjectARB_remap_index },
- { 24918, DetachObjectARB_remap_index },
- { 12273, GetActiveUniformARB_remap_index },
- { 9752, GetAttachedObjectsARB_remap_index },
- { 10059, GetHandleARB_remap_index },
- { 33775, GetInfoLogARB_remap_index },
- { 32910, GetObjectParameterfvARB_remap_index },
- { 28350, GetObjectParameterivARB_remap_index },
- { 29796, GetShaderSourceARB_remap_index },
- { 29020, GetUniformLocationARB_remap_index },
- { 24701, GetUniformfvARB_remap_index },
- { 13061, GetUniformivARB_remap_index },
- { 20951, LinkProgramARB_remap_index },
- { 21009, ShaderSourceARB_remap_index },
- { 7826, Uniform1fARB_remap_index },
- { 30683, Uniform1fvARB_remap_index },
- { 22916, Uniform1iARB_remap_index },
- { 21806, Uniform1ivARB_remap_index },
+ { 20806, IsQueryARB_remap_index },
+ { 8583, AttachObjectARB_remap_index },
+ { 19354, CompileShaderARB_remap_index },
+ { 3310, CreateProgramObjectARB_remap_index },
+ { 7133, CreateShaderObjectARB_remap_index },
+ { 14927, DeleteObjectARB_remap_index },
+ { 24911, DetachObjectARB_remap_index },
+ { 12302, GetActiveUniformARB_remap_index },
+ { 9781, GetAttachedObjectsARB_remap_index },
+ { 10088, GetHandleARB_remap_index },
+ { 33768, GetInfoLogARB_remap_index },
+ { 32903, GetObjectParameterfvARB_remap_index },
+ { 28343, GetObjectParameterivARB_remap_index },
+ { 29789, GetShaderSourceARB_remap_index },
+ { 29013, GetUniformLocationARB_remap_index },
+ { 24694, GetUniformfvARB_remap_index },
+ { 13054, GetUniformivARB_remap_index },
+ { 20944, LinkProgramARB_remap_index },
+ { 21002, ShaderSourceARB_remap_index },
+ { 7855, Uniform1fARB_remap_index },
+ { 30676, Uniform1fvARB_remap_index },
+ { 22909, Uniform1iARB_remap_index },
+ { 21799, Uniform1ivARB_remap_index },
{ 2246, Uniform2fARB_remap_index },
- { 14770, Uniform2fvARB_remap_index },
- { 27210, Uniform2iARB_remap_index },
+ { 14763, Uniform2fvARB_remap_index },
+ { 27203, Uniform2iARB_remap_index },
{ 2366, Uniform2ivARB_remap_index },
- { 19471, Uniform3fARB_remap_index },
- { 9782, Uniform3fvARB_remap_index },
- { 6715, Uniform3iARB_remap_index },
- { 17472, Uniform3ivARB_remap_index },
- { 20005, Uniform4fARB_remap_index },
- { 24565, Uniform4fvARB_remap_index },
- { 25827, Uniform4iARB_remap_index },
- { 21319, Uniform4ivARB_remap_index },
- { 8606, UniformMatrix2fvARB_remap_index },
+ { 19464, Uniform3fARB_remap_index },
+ { 9811, Uniform3fvARB_remap_index },
+ { 6744, Uniform3iARB_remap_index },
+ { 17465, Uniform3ivARB_remap_index },
+ { 19998, Uniform4fARB_remap_index },
+ { 24558, Uniform4fvARB_remap_index },
+ { 25820, Uniform4iARB_remap_index },
+ { 21312, Uniform4ivARB_remap_index },
+ { 8635, UniformMatrix2fvARB_remap_index },
{ 17, UniformMatrix3fvARB_remap_index },
{ 2763, UniformMatrix4fvARB_remap_index },
- { 26305, UseProgramObjectARB_remap_index },
- { 15320, ValidateProgramARB_remap_index },
- { 22195, BindAttribLocationARB_remap_index },
- { 5124, GetActiveAttribARB_remap_index },
- { 17086, GetAttribLocationARB_remap_index },
- { 30401, DrawBuffersARB_remap_index },
- { 30234, ClampColorARB_remap_index },
- { 18568, DrawArraysInstancedARB_remap_index },
- { 6776, DrawElementsInstancedARB_remap_index },
- { 13591, RenderbufferStorageMultisample_remap_index },
- { 14062, FramebufferTextureARB_remap_index },
- { 26741, FramebufferTextureFaceARB_remap_index },
- { 25067, ProgramParameteriARB_remap_index },
- { 6296, VertexAttribDivisorARB_remap_index },
- { 20053, FlushMappedBufferRange_remap_index },
- { 28787, MapBufferRange_remap_index },
- { 28694, TexBufferARB_remap_index },
- { 16904, BindVertexArray_remap_index },
- { 15143, GenVertexArrays_remap_index },
- { 31197, CopyBufferSubData_remap_index },
- { 32132, ClientWaitSync_remap_index },
+ { 26298, UseProgramObjectARB_remap_index },
+ { 15313, ValidateProgramARB_remap_index },
+ { 22188, BindAttribLocationARB_remap_index },
+ { 5153, GetActiveAttribARB_remap_index },
+ { 17079, GetAttribLocationARB_remap_index },
+ { 30394, DrawBuffersARB_remap_index },
+ { 30227, ClampColorARB_remap_index },
+ { 18561, DrawArraysInstancedARB_remap_index },
+ { 6805, DrawElementsInstancedARB_remap_index },
+ { 13584, RenderbufferStorageMultisample_remap_index },
+ { 14055, FramebufferTextureARB_remap_index },
+ { 26734, FramebufferTextureFaceARB_remap_index },
+ { 25060, ProgramParameteriARB_remap_index },
+ { 6325, VertexAttribDivisorARB_remap_index },
+ { 20046, FlushMappedBufferRange_remap_index },
+ { 28780, MapBufferRange_remap_index },
+ { 28687, TexBufferARB_remap_index },
+ { 16897, BindVertexArray_remap_index },
+ { 15136, GenVertexArrays_remap_index },
+ { 31190, CopyBufferSubData_remap_index },
+ { 32125, ClientWaitSync_remap_index },
{ 2682, DeleteSync_remap_index },
- { 7493, FenceSync_remap_index },
- { 15691, GetInteger64v_remap_index },
- { 23532, GetSynciv_remap_index },
- { 30340, IsSync_remap_index },
- { 9700, WaitSync_remap_index },
- { 3873, DrawElementsBaseVertex_remap_index },
- { 19216, DrawElementsInstancedBaseVertex_remap_index },
- { 31509, DrawRangeElementsBaseVertex_remap_index },
- { 27354, MultiDrawElementsBaseVertex_remap_index },
- { 17152, BlendEquationSeparateiARB_remap_index },
- { 18386, BlendEquationiARB_remap_index },
- { 13000, BlendFuncSeparateiARB_remap_index },
- { 10125, BlendFunciARB_remap_index },
- { 8468, BindSampler_remap_index },
- { 4232, DeleteSamplers_remap_index },
- { 20426, GenSamplers_remap_index },
- { 30272, GetSamplerParameterIiv_remap_index },
- { 19947, GetSamplerParameterIuiv_remap_index },
- { 4973, GetSamplerParameterfv_remap_index },
- { 26462, GetSamplerParameteriv_remap_index },
- { 14688, IsSampler_remap_index },
- { 16857, SamplerParameterIiv_remap_index },
- { 31548, SamplerParameterIuiv_remap_index },
- { 23205, SamplerParameterf_remap_index },
- { 17013, SamplerParameterfv_remap_index },
- { 23180, SamplerParameteri_remap_index },
- { 18762, SamplerParameteriv_remap_index },
- { 5320, BindTransformFeedback_remap_index },
- { 3308, DeleteTransformFeedbacks_remap_index },
- { 6748, DrawTransformFeedback_remap_index },
- { 9919, GenTransformFeedbacks_remap_index },
- { 29203, IsTransformFeedback_remap_index },
- { 26934, PauseTransformFeedback_remap_index },
- { 5783, ResumeTransformFeedback_remap_index },
- { 22515, ClearDepthf_remap_index },
- { 7052, DepthRangef_remap_index },
- { 14955, GetShaderPrecisionFormat_remap_index },
- { 10313, ReleaseShaderCompiler_remap_index },
- { 11283, ShaderBinary_remap_index },
+ { 7522, FenceSync_remap_index },
+ { 15684, GetInteger64v_remap_index },
+ { 23525, GetSynciv_remap_index },
+ { 30333, IsSync_remap_index },
+ { 9729, WaitSync_remap_index },
+ { 3902, DrawElementsBaseVertex_remap_index },
+ { 19209, DrawElementsInstancedBaseVertex_remap_index },
+ { 31502, DrawRangeElementsBaseVertex_remap_index },
+ { 27347, MultiDrawElementsBaseVertex_remap_index },
+ { 17145, BlendEquationSeparateiARB_remap_index },
+ { 18379, BlendEquationiARB_remap_index },
+ { 12993, BlendFuncSeparateiARB_remap_index },
+ { 10154, BlendFunciARB_remap_index },
+ { 8497, BindSampler_remap_index },
+ { 4261, DeleteSamplers_remap_index },
+ { 20419, GenSamplers_remap_index },
+ { 30265, GetSamplerParameterIiv_remap_index },
+ { 19940, GetSamplerParameterIuiv_remap_index },
+ { 5002, GetSamplerParameterfv_remap_index },
+ { 26455, GetSamplerParameteriv_remap_index },
+ { 14681, IsSampler_remap_index },
+ { 16850, SamplerParameterIiv_remap_index },
+ { 31541, SamplerParameterIuiv_remap_index },
+ { 23198, SamplerParameterf_remap_index },
+ { 17006, SamplerParameterfv_remap_index },
+ { 23173, SamplerParameteri_remap_index },
+ { 18755, SamplerParameteriv_remap_index },
+ { 5349, BindTransformFeedback_remap_index },
+ { 3337, DeleteTransformFeedbacks_remap_index },
+ { 6777, DrawTransformFeedback_remap_index },
+ { 9948, GenTransformFeedbacks_remap_index },
+ { 29196, IsTransformFeedback_remap_index },
+ { 26927, PauseTransformFeedback_remap_index },
+ { 5812, ResumeTransformFeedback_remap_index },
+ { 22508, ClearDepthf_remap_index },
+ { 7081, DepthRangef_remap_index },
+ { 14948, GetShaderPrecisionFormat_remap_index },
+ { 10342, ReleaseShaderCompiler_remap_index },
+ { 11312, ShaderBinary_remap_index },
{ 965, GetGraphicsResetStatusARB_remap_index },
- { 25632, GetnColorTableARB_remap_index },
- { 8237, GetnCompressedTexImageARB_remap_index },
- { 3965, GetnConvolutionFilterARB_remap_index },
- { 16244, GetnHistogramARB_remap_index },
- { 24391, GetnMapdvARB_remap_index },
- { 22947, GetnMapfvARB_remap_index },
+ { 25625, GetnColorTableARB_remap_index },
+ { 8266, GetnCompressedTexImageARB_remap_index },
+ { 3994, GetnConvolutionFilterARB_remap_index },
+ { 16237, GetnHistogramARB_remap_index },
+ { 24384, GetnMapdvARB_remap_index },
+ { 22940, GetnMapfvARB_remap_index },
{ 2225, GetnMapivARB_remap_index },
- { 17734, GetnMinmaxARB_remap_index },
- { 4598, GetnPixelMapfvARB_remap_index },
- { 19824, GetnPixelMapuivARB_remap_index },
+ { 17727, GetnMinmaxARB_remap_index },
+ { 4627, GetnPixelMapfvARB_remap_index },
+ { 19817, GetnPixelMapuivARB_remap_index },
{ 3033, GetnPixelMapusvARB_remap_index },
{ 1344, GetnPolygonStippleARB_remap_index },
- { 21980, GetnSeparableFilterARB_remap_index },
- { 33624, GetnTexImageARB_remap_index },
- { 19191, GetnUniformdvARB_remap_index },
- { 4670, GetnUniformfvARB_remap_index },
- { 10168, GetnUniformivARB_remap_index },
- { 23381, GetnUniformuivARB_remap_index },
+ { 21973, GetnSeparableFilterARB_remap_index },
+ { 33617, GetnTexImageARB_remap_index },
+ { 19184, GetnUniformdvARB_remap_index },
+ { 4699, GetnUniformfvARB_remap_index },
+ { 10197, GetnUniformivARB_remap_index },
+ { 23374, GetnUniformuivARB_remap_index },
{ 2947, ReadnPixelsARB_remap_index },
- { 5651, PolygonOffsetEXT_remap_index },
- { 24154, GetPixelTexGenParameterfvSGIS_remap_index },
- { 4548, GetPixelTexGenParameterivSGIS_remap_index },
- { 23887, PixelTexGenParameterfSGIS_remap_index },
+ { 5680, PolygonOffsetEXT_remap_index },
+ { 24147, GetPixelTexGenParameterfvSGIS_remap_index },
+ { 4577, GetPixelTexGenParameterivSGIS_remap_index },
+ { 23880, PixelTexGenParameterfSGIS_remap_index },
{ 624, PixelTexGenParameterfvSGIS_remap_index },
- { 13099, PixelTexGenParameteriSGIS_remap_index },
- { 14236, PixelTexGenParameterivSGIS_remap_index },
- { 18887, SampleMaskSGIS_remap_index },
- { 20753, SamplePatternSGIS_remap_index },
- { 27283, ColorPointerEXT_remap_index },
- { 18180, EdgeFlagPointerEXT_remap_index },
- { 6369, IndexPointerEXT_remap_index },
- { 6449, NormalPointerEXT_remap_index },
- { 16312, TexCoordPointerEXT_remap_index },
- { 7282, VertexPointerEXT_remap_index },
- { 3675, PointParameterfEXT_remap_index },
- { 8133, PointParameterfvEXT_remap_index },
- { 33008, LockArraysEXT_remap_index },
- { 15384, UnlockArraysEXT_remap_index },
+ { 13092, PixelTexGenParameteriSGIS_remap_index },
+ { 14229, PixelTexGenParameterivSGIS_remap_index },
+ { 18880, SampleMaskSGIS_remap_index },
+ { 20746, SamplePatternSGIS_remap_index },
+ { 27276, ColorPointerEXT_remap_index },
+ { 18173, EdgeFlagPointerEXT_remap_index },
+ { 6398, IndexPointerEXT_remap_index },
+ { 6478, NormalPointerEXT_remap_index },
+ { 16305, TexCoordPointerEXT_remap_index },
+ { 7311, VertexPointerEXT_remap_index },
+ { 3704, PointParameterfEXT_remap_index },
+ { 8162, PointParameterfvEXT_remap_index },
+ { 33001, LockArraysEXT_remap_index },
+ { 15377, UnlockArraysEXT_remap_index },
{ 1252, SecondaryColor3bEXT_remap_index },
- { 8326, SecondaryColor3bvEXT_remap_index },
- { 10793, SecondaryColor3dEXT_remap_index },
- { 26511, SecondaryColor3dvEXT_remap_index },
- { 29069, SecondaryColor3fEXT_remap_index },
- { 18924, SecondaryColor3fvEXT_remap_index },
+ { 8355, SecondaryColor3bvEXT_remap_index },
+ { 10822, SecondaryColor3dEXT_remap_index },
+ { 26504, SecondaryColor3dvEXT_remap_index },
+ { 29062, SecondaryColor3fEXT_remap_index },
+ { 18917, SecondaryColor3fvEXT_remap_index },
{ 470, SecondaryColor3iEXT_remap_index },
- { 16622, SecondaryColor3ivEXT_remap_index },
- { 10401, SecondaryColor3sEXT_remap_index },
- { 31796, SecondaryColor3svEXT_remap_index },
- { 28186, SecondaryColor3ubEXT_remap_index },
- { 22086, SecondaryColor3ubvEXT_remap_index },
- { 13341, SecondaryColor3uiEXT_remap_index },
- { 23774, SecondaryColor3uivEXT_remap_index },
- { 26791, SecondaryColor3usEXT_remap_index },
- { 13414, SecondaryColor3usvEXT_remap_index },
- { 12152, SecondaryColorPointerEXT_remap_index },
- { 26605, MultiDrawArraysEXT_remap_index },
- { 21741, MultiDrawElementsEXT_remap_index },
- { 21936, FogCoordPointerEXT_remap_index },
- { 4721, FogCoorddEXT_remap_index },
- { 32409, FogCoorddvEXT_remap_index },
- { 4838, FogCoordfEXT_remap_index },
- { 28109, FogCoordfvEXT_remap_index },
- { 12252, PixelTexGenSGIX_remap_index },
- { 28714, BlendFuncSeparateEXT_remap_index },
- { 7194, FlushVertexArrayRangeNV_remap_index },
- { 5600, VertexArrayRangeNV_remap_index },
- { 29134, CombinerInputNV_remap_index },
+ { 16615, SecondaryColor3ivEXT_remap_index },
+ { 10430, SecondaryColor3sEXT_remap_index },
+ { 31789, SecondaryColor3svEXT_remap_index },
+ { 28179, SecondaryColor3ubEXT_remap_index },
+ { 22079, SecondaryColor3ubvEXT_remap_index },
+ { 13334, SecondaryColor3uiEXT_remap_index },
+ { 23767, SecondaryColor3uivEXT_remap_index },
+ { 26784, SecondaryColor3usEXT_remap_index },
+ { 13407, SecondaryColor3usvEXT_remap_index },
+ { 12181, SecondaryColorPointerEXT_remap_index },
+ { 26598, MultiDrawArraysEXT_remap_index },
+ { 21734, MultiDrawElementsEXT_remap_index },
+ { 21929, FogCoordPointerEXT_remap_index },
+ { 4750, FogCoorddEXT_remap_index },
+ { 32402, FogCoorddvEXT_remap_index },
+ { 4867, FogCoordfEXT_remap_index },
+ { 28102, FogCoordfvEXT_remap_index },
+ { 12281, PixelTexGenSGIX_remap_index },
+ { 28707, BlendFuncSeparateEXT_remap_index },
+ { 7223, FlushVertexArrayRangeNV_remap_index },
+ { 5629, VertexArrayRangeNV_remap_index },
+ { 29127, CombinerInputNV_remap_index },
{ 2168, CombinerOutputNV_remap_index },
- { 31949, CombinerParameterfNV_remap_index },
- { 5474, CombinerParameterfvNV_remap_index },
- { 23230, CombinerParameteriNV_remap_index },
- { 33424, CombinerParameterivNV_remap_index },
- { 7570, FinalCombinerInputNV_remap_index },
+ { 31942, CombinerParameterfNV_remap_index },
+ { 5503, CombinerParameterfvNV_remap_index },
+ { 23223, CombinerParameteriNV_remap_index },
+ { 33417, CombinerParameterivNV_remap_index },
+ { 7599, FinalCombinerInputNV_remap_index },
{ 1609, GetCombinerInputParameterfvNV_remap_index },
- { 33261, GetCombinerInputParameterivNV_remap_index },
- { 14337, GetCombinerOutputParameterfvNV_remap_index },
- { 14165, GetCombinerOutputParameterivNV_remap_index },
- { 6956, GetFinalCombinerInputParameterfvNV_remap_index },
- { 25699, GetFinalCombinerInputParameterivNV_remap_index },
- { 12978, ResizeBuffersMESA_remap_index },
- { 11478, WindowPos2dMESA_remap_index },
+ { 33254, GetCombinerInputParameterivNV_remap_index },
+ { 14330, GetCombinerOutputParameterfvNV_remap_index },
+ { 14158, GetCombinerOutputParameterivNV_remap_index },
+ { 6985, GetFinalCombinerInputParameterfvNV_remap_index },
+ { 25692, GetFinalCombinerInputParameterivNV_remap_index },
+ { 12971, ResizeBuffersMESA_remap_index },
+ { 11507, WindowPos2dMESA_remap_index },
{ 1045, WindowPos2dvMESA_remap_index },
- { 34328, WindowPos2fMESA_remap_index },
- { 8271, WindowPos2fvMESA_remap_index },
- { 18834, WindowPos2iMESA_remap_index },
- { 21226, WindowPos2ivMESA_remap_index },
- { 21840, WindowPos2sMESA_remap_index },
- { 6038, WindowPos2svMESA_remap_index },
- { 8062, WindowPos3dMESA_remap_index },
- { 14483, WindowPos3dvMESA_remap_index },
+ { 34321, WindowPos2fMESA_remap_index },
+ { 8300, WindowPos2fvMESA_remap_index },
+ { 18827, WindowPos2iMESA_remap_index },
+ { 21219, WindowPos2ivMESA_remap_index },
+ { 21833, WindowPos2sMESA_remap_index },
+ { 6067, WindowPos2svMESA_remap_index },
+ { 8091, WindowPos3dMESA_remap_index },
+ { 14476, WindowPos3dvMESA_remap_index },
{ 516, WindowPos3fMESA_remap_index },
- { 15445, WindowPos3fvMESA_remap_index },
- { 24960, WindowPos3iMESA_remap_index },
- { 31142, WindowPos3ivMESA_remap_index },
- { 19616, WindowPos3sMESA_remap_index },
- { 32665, WindowPos3svMESA_remap_index },
- { 11429, WindowPos4dMESA_remap_index },
- { 17610, WindowPos4dvMESA_remap_index },
- { 14442, WindowPos4fMESA_remap_index },
- { 31703, WindowPos4fvMESA_remap_index },
- { 31295, WindowPos4iMESA_remap_index },
- { 12781, WindowPos4ivMESA_remap_index },
- { 19800, WindowPos4sMESA_remap_index },
- { 3259, WindowPos4svMESA_remap_index },
- { 14204, MultiModeDrawArraysIBM_remap_index },
- { 29909, MultiModeDrawElementsIBM_remap_index },
- { 12556, DeleteFencesNV_remap_index },
- { 28981, FinishFenceNV_remap_index },
- { 3797, GenFencesNV_remap_index },
- { 17590, GetFenceivNV_remap_index },
- { 8539, IsFenceNV_remap_index },
- { 14092, SetFenceNV_remap_index },
- { 4309, TestFenceNV_remap_index },
- { 32636, AreProgramsResidentNV_remap_index },
- { 31991, BindProgramNV_remap_index },
- { 26874, DeleteProgramsNV_remap_index },
- { 22304, ExecuteProgramNV_remap_index },
- { 34221, GenProgramsNV_remap_index },
- { 24259, GetProgramParameterdvNV_remap_index },
- { 10855, GetProgramParameterfvNV_remap_index },
- { 27257, GetProgramStringNV_remap_index },
- { 25337, GetProgramivNV_remap_index },
- { 24514, GetTrackMatrixivNV_remap_index },
- { 27051, GetVertexAttribPointervNV_remap_index },
- { 10496, GetVertexAttribdvNV_remap_index },
- { 9595, GetVertexAttribfvNV_remap_index },
- { 19137, GetVertexAttribivNV_remap_index },
- { 20083, IsProgramNV_remap_index },
- { 9678, LoadProgramNV_remap_index },
- { 28810, ProgramParameters4dvNV_remap_index },
- { 25267, ProgramParameters4fvNV_remap_index },
- { 21530, RequestResidentProgramsNV_remap_index },
- { 31487, TrackMatrixNV_remap_index },
- { 33238, VertexAttrib1dNV_remap_index },
- { 14003, VertexAttrib1dvNV_remap_index },
- { 29415, VertexAttrib1fNV_remap_index },
+ { 15438, WindowPos3fvMESA_remap_index },
+ { 24953, WindowPos3iMESA_remap_index },
+ { 31135, WindowPos3ivMESA_remap_index },
+ { 19609, WindowPos3sMESA_remap_index },
+ { 32658, WindowPos3svMESA_remap_index },
+ { 11458, WindowPos4dMESA_remap_index },
+ { 17603, WindowPos4dvMESA_remap_index },
+ { 14435, WindowPos4fMESA_remap_index },
+ { 31696, WindowPos4fvMESA_remap_index },
+ { 31288, WindowPos4iMESA_remap_index },
+ { 12810, WindowPos4ivMESA_remap_index },
+ { 19793, WindowPos4sMESA_remap_index },
+ { 3288, WindowPos4svMESA_remap_index },
+ { 14197, MultiModeDrawArraysIBM_remap_index },
+ { 29902, MultiModeDrawElementsIBM_remap_index },
+ { 12585, DeleteFencesNV_remap_index },
+ { 28974, FinishFenceNV_remap_index },
+ { 3826, GenFencesNV_remap_index },
+ { 17583, GetFenceivNV_remap_index },
+ { 8568, IsFenceNV_remap_index },
+ { 14085, SetFenceNV_remap_index },
+ { 4338, TestFenceNV_remap_index },
+ { 32629, AreProgramsResidentNV_remap_index },
+ { 31984, BindProgramNV_remap_index },
+ { 26867, DeleteProgramsNV_remap_index },
+ { 22297, ExecuteProgramNV_remap_index },
+ { 34214, GenProgramsNV_remap_index },
+ { 24252, GetProgramParameterdvNV_remap_index },
+ { 10884, GetProgramParameterfvNV_remap_index },
+ { 27250, GetProgramStringNV_remap_index },
+ { 25330, GetProgramivNV_remap_index },
+ { 24507, GetTrackMatrixivNV_remap_index },
+ { 27044, GetVertexAttribPointervNV_remap_index },
+ { 10525, GetVertexAttribdvNV_remap_index },
+ { 9624, GetVertexAttribfvNV_remap_index },
+ { 19130, GetVertexAttribivNV_remap_index },
+ { 20076, IsProgramNV_remap_index },
+ { 9707, LoadProgramNV_remap_index },
+ { 28803, ProgramParameters4dvNV_remap_index },
+ { 25260, ProgramParameters4fvNV_remap_index },
+ { 21523, RequestResidentProgramsNV_remap_index },
+ { 31480, TrackMatrixNV_remap_index },
+ { 33231, VertexAttrib1dNV_remap_index },
+ { 13996, VertexAttrib1dvNV_remap_index },
+ { 29408, VertexAttrib1fNV_remap_index },
{ 2488, VertexAttrib1fvNV_remap_index },
- { 31760, VertexAttrib1sNV_remap_index },
- { 15518, VertexAttrib1svNV_remap_index },
- { 5029, VertexAttrib2dNV_remap_index },
- { 13896, VertexAttrib2dvNV_remap_index },
- { 20985, VertexAttrib2fNV_remap_index },
- { 13462, VertexAttrib2fvNV_remap_index },
- { 6250, VertexAttrib2sNV_remap_index },
- { 19670, VertexAttrib2svNV_remap_index },
- { 11626, VertexAttrib3dNV_remap_index },
- { 32886, VertexAttrib3dvNV_remap_index },
- { 10667, VertexAttrib3fNV_remap_index },
- { 25659, VertexAttrib3fvNV_remap_index },
- { 23023, VertexAttrib3sNV_remap_index },
- { 24541, VertexAttrib3svNV_remap_index },
- { 29883, VertexAttrib4dNV_remap_index },
- { 34258, VertexAttrib4dvNV_remap_index },
- { 5414, VertexAttrib4fNV_remap_index },
- { 9728, VertexAttrib4fvNV_remap_index },
- { 27733, VertexAttrib4sNV_remap_index },
+ { 31753, VertexAttrib1sNV_remap_index },
+ { 15511, VertexAttrib1svNV_remap_index },
+ { 5058, VertexAttrib2dNV_remap_index },
+ { 13889, VertexAttrib2dvNV_remap_index },
+ { 20978, VertexAttrib2fNV_remap_index },
+ { 13455, VertexAttrib2fvNV_remap_index },
+ { 6279, VertexAttrib2sNV_remap_index },
+ { 19663, VertexAttrib2svNV_remap_index },
+ { 11655, VertexAttrib3dNV_remap_index },
+ { 32879, VertexAttrib3dvNV_remap_index },
+ { 10696, VertexAttrib3fNV_remap_index },
+ { 25652, VertexAttrib3fvNV_remap_index },
+ { 23016, VertexAttrib3sNV_remap_index },
+ { 24534, VertexAttrib3svNV_remap_index },
+ { 29876, VertexAttrib4dNV_remap_index },
+ { 34251, VertexAttrib4dvNV_remap_index },
+ { 5443, VertexAttrib4fNV_remap_index },
+ { 9757, VertexAttrib4fvNV_remap_index },
+ { 27726, VertexAttrib4sNV_remap_index },
{ 1422, VertexAttrib4svNV_remap_index },
- { 5187, VertexAttrib4ubNV_remap_index },
+ { 5216, VertexAttrib4ubNV_remap_index },
{ 778, VertexAttrib4ubvNV_remap_index },
- { 22484, VertexAttribPointerNV_remap_index },
+ { 22477, VertexAttribPointerNV_remap_index },
{ 2340, VertexAttribs1dvNV_remap_index },
- { 27139, VertexAttribs1fvNV_remap_index },
- { 34058, VertexAttribs1svNV_remap_index },
- { 10692, VertexAttribs2dvNV_remap_index },
- { 26266, VertexAttribs2fvNV_remap_index },
- { 18206, VertexAttribs2svNV_remap_index },
- { 5502, VertexAttribs3dvNV_remap_index },
+ { 27132, VertexAttribs1fvNV_remap_index },
+ { 34051, VertexAttribs1svNV_remap_index },
+ { 10721, VertexAttribs2dvNV_remap_index },
+ { 26259, VertexAttribs2fvNV_remap_index },
+ { 18199, VertexAttribs2svNV_remap_index },
+ { 5531, VertexAttribs3dvNV_remap_index },
{ 2199, VertexAttribs3fvNV_remap_index },
- { 30890, VertexAttribs3svNV_remap_index },
- { 27823, VertexAttribs4dvNV_remap_index },
- { 5574, VertexAttribs4fvNV_remap_index },
- { 33845, VertexAttribs4svNV_remap_index },
- { 30638, VertexAttribs4ubvNV_remap_index },
- { 27893, GetTexBumpParameterfvATI_remap_index },
- { 34099, GetTexBumpParameterivATI_remap_index },
- { 19314, TexBumpParameterfvATI_remap_index },
- { 21401, TexBumpParameterivATI_remap_index },
- { 16064, AlphaFragmentOp1ATI_remap_index },
- { 26557, AlphaFragmentOp2ATI_remap_index },
- { 25575, AlphaFragmentOp3ATI_remap_index },
- { 30817, BeginFragmentShaderATI_remap_index },
- { 32190, BindFragmentShaderATI_remap_index },
- { 24670, ColorFragmentOp1ATI_remap_index },
- { 4476, ColorFragmentOp2ATI_remap_index },
- { 32531, ColorFragmentOp3ATI_remap_index },
- { 5740, DeleteFragmentShaderATI_remap_index },
- { 34282, EndFragmentShaderATI_remap_index },
- { 33452, GenFragmentShadersATI_remap_index },
- { 26420, PassTexCoordATI_remap_index },
- { 7262, SampleMapATI_remap_index },
- { 28004, SetFragmentShaderConstantATI_remap_index },
+ { 30883, VertexAttribs3svNV_remap_index },
+ { 27816, VertexAttribs4dvNV_remap_index },
+ { 5603, VertexAttribs4fvNV_remap_index },
+ { 33838, VertexAttribs4svNV_remap_index },
+ { 30631, VertexAttribs4ubvNV_remap_index },
+ { 27886, GetTexBumpParameterfvATI_remap_index },
+ { 34092, GetTexBumpParameterivATI_remap_index },
+ { 19307, TexBumpParameterfvATI_remap_index },
+ { 21394, TexBumpParameterivATI_remap_index },
+ { 16057, AlphaFragmentOp1ATI_remap_index },
+ { 26550, AlphaFragmentOp2ATI_remap_index },
+ { 25568, AlphaFragmentOp3ATI_remap_index },
+ { 30810, BeginFragmentShaderATI_remap_index },
+ { 32183, BindFragmentShaderATI_remap_index },
+ { 24663, ColorFragmentOp1ATI_remap_index },
+ { 4505, ColorFragmentOp2ATI_remap_index },
+ { 32524, ColorFragmentOp3ATI_remap_index },
+ { 5769, DeleteFragmentShaderATI_remap_index },
+ { 34275, EndFragmentShaderATI_remap_index },
+ { 33445, GenFragmentShadersATI_remap_index },
+ { 26413, PassTexCoordATI_remap_index },
+ { 7291, SampleMapATI_remap_index },
+ { 27997, SetFragmentShaderConstantATI_remap_index },
{ 363, PointParameteriNV_remap_index },
- { 14644, PointParameterivNV_remap_index },
- { 29722, ActiveStencilFaceEXT_remap_index },
- { 28450, BindVertexArrayAPPLE_remap_index },
+ { 14637, PointParameterivNV_remap_index },
+ { 29715, ActiveStencilFaceEXT_remap_index },
+ { 28443, BindVertexArrayAPPLE_remap_index },
{ 2810, DeleteVertexArraysAPPLE_remap_index },
- { 18673, GenVertexArraysAPPLE_remap_index },
- { 24324, IsVertexArrayAPPLE_remap_index },
+ { 18666, GenVertexArraysAPPLE_remap_index },
+ { 24317, IsVertexArrayAPPLE_remap_index },
{ 819, GetProgramNamedParameterdvNV_remap_index },
- { 3638, GetProgramNamedParameterfvNV_remap_index },
- { 27924, ProgramNamedParameter4dNV_remap_index },
- { 15018, ProgramNamedParameter4dvNV_remap_index },
- { 9211, ProgramNamedParameter4fNV_remap_index },
- { 12117, ProgramNamedParameter4fvNV_remap_index },
- { 17521, PrimitiveRestartIndexNV_remap_index },
- { 31680, PrimitiveRestartNV_remap_index },
- { 25246, DepthBoundsEXT_remap_index },
+ { 3667, GetProgramNamedParameterfvNV_remap_index },
+ { 27917, ProgramNamedParameter4dNV_remap_index },
+ { 15011, ProgramNamedParameter4dvNV_remap_index },
+ { 9240, ProgramNamedParameter4fNV_remap_index },
+ { 12146, ProgramNamedParameter4fvNV_remap_index },
+ { 17514, PrimitiveRestartIndexNV_remap_index },
+ { 31673, PrimitiveRestartNV_remap_index },
+ { 25239, DepthBoundsEXT_remap_index },
{ 1144, BlendEquationSeparateEXT_remap_index },
- { 15219, BindFramebufferEXT_remap_index },
- { 26650, BindRenderbufferEXT_remap_index },
- { 9975, CheckFramebufferStatusEXT_remap_index },
- { 23575, DeleteFramebuffersEXT_remap_index },
- { 32788, DeleteRenderbuffersEXT_remap_index },
- { 13920, FramebufferRenderbufferEXT_remap_index },
- { 14109, FramebufferTexture1DEXT_remap_index },
- { 11911, FramebufferTexture2DEXT_remap_index },
- { 11531, FramebufferTexture3DEXT_remap_index },
- { 24190, GenFramebuffersEXT_remap_index },
- { 18071, GenRenderbuffersEXT_remap_index },
- { 6998, GenerateMipmapEXT_remap_index },
- { 22577, GetFramebufferAttachmentParameterivEXT_remap_index },
- { 33358, GetRenderbufferParameterivEXT_remap_index },
- { 21281, IsFramebufferEXT_remap_index },
- { 34181, IsRenderbufferEXT_remap_index },
- { 8486, RenderbufferStorageEXT_remap_index },
+ { 15212, BindFramebufferEXT_remap_index },
+ { 26643, BindRenderbufferEXT_remap_index },
+ { 10004, CheckFramebufferStatusEXT_remap_index },
+ { 23568, DeleteFramebuffersEXT_remap_index },
+ { 32781, DeleteRenderbuffersEXT_remap_index },
+ { 13913, FramebufferRenderbufferEXT_remap_index },
+ { 14102, FramebufferTexture1DEXT_remap_index },
+ { 11940, FramebufferTexture2DEXT_remap_index },
+ { 11560, FramebufferTexture3DEXT_remap_index },
+ { 24183, GenFramebuffersEXT_remap_index },
+ { 18064, GenRenderbuffersEXT_remap_index },
+ { 7027, GenerateMipmapEXT_remap_index },
+ { 22570, GetFramebufferAttachmentParameterivEXT_remap_index },
+ { 33351, GetRenderbufferParameterivEXT_remap_index },
+ { 21274, IsFramebufferEXT_remap_index },
+ { 34174, IsRenderbufferEXT_remap_index },
+ { 8515, RenderbufferStorageEXT_remap_index },
{ 695, BlitFramebufferEXT_remap_index },
- { 14804, BufferParameteriAPPLE_remap_index },
- { 20115, FlushMappedBufferRangeAPPLE_remap_index },
+ { 14797, BufferParameteriAPPLE_remap_index },
+ { 20108, FlushMappedBufferRangeAPPLE_remap_index },
{ 1867, BindFragDataLocationEXT_remap_index },
- { 25359, GetFragDataLocationEXT_remap_index },
- { 10970, GetUniformuivEXT_remap_index },
- { 33532, GetVertexAttribIivEXT_remap_index },
- { 4326, GetVertexAttribIuivEXT_remap_index },
- { 12389, Uniform1uiEXT_remap_index },
- { 28895, Uniform1uivEXT_remap_index },
- { 23119, Uniform2uiEXT_remap_index },
- { 4440, Uniform2uivEXT_remap_index },
- { 30162, Uniform3uiEXT_remap_index },
- { 15165, Uniform3uivEXT_remap_index },
- { 3562, Uniform4uiEXT_remap_index },
- { 8987, Uniform4uivEXT_remap_index },
- { 19052, VertexAttribI1iEXT_remap_index },
- { 5214, VertexAttribI1ivEXT_remap_index },
+ { 25352, GetFragDataLocationEXT_remap_index },
+ { 10999, GetUniformuivEXT_remap_index },
+ { 33525, GetVertexAttribIivEXT_remap_index },
+ { 4355, GetVertexAttribIuivEXT_remap_index },
+ { 12418, Uniform1uiEXT_remap_index },
+ { 28888, Uniform1uivEXT_remap_index },
+ { 23112, Uniform2uiEXT_remap_index },
+ { 4469, Uniform2uivEXT_remap_index },
+ { 30155, Uniform3uiEXT_remap_index },
+ { 15158, Uniform3uivEXT_remap_index },
+ { 3591, Uniform4uiEXT_remap_index },
+ { 9016, Uniform4uivEXT_remap_index },
+ { 19045, VertexAttribI1iEXT_remap_index },
+ { 5243, VertexAttribI1ivEXT_remap_index },
{ 2589, VertexAttribI1uiEXT_remap_index },
- { 13190, VertexAttribI1uivEXT_remap_index },
+ { 13183, VertexAttribI1uivEXT_remap_index },
{ 81, VertexAttribI2iEXT_remap_index },
- { 24782, VertexAttribI2ivEXT_remap_index },
- { 5528, VertexAttribI2uiEXT_remap_index },
- { 4883, VertexAttribI2uivEXT_remap_index },
- { 27525, VertexAttribI3iEXT_remap_index },
- { 25984, VertexAttribI3ivEXT_remap_index },
- { 3416, VertexAttribI3uiEXT_remap_index },
- { 31383, VertexAttribI3uivEXT_remap_index },
- { 22828, VertexAttribI4bvEXT_remap_index },
- { 15097, VertexAttribI4iEXT_remap_index },
- { 33057, VertexAttribI4ivEXT_remap_index },
- { 13823, VertexAttribI4svEXT_remap_index },
- { 17039, VertexAttribI4ubvEXT_remap_index },
- { 16685, VertexAttribI4uiEXT_remap_index },
- { 5674, VertexAttribI4uivEXT_remap_index },
- { 11694, VertexAttribI4usvEXT_remap_index },
- { 19258, VertexAttribIPointerEXT_remap_index },
+ { 24775, VertexAttribI2ivEXT_remap_index },
+ { 5557, VertexAttribI2uiEXT_remap_index },
+ { 4912, VertexAttribI2uivEXT_remap_index },
+ { 27518, VertexAttribI3iEXT_remap_index },
+ { 25977, VertexAttribI3ivEXT_remap_index },
+ { 3445, VertexAttribI3uiEXT_remap_index },
+ { 31376, VertexAttribI3uivEXT_remap_index },
+ { 22821, VertexAttribI4bvEXT_remap_index },
+ { 15090, VertexAttribI4iEXT_remap_index },
+ { 33050, VertexAttribI4ivEXT_remap_index },
+ { 13816, VertexAttribI4svEXT_remap_index },
+ { 17032, VertexAttribI4ubvEXT_remap_index },
+ { 16678, VertexAttribI4uiEXT_remap_index },
+ { 5703, VertexAttribI4uivEXT_remap_index },
+ { 11723, VertexAttribI4usvEXT_remap_index },
+ { 19251, VertexAttribIPointerEXT_remap_index },
{ 3103, FramebufferTextureLayerEXT_remap_index },
- { 5950, ColorMaskIndexedEXT_remap_index },
- { 19694, DisableIndexedEXT_remap_index },
- { 27570, EnableIndexedEXT_remap_index },
- { 22532, GetBooleanIndexedvEXT_remap_index },
- { 11305, GetIntegerIndexedvEXT_remap_index },
- { 23651, IsEnabledIndexedEXT_remap_index },
- { 23551, ClearColorIiEXT_remap_index },
- { 3512, ClearColorIuiEXT_remap_index },
- { 10193, GetTexParameterIivEXT_remap_index },
- { 6198, GetTexParameterIuivEXT_remap_index },
+ { 5979, ColorMaskIndexedEXT_remap_index },
+ { 19687, DisableIndexedEXT_remap_index },
+ { 27563, EnableIndexedEXT_remap_index },
+ { 22525, GetBooleanIndexedvEXT_remap_index },
+ { 11334, GetIntegerIndexedvEXT_remap_index },
+ { 23644, IsEnabledIndexedEXT_remap_index },
+ { 23544, ClearColorIiEXT_remap_index },
+ { 3541, ClearColorIuiEXT_remap_index },
+ { 10222, GetTexParameterIivEXT_remap_index },
+ { 6227, GetTexParameterIuivEXT_remap_index },
{ 3059, TexParameterIivEXT_remap_index },
- { 27392, TexParameterIuivEXT_remap_index },
- { 4751, BeginConditionalRenderNV_remap_index },
- { 26370, EndConditionalRenderNV_remap_index },
- { 9622, BeginTransformFeedbackEXT_remap_index },
- { 19729, BindBufferBaseEXT_remap_index },
- { 19588, BindBufferOffsetEXT_remap_index },
- { 12606, BindBufferRangeEXT_remap_index },
- { 14719, EndTransformFeedbackEXT_remap_index },
- { 11168, GetTransformFeedbackVaryingEXT_remap_index },
- { 21586, TransformFeedbackVaryingsEXT_remap_index },
- { 30539, ProvokingVertexEXT_remap_index },
- { 11116, GetTexParameterPointervAPPLE_remap_index },
- { 5276, TextureRangeAPPLE_remap_index },
- { 11983, GetObjectParameterivAPPLE_remap_index },
- { 20708, ObjectPurgeableAPPLE_remap_index },
- { 5992, ObjectUnpurgeableAPPLE_remap_index },
- { 17893, ActiveProgramEXT_remap_index },
- { 17864, CreateShaderProgramEXT_remap_index },
- { 29507, UseShaderProgramEXT_remap_index },
- { 16992, TextureBarrierNV_remap_index },
- { 29748, StencilFuncSeparateATI_remap_index },
- { 5863, ProgramEnvParameters4fvEXT_remap_index },
- { 17758, ProgramLocalParameters4fvEXT_remap_index },
- { 14572, GetQueryObjecti64vEXT_remap_index },
- { 10718, GetQueryObjectui64vEXT_remap_index },
- { 24739, EGLImageTargetRenderbufferStorageOES_remap_index },
- { 12495, EGLImageTargetTexture2DOES_remap_index },
+ { 27385, TexParameterIuivEXT_remap_index },
+ { 4780, BeginConditionalRenderNV_remap_index },
+ { 26363, EndConditionalRenderNV_remap_index },
+ { 9651, BeginTransformFeedbackEXT_remap_index },
+ { 19722, BindBufferBaseEXT_remap_index },
+ { 19581, BindBufferOffsetEXT_remap_index },
+ { 12635, BindBufferRangeEXT_remap_index },
+ { 14712, EndTransformFeedbackEXT_remap_index },
+ { 11197, GetTransformFeedbackVaryingEXT_remap_index },
+ { 21579, TransformFeedbackVaryingsEXT_remap_index },
+ { 30532, ProvokingVertexEXT_remap_index },
+ { 11145, GetTexParameterPointervAPPLE_remap_index },
+ { 5305, TextureRangeAPPLE_remap_index },
+ { 12012, GetObjectParameterivAPPLE_remap_index },
+ { 20701, ObjectPurgeableAPPLE_remap_index },
+ { 6021, ObjectUnpurgeableAPPLE_remap_index },
+ { 17886, ActiveProgramEXT_remap_index },
+ { 17857, CreateShaderProgramEXT_remap_index },
+ { 29500, UseShaderProgramEXT_remap_index },
+ { 16985, TextureBarrierNV_remap_index },
+ { 29741, StencilFuncSeparateATI_remap_index },
+ { 5892, ProgramEnvParameters4fvEXT_remap_index },
+ { 17751, ProgramLocalParameters4fvEXT_remap_index },
+ { 14565, GetQueryObjecti64vEXT_remap_index },
+ { 10747, GetQueryObjectui64vEXT_remap_index },
+ { 24732, EGLImageTargetRenderbufferStorageOES_remap_index },
+ { 12524, EGLImageTargetTexture2DOES_remap_index },
{ -1, -1 }
};
@@ -5464,108 +5461,108 @@ static const struct gl_function_remap MESA_alt_functions[] = {
/* from GL_EXT_blend_color */
{ 2728, _gloffset_BlendColor },
/* from GL_EXT_blend_minmax */
- { 11588, _gloffset_BlendEquation },
+ { 11617, _gloffset_BlendEquation },
/* from GL_EXT_color_subtable */
- { 17632, _gloffset_ColorSubTable },
- { 32720, _gloffset_CopyColorSubTable },
+ { 17625, _gloffset_ColorSubTable },
+ { 32713, _gloffset_CopyColorSubTable },
/* from GL_EXT_convolution */
{ 257, _gloffset_ConvolutionFilter1D },
{ 2527, _gloffset_CopyConvolutionFilter1D },
- { 4168, _gloffset_GetConvolutionParameteriv },
- { 8835, _gloffset_ConvolutionFilter2D },
- { 9037, _gloffset_ConvolutionParameteriv },
- { 9497, _gloffset_ConvolutionParameterfv },
- { 21429, _gloffset_GetSeparableFilter },
- { 25014, _gloffset_SeparableFilter2D },
- { 25877, _gloffset_ConvolutionParameteri },
- { 26045, _gloffset_ConvolutionParameterf },
- { 27759, _gloffset_GetConvolutionParameterfv },
- { 28616, _gloffset_GetConvolutionFilter },
- { 31079, _gloffset_CopyConvolutionFilter2D },
+ { 4197, _gloffset_GetConvolutionParameteriv },
+ { 8864, _gloffset_ConvolutionFilter2D },
+ { 9066, _gloffset_ConvolutionParameteriv },
+ { 9526, _gloffset_ConvolutionParameterfv },
+ { 21422, _gloffset_GetSeparableFilter },
+ { 25007, _gloffset_SeparableFilter2D },
+ { 25870, _gloffset_ConvolutionParameteri },
+ { 26038, _gloffset_ConvolutionParameterf },
+ { 27752, _gloffset_GetConvolutionParameterfv },
+ { 28609, _gloffset_GetConvolutionFilter },
+ { 31072, _gloffset_CopyConvolutionFilter2D },
/* from GL_EXT_copy_texture */
- { 15578, _gloffset_CopyTexSubImage3D },
- { 17319, _gloffset_CopyTexImage2D },
- { 25485, _gloffset_CopyTexImage1D },
- { 28297, _gloffset_CopyTexSubImage2D },
- { 30717, _gloffset_CopyTexSubImage1D },
+ { 15571, _gloffset_CopyTexSubImage3D },
+ { 17312, _gloffset_CopyTexImage2D },
+ { 25478, _gloffset_CopyTexImage1D },
+ { 28290, _gloffset_CopyTexSubImage2D },
+ { 30710, _gloffset_CopyTexSubImage1D },
/* from GL_EXT_draw_range_elements */
- { 9834, _gloffset_DrawRangeElements },
+ { 9863, _gloffset_DrawRangeElements },
/* from GL_EXT_histogram */
{ 856, _gloffset_Histogram },
- { 3598, _gloffset_ResetHistogram },
- { 10339, _gloffset_GetMinmax },
- { 15912, _gloffset_GetHistogramParameterfv },
- { 25410, _gloffset_GetMinmaxParameteriv },
- { 27649, _gloffset_ResetMinmax },
- { 28513, _gloffset_GetHistogramParameteriv },
- { 29682, _gloffset_GetHistogram },
- { 32306, _gloffset_Minmax },
- { 33928, _gloffset_GetMinmaxParameterfv },
+ { 3627, _gloffset_ResetHistogram },
+ { 10368, _gloffset_GetMinmax },
+ { 15905, _gloffset_GetHistogramParameterfv },
+ { 25403, _gloffset_GetMinmaxParameteriv },
+ { 27642, _gloffset_ResetMinmax },
+ { 28506, _gloffset_GetHistogramParameteriv },
+ { 29675, _gloffset_GetHistogram },
+ { 32299, _gloffset_Minmax },
+ { 33921, _gloffset_GetMinmaxParameterfv },
/* from GL_EXT_paletted_texture */
- { 8697, _gloffset_ColorTable },
- { 15758, _gloffset_GetColorTable },
- { 23937, _gloffset_GetColorTableParameterfv },
- { 26101, _gloffset_GetColorTableParameteriv },
+ { 8726, _gloffset_ColorTable },
+ { 15751, _gloffset_GetColorTable },
+ { 23930, _gloffset_GetColorTableParameterfv },
+ { 26094, _gloffset_GetColorTableParameteriv },
/* from GL_EXT_subtexture */
- { 7408, _gloffset_TexSubImage1D },
- { 11043, _gloffset_TexSubImage2D },
+ { 7437, _gloffset_TexSubImage1D },
+ { 11072, _gloffset_TexSubImage2D },
/* from GL_EXT_texture3D */
{ 1826, _gloffset_TexImage3D },
- { 23706, _gloffset_TexSubImage3D },
+ { 23699, _gloffset_TexSubImage3D },
/* from GL_EXT_texture_object */
- { 3366, _gloffset_PrioritizeTextures },
- { 7857, _gloffset_AreTexturesResident },
- { 14027, _gloffset_GenTextures },
- { 16271, _gloffset_DeleteTextures },
- { 20396, _gloffset_IsTexture },
- { 30782, _gloffset_BindTexture },
+ { 3395, _gloffset_PrioritizeTextures },
+ { 7886, _gloffset_AreTexturesResident },
+ { 14020, _gloffset_GenTextures },
+ { 16264, _gloffset_DeleteTextures },
+ { 20389, _gloffset_IsTexture },
+ { 30775, _gloffset_BindTexture },
/* from GL_EXT_vertex_array */
- { 25186, _gloffset_ArrayElement },
- { 31894, _gloffset_GetPointerv },
- { 33479, _gloffset_DrawArrays },
+ { 25179, _gloffset_ArrayElement },
+ { 31887, _gloffset_GetPointerv },
+ { 33472, _gloffset_DrawArrays },
/* from GL_SGI_color_table */
- { 7975, _gloffset_ColorTableParameteriv },
- { 8697, _gloffset_ColorTable },
- { 15758, _gloffset_GetColorTable },
- { 15868, _gloffset_CopyColorTable },
- { 20257, _gloffset_ColorTableParameterfv },
- { 23937, _gloffset_GetColorTableParameterfv },
- { 26101, _gloffset_GetColorTableParameteriv },
+ { 8004, _gloffset_ColorTableParameteriv },
+ { 8726, _gloffset_ColorTable },
+ { 15751, _gloffset_GetColorTable },
+ { 15861, _gloffset_CopyColorTable },
+ { 20250, _gloffset_ColorTableParameterfv },
+ { 23930, _gloffset_GetColorTableParameterfv },
+ { 26094, _gloffset_GetColorTableParameteriv },
/* from GL_VERSION_1_3 */
{ 425, _gloffset_MultiTexCoord3sARB },
{ 657, _gloffset_ActiveTextureARB },
- { 4378, _gloffset_MultiTexCoord1fvARB },
- { 6474, _gloffset_MultiTexCoord3dARB },
- { 6519, _gloffset_MultiTexCoord2iARB },
- { 6643, _gloffset_MultiTexCoord2svARB },
- { 8653, _gloffset_MultiTexCoord2fARB },
- { 10748, _gloffset_MultiTexCoord3fvARB },
- { 11350, _gloffset_MultiTexCoord4sARB },
- { 12031, _gloffset_MultiTexCoord2dvARB },
- { 12438, _gloffset_MultiTexCoord1svARB },
- { 12839, _gloffset_MultiTexCoord3svARB },
- { 12900, _gloffset_MultiTexCoord4iARB },
- { 13731, _gloffset_MultiTexCoord3iARB },
- { 14601, _gloffset_MultiTexCoord1dARB },
- { 14833, _gloffset_MultiTexCoord3dvARB },
- { 16112, _gloffset_MultiTexCoord3ivARB },
- { 16157, _gloffset_MultiTexCoord2sARB },
- { 17689, _gloffset_MultiTexCoord4ivARB },
- { 19897, _gloffset_ClientActiveTextureARB },
- { 22260, _gloffset_MultiTexCoord2dARB },
- { 22697, _gloffset_MultiTexCoord4dvARB },
- { 23074, _gloffset_MultiTexCoord4fvARB },
- { 24078, _gloffset_MultiTexCoord3fARB },
- { 26695, _gloffset_MultiTexCoord4dARB },
- { 26961, _gloffset_MultiTexCoord1sARB },
- { 27165, _gloffset_MultiTexCoord1dvARB },
- { 28141, _gloffset_MultiTexCoord1ivARB },
- { 28234, _gloffset_MultiTexCoord2ivARB },
- { 28573, _gloffset_MultiTexCoord1iARB },
- { 29957, _gloffset_MultiTexCoord4svARB },
- { 30581, _gloffset_MultiTexCoord1fARB },
- { 30844, _gloffset_MultiTexCoord4fARB },
- { 33313, _gloffset_MultiTexCoord2fvARB },
+ { 4407, _gloffset_MultiTexCoord1fvARB },
+ { 6503, _gloffset_MultiTexCoord3dARB },
+ { 6548, _gloffset_MultiTexCoord2iARB },
+ { 6672, _gloffset_MultiTexCoord2svARB },
+ { 8682, _gloffset_MultiTexCoord2fARB },
+ { 10777, _gloffset_MultiTexCoord3fvARB },
+ { 11379, _gloffset_MultiTexCoord4sARB },
+ { 12060, _gloffset_MultiTexCoord2dvARB },
+ { 12467, _gloffset_MultiTexCoord1svARB },
+ { 12832, _gloffset_MultiTexCoord3svARB },
+ { 12893, _gloffset_MultiTexCoord4iARB },
+ { 13724, _gloffset_MultiTexCoord3iARB },
+ { 14594, _gloffset_MultiTexCoord1dARB },
+ { 14826, _gloffset_MultiTexCoord3dvARB },
+ { 16105, _gloffset_MultiTexCoord3ivARB },
+ { 16150, _gloffset_MultiTexCoord2sARB },
+ { 17682, _gloffset_MultiTexCoord4ivARB },
+ { 19890, _gloffset_ClientActiveTextureARB },
+ { 22253, _gloffset_MultiTexCoord2dARB },
+ { 22690, _gloffset_MultiTexCoord4dvARB },
+ { 23067, _gloffset_MultiTexCoord4fvARB },
+ { 24071, _gloffset_MultiTexCoord3fARB },
+ { 26688, _gloffset_MultiTexCoord4dARB },
+ { 26954, _gloffset_MultiTexCoord1sARB },
+ { 27158, _gloffset_MultiTexCoord1dvARB },
+ { 28134, _gloffset_MultiTexCoord1ivARB },
+ { 28227, _gloffset_MultiTexCoord2ivARB },
+ { 28566, _gloffset_MultiTexCoord1iARB },
+ { 29950, _gloffset_MultiTexCoord4svARB },
+ { 30574, _gloffset_MultiTexCoord1fARB },
+ { 30837, _gloffset_MultiTexCoord4fARB },
+ { 33306, _gloffset_MultiTexCoord2fvARB },
{ -1, -1 }
};
@@ -5573,7 +5570,7 @@ static const struct gl_function_remap MESA_alt_functions[] = {
#if defined(need_GL_3DFX_tbuffer)
static const struct gl_function_remap GL_3DFX_tbuffer_functions[] = {
- { 9555, -1 }, /* TbufferMask3DFX */
+ { 9584, -1 }, /* TbufferMask3DFX */
{ -1, -1 }
};
#endif
@@ -5672,7 +5669,6 @@ static const struct gl_function_remap GL_ARB_framebuffer_object_functions[] = {
#if defined(need_GL_ARB_geometry_shader4)
/* functions defined in MESA_remap_table_functions are excluded */
static const struct gl_function_remap GL_ARB_geometry_shader4_functions[] = {
- { 12803, -1 }, /* FramebufferTextureLayer */
{ -1, -1 }
};
#endif
@@ -5693,11 +5689,11 @@ static const struct gl_function_remap GL_ARB_map_buffer_range_functions[] = {
#if defined(need_GL_ARB_matrix_palette)
static const struct gl_function_remap GL_ARB_matrix_palette_functions[] = {
- { 3849, -1 }, /* MatrixIndexusvARB */
- { 13552, -1 }, /* MatrixIndexuivARB */
- { 14988, -1 }, /* MatrixIndexPointerARB */
- { 20663, -1 }, /* CurrentPaletteMatrixARB */
- { 23822, -1 }, /* MatrixIndexubvARB */
+ { 3878, -1 }, /* MatrixIndexusvARB */
+ { 13545, -1 }, /* MatrixIndexuivARB */
+ { 14981, -1 }, /* MatrixIndexPointerARB */
+ { 20656, -1 }, /* CurrentPaletteMatrixARB */
+ { 23815, -1 }, /* MatrixIndexubvARB */
{ -1, -1 }
};
#endif
@@ -5796,15 +5792,15 @@ static const struct gl_function_remap GL_ARB_vertex_array_object_functions[] = {
#if defined(need_GL_ARB_vertex_blend)
static const struct gl_function_remap GL_ARB_vertex_blend_functions[] = {
{ 2469, -1 }, /* WeightubvARB */
- { 6886, -1 }, /* WeightivARB */
- { 11453, -1 }, /* WeightPointerARB */
- { 14319, -1 }, /* WeightfvARB */
- { 18232, -1 }, /* WeightbvARB */
- { 21893, -1 }, /* WeightusvARB */
- { 24940, -1 }, /* VertexBlendARB */
- { 30665, -1 }, /* WeightsvARB */
- { 32770, -1 }, /* WeightdvARB */
- { 33513, -1 }, /* WeightuivARB */
+ { 6915, -1 }, /* WeightivARB */
+ { 11482, -1 }, /* WeightPointerARB */
+ { 14312, -1 }, /* WeightfvARB */
+ { 18225, -1 }, /* WeightbvARB */
+ { 21886, -1 }, /* WeightusvARB */
+ { 24933, -1 }, /* VertexBlendARB */
+ { 30658, -1 }, /* WeightsvARB */
+ { 32763, -1 }, /* WeightdvARB */
+ { 33506, -1 }, /* WeightuivARB */
{ -1, -1 }
};
#endif
@@ -5895,15 +5891,15 @@ static const struct gl_function_remap GL_EXT_blend_func_separate_functions[] = {
#if defined(need_GL_EXT_blend_minmax)
static const struct gl_function_remap GL_EXT_blend_minmax_functions[] = {
- { 11588, _gloffset_BlendEquation },
+ { 11617, _gloffset_BlendEquation },
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_color_subtable)
static const struct gl_function_remap GL_EXT_color_subtable_functions[] = {
- { 17632, _gloffset_ColorSubTable },
- { 32720, _gloffset_CopyColorSubTable },
+ { 17625, _gloffset_ColorSubTable },
+ { 32713, _gloffset_CopyColorSubTable },
{ -1, -1 }
};
#endif
@@ -5919,64 +5915,64 @@ static const struct gl_function_remap GL_EXT_compiled_vertex_array_functions[] =
static const struct gl_function_remap GL_EXT_convolution_functions[] = {
{ 257, _gloffset_ConvolutionFilter1D },
{ 2527, _gloffset_CopyConvolutionFilter1D },
- { 4168, _gloffset_GetConvolutionParameteriv },
- { 8835, _gloffset_ConvolutionFilter2D },
- { 9037, _gloffset_ConvolutionParameteriv },
- { 9497, _gloffset_ConvolutionParameterfv },
- { 21429, _gloffset_GetSeparableFilter },
- { 25014, _gloffset_SeparableFilter2D },
- { 25877, _gloffset_ConvolutionParameteri },
- { 26045, _gloffset_ConvolutionParameterf },
- { 27759, _gloffset_GetConvolutionParameterfv },
- { 28616, _gloffset_GetConvolutionFilter },
- { 31079, _gloffset_CopyConvolutionFilter2D },
+ { 4197, _gloffset_GetConvolutionParameteriv },
+ { 8864, _gloffset_ConvolutionFilter2D },
+ { 9066, _gloffset_ConvolutionParameteriv },
+ { 9526, _gloffset_ConvolutionParameterfv },
+ { 21422, _gloffset_GetSeparableFilter },
+ { 25007, _gloffset_SeparableFilter2D },
+ { 25870, _gloffset_ConvolutionParameteri },
+ { 26038, _gloffset_ConvolutionParameterf },
+ { 27752, _gloffset_GetConvolutionParameterfv },
+ { 28609, _gloffset_GetConvolutionFilter },
+ { 31072, _gloffset_CopyConvolutionFilter2D },
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_coordinate_frame)
static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = {
- { 10887, -1 }, /* TangentPointerEXT */
- { 12958, -1 }, /* Binormal3ivEXT */
- { 13684, -1 }, /* Tangent3sEXT */
- { 15053, -1 }, /* Tangent3fvEXT */
- { 19342, -1 }, /* Tangent3ivEXT */
- { 19569, -1 }, /* Tangent3dvEXT */
- { 20343, -1 }, /* Binormal3bvEXT */
- { 21482, -1 }, /* Binormal3dEXT */
- { 23754, -1 }, /* Tangent3fEXT */
- { 25949, -1 }, /* Binormal3sEXT */
- { 26491, -1 }, /* Tangent3dEXT */
- { 27438, -1 }, /* Binormal3svEXT */
- { 28039, -1 }, /* Binormal3fEXT */
- { 28947, -1 }, /* Binormal3dvEXT */
- { 30214, -1 }, /* Tangent3iEXT */
- { 31364, -1 }, /* Tangent3bvEXT */
- { 31929, -1 }, /* Tangent3bEXT */
- { 32493, -1 }, /* Binormal3fvEXT */
- { 33212, -1 }, /* BinormalPointerEXT */
- { 33693, -1 }, /* Tangent3svEXT */
- { 34130, -1 }, /* Binormal3bEXT */
- { 34307, -1 }, /* Binormal3iEXT */
+ { 10916, -1 }, /* TangentPointerEXT */
+ { 12951, -1 }, /* Binormal3ivEXT */
+ { 13677, -1 }, /* Tangent3sEXT */
+ { 15046, -1 }, /* Tangent3fvEXT */
+ { 19335, -1 }, /* Tangent3ivEXT */
+ { 19562, -1 }, /* Tangent3dvEXT */
+ { 20336, -1 }, /* Binormal3bvEXT */
+ { 21475, -1 }, /* Binormal3dEXT */
+ { 23747, -1 }, /* Tangent3fEXT */
+ { 25942, -1 }, /* Binormal3sEXT */
+ { 26484, -1 }, /* Tangent3dEXT */
+ { 27431, -1 }, /* Binormal3svEXT */
+ { 28032, -1 }, /* Binormal3fEXT */
+ { 28940, -1 }, /* Binormal3dvEXT */
+ { 30207, -1 }, /* Tangent3iEXT */
+ { 31357, -1 }, /* Tangent3bvEXT */
+ { 31922, -1 }, /* Tangent3bEXT */
+ { 32486, -1 }, /* Binormal3fvEXT */
+ { 33205, -1 }, /* BinormalPointerEXT */
+ { 33686, -1 }, /* Tangent3svEXT */
+ { 34123, -1 }, /* Binormal3bEXT */
+ { 34300, -1 }, /* Binormal3iEXT */
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_copy_texture)
static const struct gl_function_remap GL_EXT_copy_texture_functions[] = {
- { 15578, _gloffset_CopyTexSubImage3D },
- { 17319, _gloffset_CopyTexImage2D },
- { 25485, _gloffset_CopyTexImage1D },
- { 28297, _gloffset_CopyTexSubImage2D },
- { 30717, _gloffset_CopyTexSubImage1D },
+ { 15571, _gloffset_CopyTexSubImage3D },
+ { 17312, _gloffset_CopyTexImage2D },
+ { 25478, _gloffset_CopyTexImage1D },
+ { 28290, _gloffset_CopyTexSubImage2D },
+ { 30710, _gloffset_CopyTexSubImage1D },
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_cull_vertex)
static const struct gl_function_remap GL_EXT_cull_vertex_functions[] = {
- { 9186, -1 }, /* CullParameterdvEXT */
- { 12076, -1 }, /* CullParameterfvEXT */
+ { 9215, -1 }, /* CullParameterdvEXT */
+ { 12105, -1 }, /* CullParameterfvEXT */
{ -1, -1 }
};
#endif
@@ -6004,7 +6000,7 @@ static const struct gl_function_remap GL_EXT_draw_instanced_functions[] = {
#if defined(need_GL_EXT_draw_range_elements)
static const struct gl_function_remap GL_EXT_draw_range_elements_functions[] = {
- { 9834, _gloffset_DrawRangeElements },
+ { 9863, _gloffset_DrawRangeElements },
{ -1, -1 }
};
#endif
@@ -6054,38 +6050,38 @@ static const struct gl_function_remap GL_EXT_gpu_shader4_functions[] = {
#if defined(need_GL_EXT_histogram)
static const struct gl_function_remap GL_EXT_histogram_functions[] = {
{ 856, _gloffset_Histogram },
- { 3598, _gloffset_ResetHistogram },
- { 10339, _gloffset_GetMinmax },
- { 15912, _gloffset_GetHistogramParameterfv },
- { 25410, _gloffset_GetMinmaxParameteriv },
- { 27649, _gloffset_ResetMinmax },
- { 28513, _gloffset_GetHistogramParameteriv },
- { 29682, _gloffset_GetHistogram },
- { 32306, _gloffset_Minmax },
- { 33928, _gloffset_GetMinmaxParameterfv },
+ { 3627, _gloffset_ResetHistogram },
+ { 10368, _gloffset_GetMinmax },
+ { 15905, _gloffset_GetHistogramParameterfv },
+ { 25403, _gloffset_GetMinmaxParameteriv },
+ { 27642, _gloffset_ResetMinmax },
+ { 28506, _gloffset_GetHistogramParameteriv },
+ { 29675, _gloffset_GetHistogram },
+ { 32299, _gloffset_Minmax },
+ { 33921, _gloffset_GetMinmaxParameterfv },
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_index_func)
static const struct gl_function_remap GL_EXT_index_func_functions[] = {
- { 11862, -1 }, /* IndexFuncEXT */
+ { 11891, -1 }, /* IndexFuncEXT */
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_index_material)
static const struct gl_function_remap GL_EXT_index_material_functions[] = {
- { 22015, -1 }, /* IndexMaterialEXT */
+ { 22008, -1 }, /* IndexMaterialEXT */
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_light_texture)
static const struct gl_function_remap GL_EXT_light_texture_functions[] = {
- { 27458, -1 }, /* ApplyTextureEXT */
- { 27603, -1 }, /* TextureMaterialEXT */
- { 27628, -1 }, /* TextureLightEXT */
+ { 27451, -1 }, /* ApplyTextureEXT */
+ { 27596, -1 }, /* TextureMaterialEXT */
+ { 27621, -1 }, /* TextureLightEXT */
{ -1, -1 }
};
#endif
@@ -6106,20 +6102,20 @@ static const struct gl_function_remap GL_EXT_multisample_functions[] = {
#if defined(need_GL_EXT_paletted_texture)
static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = {
- { 8697, _gloffset_ColorTable },
- { 15758, _gloffset_GetColorTable },
- { 23937, _gloffset_GetColorTableParameterfv },
- { 26101, _gloffset_GetColorTableParameteriv },
+ { 8726, _gloffset_ColorTable },
+ { 15751, _gloffset_GetColorTable },
+ { 23930, _gloffset_GetColorTableParameterfv },
+ { 26094, _gloffset_GetColorTableParameteriv },
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_pixel_transform)
static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = {
- { 22662, -1 }, /* PixelTransformParameterfEXT */
- { 22742, -1 }, /* PixelTransformParameteriEXT */
- { 31644, -1 }, /* PixelTransformParameterfvEXT */
- { 33176, -1 }, /* PixelTransformParameterivEXT */
+ { 22655, -1 }, /* PixelTransformParameterfEXT */
+ { 22735, -1 }, /* PixelTransformParameteriEXT */
+ { 31637, -1 }, /* PixelTransformParameterfvEXT */
+ { 33169, -1 }, /* PixelTransformParameterivEXT */
{ -1, -1 }
};
#endif
@@ -6168,8 +6164,8 @@ static const struct gl_function_remap GL_EXT_stencil_two_side_functions[] = {
#if defined(need_GL_EXT_subtexture)
static const struct gl_function_remap GL_EXT_subtexture_functions[] = {
- { 7408, _gloffset_TexSubImage1D },
- { 11043, _gloffset_TexSubImage2D },
+ { 7437, _gloffset_TexSubImage1D },
+ { 11072, _gloffset_TexSubImage2D },
{ -1, -1 }
};
#endif
@@ -6177,7 +6173,7 @@ static const struct gl_function_remap GL_EXT_subtexture_functions[] = {
#if defined(need_GL_EXT_texture3D)
static const struct gl_function_remap GL_EXT_texture3D_functions[] = {
{ 1826, _gloffset_TexImage3D },
- { 23706, _gloffset_TexSubImage3D },
+ { 23699, _gloffset_TexSubImage3D },
{ -1, -1 }
};
#endif
@@ -6198,19 +6194,19 @@ static const struct gl_function_remap GL_EXT_texture_integer_functions[] = {
#if defined(need_GL_EXT_texture_object)
static const struct gl_function_remap GL_EXT_texture_object_functions[] = {
- { 3366, _gloffset_PrioritizeTextures },
- { 7857, _gloffset_AreTexturesResident },
- { 14027, _gloffset_GenTextures },
- { 16271, _gloffset_DeleteTextures },
- { 20396, _gloffset_IsTexture },
- { 30782, _gloffset_BindTexture },
+ { 3395, _gloffset_PrioritizeTextures },
+ { 7886, _gloffset_AreTexturesResident },
+ { 14020, _gloffset_GenTextures },
+ { 16264, _gloffset_DeleteTextures },
+ { 20389, _gloffset_IsTexture },
+ { 30775, _gloffset_BindTexture },
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_texture_perturb_normal)
static const struct gl_function_remap GL_EXT_texture_perturb_normal_functions[] = {
- { 14269, -1 }, /* TextureNormalEXT */
+ { 14262, -1 }, /* TextureNormalEXT */
{ -1, -1 }
};
#endif
@@ -6232,18 +6228,18 @@ static const struct gl_function_remap GL_EXT_transform_feedback_functions[] = {
#if defined(need_GL_EXT_vertex_array)
/* functions defined in MESA_remap_table_functions are excluded */
static const struct gl_function_remap GL_EXT_vertex_array_functions[] = {
- { 25186, _gloffset_ArrayElement },
- { 31894, _gloffset_GetPointerv },
- { 33479, _gloffset_DrawArrays },
+ { 25179, _gloffset_ArrayElement },
+ { 31887, _gloffset_GetPointerv },
+ { 33472, _gloffset_DrawArrays },
{ -1, -1 }
};
#endif
#if defined(need_GL_EXT_vertex_weighting)
static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = {
- { 20444, -1 }, /* VertexWeightfvEXT */
- { 27982, -1 }, /* VertexWeightfEXT */
- { 29651, -1 }, /* VertexWeightPointerEXT */
+ { 20437, -1 }, /* VertexWeightfvEXT */
+ { 27975, -1 }, /* VertexWeightfEXT */
+ { 29644, -1 }, /* VertexWeightPointerEXT */
{ -1, -1 }
};
#endif
@@ -6251,11 +6247,11 @@ static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = {
#if defined(need_GL_HP_image_transform)
static const struct gl_function_remap GL_HP_image_transform_functions[] = {
{ 2400, -1 }, /* GetImageTransformParameterfvHP */
- { 3815, -1 }, /* ImageTransformParameterfHP */
- { 10581, -1 }, /* ImageTransformParameterfvHP */
- { 12323, -1 }, /* ImageTransformParameteriHP */
- { 12693, -1 }, /* GetImageTransformParameterivHP */
- { 20508, -1 }, /* ImageTransformParameterivHP */
+ { 3844, -1 }, /* ImageTransformParameterfHP */
+ { 10610, -1 }, /* ImageTransformParameterfvHP */
+ { 12352, -1 }, /* ImageTransformParameteriHP */
+ { 12722, -1 }, /* GetImageTransformParameterivHP */
+ { 20501, -1 }, /* ImageTransformParameterivHP */
{ -1, -1 }
};
#endif
@@ -6269,14 +6265,14 @@ static const struct gl_function_remap GL_IBM_multimode_draw_arrays_functions[] =
#if defined(need_GL_IBM_vertex_array_lists)
static const struct gl_function_remap GL_IBM_vertex_array_lists_functions[] = {
- { 4510, -1 }, /* SecondaryColorPointerListIBM */
- { 6340, -1 }, /* NormalPointerListIBM */
- { 8031, -1 }, /* FogCoordPointerListIBM */
- { 8372, -1 }, /* VertexPointerListIBM */
- { 12577, -1 }, /* ColorPointerListIBM */
- { 13791, -1 }, /* TexCoordPointerListIBM */
- { 14291, -1 }, /* IndexPointerListIBM */
- { 33871, -1 }, /* EdgeFlagPointerListIBM */
+ { 4539, -1 }, /* SecondaryColorPointerListIBM */
+ { 6369, -1 }, /* NormalPointerListIBM */
+ { 8060, -1 }, /* FogCoordPointerListIBM */
+ { 8401, -1 }, /* VertexPointerListIBM */
+ { 12606, -1 }, /* ColorPointerListIBM */
+ { 13784, -1 }, /* TexCoordPointerListIBM */
+ { 14284, -1 }, /* IndexPointerListIBM */
+ { 33864, -1 }, /* EdgeFlagPointerListIBM */
{ -1, -1 }
};
#endif
@@ -6290,10 +6286,10 @@ static const struct gl_function_remap GL_INGR_blend_func_separate_functions[] =
#if defined(need_GL_INTEL_parallel_arrays)
static const struct gl_function_remap GL_INTEL_parallel_arrays_functions[] = {
- { 13131, -1 }, /* VertexPointervINTEL */
- { 16005, -1 }, /* ColorPointervINTEL */
- { 31053, -1 }, /* NormalPointervINTEL */
- { 31576, -1 }, /* TexCoordPointervINTEL */
+ { 13124, -1 }, /* VertexPointervINTEL */
+ { 15998, -1 }, /* ColorPointervINTEL */
+ { 31046, -1 }, /* NormalPointervINTEL */
+ { 31569, -1 }, /* TexCoordPointervINTEL */
{ -1, -1 }
};
#endif
@@ -6308,9 +6304,9 @@ static const struct gl_function_remap GL_MESA_resize_buffers_functions[] = {
#if defined(need_GL_MESA_shader_debug)
static const struct gl_function_remap GL_MESA_shader_debug_functions[] = {
{ 1690, -1 }, /* GetDebugLogLengthMESA */
- { 3537, -1 }, /* ClearDebugLogMESA */
- { 4695, -1 }, /* GetDebugLogMESA */
- { 32087, -1 }, /* CreateDebugObjectMESA */
+ { 3566, -1 }, /* ClearDebugLogMESA */
+ { 4724, -1 }, /* GetDebugLogMESA */
+ { 32080, -1 }, /* CreateDebugObjectMESA */
{ -1, -1 }
};
#endif
@@ -6331,15 +6327,15 @@ static const struct gl_function_remap GL_NV_condtitional_render_functions[] = {
#if defined(need_GL_NV_evaluators)
static const struct gl_function_remap GL_NV_evaluators_functions[] = {
- { 7070, -1 }, /* GetMapAttribParameterivNV */
- { 8803, -1 }, /* MapControlPointsNV */
- { 8902, -1 }, /* MapParameterfvNV */
- { 11026, -1 }, /* EvalMapsNV */
- { 17830, -1 }, /* GetMapAttribParameterfvNV */
- { 18047, -1 }, /* MapParameterivNV */
- { 25800, -1 }, /* GetMapParameterivNV */
- { 26343, -1 }, /* GetMapParameterfvNV */
- { 30368, -1 }, /* GetMapControlPointsNV */
+ { 7099, -1 }, /* GetMapAttribParameterivNV */
+ { 8832, -1 }, /* MapControlPointsNV */
+ { 8931, -1 }, /* MapParameterfvNV */
+ { 11055, -1 }, /* EvalMapsNV */
+ { 17823, -1 }, /* GetMapAttribParameterfvNV */
+ { 18040, -1 }, /* MapParameterivNV */
+ { 25793, -1 }, /* GetMapParameterivNV */
+ { 26336, -1 }, /* GetMapParameterfvNV */
+ { 30361, -1 }, /* GetMapControlPointsNV */
{ -1, -1 }
};
#endif
@@ -6381,8 +6377,8 @@ static const struct gl_function_remap GL_NV_register_combiners_functions[] = {
#if defined(need_GL_NV_register_combiners2)
static const struct gl_function_remap GL_NV_register_combiners2_functions[] = {
- { 16424, -1 }, /* CombinerStageParameterfvNV */
- { 16820, -1 }, /* GetCombinerStageParameterfvNV */
+ { 16417, -1 }, /* CombinerStageParameterfvNV */
+ { 16813, -1 }, /* GetCombinerStageParameterfvNV */
{ -1, -1 }
};
#endif
@@ -6417,23 +6413,23 @@ static const struct gl_function_remap GL_OES_EGL_image_functions[] = {
#if defined(need_GL_PGI_misc_hints)
static const struct gl_function_remap GL_PGI_misc_hints_functions[] = {
- { 9023, -1 }, /* HintPGI */
+ { 9052, -1 }, /* HintPGI */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIS_detail_texture)
static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = {
- { 16793, -1 }, /* GetDetailTexFuncSGIS */
- { 17264, -1 }, /* DetailTexFuncSGIS */
+ { 16786, -1 }, /* GetDetailTexFuncSGIS */
+ { 17257, -1 }, /* DetailTexFuncSGIS */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIS_fog_function)
static const struct gl_function_remap GL_SGIS_fog_function_functions[] = {
- { 28279, -1 }, /* FogFuncSGIS */
- { 29000, -1 }, /* GetFogFuncSGIS */
+ { 28272, -1 }, /* FogFuncSGIS */
+ { 28993, -1 }, /* GetFogFuncSGIS */
{ -1, -1 }
};
#endif
@@ -6461,8 +6457,8 @@ static const struct gl_function_remap GL_SGIS_point_parameters_functions[] = {
#if defined(need_GL_SGIS_sharpen_texture)
static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = {
- { 7131, -1 }, /* GetSharpenTexFuncSGIS */
- { 23048, -1 }, /* SharpenTexFuncSGIS */
+ { 7160, -1 }, /* GetSharpenTexFuncSGIS */
+ { 23041, -1 }, /* SharpenTexFuncSGIS */
{ -1, -1 }
};
#endif
@@ -6470,41 +6466,41 @@ static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = {
#if defined(need_GL_SGIS_texture4D)
static const struct gl_function_remap GL_SGIS_texture4D_functions[] = {
{ 995, -1 }, /* TexImage4DSGIS */
- { 16340, -1 }, /* TexSubImage4DSGIS */
+ { 16333, -1 }, /* TexSubImage4DSGIS */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIS_texture_color_mask)
static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = {
- { 15711, -1 }, /* TextureColorMaskSGIS */
+ { 15704, -1 }, /* TextureColorMaskSGIS */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIS_texture_filter4)
static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = {
- { 7308, -1 }, /* GetTexFilterFuncSGIS */
- { 16966, -1 }, /* TexFilterFuncSGIS */
+ { 7337, -1 }, /* GetTexFilterFuncSGIS */
+ { 16959, -1 }, /* TexFilterFuncSGIS */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIX_async)
static const struct gl_function_remap GL_SGIX_async_functions[] = {
- { 3463, -1 }, /* AsyncMarkerSGIX */
- { 4649, -1 }, /* FinishAsyncSGIX */
- { 5721, -1 }, /* PollAsyncSGIX */
- { 23257, -1 }, /* DeleteAsyncMarkersSGIX */
- { 23312, -1 }, /* IsAsyncMarkerSGIX */
- { 33668, -1 }, /* GenAsyncMarkersSGIX */
+ { 3492, -1 }, /* AsyncMarkerSGIX */
+ { 4678, -1 }, /* FinishAsyncSGIX */
+ { 5750, -1 }, /* PollAsyncSGIX */
+ { 23250, -1 }, /* DeleteAsyncMarkersSGIX */
+ { 23305, -1 }, /* IsAsyncMarkerSGIX */
+ { 33661, -1 }, /* GenAsyncMarkersSGIX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIX_flush_raster)
static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = {
- { 7685, -1 }, /* FlushRasterSGIX */
+ { 7714, -1 }, /* FlushRasterSGIX */
{ -1, -1 }
};
#endif
@@ -6512,37 +6508,37 @@ static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = {
#if defined(need_GL_SGIX_fragment_lighting)
static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = {
{ 2698, -1 }, /* FragmentMaterialfvSGIX */
- { 5625, -1 }, /* FragmentLightiSGIX */
- { 8439, -1 }, /* FragmentMaterialfSGIX */
- { 8576, -1 }, /* GetFragmentLightivSGIX */
- { 9449, -1 }, /* FragmentLightModeliSGIX */
- { 11089, -1 }, /* FragmentLightivSGIX */
- { 11396, -1 }, /* GetFragmentMaterialivSGIX */
- { 16733, -1 }, /* GetFragmentMaterialfvSGIX */
- { 20313, -1 }, /* FragmentLightModelfSGIX */
- { 20631, -1 }, /* FragmentColorMaterialSGIX */
- { 21048, -1 }, /* FragmentMaterialiSGIX */
- { 22343, -1 }, /* LightEnviSGIX */
- { 24029, -1 }, /* FragmentLightModelfvSGIX */
- { 24364, -1 }, /* FragmentLightfvSGIX */
- { 29384, -1 }, /* FragmentLightModelivSGIX */
- { 29533, -1 }, /* FragmentLightfSGIX */
- { 32463, -1 }, /* GetFragmentLightfvSGIX */
- { 34151, -1 }, /* FragmentMaterialivSGIX */
+ { 5654, -1 }, /* FragmentLightiSGIX */
+ { 8468, -1 }, /* FragmentMaterialfSGIX */
+ { 8605, -1 }, /* GetFragmentLightivSGIX */
+ { 9478, -1 }, /* FragmentLightModeliSGIX */
+ { 11118, -1 }, /* FragmentLightivSGIX */
+ { 11425, -1 }, /* GetFragmentMaterialivSGIX */
+ { 16726, -1 }, /* GetFragmentMaterialfvSGIX */
+ { 20306, -1 }, /* FragmentLightModelfSGIX */
+ { 20624, -1 }, /* FragmentColorMaterialSGIX */
+ { 21041, -1 }, /* FragmentMaterialiSGIX */
+ { 22336, -1 }, /* LightEnviSGIX */
+ { 24022, -1 }, /* FragmentLightModelfvSGIX */
+ { 24357, -1 }, /* FragmentLightfvSGIX */
+ { 29377, -1 }, /* FragmentLightModelivSGIX */
+ { 29526, -1 }, /* FragmentLightfSGIX */
+ { 32456, -1 }, /* GetFragmentLightfvSGIX */
+ { 34144, -1 }, /* FragmentMaterialivSGIX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIX_framezoom)
static const struct gl_function_remap GL_SGIX_framezoom_functions[] = {
- { 23335, -1 }, /* FrameZoomSGIX */
+ { 23328, -1 }, /* FrameZoomSGIX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIX_igloo_interface)
static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = {
- { 29841, -1 }, /* IglooInterfaceSGIX */
+ { 29834, -1 }, /* IglooInterfaceSGIX */
{ -1, -1 }
};
#endif
@@ -6550,11 +6546,11 @@ static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = {
#if defined(need_GL_SGIX_instruments)
static const struct gl_function_remap GL_SGIX_instruments_functions[] = {
{ 2878, -1 }, /* ReadInstrumentsSGIX */
- { 6904, -1 }, /* PollInstrumentsSGIX */
- { 10947, -1 }, /* GetInstrumentsSGIX */
- { 13389, -1 }, /* StartInstrumentsSGIX */
- { 16458, -1 }, /* StopInstrumentsSGIX */
- { 18495, -1 }, /* InstrumentsBufferSGIX */
+ { 6933, -1 }, /* PollInstrumentsSGIX */
+ { 10976, -1 }, /* GetInstrumentsSGIX */
+ { 13382, -1 }, /* StartInstrumentsSGIX */
+ { 16451, -1 }, /* StopInstrumentsSGIX */
+ { 18488, -1 }, /* InstrumentsBufferSGIX */
{ -1, -1 }
};
#endif
@@ -6562,11 +6558,11 @@ static const struct gl_function_remap GL_SGIX_instruments_functions[] = {
#if defined(need_GL_SGIX_list_priority)
static const struct gl_function_remap GL_SGIX_list_priority_functions[] = {
{ 1226, -1 }, /* ListParameterfSGIX */
- { 3165, -1 }, /* GetListParameterfvSGIX */
- { 18360, -1 }, /* ListParameteriSGIX */
- { 19519, -1 }, /* ListParameterfvSGIX */
- { 21714, -1 }, /* ListParameterivSGIX */
- { 33712, -1 }, /* GetListParameterivSGIX */
+ { 3194, -1 }, /* GetListParameterfvSGIX */
+ { 18353, -1 }, /* ListParameteriSGIX */
+ { 19512, -1 }, /* ListParameterfvSGIX */
+ { 21707, -1 }, /* ListParameterivSGIX */
+ { 33705, -1 }, /* GetListParameterivSGIX */
{ -1, -1 }
};
#endif
@@ -6580,88 +6576,88 @@ static const struct gl_function_remap GL_SGIX_pixel_texture_functions[] = {
#if defined(need_GL_SGIX_polynomial_ffd)
static const struct gl_function_remap GL_SGIX_polynomial_ffd_functions[] = {
- { 3761, -1 }, /* LoadIdentityDeformationMapSGIX */
- { 16558, -1 }, /* DeformSGIX */
- { 25298, -1 }, /* DeformationMap3fSGIX */
- { 32351, -1 }, /* DeformationMap3dSGIX */
+ { 3790, -1 }, /* LoadIdentityDeformationMapSGIX */
+ { 16551, -1 }, /* DeformSGIX */
+ { 25291, -1 }, /* DeformationMap3fSGIX */
+ { 32344, -1 }, /* DeformationMap3dSGIX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIX_reference_plane)
static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = {
- { 15262, -1 }, /* ReferencePlaneSGIX */
+ { 15255, -1 }, /* ReferencePlaneSGIX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIX_sprite)
static const struct gl_function_remap GL_SGIX_sprite_functions[] = {
- { 9947, -1 }, /* SpriteParameterfvSGIX */
- { 21503, -1 }, /* SpriteParameteriSGIX */
- { 27683, -1 }, /* SpriteParameterfSGIX */
- { 30511, -1 }, /* SpriteParameterivSGIX */
+ { 9976, -1 }, /* SpriteParameterfvSGIX */
+ { 21496, -1 }, /* SpriteParameteriSGIX */
+ { 27676, -1 }, /* SpriteParameterfSGIX */
+ { 30504, -1 }, /* SpriteParameterivSGIX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGIX_tag_sample_buffer)
static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = {
- { 21562, -1 }, /* TagSampleBufferSGIX */
+ { 21555, -1 }, /* TagSampleBufferSGIX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SGI_color_table)
static const struct gl_function_remap GL_SGI_color_table_functions[] = {
- { 7975, _gloffset_ColorTableParameteriv },
- { 8697, _gloffset_ColorTable },
- { 15758, _gloffset_GetColorTable },
- { 15868, _gloffset_CopyColorTable },
- { 20257, _gloffset_ColorTableParameterfv },
- { 23937, _gloffset_GetColorTableParameterfv },
- { 26101, _gloffset_GetColorTableParameteriv },
+ { 8004, _gloffset_ColorTableParameteriv },
+ { 8726, _gloffset_ColorTable },
+ { 15751, _gloffset_GetColorTable },
+ { 15861, _gloffset_CopyColorTable },
+ { 20250, _gloffset_ColorTableParameterfv },
+ { 23930, _gloffset_GetColorTableParameterfv },
+ { 26094, _gloffset_GetColorTableParameteriv },
{ -1, -1 }
};
#endif
#if defined(need_GL_SUNX_constant_data)
static const struct gl_function_remap GL_SUNX_constant_data_functions[] = {
- { 32441, -1 }, /* FinishTextureSUNX */
+ { 32434, -1 }, /* FinishTextureSUNX */
{ -1, -1 }
};
#endif
#if defined(need_GL_SUN_global_alpha)
static const struct gl_function_remap GL_SUN_global_alpha_functions[] = {
- { 3484, -1 }, /* GlobalAlphaFactorubSUN */
- { 5002, -1 }, /* GlobalAlphaFactoriSUN */
- { 6929, -1 }, /* GlobalAlphaFactordSUN */
- { 10031, -1 }, /* GlobalAlphaFactoruiSUN */
- { 10538, -1 }, /* GlobalAlphaFactorbSUN */
- { 13704, -1 }, /* GlobalAlphaFactorfSUN */
- { 13868, -1 }, /* GlobalAlphaFactorusSUN */
- { 23624, -1 }, /* GlobalAlphaFactorsSUN */
+ { 3513, -1 }, /* GlobalAlphaFactorubSUN */
+ { 5031, -1 }, /* GlobalAlphaFactoriSUN */
+ { 6958, -1 }, /* GlobalAlphaFactordSUN */
+ { 10060, -1 }, /* GlobalAlphaFactoruiSUN */
+ { 10567, -1 }, /* GlobalAlphaFactorbSUN */
+ { 13697, -1 }, /* GlobalAlphaFactorfSUN */
+ { 13861, -1 }, /* GlobalAlphaFactorusSUN */
+ { 23617, -1 }, /* GlobalAlphaFactorsSUN */
{ -1, -1 }
};
#endif
#if defined(need_GL_SUN_mesh_array)
static const struct gl_function_remap GL_SUN_mesh_array_functions[] = {
- { 30302, -1 }, /* DrawMeshArraysSUN */
+ { 30295, -1 }, /* DrawMeshArraysSUN */
{ -1, -1 }
};
#endif
#if defined(need_GL_SUN_triangle_list)
static const struct gl_function_remap GL_SUN_triangle_list_functions[] = {
- { 4623, -1 }, /* ReplacementCodeubSUN */
- { 6688, -1 }, /* ReplacementCodeubvSUN */
- { 19978, -1 }, /* ReplacementCodeusvSUN */
- { 20166, -1 }, /* ReplacementCodePointerSUN */
- { 22407, -1 }, /* ReplacementCodeuiSUN */
- { 23286, -1 }, /* ReplacementCodeusSUN */
- { 30968, -1 }, /* ReplacementCodeuivSUN */
+ { 4652, -1 }, /* ReplacementCodeubSUN */
+ { 6717, -1 }, /* ReplacementCodeubvSUN */
+ { 19971, -1 }, /* ReplacementCodeusvSUN */
+ { 20159, -1 }, /* ReplacementCodePointerSUN */
+ { 22400, -1 }, /* ReplacementCodeuiSUN */
+ { 23279, -1 }, /* ReplacementCodeusSUN */
+ { 30961, -1 }, /* ReplacementCodeuivSUN */
{ -1, -1 }
};
#endif
@@ -6675,39 +6671,39 @@ static const struct gl_function_remap GL_SUN_vertex_functions[] = {
{ 2055, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */
{ 2634, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */
{ 2974, -1 }, /* Color4ubVertex3fvSUN */
- { 4807, -1 }, /* Color4ubVertex3fSUN */
- { 4930, -1 }, /* TexCoord2fVertex3fSUN */
- { 5348, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */
- { 5825, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */
- { 6583, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */
- { 7363, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */
- { 7722, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */
- { 9248, -1 }, /* Color3fVertex3fSUN */
- { 10447, -1 }, /* Color3fVertex3fvSUN */
- { 10912, -1 }, /* Color4fNormal3fVertex3fvSUN */
- { 11741, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */
- { 13252, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */
- { 14878, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */
- { 15404, -1 }, /* TexCoord2fColor3fVertex3fSUN */
- { 16483, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */
- { 16925, -1 }, /* Color4ubVertex2fvSUN */
- { 17289, -1 }, /* Normal3fVertex3fSUN */
- { 18436, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */
- { 18788, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */
- { 19095, -1 }, /* TexCoord2fNormal3fVertex3fSUN */
- { 19771, -1 }, /* TexCoord2fVertex3fvSUN */
- { 20601, -1 }, /* Color4ubVertex2fSUN */
- { 20839, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */
- { 22873, -1 }, /* TexCoord2fColor4ubVertex3fSUN */
- { 23354, -1 }, /* Normal3fVertex3fvSUN */
- { 23846, -1 }, /* Color4fNormal3fVertex3fSUN */
- { 24847, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */
- { 27004, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */
- { 28395, -1 }, /* TexCoord4fVertex4fSUN */
- { 28841, -1 }, /* TexCoord2fColor3fVertex3fvSUN */
- { 29228, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */
- { 29355, -1 }, /* TexCoord4fVertex4fvSUN */
- { 30089, -1 }, /* ReplacementCodeuiVertex3fSUN */
+ { 4836, -1 }, /* Color4ubVertex3fSUN */
+ { 4959, -1 }, /* TexCoord2fVertex3fSUN */
+ { 5377, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */
+ { 5854, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */
+ { 6612, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */
+ { 7392, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */
+ { 7751, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */
+ { 9277, -1 }, /* Color3fVertex3fSUN */
+ { 10476, -1 }, /* Color3fVertex3fvSUN */
+ { 10941, -1 }, /* Color4fNormal3fVertex3fvSUN */
+ { 11770, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */
+ { 13245, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */
+ { 14871, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */
+ { 15397, -1 }, /* TexCoord2fColor3fVertex3fSUN */
+ { 16476, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */
+ { 16918, -1 }, /* Color4ubVertex2fvSUN */
+ { 17282, -1 }, /* Normal3fVertex3fSUN */
+ { 18429, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */
+ { 18781, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */
+ { 19088, -1 }, /* TexCoord2fNormal3fVertex3fSUN */
+ { 19764, -1 }, /* TexCoord2fVertex3fvSUN */
+ { 20594, -1 }, /* Color4ubVertex2fSUN */
+ { 20832, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */
+ { 22866, -1 }, /* TexCoord2fColor4ubVertex3fSUN */
+ { 23347, -1 }, /* Normal3fVertex3fvSUN */
+ { 23839, -1 }, /* Color4fNormal3fVertex3fSUN */
+ { 24840, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */
+ { 26997, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */
+ { 28388, -1 }, /* TexCoord4fVertex4fSUN */
+ { 28834, -1 }, /* TexCoord2fColor3fVertex3fvSUN */
+ { 29221, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */
+ { 29348, -1 }, /* TexCoord4fVertex4fvSUN */
+ { 30082, -1 }, /* ReplacementCodeuiVertex3fSUN */
{ -1, -1 }
};
#endif
@@ -6717,38 +6713,38 @@ static const struct gl_function_remap GL_SUN_vertex_functions[] = {
static const struct gl_function_remap GL_VERSION_1_3_functions[] = {
{ 425, _gloffset_MultiTexCoord3sARB },
{ 657, _gloffset_ActiveTextureARB },
- { 4378, _gloffset_MultiTexCoord1fvARB },
- { 6474, _gloffset_MultiTexCoord3dARB },
- { 6519, _gloffset_MultiTexCoord2iARB },
- { 6643, _gloffset_MultiTexCoord2svARB },
- { 8653, _gloffset_MultiTexCoord2fARB },
- { 10748, _gloffset_MultiTexCoord3fvARB },
- { 11350, _gloffset_MultiTexCoord4sARB },
- { 12031, _gloffset_MultiTexCoord2dvARB },
- { 12438, _gloffset_MultiTexCoord1svARB },
- { 12839, _gloffset_MultiTexCoord3svARB },
- { 12900, _gloffset_MultiTexCoord4iARB },
- { 13731, _gloffset_MultiTexCoord3iARB },
- { 14601, _gloffset_MultiTexCoord1dARB },
- { 14833, _gloffset_MultiTexCoord3dvARB },
- { 16112, _gloffset_MultiTexCoord3ivARB },
- { 16157, _gloffset_MultiTexCoord2sARB },
- { 17689, _gloffset_MultiTexCoord4ivARB },
- { 19897, _gloffset_ClientActiveTextureARB },
- { 22260, _gloffset_MultiTexCoord2dARB },
- { 22697, _gloffset_MultiTexCoord4dvARB },
- { 23074, _gloffset_MultiTexCoord4fvARB },
- { 24078, _gloffset_MultiTexCoord3fARB },
- { 26695, _gloffset_MultiTexCoord4dARB },
- { 26961, _gloffset_MultiTexCoord1sARB },
- { 27165, _gloffset_MultiTexCoord1dvARB },
- { 28141, _gloffset_MultiTexCoord1ivARB },
- { 28234, _gloffset_MultiTexCoord2ivARB },
- { 28573, _gloffset_MultiTexCoord1iARB },
- { 29957, _gloffset_MultiTexCoord4svARB },
- { 30581, _gloffset_MultiTexCoord1fARB },
- { 30844, _gloffset_MultiTexCoord4fARB },
- { 33313, _gloffset_MultiTexCoord2fvARB },
+ { 4407, _gloffset_MultiTexCoord1fvARB },
+ { 6503, _gloffset_MultiTexCoord3dARB },
+ { 6548, _gloffset_MultiTexCoord2iARB },
+ { 6672, _gloffset_MultiTexCoord2svARB },
+ { 8682, _gloffset_MultiTexCoord2fARB },
+ { 10777, _gloffset_MultiTexCoord3fvARB },
+ { 11379, _gloffset_MultiTexCoord4sARB },
+ { 12060, _gloffset_MultiTexCoord2dvARB },
+ { 12467, _gloffset_MultiTexCoord1svARB },
+ { 12832, _gloffset_MultiTexCoord3svARB },
+ { 12893, _gloffset_MultiTexCoord4iARB },
+ { 13724, _gloffset_MultiTexCoord3iARB },
+ { 14594, _gloffset_MultiTexCoord1dARB },
+ { 14826, _gloffset_MultiTexCoord3dvARB },
+ { 16105, _gloffset_MultiTexCoord3ivARB },
+ { 16150, _gloffset_MultiTexCoord2sARB },
+ { 17682, _gloffset_MultiTexCoord4ivARB },
+ { 19890, _gloffset_ClientActiveTextureARB },
+ { 22253, _gloffset_MultiTexCoord2dARB },
+ { 22690, _gloffset_MultiTexCoord4dvARB },
+ { 23067, _gloffset_MultiTexCoord4fvARB },
+ { 24071, _gloffset_MultiTexCoord3fARB },
+ { 26688, _gloffset_MultiTexCoord4dARB },
+ { 26954, _gloffset_MultiTexCoord1sARB },
+ { 27158, _gloffset_MultiTexCoord1dvARB },
+ { 28134, _gloffset_MultiTexCoord1ivARB },
+ { 28227, _gloffset_MultiTexCoord2ivARB },
+ { 28566, _gloffset_MultiTexCoord1iARB },
+ { 29950, _gloffset_MultiTexCoord4svARB },
+ { 30574, _gloffset_MultiTexCoord1fARB },
+ { 30837, _gloffset_MultiTexCoord4fARB },
+ { 33306, _gloffset_MultiTexCoord2fvARB },
{ -1, -1 }
};
#endif
diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c
index d84f59690..8b7159db0 100644
--- a/mesalib/src/mesa/main/shared.c
+++ b/mesalib/src/mesa/main/shared.c
@@ -200,7 +200,7 @@ delete_bufferobj_cb(GLuint id, void *data, void *userData)
struct gl_buffer_object *bufObj = (struct gl_buffer_object *) data;
struct gl_context *ctx = (struct gl_context *) userData;
if (_mesa_bufferobj_mapped(bufObj)) {
- ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
+ ctx->Driver.UnmapBuffer(ctx, bufObj);
bufObj->Pointer = NULL;
}
_mesa_reference_buffer_object(ctx, &bufObj, NULL);
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index 26c2ff98b..b2ebb0de4 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -441,8 +441,8 @@ _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
* texture data to the PBO if the PBO is in VRAM along with the texture.
*/
GLubyte *buf = (GLubyte *)
- ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
- GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj);
+ ctx->Driver.MapBufferRange(ctx, 0, ctx->Pack.BufferObj->Size,
+ GL_MAP_WRITE_BIT, ctx->Pack.BufferObj);
if (!buf) {
/* out of memory or other unexpected error */
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)");
@@ -474,8 +474,7 @@ _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
}
if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
- ctx->Pack.BufferObj);
+ ctx->Driver.UnmapBuffer(ctx, ctx->Pack.BufferObj);
}
}
@@ -500,8 +499,8 @@ _mesa_get_compressed_teximage(struct gl_context *ctx, GLenum target, GLint level
if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
/* pack texture image into a PBO */
GLubyte *buf = (GLubyte *)
- ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
- GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj);
+ ctx->Driver.MapBufferRange(ctx, 0, ctx->Pack.BufferObj->Size,
+ GL_MAP_WRITE_BIT, ctx->Pack.BufferObj);
if (!buf) {
/* out of memory or other unexpected error */
_mesa_error(ctx, GL_OUT_OF_MEMORY,
@@ -531,8 +530,7 @@ _mesa_get_compressed_teximage(struct gl_context *ctx, GLenum target, GLint level
}
if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
- ctx->Pack.BufferObj);
+ ctx->Driver.UnmapBuffer(ctx, ctx->Pack.BufferObj);
}
}
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 27717cfb0..a005d2935 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -571,6 +571,8 @@ _mesa_set_tex_image(struct gl_texture_object *tObj,
/* Set the 'back' pointer */
texImage->TexObject = tObj;
+ texImage->Level = level;
+ texImage->Face = face;
}
diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c
index 1329af4cd..cda840fe2 100644
--- a/mesalib/src/mesa/main/uniforms.c
+++ b/mesalib/src/mesa/main/uniforms.c
@@ -454,9 +454,9 @@ get_uniform(struct gl_context *ctx, GLuint program, GLint location,
for (i = 0; i < rows; i++) {
const int base = paramPos + offset + i;
for (j = 0; j < cols; j++ ) {
- params[k++] = ctx->Const.GLSLVersion <= 120 ?
- (GLint) prog->Parameters->ParameterValues[base][j].f :
- prog->Parameters->ParameterValues[base][j].i;
+ params[k++] = ctx->Const.NativeIntegers ?
+ prog->Parameters->ParameterValues[base][j].i :
+ (GLint) prog->Parameters->ParameterValues[base][j].f;
}
}
}
@@ -468,9 +468,9 @@ get_uniform(struct gl_context *ctx, GLuint program, GLint location,
for (i = 0; i < rows; i++) {
const int base = paramPos + offset + i;
for (j = 0; j < cols; j++ ) {
- params[k++] = ctx->Const.GLSLVersion <= 120 ?
- (GLuint) prog->Parameters->ParameterValues[base][j].f :
- prog->Parameters->ParameterValues[base][j].u;
+ params[k++] = ctx->Const.NativeIntegers ?
+ prog->Parameters->ParameterValues[base][j].u :
+ (GLuint) prog->Parameters->ParameterValues[base][j].f;
}
}
}
@@ -750,7 +750,7 @@ set_program_uniform(struct gl_context *ctx, struct gl_program *program,
if (basicType == GL_INT) {
const GLint *iValues = ((const GLint *) values) + k * elems;
for (i = 0; i < elems; i++) {
- if (ctx->Const.GLSLVersion <= 120)
+ if (!ctx->Const.NativeIntegers)
uniformVal[i].f = (GLfloat) iValues[i];
else
uniformVal[i].i = iValues[i];
@@ -759,7 +759,7 @@ set_program_uniform(struct gl_context *ctx, struct gl_program *program,
else if (basicType == GL_UNSIGNED_INT) {
const GLuint *iValues = ((const GLuint *) values) + k * elems;
for (i = 0; i < elems; i++) {
- if (ctx->Const.GLSLVersion <= 120)
+ if (!ctx->Const.NativeIntegers)
uniformVal[i].f = (GLfloat)(GLuint) iValues[i];
else
uniformVal[i].u = iValues[i];
@@ -781,7 +781,7 @@ set_program_uniform(struct gl_context *ctx, struct gl_program *program,
else
uniformVal[i].b = uniformVal[i].u ? 1 : 0;
- if (ctx->Const.GLSLVersion <= 120)
+ if (!ctx->Const.NativeIntegers)
uniformVal[i].f = uniformVal[i].b ? 1.0f : 0.0f;
}
}
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index 1ef609fe1..6820e4c6b 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -297,11 +297,11 @@ public:
/**
* Emit the correct dot-product instruction for the type of arguments
*/
- void emit_dp(ir_instruction *ir,
- dst_reg dst,
- src_reg src0,
- src_reg src1,
- unsigned elements);
+ ir_to_mesa_instruction * emit_dp(ir_instruction *ir,
+ dst_reg dst,
+ src_reg src0,
+ src_reg src1,
+ unsigned elements);
void emit_scalar(ir_instruction *ir, enum prog_opcode op,
dst_reg dst, src_reg src0);
@@ -312,9 +312,11 @@ public:
void emit_scs(ir_instruction *ir, enum prog_opcode op,
dst_reg dst, const src_reg &src);
- GLboolean try_emit_mad(ir_expression *ir,
+ bool try_emit_mad(ir_expression *ir,
int mul_operand);
- GLboolean try_emit_sat(ir_expression *ir);
+ bool try_emit_mad_for_and_not(ir_expression *ir,
+ int mul_operand);
+ bool try_emit_sat(ir_expression *ir);
void emit_swz(ir_expression *ir);
@@ -408,7 +410,7 @@ ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op)
return emit(ir, op, undef_dst, undef_src, undef_src, undef_src);
}
-void
+ir_to_mesa_instruction *
ir_to_mesa_visitor::emit_dp(ir_instruction *ir,
dst_reg dst, src_reg src0, src_reg src1,
unsigned elements)
@@ -417,7 +419,7 @@ ir_to_mesa_visitor::emit_dp(ir_instruction *ir,
OPCODE_DP2, OPCODE_DP3, OPCODE_DP4
};
- emit(ir, dot_opcodes[elements - 2], dst, src0, src1);
+ return emit(ir, dot_opcodes[elements - 2], dst, src0, src1);
}
/**
@@ -579,7 +581,7 @@ ir_to_mesa_visitor::emit_scs(ir_instruction *ir, enum prog_opcode op,
}
}
-struct src_reg
+src_reg
ir_to_mesa_visitor::src_reg_for_float(float val)
{
src_reg src(PROGRAM_CONSTANT, -1, NULL);
@@ -723,7 +725,7 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
}
}
- struct variable_storage *storage;
+ variable_storage *storage;
dst_reg dst;
if (i == ir->num_state_slots) {
/* We'll set the index later. */
@@ -869,7 +871,7 @@ ir_to_mesa_visitor::visit(ir_function *ir)
}
}
-GLboolean
+bool
ir_to_mesa_visitor::try_emit_mad(ir_expression *ir, int mul_operand)
{
int nonmul_operand = 1 - mul_operand;
@@ -892,7 +894,47 @@ ir_to_mesa_visitor::try_emit_mad(ir_expression *ir, int mul_operand)
return true;
}
-GLboolean
+/**
+ * Emit OPCODE_MAD(a, -b, a) instead of AND(a, NOT(b))
+ *
+ * The logic values are 1.0 for true and 0.0 for false. Logical-and is
+ * implemented using multiplication, and logical-or is implemented using
+ * addition. Logical-not can be implemented as (true - x), or (1.0 - x).
+ * As result, the logical expression (a & !b) can be rewritten as:
+ *
+ * - a * !b
+ * - a * (1 - b)
+ * - (a * 1) - (a * b)
+ * - a + -(a * b)
+ * - a + (a * -b)
+ *
+ * This final expression can be implemented as a single MAD(a, -b, a)
+ * instruction.
+ */
+bool
+ir_to_mesa_visitor::try_emit_mad_for_and_not(ir_expression *ir, int try_operand)
+{
+ const int other_operand = 1 - try_operand;
+ src_reg a, b;
+
+ ir_expression *expr = ir->operands[try_operand]->as_expression();
+ if (!expr || expr->operation != ir_unop_logic_not)
+ return false;
+
+ ir->operands[other_operand]->accept(this);
+ a = this->result;
+ expr->operands[0]->accept(this);
+ b = this->result;
+
+ b.negate = ~b.negate;
+
+ this->result = get_temp(ir->type);
+ emit(ir, OPCODE_MAD, dst_reg(this->result), a, b, a);
+
+ return true;
+}
+
+bool
ir_to_mesa_visitor::try_emit_sat(ir_expression *ir)
{
/* Saturates were only introduced to vertex programs in
@@ -1088,6 +1130,16 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
if (try_emit_mad(ir, 0))
return;
}
+
+ /* Quick peephole: Emit OPCODE_MAD(-a, -b, a) instead of AND(a, NOT(b))
+ */
+ if (ir->operation == ir_binop_logic_and) {
+ if (try_emit_mad_for_and_not(ir, 1))
+ return;
+ if (try_emit_mad_for_and_not(ir, 0))
+ return;
+ }
+
if (try_emit_sat(ir))
return;
@@ -1135,7 +1187,13 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
switch (ir->operation) {
case ir_unop_logic_not:
- emit(ir, OPCODE_SEQ, result_dst, op[0], src_reg_for_float(0.0));
+ /* Previously 'SEQ dst, src, 0.0' was used for this. However, many
+ * older GPUs implement SEQ using multiple instructions (i915 uses two
+ * SGE instructions and a MUL instruction). Since our logic values are
+ * 0.0 and 1.0, 1-x also implements !x.
+ */
+ op[0].negate = ~op[0].negate;
+ emit(ir, OPCODE_ADD, result_dst, op[0], src_reg_for_float(1.0));
break;
case ir_unop_neg:
op[0].negate = ~op[0].negate;
@@ -1231,8 +1289,19 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
ir->operands[1]->type->is_vector()) {
src_reg temp = get_temp(glsl_type::vec4_type);
emit(ir, OPCODE_SNE, dst_reg(temp), op[0], op[1]);
+
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero becomes 1.0, and positive values become zero.
+ */
emit_dp(ir, result_dst, temp, temp, vector_elements);
- emit(ir, OPCODE_SEQ, result_dst, result_src, src_reg_for_float(0.0));
+
+ /* Negating the result of the dot-product gives values on the range
+ * [-4, 0]. Zero becomes 1.0, and negative values become zero. This
+ * achieved using SGE.
+ */
+ src_reg sge_src = result_src;
+ sge_src.negate = ~sge_src.negate;
+ emit(ir, OPCODE_SGE, result_dst, sge_src, src_reg_for_float(0.0));
} else {
emit(ir, OPCODE_SEQ, result_dst, op[0], op[1]);
}
@@ -1243,29 +1312,83 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
ir->operands[1]->type->is_vector()) {
src_reg temp = get_temp(glsl_type::vec4_type);
emit(ir, OPCODE_SNE, dst_reg(temp), op[0], op[1]);
- emit_dp(ir, result_dst, temp, temp, vector_elements);
- emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
+
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero stays zero, and positive values become 1.0.
+ */
+ ir_to_mesa_instruction *const dp =
+ emit_dp(ir, result_dst, temp, temp, vector_elements);
+ if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
+ /* The clamping to [0,1] can be done for free in the fragment
+ * shader with a saturate.
+ */
+ dp->saturate = true;
+ } else {
+ /* Negating the result of the dot-product gives values on the range
+ * [-4, 0]. Zero stays zero, and negative values become 1.0. This
+ * achieved using SLT.
+ */
+ src_reg slt_src = result_src;
+ slt_src.negate = ~slt_src.negate;
+ emit(ir, OPCODE_SLT, result_dst, slt_src, src_reg_for_float(0.0));
+ }
} else {
emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
}
break;
- case ir_unop_any:
+ case ir_unop_any: {
assert(ir->operands[0]->type->is_vector());
- emit_dp(ir, result_dst, op[0], op[0],
- ir->operands[0]->type->vector_elements);
- emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
+
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero stays zero, and positive values become 1.0.
+ */
+ ir_to_mesa_instruction *const dp =
+ emit_dp(ir, result_dst, op[0], op[0],
+ ir->operands[0]->type->vector_elements);
+ if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
+ /* The clamping to [0,1] can be done for free in the fragment
+ * shader with a saturate.
+ */
+ dp->saturate = true;
+ } else {
+ /* Negating the result of the dot-product gives values on the range
+ * [-4, 0]. Zero stays zero, and negative values become 1.0. This
+ * is achieved using SLT.
+ */
+ src_reg slt_src = result_src;
+ slt_src.negate = ~slt_src.negate;
+ emit(ir, OPCODE_SLT, result_dst, slt_src, src_reg_for_float(0.0));
+ }
break;
+ }
case ir_binop_logic_xor:
emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
break;
- case ir_binop_logic_or:
- /* This could be a saturated add and skip the SNE. */
- emit(ir, OPCODE_ADD, result_dst, op[0], op[1]);
- emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
+ case ir_binop_logic_or: {
+ /* After the addition, the value will be an integer on the
+ * range [0,2]. Zero stays zero, and positive values become 1.0.
+ */
+ ir_to_mesa_instruction *add =
+ emit(ir, OPCODE_ADD, result_dst, op[0], op[1]);
+ if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
+ /* The clamping to [0,1] can be done for free in the fragment
+ * shader with a saturate.
+ */
+ add->saturate = true;
+ } else {
+ /* Negating the result of the addition gives values on the range
+ * [-2, 0]. Zero stays zero, and negative values become 1.0. This
+ * is achieved using SLT.
+ */
+ src_reg slt_src = result_src;
+ slt_src.negate = ~slt_src.negate;
+ emit(ir, OPCODE_SLT, result_dst, slt_src, src_reg_for_float(0.0));
+ }
break;
+ }
case ir_binop_logic_and:
/* the bool args are stored as float 0.0 or 1.0, so "mul" gives us "and". */
@@ -1981,7 +2104,10 @@ ir_to_mesa_visitor::visit(ir_texture *ir)
ir_to_mesa_instruction *inst = NULL;
prog_opcode opcode = OPCODE_NOP;
- ir->coordinate->accept(this);
+ if (ir->op == ir_txs)
+ this->result = src_reg_for_float(0.0);
+ else
+ ir->coordinate->accept(this);
/* Put our coords in a temp. We'll need to modify them for shadow,
* projection, or LOD, so the only case we'd use it as is is if
@@ -2005,6 +2131,7 @@ ir_to_mesa_visitor::visit(ir_texture *ir)
switch (ir->op) {
case ir_tex:
+ case ir_txs:
opcode = OPCODE_TEX;
break;
case ir_txb:
diff --git a/mesalib/src/mesa/program/prog_execute.c b/mesalib/src/mesa/program/prog_execute.c
index dbfd1b918..77f842a16 100644
--- a/mesalib/src/mesa/program/prog_execute.c
+++ b/mesalib/src/mesa/program/prog_execute.c
@@ -639,7 +639,7 @@ _mesa_execute_program(struct gl_context * ctx,
struct gl_program_machine *machine)
{
const GLuint numInst = program->NumInstructions;
- const GLuint maxExec = 10000;
+ const GLuint maxExec = 65536;
GLuint pc, numExec = 0;
machine->CurProgram = program;
@@ -1651,6 +1651,14 @@ _mesa_execute_program(struct gl_context * ctx,
GLfloat texcoord[4], color[4];
fetch_vector4(&inst->SrcReg[0], machine, texcoord);
+ /* For TEX, texcoord.Q should not be used and its value should not
+ * matter (at most, we pass coord.xyz to texture3D() in GLSL).
+ * Set Q=1 so that FetchTexelDeriv() doesn't get a garbage value
+ * which is effectively what happens when the texcoord swizzle
+ * is .xyzz
+ */
+ texcoord[3] = 1.0f;
+
fetch_texel(ctx, machine, inst, texcoord, 0.0, color);
if (DEBUG_PROG) {
diff --git a/mesalib/src/mesa/program/prog_opt_constant_fold.c b/mesalib/src/mesa/program/prog_opt_constant_fold.c
new file mode 100644
index 000000000..e2418b554
--- /dev/null
+++ b/mesalib/src/mesa/program/prog_opt_constant_fold.c
@@ -0,0 +1,451 @@
+/*
+ * Copyright © 2010 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.
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "program.h"
+#include "prog_instruction.h"
+#include "prog_optimize.h"
+#include "prog_parameter.h"
+#include <stdbool.h>
+
+static bool
+src_regs_are_constant(const struct prog_instruction *inst, unsigned num_srcs)
+{
+ unsigned i;
+
+ for (i = 0; i < num_srcs; i++) {
+ if (inst->SrcReg[i].File != PROGRAM_CONSTANT)
+ return false;
+ }
+
+ return true;
+}
+
+static struct prog_src_register
+src_reg_for_float(struct gl_program *prog, float val)
+{
+ struct prog_src_register src;
+ unsigned swiz;
+
+ memset(&src, 0, sizeof(src));
+
+ src.File = PROGRAM_CONSTANT;
+ src.Index = _mesa_add_unnamed_constant(prog->Parameters,
+ (gl_constant_value *) &val, 1, &swiz);
+ src.Swizzle = swiz;
+ return src;
+}
+
+static struct prog_src_register
+src_reg_for_vec4(struct gl_program *prog, const float *val)
+{
+ struct prog_src_register src;
+ unsigned swiz;
+
+ memset(&src, 0, sizeof(src));
+
+ src.File = PROGRAM_CONSTANT;
+ src.Index = _mesa_add_unnamed_constant(prog->Parameters,
+ (gl_constant_value *) val, 4, &swiz);
+ src.Swizzle = swiz;
+ return src;
+}
+
+static bool
+src_regs_are_same(const struct prog_src_register *a,
+ const struct prog_src_register *b)
+{
+ return (a->File == b->File)
+ && (a->Index == b->Index)
+ && (a->Swizzle == b->Swizzle)
+ && (a->Abs == b->Abs)
+ && (a->Negate == b->Negate)
+ && (a->RelAddr == 0)
+ && (b->RelAddr == 0);
+}
+
+static void
+get_value(struct gl_program *prog, struct prog_src_register *r, float *data)
+{
+ const gl_constant_value *const value =
+ prog->Parameters->ParameterValues[r->Index];
+
+ data[0] = value[GET_SWZ(r->Swizzle, 0)].f;
+ data[1] = value[GET_SWZ(r->Swizzle, 1)].f;
+ data[2] = value[GET_SWZ(r->Swizzle, 2)].f;
+ data[3] = value[GET_SWZ(r->Swizzle, 3)].f;
+
+ if (r->Abs) {
+ data[0] = fabsf(data[0]);
+ data[1] = fabsf(data[1]);
+ data[2] = fabsf(data[2]);
+ data[3] = fabsf(data[3]);
+ }
+
+ if (r->Negate & 0x01) {
+ data[0] = -data[0];
+ }
+
+ if (r->Negate & 0x02) {
+ data[1] = -data[1];
+ }
+
+ if (r->Negate & 0x04) {
+ data[2] = -data[2];
+ }
+
+ if (r->Negate & 0x08) {
+ data[3] = -data[3];
+ }
+}
+
+/**
+ * Try to replace instructions that produce a constant result with simple moves
+ *
+ * The hope is that a following copy propagation pass will eliminate the
+ * unnecessary move instructions.
+ */
+GLboolean
+_mesa_constant_fold(struct gl_program *prog)
+{
+ bool progress = false;
+ unsigned i;
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *const inst = &prog->Instructions[i];
+
+ switch (inst->Opcode) {
+ case OPCODE_ADD:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], 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];
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_CMP:
+ /* FINISHME: We could also optimize CMP instructions where the first
+ * FINISHME: source is a constant that is either all < 0.0 or all
+ * FINISHME: >= 0.0.
+ */
+ if (src_regs_are_constant(inst, 3)) {
+ float a[4];
+ float b[4];
+ float c[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], b);
+ get_value(prog, &inst->SrcReg[2], c);
+
+ result[0] = a[0] < 0.0f ? b[0] : c[0];
+ result[1] = a[1] < 0.0f ? b[1] : c[1];
+ result[2] = a[2] < 0.0f ? b[2] : c[2];
+ result[3] = a[3] < 0.0f ? b[3] : c[3];
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+ inst->SrcReg[2].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[2].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_DP2:
+ case OPCODE_DP3:
+ case OPCODE_DP4:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result;
+
+ 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)
+ result += a[2] * b[2];
+
+ if (inst->Opcode == OPCODE_DP4)
+ result += a[3] * b[3];
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_float(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_MUL:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], 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];
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_SEQ:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], b);
+
+ result[0] = (a[0] == b[0]) ? 1.0f : 0.0f;
+ result[1] = (a[1] == b[1]) ? 1.0f : 0.0f;
+ result[2] = (a[2] == b[2]) ? 1.0f : 0.0f;
+ result[3] = (a[3] == b[3]) ? 1.0f : 0.0f;
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ } else if (src_regs_are_same(&inst->SrcReg[0], &inst->SrcReg[1])) {
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_float(prog, 1.0f);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_SGE:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], b);
+
+ result[0] = (a[0] >= b[0]) ? 1.0f : 0.0f;
+ result[1] = (a[1] >= b[1]) ? 1.0f : 0.0f;
+ result[2] = (a[2] >= b[2]) ? 1.0f : 0.0f;
+ result[3] = (a[3] >= b[3]) ? 1.0f : 0.0f;
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ } else if (src_regs_are_same(&inst->SrcReg[0], &inst->SrcReg[1])) {
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_float(prog, 1.0f);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_SGT:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], b);
+
+ result[0] = (a[0] > b[0]) ? 1.0f : 0.0f;
+ result[1] = (a[1] > b[1]) ? 1.0f : 0.0f;
+ result[2] = (a[2] > b[2]) ? 1.0f : 0.0f;
+ result[3] = (a[3] > b[3]) ? 1.0f : 0.0f;
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ } else if (src_regs_are_same(&inst->SrcReg[0], &inst->SrcReg[1])) {
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_float(prog, 0.0f);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_SLE:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], b);
+
+ result[0] = (a[0] <= b[0]) ? 1.0f : 0.0f;
+ result[1] = (a[1] <= b[1]) ? 1.0f : 0.0f;
+ result[2] = (a[2] <= b[2]) ? 1.0f : 0.0f;
+ result[3] = (a[3] <= b[3]) ? 1.0f : 0.0f;
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ } else if (src_regs_are_same(&inst->SrcReg[0], &inst->SrcReg[1])) {
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_float(prog, 1.0f);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_SLT:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], b);
+
+ result[0] = (a[0] < b[0]) ? 1.0f : 0.0f;
+ result[1] = (a[1] < b[1]) ? 1.0f : 0.0f;
+ result[2] = (a[2] < b[2]) ? 1.0f : 0.0f;
+ result[3] = (a[3] < b[3]) ? 1.0f : 0.0f;
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ } else if (src_regs_are_same(&inst->SrcReg[0], &inst->SrcReg[1])) {
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_float(prog, 0.0f);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ case OPCODE_SNE:
+ if (src_regs_are_constant(inst, 2)) {
+ float a[4];
+ float b[4];
+ float result[4];
+
+ get_value(prog, &inst->SrcReg[0], a);
+ get_value(prog, &inst->SrcReg[1], b);
+
+ result[0] = (a[0] != b[0]) ? 1.0f : 0.0f;
+ result[1] = (a[1] != b[1]) ? 1.0f : 0.0f;
+ result[2] = (a[2] != b[2]) ? 1.0f : 0.0f;
+ result[3] = (a[3] != b[3]) ? 1.0f : 0.0f;
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_vec4(prog, result);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ } else if (src_regs_are_same(&inst->SrcReg[0], &inst->SrcReg[1])) {
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = src_reg_for_float(prog, 0.0f);
+
+ inst->SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ progress = true;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return progress;
+}
diff --git a/mesalib/src/mesa/program/prog_optimize.c b/mesalib/src/mesa/program/prog_optimize.c
index 3340ce049..25d9684b1 100644
--- a/mesalib/src/mesa/program/prog_optimize.c
+++ b/mesalib/src/mesa/program/prog_optimize.c
@@ -1358,6 +1358,8 @@ _mesa_optimize_program(struct gl_context *ctx, struct gl_program *program)
any_change = GL_TRUE;
if (_mesa_remove_dead_code_local(program))
any_change = GL_TRUE;
+
+ any_change = _mesa_constant_fold(program) || any_change;
_mesa_reallocate_registers(program);
} while (any_change);
}
diff --git a/mesalib/src/mesa/program/prog_optimize.h b/mesalib/src/mesa/program/prog_optimize.h
index 8dc58ee52..9854fb7a4 100644
--- a/mesalib/src/mesa/program/prog_optimize.h
+++ b/mesalib/src/mesa/program/prog_optimize.h
@@ -1,47 +1,50 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 2009 VMware, Inc. 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
- * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION 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_OPT_H
-#define PROG_OPT_H
-
-
-#include "main/config.h"
-#include "main/glheader.h"
-
-
-struct gl_context;
-struct gl_program;
-struct prog_instruction;
-
-
-extern GLboolean
-_mesa_find_temp_intervals(const struct prog_instruction *instructions,
- GLuint numInstructions,
- GLint intBegin[MAX_PROGRAM_TEMPS],
- GLint intEnd[MAX_PROGRAM_TEMPS]);
-
-extern void
-_mesa_optimize_program(struct gl_context *ctx, struct gl_program *program);
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 2009 VMware, Inc. 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
+ * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION 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_OPT_H
+#define PROG_OPT_H
+
+
+#include "main/config.h"
+#include "main/glheader.h"
+
+
+struct gl_context;
+struct gl_program;
+struct prog_instruction;
+
+
+extern GLboolean
+_mesa_find_temp_intervals(const struct prog_instruction *instructions,
+ GLuint numInstructions,
+ GLint intBegin[MAX_PROGRAM_TEMPS],
+ GLint intEnd[MAX_PROGRAM_TEMPS]);
+
+extern void
+_mesa_optimize_program(struct gl_context *ctx, struct gl_program *program);
+
+extern GLboolean
+_mesa_constant_fold(struct gl_program *prog);
+
+#endif
diff --git a/mesalib/src/mesa/program/register_allocate.c b/mesalib/src/mesa/program/register_allocate.c
index de96eb42c..f5b5174fc 100644
--- a/mesalib/src/mesa/program/register_allocate.c
+++ b/mesalib/src/mesa/program/register_allocate.c
@@ -200,6 +200,27 @@ ra_add_reg_conflict(struct ra_regs *regs, unsigned int r1, unsigned int r2)
}
}
+/**
+ * Adds a conflict between base_reg and reg, and also between reg and
+ * anything that base_reg conflicts with.
+ *
+ * This can simplify code for setting up multiple register classes
+ * which are aggregates of some base hardware registers, compared to
+ * explicitly using ra_add_reg_conflict.
+ */
+void
+ra_add_transitive_reg_conflict(struct ra_regs *regs,
+ unsigned int base_reg, unsigned int reg)
+{
+ int i;
+
+ ra_add_reg_conflict(regs, reg, base_reg);
+
+ for (i = 0; i < regs->regs[base_reg].num_conflicts; i++) {
+ ra_add_reg_conflict(regs, reg, regs->regs[base_reg].conflict_list[i]);
+ }
+}
+
unsigned int
ra_alloc_reg_class(struct ra_regs *regs)
{
diff --git a/mesalib/src/mesa/program/register_allocate.h b/mesalib/src/mesa/program/register_allocate.h
index 5b95833f3..ee2e58a47 100644
--- a/mesalib/src/mesa/program/register_allocate.h
+++ b/mesalib/src/mesa/program/register_allocate.h
@@ -40,6 +40,8 @@ struct ra_regs *ra_alloc_reg_set(unsigned int count);
unsigned int ra_alloc_reg_class(struct ra_regs *regs);
void ra_add_reg_conflict(struct ra_regs *regs,
unsigned int r1, unsigned int r2);
+void ra_add_transitive_reg_conflict(struct ra_regs *regs,
+ unsigned int base_reg, unsigned int reg);
void ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int reg);
void ra_set_finalize(struct ra_regs *regs);
/** @} */
diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak
index ed008f881..5e77e0f59 100644
--- a/mesalib/src/mesa/sources.mak
+++ b/mesalib/src/mesa/sources.mak
@@ -251,6 +251,7 @@ PROGRAM_SOURCES = \
program/prog_instruction.c \
program/prog_noise.c \
program/prog_optimize.c \
+ program/prog_opt_constant_fold.c \
program/prog_parameter.c \
program/prog_parameter_layout.c \
program/prog_print.c \
diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
index 7374bb0ac..a451b4404 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -93,7 +93,6 @@ st_bufferobj_free(struct gl_context *ctx, struct gl_buffer_object *obj)
*/
static void
st_bufferobj_subdata(struct gl_context *ctx,
- GLenum target,
GLintptrARB offset,
GLsizeiptrARB size,
const GLvoid * data, struct gl_buffer_object *obj)
@@ -133,7 +132,6 @@ st_bufferobj_subdata(struct gl_context *ctx,
*/
static void
st_bufferobj_get_subdata(struct gl_context *ctx,
- GLenum target,
GLintptrARB offset,
GLsizeiptrARB size,
GLvoid * data, struct gl_buffer_object *obj)
@@ -238,52 +236,10 @@ static long st_bufferobj_zero_length = 0;
/**
- * Called via glMapBufferARB().
- */
-static void *
-st_bufferobj_map(struct gl_context *ctx, GLenum target, GLenum access,
- struct gl_buffer_object *obj)
-{
- struct st_buffer_object *st_obj = st_buffer_object(obj);
- uint flags;
-
- switch (access) {
- case GL_WRITE_ONLY:
- flags = PIPE_TRANSFER_WRITE;
- break;
- case GL_READ_ONLY:
- flags = PIPE_TRANSFER_READ;
- break;
- case GL_READ_WRITE:
- default:
- flags = PIPE_TRANSFER_READ_WRITE;
- break;
- }
-
- /* Handle zero-size buffers here rather than in drivers */
- if (obj->Size == 0) {
- obj->Pointer = &st_bufferobj_zero_length;
- }
- else {
- obj->Pointer = pipe_buffer_map(st_context(ctx)->pipe,
- st_obj->buffer,
- flags,
- &st_obj->transfer);
- }
-
- if (obj->Pointer) {
- obj->Offset = 0;
- obj->Length = obj->Size;
- }
- return obj->Pointer;
-}
-
-
-/**
* Called via glMapBufferRange().
*/
static void *
-st_bufferobj_map_range(struct gl_context *ctx, GLenum target,
+st_bufferobj_map_range(struct gl_context *ctx,
GLintptr offset, GLsizeiptr length, GLbitfield access,
struct gl_buffer_object *obj)
{
@@ -353,7 +309,7 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target,
static void
-st_bufferobj_flush_mapped_range(struct gl_context *ctx, GLenum target,
+st_bufferobj_flush_mapped_range(struct gl_context *ctx,
GLintptr offset, GLsizeiptr length,
struct gl_buffer_object *obj)
{
@@ -378,7 +334,7 @@ st_bufferobj_flush_mapped_range(struct gl_context *ctx, GLenum target,
* Called via glUnmapBufferARB().
*/
static GLboolean
-st_bufferobj_unmap(struct gl_context *ctx, GLenum target, struct gl_buffer_object *obj)
+st_bufferobj_unmap(struct gl_context *ctx, struct gl_buffer_object *obj)
{
struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_buffer_object *st_obj = st_buffer_object(obj);
@@ -444,7 +400,6 @@ st_init_bufferobject_functions(struct dd_function_table *functions)
functions->BufferData = st_bufferobj_data;
functions->BufferSubData = st_bufferobj_subdata;
functions->GetBufferSubData = st_bufferobj_get_subdata;
- functions->MapBuffer = st_bufferobj_map;
functions->MapBufferRange = st_bufferobj_map_range;
functions->FlushMappedBufferRange = st_bufferobj_flush_mapped_range;
functions->UnmapBuffer = st_bufferobj_unmap;
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index 25f08aa4d..a3b2ba9e7 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -344,7 +344,7 @@ guess_and_alloc_texture(struct st_context *st,
stImage->base.Width2,
stImage->base.Height2,
stImage->base.Depth2,
- stImage->level,
+ stImage->base.Level,
&width, &height, &depth)) {
/* we can't determine the image size at level=0 */
stObj->width0 = stObj->height0 = stObj->depth0 = 0;
@@ -367,7 +367,7 @@ guess_and_alloc_texture(struct st_context *st,
stImage->base._BaseFormat == GL_DEPTH_COMPONENT ||
stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) &&
!stObj->base.GenerateMipmap &&
- stImage->level == 0) {
+ stImage->base.Level == 0) {
/* only alloc space for a single mipmap level */
lastLevel = 0;
}
@@ -506,8 +506,8 @@ st_TexImage(struct gl_context * ctx,
assert(texImage->Depth == depth);
}
- stImage->face = _mesa_tex_target_to_face(target);
- stImage->level = level;
+ stImage->base.Face = _mesa_tex_target_to_face(target);
+ stImage->base.Level = level;
_mesa_set_fetch_functions(texImage, dims);
@@ -529,7 +529,7 @@ st_TexImage(struct gl_context * ctx,
if (stObj->pt) {
if (level > (GLint) stObj->pt->last_level ||
!st_texture_match_image(stObj->pt, &stImage->base,
- stImage->face, stImage->level)) {
+ stImage->base.Face, stImage->base.Level)) {
DBG("release it\n");
pipe_resource_reference(&stObj->pt, NULL);
assert(!stObj->pt);
@@ -563,7 +563,7 @@ st_TexImage(struct gl_context * ctx,
*/
if (stObj->pt &&
st_texture_match_image(stObj->pt, &stImage->base,
- stImage->face, stImage->level)) {
+ stImage->base.Face, stImage->base.Level)) {
pipe_resource_reference(&stImage->pt, stObj->pt);
assert(stImage->pt);
@@ -1501,8 +1501,8 @@ st_copy_texsubimage(struct gl_context *ctx,
pipe->resource_copy_region(pipe,
/* dest */
stImage->pt,
- stImage->level,
- destX, destY, destZ + stImage->face,
+ stImage->base.Level,
+ destX, destY, destZ + stImage->base.Face,
/* src */
strb->texture,
strb->surface->u.tex.level,
@@ -1524,9 +1524,9 @@ st_copy_texsubimage(struct gl_context *ctx,
memset(&surf_tmpl, 0, sizeof(surf_tmpl));
surf_tmpl.format = util_format_linear(stImage->pt->format);
surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
- surf_tmpl.u.tex.level = stImage->level;
- surf_tmpl.u.tex.first_layer = stImage->face + destZ;
- surf_tmpl.u.tex.last_layer = stImage->face + destZ;
+ surf_tmpl.u.tex.level = stImage->base.Level;
+ surf_tmpl.u.tex.first_layer = stImage->base.Face + destZ;
+ surf_tmpl.u.tex.last_layer = stImage->base.Face + destZ;
dest_surface = pipe->create_surface(pipe, stImage->pt,
&surf_tmpl);
@@ -1629,7 +1629,7 @@ copy_image_data_to_texture(struct st_context *st,
/* debug checks */
{
const struct gl_texture_image *dstImage =
- stObj->base.Image[stImage->face][dstLevel];
+ stObj->base.Image[stImage->base.Face][dstLevel];
assert(dstImage);
assert(dstImage->Width == stImage->base.Width);
assert(dstImage->Height == stImage->base.Height);
@@ -1641,15 +1641,15 @@ copy_image_data_to_texture(struct st_context *st,
*/
st_texture_image_copy(st->pipe,
stObj->pt, dstLevel, /* dest texture, level */
- stImage->pt, stImage->level, /* src texture, level */
- stImage->face);
+ stImage->pt, stImage->base.Level, /* src texture, level */
+ stImage->base.Face);
pipe_resource_reference(&stImage->pt, NULL);
}
else if (stImage->base.Data) {
st_texture_image_data(st,
stObj->pt,
- stImage->face,
+ stImage->base.Face,
dstLevel,
stImage->base.Data,
stImage->base.RowStride *
diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
index b0911294a..82ca4af7f 100644
--- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
@@ -453,7 +453,6 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
srcImage->TexFormat);
stImage = st_texture_image(dstImage);
- stImage->level = dstLevel;
pipe_resource_reference(&stImage->pt, pt);
}
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 aef23e7d2..22660830a 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -295,6 +295,7 @@ public:
bool indirect_addr_consts;
int glsl_version;
+ bool native_integers;
variable_storage *find_variable_storage(ir_variable *var);
@@ -372,11 +373,11 @@ public:
/**
* Emit the correct dot-product instruction for the type of arguments
*/
- void emit_dp(ir_instruction *ir,
- st_dst_reg dst,
- st_src_reg src0,
- st_src_reg src1,
- unsigned elements);
+ glsl_to_tgsi_instruction *emit_dp(ir_instruction *ir,
+ st_dst_reg dst,
+ st_src_reg src0,
+ st_src_reg src1,
+ unsigned elements);
void emit_scalar(ir_instruction *ir, unsigned op,
st_dst_reg dst, st_src_reg src0);
@@ -389,9 +390,11 @@ public:
void emit_scs(ir_instruction *ir, unsigned op,
st_dst_reg dst, const st_src_reg &src);
- GLboolean try_emit_mad(ir_expression *ir,
- int mul_operand);
- GLboolean try_emit_sat(ir_expression *ir);
+ bool try_emit_mad(ir_expression *ir,
+ int mul_operand);
+ bool try_emit_mad_for_and_not(ir_expression *ir,
+ int mul_operand);
+ bool try_emit_sat(ir_expression *ir);
void emit_swz(ir_expression *ir);
@@ -600,7 +603,7 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op,
if (src0.type == GLSL_TYPE_FLOAT || src1.type == GLSL_TYPE_FLOAT)
type = GLSL_TYPE_FLOAT;
- else if (glsl_version >= 130)
+ else if (native_integers)
type = src0.type;
#define case4(c, f, i, u) \
@@ -641,7 +644,7 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op,
return op;
}
-void
+glsl_to_tgsi_instruction *
glsl_to_tgsi_visitor::emit_dp(ir_instruction *ir,
st_dst_reg dst, st_src_reg src0, st_src_reg src1,
unsigned elements)
@@ -650,7 +653,7 @@ glsl_to_tgsi_visitor::emit_dp(ir_instruction *ir,
TGSI_OPCODE_DP2, TGSI_OPCODE_DP3, TGSI_OPCODE_DP4
};
- emit(ir, dot_opcodes[elements - 2], dst, src0, src1);
+ return emit(ir, dot_opcodes[elements - 2], dst, src0, src1);
}
/**
@@ -863,7 +866,7 @@ glsl_to_tgsi_visitor::add_constant(gl_register_file file,
}
}
-struct st_src_reg
+st_src_reg
glsl_to_tgsi_visitor::st_src_reg_for_float(float val)
{
st_src_reg src(PROGRAM_IMMEDIATE, -1, GLSL_TYPE_FLOAT);
@@ -875,13 +878,13 @@ glsl_to_tgsi_visitor::st_src_reg_for_float(float val)
return src;
}
-struct st_src_reg
+st_src_reg
glsl_to_tgsi_visitor::st_src_reg_for_int(int val)
{
st_src_reg src(PROGRAM_IMMEDIATE, -1, GLSL_TYPE_INT);
union gl_constant_value uval;
- assert(glsl_version >= 130);
+ assert(native_integers);
uval.i = val;
src.index = add_constant(src.file, &uval, 1, GL_INT, &src.swizzle);
@@ -889,10 +892,10 @@ glsl_to_tgsi_visitor::st_src_reg_for_int(int val)
return src;
}
-struct st_src_reg
+st_src_reg
glsl_to_tgsi_visitor::st_src_reg_for_type(int type, int val)
{
- if (glsl_version >= 130)
+ if (native_integers)
return type == GLSL_TYPE_FLOAT ? st_src_reg_for_float(val) :
st_src_reg_for_int(val);
else
@@ -950,7 +953,7 @@ glsl_to_tgsi_visitor::get_temp(const glsl_type *type)
{
st_src_reg src;
- src.type = glsl_version >= 130 ? type->base_type : GLSL_TYPE_FLOAT;
+ src.type = native_integers ? type->base_type : GLSL_TYPE_FLOAT;
src.file = PROGRAM_TEMPORARY;
src.index = next_temp;
src.reladdr = NULL;
@@ -1032,7 +1035,7 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir)
}
}
- struct variable_storage *storage;
+ variable_storage *storage;
st_dst_reg dst;
if (i == ir->num_state_slots) {
/* We'll set the index later. */
@@ -1053,7 +1056,7 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir)
this->next_temp += type_size(ir->type);
dst = st_dst_reg(st_src_reg(PROGRAM_TEMPORARY, storage->index,
- glsl_version >= 130 ? ir->type->base_type : GLSL_TYPE_FLOAT));
+ native_integers ? ir->type->base_type : GLSL_TYPE_FLOAT));
}
@@ -1069,7 +1072,7 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir)
}
} else {
st_src_reg src(PROGRAM_STATE_VAR, index,
- glsl_version >= 130 ? ir->type->base_type : GLSL_TYPE_FLOAT);
+ native_integers ? ir->type->base_type : GLSL_TYPE_FLOAT);
src.swizzle = slots[i].swizzle;
emit(ir, TGSI_OPCODE_MOV, dst, src);
/* even a float takes up a whole vec4 reg in a struct/array. */
@@ -1183,7 +1186,7 @@ glsl_to_tgsi_visitor::visit(ir_function *ir)
}
}
-GLboolean
+bool
glsl_to_tgsi_visitor::try_emit_mad(ir_expression *ir, int mul_operand)
{
int nonmul_operand = 1 - mul_operand;
@@ -1209,7 +1212,47 @@ glsl_to_tgsi_visitor::try_emit_mad(ir_expression *ir, int mul_operand)
return true;
}
-GLboolean
+/**
+ * Emit MAD(a, -b, a) instead of AND(a, NOT(b))
+ *
+ * The logic values are 1.0 for true and 0.0 for false. Logical-and is
+ * implemented using multiplication, and logical-or is implemented using
+ * addition. Logical-not can be implemented as (true - x), or (1.0 - x).
+ * As result, the logical expression (a & !b) can be rewritten as:
+ *
+ * - a * !b
+ * - a * (1 - b)
+ * - (a * 1) - (a * b)
+ * - a + -(a * b)
+ * - a + (a * -b)
+ *
+ * This final expression can be implemented as a single MAD(a, -b, a)
+ * instruction.
+ */
+bool
+glsl_to_tgsi_visitor::try_emit_mad_for_and_not(ir_expression *ir, int try_operand)
+{
+ const int other_operand = 1 - try_operand;
+ st_src_reg a, b;
+
+ ir_expression *expr = ir->operands[try_operand]->as_expression();
+ if (!expr || expr->operation != ir_unop_logic_not)
+ return false;
+
+ ir->operands[other_operand]->accept(this);
+ a = this->result;
+ expr->operands[0]->accept(this);
+ b = this->result;
+
+ b.negate = ~b.negate;
+
+ this->result = get_temp(ir->type);
+ emit(ir, TGSI_OPCODE_MAD, st_dst_reg(this->result), a, b, a);
+
+ return true;
+}
+
+bool
glsl_to_tgsi_visitor::try_emit_sat(ir_expression *ir)
{
/* Saturates were only introduced to vertex programs in
@@ -1290,6 +1333,16 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
if (try_emit_mad(ir, 0))
return;
}
+
+ /* Quick peephole: Emit OPCODE_MAD(-a, -b, a) instead of AND(a, NOT(b))
+ */
+ if (ir->operation == ir_binop_logic_and) {
+ if (try_emit_mad_for_and_not(ir, 1))
+ return;
+ if (try_emit_mad_for_and_not(ir, 0))
+ return;
+ }
+
if (try_emit_sat(ir))
return;
@@ -1335,7 +1388,17 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
switch (ir->operation) {
case ir_unop_logic_not:
- emit(ir, TGSI_OPCODE_SEQ, result_dst, op[0], st_src_reg_for_type(result_dst.type, 0));
+ if (result_dst.type != GLSL_TYPE_FLOAT)
+ emit(ir, TGSI_OPCODE_SEQ, result_dst, op[0], st_src_reg_for_type(result_dst.type, 0));
+ else {
+ /* Previously 'SEQ dst, src, 0.0' was used for this. However, many
+ * older GPUs implement SEQ using multiple instructions (i915 uses two
+ * SGE instructions and a MUL instruction). Since our logic values are
+ * 0.0 and 1.0, 1-x also implements !x.
+ */
+ op[0].negate = ~op[0].negate;
+ emit(ir, TGSI_OPCODE_ADD, result_dst, op[0], st_src_reg_for_float(1.0));
+ }
break;
case ir_unop_neg:
assert(result_dst.type == GLSL_TYPE_FLOAT || result_dst.type == GLSL_TYPE_INT);
@@ -1444,13 +1507,31 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
/* "==" operator producing a scalar boolean. */
if (ir->operands[0]->type->is_vector() ||
ir->operands[1]->type->is_vector()) {
- st_src_reg temp = get_temp(glsl_version >= 130 ?
+ st_src_reg temp = get_temp(native_integers ?
glsl_type::get_instance(ir->operands[0]->type->base_type, 4, 1) :
glsl_type::vec4_type);
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
emit(ir, TGSI_OPCODE_SNE, st_dst_reg(temp), op[0], op[1]);
+
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero becomes 1.0, and positive values become zero.
+ */
emit_dp(ir, result_dst, temp, temp, vector_elements);
- emit(ir, TGSI_OPCODE_SEQ, result_dst, result_src, st_src_reg_for_float(0.0));
+
+ if (result_dst.type == GLSL_TYPE_FLOAT) {
+ /* Negating the result of the dot-product gives values on the range
+ * [-4, 0]. Zero becomes 1.0, and negative values become zero.
+ * This is achieved using SGE.
+ */
+ st_src_reg sge_src = result_src;
+ sge_src.negate = ~sge_src.negate;
+ emit(ir, TGSI_OPCODE_SGE, result_dst, sge_src, st_src_reg_for_float(0.0));
+ } else {
+ /* The TGSI negate flag doesn't work for integers, so use SEQ 0
+ * instead.
+ */
+ emit(ir, TGSI_OPCODE_SEQ, result_dst, result_src, st_src_reg_for_int(0));
+ }
} else {
emit(ir, TGSI_OPCODE_SEQ, result_dst, op[0], op[1]);
}
@@ -1459,34 +1540,102 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
/* "!=" operator producing a scalar boolean. */
if (ir->operands[0]->type->is_vector() ||
ir->operands[1]->type->is_vector()) {
- st_src_reg temp = get_temp(glsl_version >= 130 ?
+ st_src_reg temp = get_temp(native_integers ?
glsl_type::get_instance(ir->operands[0]->type->base_type, 4, 1) :
glsl_type::vec4_type);
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
emit(ir, TGSI_OPCODE_SNE, st_dst_reg(temp), op[0], op[1]);
- emit_dp(ir, result_dst, temp, temp, vector_elements);
- emit(ir, TGSI_OPCODE_SNE, result_dst, result_src, st_src_reg_for_float(0.0));
+
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero stays zero, and positive values become 1.0.
+ */
+ glsl_to_tgsi_instruction *const dp =
+ emit_dp(ir, result_dst, temp, temp, vector_elements);
+ if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB &&
+ result_dst.type == GLSL_TYPE_FLOAT) {
+ /* The clamping to [0,1] can be done for free in the fragment
+ * shader with a saturate.
+ */
+ dp->saturate = true;
+ } else if (result_dst.type == GLSL_TYPE_FLOAT) {
+ /* Negating the result of the dot-product gives values on the range
+ * [-4, 0]. Zero stays zero, and negative values become 1.0. This
+ * achieved using SLT.
+ */
+ st_src_reg slt_src = result_src;
+ slt_src.negate = ~slt_src.negate;
+ emit(ir, TGSI_OPCODE_SLT, result_dst, slt_src, st_src_reg_for_float(0.0));
+ } else {
+ emit(ir, TGSI_OPCODE_SNE, result_dst, result_src, st_src_reg_for_int(0));
+ }
} else {
emit(ir, TGSI_OPCODE_SNE, result_dst, op[0], op[1]);
}
break;
- case ir_unop_any:
+ case ir_unop_any: {
assert(ir->operands[0]->type->is_vector());
- emit_dp(ir, result_dst, op[0], op[0],
- ir->operands[0]->type->vector_elements);
- emit(ir, TGSI_OPCODE_SNE, result_dst, result_src, st_src_reg_for_float(0.0));
+
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero stays zero, and positive values become 1.0.
+ */
+ glsl_to_tgsi_instruction *const dp =
+ emit_dp(ir, result_dst, op[0], op[0],
+ ir->operands[0]->type->vector_elements);
+ if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB &&
+ result_dst.type == GLSL_TYPE_FLOAT) {
+ /* The clamping to [0,1] can be done for free in the fragment
+ * shader with a saturate.
+ */
+ dp->saturate = true;
+ } else if (result_dst.type == GLSL_TYPE_FLOAT) {
+ /* Negating the result of the dot-product gives values on the range
+ * [-4, 0]. Zero stays zero, and negative values become 1.0. This
+ * is achieved using SLT.
+ */
+ st_src_reg slt_src = result_src;
+ slt_src.negate = ~slt_src.negate;
+ emit(ir, TGSI_OPCODE_SLT, result_dst, slt_src, st_src_reg_for_float(0.0));
+ }
+ else {
+ /* Use SNE 0 if integers are being used as boolean values. */
+ emit(ir, TGSI_OPCODE_SNE, result_dst, result_src, st_src_reg_for_int(0));
+ }
break;
+ }
case ir_binop_logic_xor:
emit(ir, TGSI_OPCODE_SNE, result_dst, op[0], op[1]);
break;
- case ir_binop_logic_or:
- /* This could be a saturated add and skip the SNE. */
- emit(ir, TGSI_OPCODE_ADD, result_dst, op[0], op[1]);
- emit(ir, TGSI_OPCODE_SNE, result_dst, result_src, st_src_reg_for_float(0.0));
+ case ir_binop_logic_or: {
+ /* After the addition, the value will be an integer on the
+ * range [0,2]. Zero stays zero, and positive values become 1.0.
+ */
+ glsl_to_tgsi_instruction *add =
+ emit(ir, TGSI_OPCODE_ADD, result_dst, op[0], op[1]);
+ if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB &&
+ result_dst.type == GLSL_TYPE_FLOAT) {
+ /* The clamping to [0,1] can be done for free in the fragment
+ * shader with a saturate if floats are being used as boolean values.
+ */
+ add->saturate = true;
+ } else if (result_dst.type == GLSL_TYPE_FLOAT) {
+ /* Negating the result of the addition gives values on the range
+ * [-2, 0]. Zero stays zero, and negative values become 1.0. This
+ * is achieved using SLT.
+ */
+ st_src_reg slt_src = result_src;
+ slt_src.negate = ~slt_src.negate;
+ emit(ir, TGSI_OPCODE_SLT, result_dst, slt_src, st_src_reg_for_float(0.0));
+ } else {
+ /* Use an SNE on the result of the addition. Zero stays zero,
+ * 1 stays 1, and 2 becomes 1.
+ */
+ emit(ir, TGSI_OPCODE_SNE, result_dst, result_src, st_src_reg_for_int(0));
+ }
break;
+ }
case ir_binop_logic_and:
/* the bool args are stored as float 0.0 or 1.0, so "mul" gives us "and". */
@@ -1514,7 +1663,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
break;
case ir_unop_i2f:
case ir_unop_b2f:
- if (glsl_version >= 130) {
+ if (native_integers) {
emit(ir, TGSI_OPCODE_I2F, result_dst, op[0]);
break;
}
@@ -1526,7 +1675,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
result_src = op[0];
break;
case ir_unop_f2i:
- if (glsl_version >= 130)
+ if (native_integers)
emit(ir, TGSI_OPCODE_F2I, result_dst, op[0]);
else
emit(ir, TGSI_OPCODE_TRUNC, result_dst, op[0]);
@@ -1567,7 +1716,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
break;
}
case ir_unop_u2f:
- if (glsl_version >= 130) {
+ if (native_integers) {
emit(ir, TGSI_OPCODE_U2F, result_dst, op[0]);
break;
}
@@ -1719,7 +1868,7 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir)
}
this->result = st_src_reg(entry->file, entry->index, var->type);
- if (glsl_version <= 120)
+ if (!native_integers)
this->result.type = GLSL_TYPE_FLOAT;
}
@@ -2109,27 +2258,27 @@ glsl_to_tgsi_visitor::visit(ir_constant *ir)
}
break;
case GLSL_TYPE_UINT:
- gl_type = glsl_version >= 130 ? GL_UNSIGNED_INT : GL_FLOAT;
+ gl_type = native_integers ? GL_UNSIGNED_INT : GL_FLOAT;
for (i = 0; i < ir->type->vector_elements; i++) {
- if (glsl_version >= 130)
+ if (native_integers)
values[i].u = ir->value.u[i];
else
values[i].f = ir->value.u[i];
}
break;
case GLSL_TYPE_INT:
- gl_type = glsl_version >= 130 ? GL_INT : GL_FLOAT;
+ gl_type = native_integers ? GL_INT : GL_FLOAT;
for (i = 0; i < ir->type->vector_elements; i++) {
- if (glsl_version >= 130)
+ if (native_integers)
values[i].i = ir->value.i[i];
else
values[i].f = ir->value.i[i];
}
break;
case GLSL_TYPE_BOOL:
- gl_type = glsl_version >= 130 ? GL_BOOL : GL_FLOAT;
+ gl_type = native_integers ? GL_BOOL : GL_FLOAT;
for (i = 0; i < ir->type->vector_elements; i++) {
- if (glsl_version >= 130)
+ if (native_integers)
values[i].b = ir->value.b[i];
else
values[i].f = ir->value.b[i];
@@ -2277,16 +2426,18 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
glsl_to_tgsi_instruction *inst = NULL;
unsigned opcode = TGSI_OPCODE_NOP;
- ir->coordinate->accept(this);
+ if (ir->coordinate) {
+ ir->coordinate->accept(this);
- /* Put our coords in a temp. We'll need to modify them for shadow,
- * projection, or LOD, so the only case we'd use it as is is if
- * we're doing plain old texturing. The optimization passes on
- * glsl_to_tgsi_visitor should handle cleaning up our mess in that case.
- */
- coord = get_temp(glsl_type::vec4_type);
- coord_dst = st_dst_reg(coord);
- emit(ir, TGSI_OPCODE_MOV, coord_dst, this->result);
+ /* Put our coords in a temp. We'll need to modify them for shadow,
+ * projection, or LOD, so the only case we'd use it as is is if
+ * we're doing plain old texturing. The optimization passes on
+ * glsl_to_tgsi_visitor should handle cleaning up our mess in that case.
+ */
+ coord = get_temp(glsl_type::vec4_type);
+ coord_dst = st_dst_reg(coord);
+ emit(ir, TGSI_OPCODE_MOV, coord_dst, this->result);
+ }
if (ir->projector) {
ir->projector->accept(this);
@@ -2320,8 +2471,15 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
ir->lod_info.grad.dPdy->accept(this);
dy = this->result;
break;
- case ir_txf: /* TODO: use TGSI_OPCODE_TXF here */
- assert(!"GLSL 1.30 features unsupported");
+ case ir_txs:
+ opcode = TGSI_OPCODE_TXQ;
+ ir->lod_info.lod->accept(this);
+ lod_info = this->result;
+ break;
+ case ir_txf:
+ opcode = TGSI_OPCODE_TXF;
+ ir->lod_info.lod->accept(this);
+ lod_info = this->result;
break;
}
@@ -2385,7 +2543,8 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
coord_dst.writemask = WRITEMASK_XYZW;
}
- if (opcode == TGSI_OPCODE_TXL || opcode == TGSI_OPCODE_TXB) {
+ 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;
emit(ir, TGSI_OPCODE_MOV, coord_dst, lod_info);
@@ -2394,6 +2553,8 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
if (opcode == TGSI_OPCODE_TXD)
inst = emit(ir, opcode, result_dst, coord, dx, dy);
+ else if (opcode == TGSI_OPCODE_TXQ)
+ inst = emit(ir, opcode, result_dst, lod_info);
else
inst = emit(ir, opcode, result_dst, coord);
@@ -2802,36 +2963,6 @@ set_uniform_initializer(struct gl_context *ctx, void *mem_ctx,
}
}
-static void
-set_uniform_initializers(struct gl_context *ctx,
- struct gl_shader_program *shader_program)
-{
- void *mem_ctx = NULL;
-
- for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
- struct gl_shader *shader = shader_program->_LinkedShaders[i];
-
- if (shader == NULL)
- continue;
-
- foreach_iter(exec_list_iterator, iter, *shader->ir) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- ir_variable *var = ir->as_variable();
-
- if (!var || var->mode != ir_var_uniform || !var->constant_value)
- continue;
-
- if (!mem_ctx)
- mem_ctx = ralloc_context(NULL);
-
- set_uniform_initializer(ctx, mem_ctx, shader_program, var->name,
- var->type, var->constant_value);
- }
- }
-
- ralloc_free(mem_ctx);
-}
-
/*
* Scan/rewrite program to remove reads of custom (output) registers.
* The passed type has to be either PROGRAM_OUTPUT or PROGRAM_VARYING
@@ -3443,7 +3574,7 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void)
/* Continuing the block, clear any channels from the write array that
* are read by this instruction.
*/
- for (int i = 0; i < 4; i++) {
+ for (unsigned i = 0; i < Elements(inst->src); i++) {
if (inst->src[i].file == PROGRAM_TEMPORARY && inst->src[i].reladdr){
/* Any temporary might be read, so no dead code elimination
* across this instruction.
@@ -3611,6 +3742,7 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
v->ctx = original->ctx;
v->prog = prog;
v->glsl_version = original->glsl_version;
+ v->native_integers = original->native_integers;
v->options = original->options;
v->next_temp = original->next_temp;
v->num_address_regs = original->num_address_regs;
@@ -3739,6 +3871,7 @@ get_bitmap_visitor(struct st_fragment_program *fp,
v->ctx = original->ctx;
v->prog = prog;
v->glsl_version = original->glsl_version;
+ v->native_integers = original->native_integers;
v->options = original->options;
v->next_temp = original->next_temp;
v->num_address_regs = original->num_address_regs;
@@ -4085,7 +4218,7 @@ translate_src(struct st_translate *t, const st_src_reg *src_reg)
static void
compile_tgsi_instruction(struct st_translate *t,
- const struct glsl_to_tgsi_instruction *inst)
+ const glsl_to_tgsi_instruction *inst)
{
struct ureg_program *ureg = t->ureg;
GLuint i;
@@ -4124,6 +4257,8 @@ compile_tgsi_instruction(struct st_translate *t,
case TGSI_OPCODE_TXD:
case TGSI_OPCODE_TXL:
case TGSI_OPCODE_TXP:
+ case TGSI_OPCODE_TXQ:
+ case TGSI_OPCODE_TXF:
src[num_src++] = t->samplers[inst->sampler];
ureg_tex_insn(ureg,
inst->op,
@@ -4674,6 +4809,7 @@ get_mesa_program(struct gl_context *ctx,
v->shader_program = shader_program;
v->options = options;
v->glsl_version = ctx->Const.GLSLVersion;
+ v->native_integers = ctx->Const.NativeIntegers;
add_uniforms_to_parameters_list(shader_program, shader, prog);
@@ -4924,53 +5060,4 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
return GL_TRUE;
}
-
-/**
- * Link a GLSL shader program. Called via glLinkProgram().
- */
-void
-st_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
-{
- unsigned int i;
-
- _mesa_clear_shader_program_data(ctx, prog);
-
- prog->LinkStatus = GL_TRUE;
-
- for (i = 0; i < prog->NumShaders; i++) {
- if (!prog->Shaders[i]->CompileStatus) {
- fail_link(prog, "linking with uncompiled shader");
- prog->LinkStatus = GL_FALSE;
- }
- }
-
- prog->Varying = _mesa_new_parameter_list();
- _mesa_reference_vertprog(ctx, &prog->VertexProgram, NULL);
- _mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL);
- _mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL);
-
- if (prog->LinkStatus) {
- link_shaders(ctx, prog);
- }
-
- if (prog->LinkStatus) {
- if (!ctx->Driver.LinkShader(ctx, prog)) {
- prog->LinkStatus = GL_FALSE;
- }
- }
-
- set_uniform_initializers(ctx, prog);
-
- if (ctx->Shader.Flags & GLSL_DUMP) {
- if (!prog->LinkStatus) {
- printf("GLSL shader program %d failed to link\n", prog->Name);
- }
-
- if (prog->InfoLog && prog->InfoLog[0] != 0) {
- printf("GLSL shader program %d info log:\n", prog->Name);
- printf("%s\n", prog->InfoLog);
- }
- }
-}
-
} /* extern "C" */
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h
index d87747178..fafe52e31 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h
@@ -64,7 +64,6 @@ struct gl_shader *st_new_shader(struct gl_context *ctx, GLuint name, GLuint type
struct gl_shader_program *
st_new_shader_program(struct gl_context *ctx, GLuint name);
-void st_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
GLboolean st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
#ifdef __cplusplus
diff --git a/mesalib/src/mesa/state_tracker/st_texture.c b/mesalib/src/mesa/state_tracker/st_texture.c
index 0e857fddc..232c286c1 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_texture.c
@@ -221,8 +221,8 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
DBG("%s \n", __FUNCTION__);
- stImage->transfer = pipe_get_transfer(st->pipe, pt, stImage->level,
- stImage->face + zoffset,
+ stImage->transfer = pipe_get_transfer(st->pipe, pt, stImage->base.Level,
+ stImage->base.Face + zoffset,
usage, x, y, w, h);
if (stImage->transfer)
diff --git a/mesalib/src/mesa/state_tracker/st_texture.h b/mesalib/src/mesa/state_tracker/st_texture.h
index b822f47cf..50b7284e7 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.h
+++ b/mesalib/src/mesa/state_tracker/st_texture.h
@@ -45,11 +45,6 @@ struct st_texture_image
{
struct gl_texture_image base;
- /* These aren't stored in gl_texture_image
- */
- GLuint level;
- GLuint face;
-
/* If stImage->pt != NULL, image data is stored here.
* Else if stImage->base.Data != NULL, image is stored there.
* Else there is no image data.
diff --git a/mesalib/src/mesa/swrast/s_aatritemp.h b/mesalib/src/mesa/swrast/s_aatritemp.h
index 4136df3a7..77b3ae6ec 100644
--- a/mesalib/src/mesa/swrast/s_aatritemp.h
+++ b/mesalib/src/mesa/swrast/s_aatritemp.h
@@ -1,331 +1,343 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.0.3
- *
- * Copyright (C) 1999-2007 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.
- */
-
-
-/*
- * Antialiased Triangle Rasterizer Template
- *
- * This file is #include'd to generate custom AA triangle rasterizers.
- * NOTE: this code hasn't been optimized yet. That'll come after it
- * works correctly.
- *
- * The following macros may be defined to indicate what auxillary information
- * must be copmuted across the triangle:
- * DO_Z - if defined, compute Z values
- * DO_ATTRIBS - if defined, compute texcoords, varying, etc.
- */
-
-/*void triangle( struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
-{
- const SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLfloat *p0 = v0->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat *p1 = v1->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat *p2 = v2->attrib[FRAG_ATTRIB_WPOS];
- const SWvertex *vMin, *vMid, *vMax;
- GLint iyMin, iyMax;
- GLfloat yMin, yMax;
- GLboolean ltor;
- GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */
-
- SWspan span;
-
-#ifdef DO_Z
- GLfloat zPlane[4];
-#endif
- GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
-#if defined(DO_ATTRIBS)
- GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4];
- GLfloat wPlane[4]; /* win[3] */
-#endif
- GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign;
-
- (void) swrast;
-
- INIT_SPAN(span, GL_POLYGON);
- span.arrayMask = SPAN_COVERAGE;
-
- /* determine bottom to top order of vertices */
- {
- GLfloat y0 = v0->attrib[FRAG_ATTRIB_WPOS][1];
- GLfloat y1 = v1->attrib[FRAG_ATTRIB_WPOS][1];
- GLfloat y2 = v2->attrib[FRAG_ATTRIB_WPOS][1];
- if (y0 <= y1) {
- if (y1 <= y2) {
- vMin = v0; vMid = v1; vMax = v2; /* y0<=y1<=y2 */
- }
- else if (y2 <= y0) {
- vMin = v2; vMid = v0; vMax = v1; /* y2<=y0<=y1 */
- }
- else {
- vMin = v0; vMid = v2; vMax = v1; bf = -bf; /* y0<=y2<=y1 */
- }
- }
- else {
- if (y0 <= y2) {
- vMin = v1; vMid = v0; vMax = v2; bf = -bf; /* y1<=y0<=y2 */
- }
- else if (y2 <= y1) {
- vMin = v2; vMid = v1; vMax = v0; bf = -bf; /* y2<=y1<=y0 */
- }
- else {
- vMin = v1; vMid = v2; vMax = v0; /* y1<=y2<=y0 */
- }
- }
- }
-
- majDx = vMax->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0];
- majDy = vMax->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1];
-
- /* front/back-face determination and cullling */
- {
- const GLfloat botDx = vMid->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0];
- const GLfloat botDy = vMid->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1];
- const GLfloat area = majDx * botDy - botDx * majDy;
- /* Do backface culling */
- if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area))
- return;
- ltor = (GLboolean) (area < 0.0F);
-
- span.facing = area * swrast->_BackfaceSign > 0.0F;
- }
-
- /* Plane equation setup:
- * We evaluate plane equations at window (x,y) coordinates in order
- * to compute color, Z, fog, texcoords, etc. This isn't terribly
- * efficient but it's easy and reliable.
- */
-#ifdef DO_Z
- compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane);
- span.arrayMask |= SPAN_Z;
-#endif
- if (ctx->Light.ShadeModel == GL_SMOOTH) {
- compute_plane(p0, p1, p2, v0->color[RCOMP], v1->color[RCOMP], v2->color[RCOMP], rPlane);
- compute_plane(p0, p1, p2, v0->color[GCOMP], v1->color[GCOMP], v2->color[GCOMP], gPlane);
- compute_plane(p0, p1, p2, v0->color[BCOMP], v1->color[BCOMP], v2->color[BCOMP], bPlane);
- compute_plane(p0, p1, p2, v0->color[ACOMP], v1->color[ACOMP], v2->color[ACOMP], aPlane);
- }
- else {
- constant_plane(v2->color[RCOMP], rPlane);
- constant_plane(v2->color[GCOMP], gPlane);
- constant_plane(v2->color[BCOMP], bPlane);
- constant_plane(v2->color[ACOMP], aPlane);
- }
- span.arrayMask |= SPAN_RGBA;
-#if defined(DO_ATTRIBS)
- {
- const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3];
- const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3];
- const GLfloat invW2 = v2->attrib[FRAG_ATTRIB_WPOS][3];
- compute_plane(p0, p1, p2, invW0, invW1, invW2, wPlane);
- span.attrStepX[FRAG_ATTRIB_WPOS][3] = plane_dx(wPlane);
- span.attrStepY[FRAG_ATTRIB_WPOS][3] = plane_dy(wPlane);
- ATTRIB_LOOP_BEGIN
- GLuint c;
- if (swrast->_InterpMode[attr] == GL_FLAT) {
- for (c = 0; c < 4; c++) {
- constant_plane(v2->attrib[attr][c] * invW2, attrPlane[attr][c]);
- }
- }
- else {
- for (c = 0; c < 4; c++) {
- const GLfloat a0 = v0->attrib[attr][c] * invW0;
- const GLfloat a1 = v1->attrib[attr][c] * invW1;
- const GLfloat a2 = v2->attrib[attr][c] * invW2;
- compute_plane(p0, p1, p2, a0, a1, a2, attrPlane[attr][c]);
- }
- }
- for (c = 0; c < 4; c++) {
- span.attrStepX[attr][c] = plane_dx(attrPlane[attr][c]);
- span.attrStepY[attr][c] = plane_dy(attrPlane[attr][c]);
- }
- ATTRIB_LOOP_END
- }
-#endif
-
- /* Begin bottom-to-top scan over the triangle.
- * The long edge will either be on the left or right side of the
- * triangle. We always scan from the long edge toward the shorter
- * edges, stopping when we find that coverage = 0. If the long edge
- * is on the left we scan left-to-right. Else, we scan right-to-left.
- */
- yMin = vMin->attrib[FRAG_ATTRIB_WPOS][1];
- yMax = vMax->attrib[FRAG_ATTRIB_WPOS][1];
- iyMin = (GLint) yMin;
- iyMax = (GLint) yMax + 1;
-
- if (ltor) {
- /* scan left to right */
- const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat dxdy = majDx / majDy;
- const GLfloat xAdj = dxdy < 0.0F ? -dxdy : 0.0F;
- GLfloat x = pMin[0] - (yMin - iyMin) * dxdy;
- GLint iy;
- for (iy = iyMin; iy < iyMax; iy++, x += dxdy) {
- GLint ix, startX = (GLint) (x - xAdj);
- GLuint count;
- GLfloat coverage = 0.0F;
-
- /* skip over fragments with zero coverage */
- while (startX < MAX_WIDTH) {
- coverage = compute_coveragef(pMin, pMid, pMax, startX, iy);
- if (coverage > 0.0F)
- break;
- startX++;
- }
-
- /* enter interior of triangle */
- ix = startX;
-
-#if defined(DO_ATTRIBS)
- /* compute attributes at left-most fragment */
- span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5F, iy + 0.5F, wPlane);
- ATTRIB_LOOP_BEGIN
- GLuint c;
- for (c = 0; c < 4; c++) {
- span.attrStart[attr][c] = solve_plane(ix + 0.5F, iy + 0.5F, attrPlane[attr][c]);
- }
- ATTRIB_LOOP_END
-#endif
-
- count = 0;
- while (coverage > 0.0F) {
- /* (cx,cy) = center of fragment */
- const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
- SWspanarrays *array = span.array;
- array->coverage[count] = coverage;
-#ifdef DO_Z
- array->z[count] = (GLuint) solve_plane(cx, cy, zPlane);
-#endif
- array->rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane);
- array->rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane);
- array->rgba[count][BCOMP] = solve_plane_chan(cx, cy, bPlane);
- array->rgba[count][ACOMP] = solve_plane_chan(cx, cy, aPlane);
- ix++;
- count++;
- coverage = compute_coveragef(pMin, pMid, pMax, ix, iy);
- }
-
- if (ix <= startX)
- continue;
-
- span.x = startX;
- span.y = iy;
- span.end = (GLuint) ix - (GLuint) startX;
- _swrast_write_rgba_span(ctx, &span);
- }
- }
- else {
- /* scan right to left */
- const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS];
- const GLfloat dxdy = majDx / majDy;
- const GLfloat xAdj = dxdy > 0 ? dxdy : 0.0F;
- GLfloat x = pMin[0] - (yMin - iyMin) * dxdy;
- GLint iy;
- for (iy = iyMin; iy < iyMax; iy++, x += dxdy) {
- GLint ix, left, startX = (GLint) (x + xAdj);
- GLuint count, n;
- GLfloat coverage = 0.0F;
-
- /* make sure we're not past the window edge */
- if (startX >= ctx->DrawBuffer->_Xmax) {
- startX = ctx->DrawBuffer->_Xmax - 1;
- }
-
- /* skip fragments with zero coverage */
- while (startX > 0) {
- coverage = compute_coveragef(pMin, pMax, pMid, startX, iy);
- if (coverage > 0.0F)
- break;
- startX--;
- }
-
- /* enter interior of triangle */
- ix = startX;
- count = 0;
- while (coverage > 0.0F) {
- /* (cx,cy) = center of fragment */
- const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
- SWspanarrays *array = span.array;
- ASSERT(ix >= 0);
- array->coverage[ix] = coverage;
-#ifdef DO_Z
- array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane);
-#endif
- array->rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane);
- array->rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane);
- array->rgba[ix][BCOMP] = solve_plane_chan(cx, cy, bPlane);
- array->rgba[ix][ACOMP] = solve_plane_chan(cx, cy, aPlane);
- ix--;
- count++;
- coverage = compute_coveragef(pMin, pMax, pMid, ix, iy);
- }
-
-#if defined(DO_ATTRIBS)
- /* compute attributes at left-most fragment */
- span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5F, iy + 0.5F, wPlane);
- ATTRIB_LOOP_BEGIN
- GLuint c;
- for (c = 0; c < 4; c++) {
- span.attrStart[attr][c] = solve_plane(ix + 1.5F, iy + 0.5F, attrPlane[attr][c]);
- }
- ATTRIB_LOOP_END
-#endif
-
- if (startX <= ix)
- continue;
-
- n = (GLuint) startX - (GLuint) ix;
-
- left = ix + 1;
-
- /* shift all values to the left */
- /* XXX this is temporary */
- {
- SWspanarrays *array = span.array;
- GLint j;
- for (j = 0; j < (GLint) n; j++) {
- array->coverage[j] = array->coverage[j + left];
- COPY_CHAN4(array->rgba[j], array->rgba[j + left]);
-#ifdef DO_Z
- array->z[j] = array->z[j + left];
-#endif
- }
- }
-
- span.x = left;
- span.y = iy;
- span.end = n;
- _swrast_write_rgba_span(ctx, &span);
- }
- }
-}
-
-
-#undef DO_Z
-#undef DO_ATTRIBS
-#undef DO_OCCLUSION_TEST
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.0.3
+ *
+ * Copyright (C) 1999-2007 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.
+ */
+
+
+/*
+ * Antialiased Triangle Rasterizer Template
+ *
+ * This file is #include'd to generate custom AA triangle rasterizers.
+ * NOTE: this code hasn't been optimized yet. That'll come after it
+ * works correctly.
+ *
+ * The following macros may be defined to indicate what auxillary information
+ * must be copmuted across the triangle:
+ * DO_Z - if defined, compute Z values
+ * DO_ATTRIBS - if defined, compute texcoords, varying, etc.
+ */
+
+/*void triangle( struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
+{
+ const SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLfloat *p0 = v0->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat *p1 = v1->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat *p2 = v2->attrib[FRAG_ATTRIB_WPOS];
+ const SWvertex *vMin, *vMid, *vMax;
+ GLint iyMin, iyMax;
+ GLfloat yMin, yMax;
+ GLboolean ltor;
+ GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */
+
+ SWspan span;
+
+#ifdef DO_Z
+ GLfloat zPlane[4];
+#endif
+ GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
+#if defined(DO_ATTRIBS)
+ GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4];
+ GLfloat wPlane[4]; /* win[3] */
+#endif
+ GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign;
+
+ (void) swrast;
+
+ INIT_SPAN(span, GL_POLYGON);
+ span.arrayMask = SPAN_COVERAGE;
+
+ /* determine bottom to top order of vertices */
+ {
+ GLfloat y0 = v0->attrib[FRAG_ATTRIB_WPOS][1];
+ GLfloat y1 = v1->attrib[FRAG_ATTRIB_WPOS][1];
+ GLfloat y2 = v2->attrib[FRAG_ATTRIB_WPOS][1];
+ if (y0 <= y1) {
+ if (y1 <= y2) {
+ vMin = v0; vMid = v1; vMax = v2; /* y0<=y1<=y2 */
+ }
+ else if (y2 <= y0) {
+ vMin = v2; vMid = v0; vMax = v1; /* y2<=y0<=y1 */
+ }
+ else {
+ vMin = v0; vMid = v2; vMax = v1; bf = -bf; /* y0<=y2<=y1 */
+ }
+ }
+ else {
+ if (y0 <= y2) {
+ vMin = v1; vMid = v0; vMax = v2; bf = -bf; /* y1<=y0<=y2 */
+ }
+ else if (y2 <= y1) {
+ vMin = v2; vMid = v1; vMax = v0; bf = -bf; /* y2<=y1<=y0 */
+ }
+ else {
+ vMin = v1; vMid = v2; vMax = v0; /* y1<=y2<=y0 */
+ }
+ }
+ }
+
+ majDx = vMax->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0];
+ majDy = vMax->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1];
+
+ /* front/back-face determination and cullling */
+ {
+ const GLfloat botDx = vMid->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0];
+ const GLfloat botDy = vMid->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1];
+ const GLfloat area = majDx * botDy - botDx * majDy;
+ /* Do backface culling */
+ if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area))
+ return;
+ ltor = (GLboolean) (area < 0.0F);
+
+ span.facing = area * swrast->_BackfaceSign > 0.0F;
+ }
+
+ /* Plane equation setup:
+ * We evaluate plane equations at window (x,y) coordinates in order
+ * to compute color, Z, fog, texcoords, etc. This isn't terribly
+ * efficient but it's easy and reliable.
+ */
+#ifdef DO_Z
+ compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane);
+ span.arrayMask |= SPAN_Z;
+#endif
+ if (ctx->Light.ShadeModel == GL_SMOOTH) {
+ compute_plane(p0, p1, p2, v0->color[RCOMP], v1->color[RCOMP], v2->color[RCOMP], rPlane);
+ compute_plane(p0, p1, p2, v0->color[GCOMP], v1->color[GCOMP], v2->color[GCOMP], gPlane);
+ compute_plane(p0, p1, p2, v0->color[BCOMP], v1->color[BCOMP], v2->color[BCOMP], bPlane);
+ compute_plane(p0, p1, p2, v0->color[ACOMP], v1->color[ACOMP], v2->color[ACOMP], aPlane);
+ }
+ else {
+ constant_plane(v2->color[RCOMP], rPlane);
+ constant_plane(v2->color[GCOMP], gPlane);
+ constant_plane(v2->color[BCOMP], bPlane);
+ constant_plane(v2->color[ACOMP], aPlane);
+ }
+ span.arrayMask |= SPAN_RGBA;
+#if defined(DO_ATTRIBS)
+ {
+ const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3];
+ const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3];
+ const GLfloat invW2 = v2->attrib[FRAG_ATTRIB_WPOS][3];
+ compute_plane(p0, p1, p2, invW0, invW1, invW2, wPlane);
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = plane_dx(wPlane);
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = plane_dy(wPlane);
+ ATTRIB_LOOP_BEGIN
+ GLuint c;
+ if (swrast->_InterpMode[attr] == GL_FLAT) {
+ for (c = 0; c < 4; c++) {
+ constant_plane(v2->attrib[attr][c] * invW2, attrPlane[attr][c]);
+ }
+ }
+ else {
+ for (c = 0; c < 4; c++) {
+ const GLfloat a0 = v0->attrib[attr][c] * invW0;
+ const GLfloat a1 = v1->attrib[attr][c] * invW1;
+ const GLfloat a2 = v2->attrib[attr][c] * invW2;
+ compute_plane(p0, p1, p2, a0, a1, a2, attrPlane[attr][c]);
+ }
+ }
+ for (c = 0; c < 4; c++) {
+ span.attrStepX[attr][c] = plane_dx(attrPlane[attr][c]);
+ span.attrStepY[attr][c] = plane_dy(attrPlane[attr][c]);
+ }
+ ATTRIB_LOOP_END
+ }
+#endif
+
+ /* Begin bottom-to-top scan over the triangle.
+ * The long edge will either be on the left or right side of the
+ * triangle. We always scan from the long edge toward the shorter
+ * edges, stopping when we find that coverage = 0. If the long edge
+ * is on the left we scan left-to-right. Else, we scan right-to-left.
+ */
+ yMin = vMin->attrib[FRAG_ATTRIB_WPOS][1];
+ yMax = vMax->attrib[FRAG_ATTRIB_WPOS][1];
+ iyMin = (GLint) yMin;
+ iyMax = (GLint) yMax + 1;
+
+ if (ltor) {
+ /* scan left to right */
+ const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat dxdy = majDx / majDy;
+ const GLfloat xAdj = dxdy < 0.0F ? -dxdy : 0.0F;
+ GLint iy;
+#ifdef _OPENMP
+#pragma omp parallel for schedule(dynamic) private(iy) firstprivate(span)
+#endif
+ for (iy = iyMin; iy < iyMax; iy++) {
+ GLfloat x = pMin[0] - (yMin - iy) * dxdy;
+ GLint ix, startX = (GLint) (x - xAdj);
+ GLuint count;
+ GLfloat coverage = 0.0F;
+
+#ifdef _OPENMP
+ /* each thread needs to use a different (global) SpanArrays variable */
+ span.array = SWRAST_CONTEXT(ctx)->SpanArrays + omp_get_thread_num();
+#endif
+ /* skip over fragments with zero coverage */
+ while (startX < MAX_WIDTH) {
+ coverage = compute_coveragef(pMin, pMid, pMax, startX, iy);
+ if (coverage > 0.0F)
+ break;
+ startX++;
+ }
+
+ /* enter interior of triangle */
+ ix = startX;
+
+#if defined(DO_ATTRIBS)
+ /* compute attributes at left-most fragment */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5F, iy + 0.5F, wPlane);
+ ATTRIB_LOOP_BEGIN
+ GLuint c;
+ for (c = 0; c < 4; c++) {
+ span.attrStart[attr][c] = solve_plane(ix + 0.5F, iy + 0.5F, attrPlane[attr][c]);
+ }
+ ATTRIB_LOOP_END
+#endif
+
+ count = 0;
+ while (coverage > 0.0F) {
+ /* (cx,cy) = center of fragment */
+ const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
+ SWspanarrays *array = span.array;
+ array->coverage[count] = coverage;
+#ifdef DO_Z
+ array->z[count] = (GLuint) solve_plane(cx, cy, zPlane);
+#endif
+ array->rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane);
+ array->rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane);
+ array->rgba[count][BCOMP] = solve_plane_chan(cx, cy, bPlane);
+ array->rgba[count][ACOMP] = solve_plane_chan(cx, cy, aPlane);
+ ix++;
+ count++;
+ coverage = compute_coveragef(pMin, pMid, pMax, ix, iy);
+ }
+
+ if (ix > startX) {
+ span.x = startX;
+ span.y = iy;
+ span.end = (GLuint) ix - (GLuint) startX;
+ _swrast_write_rgba_span(ctx, &span);
+ }
+ }
+ }
+ else {
+ /* scan right to left */
+ const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS];
+ const GLfloat dxdy = majDx / majDy;
+ const GLfloat xAdj = dxdy > 0 ? dxdy : 0.0F;
+ GLint iy;
+#ifdef _OPENMP
+#pragma omp parallel for schedule(dynamic) private(iy) firstprivate(span)
+#endif
+ for (iy = iyMin; iy < iyMax; iy++) {
+ GLfloat x = pMin[0] - (yMin - iy) * dxdy;
+ GLint ix, left, startX = (GLint) (x + xAdj);
+ GLuint count, n;
+ GLfloat coverage = 0.0F;
+
+#ifdef _OPENMP
+ /* each thread needs to use a different (global) SpanArrays variable */
+ span.array = SWRAST_CONTEXT(ctx)->SpanArrays + omp_get_thread_num();
+#endif
+ /* make sure we're not past the window edge */
+ if (startX >= ctx->DrawBuffer->_Xmax) {
+ startX = ctx->DrawBuffer->_Xmax - 1;
+ }
+
+ /* skip fragments with zero coverage */
+ while (startX > 0) {
+ coverage = compute_coveragef(pMin, pMax, pMid, startX, iy);
+ if (coverage > 0.0F)
+ break;
+ startX--;
+ }
+
+ /* enter interior of triangle */
+ ix = startX;
+ count = 0;
+ while (coverage > 0.0F) {
+ /* (cx,cy) = center of fragment */
+ const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
+ SWspanarrays *array = span.array;
+ ASSERT(ix >= 0);
+ array->coverage[ix] = coverage;
+#ifdef DO_Z
+ array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane);
+#endif
+ array->rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane);
+ array->rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane);
+ array->rgba[ix][BCOMP] = solve_plane_chan(cx, cy, bPlane);
+ array->rgba[ix][ACOMP] = solve_plane_chan(cx, cy, aPlane);
+ ix--;
+ count++;
+ coverage = compute_coveragef(pMin, pMax, pMid, ix, iy);
+ }
+
+#if defined(DO_ATTRIBS)
+ /* compute attributes at left-most fragment */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5F, iy + 0.5F, wPlane);
+ ATTRIB_LOOP_BEGIN
+ GLuint c;
+ for (c = 0; c < 4; c++) {
+ span.attrStart[attr][c] = solve_plane(ix + 1.5F, iy + 0.5F, attrPlane[attr][c]);
+ }
+ ATTRIB_LOOP_END
+#endif
+
+ if (startX > ix) {
+ n = (GLuint) startX - (GLuint) ix;
+
+ left = ix + 1;
+
+ /* shift all values to the left */
+ /* XXX this is temporary */
+ {
+ SWspanarrays *array = span.array;
+ GLint j;
+ for (j = 0; j < (GLint) n; j++) {
+ array->coverage[j] = array->coverage[j + left];
+ COPY_CHAN4(array->rgba[j], array->rgba[j + left]);
+#ifdef DO_Z
+ array->z[j] = array->z[j + left];
+#endif
+ }
+ }
+
+ span.x = left;
+ span.y = iy;
+ span.end = n;
+ _swrast_write_rgba_span(ctx, &span);
+ }
+ }
+ }
+}
+
+
+#undef DO_Z
+#undef DO_ATTRIBS
+#undef DO_OCCLUSION_TEST
diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c
index def1531d7..792b528ee 100644
--- a/mesalib/src/mesa/swrast/s_context.c
+++ b/mesalib/src/mesa/swrast/s_context.c
@@ -417,84 +417,6 @@ _swrast_validate_blend_func(struct gl_context *ctx, GLuint n, const GLubyte mask
swrast->BlendFunc( ctx, n, mask, src, dst, chanType );
}
-
-/**
- * Make sure we have texture image data for all the textures we may need
- * for subsequent rendering.
- */
-static void
-_swrast_validate_texture_images(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint u;
-
- if (!swrast->ValidateTextureImage || !ctx->Texture._EnabledUnits) {
- /* no textures enabled, or no way to validate images! */
- return;
- }
-
- for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current;
- ASSERT(texObj);
- if (texObj) {
- GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- GLuint face;
- for (face = 0; face < numFaces; face++) {
- GLint lvl;
- for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
- struct gl_texture_image *texImg = texObj->Image[face][lvl];
- if (texImg && !texImg->Data) {
- swrast->ValidateTextureImage(ctx, texObj, face, lvl);
- ASSERT(texObj->Image[face][lvl]->Data);
- }
- }
- }
- }
- }
- }
-}
-
-
-/**
- * Free the texture image data attached to all currently enabled
- * textures. Meant to be called by device drivers when transitioning
- * from software to hardware rendering.
- */
-void
-_swrast_eject_texture_images(struct gl_context *ctx)
-{
- GLuint u;
-
- if (!ctx->Texture._EnabledUnits) {
- /* no textures enabled */
- return;
- }
-
- for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current;
- ASSERT(texObj);
- if (texObj) {
- GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- GLuint face;
- for (face = 0; face < numFaces; face++) {
- GLint lvl;
- for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
- struct gl_texture_image *texImg = texObj->Image[face][lvl];
- if (texImg && texImg->Data) {
- _mesa_free_texmemory(texImg->Data);
- texImg->Data = NULL;
- }
- }
- }
- }
- }
- }
-}
-
-
-
static void
_swrast_sleep( struct gl_context *ctx, GLbitfield new_state )
{
@@ -640,7 +562,6 @@ _swrast_validate_derived( struct gl_context *ctx )
if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) {
_swrast_update_texture_samplers( ctx );
- _swrast_validate_texture_images(ctx);
}
if (swrast->NewState & (_NEW_COLOR | _NEW_PROGRAM))
@@ -772,6 +693,11 @@ _swrast_CreateContext( struct gl_context *ctx )
{
GLuint i;
SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
+#ifdef _OPENMP
+ const GLint maxThreads = omp_get_max_threads();
+#else
+ const GLint maxThreads = 1;
+#endif
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_CreateContext\n");
@@ -806,19 +732,25 @@ _swrast_CreateContext( struct gl_context *ctx )
for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
swrast->TextureSample[i] = NULL;
- swrast->SpanArrays = MALLOC_STRUCT(sw_span_arrays);
+ /* SpanArrays is global and shared by all SWspan instances. However, when
+ * using multiple threads, it is necessary to have one SpanArrays instance
+ * per thread.
+ */
+ swrast->SpanArrays = (SWspanarrays *) MALLOC(maxThreads * sizeof(SWspanarrays));
if (!swrast->SpanArrays) {
FREE(swrast);
return GL_FALSE;
}
- swrast->SpanArrays->ChanType = CHAN_TYPE;
+ for(i = 0; i < maxThreads; i++) {
+ swrast->SpanArrays[i].ChanType = CHAN_TYPE;
#if CHAN_TYPE == GL_UNSIGNED_BYTE
- swrast->SpanArrays->rgba = swrast->SpanArrays->rgba8;
+ swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba8;
#elif CHAN_TYPE == GL_UNSIGNED_SHORT
- swrast->SpanArrays->rgba = swrast->SpanArrays->rgba16;
+ swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba16;
#else
- swrast->SpanArrays->rgba = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
+ swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].attribs[FRAG_ATTRIB_COL0];
#endif
+ }
/* init point span buffer */
swrast->PointSpan.primitive = GL_POINT;
@@ -826,7 +758,10 @@ _swrast_CreateContext( struct gl_context *ctx )
swrast->PointSpan.facing = 0;
swrast->PointSpan.array = swrast->SpanArrays;
- swrast->TexelBuffer = (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits *
+ /* TexelBuffer is also global and normally shared by all SWspan instances;
+ * when running with multiple threads, create one per thread.
+ */
+ swrast->TexelBuffer = (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits * maxThreads *
MAX_WIDTH * 4 * sizeof(GLfloat));
if (!swrast->TexelBuffer) {
FREE(swrast->SpanArrays);
diff --git a/mesalib/src/mesa/swrast/s_stencil.c b/mesalib/src/mesa/swrast/s_stencil.c
index 999fe3c3f..fa5093a34 100644
--- a/mesalib/src/mesa/swrast/s_stencil.c
+++ b/mesalib/src/mesa/swrast/s_stencil.c
@@ -1,1245 +1,1246 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 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.
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/imports.h"
-
-#include "s_context.h"
-#include "s_depth.h"
-#include "s_stencil.h"
-#include "s_span.h"
-
-
-
-/* Stencil Logic:
-
-IF stencil test fails THEN
- Apply fail-op to stencil value
- Don't write the pixel (RGBA,Z)
-ELSE
- IF doing depth test && depth test fails THEN
- Apply zfail-op to stencil value
- Write RGBA and Z to appropriate buffers
- ELSE
- Apply zpass-op to stencil value
-ENDIF
-
-*/
-
-
-/**
- * Apply the given stencil operator to the array of stencil values.
- * Don't touch stencil[i] if mask[i] is zero.
- * Input: n - size of stencil array
- * oper - the stencil buffer operator
- * face - 0 or 1 for front or back face operation
- * stencil - array of stencil values
- * mask - array [n] of flag: 1=apply operator, 0=don't apply operator
- * Output: stencil - modified values
- */
-static void
-apply_stencil_op( const struct gl_context *ctx, GLenum oper, GLuint face,
- GLuint n, GLstencil stencil[], const GLubyte mask[] )
-{
- const GLstencil ref = ctx->Stencil.Ref[face];
- const GLstencil wrtmask = ctx->Stencil.WriteMask[face];
- const GLstencil invmask = (GLstencil) (~wrtmask);
- const GLstencil stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
- GLuint i;
-
- switch (oper) {
- case GL_KEEP:
- /* do nothing */
- break;
- case GL_ZERO:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- stencil[i] = 0;
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- stencil[i] = (GLstencil) (stencil[i] & invmask);
- }
- }
- }
- break;
- case GL_REPLACE:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- stencil[i] = ref;
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil s = stencil[i];
- stencil[i] = (GLstencil) ((invmask & s ) | (wrtmask & ref));
- }
- }
- }
- break;
- case GL_INCR:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil s = stencil[i];
- if (s < stencilMax) {
- stencil[i] = (GLstencil) (s+1);
- }
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- /* VERIFY logic of adding 1 to a write-masked value */
- GLstencil s = stencil[i];
- if (s < stencilMax) {
- stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s+1)));
- }
- }
- }
- }
- break;
- case GL_DECR:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil s = stencil[i];
- if (s>0) {
- stencil[i] = (GLstencil) (s-1);
- }
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- /* VERIFY logic of subtracting 1 to a write-masked value */
- GLstencil s = stencil[i];
- if (s>0) {
- stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s-1)));
- }
- }
- }
- }
- break;
- case GL_INCR_WRAP_EXT:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- stencil[i]++;
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil s = stencil[i];
- stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s+1)));
- }
- }
- }
- break;
- case GL_DECR_WRAP_EXT:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- stencil[i]--;
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil s = stencil[i];
- stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s-1)));
- }
- }
- }
- break;
- case GL_INVERT:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil s = stencil[i];
- stencil[i] = (GLstencil) ~s;
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil s = stencil[i];
- stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & ~s));
- }
- }
- }
- break;
- default:
- _mesa_problem(ctx, "Bad stencil op in apply_stencil_op");
- }
-}
-
-
-
-
-/**
- * Apply stencil test to an array of stencil values (before depth buffering).
- * Input: face - 0 or 1 for front or back-face polygons
- * n - number of pixels in the array
- * stencil - array of [n] stencil values
- * mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
- * Output: mask - pixels which fail the stencil test will have their
- * mask flag set to 0.
- * stencil - updated stencil values (where the test passed)
- * Return: GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
- */
-static GLboolean
-do_stencil_test( struct gl_context *ctx, GLuint face, GLuint n, GLstencil stencil[],
- GLubyte mask[] )
-{
- GLubyte fail[MAX_WIDTH];
- GLboolean allfail = GL_FALSE;
- GLuint i;
- const GLuint valueMask = ctx->Stencil.ValueMask[face];
- const GLstencil r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
- GLstencil s;
-
- ASSERT(n <= MAX_WIDTH);
-
- /*
- * Perform stencil test. The results of this operation are stored
- * in the fail[] array:
- * IF fail[i] is non-zero THEN
- * the stencil fail operator is to be applied
- * ELSE
- * the stencil fail operator is not to be applied
- * ENDIF
- */
- switch (ctx->Stencil.Function[face]) {
- case GL_NEVER:
- /* never pass; always fail */
- for (i=0;i<n;i++) {
- if (mask[i]) {
- mask[i] = 0;
- fail[i] = 1;
- }
- else {
- fail[i] = 0;
- }
- }
- allfail = GL_TRUE;
- break;
- case GL_LESS:
- for (i=0;i<n;i++) {
- if (mask[i]) {
- s = (GLstencil) (stencil[i] & valueMask);
- if (r < s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_LEQUAL:
- for (i=0;i<n;i++) {
- if (mask[i]) {
- s = (GLstencil) (stencil[i] & valueMask);
- if (r <= s) {
- /* pass */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_GREATER:
- for (i=0;i<n;i++) {
- if (mask[i]) {
- s = (GLstencil) (stencil[i] & valueMask);
- if (r > s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_GEQUAL:
- for (i=0;i<n;i++) {
- if (mask[i]) {
- s = (GLstencil) (stencil[i] & valueMask);
- if (r >= s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_EQUAL:
- for (i=0;i<n;i++) {
- if (mask[i]) {
- s = (GLstencil) (stencil[i] & valueMask);
- if (r == s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_NOTEQUAL:
- for (i=0;i<n;i++) {
- if (mask[i]) {
- s = (GLstencil) (stencil[i] & valueMask);
- if (r != s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_ALWAYS:
- /* always pass */
- for (i=0;i<n;i++) {
- fail[i] = 0;
- }
- break;
- default:
- _mesa_problem(ctx, "Bad stencil func in gl_stencil_span");
- return 0;
- }
-
- if (ctx->Stencil.FailFunc[face] != GL_KEEP) {
- apply_stencil_op( ctx, ctx->Stencil.FailFunc[face], face, n, stencil, fail );
- }
-
- return !allfail;
-}
-
-
-/**
- * Compute the zpass/zfail masks by comparing the pre- and post-depth test
- * masks.
- */
-static INLINE void
-compute_pass_fail_masks(GLuint n, const GLubyte origMask[],
- const GLubyte newMask[],
- GLubyte passMask[], GLubyte failMask[])
-{
- GLuint i;
- for (i = 0; i < n; i++) {
- ASSERT(newMask[i] == 0 || newMask[i] == 1);
- passMask[i] = origMask[i] & newMask[i];
- failMask[i] = origMask[i] & (newMask[i] ^ 1);
- }
-}
-
-
-/**
- * Apply stencil and depth testing to the span of pixels.
- * Both software and hardware stencil buffers are acceptable.
- * Input: n - number of pixels in the span
- * x, y - location of leftmost pixel in span
- * z - array [n] of z values
- * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
- * Output: mask - array [n] of flags (1=stencil and depth test passed)
- * Return: GL_FALSE - all fragments failed the testing
- * GL_TRUE - one or more fragments passed the testing
- *
- */
-static GLboolean
-stencil_and_ztest_span(struct gl_context *ctx, SWspan *span, GLuint face)
-{
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->_StencilBuffer;
- GLstencil stencilRow[MAX_WIDTH];
- GLstencil *stencil;
- const GLuint n = span->end;
- const GLint x = span->x;
- const GLint y = span->y;
- GLubyte *mask = span->array->mask;
-
- ASSERT((span->arrayMask & SPAN_XY) == 0);
- ASSERT(ctx->Stencil.Enabled);
- ASSERT(n <= MAX_WIDTH);
-#ifdef DEBUG
- if (ctx->Depth.Test) {
- ASSERT(span->arrayMask & SPAN_Z);
- }
-#endif
-
- stencil = (GLstencil *) rb->GetPointer(ctx, rb, x, y);
- if (!stencil) {
- rb->GetRow(ctx, rb, n, x, y, stencilRow);
- stencil = stencilRow;
- }
-
- /*
- * Apply the stencil test to the fragments.
- * failMask[i] is 1 if the stencil test failed.
- */
- if (do_stencil_test( ctx, face, n, stencil, mask ) == GL_FALSE) {
- /* all fragments failed the stencil test, we're done. */
- span->writeAll = GL_FALSE;
- if (!rb->GetPointer(ctx, rb, 0, 0)) {
- /* put updated stencil values into buffer */
- rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
- }
- return GL_FALSE;
- }
-
- /*
- * Some fragments passed the stencil test, apply depth test to them
- * and apply Zpass and Zfail stencil ops.
- */
- if (ctx->Depth.Test == GL_FALSE) {
- /*
- * No depth buffer, just apply zpass stencil function to active pixels.
- */
- apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face, n, stencil, mask );
- }
- else {
- /*
- * Perform depth buffering, then apply zpass or zfail stencil function.
- */
- GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH];
-
- /* save the current mask bits */
- memcpy(origMask, mask, n * sizeof(GLubyte));
-
- /* apply the depth test */
- _swrast_depth_test_span(ctx, span);
-
- compute_pass_fail_masks(n, origMask, mask, passMask, failMask);
-
- /* apply the pass and fail operations */
- if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
- apply_stencil_op( ctx, ctx->Stencil.ZFailFunc[face], face,
- n, stencil, failMask );
- }
- if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
- apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face,
- n, stencil, passMask );
- }
- }
-
- /*
- * Write updated stencil values back into hardware stencil buffer.
- */
- if (!rb->GetPointer(ctx, rb, 0, 0)) {
- rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
- }
-
- span->writeAll = GL_FALSE;
-
- return GL_TRUE; /* one or more fragments passed both tests */
-}
-
-
-
-/*
- * Return the address of a stencil buffer value given the window coords:
- */
-#define STENCIL_ADDRESS(X, Y) (stencilStart + (Y) * stride + (X))
-
-
-
-/**
- * Apply the given stencil operator for each pixel in the array whose
- * mask flag is set.
- * \note This is for software stencil buffers only.
- * Input: n - number of pixels in the span
- * x, y - array of [n] pixels
- * operator - the stencil buffer operator
- * mask - array [n] of flag: 1=apply operator, 0=don't apply operator
- */
-static void
-apply_stencil_op_to_pixels( struct gl_context *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLenum oper, GLuint face, const GLubyte mask[] )
-{
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->_StencilBuffer;
- const GLstencil stencilMax = (1 << fb->Visual.stencilBits) - 1;
- const GLstencil ref = ctx->Stencil.Ref[face];
- const GLstencil wrtmask = ctx->Stencil.WriteMask[face];
- const GLstencil invmask = (GLstencil) (~wrtmask);
- GLuint i;
- GLstencil *stencilStart = (GLubyte *) rb->Data;
- const GLuint stride = rb->Width;
-
- ASSERT(rb->GetPointer(ctx, rb, 0, 0));
- ASSERT(sizeof(GLstencil) == 1);
-
- switch (oper) {
- case GL_KEEP:
- /* do nothing */
- break;
- case GL_ZERO:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = 0;
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) (invmask & *sptr);
- }
- }
- }
- break;
- case GL_REPLACE:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = ref;
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) ((invmask & *sptr ) | (wrtmask & ref));
- }
- }
- }
- break;
- case GL_INCR:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- if (*sptr < stencilMax) {
- *sptr = (GLstencil) (*sptr + 1);
- }
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- if (*sptr < stencilMax) {
- *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr+1)));
- }
- }
- }
- }
- break;
- case GL_DECR:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- if (*sptr>0) {
- *sptr = (GLstencil) (*sptr - 1);
- }
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- if (*sptr>0) {
- *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr-1)));
- }
- }
- }
- }
- break;
- case GL_INCR_WRAP_EXT:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) (*sptr + 1);
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr+1)));
- }
- }
- }
- break;
- case GL_DECR_WRAP_EXT:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) (*sptr - 1);
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr-1)));
- }
- }
- }
- break;
- case GL_INVERT:
- if (invmask==0) {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) (~*sptr);
- }
- }
- }
- else {
- for (i=0;i<n;i++) {
- if (mask[i]) {
- GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
- *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & ~*sptr));
- }
- }
- }
- break;
- default:
- _mesa_problem(ctx, "Bad stencilop in apply_stencil_op_to_pixels");
- }
-}
-
-
-
-/**
- * Apply stencil test to an array of pixels before depth buffering.
- *
- * \note Used for software stencil buffer only.
- * Input: n - number of pixels in the span
- * x, y - array of [n] pixels to stencil
- * mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
- * Output: mask - pixels which fail the stencil test will have their
- * mask flag set to 0.
- * \return GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
- */
-static GLboolean
-stencil_test_pixels( struct gl_context *ctx, GLuint face, GLuint n,
- const GLint x[], const GLint y[], GLubyte mask[] )
-{
- const struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->_StencilBuffer;
- GLubyte fail[MAX_WIDTH];
- GLstencil r, s;
- GLuint i;
- GLboolean allfail = GL_FALSE;
- const GLuint valueMask = ctx->Stencil.ValueMask[face];
- const GLstencil *stencilStart = (GLstencil *) rb->Data;
- const GLuint stride = rb->Width;
-
- ASSERT(rb->GetPointer(ctx, rb, 0, 0));
- ASSERT(sizeof(GLstencil) == 1);
-
- /*
- * Perform stencil test. The results of this operation are stored
- * in the fail[] array:
- * IF fail[i] is non-zero THEN
- * the stencil fail operator is to be applied
- * ELSE
- * the stencil fail operator is not to be applied
- * ENDIF
- */
-
- switch (ctx->Stencil.Function[face]) {
- case GL_NEVER:
- /* always fail */
- for (i=0;i<n;i++) {
- if (mask[i]) {
- mask[i] = 0;
- fail[i] = 1;
- }
- else {
- fail[i] = 0;
- }
- }
- allfail = GL_TRUE;
- break;
- case GL_LESS:
- r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
- for (i=0;i<n;i++) {
- if (mask[i]) {
- const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & valueMask);
- if (r < s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_LEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
- for (i=0;i<n;i++) {
- if (mask[i]) {
- const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & valueMask);
- if (r <= s) {
- /* pass */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_GREATER:
- r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
- for (i=0;i<n;i++) {
- if (mask[i]) {
- const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & valueMask);
- if (r > s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_GEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
- for (i=0;i<n;i++) {
- if (mask[i]) {
- const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & valueMask);
- if (r >= s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_EQUAL:
- r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
- for (i=0;i<n;i++) {
- if (mask[i]) {
- const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & valueMask);
- if (r == s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_NOTEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
- for (i=0;i<n;i++) {
- if (mask[i]) {
- const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & valueMask);
- if (r != s) {
- /* passed */
- fail[i] = 0;
- }
- else {
- fail[i] = 1;
- mask[i] = 0;
- }
- }
- else {
- fail[i] = 0;
- }
- }
- break;
- case GL_ALWAYS:
- /* always pass */
- for (i=0;i<n;i++) {
- fail[i] = 0;
- }
- break;
- default:
- _mesa_problem(ctx, "Bad stencil func in gl_stencil_pixels");
- return 0;
- }
-
- if (ctx->Stencil.FailFunc[face] != GL_KEEP) {
- apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.FailFunc[face],
- face, fail );
- }
-
- return !allfail;
-}
-
-
-
-
-/**
- * Apply stencil and depth testing to an array of pixels.
- * This is used both for software and hardware stencil buffers.
- *
- * The comments in this function are a bit sparse but the code is
- * almost identical to stencil_and_ztest_span(), which is well
- * commented.
- *
- * Input: n - number of pixels in the array
- * x, y - array of [n] pixel positions
- * z - array [n] of z values
- * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
- * Output: mask - array [n] of flags (1=stencil and depth test passed)
- * Return: GL_FALSE - all fragments failed the testing
- * GL_TRUE - one or more fragments passed the testing
- */
-static GLboolean
-stencil_and_ztest_pixels( struct gl_context *ctx, SWspan *span, GLuint face )
-{
- GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH];
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->_StencilBuffer;
- const GLuint n = span->end;
- const GLint *x = span->array->x;
- const GLint *y = span->array->y;
- GLubyte *mask = span->array->mask;
-
- ASSERT(span->arrayMask & SPAN_XY);
- ASSERT(ctx->Stencil.Enabled);
- ASSERT(n <= MAX_WIDTH);
-
- if (!rb->GetPointer(ctx, rb, 0, 0)) {
- /* No direct access */
- GLstencil stencil[MAX_WIDTH];
-
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte));
-
- memcpy(origMask, mask, n * sizeof(GLubyte));
-
- (void) do_stencil_test(ctx, face, n, stencil, mask);
-
- if (ctx->Depth.Test == GL_FALSE) {
- apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face,
- n, stencil, mask);
- }
- else {
- GLubyte tmpMask[MAX_WIDTH];
- memcpy(tmpMask, mask, n * sizeof(GLubyte));
-
- _swrast_depth_test_span(ctx, span);
-
- compute_pass_fail_masks(n, tmpMask, mask, passMask, failMask);
-
- if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
- apply_stencil_op(ctx, ctx->Stencil.ZFailFunc[face], face,
- n, stencil, failMask);
- }
- if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
- apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face,
- n, stencil, passMask);
- }
- }
-
- /* Write updated stencil values into hardware stencil buffer */
- rb->PutValues(ctx, rb, n, x, y, stencil, origMask);
-
- return GL_TRUE;
- }
- else {
- /* Direct access to stencil buffer */
-
- if (stencil_test_pixels(ctx, face, n, x, y, mask) == GL_FALSE) {
- /* all fragments failed the stencil test, we're done. */
- return GL_FALSE;
- }
-
- if (ctx->Depth.Test==GL_FALSE) {
- apply_stencil_op_to_pixels(ctx, n, x, y,
- ctx->Stencil.ZPassFunc[face], face, mask);
- }
- else {
- memcpy(origMask, mask, n * sizeof(GLubyte));
-
- _swrast_depth_test_span(ctx, span);
-
- compute_pass_fail_masks(n, origMask, mask, passMask, failMask);
-
- if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
- apply_stencil_op_to_pixels(ctx, n, x, y,
- ctx->Stencil.ZFailFunc[face],
- face, failMask);
- }
- if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
- apply_stencil_op_to_pixels(ctx, n, x, y,
- ctx->Stencil.ZPassFunc[face],
- face, passMask);
- }
- }
-
- return GL_TRUE; /* one or more fragments passed both tests */
- }
-}
-
-
-/**
- * /return GL_TRUE = one or more fragments passed,
- * GL_FALSE = all fragments failed.
- */
-GLboolean
-_swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span)
-{
- const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace;
-
- if (span->arrayMask & SPAN_XY)
- return stencil_and_ztest_pixels(ctx, span, face);
- else
- return stencil_and_ztest_span(ctx, span, face);
-}
-
-
-#if 0
-GLuint
-clip_span(GLuint bufferWidth, GLuint bufferHeight,
- GLint x, GLint y, GLuint *count)
-{
- GLuint n = *count;
- GLuint skipPixels = 0;
-
- if (y < 0 || y >= bufferHeight || x + n <= 0 || x >= bufferWidth) {
- /* totally out of bounds */
- n = 0;
- }
- else {
- /* left clip */
- if (x < 0) {
- skipPixels = -x;
- x = 0;
- n -= skipPixels;
- }
- /* right clip */
- if (x + n > bufferWidth) {
- GLint dx = x + n - bufferWidth;
- n -= dx;
- }
- }
-
- *count = n;
-
- return skipPixels;
-}
-#endif
-
-
-/**
- * Return a span of stencil values from the stencil buffer.
- * Used for glRead/CopyPixels
- * Input: n - how many pixels
- * x,y - location of first pixel
- * Output: stencil - the array of stencil values
- */
-void
-_swrast_read_stencil_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLint n, GLint x, GLint y, GLstencil stencil[])
-{
- if (y < 0 || y >= (GLint) rb->Height ||
- x + n <= 0 || x >= (GLint) rb->Width) {
- /* span is completely outside framebuffer */
- return; /* undefined values OK */
- }
-
- if (x < 0) {
- GLint dx = -x;
- x = 0;
- n -= dx;
- stencil += dx;
- }
- if (x + n > (GLint) rb->Width) {
- GLint dx = x + n - rb->Width;
- n -= dx;
- }
- if (n <= 0) {
- return;
- }
-
- rb->GetRow(ctx, rb, n, x, y, stencil);
-}
-
-
-
-/**
- * Write a span of stencil values to the stencil buffer. This function
- * applies the stencil write mask when needed.
- * Used for glDraw/CopyPixels
- * Input: n - how many pixels
- * x, y - location of first pixel
- * stencil - the array of stencil values
- */
-void
-_swrast_write_stencil_span(struct gl_context *ctx, GLint n, GLint x, GLint y,
- const GLstencil stencil[] )
-{
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->_StencilBuffer;
- const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1;
- const GLuint stencilMask = ctx->Stencil.WriteMask[0];
-
- if (y < 0 || y >= (GLint) rb->Height ||
- x + n <= 0 || x >= (GLint) rb->Width) {
- /* span is completely outside framebuffer */
- return; /* undefined values OK */
- }
- if (x < 0) {
- GLint dx = -x;
- x = 0;
- n -= dx;
- stencil += dx;
- }
- if (x + n > (GLint) rb->Width) {
- GLint dx = x + n - rb->Width;
- n -= dx;
- }
- if (n <= 0) {
- return;
- }
-
- if ((stencilMask & stencilMax) != stencilMax) {
- /* need to apply writemask */
- GLstencil destVals[MAX_WIDTH], newVals[MAX_WIDTH];
- GLint i;
- rb->GetRow(ctx, rb, n, x, y, destVals);
- for (i = 0; i < n; i++) {
- newVals[i]
- = (stencil[i] & stencilMask) | (destVals[i] & ~stencilMask);
- }
- rb->PutRow(ctx, rb, n, x, y, newVals, NULL);
- }
- else {
- rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
- }
-}
-
-
-
-/**
- * Clear the stencil buffer.
- */
-void
-_swrast_clear_stencil_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb )
-{
- const GLubyte stencilBits = ctx->DrawBuffer->Visual.stencilBits;
- const GLuint mask = ctx->Stencil.WriteMask[0];
- const GLuint invMask = ~mask;
- const GLuint clearVal = (ctx->Stencil.Clear & mask);
- const GLuint stencilMax = (1 << stencilBits) - 1;
- GLint x, y, width, height;
-
- if (!rb || mask == 0)
- return;
-
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE ||
- rb->DataType == GL_UNSIGNED_SHORT);
-
- ASSERT(rb->_BaseFormat == GL_STENCIL_INDEX);
-
- /* compute region to clear */
- x = ctx->DrawBuffer->_Xmin;
- y = ctx->DrawBuffer->_Ymin;
- width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
-
- if (rb->GetPointer(ctx, rb, 0, 0)) {
- /* Direct buffer access */
- if ((mask & stencilMax) != stencilMax) {
- /* need to mask the clear */
- if (rb->DataType == GL_UNSIGNED_BYTE) {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLubyte *stencil = (GLubyte*) rb->GetPointer(ctx, rb, x, y + i);
- for (j = 0; j < width; j++) {
- stencil[j] = (stencil[j] & invMask) | clearVal;
- }
- }
- }
- else {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLushort *stencil = (GLushort*) rb->GetPointer(ctx, rb, x, y + i);
- for (j = 0; j < width; j++) {
- stencil[j] = (stencil[j] & invMask) | clearVal;
- }
- }
- }
- }
- else {
- /* no bit masking */
- if (width == (GLint) rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
- /* optimized case */
- /* Note: bottom-to-top raster assumed! */
- GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y);
- GLuint len = width * height * sizeof(GLubyte);
- memset(stencil, clearVal, len);
- }
- else {
- /* general case */
- GLint i;
- for (i = 0; i < height; i++) {
- GLvoid *stencil = rb->GetPointer(ctx, rb, x, y + i);
- if (rb->DataType == GL_UNSIGNED_BYTE) {
- memset(stencil, clearVal, width);
- }
- else {
- _mesa_memset16((short unsigned int*) stencil, clearVal, width);
- }
- }
- }
- }
- }
- else {
- /* no direct access */
- if ((mask & stencilMax) != stencilMax) {
- /* need to mask the clear */
- if (rb->DataType == GL_UNSIGNED_BYTE) {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLubyte stencil[MAX_WIDTH];
- rb->GetRow(ctx, rb, width, x, y + i, stencil);
- for (j = 0; j < width; j++) {
- stencil[j] = (stencil[j] & invMask) | clearVal;
- }
- rb->PutRow(ctx, rb, width, x, y + i, stencil, NULL);
- }
- }
- else {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLushort stencil[MAX_WIDTH];
- rb->GetRow(ctx, rb, width, x, y + i, stencil);
- for (j = 0; j < width; j++) {
- stencil[j] = (stencil[j] & invMask) | clearVal;
- }
- rb->PutRow(ctx, rb, width, x, y + i, stencil, NULL);
- }
- }
- }
- else {
- /* no bit masking */
- const GLubyte clear8 = (GLubyte) clearVal;
- const GLushort clear16 = (GLushort) clearVal;
- const void *clear;
- GLint i;
- if (rb->DataType == GL_UNSIGNED_BYTE) {
- clear = &clear8;
- }
- else {
- clear = &clear16;
- }
- for (i = 0; i < height; i++) {
- rb->PutMonoRow(ctx, rb, width, x, y + i, clear, NULL);
- }
- }
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 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.
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+
+#include "s_context.h"
+#include "s_depth.h"
+#include "s_stencil.h"
+#include "s_span.h"
+
+
+
+/* Stencil Logic:
+
+IF stencil test fails THEN
+ Apply fail-op to stencil value
+ Don't write the pixel (RGBA,Z)
+ELSE
+ IF doing depth test && depth test fails THEN
+ Apply zfail-op to stencil value
+ Write RGBA and Z to appropriate buffers
+ ELSE
+ Apply zpass-op to stencil value
+ENDIF
+
+*/
+
+
+/**
+ * Apply the given stencil operator to the array of stencil values.
+ * Don't touch stencil[i] if mask[i] is zero.
+ * Input: n - size of stencil array
+ * oper - the stencil buffer operator
+ * face - 0 or 1 for front or back face operation
+ * stencil - array of stencil values
+ * mask - array [n] of flag: 1=apply operator, 0=don't apply operator
+ * Output: stencil - modified values
+ */
+static void
+apply_stencil_op( const struct gl_context *ctx, GLenum oper, GLuint face,
+ GLuint n, GLstencil stencil[], const GLubyte mask[] )
+{
+ const GLstencil ref = ctx->Stencil.Ref[face];
+ const GLstencil wrtmask = ctx->Stencil.WriteMask[face];
+ const GLstencil invmask = (GLstencil) (~wrtmask);
+ const GLstencil stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
+ GLuint i;
+
+ switch (oper) {
+ case GL_KEEP:
+ /* do nothing */
+ break;
+ case GL_ZERO:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ stencil[i] = 0;
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ stencil[i] = (GLstencil) (stencil[i] & invmask);
+ }
+ }
+ }
+ break;
+ case GL_REPLACE:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ stencil[i] = ref;
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil s = stencil[i];
+ stencil[i] = (GLstencil) ((invmask & s ) | (wrtmask & ref));
+ }
+ }
+ }
+ break;
+ case GL_INCR:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil s = stencil[i];
+ if (s < stencilMax) {
+ stencil[i] = (GLstencil) (s+1);
+ }
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ /* VERIFY logic of adding 1 to a write-masked value */
+ GLstencil s = stencil[i];
+ if (s < stencilMax) {
+ stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s+1)));
+ }
+ }
+ }
+ }
+ break;
+ case GL_DECR:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil s = stencil[i];
+ if (s>0) {
+ stencil[i] = (GLstencil) (s-1);
+ }
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ /* VERIFY logic of subtracting 1 to a write-masked value */
+ GLstencil s = stencil[i];
+ if (s>0) {
+ stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s-1)));
+ }
+ }
+ }
+ }
+ break;
+ case GL_INCR_WRAP_EXT:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ stencil[i]++;
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil s = stencil[i];
+ stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s+1)));
+ }
+ }
+ }
+ break;
+ case GL_DECR_WRAP_EXT:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ stencil[i]--;
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil s = stencil[i];
+ stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s-1)));
+ }
+ }
+ }
+ break;
+ case GL_INVERT:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil s = stencil[i];
+ stencil[i] = (GLstencil) ~s;
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil s = stencil[i];
+ stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & ~s));
+ }
+ }
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad stencil op in apply_stencil_op");
+ }
+}
+
+
+
+
+/**
+ * Apply stencil test to an array of stencil values (before depth buffering).
+ * Input: face - 0 or 1 for front or back-face polygons
+ * n - number of pixels in the array
+ * stencil - array of [n] stencil values
+ * mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
+ * Output: mask - pixels which fail the stencil test will have their
+ * mask flag set to 0.
+ * stencil - updated stencil values (where the test passed)
+ * Return: GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
+ */
+static GLboolean
+do_stencil_test( struct gl_context *ctx, GLuint face, GLuint n, GLstencil stencil[],
+ GLubyte mask[] )
+{
+ GLubyte fail[MAX_WIDTH];
+ GLboolean allfail = GL_FALSE;
+ GLuint i;
+ const GLuint valueMask = ctx->Stencil.ValueMask[face];
+ const GLstencil r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
+ GLstencil s;
+
+ ASSERT(n <= MAX_WIDTH);
+
+ /*
+ * Perform stencil test. The results of this operation are stored
+ * in the fail[] array:
+ * IF fail[i] is non-zero THEN
+ * the stencil fail operator is to be applied
+ * ELSE
+ * the stencil fail operator is not to be applied
+ * ENDIF
+ */
+ switch (ctx->Stencil.Function[face]) {
+ case GL_NEVER:
+ /* never pass; always fail */
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ mask[i] = 0;
+ fail[i] = 1;
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ allfail = GL_TRUE;
+ break;
+ case GL_LESS:
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ s = (GLstencil) (stencil[i] & valueMask);
+ if (r < s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_LEQUAL:
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ s = (GLstencil) (stencil[i] & valueMask);
+ if (r <= s) {
+ /* pass */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_GREATER:
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ s = (GLstencil) (stencil[i] & valueMask);
+ if (r > s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_GEQUAL:
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ s = (GLstencil) (stencil[i] & valueMask);
+ if (r >= s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_EQUAL:
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ s = (GLstencil) (stencil[i] & valueMask);
+ if (r == s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_NOTEQUAL:
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ s = (GLstencil) (stencil[i] & valueMask);
+ if (r != s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_ALWAYS:
+ /* always pass */
+ for (i=0;i<n;i++) {
+ fail[i] = 0;
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad stencil func in gl_stencil_span");
+ return 0;
+ }
+
+ if (ctx->Stencil.FailFunc[face] != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.FailFunc[face], face, n, stencil, fail );
+ }
+
+ return !allfail;
+}
+
+
+/**
+ * Compute the zpass/zfail masks by comparing the pre- and post-depth test
+ * masks.
+ */
+static INLINE void
+compute_pass_fail_masks(GLuint n, const GLubyte origMask[],
+ const GLubyte newMask[],
+ GLubyte passMask[], GLubyte failMask[])
+{
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ ASSERT(newMask[i] == 0 || newMask[i] == 1);
+ passMask[i] = origMask[i] & newMask[i];
+ failMask[i] = origMask[i] & (newMask[i] ^ 1);
+ }
+}
+
+
+/**
+ * Apply stencil and depth testing to the span of pixels.
+ * Both software and hardware stencil buffers are acceptable.
+ * Input: n - number of pixels in the span
+ * x, y - location of leftmost pixel in span
+ * z - array [n] of z values
+ * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
+ * Output: mask - array [n] of flags (1=stencil and depth test passed)
+ * Return: GL_FALSE - all fragments failed the testing
+ * GL_TRUE - one or more fragments passed the testing
+ *
+ */
+static GLboolean
+stencil_and_ztest_span(struct gl_context *ctx, SWspan *span, GLuint face)
+{
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
+ GLstencil stencilRow[MAX_WIDTH];
+ GLstencil *stencil;
+ const GLuint n = span->end;
+ const GLint x = span->x;
+ const GLint y = span->y;
+ GLubyte *mask = span->array->mask;
+
+ ASSERT((span->arrayMask & SPAN_XY) == 0);
+ ASSERT(ctx->Stencil.Enabled);
+ ASSERT(n <= MAX_WIDTH);
+#ifdef DEBUG
+ if (ctx->Depth.Test) {
+ ASSERT(span->arrayMask & SPAN_Z);
+ }
+#endif
+
+ stencil = (GLstencil *) rb->GetPointer(ctx, rb, x, y);
+ if (!stencil) {
+ rb->GetRow(ctx, rb, n, x, y, stencilRow);
+ stencil = stencilRow;
+ }
+
+ /*
+ * Apply the stencil test to the fragments.
+ * failMask[i] is 1 if the stencil test failed.
+ */
+ if (do_stencil_test( ctx, face, n, stencil, mask ) == GL_FALSE) {
+ /* all fragments failed the stencil test, we're done. */
+ span->writeAll = GL_FALSE;
+ if (!rb->GetPointer(ctx, rb, 0, 0)) {
+ /* put updated stencil values into buffer */
+ rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
+ }
+ return GL_FALSE;
+ }
+
+ /*
+ * Some fragments passed the stencil test, apply depth test to them
+ * and apply Zpass and Zfail stencil ops.
+ */
+ if (ctx->Depth.Test == GL_FALSE ||
+ ctx->DrawBuffer->_DepthBuffer == NULL) {
+ /*
+ * No depth buffer, just apply zpass stencil function to active pixels.
+ */
+ apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face, n, stencil, mask );
+ }
+ else {
+ /*
+ * Perform depth buffering, then apply zpass or zfail stencil function.
+ */
+ GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH];
+
+ /* save the current mask bits */
+ memcpy(origMask, mask, n * sizeof(GLubyte));
+
+ /* apply the depth test */
+ _swrast_depth_test_span(ctx, span);
+
+ compute_pass_fail_masks(n, origMask, mask, passMask, failMask);
+
+ /* apply the pass and fail operations */
+ if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.ZFailFunc[face], face,
+ n, stencil, failMask );
+ }
+ if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face,
+ n, stencil, passMask );
+ }
+ }
+
+ /*
+ * Write updated stencil values back into hardware stencil buffer.
+ */
+ if (!rb->GetPointer(ctx, rb, 0, 0)) {
+ rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
+ }
+
+ span->writeAll = GL_FALSE;
+
+ return GL_TRUE; /* one or more fragments passed both tests */
+}
+
+
+
+/*
+ * Return the address of a stencil buffer value given the window coords:
+ */
+#define STENCIL_ADDRESS(X, Y) (stencilStart + (Y) * stride + (X))
+
+
+
+/**
+ * Apply the given stencil operator for each pixel in the array whose
+ * mask flag is set.
+ * \note This is for software stencil buffers only.
+ * Input: n - number of pixels in the span
+ * x, y - array of [n] pixels
+ * operator - the stencil buffer operator
+ * mask - array [n] of flag: 1=apply operator, 0=don't apply operator
+ */
+static void
+apply_stencil_op_to_pixels( struct gl_context *ctx,
+ GLuint n, const GLint x[], const GLint y[],
+ GLenum oper, GLuint face, const GLubyte mask[] )
+{
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
+ const GLstencil stencilMax = (1 << fb->Visual.stencilBits) - 1;
+ const GLstencil ref = ctx->Stencil.Ref[face];
+ const GLstencil wrtmask = ctx->Stencil.WriteMask[face];
+ const GLstencil invmask = (GLstencil) (~wrtmask);
+ GLuint i;
+ GLstencil *stencilStart = (GLubyte *) rb->Data;
+ const GLuint stride = rb->Width;
+
+ ASSERT(rb->GetPointer(ctx, rb, 0, 0));
+ ASSERT(sizeof(GLstencil) == 1);
+
+ switch (oper) {
+ case GL_KEEP:
+ /* do nothing */
+ break;
+ case GL_ZERO:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = 0;
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) (invmask & *sptr);
+ }
+ }
+ }
+ break;
+ case GL_REPLACE:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = ref;
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) ((invmask & *sptr ) | (wrtmask & ref));
+ }
+ }
+ }
+ break;
+ case GL_INCR:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ if (*sptr < stencilMax) {
+ *sptr = (GLstencil) (*sptr + 1);
+ }
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ if (*sptr < stencilMax) {
+ *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr+1)));
+ }
+ }
+ }
+ }
+ break;
+ case GL_DECR:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ if (*sptr>0) {
+ *sptr = (GLstencil) (*sptr - 1);
+ }
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ if (*sptr>0) {
+ *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr-1)));
+ }
+ }
+ }
+ }
+ break;
+ case GL_INCR_WRAP_EXT:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) (*sptr + 1);
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr+1)));
+ }
+ }
+ }
+ break;
+ case GL_DECR_WRAP_EXT:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) (*sptr - 1);
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr-1)));
+ }
+ }
+ }
+ break;
+ case GL_INVERT:
+ if (invmask==0) {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) (~*sptr);
+ }
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLstencil *sptr = STENCIL_ADDRESS( x[i], y[i] );
+ *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & ~*sptr));
+ }
+ }
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad stencilop in apply_stencil_op_to_pixels");
+ }
+}
+
+
+
+/**
+ * Apply stencil test to an array of pixels before depth buffering.
+ *
+ * \note Used for software stencil buffer only.
+ * Input: n - number of pixels in the span
+ * x, y - array of [n] pixels to stencil
+ * mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
+ * Output: mask - pixels which fail the stencil test will have their
+ * mask flag set to 0.
+ * \return GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
+ */
+static GLboolean
+stencil_test_pixels( struct gl_context *ctx, GLuint face, GLuint n,
+ const GLint x[], const GLint y[], GLubyte mask[] )
+{
+ const struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
+ GLubyte fail[MAX_WIDTH];
+ GLstencil r, s;
+ GLuint i;
+ GLboolean allfail = GL_FALSE;
+ const GLuint valueMask = ctx->Stencil.ValueMask[face];
+ const GLstencil *stencilStart = (GLstencil *) rb->Data;
+ const GLuint stride = rb->Width;
+
+ ASSERT(rb->GetPointer(ctx, rb, 0, 0));
+ ASSERT(sizeof(GLstencil) == 1);
+
+ /*
+ * Perform stencil test. The results of this operation are stored
+ * in the fail[] array:
+ * IF fail[i] is non-zero THEN
+ * the stencil fail operator is to be applied
+ * ELSE
+ * the stencil fail operator is not to be applied
+ * ENDIF
+ */
+
+ switch (ctx->Stencil.Function[face]) {
+ case GL_NEVER:
+ /* always fail */
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ mask[i] = 0;
+ fail[i] = 1;
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ allfail = GL_TRUE;
+ break;
+ case GL_LESS:
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
+ s = (GLstencil) (*sptr & valueMask);
+ if (r < s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_LEQUAL:
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
+ s = (GLstencil) (*sptr & valueMask);
+ if (r <= s) {
+ /* pass */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_GREATER:
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
+ s = (GLstencil) (*sptr & valueMask);
+ if (r > s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_GEQUAL:
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
+ s = (GLstencil) (*sptr & valueMask);
+ if (r >= s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_EQUAL:
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
+ s = (GLstencil) (*sptr & valueMask);
+ if (r == s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_NOTEQUAL:
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ const GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
+ s = (GLstencil) (*sptr & valueMask);
+ if (r != s) {
+ /* passed */
+ fail[i] = 0;
+ }
+ else {
+ fail[i] = 1;
+ mask[i] = 0;
+ }
+ }
+ else {
+ fail[i] = 0;
+ }
+ }
+ break;
+ case GL_ALWAYS:
+ /* always pass */
+ for (i=0;i<n;i++) {
+ fail[i] = 0;
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad stencil func in gl_stencil_pixels");
+ return 0;
+ }
+
+ if (ctx->Stencil.FailFunc[face] != GL_KEEP) {
+ apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.FailFunc[face],
+ face, fail );
+ }
+
+ return !allfail;
+}
+
+
+
+
+/**
+ * Apply stencil and depth testing to an array of pixels.
+ * This is used both for software and hardware stencil buffers.
+ *
+ * The comments in this function are a bit sparse but the code is
+ * almost identical to stencil_and_ztest_span(), which is well
+ * commented.
+ *
+ * Input: n - number of pixels in the array
+ * x, y - array of [n] pixel positions
+ * z - array [n] of z values
+ * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
+ * Output: mask - array [n] of flags (1=stencil and depth test passed)
+ * Return: GL_FALSE - all fragments failed the testing
+ * GL_TRUE - one or more fragments passed the testing
+ */
+static GLboolean
+stencil_and_ztest_pixels( struct gl_context *ctx, SWspan *span, GLuint face )
+{
+ GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH];
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
+ const GLuint n = span->end;
+ const GLint *x = span->array->x;
+ const GLint *y = span->array->y;
+ GLubyte *mask = span->array->mask;
+
+ ASSERT(span->arrayMask & SPAN_XY);
+ ASSERT(ctx->Stencil.Enabled);
+ ASSERT(n <= MAX_WIDTH);
+
+ if (!rb->GetPointer(ctx, rb, 0, 0)) {
+ /* No direct access */
+ GLstencil stencil[MAX_WIDTH];
+
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte));
+
+ memcpy(origMask, mask, n * sizeof(GLubyte));
+
+ (void) do_stencil_test(ctx, face, n, stencil, mask);
+
+ if (ctx->Depth.Test == GL_FALSE) {
+ apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face,
+ n, stencil, mask);
+ }
+ else {
+ GLubyte tmpMask[MAX_WIDTH];
+ memcpy(tmpMask, mask, n * sizeof(GLubyte));
+
+ _swrast_depth_test_span(ctx, span);
+
+ compute_pass_fail_masks(n, tmpMask, mask, passMask, failMask);
+
+ if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
+ apply_stencil_op(ctx, ctx->Stencil.ZFailFunc[face], face,
+ n, stencil, failMask);
+ }
+ if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
+ apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face,
+ n, stencil, passMask);
+ }
+ }
+
+ /* Write updated stencil values into hardware stencil buffer */
+ rb->PutValues(ctx, rb, n, x, y, stencil, origMask);
+
+ return GL_TRUE;
+ }
+ else {
+ /* Direct access to stencil buffer */
+
+ if (stencil_test_pixels(ctx, face, n, x, y, mask) == GL_FALSE) {
+ /* all fragments failed the stencil test, we're done. */
+ return GL_FALSE;
+ }
+
+ if (ctx->Depth.Test==GL_FALSE) {
+ apply_stencil_op_to_pixels(ctx, n, x, y,
+ ctx->Stencil.ZPassFunc[face], face, mask);
+ }
+ else {
+ memcpy(origMask, mask, n * sizeof(GLubyte));
+
+ _swrast_depth_test_span(ctx, span);
+
+ compute_pass_fail_masks(n, origMask, mask, passMask, failMask);
+
+ if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
+ apply_stencil_op_to_pixels(ctx, n, x, y,
+ ctx->Stencil.ZFailFunc[face],
+ face, failMask);
+ }
+ if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
+ apply_stencil_op_to_pixels(ctx, n, x, y,
+ ctx->Stencil.ZPassFunc[face],
+ face, passMask);
+ }
+ }
+
+ return GL_TRUE; /* one or more fragments passed both tests */
+ }
+}
+
+
+/**
+ * /return GL_TRUE = one or more fragments passed,
+ * GL_FALSE = all fragments failed.
+ */
+GLboolean
+_swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span)
+{
+ const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace;
+
+ if (span->arrayMask & SPAN_XY)
+ return stencil_and_ztest_pixels(ctx, span, face);
+ else
+ return stencil_and_ztest_span(ctx, span, face);
+}
+
+
+#if 0
+GLuint
+clip_span(GLuint bufferWidth, GLuint bufferHeight,
+ GLint x, GLint y, GLuint *count)
+{
+ GLuint n = *count;
+ GLuint skipPixels = 0;
+
+ if (y < 0 || y >= bufferHeight || x + n <= 0 || x >= bufferWidth) {
+ /* totally out of bounds */
+ n = 0;
+ }
+ else {
+ /* left clip */
+ if (x < 0) {
+ skipPixels = -x;
+ x = 0;
+ n -= skipPixels;
+ }
+ /* right clip */
+ if (x + n > bufferWidth) {
+ GLint dx = x + n - bufferWidth;
+ n -= dx;
+ }
+ }
+
+ *count = n;
+
+ return skipPixels;
+}
+#endif
+
+
+/**
+ * Return a span of stencil values from the stencil buffer.
+ * Used for glRead/CopyPixels
+ * Input: n - how many pixels
+ * x,y - location of first pixel
+ * Output: stencil - the array of stencil values
+ */
+void
+_swrast_read_stencil_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLint n, GLint x, GLint y, GLstencil stencil[])
+{
+ if (y < 0 || y >= (GLint) rb->Height ||
+ x + n <= 0 || x >= (GLint) rb->Width) {
+ /* span is completely outside framebuffer */
+ return; /* undefined values OK */
+ }
+
+ if (x < 0) {
+ GLint dx = -x;
+ x = 0;
+ n -= dx;
+ stencil += dx;
+ }
+ if (x + n > (GLint) rb->Width) {
+ GLint dx = x + n - rb->Width;
+ n -= dx;
+ }
+ if (n <= 0) {
+ return;
+ }
+
+ rb->GetRow(ctx, rb, n, x, y, stencil);
+}
+
+
+
+/**
+ * Write a span of stencil values to the stencil buffer. This function
+ * applies the stencil write mask when needed.
+ * Used for glDraw/CopyPixels
+ * Input: n - how many pixels
+ * x, y - location of first pixel
+ * stencil - the array of stencil values
+ */
+void
+_swrast_write_stencil_span(struct gl_context *ctx, GLint n, GLint x, GLint y,
+ const GLstencil stencil[] )
+{
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
+ const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1;
+ const GLuint stencilMask = ctx->Stencil.WriteMask[0];
+
+ if (y < 0 || y >= (GLint) rb->Height ||
+ x + n <= 0 || x >= (GLint) rb->Width) {
+ /* span is completely outside framebuffer */
+ return; /* undefined values OK */
+ }
+ if (x < 0) {
+ GLint dx = -x;
+ x = 0;
+ n -= dx;
+ stencil += dx;
+ }
+ if (x + n > (GLint) rb->Width) {
+ GLint dx = x + n - rb->Width;
+ n -= dx;
+ }
+ if (n <= 0) {
+ return;
+ }
+
+ if ((stencilMask & stencilMax) != stencilMax) {
+ /* need to apply writemask */
+ GLstencil destVals[MAX_WIDTH], newVals[MAX_WIDTH];
+ GLint i;
+ rb->GetRow(ctx, rb, n, x, y, destVals);
+ for (i = 0; i < n; i++) {
+ newVals[i]
+ = (stencil[i] & stencilMask) | (destVals[i] & ~stencilMask);
+ }
+ rb->PutRow(ctx, rb, n, x, y, newVals, NULL);
+ }
+ else {
+ rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
+ }
+}
+
+
+
+/**
+ * Clear the stencil buffer.
+ */
+void
+_swrast_clear_stencil_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb )
+{
+ const GLubyte stencilBits = ctx->DrawBuffer->Visual.stencilBits;
+ const GLuint mask = ctx->Stencil.WriteMask[0];
+ const GLuint invMask = ~mask;
+ const GLuint clearVal = (ctx->Stencil.Clear & mask);
+ const GLuint stencilMax = (1 << stencilBits) - 1;
+ GLint x, y, width, height;
+
+ if (!rb || mask == 0)
+ return;
+
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE ||
+ rb->DataType == GL_UNSIGNED_SHORT);
+
+ ASSERT(rb->_BaseFormat == GL_STENCIL_INDEX);
+
+ /* compute region to clear */
+ x = ctx->DrawBuffer->_Xmin;
+ y = ctx->DrawBuffer->_Ymin;
+ width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+
+ if (rb->GetPointer(ctx, rb, 0, 0)) {
+ /* Direct buffer access */
+ if ((mask & stencilMax) != stencilMax) {
+ /* need to mask the clear */
+ if (rb->DataType == GL_UNSIGNED_BYTE) {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLubyte *stencil = (GLubyte*) rb->GetPointer(ctx, rb, x, y + i);
+ for (j = 0; j < width; j++) {
+ stencil[j] = (stencil[j] & invMask) | clearVal;
+ }
+ }
+ }
+ else {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLushort *stencil = (GLushort*) rb->GetPointer(ctx, rb, x, y + i);
+ for (j = 0; j < width; j++) {
+ stencil[j] = (stencil[j] & invMask) | clearVal;
+ }
+ }
+ }
+ }
+ else {
+ /* no bit masking */
+ if (width == (GLint) rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
+ /* optimized case */
+ /* Note: bottom-to-top raster assumed! */
+ GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y);
+ GLuint len = width * height * sizeof(GLubyte);
+ memset(stencil, clearVal, len);
+ }
+ else {
+ /* general case */
+ GLint i;
+ for (i = 0; i < height; i++) {
+ GLvoid *stencil = rb->GetPointer(ctx, rb, x, y + i);
+ if (rb->DataType == GL_UNSIGNED_BYTE) {
+ memset(stencil, clearVal, width);
+ }
+ else {
+ _mesa_memset16((short unsigned int*) stencil, clearVal, width);
+ }
+ }
+ }
+ }
+ }
+ else {
+ /* no direct access */
+ if ((mask & stencilMax) != stencilMax) {
+ /* need to mask the clear */
+ if (rb->DataType == GL_UNSIGNED_BYTE) {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLubyte stencil[MAX_WIDTH];
+ rb->GetRow(ctx, rb, width, x, y + i, stencil);
+ for (j = 0; j < width; j++) {
+ stencil[j] = (stencil[j] & invMask) | clearVal;
+ }
+ rb->PutRow(ctx, rb, width, x, y + i, stencil, NULL);
+ }
+ }
+ else {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLushort stencil[MAX_WIDTH];
+ rb->GetRow(ctx, rb, width, x, y + i, stencil);
+ for (j = 0; j < width; j++) {
+ stencil[j] = (stencil[j] & invMask) | clearVal;
+ }
+ rb->PutRow(ctx, rb, width, x, y + i, stencil, NULL);
+ }
+ }
+ }
+ else {
+ /* no bit masking */
+ const GLubyte clear8 = (GLubyte) clearVal;
+ const GLushort clear16 = (GLushort) clearVal;
+ const void *clear;
+ GLint i;
+ if (rb->DataType == GL_UNSIGNED_BYTE) {
+ clear = &clear8;
+ }
+ else {
+ clear = &clear16;
+ }
+ for (i = 0; i < height; i++) {
+ rb->PutMonoRow(ctx, rb, width, x, y + i, clear, NULL);
+ }
+ }
+ }
+}
diff --git a/mesalib/src/mesa/swrast/s_texcombine.c b/mesalib/src/mesa/swrast/s_texcombine.c
index 53ef2f890..80b9dff3c 100644
--- a/mesalib/src/mesa/swrast/s_texcombine.c
+++ b/mesalib/src/mesa/swrast/s_texcombine.c
@@ -1,751 +1,755 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. 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.
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/colormac.h"
-#include "main/imports.h"
-#include "main/pixeltransfer.h"
-#include "program/prog_instruction.h"
-
-#include "s_context.h"
-#include "s_texcombine.h"
-
-
-/**
- * Pointer to array of float[4]
- * This type makes the code below more concise and avoids a lot of casting.
- */
-typedef float (*float4_array)[4];
-
-
-/**
- * Return array of texels for given unit.
- */
-static INLINE float4_array
-get_texel_array(SWcontext *swrast, GLuint unit)
-{
- return (float4_array) (swrast->TexelBuffer + unit * MAX_WIDTH * 4);
-}
-
-
-
-/**
- * Do texture application for:
- * GL_EXT_texture_env_combine
- * GL_ARB_texture_env_combine
- * GL_EXT_texture_env_dot3
- * GL_ARB_texture_env_dot3
- * GL_ATI_texture_env_combine3
- * GL_NV_texture_env_combine4
- * conventional GL texture env modes
- *
- * \param ctx rendering context
- * \param unit the texture combiner unit
- * \param n number of fragments to process (span width)
- * \param primary_rgba incoming fragment color array
- * \param texelBuffer pointer to texel colors for all texture units
- *
- * \param rgba incoming/result fragment colors
- */
-static void
-texture_combine( struct gl_context *ctx, GLuint unit, GLuint n,
- const float4_array primary_rgba,
- const GLfloat *texelBuffer,
- GLchan (*rgbaChan)[4] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]);
- const struct gl_tex_env_combine_state *combine = textureUnit->_CurrentCombine;
- float4_array argRGB[MAX_COMBINER_TERMS];
- float4_array argA[MAX_COMBINER_TERMS];
- const GLfloat scaleRGB = (GLfloat) (1 << combine->ScaleShiftRGB);
- const GLfloat scaleA = (GLfloat) (1 << combine->ScaleShiftA);
- const GLuint numArgsRGB = combine->_NumArgsRGB;
- const GLuint numArgsA = combine->_NumArgsA;
- float4_array ccolor[4], rgba;
- GLuint i, term;
-
- /* alloc temp pixel buffers */
- rgba = (float4_array) malloc(4 * n * sizeof(GLfloat));
- if (!rgba) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine");
- return;
- }
-
- for (i = 0; i < numArgsRGB || i < numArgsA; i++) {
- ccolor[i] = (float4_array) malloc(4 * n * sizeof(GLfloat));
- if (!ccolor[i]) {
- while (i) {
- free(ccolor[i]);
- i--;
- }
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine");
- return;
- }
- }
-
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]);
- rgba[i][GCOMP] = CHAN_TO_FLOAT(rgbaChan[i][GCOMP]);
- rgba[i][BCOMP] = CHAN_TO_FLOAT(rgbaChan[i][BCOMP]);
- rgba[i][ACOMP] = CHAN_TO_FLOAT(rgbaChan[i][ACOMP]);
- }
-
- /*
- printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n",
- combine->ModeRGB,
- combine->ModeA,
- combine->SourceRGB[0],
- combine->SourceA[0],
- combine->SourceRGB[1],
- combine->SourceA[1]);
- */
-
- /*
- * Do operand setup for up to 4 operands. Loop over the terms.
- */
- for (term = 0; term < numArgsRGB; term++) {
- const GLenum srcRGB = combine->SourceRGB[term];
- const GLenum operandRGB = combine->OperandRGB[term];
-
- switch (srcRGB) {
- case GL_TEXTURE:
- argRGB[term] = get_texel_array(swrast, unit);
- break;
- case GL_PRIMARY_COLOR:
- argRGB[term] = primary_rgba;
- break;
- case GL_PREVIOUS:
- argRGB[term] = rgba;
- break;
- case GL_CONSTANT:
- {
- float4_array c = ccolor[term];
- GLfloat red = textureUnit->EnvColor[0];
- GLfloat green = textureUnit->EnvColor[1];
- GLfloat blue = textureUnit->EnvColor[2];
- GLfloat alpha = textureUnit->EnvColor[3];
- for (i = 0; i < n; i++) {
- ASSIGN_4V(c[i], red, green, blue, alpha);
- }
- argRGB[term] = ccolor[term];
- }
- break;
- /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources.
- */
- case GL_ZERO:
- {
- float4_array c = ccolor[term];
- for (i = 0; i < n; i++) {
- ASSIGN_4V(c[i], 0.0F, 0.0F, 0.0F, 0.0F);
- }
- argRGB[term] = ccolor[term];
- }
- break;
- case GL_ONE:
- {
- float4_array c = ccolor[term];
- for (i = 0; i < n; i++) {
- ASSIGN_4V(c[i], 1.0F, 1.0F, 1.0F, 1.0F);
- }
- argRGB[term] = ccolor[term];
- }
- break;
- default:
- /* ARB_texture_env_crossbar source */
- {
- const GLuint srcUnit = srcRGB - GL_TEXTURE0;
- ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
- if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
- goto end;
- argRGB[term] = get_texel_array(swrast, srcUnit);
- }
- }
-
- if (operandRGB != GL_SRC_COLOR) {
- float4_array src = argRGB[term];
- float4_array dst = ccolor[term];
-
- /* point to new arg[term] storage */
- argRGB[term] = ccolor[term];
-
- switch (operandRGB) {
- case GL_ONE_MINUS_SRC_COLOR:
- for (i = 0; i < n; i++) {
- dst[i][RCOMP] = 1.0F - src[i][RCOMP];
- dst[i][GCOMP] = 1.0F - src[i][GCOMP];
- dst[i][BCOMP] = 1.0F - src[i][BCOMP];
- }
- break;
- case GL_SRC_ALPHA:
- for (i = 0; i < n; i++) {
- dst[i][RCOMP] =
- dst[i][GCOMP] =
- dst[i][BCOMP] = src[i][ACOMP];
- }
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- for (i = 0; i < n; i++) {
- dst[i][RCOMP] =
- dst[i][GCOMP] =
- dst[i][BCOMP] = 1.0F - src[i][ACOMP];
- }
- break;
- default:
- _mesa_problem(ctx, "Bad operandRGB");
- }
- }
- }
-
- /*
- * Set up the argA[term] pointers
- */
- for (term = 0; term < numArgsA; term++) {
- const GLenum srcA = combine->SourceA[term];
- const GLenum operandA = combine->OperandA[term];
-
- switch (srcA) {
- case GL_TEXTURE:
- argA[term] = get_texel_array(swrast, unit);
- break;
- case GL_PRIMARY_COLOR:
- argA[term] = primary_rgba;
- break;
- case GL_PREVIOUS:
- argA[term] = rgba;
- break;
- case GL_CONSTANT:
- {
- float4_array c = ccolor[term];
- GLfloat alpha = textureUnit->EnvColor[3];
- for (i = 0; i < n; i++)
- c[i][ACOMP] = alpha;
- argA[term] = ccolor[term];
- }
- break;
- /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources.
- */
- case GL_ZERO:
- {
- float4_array c = ccolor[term];
- for (i = 0; i < n; i++)
- c[i][ACOMP] = 0.0F;
- argA[term] = ccolor[term];
- }
- break;
- case GL_ONE:
- {
- float4_array c = ccolor[term];
- for (i = 0; i < n; i++)
- c[i][ACOMP] = 1.0F;
- argA[term] = ccolor[term];
- }
- break;
- default:
- /* ARB_texture_env_crossbar source */
- {
- const GLuint srcUnit = srcA - GL_TEXTURE0;
- ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
- if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
- goto end;
- argA[term] = get_texel_array(swrast, srcUnit);
- }
- }
-
- if (operandA == GL_ONE_MINUS_SRC_ALPHA) {
- float4_array src = argA[term];
- float4_array dst = ccolor[term];
- argA[term] = ccolor[term];
- for (i = 0; i < n; i++) {
- dst[i][ACOMP] = 1.0F - src[i][ACOMP];
- }
- }
- }
-
- /* RGB channel combine */
- {
- float4_array arg0 = argRGB[0];
- float4_array arg1 = argRGB[1];
- float4_array arg2 = argRGB[2];
- float4_array arg3 = argRGB[3];
-
- switch (combine->ModeRGB) {
- case GL_REPLACE:
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = arg0[i][RCOMP] * scaleRGB;
- rgba[i][GCOMP] = arg0[i][GCOMP] * scaleRGB;
- rgba[i][BCOMP] = arg0[i][BCOMP] * scaleRGB;
- }
- break;
- case GL_MODULATE:
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = arg0[i][RCOMP] * arg1[i][RCOMP] * scaleRGB;
- rgba[i][GCOMP] = arg0[i][GCOMP] * arg1[i][GCOMP] * scaleRGB;
- rgba[i][BCOMP] = arg0[i][BCOMP] * arg1[i][BCOMP] * scaleRGB;
- }
- break;
- case GL_ADD:
- if (textureUnit->EnvMode == GL_COMBINE4_NV) {
- /* (a * b) + (c * d) */
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] +
- arg2[i][RCOMP] * arg3[i][RCOMP]) * scaleRGB;
- rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] +
- arg2[i][GCOMP] * arg3[i][GCOMP]) * scaleRGB;
- rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] +
- arg2[i][BCOMP] * arg3[i][BCOMP]) * scaleRGB;
- }
- }
- else {
- /* 2-term addition */
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP]) * scaleRGB;
- rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP]) * scaleRGB;
- rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP]) * scaleRGB;
- }
- }
- break;
- case GL_ADD_SIGNED:
- if (textureUnit->EnvMode == GL_COMBINE4_NV) {
- /* (a * b) + (c * d) - 0.5 */
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] +
- arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5F) * scaleRGB;
- rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] +
- arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5F) * scaleRGB;
- rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] +
- arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5F) * scaleRGB;
- }
- }
- else {
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5F) * scaleRGB;
- rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5F) * scaleRGB;
- rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5F) * scaleRGB;
- }
- }
- break;
- case GL_INTERPOLATE:
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = (arg0[i][RCOMP] * arg2[i][RCOMP] +
- arg1[i][RCOMP] * (1.0F - arg2[i][RCOMP])) * scaleRGB;
- rgba[i][GCOMP] = (arg0[i][GCOMP] * arg2[i][GCOMP] +
- arg1[i][GCOMP] * (1.0F - arg2[i][GCOMP])) * scaleRGB;
- rgba[i][BCOMP] = (arg0[i][BCOMP] * arg2[i][BCOMP] +
- arg1[i][BCOMP] * (1.0F - arg2[i][BCOMP])) * scaleRGB;
- }
- break;
- case GL_SUBTRACT:
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = (arg0[i][RCOMP] - arg1[i][RCOMP]) * scaleRGB;
- rgba[i][GCOMP] = (arg0[i][GCOMP] - arg1[i][GCOMP]) * scaleRGB;
- rgba[i][BCOMP] = (arg0[i][BCOMP] - arg1[i][BCOMP]) * scaleRGB;
- }
- break;
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- /* Do not scale the result by 1 2 or 4 */
- for (i = 0; i < n; i++) {
- GLfloat dot = ((arg0[i][RCOMP] - 0.5F) * (arg1[i][RCOMP] - 0.5F) +
- (arg0[i][GCOMP] - 0.5F) * (arg1[i][GCOMP] - 0.5F) +
- (arg0[i][BCOMP] - 0.5F) * (arg1[i][BCOMP] - 0.5F))
- * 4.0F;
- dot = CLAMP(dot, 0.0F, 1.0F);
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = dot;
- }
- break;
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- /* DO scale the result by 1 2 or 4 */
- for (i = 0; i < n; i++) {
- GLfloat dot = ((arg0[i][RCOMP] - 0.5F) * (arg1[i][RCOMP] - 0.5F) +
- (arg0[i][GCOMP] - 0.5F) * (arg1[i][GCOMP] - 0.5F) +
- (arg0[i][BCOMP] - 0.5F) * (arg1[i][BCOMP] - 0.5F))
- * 4.0F * scaleRGB;
- dot = CLAMP(dot, 0.0F, 1.0F);
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = dot;
- }
- break;
- case GL_MODULATE_ADD_ATI:
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) +
- arg1[i][RCOMP]) * scaleRGB;
- rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) +
- arg1[i][GCOMP]) * scaleRGB;
- rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) +
- arg1[i][BCOMP]) * scaleRGB;
- }
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) +
- arg1[i][RCOMP] - 0.5F) * scaleRGB;
- rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) +
- arg1[i][GCOMP] - 0.5F) * scaleRGB;
- rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) +
- arg1[i][BCOMP] - 0.5F) * scaleRGB;
- }
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) -
- arg1[i][RCOMP]) * scaleRGB;
- rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) -
- arg1[i][GCOMP]) * scaleRGB;
- rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) -
- arg1[i][BCOMP]) * scaleRGB;
- }
- break;
- case GL_BUMP_ENVMAP_ATI:
- /* this produces a fixed rgba color, and the coord calc is done elsewhere */
- for (i = 0; i < n; i++) {
- /* rgba result is 0,0,0,1 */
- rgba[i][RCOMP] = 0.0;
- rgba[i][GCOMP] = 0.0;
- rgba[i][BCOMP] = 0.0;
- rgba[i][ACOMP] = 1.0;
- }
- goto end; /* no alpha processing */
- default:
- _mesa_problem(ctx, "invalid combine mode");
- }
- }
-
- /* Alpha channel combine */
- {
- float4_array arg0 = argA[0];
- float4_array arg1 = argA[1];
- float4_array arg2 = argA[2];
- float4_array arg3 = argA[3];
-
- switch (combine->ModeA) {
- case GL_REPLACE:
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = arg0[i][ACOMP] * scaleA;
- }
- break;
- case GL_MODULATE:
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = arg0[i][ACOMP] * arg1[i][ACOMP] * scaleA;
- }
- break;
- case GL_ADD:
- if (textureUnit->EnvMode == GL_COMBINE4_NV) {
- /* (a * b) + (c * d) */
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] +
- arg2[i][ACOMP] * arg3[i][ACOMP]) * scaleA;
- }
- }
- else {
- /* two-term add */
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * scaleA;
- }
- }
- break;
- case GL_ADD_SIGNED:
- if (textureUnit->EnvMode == GL_COMBINE4_NV) {
- /* (a * b) + (c * d) - 0.5 */
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] +
- arg2[i][ACOMP] * arg3[i][ACOMP] -
- 0.5F) * scaleA;
- }
- }
- else {
- /* a + b - 0.5 */
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * scaleA;
- }
- }
- break;
- case GL_INTERPOLATE:
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (arg0[i][ACOMP] * arg2[i][ACOMP] +
- arg1[i][ACOMP] * (1.0F - arg2[i][ACOMP]))
- * scaleA;
- }
- break;
- case GL_SUBTRACT:
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (arg0[i][ACOMP] - arg1[i][ACOMP]) * scaleA;
- }
- break;
- case GL_MODULATE_ADD_ATI:
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP])
- + arg1[i][ACOMP]) * scaleA;
- }
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) +
- arg1[i][ACOMP] - 0.5F) * scaleA;
- }
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP])
- - arg1[i][ACOMP]) * scaleA;
- }
- break;
- default:
- _mesa_problem(ctx, "invalid combine mode");
- }
- }
-
- /* Fix the alpha component for GL_DOT3_RGBA_EXT/ARB combining.
- * This is kind of a kludge. It would have been better if the spec
- * were written such that the GL_COMBINE_ALPHA value could be set to
- * GL_DOT3.
- */
- if (combine->ModeRGB == GL_DOT3_RGBA_EXT ||
- combine->ModeRGB == GL_DOT3_RGBA) {
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = rgba[i][RCOMP];
- }
- }
-
- for (i = 0; i < n; i++) {
- UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][RCOMP], rgba[i][RCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][GCOMP], rgba[i][GCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][BCOMP], rgba[i][BCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][ACOMP], rgba[i][ACOMP]);
- }
-
-end:
- for (i = 0; i < numArgsRGB || i < numArgsA; i++) {
- free(ccolor[i]);
- }
- free(rgba);
-}
-
-
-/**
- * Apply X/Y/Z/W/0/1 swizzle to an array of colors/texels.
- * See GL_EXT_texture_swizzle.
- */
-static void
-swizzle_texels(GLuint swizzle, GLuint count, float4_array texels)
-{
- const GLuint swzR = GET_SWZ(swizzle, 0);
- const GLuint swzG = GET_SWZ(swizzle, 1);
- const GLuint swzB = GET_SWZ(swizzle, 2);
- const GLuint swzA = GET_SWZ(swizzle, 3);
- GLfloat vector[6];
- GLuint i;
-
- vector[SWIZZLE_ZERO] = 0;
- vector[SWIZZLE_ONE] = 1.0F;
-
- for (i = 0; i < count; i++) {
- vector[SWIZZLE_X] = texels[i][0];
- vector[SWIZZLE_Y] = texels[i][1];
- vector[SWIZZLE_Z] = texels[i][2];
- vector[SWIZZLE_W] = texels[i][3];
- texels[i][RCOMP] = vector[swzR];
- texels[i][GCOMP] = vector[swzG];
- texels[i][BCOMP] = vector[swzB];
- texels[i][ACOMP] = vector[swzA];
- }
-}
-
-
-/**
- * Apply texture mapping to a span of fragments.
- */
-void
-_swrast_texture_span( struct gl_context *ctx, SWspan *span )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- float4_array primary_rgba;
- GLuint unit;
-
- primary_rgba = (float4_array) malloc(span->end * 4 * sizeof(GLfloat));
-
- if (!primary_rgba) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_span");
- return;
- }
-
- ASSERT(span->end <= MAX_WIDTH);
-
- /*
- * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR)
- */
- if (swrast->_TextureCombinePrimary) {
- GLuint i;
- for (i = 0; i < span->end; i++) {
- primary_rgba[i][RCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]);
- primary_rgba[i][GCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][GCOMP]);
- primary_rgba[i][BCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][BCOMP]);
- primary_rgba[i][ACOMP] = CHAN_TO_FLOAT(span->array->rgba[i][ACOMP]);
- }
- }
-
- /* First must sample all bump maps */
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if (texUnit->_ReallyEnabled &&
- texUnit->_CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) {
- const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
- span->array->attribs[FRAG_ATTRIB_TEX0 + unit];
- float4_array targetcoords =
- span->array->attribs[FRAG_ATTRIB_TEX0 +
- ctx->Texture.Unit[unit].BumpTarget - GL_TEXTURE0];
-
- const struct gl_texture_object *curObj = texUnit->_Current;
- GLfloat *lambda = span->array->lambda[unit];
- float4_array texels = get_texel_array(swrast, unit);
- GLuint i;
- GLfloat rotMatrix00 = ctx->Texture.Unit[unit].RotMatrix[0];
- GLfloat rotMatrix01 = ctx->Texture.Unit[unit].RotMatrix[1];
- GLfloat rotMatrix10 = ctx->Texture.Unit[unit].RotMatrix[2];
- GLfloat rotMatrix11 = ctx->Texture.Unit[unit].RotMatrix[3];
-
- /* adjust texture lod (lambda) */
- if (span->arrayMask & SPAN_LAMBDA) {
- if (texUnit->LodBias + curObj->Sampler.LodBias != 0.0F) {
- /* apply LOD bias, but don't clamp yet */
- const GLfloat bias = CLAMP(texUnit->LodBias + curObj->Sampler.LodBias,
- -ctx->Const.MaxTextureLodBias,
- ctx->Const.MaxTextureLodBias);
- GLuint i;
- for (i = 0; i < span->end; i++) {
- lambda[i] += bias;
- }
- }
-
- if (curObj->Sampler.MinLod != -1000.0 ||
- curObj->Sampler.MaxLod != 1000.0) {
- /* apply LOD clamping to lambda */
- const GLfloat min = curObj->Sampler.MinLod;
- const GLfloat max = curObj->Sampler.MaxLod;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- GLfloat l = lambda[i];
- lambda[i] = CLAMP(l, min, max);
- }
- }
- }
-
- /* Sample the texture (span->end = number of fragments) */
- swrast->TextureSample[unit]( ctx, texUnit->_Current, span->end,
- texcoords, lambda, texels );
-
- /* manipulate the span values of the bump target
- not sure this can work correctly even ignoring
- the problem that channel is unsigned */
- for (i = 0; i < span->end; i++) {
- targetcoords[i][0] += (texels[i][0] * rotMatrix00 + texels[i][1] *
- rotMatrix01) / targetcoords[i][3];
- targetcoords[i][1] += (texels[i][0] * rotMatrix10 + texels[i][1] *
- rotMatrix11) / targetcoords[i][3];
- }
- }
- }
-
- /*
- * Must do all texture sampling before combining in order to
- * accomodate GL_ARB_texture_env_crossbar.
- */
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- if (texUnit->_ReallyEnabled &&
- texUnit->_CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) {
- const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
- span->array->attribs[FRAG_ATTRIB_TEX0 + unit];
- const struct gl_texture_object *curObj = texUnit->_Current;
- GLfloat *lambda = span->array->lambda[unit];
- float4_array texels = get_texel_array(swrast, unit);
-
- /* adjust texture lod (lambda) */
- if (span->arrayMask & SPAN_LAMBDA) {
- if (texUnit->LodBias + curObj->Sampler.LodBias != 0.0F) {
- /* apply LOD bias, but don't clamp yet */
- const GLfloat bias = CLAMP(texUnit->LodBias + curObj->Sampler.LodBias,
- -ctx->Const.MaxTextureLodBias,
- ctx->Const.MaxTextureLodBias);
- GLuint i;
- for (i = 0; i < span->end; i++) {
- lambda[i] += bias;
- }
- }
-
- if (curObj->Sampler.MinLod != -1000.0 ||
- curObj->Sampler.MaxLod != 1000.0) {
- /* apply LOD clamping to lambda */
- const GLfloat min = curObj->Sampler.MinLod;
- const GLfloat max = curObj->Sampler.MaxLod;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- GLfloat l = lambda[i];
- lambda[i] = CLAMP(l, min, max);
- }
- }
- }
- else if (curObj->Sampler.MaxAnisotropy > 1.0 &&
- curObj->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
- /* sample_lambda_2d_aniso is beeing used as texture_sample_func,
- * it requires the current SWspan *span as an additional parameter.
- * In order to keep the same function signature, the unused lambda
- * parameter will be modified to actually contain the SWspan pointer.
- * This is a Hack. To make it right, the texture_sample_func
- * signature and all implementing functions need to be modified.
- */
- /* "hide" SWspan struct; cast to (GLfloat *) to suppress warning */
- lambda = (GLfloat *)span;
- }
-
- /* Sample the texture (span->end = number of fragments) */
- swrast->TextureSample[unit]( ctx, texUnit->_Current, span->end,
- texcoords, lambda, texels );
-
- /* GL_EXT_texture_swizzle */
- if (curObj->_Swizzle != SWIZZLE_NOOP) {
- swizzle_texels(curObj->_Swizzle, span->end, texels);
- }
- }
- }
-
- /*
- * OK, now apply the texture (aka texture combine/blend).
- * We modify the span->color.rgba values.
- */
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- texture_combine( ctx, unit, span->end,
- primary_rgba,
- swrast->TexelBuffer,
- span->array->rgba );
- }
- }
-
- free(primary_rgba);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. 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.
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/pixeltransfer.h"
+#include "program/prog_instruction.h"
+
+#include "s_context.h"
+#include "s_texcombine.h"
+
+
+/**
+ * Pointer to array of float[4]
+ * This type makes the code below more concise and avoids a lot of casting.
+ */
+typedef float (*float4_array)[4];
+
+
+/**
+ * Return array of texels for given unit.
+ */
+static INLINE float4_array
+get_texel_array(SWcontext *swrast, GLuint unit)
+{
+#ifdef _OPENMP
+ return (float4_array) (swrast->TexelBuffer + unit * MAX_WIDTH * 4 * omp_get_num_threads() + (MAX_WIDTH * 4 * omp_get_thread_num()));
+#else
+ return (float4_array) (swrast->TexelBuffer + unit * MAX_WIDTH * 4);
+#endif
+}
+
+
+
+/**
+ * Do texture application for:
+ * GL_EXT_texture_env_combine
+ * GL_ARB_texture_env_combine
+ * GL_EXT_texture_env_dot3
+ * GL_ARB_texture_env_dot3
+ * GL_ATI_texture_env_combine3
+ * GL_NV_texture_env_combine4
+ * conventional GL texture env modes
+ *
+ * \param ctx rendering context
+ * \param unit the texture combiner unit
+ * \param n number of fragments to process (span width)
+ * \param primary_rgba incoming fragment color array
+ * \param texelBuffer pointer to texel colors for all texture units
+ *
+ * \param rgba incoming/result fragment colors
+ */
+static void
+texture_combine( struct gl_context *ctx, GLuint unit, GLuint n,
+ const float4_array primary_rgba,
+ const GLfloat *texelBuffer,
+ GLchan (*rgbaChan)[4] )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]);
+ const struct gl_tex_env_combine_state *combine = textureUnit->_CurrentCombine;
+ float4_array argRGB[MAX_COMBINER_TERMS];
+ float4_array argA[MAX_COMBINER_TERMS];
+ const GLfloat scaleRGB = (GLfloat) (1 << combine->ScaleShiftRGB);
+ const GLfloat scaleA = (GLfloat) (1 << combine->ScaleShiftA);
+ const GLuint numArgsRGB = combine->_NumArgsRGB;
+ const GLuint numArgsA = combine->_NumArgsA;
+ float4_array ccolor[4], rgba;
+ GLuint i, term;
+
+ /* alloc temp pixel buffers */
+ rgba = (float4_array) malloc(4 * n * sizeof(GLfloat));
+ if (!rgba) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine");
+ return;
+ }
+
+ for (i = 0; i < numArgsRGB || i < numArgsA; i++) {
+ ccolor[i] = (float4_array) malloc(4 * n * sizeof(GLfloat));
+ if (!ccolor[i]) {
+ while (i) {
+ free(ccolor[i]);
+ i--;
+ }
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine");
+ return;
+ }
+ }
+
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]);
+ rgba[i][GCOMP] = CHAN_TO_FLOAT(rgbaChan[i][GCOMP]);
+ rgba[i][BCOMP] = CHAN_TO_FLOAT(rgbaChan[i][BCOMP]);
+ rgba[i][ACOMP] = CHAN_TO_FLOAT(rgbaChan[i][ACOMP]);
+ }
+
+ /*
+ printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n",
+ combine->ModeRGB,
+ combine->ModeA,
+ combine->SourceRGB[0],
+ combine->SourceA[0],
+ combine->SourceRGB[1],
+ combine->SourceA[1]);
+ */
+
+ /*
+ * Do operand setup for up to 4 operands. Loop over the terms.
+ */
+ for (term = 0; term < numArgsRGB; term++) {
+ const GLenum srcRGB = combine->SourceRGB[term];
+ const GLenum operandRGB = combine->OperandRGB[term];
+
+ switch (srcRGB) {
+ case GL_TEXTURE:
+ argRGB[term] = get_texel_array(swrast, unit);
+ break;
+ case GL_PRIMARY_COLOR:
+ argRGB[term] = primary_rgba;
+ break;
+ case GL_PREVIOUS:
+ argRGB[term] = rgba;
+ break;
+ case GL_CONSTANT:
+ {
+ float4_array c = ccolor[term];
+ GLfloat red = textureUnit->EnvColor[0];
+ GLfloat green = textureUnit->EnvColor[1];
+ GLfloat blue = textureUnit->EnvColor[2];
+ GLfloat alpha = textureUnit->EnvColor[3];
+ for (i = 0; i < n; i++) {
+ ASSIGN_4V(c[i], red, green, blue, alpha);
+ }
+ argRGB[term] = ccolor[term];
+ }
+ break;
+ /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources.
+ */
+ case GL_ZERO:
+ {
+ float4_array c = ccolor[term];
+ for (i = 0; i < n; i++) {
+ ASSIGN_4V(c[i], 0.0F, 0.0F, 0.0F, 0.0F);
+ }
+ argRGB[term] = ccolor[term];
+ }
+ break;
+ case GL_ONE:
+ {
+ float4_array c = ccolor[term];
+ for (i = 0; i < n; i++) {
+ ASSIGN_4V(c[i], 1.0F, 1.0F, 1.0F, 1.0F);
+ }
+ argRGB[term] = ccolor[term];
+ }
+ break;
+ default:
+ /* ARB_texture_env_crossbar source */
+ {
+ const GLuint srcUnit = srcRGB - GL_TEXTURE0;
+ ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
+ if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
+ goto end;
+ argRGB[term] = get_texel_array(swrast, srcUnit);
+ }
+ }
+
+ if (operandRGB != GL_SRC_COLOR) {
+ float4_array src = argRGB[term];
+ float4_array dst = ccolor[term];
+
+ /* point to new arg[term] storage */
+ argRGB[term] = ccolor[term];
+
+ switch (operandRGB) {
+ case GL_ONE_MINUS_SRC_COLOR:
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = 1.0F - src[i][RCOMP];
+ dst[i][GCOMP] = 1.0F - src[i][GCOMP];
+ dst[i][BCOMP] = 1.0F - src[i][BCOMP];
+ }
+ break;
+ case GL_SRC_ALPHA:
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] =
+ dst[i][GCOMP] =
+ dst[i][BCOMP] = src[i][ACOMP];
+ }
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] =
+ dst[i][GCOMP] =
+ dst[i][BCOMP] = 1.0F - src[i][ACOMP];
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad operandRGB");
+ }
+ }
+ }
+
+ /*
+ * Set up the argA[term] pointers
+ */
+ for (term = 0; term < numArgsA; term++) {
+ const GLenum srcA = combine->SourceA[term];
+ const GLenum operandA = combine->OperandA[term];
+
+ switch (srcA) {
+ case GL_TEXTURE:
+ argA[term] = get_texel_array(swrast, unit);
+ break;
+ case GL_PRIMARY_COLOR:
+ argA[term] = primary_rgba;
+ break;
+ case GL_PREVIOUS:
+ argA[term] = rgba;
+ break;
+ case GL_CONSTANT:
+ {
+ float4_array c = ccolor[term];
+ GLfloat alpha = textureUnit->EnvColor[3];
+ for (i = 0; i < n; i++)
+ c[i][ACOMP] = alpha;
+ argA[term] = ccolor[term];
+ }
+ break;
+ /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources.
+ */
+ case GL_ZERO:
+ {
+ float4_array c = ccolor[term];
+ for (i = 0; i < n; i++)
+ c[i][ACOMP] = 0.0F;
+ argA[term] = ccolor[term];
+ }
+ break;
+ case GL_ONE:
+ {
+ float4_array c = ccolor[term];
+ for (i = 0; i < n; i++)
+ c[i][ACOMP] = 1.0F;
+ argA[term] = ccolor[term];
+ }
+ break;
+ default:
+ /* ARB_texture_env_crossbar source */
+ {
+ const GLuint srcUnit = srcA - GL_TEXTURE0;
+ ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
+ if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
+ goto end;
+ argA[term] = get_texel_array(swrast, srcUnit);
+ }
+ }
+
+ if (operandA == GL_ONE_MINUS_SRC_ALPHA) {
+ float4_array src = argA[term];
+ float4_array dst = ccolor[term];
+ argA[term] = ccolor[term];
+ for (i = 0; i < n; i++) {
+ dst[i][ACOMP] = 1.0F - src[i][ACOMP];
+ }
+ }
+ }
+
+ /* RGB channel combine */
+ {
+ float4_array arg0 = argRGB[0];
+ float4_array arg1 = argRGB[1];
+ float4_array arg2 = argRGB[2];
+ float4_array arg3 = argRGB[3];
+
+ switch (combine->ModeRGB) {
+ case GL_REPLACE:
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = arg0[i][RCOMP] * scaleRGB;
+ rgba[i][GCOMP] = arg0[i][GCOMP] * scaleRGB;
+ rgba[i][BCOMP] = arg0[i][BCOMP] * scaleRGB;
+ }
+ break;
+ case GL_MODULATE:
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = arg0[i][RCOMP] * arg1[i][RCOMP] * scaleRGB;
+ rgba[i][GCOMP] = arg0[i][GCOMP] * arg1[i][GCOMP] * scaleRGB;
+ rgba[i][BCOMP] = arg0[i][BCOMP] * arg1[i][BCOMP] * scaleRGB;
+ }
+ break;
+ case GL_ADD:
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) */
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] +
+ arg2[i][RCOMP] * arg3[i][RCOMP]) * scaleRGB;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] +
+ arg2[i][GCOMP] * arg3[i][GCOMP]) * scaleRGB;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] +
+ arg2[i][BCOMP] * arg3[i][BCOMP]) * scaleRGB;
+ }
+ }
+ else {
+ /* 2-term addition */
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP]) * scaleRGB;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP]) * scaleRGB;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP]) * scaleRGB;
+ }
+ }
+ break;
+ case GL_ADD_SIGNED:
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) - 0.5 */
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] +
+ arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5F) * scaleRGB;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] +
+ arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5F) * scaleRGB;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] +
+ arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5F) * scaleRGB;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5F) * scaleRGB;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5F) * scaleRGB;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5F) * scaleRGB;
+ }
+ }
+ break;
+ case GL_INTERPOLATE:
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = (arg0[i][RCOMP] * arg2[i][RCOMP] +
+ arg1[i][RCOMP] * (1.0F - arg2[i][RCOMP])) * scaleRGB;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] * arg2[i][GCOMP] +
+ arg1[i][GCOMP] * (1.0F - arg2[i][GCOMP])) * scaleRGB;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] * arg2[i][BCOMP] +
+ arg1[i][BCOMP] * (1.0F - arg2[i][BCOMP])) * scaleRGB;
+ }
+ break;
+ case GL_SUBTRACT:
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = (arg0[i][RCOMP] - arg1[i][RCOMP]) * scaleRGB;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] - arg1[i][GCOMP]) * scaleRGB;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] - arg1[i][BCOMP]) * scaleRGB;
+ }
+ break;
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ /* Do not scale the result by 1 2 or 4 */
+ for (i = 0; i < n; i++) {
+ GLfloat dot = ((arg0[i][RCOMP] - 0.5F) * (arg1[i][RCOMP] - 0.5F) +
+ (arg0[i][GCOMP] - 0.5F) * (arg1[i][GCOMP] - 0.5F) +
+ (arg0[i][BCOMP] - 0.5F) * (arg1[i][BCOMP] - 0.5F))
+ * 4.0F;
+ dot = CLAMP(dot, 0.0F, 1.0F);
+ rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = dot;
+ }
+ break;
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ /* DO scale the result by 1 2 or 4 */
+ for (i = 0; i < n; i++) {
+ GLfloat dot = ((arg0[i][RCOMP] - 0.5F) * (arg1[i][RCOMP] - 0.5F) +
+ (arg0[i][GCOMP] - 0.5F) * (arg1[i][GCOMP] - 0.5F) +
+ (arg0[i][BCOMP] - 0.5F) * (arg1[i][BCOMP] - 0.5F))
+ * 4.0F * scaleRGB;
+ dot = CLAMP(dot, 0.0F, 1.0F);
+ rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = dot;
+ }
+ break;
+ case GL_MODULATE_ADD_ATI:
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) +
+ arg1[i][RCOMP]) * scaleRGB;
+ rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) +
+ arg1[i][GCOMP]) * scaleRGB;
+ rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) +
+ arg1[i][BCOMP]) * scaleRGB;
+ }
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) +
+ arg1[i][RCOMP] - 0.5F) * scaleRGB;
+ rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) +
+ arg1[i][GCOMP] - 0.5F) * scaleRGB;
+ rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) +
+ arg1[i][BCOMP] - 0.5F) * scaleRGB;
+ }
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) -
+ arg1[i][RCOMP]) * scaleRGB;
+ rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) -
+ arg1[i][GCOMP]) * scaleRGB;
+ rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) -
+ arg1[i][BCOMP]) * scaleRGB;
+ }
+ break;
+ case GL_BUMP_ENVMAP_ATI:
+ /* this produces a fixed rgba color, and the coord calc is done elsewhere */
+ for (i = 0; i < n; i++) {
+ /* rgba result is 0,0,0,1 */
+ rgba[i][RCOMP] = 0.0;
+ rgba[i][GCOMP] = 0.0;
+ rgba[i][BCOMP] = 0.0;
+ rgba[i][ACOMP] = 1.0;
+ }
+ goto end; /* no alpha processing */
+ default:
+ _mesa_problem(ctx, "invalid combine mode");
+ }
+ }
+
+ /* Alpha channel combine */
+ {
+ float4_array arg0 = argA[0];
+ float4_array arg1 = argA[1];
+ float4_array arg2 = argA[2];
+ float4_array arg3 = argA[3];
+
+ switch (combine->ModeA) {
+ case GL_REPLACE:
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = arg0[i][ACOMP] * scaleA;
+ }
+ break;
+ case GL_MODULATE:
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = arg0[i][ACOMP] * arg1[i][ACOMP] * scaleA;
+ }
+ break;
+ case GL_ADD:
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) */
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] +
+ arg2[i][ACOMP] * arg3[i][ACOMP]) * scaleA;
+ }
+ }
+ else {
+ /* two-term add */
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * scaleA;
+ }
+ }
+ break;
+ case GL_ADD_SIGNED:
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) - 0.5 */
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] +
+ arg2[i][ACOMP] * arg3[i][ACOMP] -
+ 0.5F) * scaleA;
+ }
+ }
+ else {
+ /* a + b - 0.5 */
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * scaleA;
+ }
+ }
+ break;
+ case GL_INTERPOLATE:
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = (arg0[i][ACOMP] * arg2[i][ACOMP] +
+ arg1[i][ACOMP] * (1.0F - arg2[i][ACOMP]))
+ * scaleA;
+ }
+ break;
+ case GL_SUBTRACT:
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = (arg0[i][ACOMP] - arg1[i][ACOMP]) * scaleA;
+ }
+ break;
+ case GL_MODULATE_ADD_ATI:
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP])
+ + arg1[i][ACOMP]) * scaleA;
+ }
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) +
+ arg1[i][ACOMP] - 0.5F) * scaleA;
+ }
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP])
+ - arg1[i][ACOMP]) * scaleA;
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "invalid combine mode");
+ }
+ }
+
+ /* Fix the alpha component for GL_DOT3_RGBA_EXT/ARB combining.
+ * This is kind of a kludge. It would have been better if the spec
+ * were written such that the GL_COMBINE_ALPHA value could be set to
+ * GL_DOT3.
+ */
+ if (combine->ModeRGB == GL_DOT3_RGBA_EXT ||
+ combine->ModeRGB == GL_DOT3_RGBA) {
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = rgba[i][RCOMP];
+ }
+ }
+
+ for (i = 0; i < n; i++) {
+ UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][RCOMP], rgba[i][RCOMP]);
+ UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][GCOMP], rgba[i][GCOMP]);
+ UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][BCOMP], rgba[i][BCOMP]);
+ UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][ACOMP], rgba[i][ACOMP]);
+ }
+
+end:
+ for (i = 0; i < numArgsRGB || i < numArgsA; i++) {
+ free(ccolor[i]);
+ }
+ free(rgba);
+}
+
+
+/**
+ * Apply X/Y/Z/W/0/1 swizzle to an array of colors/texels.
+ * See GL_EXT_texture_swizzle.
+ */
+static void
+swizzle_texels(GLuint swizzle, GLuint count, float4_array texels)
+{
+ const GLuint swzR = GET_SWZ(swizzle, 0);
+ const GLuint swzG = GET_SWZ(swizzle, 1);
+ const GLuint swzB = GET_SWZ(swizzle, 2);
+ const GLuint swzA = GET_SWZ(swizzle, 3);
+ GLfloat vector[6];
+ GLuint i;
+
+ vector[SWIZZLE_ZERO] = 0;
+ vector[SWIZZLE_ONE] = 1.0F;
+
+ for (i = 0; i < count; i++) {
+ vector[SWIZZLE_X] = texels[i][0];
+ vector[SWIZZLE_Y] = texels[i][1];
+ vector[SWIZZLE_Z] = texels[i][2];
+ vector[SWIZZLE_W] = texels[i][3];
+ texels[i][RCOMP] = vector[swzR];
+ texels[i][GCOMP] = vector[swzG];
+ texels[i][BCOMP] = vector[swzB];
+ texels[i][ACOMP] = vector[swzA];
+ }
+}
+
+
+/**
+ * Apply texture mapping to a span of fragments.
+ */
+void
+_swrast_texture_span( struct gl_context *ctx, SWspan *span )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ float4_array primary_rgba;
+ GLuint unit;
+
+ primary_rgba = (float4_array) malloc(span->end * 4 * sizeof(GLfloat));
+
+ if (!primary_rgba) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_span");
+ return;
+ }
+
+ ASSERT(span->end <= MAX_WIDTH);
+
+ /*
+ * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR)
+ */
+ if (swrast->_TextureCombinePrimary) {
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ primary_rgba[i][RCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]);
+ primary_rgba[i][GCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][GCOMP]);
+ primary_rgba[i][BCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][BCOMP]);
+ primary_rgba[i][ACOMP] = CHAN_TO_FLOAT(span->array->rgba[i][ACOMP]);
+ }
+ }
+
+ /* First must sample all bump maps */
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+
+ if (texUnit->_ReallyEnabled &&
+ texUnit->_CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) {
+ const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
+ span->array->attribs[FRAG_ATTRIB_TEX0 + unit];
+ float4_array targetcoords =
+ span->array->attribs[FRAG_ATTRIB_TEX0 +
+ ctx->Texture.Unit[unit].BumpTarget - GL_TEXTURE0];
+
+ const struct gl_texture_object *curObj = texUnit->_Current;
+ GLfloat *lambda = span->array->lambda[unit];
+ float4_array texels = get_texel_array(swrast, unit);
+ GLuint i;
+ GLfloat rotMatrix00 = ctx->Texture.Unit[unit].RotMatrix[0];
+ GLfloat rotMatrix01 = ctx->Texture.Unit[unit].RotMatrix[1];
+ GLfloat rotMatrix10 = ctx->Texture.Unit[unit].RotMatrix[2];
+ GLfloat rotMatrix11 = ctx->Texture.Unit[unit].RotMatrix[3];
+
+ /* adjust texture lod (lambda) */
+ if (span->arrayMask & SPAN_LAMBDA) {
+ if (texUnit->LodBias + curObj->Sampler.LodBias != 0.0F) {
+ /* apply LOD bias, but don't clamp yet */
+ const GLfloat bias = CLAMP(texUnit->LodBias + curObj->Sampler.LodBias,
+ -ctx->Const.MaxTextureLodBias,
+ ctx->Const.MaxTextureLodBias);
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ lambda[i] += bias;
+ }
+ }
+
+ if (curObj->Sampler.MinLod != -1000.0 ||
+ curObj->Sampler.MaxLod != 1000.0) {
+ /* apply LOD clamping to lambda */
+ const GLfloat min = curObj->Sampler.MinLod;
+ const GLfloat max = curObj->Sampler.MaxLod;
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ GLfloat l = lambda[i];
+ lambda[i] = CLAMP(l, min, max);
+ }
+ }
+ }
+
+ /* Sample the texture (span->end = number of fragments) */
+ swrast->TextureSample[unit]( ctx, texUnit->_Current, span->end,
+ texcoords, lambda, texels );
+
+ /* manipulate the span values of the bump target
+ not sure this can work correctly even ignoring
+ the problem that channel is unsigned */
+ for (i = 0; i < span->end; i++) {
+ targetcoords[i][0] += (texels[i][0] * rotMatrix00 + texels[i][1] *
+ rotMatrix01) / targetcoords[i][3];
+ targetcoords[i][1] += (texels[i][0] * rotMatrix10 + texels[i][1] *
+ rotMatrix11) / targetcoords[i][3];
+ }
+ }
+ }
+
+ /*
+ * Must do all texture sampling before combining in order to
+ * accomodate GL_ARB_texture_env_crossbar.
+ */
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ if (texUnit->_ReallyEnabled &&
+ texUnit->_CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) {
+ const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
+ span->array->attribs[FRAG_ATTRIB_TEX0 + unit];
+ const struct gl_texture_object *curObj = texUnit->_Current;
+ GLfloat *lambda = span->array->lambda[unit];
+ float4_array texels = get_texel_array(swrast, unit);
+
+ /* adjust texture lod (lambda) */
+ if (span->arrayMask & SPAN_LAMBDA) {
+ if (texUnit->LodBias + curObj->Sampler.LodBias != 0.0F) {
+ /* apply LOD bias, but don't clamp yet */
+ const GLfloat bias = CLAMP(texUnit->LodBias + curObj->Sampler.LodBias,
+ -ctx->Const.MaxTextureLodBias,
+ ctx->Const.MaxTextureLodBias);
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ lambda[i] += bias;
+ }
+ }
+
+ if (curObj->Sampler.MinLod != -1000.0 ||
+ curObj->Sampler.MaxLod != 1000.0) {
+ /* apply LOD clamping to lambda */
+ const GLfloat min = curObj->Sampler.MinLod;
+ const GLfloat max = curObj->Sampler.MaxLod;
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ GLfloat l = lambda[i];
+ lambda[i] = CLAMP(l, min, max);
+ }
+ }
+ }
+ else if (curObj->Sampler.MaxAnisotropy > 1.0 &&
+ curObj->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
+ /* sample_lambda_2d_aniso is beeing used as texture_sample_func,
+ * it requires the current SWspan *span as an additional parameter.
+ * In order to keep the same function signature, the unused lambda
+ * parameter will be modified to actually contain the SWspan pointer.
+ * This is a Hack. To make it right, the texture_sample_func
+ * signature and all implementing functions need to be modified.
+ */
+ /* "hide" SWspan struct; cast to (GLfloat *) to suppress warning */
+ lambda = (GLfloat *)span;
+ }
+
+ /* Sample the texture (span->end = number of fragments) */
+ swrast->TextureSample[unit]( ctx, texUnit->_Current, span->end,
+ texcoords, lambda, texels );
+
+ /* GL_EXT_texture_swizzle */
+ if (curObj->_Swizzle != SWIZZLE_NOOP) {
+ swizzle_texels(curObj->_Swizzle, span->end, texels);
+ }
+ }
+ }
+
+ /*
+ * OK, now apply the texture (aka texture combine/blend).
+ * We modify the span->color.rgba values.
+ */
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ if (ctx->Texture.Unit[unit]._ReallyEnabled) {
+ texture_combine( ctx, unit, span->end,
+ primary_rgba,
+ swrast->TexelBuffer,
+ span->array->rgba );
+ }
+ }
+
+ free(primary_rgba);
+}
diff --git a/mesalib/src/mesa/tnl/NOTES b/mesalib/src/mesa/tnl/NOTES
index 9a35e948b..43c469201 100644
--- a/mesalib/src/mesa/tnl/NOTES
+++ b/mesalib/src/mesa/tnl/NOTES
@@ -1,102 +1,100 @@
-INTRODUCTION
-
-A generic, configurable software implementation of GL transformation &
-lighting.
-
-This module provides an implementation of the routines required by the
-'vtxfmt' mechanism of core mesa for tnl functionality in all
-combinations of compile and execute modes.
-
-Most current drivers use the tnl module exclusively to provide this
-functionality, though there is an experimental alternate
-implementation provided by the tnl_dd/t_dd_imm_* files which can
-handle a small subset of GL states in execute mode only.
-
-
-STATE
-
-To create and destroy the module:
-
- GLboolean _tnl_CreateContext( struct gl_context *ctx );
- void _tnl_DestroyContext( struct gl_context *ctx );
-
-The module is not active by default, and must be installed by calling
-_tnl_Wakeup(). This function installs internal tnl functions into all
-the vtxfmt dispatch hooks, thus taking over the task of transformation
-and lighting entirely:
-
- void _tnl_wakeup_exec( struct gl_context *ctx );
- void _tnl_wakeup_save_exec( struct gl_context *ctx );
-
-
-This module tracks state changes internally and maintains derived
-values based on the current state. For this to work, the driver
-ensure the following funciton is called whenever the state changes and
-the swsetup module is 'awake':
-
- void _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state );
-
-There is no explicit call to put the tnl module to sleep. Simply
-install other function pointers into all the vtxfmt dispatch slots,
-and (optionally) cease calling _tnl_InvalidateState().
-
-CUSTOMIZATION
-
-The module provides customizability through several mechanisms. The
-most important is by allowing drivers to specify the pipeline through
-which vertex data is passed, including its eventual transfer to
-rasterization hardware (or software).
-
-The default pipeline is specified in t_pipeline.c, and is usually a
-starting point for driver pipelines. Some drivers will remove a stage
-where hardware provides support for the implemented operation (for
-instance fog where per-pixel hardware fog is available, as in the dri
-tdfx driver), or add stages to shortcircuit latter operations (for
-example taking advantage of hardware support for strips and other
-higher-level primitives (for example the radeon driver).
-
-In addition, the following functions provide further tweaks:
-
-extern void
-_tnl_need_projected_coords( struct gl_context *ctx, GLboolean flag );
-
- - Direct the default vertex transformation stage to
- produce/not produce projected clip coordinates.
-
-extern void
-_tnl_need_dlist_loopback( struct gl_context *ctx, GLboolean flag );
-
- - Direct the display list component of the tnl module to
- replay display lists as 'glVertex' type calls, rather than
- passing the display list data directly into the tnl pipeline
- mechanism.
-
- This allows display lists to be replayed by the tnl module
- even when the module is not strictly active.
-
-
-extern void
-_tnl_need_dlist_norm_lengths( struct gl_context *ctx, GLboolean flag );
-
- - Direct the display list component to enable/disable caching
- 1/length values for display list normals. Doing so is
- ususally helpful when lighting is performed in software, but
- wasteful otherwise.
-
-
-DRIVER INTERFACE
-
-The module itself offers a minimal driver interface:
-
- void (*RunPipeline)( struct gl_context *ctx );
-
-Normally this is set to _tnl_RunPipeline(), however the driver can use
-this hook to wrap checks or other code around this call.
-
-In addition, the driver interface for the default render pipeline
-stage is housed in the tnl context struct (this could be cleaner).
-
-
-RENDER DRIVER INTERFACE
-
+INTRODUCTION
+
+A generic, configurable software implementation of GL transformation &
+lighting.
+
+This module provides an implementation of the routines required by the
+'vtxfmt' mechanism of core mesa for tnl functionality in all
+combinations of compile and execute modes.
+
+Most current drivers use the tnl module exclusively to provide this
+functionality.
+
+
+STATE
+
+To create and destroy the module:
+
+ GLboolean _tnl_CreateContext( struct gl_context *ctx );
+ void _tnl_DestroyContext( struct gl_context *ctx );
+
+The module is not active by default, and must be installed by calling
+_tnl_Wakeup(). This function installs internal tnl functions into all
+the vtxfmt dispatch hooks, thus taking over the task of transformation
+and lighting entirely:
+
+ void _tnl_wakeup_exec( struct gl_context *ctx );
+ void _tnl_wakeup_save_exec( struct gl_context *ctx );
+
+
+This module tracks state changes internally and maintains derived
+values based on the current state. For this to work, the driver
+ensure the following funciton is called whenever the state changes and
+the swsetup module is 'awake':
+
+ void _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state );
+
+There is no explicit call to put the tnl module to sleep. Simply
+install other function pointers into all the vtxfmt dispatch slots,
+and (optionally) cease calling _tnl_InvalidateState().
+
+CUSTOMIZATION
+
+The module provides customizability through several mechanisms. The
+most important is by allowing drivers to specify the pipeline through
+which vertex data is passed, including its eventual transfer to
+rasterization hardware (or software).
+
+The default pipeline is specified in t_pipeline.c, and is usually a
+starting point for driver pipelines. Some drivers will remove a stage
+where hardware provides support for the implemented operation (for
+instance fog where per-pixel hardware fog is available),
+or add stages to shortcircuit latter operations (for
+example taking advantage of hardware support for strips and other
+higher-level primitives (for example the radeon driver).
+
+In addition, the following functions provide further tweaks:
+
+extern void
+_tnl_need_projected_coords( struct gl_context *ctx, GLboolean flag );
+
+ - Direct the default vertex transformation stage to
+ produce/not produce projected clip coordinates.
+
+extern void
+_tnl_need_dlist_loopback( struct gl_context *ctx, GLboolean flag );
+
+ - Direct the display list component of the tnl module to
+ replay display lists as 'glVertex' type calls, rather than
+ passing the display list data directly into the tnl pipeline
+ mechanism.
+
+ This allows display lists to be replayed by the tnl module
+ even when the module is not strictly active.
+
+
+extern void
+_tnl_need_dlist_norm_lengths( struct gl_context *ctx, GLboolean flag );
+
+ - Direct the display list component to enable/disable caching
+ 1/length values for display list normals. Doing so is
+ ususally helpful when lighting is performed in software, but
+ wasteful otherwise.
+
+
+DRIVER INTERFACE
+
+The module itself offers a minimal driver interface:
+
+ void (*RunPipeline)( struct gl_context *ctx );
+
+Normally this is set to _tnl_RunPipeline(), however the driver can use
+this hook to wrap checks or other code around this call.
+
+In addition, the driver interface for the default render pipeline
+stage is housed in the tnl context struct (this could be cleaner).
+
+
+RENDER DRIVER INTERFACE
+
See t_context.h for the definition and explanation of this. \ No newline at end of file
diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c
index b1967e654..86af4b7cf 100644
--- a/mesalib/src/mesa/tnl/t_draw.c
+++ b/mesalib/src/mesa/tnl/t_draw.c
@@ -280,10 +280,9 @@ static void bind_inputs( struct gl_context *ctx,
if (!inputs[i]->BufferObj->Pointer) {
bo[*nr_bo] = inputs[i]->BufferObj;
(*nr_bo)++;
- ctx->Driver.MapBuffer(ctx,
- GL_ARRAY_BUFFER,
- GL_READ_ONLY_ARB,
- inputs[i]->BufferObj);
+ ctx->Driver.MapBufferRange(ctx, 0, inputs[i]->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ inputs[i]->BufferObj);
assert(inputs[i]->BufferObj->Pointer);
}
@@ -348,18 +347,32 @@ static void bind_indices( struct gl_context *ctx,
}
if (ib->obj->Name && !ib->obj->Pointer) {
+ unsigned map_size;
+
+ switch (ib->type) {
+ case GL_UNSIGNED_BYTE:
+ map_size = ib->count * sizeof(GLubyte);
+ break;
+ case GL_UNSIGNED_SHORT:
+ map_size = ib->count * sizeof(GLushort);
+ break;
+ case GL_UNSIGNED_INT:
+ map_size = ib->count * sizeof(GLuint);
+ break;
+ default:
+ assert(0);
+ map_size = 0;
+ }
+
bo[*nr_bo] = ib->obj;
(*nr_bo)++;
- ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER,
- GL_READ_ONLY_ARB,
- ib->obj);
-
+ ptr = ctx->Driver.MapBufferRange(ctx, (GLsizeiptr) ib->ptr, map_size,
+ GL_MAP_READ_BIT, ib->obj);
assert(ib->obj->Pointer);
+ } else {
+ ptr = ib->ptr;
}
- ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr);
-
if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) {
VB->Elts = (GLuint *) ptr;
}
@@ -402,9 +415,7 @@ static void unmap_vbos( struct gl_context *ctx,
{
GLuint i;
for (i = 0; i < nr_bo; i++) {
- ctx->Driver.UnmapBuffer(ctx,
- 0, /* target -- I don't see why this would be needed */
- bo[i]);
+ ctx->Driver.UnmapBuffer(ctx, bo[i]);
}
}
diff --git a/mesalib/src/mesa/tnl/t_pipeline.c b/mesalib/src/mesa/tnl/t_pipeline.c
index 27d7ecff7..881d5d5f5 100644
--- a/mesalib/src/mesa/tnl/t_pipeline.c
+++ b/mesalib/src/mesa/tnl/t_pipeline.c
@@ -1,210 +1,222 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 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.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/imports.h"
-#include "main/mtypes.h"
-
-#include "t_context.h"
-#include "t_pipeline.h"
-#include "t_vp_build.h"
-#include "t_vertex.h"
-
-void _tnl_install_pipeline( struct gl_context *ctx,
- const struct tnl_pipeline_stage **stages )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint i;
-
- tnl->pipeline.new_state = ~0;
-
- /* Create a writeable copy of each stage.
- */
- for (i = 0 ; i < MAX_PIPELINE_STAGES && stages[i] ; i++) {
- struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
- memcpy(s, stages[i], sizeof(*s));
- if (s->create)
- s->create(ctx, s);
- }
-
- tnl->pipeline.nr_stages = i;
-}
-
-void _tnl_destroy_pipeline( struct gl_context *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint i;
-
- for (i = 0 ; i < tnl->pipeline.nr_stages ; i++) {
- struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
- if (s->destroy)
- s->destroy(s);
- }
-
- tnl->pipeline.nr_stages = 0;
-}
-
-
-
-static GLuint check_input_changes( struct gl_context *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint i;
-
- for (i = 0; i <= _TNL_LAST_MAT; i++) {
- if (tnl->vb.AttribPtr[i]->size != tnl->pipeline.last_attrib_size[i] ||
- tnl->vb.AttribPtr[i]->stride != tnl->pipeline.last_attrib_stride[i]) {
- tnl->pipeline.last_attrib_size[i] = tnl->vb.AttribPtr[i]->size;
- tnl->pipeline.last_attrib_stride[i] = tnl->vb.AttribPtr[i]->stride;
- tnl->pipeline.input_changes |= 1<<i;
- }
- }
-
- return tnl->pipeline.input_changes;
-}
-
-
-static GLuint check_output_changes( struct gl_context *ctx )
-{
-#if 0
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- for (i = 0; i < VERT_RESULT_MAX; i++) {
- if (tnl->vb.ResultPtr[i]->size != tnl->last_result_size[i] ||
- tnl->vb.ResultPtr[i]->stride != tnl->last_result_stride[i]) {
- tnl->last_result_size[i] = tnl->vb.ResultPtr[i]->size;
- tnl->last_result_stride[i] = tnl->vb.ResultPtr[i]->stride;
- tnl->pipeline.output_changes |= 1<<i;
- }
- }
-
- if (tnl->pipeline.output_changes)
- tnl->Driver.NotifyOutputChanges( ctx, tnl->pipeline.output_changes );
-
- return tnl->pipeline.output_changes;
-#else
- return ~0;
-#endif
-}
-
-
-void _tnl_run_pipeline( struct gl_context *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- unsigned short __tmp;
- GLuint i;
-
- if (!tnl->vb.Count)
- return;
-
- /* Check for changed input sizes or change in stride to/from zero
- * (ie const or non-const).
- */
- if (check_input_changes( ctx ) || tnl->pipeline.new_state) {
- if (ctx->VertexProgram._MaintainTnlProgram)
- _tnl_UpdateFixedFunctionProgram( ctx );
-
- for (i = 0; i < tnl->pipeline.nr_stages ; i++) {
- struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
- if (s->validate)
- s->validate( ctx, s );
- }
-
- tnl->pipeline.new_state = 0;
- tnl->pipeline.input_changes = 0;
-
- /* Pipeline can only change its output in response to either a
- * statechange or an input size/stride change. No other changes
- * are allowed.
- */
- if (check_output_changes( ctx ))
- _tnl_notify_pipeline_output_change( ctx );
- }
-
- START_FAST_MATH(__tmp);
-
- for (i = 0; i < tnl->pipeline.nr_stages ; i++) {
- struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
- if (!s->run( ctx, s ))
- break;
- }
-
- END_FAST_MATH(__tmp);
-}
-
-
-
-/* The default pipeline. This is useful for software rasterizers, and
- * simple hardware rasterizers. For customization, I don't recommend
- * tampering with the internals of these stages in the way that
- * drivers did in Mesa 3.4. These stages are basically black boxes,
- * and should be left intact.
- *
- * To customize the pipeline, consider:
- *
- * - removing redundant stages (making sure that the software rasterizer
- * can cope with this on fallback paths). An example is fog
- * coordinate generation, which is not required in the FX driver.
- *
- * - replacing general-purpose machine-independent stages with
- * general-purpose machine-specific stages. There is no example of
- * this to date, though it must be borne in mind that all subsequent
- * stages that reference the output of the new stage must cope with
- * any machine-specific data introduced. This may not be easy
- * unless there are no such stages (ie the new stage is the last in
- * the pipe).
- *
- * - inserting optimized (but specialized) stages ahead of the
- * general-purpose fallback implementation. For example, the old
- * fastpath mechanism, which only works when the VB->Elts input is
- * available, can be duplicated by placing the fastpath stage at the
- * head of this pipeline. Such specialized stages are currently
- * constrained to have no outputs (ie. they must either finish the *
- * pipeline by returning GL_FALSE from run(), or do nothing).
- *
- * Some work can be done to lift some of the restrictions in the final
- * case, if it becomes necessary to do so.
- */
-const struct tnl_pipeline_stage *_tnl_default_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
- &_tnl_vertex_program_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_render_stage,
- NULL
-};
-
-const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = {
- &_tnl_vertex_program_stage,
- &_tnl_render_stage,
- NULL
-};
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 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.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+
+#include "t_context.h"
+#include "t_pipeline.h"
+#include "t_vp_build.h"
+#include "t_vertex.h"
+
+void _tnl_install_pipeline( struct gl_context *ctx,
+ const struct tnl_pipeline_stage **stages )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ tnl->pipeline.new_state = ~0;
+
+ /* Create a writeable copy of each stage.
+ */
+ for (i = 0 ; i < MAX_PIPELINE_STAGES && stages[i] ; i++) {
+ struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
+ memcpy(s, stages[i], sizeof(*s));
+ if (s->create)
+ s->create(ctx, s);
+ }
+
+ tnl->pipeline.nr_stages = i;
+}
+
+void _tnl_destroy_pipeline( struct gl_context *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ for (i = 0 ; i < tnl->pipeline.nr_stages ; i++) {
+ struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
+ if (s->destroy)
+ s->destroy(s);
+ }
+
+ tnl->pipeline.nr_stages = 0;
+}
+
+
+
+static GLuint check_input_changes( struct gl_context *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ for (i = 0; i <= _TNL_LAST_MAT; i++) {
+ if (tnl->vb.AttribPtr[i]->size != tnl->pipeline.last_attrib_size[i] ||
+ tnl->vb.AttribPtr[i]->stride != tnl->pipeline.last_attrib_stride[i]) {
+ tnl->pipeline.last_attrib_size[i] = tnl->vb.AttribPtr[i]->size;
+ tnl->pipeline.last_attrib_stride[i] = tnl->vb.AttribPtr[i]->stride;
+ tnl->pipeline.input_changes |= 1<<i;
+ }
+ }
+
+ return tnl->pipeline.input_changes;
+}
+
+
+static GLuint check_output_changes( struct gl_context *ctx )
+{
+#if 0
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ for (i = 0; i < VERT_RESULT_MAX; i++) {
+ if (tnl->vb.ResultPtr[i]->size != tnl->last_result_size[i] ||
+ tnl->vb.ResultPtr[i]->stride != tnl->last_result_stride[i]) {
+ tnl->last_result_size[i] = tnl->vb.ResultPtr[i]->size;
+ tnl->last_result_stride[i] = tnl->vb.ResultPtr[i]->stride;
+ tnl->pipeline.output_changes |= 1<<i;
+ }
+ }
+
+ if (tnl->pipeline.output_changes)
+ tnl->Driver.NotifyOutputChanges( ctx, tnl->pipeline.output_changes );
+
+ return tnl->pipeline.output_changes;
+#else
+ return ~0;
+#endif
+}
+
+
+void _tnl_run_pipeline( struct gl_context *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ unsigned short __tmp;
+ GLuint i;
+
+ if (!tnl->vb.Count)
+ return;
+
+ /* Check for changed input sizes or change in stride to/from zero
+ * (ie const or non-const).
+ */
+ if (check_input_changes( ctx ) || tnl->pipeline.new_state) {
+ if (ctx->VertexProgram._MaintainTnlProgram)
+ _tnl_UpdateFixedFunctionProgram( ctx );
+
+ for (i = 0; i < tnl->pipeline.nr_stages ; i++) {
+ struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
+ if (s->validate)
+ s->validate( ctx, s );
+ }
+
+ tnl->pipeline.new_state = 0;
+ tnl->pipeline.input_changes = 0;
+
+ /* Pipeline can only change its output in response to either a
+ * statechange or an input size/stride change. No other changes
+ * are allowed.
+ */
+ if (check_output_changes( ctx ))
+ _tnl_notify_pipeline_output_change( ctx );
+ }
+
+#ifndef _OPENMP
+ /* Don't adjust FPU precision mode in case multiple threads are to be used.
+ * This would require that the additional threads also changed the FPU mode
+ * which is quite a mess as this had to be done in all parallelized sections;
+ * otherwise the master thread and all other threads are running in different
+ * modes, producing inconsistent results.
+ * Note that all x64 implementations don't define/use START_FAST_MATH, so
+ * this is "hack" is only used in i386 mode
+ */
+ START_FAST_MATH(__tmp);
+#endif
+
+ for (i = 0; i < tnl->pipeline.nr_stages ; i++) {
+ struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i];
+ if (!s->run( ctx, s ))
+ break;
+ }
+
+#ifndef _OPENMP
+ END_FAST_MATH(__tmp);
+#endif
+}
+
+
+
+/* The default pipeline. This is useful for software rasterizers, and
+ * simple hardware rasterizers. For customization, I don't recommend
+ * tampering with the internals of these stages in the way that
+ * drivers did in Mesa 3.4. These stages are basically black boxes,
+ * and should be left intact.
+ *
+ * To customize the pipeline, consider:
+ *
+ * - removing redundant stages (making sure that the software rasterizer
+ * can cope with this on fallback paths). An example is fog
+ * coordinate generation, which is not required in the FX driver.
+ *
+ * - replacing general-purpose machine-independent stages with
+ * general-purpose machine-specific stages. There is no example of
+ * this to date, though it must be borne in mind that all subsequent
+ * stages that reference the output of the new stage must cope with
+ * any machine-specific data introduced. This may not be easy
+ * unless there are no such stages (ie the new stage is the last in
+ * the pipe).
+ *
+ * - inserting optimized (but specialized) stages ahead of the
+ * general-purpose fallback implementation. For example, the old
+ * fastpath mechanism, which only works when the VB->Elts input is
+ * available, can be duplicated by placing the fastpath stage at the
+ * head of this pipeline. Such specialized stages are currently
+ * constrained to have no outputs (ie. they must either finish the *
+ * pipeline by returning GL_FALSE from run(), or do nothing).
+ *
+ * Some work can be done to lift some of the restrictions in the final
+ * case, if it becomes necessary to do so.
+ */
+const struct tnl_pipeline_stage *_tnl_default_pipeline[] = {
+ &_tnl_vertex_transform_stage,
+ &_tnl_normal_transform_stage,
+ &_tnl_lighting_stage,
+ &_tnl_texgen_stage,
+ &_tnl_texture_transform_stage,
+ &_tnl_point_attenuation_stage,
+ &_tnl_vertex_program_stage,
+ &_tnl_fog_coordinate_stage,
+ &_tnl_render_stage,
+ NULL
+};
+
+const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = {
+ &_tnl_vertex_program_stage,
+ &_tnl_render_stage,
+ NULL
+};
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index 2b8d38ef2..8474c787a 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -431,6 +431,24 @@ do { \
#include "vbo_attrib_tmp.h"
+/**
+ * Flush (draw) vertices.
+ * \param unmap - leave VBO unmapped after flushing?
+ */
+static void
+vbo_exec_FlushVertices_internal(struct vbo_exec_context *exec, GLboolean unmap)
+{
+ if (exec->vtx.vert_count || unmap) {
+ vbo_exec_vtx_flush( exec, unmap );
+ }
+
+ if (exec->vtx.vertex_size) {
+ vbo_exec_copy_to_current( exec );
+ reset_attrfv( exec );
+ }
+}
+
+
#if FEATURE_beginend
@@ -535,24 +553,6 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j )
/**
- * Flush (draw) vertices.
- * \param unmap - leave VBO unmapped after flushing?
- */
-static void
-vbo_exec_FlushVertices_internal(struct vbo_exec_context *exec, GLboolean unmap)
-{
- if (exec->vtx.vert_count || unmap) {
- vbo_exec_vtx_flush( exec, unmap );
- }
-
- if (exec->vtx.vertex_size) {
- vbo_exec_copy_to_current( exec );
- reset_attrfv( exec );
- }
-}
-
-
-/**
* Called via glBegin.
*/
static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
@@ -947,7 +947,7 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
/* Free the vertex buffer. Unmap first if needed.
*/
if (_mesa_bufferobj_mapped(exec->vtx.bufferobj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, exec->vtx.bufferobj);
+ ctx->Driver.UnmapBuffer(ctx, exec->vtx.bufferobj);
}
_mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
}
diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c
index 32ce0e4a8..18719d5f5 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_array.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_array.c
@@ -95,10 +95,25 @@ vbo_get_minmax_index(struct gl_context *ctx,
GLuint i;
if (_mesa_is_bufferobj(ib->obj)) {
- const GLvoid *map =
- ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
- GL_READ_ONLY, ib->obj);
- indices = ADD_POINTERS(map, ib->ptr);
+ unsigned map_size;
+
+ switch (ib->type) {
+ case GL_UNSIGNED_INT:
+ map_size = count * sizeof(GLuint);
+ break;
+ case GL_UNSIGNED_SHORT:
+ map_size = count * sizeof(GLushort);
+ break;
+ case GL_UNSIGNED_BYTE:
+ map_size = count * sizeof(GLubyte);
+ break;
+ default:
+ assert(0);
+ map_size = 0;
+ }
+
+ indices = ctx->Driver.MapBufferRange(ctx, (GLsizeiptr) ib->ptr, map_size,
+ GL_MAP_READ_BIT, ib->obj);
} else {
indices = ib->ptr;
}
@@ -176,7 +191,7 @@ vbo_get_minmax_index(struct gl_context *ctx,
}
if (_mesa_is_bufferobj(ib->obj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj);
+ ctx->Driver.UnmapBuffer(ctx, ib->obj);
}
}
@@ -196,8 +211,8 @@ check_array_data(struct gl_context *ctx, struct gl_client_array *array,
if (!array->BufferObj->Pointer) {
/* need to map now */
array->BufferObj->Pointer =
- ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB,
- GL_READ_ONLY, array->BufferObj);
+ ctx->Driver.MapBufferRange(ctx, 0, array->BufferObj->Size,
+ GL_MAP_READ_BIT, array->BufferObj);
}
data = ADD_POINTERS(data, array->BufferObj->Pointer);
}
@@ -238,7 +253,7 @@ unmap_array_buffer(struct gl_context *ctx, struct gl_client_array *array)
if (array->Enabled &&
_mesa_is_bufferobj(array->BufferObj) &&
_mesa_bufferobj_mapped(array->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj);
+ ctx->Driver.UnmapBuffer(ctx, array->BufferObj);
}
}
@@ -256,10 +271,10 @@ check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
GLint i, k;
if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
- elemMap = ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- GL_READ_ONLY,
- ctx->Array.ElementArrayBufferObj);
+ elemMap = ctx->Driver.MapBufferRange(ctx, 0,
+ ctx->Array.ElementArrayBufferObj->Size,
+ GL_MAP_READ_BIT,
+ ctx->Array.ElementArrayBufferObj);
elements = ADD_POINTERS(elements, elemMap);
}
@@ -296,8 +311,7 @@ check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
}
if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
- ctx->Array.ElementArrayBufferObj);
+ ctx->Driver.UnmapBuffer(ctx, ctx->Array.ElementArrayBufferObj);
}
unmap_array_buffer(ctx, &arrayObj->Vertex);
@@ -351,8 +365,8 @@ print_draw_arrays(struct gl_context *ctx,
bufName);
if (bufName) {
- GLubyte *p = ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB,
- GL_READ_ONLY_ARB, bufObj);
+ GLubyte *p = ctx->Driver.MapBufferRange(ctx, 0, bufObj->Size,
+ GL_MAP_READ_BIT, bufObj);
int offset = (int) (GLintptr) exec->array.inputs[i]->Ptr;
float *f = (float *) (p + offset);
int *k = (int *) f;
@@ -364,7 +378,7 @@ print_draw_arrays(struct gl_context *ctx,
for (i = 0; i < n; i++) {
printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
}
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, bufObj);
+ ctx->Driver.UnmapBuffer(ctx, bufObj);
}
}
}
@@ -715,10 +729,11 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
static void
dump_element_buffer(struct gl_context *ctx, GLenum type)
{
- const GLvoid *map = ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- GL_READ_ONLY,
- ctx->Array.ElementArrayBufferObj);
+ const GLvoid *map =
+ ctx->Driver.MapBufferRange(ctx, 0,
+ ctx->Array.ElementArrayBufferObj->Size,
+ GL_MAP_READ_BIT,
+ ctx->Array.ElementArrayBufferObj);
switch (type) {
case GL_UNSIGNED_BYTE:
{
@@ -760,8 +775,7 @@ dump_element_buffer(struct gl_context *ctx, GLenum type)
;
}
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
- ctx->Array.ElementArrayBufferObj);
+ ctx->Driver.UnmapBuffer(ctx, ctx->Array.ElementArrayBufferObj);
}
diff --git a/mesalib/src/mesa/vbo/vbo_exec_draw.c b/mesalib/src/mesa/vbo/vbo_exec_draw.c
index 98f585792..8ffaaaa48 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_draw.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_draw.c
@@ -1,427 +1,416 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.2
- *
- * 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.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "main/glheader.h"
-#include "main/bufferobj.h"
-#include "main/compiler.h"
-#include "main/enums.h"
-#include "main/mfeatures.h"
-#include "main/state.h"
-
-#include "vbo_context.h"
-
-
-#if FEATURE_beginend
-
-
-static void
-vbo_exec_debug_verts( struct vbo_exec_context *exec )
-{
- GLuint count = exec->vtx.vert_count;
- GLuint i;
-
- printf("%s: %u vertices %d primitives, %d vertsize\n",
- __FUNCTION__,
- count,
- exec->vtx.prim_count,
- exec->vtx.vertex_size);
-
- for (i = 0 ; i < exec->vtx.prim_count ; i++) {
- struct _mesa_prim *prim = &exec->vtx.prim[i];
- printf(" prim %d: %s%s %d..%d %s %s\n",
- i,
- _mesa_lookup_prim_by_nr(prim->mode),
- prim->weak ? " (weak)" : "",
- prim->start,
- prim->start + prim->count,
- prim->begin ? "BEGIN" : "(wrap)",
- prim->end ? "END" : "(wrap)");
- }
-}
-
-
-/*
- * NOTE: Need to have calculated primitives by this point -- do it on the fly.
- * NOTE: Old 'parity' issue is gone.
- */
-static GLuint
-vbo_copy_vertices( struct vbo_exec_context *exec )
-{
- GLuint nr = exec->vtx.prim[exec->vtx.prim_count-1].count;
- GLuint ovf, i;
- GLuint sz = exec->vtx.vertex_size;
- GLfloat *dst = exec->vtx.copied.buffer;
- const GLfloat *src = (exec->vtx.buffer_map +
- exec->vtx.prim[exec->vtx.prim_count-1].start *
- exec->vtx.vertex_size);
-
-
- switch (exec->ctx->Driver.CurrentExecPrimitive) {
- case GL_POINTS:
- return 0;
- case GL_LINES:
- ovf = nr&1;
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
- return i;
- case GL_TRIANGLES:
- ovf = nr%3;
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
- return i;
- case GL_QUADS:
- ovf = nr&3;
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
- return i;
- case GL_LINE_STRIP:
- if (nr == 0) {
- return 0;
- }
- else {
- memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) );
- return 1;
- }
- case GL_LINE_LOOP:
- case GL_TRIANGLE_FAN:
- case GL_POLYGON:
- if (nr == 0) {
- return 0;
- }
- else if (nr == 1) {
- memcpy( dst, src+0, sz * sizeof(GLfloat) );
- return 1;
- }
- else {
- memcpy( dst, src+0, sz * sizeof(GLfloat) );
- memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) );
- return 2;
- }
- case GL_TRIANGLE_STRIP:
- /* no parity issue, but need to make sure the tri is not drawn twice */
- if (nr & 1) {
- exec->vtx.prim[exec->vtx.prim_count-1].count--;
- }
- /* fallthrough */
- case GL_QUAD_STRIP:
- switch (nr) {
- case 0:
- ovf = 0;
- break;
- case 1:
- ovf = 1;
- break;
- default:
- ovf = 2 + (nr & 1);
- break;
- }
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
- return i;
- case PRIM_OUTSIDE_BEGIN_END:
- return 0;
- default:
- assert(0);
- return 0;
- }
-}
-
-
-
-/* TODO: populate these as the vertex is defined:
- */
-static void
-vbo_exec_bind_arrays( struct gl_context *ctx )
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- struct gl_client_array *arrays = exec->vtx.arrays;
- const GLuint count = exec->vtx.vert_count;
- const GLuint *map;
- GLuint attr;
- GLbitfield varying_inputs = 0x0;
-
- /* Install the default (ie Current) attributes first, then overlay
- * all active ones.
- */
- switch (get_program_mode(exec->ctx)) {
- case VP_NONE:
- for (attr = 0; attr < 16; attr++) {
- exec->vtx.inputs[attr] = &vbo->legacy_currval[attr];
- }
- for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) {
- ASSERT(attr + 16 < Elements(exec->vtx.inputs));
- exec->vtx.inputs[attr + 16] = &vbo->mat_currval[attr];
- }
- map = vbo->map_vp_none;
- break;
- case VP_NV:
- case VP_ARB:
- /* The aliasing of attributes for NV vertex programs has already
- * occurred. NV vertex programs cannot access material values,
- * nor attributes greater than VERT_ATTRIB_TEX7.
- */
- for (attr = 0; attr < 16; attr++) {
- exec->vtx.inputs[attr] = &vbo->legacy_currval[attr];
- ASSERT(attr + 16 < Elements(exec->vtx.inputs));
- exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr];
- }
- map = vbo->map_vp_arb;
-
- /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read.
- * In that case we effectively need to route the data from
- * glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
- */
- if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 &&
- (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) {
- exec->vtx.inputs[16] = exec->vtx.inputs[0];
- exec->vtx.attrsz[16] = exec->vtx.attrsz[0];
- exec->vtx.attrptr[16] = exec->vtx.attrptr[0];
- exec->vtx.attrsz[0] = 0;
- }
- break;
- default:
- assert(0);
- }
-
- /* Make all active attributes (including edgeflag) available as
- * arrays of floats.
- */
- for (attr = 0; attr < VERT_ATTRIB_MAX ; attr++) {
- const GLuint src = map[attr];
-
- if (exec->vtx.attrsz[src]) {
- GLsizeiptr offset = (GLbyte *)exec->vtx.attrptr[src] -
- (GLbyte *)exec->vtx.vertex;
-
- /* override the default array set above */
- ASSERT(attr < Elements(exec->vtx.inputs));
- ASSERT(attr < Elements(exec->vtx.arrays)); /* arrays[] */
- exec->vtx.inputs[attr] = &arrays[attr];
-
- if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
- /* a real buffer obj: Ptr is an offset, not a pointer*/
- assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */
- assert(offset >= 0);
- arrays[attr].Ptr = (GLubyte *)exec->vtx.bufferobj->Offset + offset;
- }
- else {
- /* Ptr into ordinary app memory */
- arrays[attr].Ptr = (GLubyte *)exec->vtx.buffer_map + offset;
- }
- arrays[attr].Size = exec->vtx.attrsz[src];
- arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat);
- arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat);
- arrays[attr].Type = GL_FLOAT;
- arrays[attr].Format = GL_RGBA;
- arrays[attr].Enabled = 1;
- arrays[attr]._ElementSize = arrays[attr].Size * sizeof(GLfloat);
- _mesa_reference_buffer_object(ctx,
- &arrays[attr].BufferObj,
- exec->vtx.bufferobj);
- arrays[attr]._MaxElement = count; /* ??? */
-
- varying_inputs |= 1 << attr;
- ctx->NewState |= _NEW_ARRAY;
- }
- }
-
- _mesa_set_varying_vp_inputs( ctx, varying_inputs );
-}
-
-
-/**
- * Unmap the VBO. This is called before drawing.
- */
-static void
-vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
-{
- GLenum target = GL_ARRAY_BUFFER_ARB;
-
- if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
- struct gl_context *ctx = exec->ctx;
-
- if (ctx->Driver.FlushMappedBufferRange) {
- GLintptr offset = exec->vtx.buffer_used - exec->vtx.bufferobj->Offset;
- GLsizeiptr length = (exec->vtx.buffer_ptr - exec->vtx.buffer_map) * sizeof(float);
-
- if (length)
- ctx->Driver.FlushMappedBufferRange(ctx, target,
- offset, length,
- exec->vtx.bufferobj);
- }
-
- exec->vtx.buffer_used += (exec->vtx.buffer_ptr -
- exec->vtx.buffer_map) * sizeof(float);
-
- assert(exec->vtx.buffer_used <= VBO_VERT_BUFFER_SIZE);
- assert(exec->vtx.buffer_ptr != NULL);
-
- ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj);
- exec->vtx.buffer_map = NULL;
- exec->vtx.buffer_ptr = NULL;
- exec->vtx.max_vert = 0;
- }
-}
-
-
-/**
- * Map the vertex buffer to begin storing glVertex, glColor, etc data.
- */
-void
-vbo_exec_vtx_map( struct vbo_exec_context *exec )
-{
- struct gl_context *ctx = exec->ctx;
- const GLenum target = GL_ARRAY_BUFFER_ARB;
- const GLenum access = GL_READ_WRITE_ARB; /* for MapBuffer */
- const GLenum accessRange = GL_MAP_WRITE_BIT | /* for MapBufferRange */
- GL_MAP_INVALIDATE_RANGE_BIT |
- GL_MAP_UNSYNCHRONIZED_BIT |
- GL_MAP_FLUSH_EXPLICIT_BIT |
- MESA_MAP_NOWAIT_BIT;
- const GLenum usage = GL_STREAM_DRAW_ARB;
-
- if (!_mesa_is_bufferobj(exec->vtx.bufferobj))
- return;
-
- assert(!exec->vtx.buffer_map);
- assert(!exec->vtx.buffer_ptr);
-
- if (VBO_VERT_BUFFER_SIZE > exec->vtx.buffer_used + 1024 &&
- ctx->Driver.MapBufferRange) {
- /* The VBO exists and there's room for more */
- exec->vtx.buffer_map =
- (GLfloat *)ctx->Driver.MapBufferRange(ctx,
- target,
- exec->vtx.buffer_used,
- (VBO_VERT_BUFFER_SIZE -
- exec->vtx.buffer_used),
- accessRange,
- exec->vtx.bufferobj);
- exec->vtx.buffer_ptr = exec->vtx.buffer_map;
- }
-
- if (!exec->vtx.buffer_map) {
- /* Need to allocate a new VBO */
- exec->vtx.buffer_used = 0;
-
- ctx->Driver.BufferData(ctx, target,
- VBO_VERT_BUFFER_SIZE,
- NULL, usage, exec->vtx.bufferobj);
-
-
- if (ctx->Driver.MapBufferRange)
- exec->vtx.buffer_map =
- (GLfloat *)ctx->Driver.MapBufferRange(ctx, target,
- 0, VBO_VERT_BUFFER_SIZE,
- accessRange,
- exec->vtx.bufferobj);
- if (!exec->vtx.buffer_map)
- exec->vtx.buffer_map =
- (GLfloat *)ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj);
- assert(exec->vtx.buffer_map);
- exec->vtx.buffer_ptr = exec->vtx.buffer_map;
- }
-
- if (0)
- printf("map %d..\n", exec->vtx.buffer_used);
-}
-
-
-
-/**
- * Execute the buffer and save copied verts.
- * \param keep_unmapped if true, leave the VBO unmapped when we're done.
- */
-void
-vbo_exec_vtx_flush(struct vbo_exec_context *exec, GLboolean keepUnmapped)
-{
- if (0)
- vbo_exec_debug_verts( exec );
-
- if (exec->vtx.prim_count &&
- exec->vtx.vert_count) {
-
- exec->vtx.copied.nr = vbo_copy_vertices( exec );
-
- if (exec->vtx.copied.nr != exec->vtx.vert_count) {
- struct gl_context *ctx = exec->ctx;
-
- /* Before the update_state() as this may raise _NEW_ARRAY
- * from _mesa_set_varying_vp_inputs().
- */
- vbo_exec_bind_arrays( ctx );
-
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
- if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
- vbo_exec_vtx_unmap( exec );
- }
-
- if (0)
- printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count,
- exec->vtx.vert_count);
-
- vbo_context(ctx)->draw_prims( ctx,
- exec->vtx.inputs,
- exec->vtx.prim,
- exec->vtx.prim_count,
- NULL,
- GL_TRUE,
- 0,
- exec->vtx.vert_count - 1);
-
- /* If using a real VBO, get new storage -- unless asked not to.
- */
- if (_mesa_is_bufferobj(exec->vtx.bufferobj) && !keepUnmapped) {
- vbo_exec_vtx_map( exec );
- }
- }
- }
-
- /* May have to unmap explicitly if we didn't draw:
- */
- if (keepUnmapped &&
- _mesa_is_bufferobj(exec->vtx.bufferobj) &&
- exec->vtx.buffer_map) {
- vbo_exec_vtx_unmap( exec );
- }
-
- if (keepUnmapped || exec->vtx.vertex_size == 0)
- exec->vtx.max_vert = 0;
- else
- exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) /
- (exec->vtx.vertex_size * sizeof(GLfloat)));
-
- exec->vtx.buffer_ptr = exec->vtx.buffer_map;
- exec->vtx.prim_count = 0;
- exec->vtx.vert_count = 0;
-}
-
-
-#endif /* FEATURE_beginend */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.2
+ *
+ * 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.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/compiler.h"
+#include "main/enums.h"
+#include "main/mfeatures.h"
+#include "main/state.h"
+
+#include "vbo_context.h"
+
+
+#if FEATURE_beginend
+
+
+static void
+vbo_exec_debug_verts( struct vbo_exec_context *exec )
+{
+ GLuint count = exec->vtx.vert_count;
+ GLuint i;
+
+ printf("%s: %u vertices %d primitives, %d vertsize\n",
+ __FUNCTION__,
+ count,
+ exec->vtx.prim_count,
+ exec->vtx.vertex_size);
+
+ for (i = 0 ; i < exec->vtx.prim_count ; i++) {
+ struct _mesa_prim *prim = &exec->vtx.prim[i];
+ printf(" prim %d: %s%s %d..%d %s %s\n",
+ i,
+ _mesa_lookup_prim_by_nr(prim->mode),
+ prim->weak ? " (weak)" : "",
+ prim->start,
+ prim->start + prim->count,
+ prim->begin ? "BEGIN" : "(wrap)",
+ prim->end ? "END" : "(wrap)");
+ }
+}
+
+
+/*
+ * NOTE: Need to have calculated primitives by this point -- do it on the fly.
+ * NOTE: Old 'parity' issue is gone.
+ */
+static GLuint
+vbo_copy_vertices( struct vbo_exec_context *exec )
+{
+ GLuint nr = exec->vtx.prim[exec->vtx.prim_count-1].count;
+ GLuint ovf, i;
+ GLuint sz = exec->vtx.vertex_size;
+ GLfloat *dst = exec->vtx.copied.buffer;
+ const GLfloat *src = (exec->vtx.buffer_map +
+ exec->vtx.prim[exec->vtx.prim_count-1].start *
+ exec->vtx.vertex_size);
+
+
+ switch (exec->ctx->Driver.CurrentExecPrimitive) {
+ case GL_POINTS:
+ return 0;
+ case GL_LINES:
+ ovf = nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case GL_TRIANGLES:
+ ovf = nr%3;
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case GL_QUADS:
+ ovf = nr&3;
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case GL_LINE_STRIP:
+ if (nr == 0) {
+ return 0;
+ }
+ else {
+ memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) );
+ return 1;
+ }
+ case GL_LINE_LOOP:
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ if (nr == 0) {
+ return 0;
+ }
+ else if (nr == 1) {
+ memcpy( dst, src+0, sz * sizeof(GLfloat) );
+ return 1;
+ }
+ else {
+ memcpy( dst, src+0, sz * sizeof(GLfloat) );
+ memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) );
+ return 2;
+ }
+ case GL_TRIANGLE_STRIP:
+ /* no parity issue, but need to make sure the tri is not drawn twice */
+ if (nr & 1) {
+ exec->vtx.prim[exec->vtx.prim_count-1].count--;
+ }
+ /* fallthrough */
+ case GL_QUAD_STRIP:
+ switch (nr) {
+ case 0:
+ ovf = 0;
+ break;
+ case 1:
+ ovf = 1;
+ break;
+ default:
+ ovf = 2 + (nr & 1);
+ break;
+ }
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case PRIM_OUTSIDE_BEGIN_END:
+ return 0;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+
+/* TODO: populate these as the vertex is defined:
+ */
+static void
+vbo_exec_bind_arrays( struct gl_context *ctx )
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ struct gl_client_array *arrays = exec->vtx.arrays;
+ const GLuint count = exec->vtx.vert_count;
+ const GLuint *map;
+ GLuint attr;
+ GLbitfield varying_inputs = 0x0;
+
+ /* Install the default (ie Current) attributes first, then overlay
+ * all active ones.
+ */
+ switch (get_program_mode(exec->ctx)) {
+ case VP_NONE:
+ for (attr = 0; attr < 16; attr++) {
+ exec->vtx.inputs[attr] = &vbo->legacy_currval[attr];
+ }
+ for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) {
+ ASSERT(attr + 16 < Elements(exec->vtx.inputs));
+ exec->vtx.inputs[attr + 16] = &vbo->mat_currval[attr];
+ }
+ map = vbo->map_vp_none;
+ break;
+ case VP_NV:
+ case VP_ARB:
+ /* The aliasing of attributes for NV vertex programs has already
+ * occurred. NV vertex programs cannot access material values,
+ * nor attributes greater than VERT_ATTRIB_TEX7.
+ */
+ for (attr = 0; attr < 16; attr++) {
+ exec->vtx.inputs[attr] = &vbo->legacy_currval[attr];
+ ASSERT(attr + 16 < Elements(exec->vtx.inputs));
+ exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr];
+ }
+ map = vbo->map_vp_arb;
+
+ /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read.
+ * In that case we effectively need to route the data from
+ * glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
+ */
+ if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 &&
+ (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) {
+ exec->vtx.inputs[16] = exec->vtx.inputs[0];
+ exec->vtx.attrsz[16] = exec->vtx.attrsz[0];
+ exec->vtx.attrptr[16] = exec->vtx.attrptr[0];
+ exec->vtx.attrsz[0] = 0;
+ }
+ break;
+ default:
+ assert(0);
+ }
+
+ /* Make all active attributes (including edgeflag) available as
+ * arrays of floats.
+ */
+ for (attr = 0; attr < VERT_ATTRIB_MAX ; attr++) {
+ const GLuint src = map[attr];
+
+ if (exec->vtx.attrsz[src]) {
+ GLsizeiptr offset = (GLbyte *)exec->vtx.attrptr[src] -
+ (GLbyte *)exec->vtx.vertex;
+
+ /* override the default array set above */
+ ASSERT(attr < Elements(exec->vtx.inputs));
+ ASSERT(attr < Elements(exec->vtx.arrays)); /* arrays[] */
+ exec->vtx.inputs[attr] = &arrays[attr];
+
+ if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
+ /* a real buffer obj: Ptr is an offset, not a pointer*/
+ assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */
+ assert(offset >= 0);
+ arrays[attr].Ptr = (GLubyte *)exec->vtx.bufferobj->Offset + offset;
+ }
+ else {
+ /* Ptr into ordinary app memory */
+ arrays[attr].Ptr = (GLubyte *)exec->vtx.buffer_map + offset;
+ }
+ arrays[attr].Size = exec->vtx.attrsz[src];
+ arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat);
+ arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat);
+ arrays[attr].Type = GL_FLOAT;
+ arrays[attr].Format = GL_RGBA;
+ arrays[attr].Enabled = 1;
+ arrays[attr]._ElementSize = arrays[attr].Size * sizeof(GLfloat);
+ _mesa_reference_buffer_object(ctx,
+ &arrays[attr].BufferObj,
+ exec->vtx.bufferobj);
+ arrays[attr]._MaxElement = count; /* ??? */
+
+ varying_inputs |= 1 << attr;
+ ctx->NewState |= _NEW_ARRAY;
+ }
+ }
+
+ _mesa_set_varying_vp_inputs( ctx, varying_inputs );
+}
+
+
+/**
+ * Unmap the VBO. This is called before drawing.
+ */
+static void
+vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
+{
+ if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
+ struct gl_context *ctx = exec->ctx;
+
+ if (ctx->Driver.FlushMappedBufferRange) {
+ GLintptr offset = exec->vtx.buffer_used - exec->vtx.bufferobj->Offset;
+ GLsizeiptr length = (exec->vtx.buffer_ptr - exec->vtx.buffer_map) * sizeof(float);
+
+ if (length)
+ ctx->Driver.FlushMappedBufferRange(ctx, offset, length,
+ exec->vtx.bufferobj);
+ }
+
+ exec->vtx.buffer_used += (exec->vtx.buffer_ptr -
+ exec->vtx.buffer_map) * sizeof(float);
+
+ assert(exec->vtx.buffer_used <= VBO_VERT_BUFFER_SIZE);
+ assert(exec->vtx.buffer_ptr != NULL);
+
+ ctx->Driver.UnmapBuffer(ctx, exec->vtx.bufferobj);
+ exec->vtx.buffer_map = NULL;
+ exec->vtx.buffer_ptr = NULL;
+ exec->vtx.max_vert = 0;
+ }
+}
+
+
+/**
+ * Map the vertex buffer to begin storing glVertex, glColor, etc data.
+ */
+void
+vbo_exec_vtx_map( struct vbo_exec_context *exec )
+{
+ struct gl_context *ctx = exec->ctx;
+ const GLenum accessRange = GL_MAP_WRITE_BIT | /* for MapBufferRange */
+ GL_MAP_INVALIDATE_RANGE_BIT |
+ GL_MAP_UNSYNCHRONIZED_BIT |
+ GL_MAP_FLUSH_EXPLICIT_BIT |
+ MESA_MAP_NOWAIT_BIT;
+ const GLenum usage = GL_STREAM_DRAW_ARB;
+
+ if (!_mesa_is_bufferobj(exec->vtx.bufferobj))
+ return;
+
+ assert(!exec->vtx.buffer_map);
+ assert(!exec->vtx.buffer_ptr);
+
+ if (VBO_VERT_BUFFER_SIZE > exec->vtx.buffer_used + 1024) {
+ /* The VBO exists and there's room for more */
+ exec->vtx.buffer_map =
+ (GLfloat *)ctx->Driver.MapBufferRange(ctx,
+ exec->vtx.buffer_used,
+ (VBO_VERT_BUFFER_SIZE -
+ exec->vtx.buffer_used),
+ accessRange,
+ exec->vtx.bufferobj);
+ exec->vtx.buffer_ptr = exec->vtx.buffer_map;
+ }
+
+ if (!exec->vtx.buffer_map) {
+ /* Need to allocate a new VBO */
+ exec->vtx.buffer_used = 0;
+
+ ctx->Driver.BufferData(ctx, GL_ARRAY_BUFFER_ARB,
+ VBO_VERT_BUFFER_SIZE,
+ NULL, usage, exec->vtx.bufferobj);
+
+
+ exec->vtx.buffer_map =
+ (GLfloat *)ctx->Driver.MapBufferRange(ctx,
+ 0, VBO_VERT_BUFFER_SIZE,
+ accessRange,
+ exec->vtx.bufferobj);
+ assert(exec->vtx.buffer_map);
+ exec->vtx.buffer_ptr = exec->vtx.buffer_map;
+ }
+
+ if (0)
+ printf("map %d..\n", exec->vtx.buffer_used);
+}
+
+
+
+/**
+ * Execute the buffer and save copied verts.
+ * \param keep_unmapped if true, leave the VBO unmapped when we're done.
+ */
+void
+vbo_exec_vtx_flush(struct vbo_exec_context *exec, GLboolean keepUnmapped)
+{
+ if (0)
+ vbo_exec_debug_verts( exec );
+
+ if (exec->vtx.prim_count &&
+ exec->vtx.vert_count) {
+
+ exec->vtx.copied.nr = vbo_copy_vertices( exec );
+
+ if (exec->vtx.copied.nr != exec->vtx.vert_count) {
+ struct gl_context *ctx = exec->ctx;
+
+ /* Before the update_state() as this may raise _NEW_ARRAY
+ * from _mesa_set_varying_vp_inputs().
+ */
+ vbo_exec_bind_arrays( ctx );
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
+ vbo_exec_vtx_unmap( exec );
+ }
+
+ if (0)
+ printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count,
+ exec->vtx.vert_count);
+
+ vbo_context(ctx)->draw_prims( ctx,
+ exec->vtx.inputs,
+ exec->vtx.prim,
+ exec->vtx.prim_count,
+ NULL,
+ GL_TRUE,
+ 0,
+ exec->vtx.vert_count - 1);
+
+ /* If using a real VBO, get new storage -- unless asked not to.
+ */
+ if (_mesa_is_bufferobj(exec->vtx.bufferobj) && !keepUnmapped) {
+ vbo_exec_vtx_map( exec );
+ }
+ }
+ }
+
+ /* May have to unmap explicitly if we didn't draw:
+ */
+ if (keepUnmapped &&
+ _mesa_is_bufferobj(exec->vtx.bufferobj) &&
+ exec->vtx.buffer_map) {
+ vbo_exec_vtx_unmap( exec );
+ }
+
+ if (keepUnmapped || exec->vtx.vertex_size == 0)
+ exec->vtx.max_vert = 0;
+ else
+ exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) /
+ (exec->vtx.vertex_size * sizeof(GLfloat)));
+
+ exec->vtx.buffer_ptr = exec->vtx.buffer_map;
+ exec->vtx.prim_count = 0;
+ exec->vtx.vert_count = 0;
+}
+
+
+#endif /* FEATURE_beginend */
diff --git a/mesalib/src/mesa/vbo/vbo_rebase.c b/mesalib/src/mesa/vbo/vbo_rebase.c
index 1de290ff6..a1eab752a 100644
--- a/mesalib/src/mesa/vbo/vbo_rebase.c
+++ b/mesalib/src/mesa/vbo/vbo_rebase.c
@@ -159,10 +159,8 @@ void vbo_rebase_prims( struct gl_context *ctx,
void *ptr;
if (map_ib)
- ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER,
- GL_READ_ONLY_ARB,
- ib->obj);
+ ctx->Driver.MapBufferRange(ctx, 0, ib->obj->Size, GL_MAP_READ_BIT,
+ ib->obj);
ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr);
@@ -183,9 +181,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
}
if (map_ib)
- ctx->Driver.UnmapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER,
- ib->obj);
+ ctx->Driver.UnmapBuffer(ctx, ib->obj);
tmp_ib.obj = ctx->Shared->NullBufferObj;
tmp_ib.ptr = tmp_indices;
diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c
index 9041f791e..ad36e9332 100644
--- a/mesalib/src/mesa/vbo/vbo_save_api.c
+++ b/mesalib/src/mesa/vbo/vbo_save_api.c
@@ -232,11 +232,10 @@ map_vertex_store(struct gl_context *ctx,
assert(vertex_store->bufferobj);
assert(!vertex_store->buffer);
vertex_store->buffer =
- (GLfloat *) ctx->Driver.MapBuffer(ctx,
- GL_ARRAY_BUFFER_ARB, /* not used */
- GL_WRITE_ONLY, /* not used */
- vertex_store->
- bufferobj);
+ (GLfloat *) ctx->Driver.MapBufferRange(ctx, 0,
+ vertex_store->bufferobj->Size,
+ GL_MAP_WRITE_BIT, /* not used */
+ vertex_store->bufferobj);
assert(vertex_store->buffer);
return vertex_store->buffer + vertex_store->used;
@@ -247,7 +246,7 @@ static void
unmap_vertex_store(struct gl_context *ctx,
struct vbo_save_vertex_store *vertex_store)
{
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, vertex_store->bufferobj);
+ ctx->Driver.UnmapBuffer(ctx, vertex_store->bufferobj);
vertex_store->buffer = NULL;
}
diff --git a/mesalib/src/mesa/vbo/vbo_save_draw.c b/mesalib/src/mesa/vbo/vbo_save_draw.c
index a37af73e0..6cda831aa 100644
--- a/mesalib/src/mesa/vbo/vbo_save_draw.c
+++ b/mesalib/src/mesa/vbo/vbo_save_draw.c
@@ -70,7 +70,7 @@ _playback_copy_to_current(struct gl_context *ctx,
else
offset = node->buffer_offset;
- ctx->Driver.GetBufferSubData( ctx, 0, offset,
+ ctx->Driver.GetBufferSubData( ctx, offset,
node->vertex_size * sizeof(GLfloat),
data, node->vertex_store->bufferobj );
@@ -217,10 +217,11 @@ static void
vbo_save_loopback_vertex_list(struct gl_context *ctx,
const struct vbo_save_vertex_list *list)
{
- const char *buffer = ctx->Driver.MapBuffer(ctx,
- GL_ARRAY_BUFFER_ARB,
- GL_READ_ONLY, /* ? */
- list->vertex_store->bufferobj);
+ const char *buffer =
+ ctx->Driver.MapBufferRange(ctx, 0,
+ list->vertex_store->bufferobj->Size,
+ GL_MAP_READ_BIT, /* ? */
+ list->vertex_store->bufferobj);
vbo_loopback_vertex_list(ctx,
(const GLfloat *)(buffer + list->buffer_offset),
@@ -230,8 +231,7 @@ vbo_save_loopback_vertex_list(struct gl_context *ctx,
list->wrap_count,
list->vertex_size);
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB,
- list->vertex_store->bufferobj);
+ ctx->Driver.UnmapBuffer(ctx, list->vertex_store->bufferobj);
}
diff --git a/mesalib/src/mesa/vbo/vbo_split.c b/mesalib/src/mesa/vbo/vbo_split.c
index e28f9afcf..c933a3f9a 100644
--- a/mesalib/src/mesa/vbo/vbo_split.c
+++ b/mesalib/src/mesa/vbo/vbo_split.c
@@ -1,169 +1,168 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2006 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.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-/* Deal with hardware and/or swtnl maximums:
- * - maximum number of vertices in buffer
- * - maximum number of elements (maybe zero)
- *
- * The maximums may vary with opengl state (eg if a larger hardware
- * vertex is required in this state, the maximum number of vertices
- * may be smaller than in another state).
- *
- * We want buffer splitting to be a convenience function for the code
- * actually drawing the primitives rather than a system-wide maximum,
- * otherwise it is hard to avoid pessimism.
- *
- * For instance, if a driver has no hardware limits on vertex buffer
- * dimensions, it would not ordinarily want to split vbos. But if
- * there is an unexpected fallback, eg memory manager fails to upload
- * textures, it will want to pass the drawing commands onto swtnl,
- * which does have limitations. A convenience function allows swtnl
- * to split the drawing and vbos internally without imposing its
- * limitations on drivers which want to use it as a fallback path.
- */
-
-#include "main/glheader.h"
-#include "main/imports.h"
-#include "main/mtypes.h"
-#include "main/macros.h"
-
-#include "vbo_split.h"
-#include "vbo.h"
-
-/* True if a primitive can be split without copying of vertices, false
- * otherwise.
- */
-GLboolean split_prim_inplace(GLenum mode, GLuint *first, GLuint *incr)
-{
- switch (mode) {
- case GL_POINTS:
- *first = 1;
- *incr = 1;
- return GL_TRUE;
- case GL_LINES:
- *first = 2;
- *incr = 2;
- return GL_TRUE;
- case GL_LINE_STRIP:
- *first = 2;
- *incr = 1;
- return GL_TRUE;
- case GL_TRIANGLES:
- *first = 3;
- *incr = 3;
- return GL_TRUE;
- case GL_TRIANGLE_STRIP:
- *first = 3;
- *incr = 1;
- return GL_TRUE;
- case GL_QUADS:
- *first = 4;
- *incr = 4;
- return GL_TRUE;
- case GL_QUAD_STRIP:
- *first = 4;
- *incr = 2;
- return GL_TRUE;
- default:
- *first = 0;
- *incr = 1; /* so that count % incr works */
- return GL_FALSE;
- }
-}
-
-
-
-void vbo_split_prims( struct gl_context *ctx,
- const struct gl_client_array *arrays[],
- const struct _mesa_prim *prim,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLuint min_index,
- GLuint max_index,
- vbo_draw_func draw,
- const struct split_limits *limits )
-{
- GLint max_basevertex = prim->basevertex;
- GLuint i;
-
- for (i = 1; i < nr_prims; i++)
- max_basevertex = MAX2(max_basevertex, prim[i].basevertex);
-
- /* XXX max_basevertex is computed but not used, why? */
-
- if (ib) {
- if (limits->max_indices == 0) {
- /* Could traverse the indices, re-emitting vertices in turn.
- * But it's hard to see why this case would be needed - for
- * software tnl, it is better to convert to non-indexed
- * rendering after transformation is complete, as is done in
- * the t_dd_rendertmp.h templates. Are there any devices
- * with hardware tnl that cannot do indexed rendering?
- *
- * For now, this path is disabled.
- */
- assert(0);
- }
- else if (max_index - min_index >= limits->max_verts) {
- /* The vertex buffers are too large for hardware (or the
- * swtnl module). Traverse the indices, re-emitting vertices
- * in turn. Use a vertex cache to preserve some of the
- * sharing from the original index list.
- */
- vbo_split_copy(ctx, arrays, prim, nr_prims, ib,
- draw, limits );
- }
- else if (ib->count > limits->max_indices) {
- /* The index buffer is too large for hardware. Try to split
- * on whole-primitive boundaries, otherwise try to split the
- * individual primitives.
- */
- vbo_split_inplace(ctx, arrays, prim, nr_prims, ib,
- min_index, max_index, draw, limits );
- }
- else {
- /* Why were we called? */
- assert(0);
- }
- }
- else {
- if (max_index - min_index >= limits->max_verts) {
- /* The vertex buffer is too large for hardware (or the swtnl
- * module). Try to split on whole-primitive boundaries,
- * otherwise try to split the individual primitives.
- */
- vbo_split_inplace(ctx, arrays, prim, nr_prims, ib,
- min_index, max_index, draw, limits );
- }
- else {
- /* Why were we called? */
- assert(0);
- }
- }
-}
-
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 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.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+/* Deal with hardware and/or swtnl maximums:
+ * - maximum number of vertices in buffer
+ * - maximum number of elements (maybe zero)
+ *
+ * The maximums may vary with opengl state (eg if a larger hardware
+ * vertex is required in this state, the maximum number of vertices
+ * may be smaller than in another state).
+ *
+ * We want buffer splitting to be a convenience function for the code
+ * actually drawing the primitives rather than a system-wide maximum,
+ * otherwise it is hard to avoid pessimism.
+ *
+ * For instance, if a driver has no hardware limits on vertex buffer
+ * dimensions, it would not ordinarily want to split vbos. But if
+ * there is an unexpected fallback, eg memory manager fails to upload
+ * textures, it will want to pass the drawing commands onto swtnl,
+ * which does have limitations. A convenience function allows swtnl
+ * to split the drawing and vbos internally without imposing its
+ * limitations on drivers which want to use it as a fallback path.
+ */
+
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+
+#include "vbo_split.h"
+#include "vbo.h"
+
+/* True if a primitive can be split without copying of vertices, false
+ * otherwise.
+ */
+GLboolean split_prim_inplace(GLenum mode, GLuint *first, GLuint *incr)
+{
+ switch (mode) {
+ case GL_POINTS:
+ *first = 1;
+ *incr = 1;
+ return GL_TRUE;
+ case GL_LINES:
+ *first = 2;
+ *incr = 2;
+ return GL_TRUE;
+ case GL_LINE_STRIP:
+ *first = 2;
+ *incr = 1;
+ return GL_TRUE;
+ case GL_TRIANGLES:
+ *first = 3;
+ *incr = 3;
+ return GL_TRUE;
+ case GL_TRIANGLE_STRIP:
+ *first = 3;
+ *incr = 1;
+ return GL_TRUE;
+ case GL_QUADS:
+ *first = 4;
+ *incr = 4;
+ return GL_TRUE;
+ case GL_QUAD_STRIP:
+ *first = 4;
+ *incr = 2;
+ return GL_TRUE;
+ default:
+ *first = 0;
+ *incr = 1; /* so that count % incr works */
+ return GL_FALSE;
+ }
+}
+
+
+
+void vbo_split_prims( struct gl_context *ctx,
+ const struct gl_client_array *arrays[],
+ const struct _mesa_prim *prim,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLuint min_index,
+ GLuint max_index,
+ vbo_draw_func draw,
+ const struct split_limits *limits )
+{
+ GLint max_basevertex = prim->basevertex;
+ GLuint i;
+
+ for (i = 1; i < nr_prims; i++)
+ max_basevertex = MAX2(max_basevertex, prim[i].basevertex);
+
+ /* XXX max_basevertex is computed but not used, why? */
+
+ if (ib) {
+ if (limits->max_indices == 0) {
+ /* Could traverse the indices, re-emitting vertices in turn.
+ * But it's hard to see why this case would be needed - for
+ * software tnl, it is better to convert to non-indexed
+ * rendering after transformation is complete. Are there any devices
+ * with hardware tnl that cannot do indexed rendering?
+ *
+ * For now, this path is disabled.
+ */
+ assert(0);
+ }
+ else if (max_index - min_index >= limits->max_verts) {
+ /* The vertex buffers are too large for hardware (or the
+ * swtnl module). Traverse the indices, re-emitting vertices
+ * in turn. Use a vertex cache to preserve some of the
+ * sharing from the original index list.
+ */
+ vbo_split_copy(ctx, arrays, prim, nr_prims, ib,
+ draw, limits );
+ }
+ else if (ib->count > limits->max_indices) {
+ /* The index buffer is too large for hardware. Try to split
+ * on whole-primitive boundaries, otherwise try to split the
+ * individual primitives.
+ */
+ vbo_split_inplace(ctx, arrays, prim, nr_prims, ib,
+ min_index, max_index, draw, limits );
+ }
+ else {
+ /* Why were we called? */
+ assert(0);
+ }
+ }
+ else {
+ if (max_index - min_index >= limits->max_verts) {
+ /* The vertex buffer is too large for hardware (or the swtnl
+ * module). Try to split on whole-primitive boundaries,
+ * otherwise try to split the individual primitives.
+ */
+ vbo_split_inplace(ctx, arrays, prim, nr_prims, ib,
+ min_index, max_index, draw, limits );
+ }
+ else {
+ /* Why were we called? */
+ assert(0);
+ }
+ }
+}
+
diff --git a/mesalib/src/mesa/vbo/vbo_split_copy.c b/mesalib/src/mesa/vbo/vbo_split_copy.c
index 3a869d712..40906e389 100644
--- a/mesalib/src/mesa/vbo/vbo_split_copy.c
+++ b/mesalib/src/mesa/vbo/vbo_split_copy.c
@@ -1,627 +1,627 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2006 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.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-/* Split indexed primitives with per-vertex copying.
- */
-
-#include "main/glheader.h"
-#include "main/bufferobj.h"
-#include "main/imports.h"
-#include "main/image.h"
-#include "main/macros.h"
-#include "main/mtypes.h"
-
-#include "vbo_split.h"
-#include "vbo.h"
-
-
-#define ELT_TABLE_SIZE 16
-
-/**
- * Used for vertex-level splitting of indexed buffers. Note that
- * non-indexed primitives may be converted to indexed in some cases
- * (eg loops, fans) in order to use this splitting path.
- */
-struct copy_context {
-
- struct gl_context *ctx;
- const struct gl_client_array **array;
- const struct _mesa_prim *prim;
- GLuint nr_prims;
- const struct _mesa_index_buffer *ib;
- vbo_draw_func draw;
-
- const struct split_limits *limits;
-
- struct {
- GLuint attr;
- GLuint size;
- const struct gl_client_array *array;
- const GLubyte *src_ptr;
-
- struct gl_client_array dstarray;
-
- } varying[VERT_ATTRIB_MAX];
- GLuint nr_varying;
-
- const struct gl_client_array *dstarray_ptr[VERT_ATTRIB_MAX];
- struct _mesa_index_buffer dstib;
-
- GLuint *translated_elt_buf;
- const GLuint *srcelt;
-
- /** A baby hash table to avoid re-emitting (some) duplicate
- * vertices when splitting indexed primitives.
- */
- struct {
- GLuint in;
- GLuint out;
- } vert_cache[ELT_TABLE_SIZE];
-
- GLuint vertex_size;
- GLubyte *dstbuf;
- GLubyte *dstptr; /**< dstptr == dstbuf + dstelt_max * vertsize */
- GLuint dstbuf_size; /**< in vertices */
- GLuint dstbuf_nr; /**< count of emitted vertices, also the largest value
- * in dstelt. Our MaxIndex.
- */
-
- GLuint *dstelt;
- GLuint dstelt_nr;
- GLuint dstelt_size;
-
-#define MAX_PRIM 32
- struct _mesa_prim dstprim[MAX_PRIM];
- GLuint dstprim_nr;
-
-};
-
-
-static GLuint attr_size( const struct gl_client_array *array )
-{
- return array->Size * _mesa_sizeof_type(array->Type);
-}
-
-
-/**
- * Starts returning true slightly before the buffer fills, to ensure
- * that there is sufficient room for any remaining vertices to finish
- * off the prim:
- */
-static GLboolean
-check_flush( struct copy_context *copy )
-{
- GLenum mode = copy->dstprim[copy->dstprim_nr].mode;
-
- if (GL_TRIANGLE_STRIP == mode &&
- copy->dstelt_nr & 1) { /* see bug9962 */
- return GL_FALSE;
- }
-
- if (copy->dstbuf_nr + 4 > copy->dstbuf_size)
- return GL_TRUE;
-
- if (copy->dstelt_nr + 4 > copy->dstelt_size)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-
-/**
- * Dump the parameters/info for a vbo->draw() call.
- */
-static void
-dump_draw_info(struct gl_context *ctx,
- const struct gl_client_array **arrays,
- const struct _mesa_prim *prims,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLuint min_index,
- GLuint max_index)
-{
- GLuint i, j;
-
- printf("VBO Draw:\n");
- for (i = 0; i < nr_prims; i++) {
- printf("Prim %u of %u\n", i, nr_prims);
- printf(" Prim mode 0x%x\n", prims[i].mode);
- printf(" IB: %p\n", (void*) ib);
- for (j = 0; j < VERT_ATTRIB_MAX; j++) {
- printf(" array %d at %p:\n", j, (void*) arrays[j]);
- printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n",
- arrays[j]->Enabled, arrays[j]->Ptr,
- arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB);
- if (0) {
- GLint k = prims[i].start + prims[i].count - 1;
- GLfloat *last = (GLfloat *) (arrays[j]->Ptr + arrays[j]->Stride * k);
- printf(" last: %f %f %f\n",
- last[0], last[1], last[2]);
- }
- }
- }
-}
-
-
-static void
-flush( struct copy_context *copy )
-{
- GLuint i;
-
- /* Set some counters:
- */
- copy->dstib.count = copy->dstelt_nr;
-
-#if 0
- dump_draw_info(copy->ctx,
- copy->dstarray_ptr,
- copy->dstprim,
- copy->dstprim_nr,
- &copy->dstib,
- 0,
- copy->dstbuf_nr);
-#else
- (void) dump_draw_info;
-#endif
-
- copy->draw( copy->ctx,
- copy->dstarray_ptr,
- copy->dstprim,
- copy->dstprim_nr,
- &copy->dstib,
- GL_TRUE,
- 0,
- copy->dstbuf_nr - 1 );
-
- /* Reset all pointers:
- */
- copy->dstprim_nr = 0;
- copy->dstelt_nr = 0;
- copy->dstbuf_nr = 0;
- copy->dstptr = copy->dstbuf;
-
- /* Clear the vertex cache:
- */
- for (i = 0; i < ELT_TABLE_SIZE; i++)
- copy->vert_cache[i].in = ~0;
-}
-
-
-/**
- * Called at begin of each primitive during replay.
- */
-static void
-begin( struct copy_context *copy, GLenum mode, GLboolean begin_flag )
-{
- struct _mesa_prim *prim = &copy->dstprim[copy->dstprim_nr];
-
- prim->mode = mode;
- prim->begin = begin_flag;
- prim->num_instances = 1;
-}
-
-
-/**
- * Use a hashtable to attempt to identify recently-emitted vertices
- * and avoid re-emitting them.
- */
-static GLuint
-elt(struct copy_context *copy, GLuint elt_idx)
-{
- GLuint elt = copy->srcelt[elt_idx];
- GLuint slot = elt & (ELT_TABLE_SIZE-1);
-
-/* printf("elt %d\n", elt); */
-
- /* Look up the incoming element in the vertex cache. Re-emit if
- * necessary.
- */
- if (copy->vert_cache[slot].in != elt) {
- GLubyte *csr = copy->dstptr;
- GLuint i;
-
-/* printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */
-
- for (i = 0; i < copy->nr_varying; i++) {
- const struct gl_client_array *srcarray = copy->varying[i].array;
- const GLubyte *srcptr = copy->varying[i].src_ptr + elt * srcarray->StrideB;
-
- memcpy(csr, srcptr, copy->varying[i].size);
- csr += copy->varying[i].size;
-
-#ifdef NAN_CHECK
- if (srcarray->Type == GL_FLOAT) {
- GLuint k;
- GLfloat *f = (GLfloat *) srcptr;
- for (k = 0; k < srcarray->Size; k++) {
- assert(!IS_INF_OR_NAN(f[k]));
- assert(f[k] <= 1.0e20 && f[k] >= -1.0e20);
- }
- }
-#endif
-
- if (0)
- {
- const GLuint *f = (const GLuint *)srcptr;
- GLuint j;
- printf(" varying %d: ", i);
- for(j = 0; j < copy->varying[i].size / 4; j++)
- printf("%x ", f[j]);
- printf("\n");
- }
- }
-
- copy->vert_cache[slot].in = elt;
- copy->vert_cache[slot].out = copy->dstbuf_nr++;
- copy->dstptr += copy->vertex_size;
-
- assert(csr == copy->dstptr);
- assert(copy->dstptr == (copy->dstbuf +
- copy->dstbuf_nr * copy->vertex_size));
- }
-/* else */
-/* printf(" --> reuse vertex\n"); */
-
-/* printf(" --> emit %d\n", copy->vert_cache[slot].out); */
- copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out;
- return check_flush(copy);
-}
-
-
-/**
- * Called at end of each primitive during replay.
- */
-static void
-end( struct copy_context *copy, GLboolean end_flag )
-{
- struct _mesa_prim *prim = &copy->dstprim[copy->dstprim_nr];
-
-/* printf("end (%d)\n", end_flag); */
-
- prim->end = end_flag;
- prim->count = copy->dstelt_nr - prim->start;
-
- if (++copy->dstprim_nr == MAX_PRIM ||
- check_flush(copy))
- flush(copy);
-}
-
-
-static void
-replay_elts( struct copy_context *copy )
-{
- GLuint i, j, k;
- GLboolean split;
-
- for (i = 0; i < copy->nr_prims; i++) {
- const struct _mesa_prim *prim = &copy->prim[i];
- const GLuint start = prim->start;
- GLuint first, incr;
-
- switch (prim->mode) {
-
- case GL_LINE_LOOP:
- /* Convert to linestrip and emit the final vertex explicitly,
- * but only in the resultant strip that requires it.
- */
- j = 0;
- while (j != prim->count) {
- begin(copy, GL_LINE_STRIP, prim->begin && j == 0);
-
- for (split = GL_FALSE; j != prim->count && !split; j++)
- split = elt(copy, start + j);
-
- if (j == prim->count) {
- /* Done, emit final line. Split doesn't matter as
- * it is always raised a bit early so we can emit
- * the last verts if necessary!
- */
- if (prim->end)
- (void)elt(copy, start + 0);
-
- end(copy, prim->end);
- }
- else {
- /* Wrap
- */
- assert(split);
- end(copy, 0);
- j--;
- }
- }
- break;
-
- case GL_TRIANGLE_FAN:
- case GL_POLYGON:
- j = 2;
- while (j != prim->count) {
- begin(copy, prim->mode, prim->begin && j == 0);
-
- split = elt(copy, start+0);
- assert(!split);
-
- split = elt(copy, start+j-1);
- assert(!split);
-
- for (; j != prim->count && !split; j++)
- split = elt(copy, start+j);
-
- end(copy, prim->end && j == prim->count);
-
- if (j != prim->count) {
- /* Wrapped the primitive, need to repeat some vertices:
- */
- j -= 1;
- }
- }
- break;
-
- default:
- (void)split_prim_inplace(prim->mode, &first, &incr);
-
- j = 0;
- while (j != prim->count) {
-
- begin(copy, prim->mode, prim->begin && j == 0);
-
- split = 0;
- for (k = 0; k < first; k++, j++)
- split |= elt(copy, start+j);
-
- assert(!split);
-
- for (; j != prim->count && !split; )
- for (k = 0; k < incr; k++, j++)
- split |= elt(copy, start+j);
-
- end(copy, prim->end && j == prim->count);
-
- if (j != prim->count) {
- /* Wrapped the primitive, need to repeat some vertices:
- */
- assert(j > first - incr);
- j -= (first - incr);
- }
- }
- break;
- }
- }
-
- if (copy->dstprim_nr)
- flush(copy);
-}
-
-
-static void
-replay_init( struct copy_context *copy )
-{
- struct gl_context *ctx = copy->ctx;
- GLuint i;
- GLuint offset;
- const GLvoid *srcptr;
-
- /* Make a list of varying attributes and their vbo's. Also
- * calculate vertex size.
- */
- copy->vertex_size = 0;
- for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- struct gl_buffer_object *vbo = copy->array[i]->BufferObj;
-
- if (copy->array[i]->StrideB == 0) {
- copy->dstarray_ptr[i] = copy->array[i];
- }
- else {
- GLuint j = copy->nr_varying++;
-
- copy->varying[j].attr = i;
- copy->varying[j].array = copy->array[i];
- copy->varying[j].size = attr_size(copy->array[i]);
- copy->vertex_size += attr_size(copy->array[i]);
-
- if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo))
- ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY, vbo);
-
- copy->varying[j].src_ptr = ADD_POINTERS(vbo->Pointer,
- copy->array[i]->Ptr);
-
- copy->dstarray_ptr[i] = &copy->varying[j].dstarray;
- }
- }
-
- /* There must always be an index buffer. Currently require the
- * caller convert non-indexed prims to indexed. Could alternately
- * do it internally.
- */
- if (_mesa_is_bufferobj(copy->ib->obj) &&
- !_mesa_bufferobj_mapped(copy->ib->obj))
- ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY,
- copy->ib->obj);
-
- srcptr = (const GLubyte *) ADD_POINTERS(copy->ib->obj->Pointer,
- copy->ib->ptr);
-
- switch (copy->ib->type) {
- case GL_UNSIGNED_BYTE:
- copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count);
- copy->srcelt = copy->translated_elt_buf;
-
- for (i = 0; i < copy->ib->count; i++)
- copy->translated_elt_buf[i] = ((const GLubyte *)srcptr)[i];
- break;
-
- case GL_UNSIGNED_SHORT:
- copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count);
- copy->srcelt = copy->translated_elt_buf;
-
- for (i = 0; i < copy->ib->count; i++)
- copy->translated_elt_buf[i] = ((const GLushort *)srcptr)[i];
- break;
-
- case GL_UNSIGNED_INT:
- copy->translated_elt_buf = NULL;
- copy->srcelt = (const GLuint *)srcptr;
- break;
- }
-
- /* Figure out the maximum allowed vertex buffer size:
- */
- if (copy->vertex_size * copy->limits->max_verts <= copy->limits->max_vb_size) {
- copy->dstbuf_size = copy->limits->max_verts;
- }
- else {
- copy->dstbuf_size = copy->limits->max_vb_size / copy->vertex_size;
- }
-
- /* Allocate an output vertex buffer:
- *
- * XXX: This should be a VBO!
- */
- copy->dstbuf = malloc(copy->dstbuf_size * copy->vertex_size);
- copy->dstptr = copy->dstbuf;
-
- /* Setup new vertex arrays to point into the output buffer:
- */
- for (offset = 0, i = 0; i < copy->nr_varying; i++) {
- const struct gl_client_array *src = copy->varying[i].array;
- struct gl_client_array *dst = &copy->varying[i].dstarray;
-
- dst->Size = src->Size;
- dst->Type = src->Type;
- dst->Format = GL_RGBA;
- dst->Stride = copy->vertex_size;
- dst->StrideB = copy->vertex_size;
- dst->Ptr = copy->dstbuf + offset;
- dst->Enabled = GL_TRUE;
- dst->Normalized = src->Normalized;
- dst->BufferObj = ctx->Shared->NullBufferObj;
- dst->_ElementSize = src->_ElementSize;
- dst->_MaxElement = copy->dstbuf_size; /* may be less! */
-
- offset += copy->varying[i].size;
- }
-
- /* Allocate an output element list:
- */
- copy->dstelt_size = MIN2(65536,
- copy->ib->count * 2 + 3);
- copy->dstelt_size = MIN2(copy->dstelt_size,
- copy->limits->max_indices);
- copy->dstelt = malloc(sizeof(GLuint) * copy->dstelt_size);
- copy->dstelt_nr = 0;
-
- /* Setup the new index buffer to point to the allocated element
- * list:
- */
- copy->dstib.count = 0; /* duplicates dstelt_nr */
- copy->dstib.type = GL_UNSIGNED_INT;
- copy->dstib.obj = ctx->Shared->NullBufferObj;
- copy->dstib.ptr = copy->dstelt;
-}
-
-
-/**
- * Free up everything allocated during split/replay.
- */
-static void
-replay_finish( struct copy_context *copy )
-{
- struct gl_context *ctx = copy->ctx;
- GLuint i;
-
- /* Free our vertex and index buffers:
- */
- free(copy->translated_elt_buf);
- free(copy->dstbuf);
- free(copy->dstelt);
-
- /* Unmap VBO's
- */
- for (i = 0; i < copy->nr_varying; i++) {
- struct gl_buffer_object *vbo = copy->varying[i].array->BufferObj;
- if (_mesa_is_bufferobj(vbo) && _mesa_bufferobj_mapped(vbo))
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, vbo);
- }
-
- /* Unmap index buffer:
- */
- if (_mesa_is_bufferobj(copy->ib->obj) &&
- _mesa_bufferobj_mapped(copy->ib->obj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, copy->ib->obj);
- }
-}
-
-
-/**
- * Split VBO into smaller pieces, draw the pieces.
- */
-void vbo_split_copy( struct gl_context *ctx,
- const struct gl_client_array *arrays[],
- const struct _mesa_prim *prim,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- vbo_draw_func draw,
- const struct split_limits *limits )
-{
- struct copy_context copy;
- GLuint i, this_nr_prims;
-
- for (i = 0; i < nr_prims;) {
- /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices
- * will rebase the elements to the basevertex, and we'll only
- * emit strings of prims with the same basevertex in one draw call.
- */
- for (this_nr_prims = 1; i + this_nr_prims < nr_prims;
- this_nr_prims++) {
- if (prim[i].basevertex != prim[i + this_nr_prims].basevertex)
- break;
- }
-
- memset(&copy, 0, sizeof(copy));
-
- /* Require indexed primitives:
- */
- assert(ib);
-
- copy.ctx = ctx;
- copy.array = arrays;
- copy.prim = &prim[i];
- copy.nr_prims = this_nr_prims;
- copy.ib = ib;
- copy.draw = draw;
- copy.limits = limits;
-
- /* Clear the vertex cache:
- */
- for (i = 0; i < ELT_TABLE_SIZE; i++)
- copy.vert_cache[i].in = ~0;
-
- replay_init(&copy);
- replay_elts(&copy);
- replay_finish(&copy);
- }
-}
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 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.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+/* Split indexed primitives with per-vertex copying.
+ */
+
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/imports.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+
+#include "vbo_split.h"
+#include "vbo.h"
+
+
+#define ELT_TABLE_SIZE 16
+
+/**
+ * Used for vertex-level splitting of indexed buffers. Note that
+ * non-indexed primitives may be converted to indexed in some cases
+ * (eg loops, fans) in order to use this splitting path.
+ */
+struct copy_context {
+
+ struct gl_context *ctx;
+ const struct gl_client_array **array;
+ const struct _mesa_prim *prim;
+ GLuint nr_prims;
+ const struct _mesa_index_buffer *ib;
+ vbo_draw_func draw;
+
+ const struct split_limits *limits;
+
+ struct {
+ GLuint attr;
+ GLuint size;
+ const struct gl_client_array *array;
+ const GLubyte *src_ptr;
+
+ struct gl_client_array dstarray;
+
+ } varying[VERT_ATTRIB_MAX];
+ GLuint nr_varying;
+
+ const struct gl_client_array *dstarray_ptr[VERT_ATTRIB_MAX];
+ struct _mesa_index_buffer dstib;
+
+ GLuint *translated_elt_buf;
+ const GLuint *srcelt;
+
+ /** A baby hash table to avoid re-emitting (some) duplicate
+ * vertices when splitting indexed primitives.
+ */
+ struct {
+ GLuint in;
+ GLuint out;
+ } vert_cache[ELT_TABLE_SIZE];
+
+ GLuint vertex_size;
+ GLubyte *dstbuf;
+ GLubyte *dstptr; /**< dstptr == dstbuf + dstelt_max * vertsize */
+ GLuint dstbuf_size; /**< in vertices */
+ GLuint dstbuf_nr; /**< count of emitted vertices, also the largest value
+ * in dstelt. Our MaxIndex.
+ */
+
+ GLuint *dstelt;
+ GLuint dstelt_nr;
+ GLuint dstelt_size;
+
+#define MAX_PRIM 32
+ struct _mesa_prim dstprim[MAX_PRIM];
+ GLuint dstprim_nr;
+
+};
+
+
+static GLuint attr_size( const struct gl_client_array *array )
+{
+ return array->Size * _mesa_sizeof_type(array->Type);
+}
+
+
+/**
+ * Starts returning true slightly before the buffer fills, to ensure
+ * that there is sufficient room for any remaining vertices to finish
+ * off the prim:
+ */
+static GLboolean
+check_flush( struct copy_context *copy )
+{
+ GLenum mode = copy->dstprim[copy->dstprim_nr].mode;
+
+ if (GL_TRIANGLE_STRIP == mode &&
+ copy->dstelt_nr & 1) { /* see bug9962 */
+ return GL_FALSE;
+ }
+
+ if (copy->dstbuf_nr + 4 > copy->dstbuf_size)
+ return GL_TRUE;
+
+ if (copy->dstelt_nr + 4 > copy->dstelt_size)
+ return GL_TRUE;
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Dump the parameters/info for a vbo->draw() call.
+ */
+static void
+dump_draw_info(struct gl_context *ctx,
+ const struct gl_client_array **arrays,
+ const struct _mesa_prim *prims,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLuint min_index,
+ GLuint max_index)
+{
+ GLuint i, j;
+
+ printf("VBO Draw:\n");
+ for (i = 0; i < nr_prims; i++) {
+ printf("Prim %u of %u\n", i, nr_prims);
+ printf(" Prim mode 0x%x\n", prims[i].mode);
+ printf(" IB: %p\n", (void*) ib);
+ for (j = 0; j < VERT_ATTRIB_MAX; j++) {
+ printf(" array %d at %p:\n", j, (void*) arrays[j]);
+ printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n",
+ arrays[j]->Enabled, arrays[j]->Ptr,
+ arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB);
+ if (0) {
+ GLint k = prims[i].start + prims[i].count - 1;
+ GLfloat *last = (GLfloat *) (arrays[j]->Ptr + arrays[j]->Stride * k);
+ printf(" last: %f %f %f\n",
+ last[0], last[1], last[2]);
+ }
+ }
+ }
+}
+
+
+static void
+flush( struct copy_context *copy )
+{
+ GLuint i;
+
+ /* Set some counters:
+ */
+ copy->dstib.count = copy->dstelt_nr;
+
+#if 0
+ dump_draw_info(copy->ctx,
+ copy->dstarray_ptr,
+ copy->dstprim,
+ copy->dstprim_nr,
+ &copy->dstib,
+ 0,
+ copy->dstbuf_nr);
+#else
+ (void) dump_draw_info;
+#endif
+
+ copy->draw( copy->ctx,
+ copy->dstarray_ptr,
+ copy->dstprim,
+ copy->dstprim_nr,
+ &copy->dstib,
+ GL_TRUE,
+ 0,
+ copy->dstbuf_nr - 1 );
+
+ /* Reset all pointers:
+ */
+ copy->dstprim_nr = 0;
+ copy->dstelt_nr = 0;
+ copy->dstbuf_nr = 0;
+ copy->dstptr = copy->dstbuf;
+
+ /* Clear the vertex cache:
+ */
+ for (i = 0; i < ELT_TABLE_SIZE; i++)
+ copy->vert_cache[i].in = ~0;
+}
+
+
+/**
+ * Called at begin of each primitive during replay.
+ */
+static void
+begin( struct copy_context *copy, GLenum mode, GLboolean begin_flag )
+{
+ struct _mesa_prim *prim = &copy->dstprim[copy->dstprim_nr];
+
+ prim->mode = mode;
+ prim->begin = begin_flag;
+ prim->num_instances = 1;
+}
+
+
+/**
+ * Use a hashtable to attempt to identify recently-emitted vertices
+ * and avoid re-emitting them.
+ */
+static GLuint
+elt(struct copy_context *copy, GLuint elt_idx)
+{
+ GLuint elt = copy->srcelt[elt_idx];
+ GLuint slot = elt & (ELT_TABLE_SIZE-1);
+
+/* printf("elt %d\n", elt); */
+
+ /* Look up the incoming element in the vertex cache. Re-emit if
+ * necessary.
+ */
+ if (copy->vert_cache[slot].in != elt) {
+ GLubyte *csr = copy->dstptr;
+ GLuint i;
+
+/* printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */
+
+ for (i = 0; i < copy->nr_varying; i++) {
+ const struct gl_client_array *srcarray = copy->varying[i].array;
+ const GLubyte *srcptr = copy->varying[i].src_ptr + elt * srcarray->StrideB;
+
+ memcpy(csr, srcptr, copy->varying[i].size);
+ csr += copy->varying[i].size;
+
+#ifdef NAN_CHECK
+ if (srcarray->Type == GL_FLOAT) {
+ GLuint k;
+ GLfloat *f = (GLfloat *) srcptr;
+ for (k = 0; k < srcarray->Size; k++) {
+ assert(!IS_INF_OR_NAN(f[k]));
+ assert(f[k] <= 1.0e20 && f[k] >= -1.0e20);
+ }
+ }
+#endif
+
+ if (0)
+ {
+ const GLuint *f = (const GLuint *)srcptr;
+ GLuint j;
+ printf(" varying %d: ", i);
+ for(j = 0; j < copy->varying[i].size / 4; j++)
+ printf("%x ", f[j]);
+ printf("\n");
+ }
+ }
+
+ copy->vert_cache[slot].in = elt;
+ copy->vert_cache[slot].out = copy->dstbuf_nr++;
+ copy->dstptr += copy->vertex_size;
+
+ assert(csr == copy->dstptr);
+ assert(copy->dstptr == (copy->dstbuf +
+ copy->dstbuf_nr * copy->vertex_size));
+ }
+/* else */
+/* printf(" --> reuse vertex\n"); */
+
+/* printf(" --> emit %d\n", copy->vert_cache[slot].out); */
+ copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out;
+ return check_flush(copy);
+}
+
+
+/**
+ * Called at end of each primitive during replay.
+ */
+static void
+end( struct copy_context *copy, GLboolean end_flag )
+{
+ struct _mesa_prim *prim = &copy->dstprim[copy->dstprim_nr];
+
+/* printf("end (%d)\n", end_flag); */
+
+ prim->end = end_flag;
+ prim->count = copy->dstelt_nr - prim->start;
+
+ if (++copy->dstprim_nr == MAX_PRIM ||
+ check_flush(copy))
+ flush(copy);
+}
+
+
+static void
+replay_elts( struct copy_context *copy )
+{
+ GLuint i, j, k;
+ GLboolean split;
+
+ for (i = 0; i < copy->nr_prims; i++) {
+ const struct _mesa_prim *prim = &copy->prim[i];
+ const GLuint start = prim->start;
+ GLuint first, incr;
+
+ switch (prim->mode) {
+
+ case GL_LINE_LOOP:
+ /* Convert to linestrip and emit the final vertex explicitly,
+ * but only in the resultant strip that requires it.
+ */
+ j = 0;
+ while (j != prim->count) {
+ begin(copy, GL_LINE_STRIP, prim->begin && j == 0);
+
+ for (split = GL_FALSE; j != prim->count && !split; j++)
+ split = elt(copy, start + j);
+
+ if (j == prim->count) {
+ /* Done, emit final line. Split doesn't matter as
+ * it is always raised a bit early so we can emit
+ * the last verts if necessary!
+ */
+ if (prim->end)
+ (void)elt(copy, start + 0);
+
+ end(copy, prim->end);
+ }
+ else {
+ /* Wrap
+ */
+ assert(split);
+ end(copy, 0);
+ j--;
+ }
+ }
+ break;
+
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ j = 2;
+ while (j != prim->count) {
+ begin(copy, prim->mode, prim->begin && j == 0);
+
+ split = elt(copy, start+0);
+ assert(!split);
+
+ split = elt(copy, start+j-1);
+ assert(!split);
+
+ for (; j != prim->count && !split; j++)
+ split = elt(copy, start+j);
+
+ end(copy, prim->end && j == prim->count);
+
+ if (j != prim->count) {
+ /* Wrapped the primitive, need to repeat some vertices:
+ */
+ j -= 1;
+ }
+ }
+ break;
+
+ default:
+ (void)split_prim_inplace(prim->mode, &first, &incr);
+
+ j = 0;
+ while (j != prim->count) {
+
+ begin(copy, prim->mode, prim->begin && j == 0);
+
+ split = 0;
+ for (k = 0; k < first; k++, j++)
+ split |= elt(copy, start+j);
+
+ assert(!split);
+
+ for (; j != prim->count && !split; )
+ for (k = 0; k < incr; k++, j++)
+ split |= elt(copy, start+j);
+
+ end(copy, prim->end && j == prim->count);
+
+ if (j != prim->count) {
+ /* Wrapped the primitive, need to repeat some vertices:
+ */
+ assert(j > first - incr);
+ j -= (first - incr);
+ }
+ }
+ break;
+ }
+ }
+
+ if (copy->dstprim_nr)
+ flush(copy);
+}
+
+
+static void
+replay_init( struct copy_context *copy )
+{
+ struct gl_context *ctx = copy->ctx;
+ GLuint i;
+ GLuint offset;
+ const GLvoid *srcptr;
+
+ /* Make a list of varying attributes and their vbo's. Also
+ * calculate vertex size.
+ */
+ copy->vertex_size = 0;
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
+ struct gl_buffer_object *vbo = copy->array[i]->BufferObj;
+
+ if (copy->array[i]->StrideB == 0) {
+ copy->dstarray_ptr[i] = copy->array[i];
+ }
+ else {
+ GLuint j = copy->nr_varying++;
+
+ copy->varying[j].attr = i;
+ copy->varying[j].array = copy->array[i];
+ copy->varying[j].size = attr_size(copy->array[i]);
+ copy->vertex_size += attr_size(copy->array[i]);
+
+ if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo))
+ ctx->Driver.MapBufferRange(ctx, 0, vbo->Size, GL_MAP_READ_BIT, vbo);
+
+ copy->varying[j].src_ptr = ADD_POINTERS(vbo->Pointer,
+ copy->array[i]->Ptr);
+
+ copy->dstarray_ptr[i] = &copy->varying[j].dstarray;
+ }
+ }
+
+ /* There must always be an index buffer. Currently require the
+ * caller convert non-indexed prims to indexed. Could alternately
+ * do it internally.
+ */
+ if (_mesa_is_bufferobj(copy->ib->obj) &&
+ !_mesa_bufferobj_mapped(copy->ib->obj))
+ ctx->Driver.MapBufferRange(ctx, 0, copy->ib->obj->Size, GL_MAP_READ_BIT,
+ copy->ib->obj);
+
+ srcptr = (const GLubyte *) ADD_POINTERS(copy->ib->obj->Pointer,
+ copy->ib->ptr);
+
+ switch (copy->ib->type) {
+ case GL_UNSIGNED_BYTE:
+ copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count);
+ copy->srcelt = copy->translated_elt_buf;
+
+ for (i = 0; i < copy->ib->count; i++)
+ copy->translated_elt_buf[i] = ((const GLubyte *)srcptr)[i];
+ break;
+
+ case GL_UNSIGNED_SHORT:
+ copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count);
+ copy->srcelt = copy->translated_elt_buf;
+
+ for (i = 0; i < copy->ib->count; i++)
+ copy->translated_elt_buf[i] = ((const GLushort *)srcptr)[i];
+ break;
+
+ case GL_UNSIGNED_INT:
+ copy->translated_elt_buf = NULL;
+ copy->srcelt = (const GLuint *)srcptr;
+ break;
+ }
+
+ /* Figure out the maximum allowed vertex buffer size:
+ */
+ if (copy->vertex_size * copy->limits->max_verts <= copy->limits->max_vb_size) {
+ copy->dstbuf_size = copy->limits->max_verts;
+ }
+ else {
+ copy->dstbuf_size = copy->limits->max_vb_size / copy->vertex_size;
+ }
+
+ /* Allocate an output vertex buffer:
+ *
+ * XXX: This should be a VBO!
+ */
+ copy->dstbuf = malloc(copy->dstbuf_size * copy->vertex_size);
+ copy->dstptr = copy->dstbuf;
+
+ /* Setup new vertex arrays to point into the output buffer:
+ */
+ for (offset = 0, i = 0; i < copy->nr_varying; i++) {
+ const struct gl_client_array *src = copy->varying[i].array;
+ struct gl_client_array *dst = &copy->varying[i].dstarray;
+
+ dst->Size = src->Size;
+ dst->Type = src->Type;
+ dst->Format = GL_RGBA;
+ dst->Stride = copy->vertex_size;
+ dst->StrideB = copy->vertex_size;
+ dst->Ptr = copy->dstbuf + offset;
+ dst->Enabled = GL_TRUE;
+ dst->Normalized = src->Normalized;
+ dst->BufferObj = ctx->Shared->NullBufferObj;
+ dst->_ElementSize = src->_ElementSize;
+ dst->_MaxElement = copy->dstbuf_size; /* may be less! */
+
+ offset += copy->varying[i].size;
+ }
+
+ /* Allocate an output element list:
+ */
+ copy->dstelt_size = MIN2(65536,
+ copy->ib->count * 2 + 3);
+ copy->dstelt_size = MIN2(copy->dstelt_size,
+ copy->limits->max_indices);
+ copy->dstelt = malloc(sizeof(GLuint) * copy->dstelt_size);
+ copy->dstelt_nr = 0;
+
+ /* Setup the new index buffer to point to the allocated element
+ * list:
+ */
+ copy->dstib.count = 0; /* duplicates dstelt_nr */
+ copy->dstib.type = GL_UNSIGNED_INT;
+ copy->dstib.obj = ctx->Shared->NullBufferObj;
+ copy->dstib.ptr = copy->dstelt;
+}
+
+
+/**
+ * Free up everything allocated during split/replay.
+ */
+static void
+replay_finish( struct copy_context *copy )
+{
+ struct gl_context *ctx = copy->ctx;
+ GLuint i;
+
+ /* Free our vertex and index buffers:
+ */
+ free(copy->translated_elt_buf);
+ free(copy->dstbuf);
+ free(copy->dstelt);
+
+ /* Unmap VBO's
+ */
+ for (i = 0; i < copy->nr_varying; i++) {
+ struct gl_buffer_object *vbo = copy->varying[i].array->BufferObj;
+ if (_mesa_is_bufferobj(vbo) && _mesa_bufferobj_mapped(vbo))
+ ctx->Driver.UnmapBuffer(ctx, vbo);
+ }
+
+ /* Unmap index buffer:
+ */
+ if (_mesa_is_bufferobj(copy->ib->obj) &&
+ _mesa_bufferobj_mapped(copy->ib->obj)) {
+ ctx->Driver.UnmapBuffer(ctx, copy->ib->obj);
+ }
+}
+
+
+/**
+ * Split VBO into smaller pieces, draw the pieces.
+ */
+void vbo_split_copy( struct gl_context *ctx,
+ const struct gl_client_array *arrays[],
+ const struct _mesa_prim *prim,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ vbo_draw_func draw,
+ const struct split_limits *limits )
+{
+ struct copy_context copy;
+ GLuint i, this_nr_prims;
+
+ for (i = 0; i < nr_prims;) {
+ /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices
+ * will rebase the elements to the basevertex, and we'll only
+ * emit strings of prims with the same basevertex in one draw call.
+ */
+ for (this_nr_prims = 1; i + this_nr_prims < nr_prims;
+ this_nr_prims++) {
+ if (prim[i].basevertex != prim[i + this_nr_prims].basevertex)
+ break;
+ }
+
+ memset(&copy, 0, sizeof(copy));
+
+ /* Require indexed primitives:
+ */
+ assert(ib);
+
+ copy.ctx = ctx;
+ copy.array = arrays;
+ copy.prim = &prim[i];
+ copy.nr_prims = this_nr_prims;
+ copy.ib = ib;
+ copy.draw = draw;
+ copy.limits = limits;
+
+ /* Clear the vertex cache:
+ */
+ for (i = 0; i < ELT_TABLE_SIZE; i++)
+ copy.vert_cache[i].in = ~0;
+
+ replay_init(&copy);
+ replay_elts(&copy);
+ replay_finish(&copy);
+ }
+}