diff options
Diffstat (limited to 'src/mesa')
361 files changed, 10490 insertions, 9417 deletions
diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 8b0756b..25e7cce 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -6,37 +6,20 @@ include $(TOP)/configs/current MESA_LIBS := libmesa.a libmesagallium.a DEPENDS := depend -ifeq ($(GLES_OVERLAY),1) -ES1_LIBS := libes1gallium.a -ES2_LIBS := libes2gallium.a -DEPENDS += depend.es1 depend.es2 -endif - MESA_OBJ_DIR := . -ES1_OBJ_DIR := objs-es1 -ES2_OBJ_DIR := objs-es2 include sources.mak # adjust object dirs -ES1_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_OBJECTS)) -ES2_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_OBJECTS)) MESA_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_OBJECTS)) - -ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS)) -ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS)) MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS)) # define preprocessor flags MESA_CPPFLAGS := $(API_DEFINES) $(DEFINES) -ES1_CPPFLAGS := -DFEATURE_ES1=1 $(DEFINES) -ES2_CPPFLAGS := -DFEATURE_ES2=1 $(DEFINES) # append include dirs MESA_CPPFLAGS += $(INCLUDE_DIRS) $(TALLOC_CFLAGS) -ES1_CPPFLAGS += -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS) $(TALLOC_CFLAGS) -ES2_CPPFLAGS += -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS) $(TALLOC_CFLAGS) # tidy compiler flags CFLAGS := $(filter-out $(DEFINES), $(CFLAGS)) @@ -44,8 +27,6 @@ CXXFLAGS := $(filter-out $(DEFINES), $(CXXFLAGS)) # LLVM is needed for the state tracker MESA_CFLAGS := $(LLVM_CFLAGS) -ES1_CFLAGS := $(LLVM_CFLAGS) -ES2_CFLAGS := $(LLVM_CFLAGS) define mesa-cc-c @mkdir -p $(dir $@) @@ -66,29 +47,9 @@ $(MESA_OBJ_DIR)/%.o: %.cpp $(MESA_OBJ_DIR)/%.o: %.S $(call mesa-cc-c,MESA) -$(ES1_OBJ_DIR)/%.o: %.c - $(call mesa-cc-c,ES1) - -$(ES1_OBJ_DIR)/%.o: %.cpp - $(call mesa-cxx-c,ES1) - -$(ES1_OBJ_DIR)/%.o: %.S - $(call mesa-cc-c,ES1) - -$(ES2_OBJ_DIR)/%.o: %.c - $(call mesa-cc-c,ES2) - -$(ES2_OBJ_DIR)/%.o: %.cpp - $(call mesa-cxx-c,ES2) - -$(ES2_OBJ_DIR)/%.o: %.S - $(call mesa-cc-c,ES2) - - # Default: build dependencies, then asm_subdirs, GLSL built-in lib, # then convenience libs (.a) and finally the device drivers: -default: $(DEPENDS) asm_subdirs \ - $(MESA_LIBS) $(ES1_LIBS) $(ES2_LIBS) driver_subdirs +default: $(DEPENDS) asm_subdirs $(MESA_LIBS) driver_subdirs 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 > $@ @@ -103,22 +64,10 @@ main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py m libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS) @ $(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS) -libes1.a: $(ES1_OBJECTS) $(GLSL_LIBS) - @$(MKLIB) -o es1 -static $(ES1_OBJECTS) $(GLSL_LIBS) - -libes2.a: $(ES2_OBJECTS) $(GLSL_LIBS) - @$(MKLIB) -o es2 -static $(ES2_OBJECTS) $(GLSL_LIBS) - # Make archive of subset of core mesa object files for gallium libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) -libes1gallium.a: $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS) - @$(MKLIB) -o es1gallium -static $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS) - -libes2gallium.a: $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS) - @$(MKLIB) -o es2gallium -static $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS) - ###################################################################### # Device drivers driver_subdirs: $(MESA_LIBS) @@ -146,18 +95,6 @@ depend: $(ALL_SOURCES) @$(MKDEP) $(MKDEP_OPTIONS) -p$(MESA_OBJ_DIR)/ $(MESA_CPPFLAGS) \ $(ALL_SOURCES) > /dev/null 2>/dev/null -depend.es1: $(ALL_SOURCES) - @echo "running $(MKDEP) for ES1" - @touch $@ - @$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES1_OBJ_DIR)/ $(ES1_CPPFLAGS) \ - $(ALL_SOURCES) > /dev/null 2>/dev/null - -depend.es2: $(ALL_SOURCES) - @echo "running $(MKDEP) for ES2" - @touch $@ - @$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES2_OBJ_DIR)/ $(ES2_CPPFLAGS) \ - $(ALL_SOURCES) > /dev/null 2>/dev/null - ###################################################################### # Installation rules @@ -192,6 +129,7 @@ gl_pcedit = sed \ -e 's,@GL_PC_REQ_PRIV@,$(GL_PC_REQ_PRIV),' \ -e 's,@GL_PC_LIB_PRIV@,$(GL_PC_LIB_PRIV),' \ -e 's,@GL_PC_CFLAGS@,$(GL_PC_CFLAGS),' \ + -e 's,@GLX_TLS@,$(GLX_TLS),' \ -e 's,@GL_LIB@,$(GL_LIB),' gl.pc: gl.pc.in @@ -234,17 +172,7 @@ install-dri: default tags: etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h -clean-es1: - -rm -f $(ES1_LIBS) - -rm -rf $(ES1_OBJ_DIR) - -rm -f depend.es1 depend.es1.bak - -clean-es2: - -rm -f $(ES2_LIBS) - -rm -rf $(ES2_OBJ_DIR) - -rm -f depend.es2 depend.es2.bak - -clean: clean-es1 clean-es2 +clean: -rm -f */*.o -rm -f */*/*.o -rm -f depend depend.bak libmesa.a libmesagallium.a diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 08d731d..cc4ad09 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -16,7 +16,6 @@ if env['platform'] == 'windows': env.Append(CPPDEFINES = [ '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers - 'WIN32_THREADS', # use Win32 thread API ]) env.Prepend(CPPPATH = ['#src/talloc']) else: diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index ba8be12..fd12e4d 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -266,13 +266,16 @@ struct gen_mipmap_state GLuint FBO; }; - +#define MAX_META_OPS_DEPTH 2 /** * All per-context meta state. */ struct gl_meta_state { - struct save_state Save; /**< state saved during meta-ops */ + /** Stack of state saved during meta-ops */ + struct save_state Save[MAX_META_OPS_DEPTH]; + /** Save stack depth */ + GLuint SaveStackDepth; struct temp_texture TempTex; @@ -324,8 +327,13 @@ _mesa_meta_free(struct gl_context *ctx) static void _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) { - struct save_state *save = &ctx->Meta->Save; + struct save_state *save; + + /* hope MAX_META_OPS_DEPTH is large enough */ + assert(ctx->Meta->SaveStackDepth < MAX_META_OPS_DEPTH); + save = &ctx->Meta->Save[ctx->Meta->SaveStackDepth++]; + memset(save, 0, sizeof(*save)); save->SavedState = state; if (state & META_ALPHA_TEST) { @@ -575,7 +583,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) static void _mesa_meta_end(struct gl_context *ctx) { - struct save_state *save = &ctx->Meta->Save; + struct save_state *save = &ctx->Meta->Save[--ctx->Meta->SaveStackDepth]; const GLbitfield state = save->SavedState; if (state & META_ALPHA_TEST) { @@ -1398,6 +1406,7 @@ _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; + const GLuint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; if (buffers & BUFFER_BITS_COLOR) { /* if clearing color buffers, don't save/restore colormask */ @@ -1453,7 +1462,7 @@ _mesa_meta_Clear(struct gl_context *ctx, GLbitfield buffers) _mesa_StencilOpSeparate(GL_FRONT_AND_BACK, GL_REPLACE, GL_REPLACE, GL_REPLACE); _mesa_StencilFuncSeparate(GL_FRONT_AND_BACK, GL_ALWAYS, - ctx->Stencil.Clear & 0x7fffffff, + ctx->Stencil.Clear & stencilMax, ctx->Stencil.WriteMask[0]); } else { @@ -2251,7 +2260,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, const GLuint maxLevel = texObj->MaxLevel; const GLenum minFilterSave = texObj->MinFilter; const GLenum magFilterSave = texObj->MagFilter; - const GLint baseLevelSave = texObj->BaseLevel; const GLint maxLevelSave = texObj->MaxLevel; const GLboolean genMipmapSave = texObj->GenerateMipmap; const GLenum wrapSSave = texObj->WrapS; @@ -2311,7 +2319,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, } _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); - _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -2487,8 +2495,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, } } - /* limit sampling to src level */ - _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + /* limit minification to src level */ _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); /* Set to draw into the current dstLevel */ @@ -2540,7 +2547,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); - _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index a5b71bd..bf8cf6e 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -790,6 +790,9 @@ driCreateNewScreen(int scrn, static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; + if (driDriverAPI.InitScreen == NULL) + return NULL; + psp = calloc(1, sizeof *psp); if (!psp) return NULL; diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index abd79562..f436d13 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -48,6 +48,15 @@ #define HW_WRITE_CLIPLOOP() HW_CLIPLOOP() #endif +#ifdef SPANTMP_MESA_FMT +#define SPANTMP_PIXEL_FMT GL_NONE +#define SPANTMP_PIXEL_TYPE GL_NONE +#endif + +#ifndef SPANTMP_MESA_FMT +#define SPANTMP_MESA_FMT MESA_FORMAT_COUNT +#endif + #if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5) /** @@ -445,6 +454,118 @@ rgba[3] = p; \ } while (0) +#elif (SPANTMP_MESA_FMT == MESA_FORMAT_R8) + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLubyte *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLubyte *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + p = color[0] + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, r) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLubyte p = GET_VALUE(_x, _y); \ + rgba[0] = p; \ + rgba[1] = 0; \ + rgba[2] = 0; \ + rgba[3] = 0; \ + } while (0) + +#elif (SPANTMP_MESA_FMT == MESA_FORMAT_RG88) + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + PACK_COLOR_8888(color[0], color[1], 0, 0) + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, r) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLushort p = GET_VALUE(_x, _y); \ + rgba[0] = p & 0xff; \ + rgba[1] = (p >> 8) & 0xff; \ + rgba[2] = 0; \ + rgba[3] = 0; \ + } while (0) + +#elif (SPANTMP_MESA_FMT == MESA_FORMAT_R16) + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + p = color[0] + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, r) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLushort p = GET_VALUE(_x, _y); \ + rgba[0] = p; \ + rgba[1] = 0; \ + rgba[2] = 0; \ + rgba[3] = 0; \ + } while (0) + +#elif (SPANTMP_MESA_FMT == MESA_FORMAT_RG1616) + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + ((color[1] << 16) | (color[0])) + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, r) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + rgba[0] = p & 0xffff; \ + rgba[1] = (p >> 16) & 0xffff; \ + rgba[2] = 0; \ + rgba[3] = 0; \ + } while (0) + #else #error SPANTMP_PIXEL_FMT must be set to a valid value! #endif @@ -914,3 +1035,4 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb) #undef GET_PTR #undef SPANTMP_PIXEL_FMT #undef SPANTMP_PIXEL_TYPE +#undef SPANTMP_MESA_FMT diff --git a/src/mesa/drivers/dri/i915/i830_reg.h b/src/mesa/drivers/dri/i915/i830_reg.h index ae13170..99ee1bb 100644 --- a/src/mesa/drivers/dri/i915/i830_reg.h +++ b/src/mesa/drivers/dri/i915/i830_reg.h @@ -585,6 +585,8 @@ #define TM0S2_VERITCAL_LINE_STRIDE_OFF (1<<12) #define TM0S2_OUTPUT_CHAN_SHIFT 10 #define TM0S2_OUTPUT_CHAN_MASK (3<<10) +#define TM0S2_BASE_MIP_LEVEL_SHIFT 1 +#define TM0S2_LOD_PRECLAMP (1 << 0) #define TM0S3_MIP_FILTER_MASK (0x3<<30) #define TM0S3_MIP_FILTER_SHIFT 30 @@ -605,6 +607,8 @@ #define TM0S3_MAX_MIP_MASK (0xff<<9) #define TM0S3_MIN_MIP_SHIFT 3 #define TM0S3_MIN_MIP_MASK (0x3f<<3) +#define TM0S3_MIN_MIP_SHIFT_830 5 +#define TM0S3_MIN_MIP_MASK_830 (0x3f<<5) #define TM0S3_KILL_PIXEL (1<<2) #define TM0S3_KEYED_FILTER (1<<1) #define TM0S3_CHROMA_KEY (1<<0) diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index b3bb883..c35b4b5 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -28,13 +28,14 @@ #include "main/mtypes.h" #include "main/enums.h" #include "main/colormac.h" +#include "main/macros.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" #include "i830_context.h" #include "i830_reg.h" - +#include "intel_chipset.h" static GLuint @@ -139,9 +140,9 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) /* Get first image here, since intelObj->firstLevel will get set in * the intel_finalize_mipmap_tree() call above. */ - firstImage = tObj->Image[0][intelObj->firstLevel]; + firstImage = tObj->Image[0][tObj->BaseLevel]; - intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0, + intel_miptree_get_image_offset(intelObj->mt, tObj->BaseLevel, 0, 0, &dst_x, &dst_y); drm_intel_bo_reference(intelObj->mt->region->buffer); @@ -189,6 +190,8 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) { GLuint minFilt, mipFilt, magFilt; + float maxlod; + uint32_t minlod_fixed, maxlod_fixed; switch (tObj->MinFilter) { case GL_NEAREST: @@ -252,10 +255,24 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) state[I830_TEXREG_TM0S3] |= SS2_COLORSPACE_CONVERSION; #endif - state[I830_TEXREG_TM0S3] |= ((intelObj->lastLevel - - intelObj->firstLevel) * - 4) << TM0S3_MIN_MIP_SHIFT; - + /* We get one field with fraction bits for the maximum + * addressable (smallest resolution) LOD. Use it to cover both + * MAX_LEVEL and MAX_LOD. + */ + minlod_fixed = U_FIXED(CLAMP(tObj->MinLod, 0.0, 11), 4); + maxlod = MIN2(tObj->MaxLod, tObj->_MaxLevel - tObj->BaseLevel); + if (intel->intelScreen->deviceID == PCI_CHIP_I855_GM || + intel->intelScreen->deviceID == PCI_CHIP_I865_G) { + maxlod_fixed = U_FIXED(CLAMP(maxlod, 0.0, 11.75), 2); + maxlod_fixed = MAX2(maxlod_fixed, (minlod_fixed + 3) >> 2); + state[I830_TEXREG_TM0S3] |= maxlod_fixed << TM0S3_MIN_MIP_SHIFT; + state[I830_TEXREG_TM0S2] |= TM0S2_LOD_PRECLAMP; + } else { + maxlod_fixed = U_FIXED(CLAMP(maxlod, 0.0, 11), 0); + maxlod_fixed = MAX2(maxlod_fixed, (minlod_fixed + 15) >> 4); + state[I830_TEXREG_TM0S3] |= maxlod_fixed << TM0S3_MIN_MIP_SHIFT_830; + } + state[I830_TEXREG_TM0S3] |= minlod_fixed << TM0S3_MAX_MIP_SHIFT; state[I830_TEXREG_TM0S3] |= ((minFilt << TM0S3_MIN_FILTER_SHIFT) | (mipFilt << TM0S3_MIP_FILTER_SHIFT) | (magFilt << TM0S3_MAG_FILTER_SHIFT)); diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index f7fdb78..ebdefea 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -364,7 +364,7 @@ i830_emit_invarient_state(struct intel_context *intel) #define emit( intel, state, size ) \ - intel_batchbuffer_data(intel->batch, state, size ) + intel_batchbuffer_data(intel->batch, state, size, false) static GLuint get_dirty(struct i830_hw_state *state) @@ -429,7 +429,8 @@ i830_emit_state(struct intel_context *intel) * batchbuffer fills up. */ intel_batchbuffer_require_space(intel->batch, - get_state_size(state) + INTEL_PRIM_EMIT_SIZE); + get_state_size(state) + INTEL_PRIM_EMIT_SIZE, + false); count = 0; again: aper_count = 0; @@ -534,14 +535,9 @@ i830_emit_state(struct intel_context *intel) BEGIN_BATCH(I830_TEX_SETUP_SIZE + 1); OUT_BATCH(state->Tex[i][I830_TEXREG_TM0LI]); - if (state->tex_buffer[i]) { - OUT_RELOC(state->tex_buffer[i], - I915_GEM_DOMAIN_SAMPLER, 0, - state->tex_offset[i]); - } - else { - OUT_BATCH(state->tex_offset[i]); - } + OUT_RELOC(state->tex_buffer[i], + I915_GEM_DOMAIN_SAMPLER, 0, + state->tex_offset[i]); OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S1]); OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S2]); @@ -584,6 +580,27 @@ i830_destroy_context(struct intel_context *intel) _tnl_free_vertices(&intel->ctx); } +static uint32_t i830_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] = +{ + [MESA_FORMAT_ARGB8888] = DV_PF_8888, + [MESA_FORMAT_XRGB8888] = DV_PF_8888, + [MESA_FORMAT_RGB565] = DV_PF_565, + [MESA_FORMAT_ARGB1555] = DV_PF_1555, + [MESA_FORMAT_ARGB4444] = DV_PF_4444, +}; + +static bool +i830_render_target_supported(gl_format format) +{ + if (format == MESA_FORMAT_S8_Z24 || + format == MESA_FORMAT_X8_Z24 || + format == MESA_FORMAT_Z16) { + return true; + } + + return i830_render_target_format_for_mesa_format[format] != 0; +} + static void i830_set_draw_region(struct intel_context *intel, struct intel_region *color_regions[], @@ -623,24 +640,7 @@ i830_set_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z); /* .5 */ if (irb != NULL) { - switch (irb->Base.Format) { - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_XRGB8888: - value |= DV_PF_8888; - break; - case MESA_FORMAT_RGB565: - value |= DV_PF_565; - break; - case MESA_FORMAT_ARGB1555: - value |= DV_PF_1555; - break; - case MESA_FORMAT_ARGB4444: - value |= DV_PF_4444; - break; - default: - _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->Base.Format); - } + value |= i830_render_target_format_for_mesa_format[irb->Base.Format]; } if (depth_region && depth_region->cpp == 4) { @@ -728,4 +728,5 @@ i830InitVtbl(struct i830_context *i830) i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty; i830->intel.vtbl.finish_batch = intel_finish_vb; i830->intel.vtbl.invalidate_state = i830_invalidate_state; + i830->intel.vtbl.render_target_supported = i830_render_target_supported; } diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index f943f81..f32f3cf 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -176,6 +176,7 @@ i915CreateContext(int api, ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = GL_TRUE; ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT].EmitNoIfs = GL_TRUE; ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT].EmitNoNoise = GL_TRUE; + ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT].EmitNoPow = GL_TRUE; ctx->Const.MaxDrawBuffers = 1; diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index c00ee41..1c6e984 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -569,10 +569,14 @@ upload_program(struct i915_fragment_program *p) if (inst->DstReg.CondMask == COND_TR) { tmp = i915_get_utemp(p); + /* The KIL instruction discards the fragment if any component of + * the source is < 0. Emit an immediate operand of {-1}.xywz. + */ i915_emit_texld(p, get_live_regs(p, inst), tmp, A0_DEST_CHANNEL_ALL, 0, /* use a dummy dest reg */ - swizzle(tmp, ONE, ONE, ONE, ONE), /* always */ + negate(swizzle(tmp, ONE, ONE, ONE, ONE), + 1, 1, 1, 1), T0_TEXKILL); } else { p->error = 1; @@ -1158,11 +1162,6 @@ translate_program(struct i915_fragment_program *p) fixup_depth_write(p); i915_fini_program(p); - if (INTEL_DEBUG & DEBUG_WM) { - printf("i915:\n"); - i915_disassemble_program(i915->state.Program, i915->state.ProgramSize); - } - p->translated = 1; } @@ -1423,6 +1422,11 @@ i915ValidateFragmentProgram(struct i915_context *i915) if (!p->on_hardware) i915_upload_program(i915, p); + + if (INTEL_DEBUG & DEBUG_WM) { + printf("i915:\n"); + i915_disassemble_program(i915->state.Program, i915->state.ProgramSize); + } } void diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index c724a21..af140c8 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -156,7 +156,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) /* Get first image here, since intelObj->firstLevel will get set in * the intel_finalize_mipmap_tree() call above. */ - firstImage = tObj->Image[0][intelObj->firstLevel]; + firstImage = tObj->Image[0][tObj->BaseLevel]; drm_intel_bo_reference(intelObj->mt->region->buffer); i915->state.tex_buffer[unit] = intelObj->mt->region->buffer; diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 59dfe08..a94b957 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -217,7 +217,7 @@ i915_emit_invarient_state(struct intel_context *intel) #define emit(intel, state, size ) \ - intel_batchbuffer_data(intel->batch, state, size) + intel_batchbuffer_data(intel->batch, state, size, false) static GLuint get_dirty(struct i915_hw_state *state) @@ -300,7 +300,8 @@ i915_emit_state(struct intel_context *intel) * batchbuffer fills up. */ intel_batchbuffer_require_space(intel->batch, - get_state_size(state) + INTEL_PRIM_EMIT_SIZE); + get_state_size(state) + INTEL_PRIM_EMIT_SIZE, + false); count = 0; again: aper_count = 0; @@ -435,15 +436,9 @@ i915_emit_state(struct intel_context *intel) OUT_BATCH((dirty & I915_UPLOAD_TEX_ALL) >> I915_UPLOAD_TEX_0_SHIFT); for (i = 0; i < I915_TEX_UNITS; i++) if (dirty & I915_UPLOAD_TEX(i)) { - - if (state->tex_buffer[i]) { - OUT_RELOC(state->tex_buffer[i], - I915_GEM_DOMAIN_SAMPLER, 0, - state->tex_offset[i]); - } - else { - OUT_BATCH(state->tex_offset[i]); - } + OUT_RELOC(state->tex_buffer[i], + I915_GEM_DOMAIN_SAMPLER, 0, + state->tex_offset[i]); OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]); OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]); @@ -523,6 +518,27 @@ i915_set_buf_info_for_region(uint32_t *state, struct intel_region *region, } } +static uint32_t i915_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] = +{ + [MESA_FORMAT_ARGB8888] = DV_PF_8888, + [MESA_FORMAT_XRGB8888] = DV_PF_8888, + [MESA_FORMAT_RGB565] = DV_PF_565 | DITHER_FULL_ALWAYS, + [MESA_FORMAT_ARGB1555] = DV_PF_1555 | DITHER_FULL_ALWAYS, + [MESA_FORMAT_ARGB4444] = DV_PF_4444 | DITHER_FULL_ALWAYS, +}; + +static bool +i915_render_target_supported(gl_format format) +{ + if (format == MESA_FORMAT_S8_Z24 || + format == MESA_FORMAT_X8_Z24 || + format == MESA_FORMAT_Z16) { + return true; + } + + return i915_render_target_format_for_mesa_format[format] != 0; +} + static void i915_set_draw_region(struct intel_context *intel, struct intel_region *color_regions[], @@ -562,24 +578,7 @@ i915_set_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | /* .5 */ LOD_PRECLAMP_OGL | TEX_DEFAULT_COLOR_OGL); if (irb != NULL) { - switch (irb->Base.Format) { - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_XRGB8888: - value |= DV_PF_8888; - break; - case MESA_FORMAT_RGB565: - value |= DV_PF_565 | DITHER_FULL_ALWAYS; - break; - case MESA_FORMAT_ARGB1555: - value |= DV_PF_1555 | DITHER_FULL_ALWAYS; - break; - case MESA_FORMAT_ARGB4444: - value |= DV_PF_4444 | DITHER_FULL_ALWAYS; - break; - default: - _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->Base.Format); - } + value |= i915_render_target_format_for_mesa_format[irb->Base.Format]; } /* This isn't quite safe, thus being hidden behind an option. When changing @@ -686,4 +685,5 @@ i915InitVtbl(struct i915_context *i915) i915->intel.vtbl.update_texture_state = i915UpdateTextureState; i915->intel.vtbl.assert_not_dirty = i915_assert_not_dirty; i915->intel.vtbl.finish_batch = intel_finish_vb; + i915->intel.vtbl.render_target_supported = i915_render_target_supported; } diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index e3ca863..7c3ac0c 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -81,7 +81,6 @@ DRIVER_SOURCES = \ brw_wm_emit.c \ brw_wm_fp.c \ brw_wm_iz.c \ - brw_wm_glsl.c \ brw_wm_pass0.c \ brw_wm_pass1.c \ brw_wm_pass2.c \ diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index d3a1233..d286c9d 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -239,7 +239,7 @@ static void upload_blend_constant_color(struct brw_context *brw) struct brw_blend_constant_color bcc; memset(&bcc, 0, sizeof(bcc)); - bcc.header.opcode = CMD_BLEND_CONSTANT_COLOR; + bcc.header.opcode = _3DSTATE_BLEND_CONSTANT_COLOR; bcc.header.length = sizeof(bcc)/4-2; bcc.blend_constant_color[0] = ctx->Color.BlendColor[0]; bcc.blend_constant_color[1] = ctx->Color.BlendColor[1]; diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index cb0a8b9..8fc322f 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -122,9 +122,6 @@ GLboolean brwCreateContext( int api, (i == MESA_SHADER_FRAGMENT); ctx->ShaderCompilerOptions[i].EmitNoIndirectTemp = (i == MESA_SHADER_FRAGMENT); - - if (intel->gen == 6) - ctx->ShaderCompilerOptions[i].EmitNoIfs = (i == MESA_SHADER_VERTEX); } ctx->Const.VertexProgram.MaxNativeInstructions = (16 * 1024); @@ -154,6 +151,13 @@ GLboolean brwCreateContext( int api, MIN2(ctx->Const.FragmentProgram.MaxNativeParameters, ctx->Const.FragmentProgram.MaxEnvParams); + /* Gen6 converts quads to polygon in beginning of 3D pipeline, + but we're not sure how it's actually done for vertex order, + that affect provoking vertex decision. Always use last vertex + convention for quad primitive which works as expected for now. */ + if (intel->gen == 6) + ctx->Const.QuadsFollowProvokingVertexConvention = GL_FALSE; + if (intel->is_g4x || intel->gen >= 5) { brw->CMD_VF_STATISTICS = CMD_VF_STATISTICS_GM45; brw->CMD_PIPELINE_SELECT = CMD_PIPELINE_SELECT_GM45; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 3353395..7069724 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -171,7 +171,6 @@ struct brw_vertex_program { struct brw_fragment_program { struct gl_fragment_program program; GLuint id; /**< serial no. to identify frag progs, never re-used */ - GLboolean isGLSL; /**< really, any IF/LOOP/CONT/BREAK instructions */ /** for debugging, which texture units are referenced */ GLbitfield tex_units_used; @@ -211,6 +210,7 @@ struct brw_wm_prog_data { GLuint nr_params; /**< number of float params/constants */ GLuint nr_pull_params; GLboolean error; + int dispatch_width; /* Pointer to tracked values (only valid once * _mesa_load_state_parameters has been called at runtime). diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 7b823eb..877b22f 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -242,21 +242,13 @@ static void prepare_constant_buffer(struct brw_context *brw) GLuint offset = brw->curbe.vs_start * 16; GLuint nr = brw->vs.prog_data->nr_params / 4; - if (vp->use_const_buffer) { - /* Load the subset of push constants that will get used when - * we also have a pull constant buffer. - */ - for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) { - if (brw->vs.constant_map[i] != -1) { - assert(brw->vs.constant_map[i] <= nr); - memcpy(buf + offset + brw->vs.constant_map[i] * 4, - vp->program.Base.Parameters->ParameterValues[i], - 4 * sizeof(float)); - } - } - } else { - for (i = 0; i < nr; i++) { - memcpy(buf + offset + i * 4, + /* Load the subset of push constants that will get used when + * we also have a pull constant buffer. + */ + for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) { + if (brw->vs.constant_map[i] != -1) { + assert(brw->vs.constant_map[i] <= nr); + memcpy(buf + offset + brw->vs.constant_map[i] * 4, vp->program.Base.Parameters->ParameterValues[i], 4 * sizeof(float)); } diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 239586a..2f7dcc2 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -35,28 +35,6 @@ /* 3D state: */ -#define _3DOP_3DSTATE_PIPELINED 0x0 -#define _3DOP_3DSTATE_NONPIPELINED 0x1 -#define _3DOP_3DCONTROL 0x2 -#define _3DOP_3DPRIMITIVE 0x3 - -#define _3DSTATE_PIPELINED_POINTERS 0x00 -#define _3DSTATE_BINDING_TABLE_POINTERS 0x01 -#define _3DSTATE_VERTEX_BUFFERS 0x08 -#define _3DSTATE_VERTEX_ELEMENTS 0x09 -#define _3DSTATE_INDEX_BUFFER 0x0A -#define _3DSTATE_VF_STATISTICS 0x0B -#define _3DSTATE_DRAWING_RECTANGLE 0x00 -#define _3DSTATE_CONSTANT_COLOR 0x01 -#define _3DSTATE_SAMPLER_PALETTE_LOAD 0x02 -#define _3DSTATE_CHROMA_KEY 0x04 -#define _3DSTATE_DEPTH_BUFFER 0x05 -#define _3DSTATE_POLY_STIPPLE_OFFSET 0x06 -#define _3DSTATE_POLY_STIPPLE_PATTERN 0x07 -#define _3DSTATE_LINE_STIPPLE 0x08 -#define _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP 0x09 -#define _3DCONTROL 0x00 - #define PIPE_CONTROL_NOWRITE 0x00 #define PIPE_CONTROL_WRITEIMMEDIATE 0x01 #define PIPE_CONTROL_WRITEDEPTH 0x02 @@ -389,6 +367,7 @@ #define BRW_SURFACEFORMAT_R8_SSCALED 0x149 #define BRW_SURFACEFORMAT_R8_USCALED 0x14A #define BRW_SURFACEFORMAT_L8_UNORM_SRGB 0x14C +#define BRW_SURFACEFORMAT_DXT1_RGB_SRGB 0x180 #define BRW_SURFACEFORMAT_R1_UINT 0x181 #define BRW_SURFACEFORMAT_YCRCB_NORMAL 0x182 #define BRW_SURFACEFORMAT_YCRCB_SWAPUVY 0x183 @@ -462,6 +441,13 @@ #define BRW_COMPRESSION_2NDHALF 1 #define BRW_COMPRESSION_COMPRESSED 2 +#define GEN6_COMPRESSION_1Q 0 +#define GEN6_COMPRESSION_2Q 1 +#define GEN6_COMPRESSION_3Q 2 +#define GEN6_COMPRESSION_4Q 3 +#define GEN6_COMPRESSION_1H 0 +#define GEN6_COMPRESSION_2H 2 + #define BRW_CONDITIONAL_NONE 0 #define BRW_CONDITIONAL_Z 1 #define BRW_CONDITIONAL_NZ 2 @@ -837,7 +823,7 @@ # define GEN6_BINDING_TABLE_MODIFY_GS (1 << 9) # define GEN6_BINDING_TABLE_MODIFY_PS (1 << 12) -#define CMD_3D_SAMPLER_STATE_POINTERS 0x7802 /* SNB+ */ +#define _3DSTATE_SAMPLER_STATE_POINTERS 0x7802 /* GEN6+ */ # define PS_SAMPLER_STATE_CHANGE (1 << 12) # define GS_SAMPLER_STATE_CHANGE (1 << 9) # define VS_SAMPLER_STATE_CHANGE (1 << 8) @@ -878,27 +864,29 @@ #define CMD_INDEX_BUFFER 0x780a #define CMD_VF_STATISTICS_965 0x780b #define CMD_VF_STATISTICS_GM45 0x680b -#define CMD_3D_CC_STATE_POINTERS 0x780e /* GEN6+ */ +#define _3DSTATE_CC_STATE_POINTERS 0x780e /* GEN6+ */ -#define CMD_URB 0x7805 /* GEN6+ */ +#define _3DSTATE_URB 0x7805 /* GEN6+ */ # define GEN6_URB_VS_SIZE_SHIFT 16 # define GEN6_URB_VS_ENTRIES_SHIFT 0 # define GEN6_URB_GS_ENTRIES_SHIFT 8 # define GEN6_URB_GS_SIZE_SHIFT 0 -#define CMD_VIEWPORT_STATE_POINTERS 0x780d /* GEN6+ */ +#define _3DSTATE_VIEWPORT_STATE_POINTERS 0x780d /* GEN6+ */ # define GEN6_CC_VIEWPORT_MODIFY (1 << 12) # define GEN6_SF_VIEWPORT_MODIFY (1 << 11) # define GEN6_CLIP_VIEWPORT_MODIFY (1 << 10) -#define CMD_3D_SCISSOR_STATE_POINTERS 0x780f /* GEN6+ */ +#define _3DSTATE_SCISSOR_STATE_POINTERS 0x780f /* GEN6+ */ -#define CMD_3D_VS_STATE 0x7810 /* GEN6+ */ +#define _3DSTATE_VS 0x7810 /* GEN6+ */ /* DW2 */ # define GEN6_VS_SPF_MODE (1 << 31) # define GEN6_VS_VECTOR_MASK_ENABLE (1 << 30) # define GEN6_VS_SAMPLER_COUNT_SHIFT 27 # define GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 +# define GEN6_VS_FLOATING_POINT_MODE_IEEE_754 (0 << 16) +# define GEN6_VS_FLOATING_POINT_MODE_ALT (1 << 16) /* DW4 */ # define GEN6_VS_DISPATCH_START_GRF_SHIFT 20 # define GEN6_VS_URB_READ_LENGTH_SHIFT 11 @@ -909,7 +897,7 @@ # define GEN6_VS_CACHE_DISABLE (1 << 1) # define GEN6_VS_ENABLE (1 << 0) -#define CMD_3D_GS_STATE 0x7811 /* GEN6+ */ +#define _3DSTATE_GS 0x7811 /* GEN6+ */ /* DW2 */ # define GEN6_GS_SPF_MODE (1 << 31) # define GEN6_GS_VECTOR_MASK_ENABLE (1 << 30) @@ -927,7 +915,7 @@ /* DW6 */ # define GEN6_GS_ENABLE (1 << 15) -#define CMD_3D_CLIP_STATE 0x7812 /* GEN6+ */ +#define _3DSTATE_CLIP 0x7812 /* GEN6+ */ /* DW1 */ # define GEN6_CLIP_STATISTICS_ENABLE (1 << 10) /** @@ -957,7 +945,7 @@ # define GEN6_CLIP_MAX_POINT_WIDTH_SHIFT 6 # define GEN6_CLIP_FORCE_ZERO_RTAINDEX (1 << 5) -#define CMD_3D_SF_STATE 0x7813 /* GEN6+ */ +#define _3DSTATE_SF 0x7813 /* GEN6+ */ /* DW1 */ # define GEN6_SF_NUM_OUTPUTS_SHIFT 22 # define GEN6_SF_SWIZZLE_ENABLE (1 << 21) @@ -1022,18 +1010,27 @@ # define ATTRIBUTE_0_CONST_SOURCE_SHIFT 9 # define ATTRIBUTE_0_SWIZZLE_SHIFT 6 # define ATTRIBUTE_0_SOURCE_SHIFT 0 + +# define ATTRIBUTE_SWIZZLE_INPUTATTR 0 +# define ATTRIBUTE_SWIZZLE_INPUTATTR_FACING 1 +# define ATTRIBUTE_SWIZZLE_INPUTATTR_W 2 +# define ATTRIBUTE_SWIZZLE_INPUTATTR_FACING_W 3 +# define ATTRIBUTE_SWIZZLE_SHIFT 6 + /* DW16: Point sprite texture coordinate enables */ /* DW17: Constant interpolation enables */ /* DW18: attr 0-7 wrap shortest enables */ /* DW19: attr 8-16 wrap shortest enables */ -#define CMD_3D_WM_STATE 0x7814 /* GEN6+ */ +#define _3DSTATE_WM 0x7814 /* GEN6+ */ /* DW1: kernel pointer */ /* DW2 */ # define GEN6_WM_SPF_MODE (1 << 31) # define GEN6_WM_VECTOR_MASK_ENABLE (1 << 30) # define GEN6_WM_SAMPLER_COUNT_SHIFT 27 # define GEN6_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 +# define GEN6_WM_FLOATING_POINT_MODE_IEEE_754 (0 << 16) +# define GEN6_WM_FLOATING_POINT_MODE_ALT (1 << 16) /* DW3: scratch space */ /* DW4 */ # define GEN6_WM_STATISTICS_ENABLE (1 << 31) @@ -1088,34 +1085,34 @@ /* DW7: kernel 1 pointer */ /* DW8: kernel 2 pointer */ -#define CMD_3D_CONSTANT_VS_STATE 0x7815 /* GEN6+ */ -#define CMD_3D_CONSTANT_GS_STATE 0x7816 /* GEN6+ */ -#define CMD_3D_CONSTANT_PS_STATE 0x7817 /* GEN6+ */ +#define _3DSTATE_CONSTANT_VS 0x7815 /* GEN6+ */ +#define _3DSTATE_CONSTANT_GS 0x7816 /* GEN6+ */ +#define _3DSTATE_CONSTANT_PS 0x7817 /* GEN6+ */ # define GEN6_CONSTANT_BUFFER_3_ENABLE (1 << 15) # define GEN6_CONSTANT_BUFFER_2_ENABLE (1 << 14) # define GEN6_CONSTANT_BUFFER_1_ENABLE (1 << 13) # define GEN6_CONSTANT_BUFFER_0_ENABLE (1 << 12) -#define CMD_3D_SAMPLE_MASK 0x7818 /* GEN6+ */ +#define _3DSTATE_SAMPLE_MASK 0x7818 /* GEN6+ */ -#define CMD_DRAW_RECT 0x7900 -#define CMD_BLEND_CONSTANT_COLOR 0x7901 -#define CMD_CHROMA_KEY 0x7904 -#define CMD_DEPTH_BUFFER 0x7905 -#define CMD_POLY_STIPPLE_OFFSET 0x7906 -#define CMD_POLY_STIPPLE_PATTERN 0x7907 -#define CMD_LINE_STIPPLE_PATTERN 0x7908 -#define CMD_GLOBAL_DEPTH_OFFSET_CLAMP 0x7909 -#define CMD_AA_LINE_PARAMETERS 0x790a +#define _3DSTATE_DRAWING_RECTANGLE 0x7900 +#define _3DSTATE_BLEND_CONSTANT_COLOR 0x7901 +#define _3DSTATE_CHROMA_KEY 0x7904 +#define _3DSTATE_DEPTH_BUFFER 0x7905 +#define _3DSTATE_POLY_STIPPLE_OFFSET 0x7906 +#define _3DSTATE_POLY_STIPPLE_PATTERN 0x7907 +#define _3DSTATE_LINE_STIPPLE_PATTERN 0x7908 +#define _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP 0x7909 +#define _3DSTATE_AA_LINE_PARAMETERS 0x790a /* G45+ */ -#define CMD_GS_SVB_INDEX 0x790b /* CTG+ */ +#define _3DSTATE_GS_SVB_INDEX 0x790b /* CTG+ */ /* DW1 */ # define SVB_INDEX_SHIFT 29 # define SVB_LOAD_INTERNAL_VERTEX_COUNT (1 << 0) /* SNB+ */ /* DW2: SVB index */ /* DW3: SVB maximum index */ -#define CMD_3D_MULTISAMPLE 0x790d /* SNB+ */ +#define _3DSTATE_MULTISAMPLE 0x790d /* GEN6+ */ /* DW1 */ # define MS_PIXEL_LOCATION_CENTER (0 << 4) # define MS_PIXEL_LOCATION_UPPER_LEFT (1 << 4) @@ -1123,7 +1120,10 @@ # define MS_NUMSAMPLES_4 (2 << 1) # define MS_NUMSAMPLES_8 (3 << 1) -#define CMD_3D_CLEAR_PARAMS 0x7910 /* ILK+ */ +#define _3DSTATE_STENCIL_BUFFER 0x790e /* ILK, SNB */ +#define _3DSTATE_HIER_DEPTH_BUFFER 0x790f /* ILK, SNB */ + +#define _3DSTATE_CLEAR_PARAMS 0x7910 /* ILK+ */ # define DEPTH_CLEAR_VALID (1 << 15) /* DW1: depth clear value */ diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index 962c041..111cb99 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -899,7 +899,8 @@ int brw_disasm (FILE *file, struct brw_instruction *inst, int gen) err |= dest (file, inst); } else if (gen >= 6 && (inst->header.opcode == BRW_OPCODE_IF || inst->header.opcode == BRW_OPCODE_ELSE || - inst->header.opcode == BRW_OPCODE_ENDIF)) { + inst->header.opcode == BRW_OPCODE_ENDIF || + inst->header.opcode == BRW_OPCODE_WHILE)) { format (file, " %d", inst->bits1.branch_gen6.jump_count); } @@ -972,7 +973,7 @@ int brw_disasm (FILE *file, struct brw_instruction *inst, int gen) inst->bits3.dp_render_cache.send_commit_msg, inst->bits3.dp_render_cache.msg_length, inst->bits3.dp_render_cache.response_length); - } else if (gen >= 5) { + } else if (gen >= 5 /* FINISHME: || is_g4x */) { format (file, " (%d, %d, %d)", inst->bits3.dp_read_gen5.binding_table_index, inst->bits3.dp_read_gen5.msg_control, diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index a1f403c..7eb16b7 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -159,7 +159,7 @@ static void brw_emit_prim(struct brw_context *brw, } if (prim_packet.verts_per_instance) { intel_batchbuffer_data( brw->intel.batch, &prim_packet, - sizeof(prim_packet)); + sizeof(prim_packet), false); } if (intel->always_flush_cache) { intel_batchbuffer_emit_mi_flush(intel->batch); @@ -351,7 +351,8 @@ static GLboolean brw_try_draw_prims( struct gl_context *ctx, * an upper bound of how much we might emit in a single * brw_try_draw_prims(). */ - intel_batchbuffer_require_space(intel->batch, intel->batch->size / 4); + intel_batchbuffer_require_space(intel->batch, intel->batch->size / 4, + false); hw_prim = brw_set_prim(brw, &prim[i]); diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c index 2ff39e8..3b5c4c0 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.c +++ b/src/mesa/drivers/dri/i965/brw_eu.c @@ -72,7 +72,37 @@ void brw_set_access_mode( struct brw_compile *p, GLuint access_mode ) void brw_set_compression_control( struct brw_compile *p, GLboolean compression_control ) { - p->current->header.compression_control = compression_control; + p->compressed = (compression_control == BRW_COMPRESSION_COMPRESSED); + + if (p->brw->intel.gen >= 6) { + /* Since we don't use the 32-wide support in gen6, we translate + * the pre-gen6 compression control here. + */ + switch (compression_control) { + case BRW_COMPRESSION_NONE: + /* This is the "use the first set of bits of dmask/vmask/arf + * according to execsize" option. + */ + p->current->header.compression_control = GEN6_COMPRESSION_1Q; + break; + case BRW_COMPRESSION_2NDHALF: + /* For 8-wide, this is "use the second set of 8 bits." */ + p->current->header.compression_control = GEN6_COMPRESSION_2Q; + break; + case BRW_COMPRESSION_COMPRESSED: + /* For 16-wide instruction compression, use the first set of 16 bits + * since we don't do 32-wide dispatch. + */ + p->current->header.compression_control = GEN6_COMPRESSION_1H; + break; + default: + assert(!"not reached"); + p->current->header.compression_control = GEN6_COMPRESSION_1H; + break; + } + } else { + p->current->header.compression_control = compression_control; + } } void brw_set_mask_control( struct brw_compile *p, GLuint value ) @@ -95,6 +125,7 @@ void brw_push_insn_state( struct brw_compile *p ) { assert(p->current != &p->stack[BRW_EU_MAX_INSN_STACK-1]); memcpy(p->current+1, p->current, sizeof(struct brw_instruction)); + p->compressed_stack[p->current - p->stack] = p->compressed; p->current++; } @@ -102,6 +133,7 @@ void brw_pop_insn_state( struct brw_compile *p ) { assert(p->current != p->stack); p->current--; + p->compressed = p->compressed_stack[p->current - p->stack]; } @@ -112,6 +144,7 @@ void brw_init_compile( struct brw_context *brw, struct brw_compile *p ) p->brw = brw; p->nr_insn = 0; p->current = p->stack; + p->compressed = false; memset(p->current, 0, sizeof(p->current[0])); /* Some defaults? diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index b4538e6..119ffc7 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -33,6 +33,7 @@ #ifndef BRW_EU_H #define BRW_EU_H +#include <stdbool.h> #include "brw_structs.h" #include "brw_defines.h" #include "program/prog_instruction.h" @@ -106,10 +107,12 @@ struct brw_compile { /* Allow clients to push/pop instruction state: */ struct brw_instruction stack[BRW_EU_MAX_INSN_STACK]; + bool compressed_stack[BRW_EU_MAX_INSN_STACK]; struct brw_instruction *current; GLuint flag_value; GLboolean single_program_flow; + bool compressed; struct brw_context *brw; struct brw_glsl_label *first_label; /**< linked list of labels */ @@ -858,7 +861,8 @@ void brw_fb_WRITE(struct brw_compile *p, GLuint binding_table_index, GLuint msg_length, GLuint response_length, - GLboolean eot); + GLboolean eot, + GLboolean header_present); void brw_SAMPLE(struct brw_compile *p, struct brw_reg dest, @@ -954,6 +958,8 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p, struct brw_instruction *patch_insn); struct brw_instruction *brw_BREAK(struct brw_compile *p, int pop_count); +struct brw_instruction *brw_CONT_gen6(struct brw_compile *p, + struct brw_instruction *do_insn); struct brw_instruction *brw_CONT(struct brw_compile *p, int pop_count); /* Forward jumps: */ @@ -1009,6 +1015,7 @@ void brw_math_invert( struct brw_compile *p, void brw_set_src1( struct brw_instruction *insn, struct brw_reg reg ); +void brw_set_uip_jip(struct brw_compile *p); /* brw_optimize.c */ void brw_optimize(struct brw_compile *p); diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 9cb941d..88131c4 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -41,19 +41,20 @@ * Internal helper for constructing instructions */ -static void guess_execution_size( struct brw_instruction *insn, - struct brw_reg reg ) +static void guess_execution_size(struct brw_compile *p, + struct brw_instruction *insn, + struct brw_reg reg) { - if (reg.width == BRW_WIDTH_8 && - insn->header.compression_control == BRW_COMPRESSION_COMPRESSED) + if (reg.width == BRW_WIDTH_8 && p->compressed) insn->header.execution_size = BRW_EXECUTE_16; else insn->header.execution_size = reg.width; /* note - definitions are compatible */ } -static void brw_set_dest( struct brw_instruction *insn, - struct brw_reg dest ) +static void brw_set_dest(struct brw_compile *p, + struct brw_instruction *insn, + struct brw_reg dest) { if (dest.file != BRW_ARCHITECTURE_REGISTER_FILE && dest.file != BRW_MESSAGE_REGISTER_FILE) @@ -100,7 +101,7 @@ static void brw_set_dest( struct brw_instruction *insn, /* NEW: Set the execution size based on dest.width and * insn->compression_control: */ - guess_execution_size(insn, dest); + guess_execution_size(p, insn, dest); } extern int reg_type_size[]; @@ -535,6 +536,16 @@ brw_set_dp_read_message(struct brw_context *brw, insn->bits3.dp_read_gen5.end_of_thread = 0; insn->bits2.send_gen5.sfid = BRW_MESSAGE_TARGET_DATAPORT_READ; insn->bits2.send_gen5.end_of_thread = 0; + } else if (intel->is_g4x) { + insn->bits3.dp_read_g4x.binding_table_index = binding_table_index; /*0:7*/ + insn->bits3.dp_read_g4x.msg_control = msg_control; /*8:10*/ + insn->bits3.dp_read_g4x.msg_type = msg_type; /*11:13*/ + insn->bits3.dp_read_g4x.target_cache = target_cache; /*14:15*/ + insn->bits3.dp_read_g4x.response_length = response_length; /*16:19*/ + insn->bits3.dp_read_g4x.msg_length = msg_length; /*20:23*/ + insn->bits3.dp_read_g4x.msg_target = BRW_MESSAGE_TARGET_DATAPORT_READ; /*24:27*/ + insn->bits3.dp_read_g4x.pad1 = 0; + insn->bits3.dp_read_g4x.end_of_thread = 0; } else { insn->bits3.dp_read.binding_table_index = binding_table_index; /*0:7*/ insn->bits3.dp_read.msg_control = msg_control; /*8:11*/ @@ -629,7 +640,7 @@ static struct brw_instruction *brw_alu1( struct brw_compile *p, struct brw_reg src ) { struct brw_instruction *insn = next_insn(p, opcode); - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src); return insn; } @@ -641,7 +652,7 @@ static struct brw_instruction *brw_alu2(struct brw_compile *p, struct brw_reg src1 ) { struct brw_instruction *insn = next_insn(p, opcode); - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, src1); return insn; @@ -680,7 +691,7 @@ void brw_##OP(struct brw_compile *p, \ { \ struct brw_instruction *rnd, *add; \ rnd = next_insn(p, BRW_OPCODE_##OP); \ - brw_set_dest(rnd, dest); \ + brw_set_dest(p, rnd, dest); \ brw_set_src0(rnd, src); \ rnd->header.destreg__conditionalmod = 0x7; /* turn on round-increments */ \ \ @@ -779,7 +790,7 @@ struct brw_instruction *brw_MUL(struct brw_compile *p, void brw_NOP(struct brw_compile *p) { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_NOP); - brw_set_dest(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); + brw_set_dest(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src1(insn, brw_imm_ud(0x0)); } @@ -840,11 +851,11 @@ struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size) /* Override the defaults for this instruction: */ if (intel->gen < 6) { - brw_set_dest(insn, brw_ip_reg()); + brw_set_dest(p, insn, brw_ip_reg()); brw_set_src0(insn, brw_ip_reg()); brw_set_src1(insn, brw_imm_d(0x0)); } else { - brw_set_dest(insn, brw_imm_w(0)); + brw_set_dest(p, insn, brw_imm_w(0)); insn->bits1.branch_gen6.jump_count = 0; brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); @@ -870,7 +881,7 @@ brw_IF_gen6(struct brw_compile *p, uint32_t conditional, insn = next_insn(p, BRW_OPCODE_IF); - brw_set_dest(insn, brw_imm_w(0)); + brw_set_dest(p, insn, brw_imm_w(0)); insn->header.execution_size = BRW_EXECUTE_8; insn->bits1.branch_gen6.jump_count = 0; brw_set_src0(insn, src0); @@ -905,11 +916,11 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p, } if (intel->gen < 6) { - brw_set_dest(insn, brw_ip_reg()); + brw_set_dest(p, insn, brw_ip_reg()); brw_set_src0(insn, brw_ip_reg()); brw_set_src1(insn, brw_imm_d(0x0)); } else { - brw_set_dest(insn, brw_imm_w(0)); + brw_set_dest(p, insn, brw_imm_w(0)); insn->bits1.branch_gen6.jump_count = 0; brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); @@ -965,11 +976,11 @@ void brw_ENDIF(struct brw_compile *p, struct brw_instruction *insn = next_insn(p, BRW_OPCODE_ENDIF); if (intel->gen < 6) { - brw_set_dest(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); + brw_set_dest(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src1(insn, brw_imm_d(0x0)); } else { - brw_set_dest(insn, brw_imm_w(0)); + brw_set_dest(p, insn, brw_imm_w(0)); brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); } @@ -1029,16 +1040,44 @@ void brw_ENDIF(struct brw_compile *p, struct brw_instruction *brw_BREAK(struct brw_compile *p, int pop_count) { + struct intel_context *intel = &p->brw->intel; struct brw_instruction *insn; + insn = next_insn(p, BRW_OPCODE_BREAK); - brw_set_dest(insn, brw_ip_reg()); + if (intel->gen >= 6) { + brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); + brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); + brw_set_src1(insn, brw_imm_d(0x0)); + } else { + brw_set_dest(p, insn, brw_ip_reg()); + brw_set_src0(insn, brw_ip_reg()); + brw_set_src1(insn, brw_imm_d(0x0)); + insn->bits3.if_else.pad0 = 0; + insn->bits3.if_else.pop_count = pop_count; + } + insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.execution_size = BRW_EXECUTE_8; + + return insn; +} + +struct brw_instruction *brw_CONT_gen6(struct brw_compile *p, + struct brw_instruction *do_insn) +{ + struct brw_instruction *insn; + int br = 2; + + insn = next_insn(p, BRW_OPCODE_CONTINUE); + brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); + brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); + brw_set_dest(p, insn, brw_ip_reg()); brw_set_src0(insn, brw_ip_reg()); brw_set_src1(insn, brw_imm_d(0x0)); + + insn->bits3.break_cont.uip = br * (do_insn - insn); + insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.execution_size = BRW_EXECUTE_8; - /* insn->header.mask_control = BRW_MASK_DISABLE; */ - insn->bits3.if_else.pad0 = 0; - insn->bits3.if_else.pop_count = pop_count; return insn; } @@ -1046,7 +1085,7 @@ struct brw_instruction *brw_CONT(struct brw_compile *p, int pop_count) { struct brw_instruction *insn; insn = next_insn(p, BRW_OPCODE_CONTINUE); - brw_set_dest(insn, brw_ip_reg()); + brw_set_dest(p, insn, brw_ip_reg()); brw_set_src0(insn, brw_ip_reg()); brw_set_src1(insn, brw_imm_d(0x0)); insn->header.compression_control = BRW_COMPRESSION_NONE; @@ -1058,17 +1097,33 @@ struct brw_instruction *brw_CONT(struct brw_compile *p, int pop_count) } /* DO/WHILE loop: + * + * The DO/WHILE is just an unterminated loop -- break or continue are + * used for control within the loop. We have a few ways they can be + * done. + * + * For uniform control flow, the WHILE is just a jump, so ADD ip, ip, + * jip and no DO instruction. + * + * For non-uniform control flow pre-gen6, there's a DO instruction to + * push the mask, and a WHILE to jump back, and BREAK to get out and + * pop the mask. + * + * For gen6, there's no more mask stack, so no need for DO. WHILE + * just points back to the first instruction of the loop. */ struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size) { - if (p->single_program_flow) { + struct intel_context *intel = &p->brw->intel; + + if (intel->gen >= 6 || p->single_program_flow) { return &p->store[p->nr_insn]; } else { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_DO); /* Override the defaults for this instruction: */ - brw_set_dest(insn, brw_null_reg()); + brw_set_dest(p, insn, brw_null_reg()); brw_set_src0(insn, brw_null_reg()); brw_set_src1(insn, brw_null_reg()); @@ -1094,34 +1149,42 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p, if (intel->gen >= 5) br = 2; - if (p->single_program_flow) - insn = next_insn(p, BRW_OPCODE_ADD); - else + if (intel->gen >= 6) { insn = next_insn(p, BRW_OPCODE_WHILE); - brw_set_dest(insn, brw_ip_reg()); - brw_set_src0(insn, brw_ip_reg()); - brw_set_src1(insn, brw_imm_d(0x0)); + brw_set_dest(p, insn, brw_imm_w(0)); + insn->bits1.branch_gen6.jump_count = br * (do_insn - insn); + brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); + brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); - insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.execution_size = do_insn->header.execution_size; + assert(insn->header.execution_size == BRW_EXECUTE_8); + } else { + if (p->single_program_flow) { + insn = next_insn(p, BRW_OPCODE_ADD); - if (p->single_program_flow) { - insn->header.execution_size = BRW_EXECUTE_1; + brw_set_dest(p, insn, brw_ip_reg()); + brw_set_src0(insn, brw_ip_reg()); + brw_set_src1(insn, brw_imm_d((do_insn - insn) * 16)); + insn->header.execution_size = BRW_EXECUTE_1; + } else { + insn = next_insn(p, BRW_OPCODE_WHILE); - insn->bits3.d = (do_insn - insn) * 16; - } else { - insn->header.execution_size = do_insn->header.execution_size; + assert(do_insn->header.opcode == BRW_OPCODE_DO); - assert(do_insn->header.opcode == BRW_OPCODE_DO); - insn->bits3.if_else.jump_count = br * (do_insn - insn + 1); - insn->bits3.if_else.pop_count = 0; - insn->bits3.if_else.pad0 = 0; - } + brw_set_dest(p, insn, brw_ip_reg()); + brw_set_src0(insn, brw_ip_reg()); + brw_set_src1(insn, brw_imm_d(0)); -/* insn->header.mask_control = BRW_MASK_ENABLE; */ + insn->header.execution_size = do_insn->header.execution_size; + insn->bits3.if_else.jump_count = br * (do_insn - insn + 1); + insn->bits3.if_else.pop_count = 0; + insn->bits3.if_else.pad0 = 0; + } + } + insn->header.compression_control = BRW_COMPRESSION_NONE; + p->current->header.predicate_control = BRW_PREDICATE_NONE; - /* insn->header.mask_control = BRW_MASK_DISABLE; */ - p->current->header.predicate_control = BRW_PREDICATE_NONE; return insn; } @@ -1159,7 +1222,7 @@ void brw_CMP(struct brw_compile *p, struct brw_instruction *insn = next_insn(p, BRW_OPCODE_CMP); insn->header.destreg__conditionalmod = conditional; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, src1); @@ -1184,7 +1247,7 @@ void brw_WAIT (struct brw_compile *p) struct brw_instruction *insn = next_insn(p, BRW_OPCODE_WAIT); struct brw_reg src = brw_notification_1_reg(); - brw_set_dest(insn, src); + brw_set_dest(p, insn, src); brw_set_src0(insn, src); brw_set_src1(insn, brw_null_reg()); insn->header.execution_size = 0; /* must */ @@ -1219,6 +1282,10 @@ void brw_math( struct brw_compile *p, assert(dest.hstride == BRW_HORIZONTAL_STRIDE_1); assert(src.hstride == BRW_HORIZONTAL_STRIDE_1); + /* Source modifiers are ignored for extended math instructions. */ + assert(!src.negate); + assert(!src.abs); + if (function != BRW_MATH_FUNCTION_INT_DIV_QUOTIENT && function != BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER) { assert(src.type == BRW_REGISTER_TYPE_F); @@ -1228,8 +1295,9 @@ void brw_math( struct brw_compile *p, * becomes FC[3:0] and ThreadCtrl becomes FC[5:4]. */ insn->header.destreg__conditionalmod = function; + insn->header.saturate = saturate; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src); brw_set_src1(insn, brw_null_reg()); } else { @@ -1242,7 +1310,7 @@ void brw_math( struct brw_compile *p, insn->header.predicate_control = 0; insn->header.destreg__conditionalmod = msg_reg_nr; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src); brw_set_math_message(p->brw, insn, @@ -1284,12 +1352,18 @@ void brw_math2(struct brw_compile *p, assert(src1.type == BRW_REGISTER_TYPE_F); } + /* Source modifiers are ignored for extended math instructions. */ + assert(!src0.negate); + assert(!src0.abs); + assert(!src1.negate); + assert(!src1.abs); + /* Math is the same ISA format as other opcodes, except that CondModifier * becomes FC[3:0] and ThreadCtrl becomes FC[5:4]. */ insn->header.destreg__conditionalmod = function; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, src1); } @@ -1318,8 +1392,13 @@ void brw_math_16( struct brw_compile *p, * becomes FC[3:0] and ThreadCtrl becomes FC[5:4]. */ insn->header.destreg__conditionalmod = function; + insn->header.saturate = saturate; - brw_set_dest(insn, dest); + /* Source modifiers are ignored for extended math instructions. */ + assert(!src.negate); + assert(!src.abs); + + brw_set_dest(p, insn, dest); brw_set_src0(insn, src); brw_set_src1(insn, brw_null_reg()); return; @@ -1334,7 +1413,7 @@ void brw_math_16( struct brw_compile *p, insn = next_insn(p, BRW_OPCODE_SEND); insn->header.destreg__conditionalmod = msg_reg_nr; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src); brw_set_math_message(p->brw, insn, @@ -1351,7 +1430,7 @@ void brw_math_16( struct brw_compile *p, insn->header.compression_control = BRW_COMPRESSION_2NDHALF; insn->header.destreg__conditionalmod = msg_reg_nr+1; - brw_set_dest(insn, offset(dest,1)); + brw_set_dest(p, insn, offset(dest,1)); brw_set_src0(insn, src); brw_set_math_message(p->brw, insn, @@ -1446,7 +1525,7 @@ void brw_oword_block_write_scratch(struct brw_compile *p, send_commit_msg = 1; } - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, brw_null_reg()); brw_set_dp_write_message(p->brw, @@ -1516,7 +1595,7 @@ brw_oword_block_read_scratch(struct brw_compile *p, insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.destreg__conditionalmod = mrf.nr; - brw_set_dest(insn, dest); /* UW? */ + brw_set_dest(p, insn, dest); /* UW? */ brw_set_src0(insn, brw_null_reg()); brw_set_dp_read_message(p->brw, @@ -1569,7 +1648,7 @@ void brw_oword_block_read(struct brw_compile *p, /* cast dest to a uword[8] vector */ dest = retype(vec8(dest), BRW_REGISTER_TYPE_UW); - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); if (intel->gen >= 6) { brw_set_src0(insn, mrf); } else { @@ -1614,7 +1693,7 @@ void brw_dword_scattered_read(struct brw_compile *p, /* cast dest to a uword[8] vector */ dest = retype(vec8(dest), BRW_REGISTER_TYPE_UW); - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, brw_null_reg()); brw_set_dp_read_message(p->brw, @@ -1639,29 +1718,22 @@ void brw_dp_READ_4_vs(struct brw_compile *p, GLuint location, GLuint bind_table_index) { + struct intel_context *intel = &p->brw->intel; struct brw_instruction *insn; GLuint msg_reg_nr = 1; - struct brw_reg b; - /* - printf("vs const read msg, location %u, msg_reg_nr %d\n", - location, msg_reg_nr); - */ + if (intel->gen >= 6) + location /= 16; /* Setup MRF[1] with location/offset into const buffer */ brw_push_insn_state(p); + brw_set_access_mode(p, BRW_ALIGN_1); brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - - /* XXX I think we're setting all the dwords of MRF[1] to 'location'. - * when the docs say only dword[2] should be set. Hmmm. But it works. - */ - b = brw_message_reg(msg_reg_nr); - b = retype(b, BRW_REGISTER_TYPE_UD); - /*b = get_element_ud(b, 2);*/ - brw_MOV(p, b, brw_imm_ud(location)); - + brw_MOV(p, retype(brw_vec1_reg(BRW_MESSAGE_REGISTER_FILE, msg_reg_nr, 2), + BRW_REGISTER_TYPE_UD), + brw_imm_ud(location)); brw_pop_insn_state(p); insn = next_insn(p, BRW_OPCODE_SEND); @@ -1671,8 +1743,12 @@ void brw_dp_READ_4_vs(struct brw_compile *p, insn->header.destreg__conditionalmod = msg_reg_nr; insn->header.mask_control = BRW_MASK_DISABLE; - brw_set_dest(insn, dest); - brw_set_src0(insn, brw_null_reg()); + brw_set_dest(p, insn, dest); + if (intel->gen >= 6) { + brw_set_src0(insn, brw_message_reg(msg_reg_nr)); + } else { + brw_set_src0(insn, brw_null_reg()); + } brw_set_dp_read_message(p->brw, insn, @@ -1699,6 +1775,7 @@ void brw_dp_READ_4_vs_relative(struct brw_compile *p, /* Setup MRF[1] with offset into const buffer */ brw_push_insn_state(p); + brw_set_access_mode(p, BRW_ALIGN_1); brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_predicate_control(p, BRW_PREDICATE_NONE); @@ -1706,7 +1783,7 @@ void brw_dp_READ_4_vs_relative(struct brw_compile *p, /* M1.0 is block offset 0, M1.4 is block offset 1, all other * fields ignored. */ - brw_ADD(p, retype(brw_message_reg(1), BRW_REGISTER_TYPE_UD), + brw_ADD(p, retype(brw_message_reg(1), BRW_REGISTER_TYPE_D), addr_reg, brw_imm_d(offset)); brw_pop_insn_state(p); @@ -1717,7 +1794,7 @@ void brw_dp_READ_4_vs_relative(struct brw_compile *p, insn->header.destreg__conditionalmod = 0; insn->header.mask_control = BRW_MASK_DISABLE; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, brw_vec8_grf(0, 0)); if (intel->gen == 6) @@ -1747,12 +1824,12 @@ void brw_fb_WRITE(struct brw_compile *p, GLuint binding_table_index, GLuint msg_length, GLuint response_length, - GLboolean eot) + GLboolean eot, + GLboolean header_present) { struct intel_context *intel = &p->brw->intel; struct brw_instruction *insn; GLuint msg_control, msg_type; - GLboolean header_present = GL_TRUE; if (intel->gen >= 6 && binding_table_index == 0) { insn = next_insn(p, BRW_OPCODE_SENDC); @@ -1764,9 +1841,6 @@ void brw_fb_WRITE(struct brw_compile *p, insn->header.compression_control = BRW_COMPRESSION_NONE; if (intel->gen >= 6) { - if (msg_length == 4) - header_present = GL_FALSE; - /* headerless version, just submit color payload */ src0 = brw_message_reg(msg_reg_nr); @@ -1782,7 +1856,7 @@ void brw_fb_WRITE(struct brw_compile *p, else msg_control = BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD8_SINGLE_SOURCE_SUBSPAN01; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_dp_write_message(p->brw, insn, @@ -1860,7 +1934,7 @@ void brw_SAMPLE(struct brw_compile *p, struct brw_reg m1 = brw_message_reg(msg_reg_nr); - guess_execution_size(p->current, dest); + guess_execution_size(p, p->current, dest); if (p->current->header.execution_size == BRW_EXECUTE_16) dispatch_16 = GL_TRUE; @@ -1871,7 +1945,8 @@ void brw_SAMPLE(struct brw_compile *p, brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_mask_control(p, BRW_MASK_DISABLE); - brw_MOV(p, m1, brw_vec8_grf(0,0)); + brw_MOV(p, retype(m1, BRW_REGISTER_TYPE_UD), + retype(brw_vec8_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_MOV(p, get_element_ud(m1, 2), brw_imm_ud(newmask << 12)); brw_pop_insn_state(p); @@ -1895,12 +1970,15 @@ void brw_SAMPLE(struct brw_compile *p, * and the first message register index comes from src0. */ if (intel->gen >= 6) { - brw_push_insn_state(p); - brw_set_mask_control( p, BRW_MASK_DISABLE ); - /* m1 contains header? */ - brw_MOV(p, brw_message_reg(msg_reg_nr), src0); - brw_pop_insn_state(p); - src0 = brw_message_reg(msg_reg_nr); + if (src0.file != BRW_ARCHITECTURE_REGISTER_FILE || + src0.nr != BRW_ARF_NULL) { + brw_push_insn_state(p); + brw_set_mask_control( p, BRW_MASK_DISABLE ); + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_MOV(p, retype(brw_message_reg(msg_reg_nr), src0.type), src0); + brw_pop_insn_state(p); + } + src0 = brw_message_reg(msg_reg_nr); } insn = next_insn(p, BRW_OPCODE_SEND); @@ -1909,7 +1987,7 @@ void brw_SAMPLE(struct brw_compile *p, if (intel->gen < 6) insn->header.destreg__conditionalmod = msg_reg_nr; - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_sampler_message(p->brw, insn, binding_table_index, @@ -1929,7 +2007,8 @@ void brw_SAMPLE(struct brw_compile *p, */ brw_push_insn_state(p); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_MOV(p, reg, reg); + brw_MOV(p, retype(reg, BRW_REGISTER_TYPE_UD), + retype(reg, BRW_REGISTER_TYPE_UD)); brw_pop_insn_state(p); } @@ -1961,7 +2040,8 @@ void brw_urb_WRITE(struct brw_compile *p, if (intel->gen >= 6) { brw_push_insn_state(p); brw_set_mask_control( p, BRW_MASK_DISABLE ); - brw_MOV(p, brw_message_reg(msg_reg_nr), src0); + brw_MOV(p, retype(brw_message_reg(msg_reg_nr), BRW_REGISTER_TYPE_UD), + retype(src0, BRW_REGISTER_TYPE_UD)); brw_pop_insn_state(p); src0 = brw_message_reg(msg_reg_nr); } @@ -1970,7 +2050,7 @@ void brw_urb_WRITE(struct brw_compile *p, assert(msg_length < BRW_MAX_MRF); - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, brw_imm_d(0)); @@ -1989,6 +2069,80 @@ void brw_urb_WRITE(struct brw_compile *p, swizzle); } +static int +brw_find_next_block_end(struct brw_compile *p, int start) +{ + int ip; + + for (ip = start + 1; ip < p->nr_insn; ip++) { + struct brw_instruction *insn = &p->store[ip]; + + switch (insn->header.opcode) { + case BRW_OPCODE_ENDIF: + case BRW_OPCODE_ELSE: + case BRW_OPCODE_WHILE: + return ip; + } + } + assert(!"not reached"); + return start + 1; +} + +/* There is no DO instruction on gen6, so to find the end of the loop + * we have to see if the loop is jumping back before our start + * instruction. + */ +static int +brw_find_loop_end(struct brw_compile *p, int start) +{ + int ip; + int br = 2; + + for (ip = start + 1; ip < p->nr_insn; ip++) { + struct brw_instruction *insn = &p->store[ip]; + + if (insn->header.opcode == BRW_OPCODE_WHILE) { + if (ip + insn->bits1.branch_gen6.jump_count / br < start) + return ip; + } + } + assert(!"not reached"); + return start + 1; +} + +/* After program generation, go back and update the UIP and JIP of + * BREAK and CONT instructions to their correct locations. + */ +void +brw_set_uip_jip(struct brw_compile *p) +{ + struct intel_context *intel = &p->brw->intel; + int ip; + int br = 2; + + if (intel->gen < 6) + return; + + for (ip = 0; ip < p->nr_insn; ip++) { + struct brw_instruction *insn = &p->store[ip]; + + switch (insn->header.opcode) { + case BRW_OPCODE_BREAK: + insn->bits3.break_cont.jip = br * (brw_find_next_block_end(p, ip) - ip); + insn->bits3.break_cont.uip = br * (brw_find_loop_end(p, ip) - ip + 1); + break; + case BRW_OPCODE_CONTINUE: + /* JIP is set at CONTINUE emit time, since that's when we + * know where the start of the loop is. + */ + insn->bits3.break_cont.jip = br * (brw_find_next_block_end(p, ip) - ip); + assert(insn->bits3.break_cont.uip != 0); + assert(insn->bits3.break_cont.jip != 0); + break; + } + } +} + void brw_ff_sync(struct brw_compile *p, struct brw_reg dest, GLuint msg_reg_nr, @@ -2013,7 +2167,7 @@ void brw_ff_sync(struct brw_compile *p, } insn = next_insn(p, BRW_OPCODE_SEND); - brw_set_dest(insn, dest); + brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, brw_imm_d(0)); diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 6796fb2..d0b0c22 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -36,8 +36,6 @@ #include "swrast/swrast.h" #include "tnl/tnl.h" #include "brw_context.h" -#include "intel_fbo.h" -#include "intel_regions.h" #define FILE_DEBUG_FLAG DEBUG_FALLBACKS @@ -63,49 +61,14 @@ static GLboolean do_check_fallback(struct brw_context *brw) for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; if (texUnit->_ReallyEnabled) { - struct intel_texture_object *intelObj = intel_texture_object(texUnit->_Current); - struct gl_texture_image *texImage = intelObj->base.Image[0][intelObj->firstLevel]; + struct gl_texture_object *tex_obj = texUnit->_Current; + struct gl_texture_image *texImage = tex_obj->Image[0][tex_obj->BaseLevel]; if (texImage->Border) { DBG("FALLBACK: texture border\n"); return GL_TRUE; } } } - - /* _NEW_STENCIL - */ - if (ctx->Stencil._Enabled && - (ctx->DrawBuffer->Name == 0 && !brw->intel.hw_stencil)) { - DBG("FALLBACK: stencil\n"); - return GL_TRUE; - } - - /* _NEW_BUFFERS */ - if (!brw->has_surface_tile_offset) { - for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[i]; - struct intel_renderbuffer *irb = intel_renderbuffer(rb); - - /* The original gen4 hardware couldn't set up WM surfaces pointing - * at an offset within a tile, which can happen when rendering to - * anything but the base level of a texture or the +X face/0 depth. - * This was fixed with the 4 Series hardware. - * - * For these original chips, you would have to make the depth and - * color destination surfaces include information on the texture - * type, LOD, face, and various limits to use them as a destination. - * I would have done this, but there's also a nasty requirement that - * the depth and the color surfaces all be of the same LOD, which - * may be a worse requirement than this alignment. (Also, we may - * want to just demote the texture to untiled, instead). - */ - if (irb->region && irb->region->tiling != I915_TILING_NONE && - (irb->region->draw_offset & 4095)) { - DBG("FALLBACK: non-tile-aligned destination for tiled FBO\n"); - return GL_TRUE; - } - } - } return GL_FALSE; } @@ -117,7 +80,7 @@ static void check_fallback(struct brw_context *brw) const struct brw_tracked_state brw_check_fallback = { .dirty = { - .mesa = _NEW_BUFFERS | _NEW_RENDERMODE | _NEW_TEXTURE | _NEW_STENCIL, + .mesa = _NEW_RENDERMODE | _NEW_TEXTURE | _NEW_STENCIL, .brw = 0, .cache = 0 }, diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index edb02fa..a35687d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -48,6 +48,7 @@ extern "C" { #include "../glsl/ir_optimization.h" #include "../glsl/ir_print_visitor.h" +#define MAX_INSTRUCTION (1 << 30) static struct brw_reg brw_reg_from_fs_reg(class fs_reg *reg); struct gl_shader * @@ -89,6 +90,9 @@ brw_compile_shader(struct gl_context *ctx, struct gl_shader *shader) GLboolean brw_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) { + struct brw_context *brw = brw_context(ctx); + struct intel_context *intel = &brw->intel; + struct brw_shader *shader = (struct brw_shader *)prog->_LinkedShaders[MESA_SHADER_FRAGMENT]; if (shader != NULL) { @@ -107,7 +111,15 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) SUB_TO_ADD_NEG | EXP_TO_EXP2 | LOG_TO_LOG2); + + /* Pre-gen6 HW can only nest if-statements 16 deep. Beyond this, + * if-statements need to be flattened. + */ + if (intel->gen < 6) + lower_if_to_cond_assign(shader->ir, 16); + do_lower_texture_projection(shader->ir); + do_vec_index_to_cond_assign(shader->ir); brw_do_cubemap_normalize(shader->ir); do { @@ -474,8 +486,13 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir) wpos.reg_offset++; /* gl_FragCoord.z */ - emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y, - interp_reg(FRAG_ATTRIB_WPOS, 2))); + if (intel->gen >= 6) { + emit(fs_inst(BRW_OPCODE_MOV, wpos, + fs_reg(brw_vec8_grf(c->source_depth_reg, 0)))); + } else { + emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y, + interp_reg(FRAG_ATTRIB_WPOS, 2))); + } wpos.reg_offset++; /* gl_FragCoord.w: Already set up in emit_interpolation */ @@ -518,25 +535,40 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) continue; } - for (unsigned int c = 0; c < type->vector_elements; c++) { - struct brw_reg interp = interp_reg(location, c); - emit(fs_inst(FS_OPCODE_LINTERP, - attr, - this->delta_x, - this->delta_y, - fs_reg(interp))); - attr.reg_offset++; - } - - if (intel->gen < 6) { - attr.reg_offset -= type->vector_elements; + if (c->key.flat_shade && (location == FRAG_ATTRIB_COL0 || + location == FRAG_ATTRIB_COL1)) { + /* Constant interpolation (flat shading) case. The SF has + * handed us defined values in only the constant offset + * field of the setup reg. + */ for (unsigned int c = 0; c < type->vector_elements; c++) { - emit(fs_inst(BRW_OPCODE_MUL, - attr, + struct brw_reg interp = interp_reg(location, c); + interp = suboffset(interp, 3); + emit(fs_inst(FS_OPCODE_CINTERP, attr, fs_reg(interp))); + attr.reg_offset++; + } + } else { + /* Perspective interpolation case. */ + for (unsigned int c = 0; c < type->vector_elements; c++) { + struct brw_reg interp = interp_reg(location, c); + emit(fs_inst(FS_OPCODE_LINTERP, attr, - this->pixel_w)); + this->delta_x, + this->delta_y, + fs_reg(interp))); attr.reg_offset++; } + + if (intel->gen < 6) { + attr.reg_offset -= type->vector_elements; + for (unsigned int c = 0; c < type->vector_elements; c++) { + emit(fs_inst(BRW_OPCODE_MUL, + attr, + attr, + this->pixel_w)); + attr.reg_offset++; + } + } } location++; } @@ -600,8 +632,13 @@ fs_visitor::emit_math(fs_opcodes opcode, fs_reg dst, fs_reg src) * might be able to do better by doing execsize = 1 math and then * expanding that result out, but we would need to be careful with * masking. + * + * The hardware ignores source modifiers (negate and abs) on math + * instructions, so we also move to a temp to set those up. */ - if (intel->gen >= 6 && src.file == UNIFORM) { + if (intel->gen >= 6 && (src.file == UNIFORM || + src.abs || + src.negate)) { fs_reg expanded = fs_reg(this, glsl_type::float_type); emit(fs_inst(BRW_OPCODE_MOV, expanded, src)); src = expanded; @@ -765,6 +802,30 @@ fs_visitor::try_emit_saturate(ir_expression *ir) return true; } +static uint32_t +brw_conditional_for_comparison(unsigned int op) +{ + switch (op) { + case ir_binop_less: + return BRW_CONDITIONAL_L; + case ir_binop_greater: + return BRW_CONDITIONAL_G; + case ir_binop_lequal: + return BRW_CONDITIONAL_LE; + case ir_binop_gequal: + return BRW_CONDITIONAL_GE; + case ir_binop_equal: + case ir_binop_all_equal: /* same as equal for scalars */ + return BRW_CONDITIONAL_Z; + case ir_binop_nequal: + case ir_binop_any_nequal: /* same as nequal for scalars */ + return BRW_CONDITIONAL_NZ; + default: + assert(!"not reached: bad operation for comparison"); + return BRW_CONDITIONAL_NZ; + } +} + void fs_visitor::visit(ir_expression *ir) { @@ -814,6 +875,7 @@ fs_visitor::visit(ir_expression *ir) break; case ir_unop_abs: op[0].abs = true; + op[0].negate = false; this->result = op[0]; break; case ir_unop_sign: @@ -880,35 +942,20 @@ fs_visitor::visit(ir_expression *ir) break; case ir_binop_less: - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_L; - emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); - break; case ir_binop_greater: - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_G; - emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); - break; case ir_binop_lequal: - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_LE; - emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); - break; case ir_binop_gequal: - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_GE; - emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); - break; case ir_binop_equal: - case ir_binop_all_equal: /* same as nequal for scalars */ - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_Z; - emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); - break; + case ir_binop_all_equal: case ir_binop_nequal: - case ir_binop_any_nequal: /* same as nequal for scalars */ - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_NZ; + case ir_binop_any_nequal: + temp = this->result; + /* original gen4 does implicit conversion before comparison. */ + if (intel->gen < 5) + temp.type = op[0].type; + + inst = emit(fs_inst(BRW_OPCODE_CMP, temp, op[0], op[1])); + inst->conditional_mod = brw_conditional_for_comparison(ir->operation); emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); break; @@ -933,6 +980,10 @@ fs_visitor::visit(ir_expression *ir) assert(!"not reached: should be handled by lower_noise"); break; + case ir_quadop_vector: + assert(!"not reached: should be handled by lower_quadop_vector"); + break; + case ir_unop_sqrt: emit_math(FS_OPCODE_SQRT, this->result, op[0]); break; @@ -949,7 +1000,12 @@ fs_visitor::visit(ir_expression *ir) break; case ir_unop_f2b: case ir_unop_i2b: - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], fs_reg(0.0f))); + temp = this->result; + /* original gen4 does implicit conversion before comparison. */ + if (intel->gen < 5) + temp.type = op[0].type; + + inst = emit(fs_inst(BRW_OPCODE_CMP, temp, op[0], fs_reg(0.0f))); inst->conditional_mod = BRW_CONDITIONAL_NZ; inst = emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(1))); @@ -1423,28 +1479,70 @@ fs_visitor::visit(ir_discard *ir) void fs_visitor::visit(ir_constant *ir) { - fs_reg reg(this, ir->type); - this->result = reg; + /* Set this->result to reg at the bottom of the function because some code + * paths will cause this visitor to be applied to other fields. This will + * cause the value stored in this->result to be modified. + * + * Make reg constant so that it doesn't get accidentally modified along the + * way. Yes, I actually had this problem. :( + */ + const fs_reg reg(this, ir->type); + fs_reg dst_reg = reg; - for (unsigned int i = 0; i < ir->type->vector_elements; i++) { - switch (ir->type->base_type) { - case GLSL_TYPE_FLOAT: - emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg(ir->value.f[i]))); - break; - case GLSL_TYPE_UINT: - emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg(ir->value.u[i]))); - break; - case GLSL_TYPE_INT: - emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg(ir->value.i[i]))); - break; - case GLSL_TYPE_BOOL: - emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg((int)ir->value.b[i]))); - break; - default: - assert(!"Non-float/uint/int/bool constant"); + if (ir->type->is_array()) { + const unsigned size = type_size(ir->type->fields.array); + + for (unsigned i = 0; i < ir->type->length; i++) { + ir->array_elements[i]->accept(this); + fs_reg src_reg = this->result; + + dst_reg.type = src_reg.type; + for (unsigned j = 0; j < size; j++) { + emit(fs_inst(BRW_OPCODE_MOV, dst_reg, src_reg)); + src_reg.reg_offset++; + dst_reg.reg_offset++; + } + } + } else if (ir->type->is_record()) { + foreach_list(node, &ir->components) { + ir_instruction *const field = (ir_instruction *) node; + const unsigned size = type_size(field->type); + + field->accept(this); + fs_reg src_reg = this->result; + + dst_reg.type = src_reg.type; + for (unsigned j = 0; j < size; j++) { + emit(fs_inst(BRW_OPCODE_MOV, dst_reg, src_reg)); + src_reg.reg_offset++; + dst_reg.reg_offset++; + } + } + } else { + const unsigned size = type_size(ir->type); + + for (unsigned i = 0; i < size; i++) { + switch (ir->type->base_type) { + case GLSL_TYPE_FLOAT: + emit(fs_inst(BRW_OPCODE_MOV, dst_reg, fs_reg(ir->value.f[i]))); + break; + case GLSL_TYPE_UINT: + emit(fs_inst(BRW_OPCODE_MOV, dst_reg, fs_reg(ir->value.u[i]))); + break; + case GLSL_TYPE_INT: + emit(fs_inst(BRW_OPCODE_MOV, dst_reg, fs_reg(ir->value.i[i]))); + break; + case GLSL_TYPE_BOOL: + emit(fs_inst(BRW_OPCODE_MOV, dst_reg, fs_reg((int)ir->value.b[i]))); + break; + default: + assert(!"Non-float/uint/int/bool constant"); + } + dst_reg.reg_offset++; } - reg.reg_offset++; } + + this->result = reg; } void @@ -1490,7 +1588,7 @@ fs_visitor::emit_bool_to_cond_code(ir_rvalue *ir) inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, op[0], fs_reg(0.0f))); } else { - inst = emit(fs_inst(BRW_OPCODE_MOV, reg_null_d, op[0])); + inst = emit(fs_inst(BRW_OPCODE_MOV, reg_null_f, op[0])); } inst->conditional_mod = BRW_CONDITIONAL_NZ; break; @@ -1505,31 +1603,18 @@ fs_visitor::emit_bool_to_cond_code(ir_rvalue *ir) break; case ir_binop_greater: - inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_G; - break; case ir_binop_gequal: - inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_GE; - break; case ir_binop_less: - inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_L; - break; case ir_binop_lequal: - inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_LE; - break; case ir_binop_equal: case ir_binop_all_equal: - inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_Z; - break; case ir_binop_nequal: case ir_binop_any_nequal: - inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_NZ; + inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_cmp, op[0], op[1])); + inst->conditional_mod = + brw_conditional_for_comparison(expr->operation); break; + default: assert(!"not reached"); this->fail = true; @@ -1574,7 +1659,7 @@ fs_visitor::emit_if_gen6(ir_if *ir) switch (expr->operation) { case ir_unop_logic_not: - inst = emit(fs_inst(BRW_OPCODE_IF, temp, op[0], fs_reg(1))); + inst = emit(fs_inst(BRW_OPCODE_IF, temp, op[0], fs_reg(0))); inst->conditional_mod = BRW_CONDITIONAL_Z; return; @@ -1608,30 +1693,16 @@ fs_visitor::emit_if_gen6(ir_if *ir) return; case ir_binop_greater: - inst = emit(fs_inst(BRW_OPCODE_IF, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_G; - return; case ir_binop_gequal: - inst = emit(fs_inst(BRW_OPCODE_IF, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_GE; - return; case ir_binop_less: - inst = emit(fs_inst(BRW_OPCODE_IF, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_L; - return; case ir_binop_lequal: - inst = emit(fs_inst(BRW_OPCODE_IF, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_LE; - return; case ir_binop_equal: case ir_binop_all_equal: - inst = emit(fs_inst(BRW_OPCODE_IF, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_Z; - return; case ir_binop_nequal: case ir_binop_any_nequal: inst = emit(fs_inst(BRW_OPCODE_IF, reg_null_d, op[0], op[1])); - inst->conditional_mod = BRW_CONDITIONAL_NZ; + inst->conditional_mod = + brw_conditional_for_comparison(expr->operation); return; default: assert(!"not reached"); @@ -1713,32 +1784,9 @@ fs_visitor::visit(ir_loop *ir) this->base_ir = ir->to; ir->to->accept(this); - fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_d, + fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null_cmp, counter, this->result)); - switch (ir->cmp) { - case ir_binop_equal: - inst->conditional_mod = BRW_CONDITIONAL_Z; - break; - case ir_binop_nequal: - inst->conditional_mod = BRW_CONDITIONAL_NZ; - break; - case ir_binop_gequal: - inst->conditional_mod = BRW_CONDITIONAL_GE; - break; - case ir_binop_lequal: - inst->conditional_mod = BRW_CONDITIONAL_LE; - break; - case ir_binop_greater: - inst->conditional_mod = BRW_CONDITIONAL_G; - break; - case ir_binop_less: - inst->conditional_mod = BRW_CONDITIONAL_L; - break; - default: - assert(!"not reached: unknown loop condition"); - this->fail = true; - break; - } + inst->conditional_mod = brw_conditional_for_comparison(ir->cmp); inst = emit(fs_inst(BRW_OPCODE_BREAK)); inst->predicated = true; @@ -1951,7 +1999,7 @@ fs_visitor::emit_interpolation_setup_gen6() emit(fs_inst(BRW_OPCODE_MOV, this->pixel_y, int_pixel_y)); this->current_annotation = "compute 1/pos.w"; - this->wpos_w = fs_reg(brw_vec8_grf(c->key.source_w_reg, 0)); + this->wpos_w = fs_reg(brw_vec8_grf(c->source_w_reg, 0)); this->pixel_w = fs_reg(this, glsl_type::float_type); emit_math(FS_OPCODE_RCP, this->pixel_w, wpos_w); @@ -1979,17 +2027,17 @@ fs_visitor::emit_fb_writes() nr += 2; } - if (c->key.aa_dest_stencil_reg) { + if (c->aa_dest_stencil_reg) { emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++), - fs_reg(brw_vec8_grf(c->key.aa_dest_stencil_reg, 0)))); + fs_reg(brw_vec8_grf(c->aa_dest_stencil_reg, 0)))); } /* Reserve space for color. It'll be filled in per MRT below. */ int color_mrf = nr; nr += 4; - if (c->key.source_depth_to_render_target) { - if (c->key.computes_depth) { + if (c->source_depth_to_render_target) { + if (c->computes_depth) { /* Hand over gl_FragDepth. */ assert(this->frag_depth); fs_reg depth = *(variable_storage(this->frag_depth)); @@ -1998,20 +2046,22 @@ fs_visitor::emit_fb_writes() } else { /* Pass through the payload depth. */ emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++), - fs_reg(brw_vec8_grf(c->key.source_depth_reg, 0)))); + fs_reg(brw_vec8_grf(c->source_depth_reg, 0)))); } } - if (c->key.dest_depth_reg) { + if (c->dest_depth_reg) { emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++), - fs_reg(brw_vec8_grf(c->key.dest_depth_reg, 0)))); + fs_reg(brw_vec8_grf(c->dest_depth_reg, 0)))); } fs_reg color = reg_undef; if (this->frag_color) color = *(variable_storage(this->frag_color)); - else if (this->frag_data) + else if (this->frag_data) { color = *(variable_storage(this->frag_data)); + color.type = BRW_REGISTER_TYPE_F; + } for (int target = 0; target < c->key.nr_color_regions; target++) { this->current_annotation = talloc_asprintf(this->mem_ctx, @@ -2105,7 +2155,8 @@ fs_visitor::generate_fb_write(fs_inst *inst) inst->target, inst->mlen, 0, - eot); + eot, + inst->header_present); } void @@ -2452,7 +2503,7 @@ fs_visitor::generate_pull_constant_load(fs_inst *inst, struct brw_reg dst) void fs_visitor::assign_curb_setup() { - c->prog_data.first_curbe_grf = c->key.nr_payload_regs; + c->prog_data.first_curbe_grf = c->nr_payload_regs; c->prog_data.curb_read_length = ALIGN(c->prog_data.nr_params, 8) / 8; /* Map the offsets in the UNIFORM file to fixed HW regs. */ @@ -2522,12 +2573,15 @@ fs_visitor::assign_urb_setup() foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); - if (inst->opcode != FS_OPCODE_LINTERP) - continue; - - assert(inst->src[2].file == FIXED_HW_REG); + if (inst->opcode == FS_OPCODE_LINTERP) { + assert(inst->src[2].file == FIXED_HW_REG); + inst->src[2].fixed_hw_reg.nr += urb_start; + } - inst->src[2].fixed_hw_reg.nr += urb_start; + if (inst->opcode == FS_OPCODE_CINTERP) { + assert(inst->src[0].file == FIXED_HW_REG); + inst->src[0].fixed_hw_reg.nr += urb_start; + } } this->first_non_payload_grf = urb_start + c->prog_data.urb_read_length; @@ -2618,6 +2672,7 @@ fs_visitor::split_virtual_grfs() } } } + this->live_intervals_valid = false; } /** @@ -2692,8 +2747,11 @@ fs_visitor::calculate_live_intervals() int loop_start = 0; int bb_header_ip = 0; + if (this->live_intervals_valid) + return; + for (int i = 0; i < num_vars; i++) { - def[i] = 1 << 30; + def[i] = MAX_INSTRUCTION; use[i] = -1; } @@ -2771,6 +2829,8 @@ fs_visitor::calculate_live_intervals() talloc_free(this->virtual_grf_use); this->virtual_grf_def = def; this->virtual_grf_use = use; + + this->live_intervals_valid = true; } /** @@ -2786,6 +2846,8 @@ fs_visitor::propagate_constants() { bool progress = false; + calculate_live_intervals(); + foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); @@ -2843,6 +2905,7 @@ fs_visitor::propagate_constants() /* Fit this constant in by commuting the operands */ scan_inst->src[0] = scan_inst->src[1]; scan_inst->src[1] = inst->src[0]; + progress = true; } break; case BRW_OPCODE_CMP: @@ -2863,6 +2926,9 @@ fs_visitor::propagate_constants() } } + if (progress) + this->live_intervals_valid = false; + return progress; } /** @@ -2877,6 +2943,8 @@ fs_visitor::dead_code_eliminate() bool progress = false; int pc = 0; + calculate_live_intervals(); + foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); @@ -2888,6 +2956,9 @@ fs_visitor::dead_code_eliminate() pc++; } + if (progress) + live_intervals_valid = false; + return progress; } @@ -2895,10 +2966,35 @@ bool fs_visitor::register_coalesce() { bool progress = false; + int if_depth = 0; + int loop_depth = 0; foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); + /* Make sure that we dominate the instructions we're going to + * scan for interfering with our coalescing, or we won't have + * scanned enough to see if anything interferes with our + * coalescing. We don't dominate the following instructions if + * we're in a loop or an if block. + */ + switch (inst->opcode) { + case BRW_OPCODE_DO: + loop_depth++; + break; + case BRW_OPCODE_WHILE: + loop_depth--; + break; + case BRW_OPCODE_IF: + if_depth++; + break; + case BRW_OPCODE_ENDIF: + if_depth--; + break; + } + if (loop_depth || if_depth) + continue; + if (inst->opcode != BRW_OPCODE_MOV || inst->predicated || inst->saturate || @@ -2916,14 +3012,6 @@ fs_visitor::register_coalesce() for (; scan_iter.has_next(); scan_iter.next()) { fs_inst *scan_inst = (fs_inst *)scan_iter.get(); - if (scan_inst->opcode == BRW_OPCODE_DO || - scan_inst->opcode == BRW_OPCODE_WHILE || - scan_inst->opcode == BRW_OPCODE_ENDIF) { - interfered = true; - iter = scan_iter; - break; - } - if (scan_inst->dst.file == GRF) { if (scan_inst->dst.reg == inst->dst.reg && (scan_inst->dst.reg_offset == inst->dst.reg_offset || @@ -2943,10 +3031,6 @@ fs_visitor::register_coalesce() continue; } - /* Update live interval so we don't have to recalculate. */ - this->virtual_grf_use[inst->src[0].reg] = MAX2(virtual_grf_use[inst->src[0].reg], - virtual_grf_use[inst->dst.reg]); - /* Rewrite the later usage to point at the source of the move to * be removed. */ @@ -2971,6 +3055,9 @@ fs_visitor::register_coalesce() progress = true; } + if (progress) + live_intervals_valid = false; + return progress; } @@ -2981,6 +3068,8 @@ fs_visitor::compute_to_mrf() bool progress = false; int next_ip = 0; + calculate_live_intervals(); + foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); @@ -3184,15 +3273,16 @@ fs_visitor::virtual_grf_interferes(int a, int b) int start = MAX2(this->virtual_grf_def[a], this->virtual_grf_def[b]); int end = MIN2(this->virtual_grf_use[a], this->virtual_grf_use[b]); - /* For dead code, just check if the def interferes with the other range. */ - if (this->virtual_grf_use[a] == -1) { - return (this->virtual_grf_def[a] >= this->virtual_grf_def[b] && - this->virtual_grf_def[a] < this->virtual_grf_use[b]); - } - if (this->virtual_grf_use[b] == -1) { - return (this->virtual_grf_def[b] >= this->virtual_grf_def[a] && - this->virtual_grf_def[b] < this->virtual_grf_use[a]); - } + /* We can't handle dead register writes here, without iterating + * over the whole instruction stream to find every single dead + * write to that register to compare to the live interval of the + * other register. Just assert that dead_code_eliminate() has been + * called. + */ + assert((this->virtual_grf_use[a] != -1 || + this->virtual_grf_def[a] == MAX_INSTRUCTION) && + (this->virtual_grf_use[b] != -1 || + this->virtual_grf_def[b] == MAX_INSTRUCTION)); return start < end; } @@ -3227,6 +3317,7 @@ static struct brw_reg brw_reg_from_fs_reg(fs_reg *reg) break; default: assert(!"not reached"); + brw_reg = brw_null_reg(); break; } break; @@ -3241,6 +3332,10 @@ static struct brw_reg brw_reg_from_fs_reg(fs_reg *reg) assert(!"not reached"); brw_reg = brw_null_reg(); break; + default: + assert(!"not reached"); + brw_reg = brw_null_reg(); + break; } if (reg->abs) brw_reg = brw_abs(brw_reg); @@ -3373,10 +3468,6 @@ fs_visitor::generate_code() break; case BRW_OPCODE_DO: - /* FINISHME: We need to write the loop instruction support still. */ - if (intel->gen >= 6) - this->fail = true; - loop_stack[loop_stack_depth++] = brw_DO(p, BRW_EXECUTE_8); if_depth_in_loop[loop_stack_depth] = 0; break; @@ -3386,7 +3477,11 @@ fs_visitor::generate_code() brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; case BRW_OPCODE_CONTINUE: - brw_CONT(p, if_depth_in_loop[loop_stack_depth]); + /* FINISHME: We need to write the loop instruction support still. */ + if (intel->gen >= 6) + brw_CONT_gen6(p, loop_stack[loop_stack_depth - 1]); + else + brw_CONT(p, if_depth_in_loop[loop_stack_depth]); brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; @@ -3400,16 +3495,18 @@ fs_visitor::generate_code() assert(loop_stack_depth > 0); loop_stack_depth--; inst0 = inst1 = brw_WHILE(p, loop_stack[loop_stack_depth]); - /* patch all the BREAK/CONT instructions from last BGNLOOP */ - while (inst0 > loop_stack[loop_stack_depth]) { - inst0--; - if (inst0->header.opcode == BRW_OPCODE_BREAK && - inst0->bits3.if_else.jump_count == 0) { - inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); + if (intel->gen < 6) { + /* patch all the BREAK/CONT instructions from last BGNLOOP */ + while (inst0 > loop_stack[loop_stack_depth]) { + inst0--; + if (inst0->header.opcode == BRW_OPCODE_BREAK && + inst0->bits3.if_else.jump_count == 0) { + inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); } - else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && - inst0->bits3.if_else.jump_count == 0) { - inst0->bits3.if_else.jump_count = br * (inst1 - inst0); + else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && + inst0->bits3.if_else.jump_count == 0) { + inst0->bits3.if_else.jump_count = br * (inst1 - inst0); + } } } } @@ -3425,6 +3522,9 @@ fs_visitor::generate_code() case FS_OPCODE_COS: generate_math(inst, dst, src); break; + case FS_OPCODE_CINTERP: + brw_MOV(p, dst, src[0]); + break; case FS_OPCODE_LINTERP: generate_linterp(inst, dst, src); break; @@ -3486,6 +3586,26 @@ fs_visitor::generate_code() last_native_inst = p->nr_insn; } + + brw_set_uip_jip(p); + + /* OK, while the INTEL_DEBUG=wm above is very nice for debugging FS + * emit issues, it doesn't get the jump distances into the output, + * which is often something we want to debug. So this is here in + * case you're doing that. + */ + if (0) { + if (unlikely(INTEL_DEBUG & DEBUG_WM)) { + for (unsigned int i = 0; i < p->nr_insn; i++) { + printf("0x%08x 0x%08x 0x%08x 0x%08x ", + ((uint32_t *)&p->store[i])[3], + ((uint32_t *)&p->store[i])[2], + ((uint32_t *)&p->store[i])[1], + ((uint32_t *)&p->store[i])[0]); + brw_disasm(stdout, &p->store[i], intel->gen); + } + } + } } GLboolean @@ -3553,7 +3673,6 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) progress = v.remove_duplicate_mrf_writes() || progress; - v.calculate_live_intervals(); progress = v.propagate_constants() || progress; progress = v.register_coalesce() || progress; progress = v.compute_to_mrf() || progress; @@ -3566,7 +3685,6 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) for (int i = 1; i < virtual_grf_count; i++) { v.spill_reg(i); } - v.calculate_live_intervals(); } if (0) @@ -3575,8 +3693,6 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) while (!v.assign_regs()) { if (v.fail) break; - - v.calculate_live_intervals(); } } } diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index de7b153..82d96f6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -68,6 +68,7 @@ enum fs_opcodes { FS_OPCODE_COS, FS_OPCODE_DDX, FS_OPCODE_DDY, + FS_OPCODE_CINTERP, FS_OPCODE_LINTERP, FS_OPCODE_TEX, FS_OPCODE_TXB, @@ -348,6 +349,23 @@ public: hash_table_pointer_hash, hash_table_pointer_compare); + /* There's a question that appears to be left open in the spec: + * How do implicit dst conversions interact with the CMP + * instruction or conditional mods? On gen6, the instruction: + * + * CMP null<d> src0<f> src1<f> + * + * will do src1 - src0 and compare that result as if it was an + * integer. On gen4, it will do src1 - src0 as float, convert + * the result to int, and compare as int. In between, it + * appears that it does src1 - src0 and does the compare in the + * execution type so dst type doesn't matter. + */ + if (this->intel->gen > 4) + this->reg_null_cmp = reg_null_d; + else + this->reg_null_cmp = reg_null_f; + this->frag_color = NULL; this->frag_data = NULL; this->frag_depth = NULL; @@ -361,6 +379,7 @@ public: this->virtual_grf_array_size = 0; this->virtual_grf_def = NULL; this->virtual_grf_use = NULL; + this->live_intervals_valid = false; this->kill_emitted = false; } @@ -462,6 +481,7 @@ public: int virtual_grf_array_size; int *virtual_grf_def; int *virtual_grf_use; + bool live_intervals_valid; struct hash_table *variable_ht; ir_variable *frag_color, *frag_data, *frag_depth; @@ -485,6 +505,7 @@ public: fs_reg pixel_w; fs_reg delta_x; fs_reg delta_y; + fs_reg reg_null_cmp; int grf_used; }; diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp index 3b7b03a..20bfa4c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp @@ -205,6 +205,8 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir) case ir_unop_round_even: case ir_unop_sin: case ir_unop_cos: + case ir_unop_sin_reduced: + case ir_unop_cos_reduced: case ir_unop_dFdx: case ir_unop_dFdy: for (i = 0; i < vector_elements; i++) { @@ -328,6 +330,9 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir) case ir_unop_noise: assert(!"noise should have been broken down to function call"); break; + case ir_quadop_vector: + assert(!"should have been lowered"); + break; } ir->remove(); diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp index bbb210c..078a349 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp @@ -94,6 +94,8 @@ fs_visitor::assign_regs() int class_count = 0; int aligned_pair_class = -1; + calculate_live_intervals(); + /* Set up the register classes. * * The base registers store a scalar value. For texture samples, @@ -416,4 +418,6 @@ fs_visitor::spill_reg(int spill_reg) } } } + + this->live_intervals_valid = false; } diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index b0c76f4..70c451d 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -96,6 +96,9 @@ static void compile_gs_prog( struct brw_context *brw, brw_gs_quad_strip( &c, key ); break; case GL_LINE_LOOP: + /* Gen6: LINELOOP is converted to LINESTRIP at the beginning of the 3D pipeline */ + if (intel->gen == 6) + return; brw_gs_lines( &c ); break; case GL_LINES: @@ -166,6 +169,9 @@ static void populate_key( struct brw_context *brw, struct brw_gs_prog_key *key ) { struct gl_context *ctx = &brw->intel.ctx; + struct intel_context *intel = &brw->intel; + int prim_gs_always; + memset(key, 0, sizeof(*key)); /* CACHE_NEW_VS_PROG */ @@ -185,10 +191,14 @@ static void populate_key( struct brw_context *brw, key->pv_first = GL_TRUE; } - key->need_gs_prog = (key->hint_gs_always || - brw->primitive == GL_QUADS || + if (intel->gen == 6) + prim_gs_always = 0; + else + prim_gs_always = brw->primitive == GL_QUADS || brw->primitive == GL_QUAD_STRIP || - brw->primitive == GL_LINE_LOOP); + brw->primitive == GL_LINE_LOOP; + + key->need_gs_prog = (key->hint_gs_always || prim_gs_always); } /* Calculate interpolants for triangle and line rasterization. @@ -205,8 +215,10 @@ static void prepare_gs_prog(struct brw_context *brw) brw->gs.prog_active = key.need_gs_prog; } + drm_intel_bo_unreference(brw->gs.prog_bo); + brw->gs.prog_bo = NULL; + if (brw->gs.prog_active) { - drm_intel_bo_unreference(brw->gs.prog_bo); brw->gs.prog_bo = brw_search_cache(&brw->cache, BRW_GS_PROG, &key, sizeof(key), NULL, 0, diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index a91b052..79afe19 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -214,7 +214,7 @@ static void emit_depthbuffer(struct brw_context *brw) if (region == NULL) { BEGIN_BATCH(len); - OUT_BATCH(CMD_DEPTH_BUFFER << 16 | (len - 2)); + OUT_BATCH(_3DSTATE_DEPTH_BUFFER << 16 | (len - 2)); OUT_BATCH((BRW_DEPTHFORMAT_D32_FLOAT << 18) | (BRW_SURFACE_NULL << 29)); OUT_BATCH(0); @@ -251,7 +251,7 @@ static void emit_depthbuffer(struct brw_context *brw) assert(region->tiling != I915_TILING_NONE); BEGIN_BATCH(len); - OUT_BATCH(CMD_DEPTH_BUFFER << 16 | (len - 2)); + OUT_BATCH(_3DSTATE_DEPTH_BUFFER << 16 | (len - 2)); OUT_BATCH(((region->pitch * region->cpp) - 1) | (format << 18) | (BRW_TILEWALK_YMAJOR << 26) | @@ -277,7 +277,7 @@ static void emit_depthbuffer(struct brw_context *brw) /* Initialize it for safety. */ if (intel->gen >= 6) { BEGIN_BATCH(2); - OUT_BATCH(CMD_3D_CLEAR_PARAMS << 16 | (2 - 2)); + OUT_BATCH(_3DSTATE_CLEAR_PARAMS << 16 | (2 - 2)); OUT_BATCH(0); ADVANCE_BATCH(); } @@ -309,7 +309,7 @@ static void upload_polygon_stipple(struct brw_context *brw) return; memset(&bps, 0, sizeof(bps)); - bps.header.opcode = CMD_POLY_STIPPLE_PATTERN; + bps.header.opcode = _3DSTATE_POLY_STIPPLE_PATTERN; bps.header.length = sizeof(bps)/4-2; /* Polygon stipple is provided in OpenGL order, i.e. bottom @@ -354,7 +354,7 @@ static void upload_polygon_stipple_offset(struct brw_context *brw) return; memset(&bpso, 0, sizeof(bpso)); - bpso.header.opcode = CMD_POLY_STIPPLE_OFFSET; + bpso.header.opcode = _3DSTATE_POLY_STIPPLE_OFFSET; bpso.header.length = sizeof(bpso)/4-2; /* If we're drawing to a system window (ctx->DrawBuffer->Name == 0), @@ -401,7 +401,7 @@ static void upload_aa_line_parameters(struct brw_context *brw) /* use legacy aa line coverage computation */ memset(&balp, 0, sizeof(balp)); - balp.header.opcode = CMD_AA_LINE_PARAMETERS; + balp.header.opcode = _3DSTATE_AA_LINE_PARAMETERS; balp.header.length = sizeof(balp) / 4 - 2; BRW_CACHED_BATCH_STRUCT(brw, &balp); @@ -431,7 +431,7 @@ static void upload_line_stipple(struct brw_context *brw) return; memset(&bls, 0, sizeof(bls)); - bls.header.opcode = CMD_LINE_STIPPLE_PATTERN; + bls.header.opcode = _3DSTATE_LINE_STIPPLE_PATTERN; bls.header.length = sizeof(bls)/4 - 2; bls.bits0.pattern = ctx->Line.StipplePattern; @@ -481,7 +481,7 @@ static void upload_invarient_state( struct brw_context *brw ) /* Disable depth offset clamping. */ - gdo.header.opcode = CMD_GLOBAL_DEPTH_OFFSET_CLAMP; + gdo.header.opcode = _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP; gdo.header.length = sizeof(gdo)/4 - 2; gdo.depth_offset_clamp = 0.0; @@ -492,20 +492,20 @@ static void upload_invarient_state( struct brw_context *brw ) int i; BEGIN_BATCH(3); - OUT_BATCH(CMD_3D_MULTISAMPLE << 16 | (3 - 2)); + OUT_BATCH(_3DSTATE_MULTISAMPLE << 16 | (3 - 2)); OUT_BATCH(MS_PIXEL_LOCATION_CENTER | MS_NUMSAMPLES_1); OUT_BATCH(0); /* positions for 4/8-sample */ ADVANCE_BATCH(); BEGIN_BATCH(2); - OUT_BATCH(CMD_3D_SAMPLE_MASK << 16 | (2 - 2)); + OUT_BATCH(_3DSTATE_SAMPLE_MASK << 16 | (2 - 2)); OUT_BATCH(1); ADVANCE_BATCH(); for (i = 0; i < 4; i++) { BEGIN_BATCH(4); - OUT_BATCH(CMD_GS_SVB_INDEX << 16 | (4 - 2)); + OUT_BATCH(_3DSTATE_GS_SVB_INDEX << 16 | (4 - 2)); OUT_BATCH(i << SVB_INDEX_SHIFT); OUT_BATCH(0); OUT_BATCH(0xffffffff); diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index 1367d81..94efa79 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -142,7 +142,6 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx, if (newFP == curFP) brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM; newFP->id = brw->program_id++; - newFP->isGLSL = brw_wm_is_glsl(fprog); /* Don't reject fragment shaders for their Mesa IR state when we're * using the new FS backend. diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index f28f286..656aad6 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -232,6 +232,12 @@ brw_prepare_query_begin(struct brw_context *brw) brw->query.bo = NULL; brw->query.bo = drm_intel_bo_alloc(intel->bufmgr, "query", 4096, 1); + + /* clear target buffer */ + drm_intel_bo_map(brw->query.bo, GL_TRUE); + memset((char *)brw->query.bo->virtual, 0, 4096); + drm_intel_bo_unmap(brw->query.bo); + brw->query.index = 0; } diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 3beed16..4bb93e7 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -164,7 +164,8 @@ void brw_destroy_caches( struct brw_context *brw ); /*********************************************************************** * brw_state_batch.c */ -#define BRW_BATCH_STRUCT(brw, s) intel_batchbuffer_data( brw->intel.batch, (s), sizeof(*(s))) +#define BRW_BATCH_STRUCT(brw, s) intel_batchbuffer_data(brw->intel.batch, (s), \ + sizeof(*(s)), false) #define BRW_CACHED_BATCH_STRUCT(brw, s) brw_cached_batch_struct( brw, (s), sizeof(*(s)) ) GLboolean brw_cached_batch_struct( struct brw_context *brw, diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index be3989e..a21af13 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -48,7 +48,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, struct header *newheader = (struct header *)data; if (brw->emit_state_always) { - intel_batchbuffer_data(brw->intel.batch, data, sz); + intel_batchbuffer_data(brw->intel.batch, data, sz, false); return GL_TRUE; } @@ -75,7 +75,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, emit: memcpy(item->header, newheader, sz); - intel_batchbuffer_data(brw->intel.batch, data, sz); + intel_batchbuffer_data(brw->intel.batch, data, sz, false); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index 58ff528..7045888 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -58,8 +58,6 @@ #include "main/imports.h" #include "brw_state.h" -#include "intel_batchbuffer.h" -#include "brw_wm.h" #define FILE_DEBUG_FLAG DEBUG_STATE diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 338f387..eba4411 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -129,7 +129,7 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_vs_constants, /* Before vs_surfaces and constant_buffer */ &brw_wm_constants, /* Before wm_surfaces and constant_buffer */ - &gen6_wm_constants, /* Before wm_surfaces and constant_buffer */ + &gen6_wm_constants, /* Before wm_state */ &brw_vs_surfaces, /* must do before unit */ &brw_wm_constant_surface, /* must do before wm surfaces/bind bo */ diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 8ce9af9..6687a89 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -1017,7 +1017,14 @@ struct brw_wm_unit_state GLuint enable_32_pix:1; GLuint enable_con_32_pix:1; GLuint enable_con_64_pix:1; - GLuint pad0:5; + GLuint pad0:1; + + /* These next four bits are for Ironlake+ */ + GLuint fast_span_coverage_enable:1; + GLuint depth_buffer_clear:1; + GLuint depth_buffer_resolve_enable:1; + GLuint hierarchical_depth_buffer_resolve_enable:1; + GLuint legacy_global_depth_bias:1; GLuint line_stipple:1; GLuint depth_offset:1; @@ -1064,6 +1071,15 @@ struct brw_sampler_default_color { GLfloat color[4]; }; +struct gen5_sampler_default_color { + uint8_t ub[4]; + float f[4]; + uint16_t hf[4]; + uint16_t us[4]; + int16_t s[4]; + uint8_t b[4]; +}; + struct brw_sampler_state { @@ -1169,7 +1185,12 @@ struct brw_surface_state GLuint cube_neg_y:1; GLuint cube_pos_x:1; GLuint cube_neg_x:1; - GLuint pad:4; + GLuint pad:2; + /* Required on gen6 for surfaces accessed through render cache messages. + */ + GLuint render_cache_read_write:1; + /* Ironlake and newer: instead of replicating one of the texels */ + GLuint cube_corner_average:1; GLuint mipmap_layout_mode:1; GLuint vert_line_stride_ofs:1; GLuint vert_line_stride:1; @@ -1539,6 +1560,21 @@ struct brw_instruction GLuint pad0:12; } if_else; + struct + { + /* Signed jump distance to the ip to jump to if all channels + * are disabled after the break or continue. It should point + * to the end of the innermost control flow block, as that's + * where some channel could get re-enabled. + */ + int jip:16; + + /* Signed jump distance to the location to resume execution + * of this channel if it's enabled for the break or continue. + */ + int uip:16; + } break_cont; + struct { GLuint function:4; GLuint int_type:1; @@ -1636,6 +1672,18 @@ struct brw_instruction struct { GLuint binding_table_index:8; + GLuint msg_control:3; + GLuint msg_type:3; + GLuint target_cache:2; + GLuint response_length:4; + GLuint msg_length:4; + GLuint msg_target:4; + GLuint pad1:3; + GLuint end_of_thread:1; + } dp_read_g4x; + + struct { + GLuint binding_table_index:8; GLuint msg_control:3; GLuint msg_type:3; GLuint target_cache:2; diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 4a41c7a..6ae75d2 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -99,8 +99,8 @@ static void do_vs_prog( struct brw_context *brw, (void) ctx; aux_size = sizeof(c.prog_data); - if (c.vp->use_const_buffer) - aux_size += c.vp->program.Base.Parameters->NumParameters; + /* constant_map */ + aux_size += c.vp->program.Base.Parameters->NumParameters; drm_intel_bo_unreference(brw->vs.prog_bo); brw->vs.prog_bo = brw_upload_cache_with_auxdata(&brw->cache, BRW_VS_PROG, @@ -130,6 +130,7 @@ static void brw_upload_vs_prog(struct brw_context *brw) key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled); key.copy_edgeflag = (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL); + key.two_side_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide); /* _NEW_POINT */ if (ctx->Point.PointSprite) { @@ -157,7 +158,7 @@ static void brw_upload_vs_prog(struct brw_context *brw) */ const struct brw_tracked_state brw_vs_prog = { .dirty = { - .mesa = _NEW_TRANSFORM | _NEW_POLYGON | _NEW_POINT, + .mesa = _NEW_TRANSFORM | _NEW_POLYGON | _NEW_POINT | _NEW_LIGHT, .brw = BRW_NEW_VERTEX_PROGRAM, .cache = 0 }, diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h index 9338a6b..0b88cc1 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.h +++ b/src/mesa/drivers/dri/i965/brw_vs.h @@ -44,6 +44,7 @@ struct brw_vs_prog_key { GLuint nr_userclip:4; GLuint copy_edgeflag:1; GLuint point_coord_replace:8; + GLuint two_side_color: 1; }; diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index a13c3ca..0411ce0 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -140,9 +140,13 @@ clear_current_const(struct brw_vs_compile *c) static void brw_vs_alloc_regs( struct brw_vs_compile *c ) { struct intel_context *intel = &c->func.brw->intel; - GLuint i, reg = 0, mrf; + GLuint i, reg = 0, mrf, j; int attributes_in_vue; int first_reladdr_output; + int max_constant; + int constant = 0; + int vert_result_reoder[VERT_RESULT_MAX]; + int bfc = 0; /* Determine whether to use a real constant buffer or use a block * of GRF registers for constants. The later is faster but only @@ -181,62 +185,81 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) } - /* Vertex program parameters from curbe: + /* Assign some (probably all) of the vertex program constants to + * the push constant buffer/CURBE. + * + * There's an obvious limit to the numer of push constants equal to + * the number of register available, and that number is smaller + * than the minimum maximum number of vertex program parameters, so + * support for pull constants is required if we overflow. + * Additionally, on gen6 the number of push constants is even + * lower. + * + * When there's relative addressing, we don't know what range of + * Mesa IR registers can be accessed. And generally, when relative + * addressing is used we also have too many constants to load them + * all as push constants. So, we'll just support relative + * addressing out of the pull constant buffers, and try to load as + * many statically-accessed constants into the push constant buffer + * as we can. */ - if (c->vp->use_const_buffer) { - int max_constant = BRW_MAX_GRF - 20 - c->vp->program.Base.NumTemporaries; - int constant = 0; - - /* We've got more constants than we can load with the push - * mechanism. This is often correlated with reladdr loads where - * we should probably be using a pull mechanism anyway to avoid - * excessive reading. However, the pull mechanism is slow in - * general. So, we try to allocate as many non-reladdr-loaded - * constants through the push buffer as we can before giving up. - */ - memset(c->constant_map, -1, c->vp->program.Base.Parameters->NumParameters); - for (i = 0; - i < c->vp->program.Base.NumInstructions && constant < max_constant; - i++) { - struct prog_instruction *inst = &c->vp->program.Base.Instructions[i]; - int arg; - - for (arg = 0; arg < 3 && constant < max_constant; arg++) { - if ((inst->SrcReg[arg].File != PROGRAM_STATE_VAR && - inst->SrcReg[arg].File != PROGRAM_CONSTANT && - inst->SrcReg[arg].File != PROGRAM_UNIFORM && - inst->SrcReg[arg].File != PROGRAM_ENV_PARAM && - inst->SrcReg[arg].File != PROGRAM_LOCAL_PARAM) || - inst->SrcReg[arg].RelAddr) - continue; - - if (c->constant_map[inst->SrcReg[arg].Index] == -1) { - c->constant_map[inst->SrcReg[arg].Index] = constant++; - } + if (intel->gen >= 6) { + /* We can only load 32 regs of push constants. */ + max_constant = 32 * 2 - c->key.nr_userclip; + } else { + max_constant = BRW_MAX_GRF - 20 - c->vp->program.Base.NumTemporaries; + } + + /* constant_map maps from ParameterValues[] index to index in the + * push constant buffer, or -1 if it's only in the pull constant + * buffer. + */ + memset(c->constant_map, -1, c->vp->program.Base.Parameters->NumParameters); + for (i = 0; + i < c->vp->program.Base.NumInstructions && constant < max_constant; + i++) { + struct prog_instruction *inst = &c->vp->program.Base.Instructions[i]; + int arg; + + for (arg = 0; arg < 3 && constant < max_constant; arg++) { + if (inst->SrcReg[arg].File != PROGRAM_STATE_VAR && + inst->SrcReg[arg].File != PROGRAM_CONSTANT && + inst->SrcReg[arg].File != PROGRAM_UNIFORM && + inst->SrcReg[arg].File != PROGRAM_ENV_PARAM && + inst->SrcReg[arg].File != PROGRAM_LOCAL_PARAM) { + continue; + } + + if (inst->SrcReg[arg].RelAddr) { + c->vp->use_const_buffer = GL_TRUE; + continue; } - } - for (i = 0; i < constant; i++) { - c->regs[PROGRAM_STATE_VAR][i] = stride( brw_vec4_grf(reg+i/2, - (i%2) * 4), - 0, 4, 1); + if (c->constant_map[inst->SrcReg[arg].Index] == -1) { + c->constant_map[inst->SrcReg[arg].Index] = constant++; + } } - reg += (constant + 1) / 2; - c->prog_data.curb_read_length = reg - 1; - /* XXX 0 causes a bug elsewhere... */ - c->prog_data.nr_params = MAX2(constant * 4, 4); } - else { - /* use a section of the GRF for constants */ - GLuint nr_params = c->vp->program.Base.Parameters->NumParameters; - for (i = 0; i < nr_params; i++) { - c->regs[PROGRAM_STATE_VAR][i] = stride( brw_vec4_grf(reg+i/2, (i%2) * 4), 0, 4, 1); - } - reg += (nr_params + 1) / 2; - c->prog_data.curb_read_length = reg - 1; - c->prog_data.nr_params = nr_params * 4; + /* If we ran out of push constant space, then we'll also upload all + * constants through the pull constant buffer so that they can be + * accessed no matter what. For relative addressing (the common + * case) we need them all in place anyway. + */ + if (constant == max_constant) + c->vp->use_const_buffer = GL_TRUE; + + for (i = 0; i < constant; i++) { + c->regs[PROGRAM_STATE_VAR][i] = stride(brw_vec4_grf(reg + i / 2, + (i % 2) * 4), + 0, 4, 1); } + reg += (constant + 1) / 2; + c->prog_data.curb_read_length = reg - 1; + c->prog_data.nr_params = constant * 4; + /* XXX 0 causes a bug elsewhere... */ + if (intel->gen < 6 && c->prog_data.nr_params == 0) + c->prog_data.nr_params = 4; /* Allocate input regs: */ @@ -270,7 +293,36 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) mrf = 4; first_reladdr_output = get_first_reladdr_output(&c->vp->program); - for (i = 0; i < VERT_RESULT_MAX; i++) { + + for (i = 0; i < VERT_RESULT_MAX; i++) + vert_result_reoder[i] = i; + + /* adjust attribute order in VUE for BFC0/BFC1 on Gen6+ */ + if (intel->gen >= 6 && c->key.two_side_color) { + if ((c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_COL1)) && + (c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC1))) { + assert(c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_COL0)); + assert(c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC0)); + bfc = 2; + } else if ((c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_COL0)) && + (c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC0))) + bfc = 1; + + if (bfc) { + for (i = 0; i < bfc; i++) { + vert_result_reoder[VERT_RESULT_COL0 + i * 2 + 0] = VERT_RESULT_COL0 + i; + vert_result_reoder[VERT_RESULT_COL0 + i * 2 + 1] = VERT_RESULT_BFC0 + i; + } + + for (i = VERT_RESULT_COL0 + bfc * 2; i < VERT_RESULT_BFC0 + bfc; i++) { + vert_result_reoder[i] = i - bfc; + } + } + } + + for (j = 0; j < VERT_RESULT_MAX; j++) { + i = vert_result_reoder[j]; + if (c->prog_data.outputs_written & BITFIELD64_BIT(i)) { c->nr_outputs++; assert(i < Elements(c->regs[PROGRAM_OUTPUT])); @@ -281,7 +333,6 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) else if (i == VERT_RESULT_PSIZ) { c->regs[PROGRAM_OUTPUT][i] = brw_vec8_grf(reg, 0); reg++; - mrf++; /* just a placeholder? XXX fix later stages & remove this */ } else { /* Two restrictions on our compute-to-MRF here. The @@ -607,6 +658,22 @@ static void emit_min( struct brw_compile *p, } } +static void emit_arl(struct brw_compile *p, + struct brw_reg dst, + struct brw_reg src) +{ + struct intel_context *intel = &p->brw->intel; + + if (intel->gen >= 6) { + struct brw_reg dst_f = retype(dst, BRW_REGISTER_TYPE_F); + + brw_RNDD(p, dst_f, src); + brw_MOV(p, dst, dst_f); + } else { + brw_RNDD(p, dst, src); + } +} + static void emit_math1_gen4(struct brw_vs_compile *c, GLuint function, struct brw_reg dst, @@ -698,7 +765,7 @@ emit_math1(struct brw_vs_compile *c, emit_math1_gen4(c, function, dst, arg0, precision); } -static void emit_math2( struct brw_vs_compile *c, +static void emit_math2_gen4( struct brw_vs_compile *c, GLuint function, struct brw_reg dst, struct brw_reg arg0, @@ -706,14 +773,11 @@ static void emit_math2( struct brw_vs_compile *c, GLuint precision) { struct brw_compile *p = &c->func; - struct intel_context *intel = &p->brw->intel; struct brw_reg tmp = dst; GLboolean need_tmp = GL_FALSE; - if (dst.file != BRW_GENERAL_REGISTER_FILE) - need_tmp = GL_TRUE; - - if (intel->gen < 6 && dst.dw1.bits.writemask != 0xf) + if (dst.file != BRW_GENERAL_REGISTER_FILE || + dst.dw1.bits.writemask != 0xf) need_tmp = GL_TRUE; if (need_tmp) @@ -736,6 +800,53 @@ static void emit_math2( struct brw_vs_compile *c, } } +static void emit_math2_gen6( struct brw_vs_compile *c, + GLuint function, + struct brw_reg dst, + struct brw_reg arg0, + struct brw_reg arg1, + GLuint precision) +{ + struct brw_compile *p = &c->func; + struct brw_reg tmp_src0, tmp_src1, tmp_dst; + + tmp_src0 = get_tmp(c); + tmp_src1 = get_tmp(c); + tmp_dst = get_tmp(c); + + brw_MOV(p, tmp_src0, arg0); + brw_MOV(p, tmp_src1, arg1); + + brw_set_access_mode(p, BRW_ALIGN_1); + brw_math2(p, + tmp_dst, + function, + tmp_src0, + tmp_src1); + brw_set_access_mode(p, BRW_ALIGN_16); + + brw_MOV(p, dst, tmp_dst); + + release_tmp(c, tmp_src0); + release_tmp(c, tmp_src1); + release_tmp(c, tmp_dst); +} + +static void emit_math2( struct brw_vs_compile *c, + GLuint function, + struct brw_reg dst, + struct brw_reg arg0, + struct brw_reg arg1, + GLuint precision) +{ + struct brw_compile *p = &c->func; + struct intel_context *intel = &p->brw->intel; + + if (intel->gen >= 6) + emit_math2_gen6(c, function, dst, arg0, arg1, precision); + else + emit_math2_gen4(c, function, dst, arg0, arg1, precision); +} static void emit_exp_noalias( struct brw_vs_compile *c, struct brw_reg dst, @@ -1008,8 +1119,6 @@ get_constant(struct brw_vs_compile *c, assert(argIndex < 3); - assert(c->func.brw->intel.gen < 6); /* FINISHME */ - if (c->current_const[argIndex].index != src->Index) { /* Keep track of the last constant loaded in this slot, for reuse. */ c->current_const[argIndex].index = src->Index; @@ -1027,7 +1136,7 @@ get_constant(struct brw_vs_compile *c, } /* replicate lower four floats into upper half (to get XYZWXYZW) */ - const_reg = stride(const_reg, 0, 4, 0); + const_reg = stride(const_reg, 0, 4, 1); const_reg.subnr = 0; return const_reg; @@ -1040,14 +1149,14 @@ get_reladdr_constant(struct brw_vs_compile *c, { const struct prog_src_register *src = &inst->SrcReg[argIndex]; struct brw_compile *p = &c->func; + struct brw_context *brw = p->brw; + struct intel_context *intel = &brw->intel; struct brw_reg const_reg = c->current_const[argIndex].reg; - struct brw_reg addrReg = c->regs[PROGRAM_ADDRESS][0]; - struct brw_reg byte_addr_reg = retype(get_tmp(c), BRW_REGISTER_TYPE_D); + struct brw_reg addr_reg = c->regs[PROGRAM_ADDRESS][0]; + uint32_t offset; assert(argIndex < 3); - assert(c->func.brw->intel.gen < 6); /* FINISHME */ - /* Can't reuse a reladdr constant load. */ c->current_const[argIndex].index = -1; @@ -1056,15 +1165,21 @@ get_reladdr_constant(struct brw_vs_compile *c, src->Index, argIndex, c->current_const[argIndex].reg.nr); #endif - brw_MUL(p, byte_addr_reg, addrReg, brw_imm_ud(16)); + if (intel->gen >= 6) { + offset = src->Index; + } else { + struct brw_reg byte_addr_reg = retype(get_tmp(c), BRW_REGISTER_TYPE_D); + brw_MUL(p, byte_addr_reg, addr_reg, brw_imm_d(16)); + addr_reg = byte_addr_reg; + offset = 16 * src->Index; + } /* fetch the first vec4 */ brw_dp_READ_4_vs_relative(p, - const_reg, /* writeback dest */ - byte_addr_reg, /* address register */ - 16 * src->Index, /* byte offset */ - SURF_INDEX_VERT_CONST_BUFFER /* binding table index */ - ); + const_reg, + addr_reg, + offset, + SURF_INDEX_VERT_CONST_BUFFER); return const_reg; } @@ -1259,22 +1374,18 @@ get_src_reg( struct brw_vs_compile *c, case PROGRAM_UNIFORM: case PROGRAM_ENV_PARAM: case PROGRAM_LOCAL_PARAM: - if (c->vp->use_const_buffer) { - if (!relAddr && c->constant_map[index] != -1) { - assert(c->regs[PROGRAM_STATE_VAR][c->constant_map[index]].nr != 0); - return c->regs[PROGRAM_STATE_VAR][c->constant_map[index]]; - } else if (relAddr) + if (!relAddr && c->constant_map[index] != -1) { + /* Take from the push constant buffer if possible. */ + assert(c->regs[PROGRAM_STATE_VAR][c->constant_map[index]].nr != 0); + return c->regs[PROGRAM_STATE_VAR][c->constant_map[index]]; + } else { + /* Must be in the pull constant buffer then .*/ + assert(c->vp->use_const_buffer); + if (relAddr) return get_reladdr_constant(c, inst, argIndex); else return get_constant(c, inst, argIndex); } - else if (relAddr) { - return deref(c, c->regs[PROGRAM_STATE_VAR][0], index, 16); - } - else { - assert(c->regs[PROGRAM_STATE_VAR][index].nr != 0); - return c->regs[PROGRAM_STATE_VAR][index]; - } case PROGRAM_ADDRESS: assert(index == 0); return c->regs[file][index]; @@ -1315,11 +1426,10 @@ static struct brw_reg get_arg( struct brw_vs_compile *c, GET_SWZ(src->Swizzle, 1), GET_SWZ(src->Swizzle, 2), GET_SWZ(src->Swizzle, 3)); - } - /* Note this is ok for non-swizzle instructions: - */ - reg.negate = src->Negate ? 1 : 0; + /* Note this is ok for non-swizzle ARB_vp instructions */ + reg.negate = src->Negate ? 1 : 0; + } return reg; } @@ -1603,6 +1713,8 @@ static void emit_vertex_write( struct brw_vs_compile *c) break; if (!(c->prog_data.outputs_written & BITFIELD64_BIT(i))) continue; + if (i == VERT_RESULT_PSIZ) + continue; if (i >= VERT_RESULT_TEX0 && c->regs[PROGRAM_OUTPUT][i].file == BRW_GENERAL_REGISTER_FILE) { @@ -1830,6 +1942,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) switch (inst->Opcode) { case OPCODE_ABS: + args[0].negate = false; brw_MOV(p, dst, brw_abs(args[0])); break; case OPCODE_ADD: @@ -1866,7 +1979,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) emit_math1(c, BRW_MATH_FUNCTION_EXP, dst, args[0], BRW_MATH_PRECISION_FULL); break; case OPCODE_ARL: - brw_RNDD(p, dst, args[0]); + emit_arl(p, dst, args[0]); break; case OPCODE_FLR: brw_RNDD(p, dst, args[0]); @@ -1913,7 +2026,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) emit_math1(c, BRW_MATH_FUNCTION_INV, dst, args[0], BRW_MATH_PRECISION_FULL); break; case OPCODE_RSQ: - emit_math1(c, BRW_MATH_FUNCTION_RSQ, dst, args[0], BRW_MATH_PRECISION_FULL); + emit_math1(c, BRW_MATH_FUNCTION_RSQ, dst, brw_abs(args[0]), BRW_MATH_PRECISION_FULL); break; case OPCODE_SEQ: @@ -1987,35 +2100,42 @@ void brw_vs_emit(struct brw_vs_compile *c ) break; case OPCODE_CONT: brw_set_predicate_control(p, get_predicate(inst)); - brw_CONT(p, if_depth_in_loop[loop_depth]); + if (intel->gen >= 6) { + brw_CONT_gen6(p, loop_inst[loop_depth - 1]); + } else { + brw_CONT(p, if_depth_in_loop[loop_depth]); + } brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; - case OPCODE_ENDLOOP: - { - clear_current_const(c); - struct brw_instruction *inst0, *inst1; - GLuint br = 1; - - loop_depth--; - - if (intel->gen == 5) - br = 2; - - inst0 = inst1 = brw_WHILE(p, loop_inst[loop_depth]); - /* patch all the BREAK/CONT instructions from last BEGINLOOP */ - while (inst0 > loop_inst[loop_depth]) { - inst0--; - if (inst0->header.opcode == BRW_OPCODE_BREAK && + + case OPCODE_ENDLOOP: { + clear_current_const(c); + struct brw_instruction *inst0, *inst1; + GLuint br = 1; + + loop_depth--; + + if (intel->gen == 5) + br = 2; + + inst0 = inst1 = brw_WHILE(p, loop_inst[loop_depth]); + + if (intel->gen < 6) { + /* patch all the BREAK/CONT instructions from last BEGINLOOP */ + while (inst0 > loop_inst[loop_depth]) { + inst0--; + if (inst0->header.opcode == BRW_OPCODE_BREAK && inst0->bits3.if_else.jump_count == 0) { - inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); - } - else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && - inst0->bits3.if_else.jump_count == 0) { - inst0->bits3.if_else.jump_count = br * (inst1 - inst0); - } - } - } + inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); + } else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && + inst0->bits3.if_else.jump_count == 0) { + inst0->bits3.if_else.jump_count = br * (inst1 - inst0); + } + } + } + } break; + case OPCODE_BRA: brw_set_predicate_control(p, get_predicate(inst)); brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); @@ -2106,6 +2226,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) } brw_resolve_cals(p); + brw_set_uip_jip(p); brw_optimize(p); diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index eabac51..b0b0544 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -82,6 +82,15 @@ prepare_vs_constants(struct brw_context *brw) params->ParameterValues[i], 4 * sizeof(float)); } + + if (0) { + for (i = 0; i < params->NumParameters; i++) { + float *row = (float *)brw->vs.const_bo->virtual + i * 4; + printf("vs const surface %3d: %4.3f %4.3f %4.3f %4.3f\n", + i, row[0], row[1], row[2], row[3]); + } + } + drm_intel_gem_bo_unmap_gtt(brw->vs.const_bo); brw->state.dirty.brw |= BRW_NEW_VS_CONSTBUF; } diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 3d7a98c..100a21b 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -203,4 +203,5 @@ void brwInitVtbl( struct brw_context *brw ) brw->intel.vtbl.destroy = brw_destroy_context; brw->intel.vtbl.set_draw_region = brw_set_draw_region; brw->intel.vtbl.debug_batch = brw_debug_batch; + brw->intel.vtbl.render_target_supported = brw_render_target_supported; } diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index ccdc18e..656501b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -119,6 +119,62 @@ brw_wm_non_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) brw_wm_emit(c); } +static void +brw_wm_payload_setup(struct brw_context *brw, + struct brw_wm_compile *c) +{ + struct intel_context *intel = &brw->intel; + bool uses_depth = (c->fp->program.Base.InputsRead & + (1 << FRAG_ATTRIB_WPOS)) != 0; + + if (intel->gen >= 6) { + /* R0-1: masks, pixel X/Y coordinates. */ + c->nr_payload_regs = 2; + /* R2: only for 32-pixel dispatch.*/ + /* R3-4: perspective pixel location barycentric */ + c->nr_payload_regs += 2; + /* R5-6: perspective pixel location bary for dispatch width != 8 */ + if (c->dispatch_width == 16) { + c->nr_payload_regs += 2; + } + /* R7-10: perspective centroid barycentric */ + /* R11-14: perspective sample barycentric */ + /* R15-18: linear pixel location barycentric */ + /* R19-22: linear centroid barycentric */ + /* R23-26: linear sample barycentric */ + + /* R27: interpolated depth if uses source depth */ + if (uses_depth) { + c->source_depth_reg = c->nr_payload_regs; + c->nr_payload_regs++; + if (c->dispatch_width == 16) { + /* R28: interpolated depth if not 8-wide. */ + c->nr_payload_regs++; + } + } + /* R29: interpolated W set if GEN6_WM_USES_SOURCE_W. + */ + if (uses_depth) { + c->source_w_reg = c->nr_payload_regs; + c->nr_payload_regs++; + if (c->dispatch_width == 16) { + /* R30: interpolated W if not 8-wide. */ + c->nr_payload_regs++; + } + } + /* R31: MSAA position offsets. */ + /* R32-: bary for 32-pixel. */ + /* R58-59: interp W for 32-pixel. */ + + if (c->fp->program.Base.OutputsWritten & + BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { + c->source_depth_to_render_target = GL_TRUE; + c->computes_depth = GL_TRUE; + } + } else { + brw_wm_lookup_iz(intel, c); + } +} /** * All Mesa program -> GPU code generation goes through this function. @@ -167,23 +223,18 @@ static void do_wm_prog( struct brw_context *brw, brw_init_compile(brw, &c->func); - /* temporary sanity check assertion */ - ASSERT(fp->isGLSL == brw_wm_is_glsl(&c->fp->program)); + brw_wm_payload_setup(brw, c); if (!brw_wm_fs_emit(brw, c)) { /* * Shader which use GLSL features such as flow control are handled * differently from "simple" shaders. */ - if (fp->isGLSL) { - c->dispatch_width = 8; - brw_wm_glsl_emit(brw, c); - } - else { - c->dispatch_width = 16; - brw_wm_non_glsl_emit(brw, c); - } + c->dispatch_width = 16; + brw_wm_payload_setup(brw, c); + brw_wm_non_glsl_emit(brw, c); } + c->prog_data.dispatch_width = c->dispatch_width; /* Scratch space is used for register spilling */ if (c->last_scratch) { @@ -220,12 +271,10 @@ static void do_wm_prog( struct brw_context *brw, static void brw_wm_populate_key( struct brw_context *brw, struct brw_wm_prog_key *key ) { - struct intel_context *intel = &brw->intel; struct gl_context *ctx = &brw->intel.ctx; /* BRW_NEW_FRAGMENT_PROGRAM */ const struct brw_fragment_program *fp = (struct brw_fragment_program *)brw->fragment_program; - GLboolean uses_depth = (fp->program.Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0; GLuint lookup = 0; GLuint line_aa; GLuint i; @@ -285,57 +334,9 @@ static void brw_wm_populate_key( struct brw_context *brw, } } - if (intel->gen >= 6) { - /* R0-1: masks, pixel X/Y coordinates. */ - key->nr_payload_regs = 2; - /* R2: only for 32-pixel dispatch.*/ - /* R3-4: perspective pixel location barycentric */ - key->nr_payload_regs += 2; - /* R5-6: perspective pixel location bary for dispatch width != 8 */ - if (!fp->isGLSL) { /* dispatch_width != 8 */ - key->nr_payload_regs += 2; - } - /* R7-10: perspective centroid barycentric */ - /* R11-14: perspective sample barycentric */ - /* R15-18: linear pixel location barycentric */ - /* R19-22: linear centroid barycentric */ - /* R23-26: linear sample barycentric */ - - /* R27: interpolated depth if uses source depth */ - if (uses_depth) { - key->source_depth_reg = key->nr_payload_regs; - key->nr_payload_regs++; - if (!fp->isGLSL) { /* dispatch_width != 8 */ - /* R28: interpolated depth if not 8-wide. */ - key->nr_payload_regs++; - } - } - /* R29: interpolated W set if GEN6_WM_USES_SOURCE_W. - */ - if (uses_depth) { - key->source_w_reg = key->nr_payload_regs; - key->nr_payload_regs++; - if (!fp->isGLSL) { /* dispatch_width != 8 */ - /* R30: interpolated W if not 8-wide. */ - key->nr_payload_regs++; - } - } - /* R31: MSAA position offsets. */ - /* R32-: bary for 32-pixel. */ - /* R58-59: interp W for 32-pixel. */ - - if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { - key->source_depth_to_render_target = GL_TRUE; - key->computes_depth = GL_TRUE; - } - - } else { - brw_wm_lookup_iz(intel, - line_aa, - lookup, - uses_depth, - key); - } + key->iz_lookup = lookup; + key->line_aa = line_aa; + key->stats_wm = brw->intel.stats_wm; /* BRW_NEW_WM_INPUT_DIMENSIONS */ key->proj_attrib_mask = brw->wm.input_size_masks[4-1]; @@ -377,6 +378,10 @@ static void brw_wm_populate_key( struct brw_context *brw, swizzles[2] = SWIZZLE_ZERO; } else if (t->DepthMode == GL_LUMINANCE) { swizzles[3] = SWIZZLE_ONE; + } else if (t->DepthMode == GL_RED) { + swizzles[1] = SWIZZLE_ZERO; + swizzles[2] = SWIZZLE_ZERO; + swizzles[3] = SWIZZLE_ZERO; } } diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 2ca6857..d9cae75 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -59,16 +59,9 @@ #define AA_ALWAYS 2 struct brw_wm_prog_key { - GLuint source_depth_reg:3; - GLuint source_w_reg:3; - GLuint aa_dest_stencil_reg:3; - GLuint dest_depth_reg:3; - GLuint nr_payload_regs:4; - GLuint computes_depth:1; /* could be derived from program string */ - GLuint source_depth_to_render_target:1; + GLuint stats_wm:1; GLuint flat_shade:1; GLuint linear_color:1; /**< linear interpolation vs perspective interp */ - GLuint runtime_check_aads_emit:1; GLuint nr_color_regions:5; GLuint render_to_fbo:1; @@ -81,6 +74,8 @@ struct brw_wm_prog_key { GLushort drawable_height; GLbitfield64 vp_outputs_written; + GLuint iz_lookup; + GLuint line_aa; GLuint program_string_id:32; }; @@ -204,6 +199,15 @@ struct brw_wm_compile { PASS2_DONE } state; + GLuint source_depth_reg:3; + GLuint source_w_reg:3; + GLuint aa_dest_stencil_reg:3; + GLuint dest_depth_reg:3; + GLuint nr_payload_regs:4; + GLuint computes_depth:1; /* could be derived from program string */ + GLuint source_depth_to_render_target:1; + GLuint runtime_check_aads_emit:1; + /* Initial pass - translate fp instructions to fp instructions, * simplifying and adding instructions for interpolation and * framebuffer writes. @@ -306,14 +310,9 @@ void brw_wm_print_insn( struct brw_wm_compile *c, void brw_wm_print_program( struct brw_wm_compile *c, const char *stage ); -void brw_wm_lookup_iz( struct intel_context *intel, - GLuint line_aa, - GLuint lookup, - GLboolean ps_uses_depth, - struct brw_wm_prog_key *key ); +void brw_wm_lookup_iz(struct intel_context *intel, + struct brw_wm_compile *c); -GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp); -void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c); GLboolean brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c); /* brw_wm_emit.c */ @@ -381,7 +380,6 @@ void emit_fb_write(struct brw_wm_compile *c, void emit_frontfacing(struct brw_compile *p, const struct brw_reg *dst, GLuint mask); -void emit_kil_nv(struct brw_wm_compile *c); void emit_linterp(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, @@ -476,5 +474,6 @@ struct gl_shader *brw_new_shader(struct gl_context *ctx, GLuint name, GLuint typ struct gl_shader_program *brw_new_shader_program(struct gl_context *ctx, GLuint name); bool brw_color_buffer_write_enabled(struct brw_context *brw); +bool brw_render_target_supported(gl_format format); #endif diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 96fecc9..2336e27 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -219,43 +219,45 @@ void emit_wpos_xy(struct brw_wm_compile *c, const struct brw_reg *arg0) { struct brw_compile *p = &c->func; + struct intel_context *intel = &p->brw->intel; + struct brw_reg delta_x = retype(arg0[0], BRW_REGISTER_TYPE_W); + struct brw_reg delta_y = retype(arg0[1], BRW_REGISTER_TYPE_W); if (mask & WRITEMASK_X) { + if (intel->gen >= 6) { + struct brw_reg delta_x_f = retype(delta_x, BRW_REGISTER_TYPE_F); + brw_MOV(p, delta_x_f, delta_x); + delta_x = delta_x_f; + } + if (c->fp->program.PixelCenterInteger) { /* X' = X */ - brw_MOV(p, - dst[0], - retype(arg0[0], BRW_REGISTER_TYPE_W)); + brw_MOV(p, dst[0], delta_x); } else { /* X' = X + 0.5 */ - brw_ADD(p, - dst[0], - retype(arg0[0], BRW_REGISTER_TYPE_W), - brw_imm_f(0.5)); + brw_ADD(p, dst[0], delta_x, brw_imm_f(0.5)); } } if (mask & WRITEMASK_Y) { + if (intel->gen >= 6) { + struct brw_reg delta_y_f = retype(delta_y, BRW_REGISTER_TYPE_F); + brw_MOV(p, delta_y_f, delta_y); + delta_y = delta_y_f; + } + if (c->fp->program.OriginUpperLeft) { if (c->fp->program.PixelCenterInteger) { /* Y' = Y */ - brw_MOV(p, - dst[1], - retype(arg0[1], BRW_REGISTER_TYPE_W)); + brw_MOV(p, dst[1], delta_y); } else { - /* Y' = Y + 0.5 */ - brw_ADD(p, - dst[1], - retype(arg0[1], BRW_REGISTER_TYPE_W), - brw_imm_f(0.5)); + brw_ADD(p, dst[1], delta_y, brw_imm_f(0.5)); } } else { float center_offset = c->fp->program.PixelCenterInteger ? 0.0 : 0.5; /* Y' = (height - 1) - Y + center */ - brw_ADD(p, - dst[1], - negate(retype(arg0[1], BRW_REGISTER_TYPE_W)), + brw_ADD(p, dst[1], negate(delta_y), brw_imm_f(c->key.drawable_height - 1 + center_offset)); } } @@ -896,10 +898,14 @@ void emit_math1(struct brw_wm_compile *c, BRW_MATH_SATURATE_NONE); struct brw_reg src; - if (intel->gen >= 6 && (arg0[0].hstride == BRW_HORIZONTAL_STRIDE_0 || - arg0[0].file != BRW_GENERAL_REGISTER_FILE)) { + if (intel->gen >= 6 && ((arg0[0].hstride == BRW_HORIZONTAL_STRIDE_0 || + arg0[0].file != BRW_GENERAL_REGISTER_FILE) || + arg0[0].negate || arg0[0].abs)) { /* Gen6 math requires that source and dst horizontal stride be 1, * and that the argument be in the GRF. + * + * The hardware ignores source modifiers (negate and abs) on math + * instructions, so we also move to a temp to set those up. */ src = dst[dst_chan]; brw_MOV(p, src, arg0[0]); @@ -967,34 +973,23 @@ void emit_math2(struct brw_wm_compile *c, struct brw_reg temp_dst = dst[dst_chan]; if (arg0[0].hstride == BRW_HORIZONTAL_STRIDE_0) { - if (arg1[0].hstride == BRW_HORIZONTAL_STRIDE_0) { - /* Both scalar arguments. Do scalar calc. */ - src0.hstride = BRW_HORIZONTAL_STRIDE_1; - src1.hstride = BRW_HORIZONTAL_STRIDE_1; - temp_dst.hstride = BRW_HORIZONTAL_STRIDE_1; - temp_dst.width = BRW_WIDTH_1; - - if (arg0[0].subnr != 0) { - brw_MOV(p, temp_dst, src0); - src0 = temp_dst; - - /* Ouch. We've used the temp as a dst, and we still - * need a temp to store arg1 in, because src and dst - * offsets have to be equal. Leaving this up to - * glsl2-965 to handle correctly. - */ - assert(arg1[0].subnr == 0); - } else if (arg1[0].subnr != 0) { - brw_MOV(p, temp_dst, src1); - src1 = temp_dst; - } - } else { - brw_MOV(p, temp_dst, src0); - src0 = temp_dst; - } - } else if (arg1[0].hstride == BRW_HORIZONTAL_STRIDE_0) { - brw_MOV(p, temp_dst, src1); - src1 = temp_dst; + brw_MOV(p, temp_dst, src0); + src0 = temp_dst; + } + + if (arg1[0].hstride == BRW_HORIZONTAL_STRIDE_0) { + /* This is a heinous hack to get a temporary register for use + * in case both arg0 and arg1 are constants. Why you're + * doing exponentiation on constant values in the shader, we + * don't know. + * + * max_wm_grf is almost surely less than the maximum GRF, and + * gen6 doesn't care about the number of GRFs used in a + * shader like pre-gen6 did. + */ + struct brw_reg temp = brw_vec8_grf(c->max_wm_grf, 0); + brw_MOV(p, temp, src1); + src1 = temp; } brw_set_saturate(p, (mask & SATURATE) ? 1 : 0); @@ -1012,14 +1007,6 @@ void emit_math2(struct brw_wm_compile *c, sechalf(src0), sechalf(src1)); } - - /* Splat a scalar result into all the channels. */ - if (arg0[0].hstride == BRW_HORIZONTAL_STRIDE_0 && - arg1[0].hstride == BRW_HORIZONTAL_STRIDE_0) { - temp_dst.hstride = BRW_HORIZONTAL_STRIDE_0; - temp_dst.vstride = BRW_VERTICAL_STRIDE_0; - brw_MOV(p, dst[dst_chan], temp_dst); - } } else { GLuint saturate = ((mask & SATURATE) ? BRW_MATH_SATURATE_SATURATE : @@ -1301,9 +1288,15 @@ static void emit_kil( struct brw_wm_compile *c, struct brw_reg *arg0) { struct brw_compile *p = &c->func; - struct brw_reg r0uw = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW); + struct intel_context *intel = &p->brw->intel; + struct brw_reg pixelmask; GLuint i, j; + if (intel->gen >= 6) + pixelmask = retype(brw_vec1_grf(1, 7), BRW_REGISTER_TYPE_UW); + else + pixelmask = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW); + for (i = 0; i < 4; i++) { /* Check if we've already done the comparison for this reg * -- common when someone does KIL TEMP.wwww. @@ -1319,26 +1312,11 @@ static void emit_kil( struct brw_wm_compile *c, brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_GE, arg0[i], brw_imm_f(0)); brw_set_predicate_control_flag_value(p, 0xff); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_AND(p, r0uw, brw_flag_reg(), r0uw); + brw_AND(p, pixelmask, brw_flag_reg(), pixelmask); brw_pop_insn_state(p); } } -/* KIL_NV kills the pixels that are currently executing, not based on a test - * of the arguments. - */ -void emit_kil_nv( struct brw_wm_compile *c ) -{ - struct brw_compile *p = &c->func; - struct brw_reg r0uw = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW); - - brw_push_insn_state(p); - brw_set_mask_control(p, BRW_MASK_DISABLE); - brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); /* IMASK */ - brw_AND(p, r0uw, c->emit_mask_reg, r0uw); - brw_pop_insn_state(p); -} - static void fire_fb_write( struct brw_wm_compile *c, GLuint base_reg, GLuint nr, @@ -1355,9 +1333,11 @@ static void fire_fb_write( struct brw_wm_compile *c, dst = retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW); /* Pass through control information: + * + * Gen6 has done m1 mov in emit_fb_write() for current SIMD16 case. */ /* mov (8) m1.0<1>:ud r1.0<8;8,1>:ud { Align1 NoMask } */ - if (intel->gen < 6) /* gen6, use headerless for fb write */ + if (intel->gen < 6) { brw_push_insn_state(p); brw_set_mask_control(p, BRW_MASK_DISABLE); /* ? */ @@ -1378,7 +1358,8 @@ static void fire_fb_write( struct brw_wm_compile *c, target, nr, 0, - eot); + eot, + GL_TRUE); } @@ -1387,8 +1368,8 @@ static void emit_aa( struct brw_wm_compile *c, GLuint reg ) { struct brw_compile *p = &c->func; - GLuint comp = c->key.aa_dest_stencil_reg / 2; - GLuint off = c->key.aa_dest_stencil_reg % 2; + GLuint comp = c->aa_dest_stencil_reg / 2; + GLuint off = c->aa_dest_stencil_reg % 2; struct brw_reg aa = offset(arg1[comp], off); brw_push_insn_state(p); @@ -1416,11 +1397,10 @@ void emit_fb_write(struct brw_wm_compile *c, struct intel_context *intel = &brw->intel; GLuint nr = 2; GLuint channel; - int base_reg; /* For gen6 fb write with no header, starting from color payload directly!. */ /* Reserve a space for AA - may not be needed: */ - if (c->key.aa_dest_stencil_reg) + if (c->aa_dest_stencil_reg) nr += 1; /* I don't really understand how this achieves the color interleave @@ -1428,11 +1408,6 @@ void emit_fb_write(struct brw_wm_compile *c, */ brw_push_insn_state(p); - if (intel->gen >= 6) - base_reg = nr; - else - base_reg = 0; - for (channel = 0; channel < 4; channel++) { if (intel->gen >= 6) { /* gen6 SIMD16 single source DP write looks like: @@ -1493,9 +1468,9 @@ void emit_fb_write(struct brw_wm_compile *c, brw_pop_insn_state(p); - if (c->key.source_depth_to_render_target) + if (c->source_depth_to_render_target) { - if (c->key.computes_depth) + if (c->computes_depth) brw_MOV(p, brw_message_reg(nr), arg2[2]); else brw_MOV(p, brw_message_reg(nr), arg1[1]); /* ? */ @@ -1503,10 +1478,10 @@ void emit_fb_write(struct brw_wm_compile *c, nr += 2; } - if (c->key.dest_depth_reg) + if (c->dest_depth_reg) { - GLuint comp = c->key.dest_depth_reg / 2; - GLuint off = c->key.dest_depth_reg % 2; + GLuint comp = c->dest_depth_reg / 2; + GLuint off = c->dest_depth_reg % 2; if (off != 0) { brw_push_insn_state(p); @@ -1524,15 +1499,28 @@ void emit_fb_write(struct brw_wm_compile *c, } if (intel->gen >= 6) { - /* Subtract off the message header, since we send headerless. */ - nr -= 2; + /* Load the message header. There's no implied move from src0 + * to the base mrf on gen6. + */ + brw_push_insn_state(p); + brw_set_mask_control(p, BRW_MASK_DISABLE); + brw_MOV(p, retype(brw_message_reg(0), BRW_REGISTER_TYPE_UD), + retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UD)); + brw_pop_insn_state(p); + + if (target != 0) { + brw_MOV(p, retype(brw_vec1_reg(BRW_MESSAGE_REGISTER_FILE, + 0, + 2), BRW_REGISTER_TYPE_UD), + brw_imm_ud(target)); + } } - if (!c->key.runtime_check_aads_emit) { - if (c->key.aa_dest_stencil_reg) + if (!c->runtime_check_aads_emit) { + if (c->aa_dest_stencil_reg) emit_aa(c, arg1, 2); - fire_fb_write(c, base_reg, nr, target, eot); + fire_fb_write(c, 0, nr, target, eot); } else { struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD)); @@ -1897,10 +1885,6 @@ void brw_wm_emit( struct brw_wm_compile *c ) emit_kil(c, args[0]); break; - case OPCODE_KIL_NV: - emit_kil_nv(c); - break; - default: printf("Unsupported opcode %i (%s) in fragment shader\n", inst->opcode, inst->opcode < MAX_OPCODE ? diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 2cae698..4759b28 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -338,11 +338,13 @@ static struct prog_src_register get_delta_xy( struct brw_wm_compile *c ) static struct prog_src_register get_pixel_w( struct brw_wm_compile *c ) { - /* This is only called for producing 1/w in pre-gen6 interp. for - * gen6, the interp opcodes don't use this argument. + /* This is called for producing 1/w in pre-gen6 interp. for gen6, + * the interp opcodes don't use this argument. But to keep the + * nr_args = 3 expectations of pinterp happy, just stuff delta_xy + * into the slot. */ if (c->func.brw->intel.gen >= 6) - return src_undef(); + return c->delta_xy; if (src_is_undef(c->pixel_w)) { struct prog_dst_register pixel_w = get_temp(c); @@ -373,11 +375,7 @@ static void emit_interp( struct brw_wm_compile *c, struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx); struct prog_src_register deltas; - if (c->func.brw->intel.gen < 6) { - deltas = get_delta_xy(c); - } else { - deltas = src_undef(); - } + deltas = get_delta_xy(c); /* Need to use PINTERP on attributes which have been * multiplied by 1/W in the SF program, and LINTERP on those @@ -1133,6 +1131,11 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) precalc_lit(c, inst); break; + case OPCODE_RSQ: + out = emit_scalar_insn(c, inst); + out->SrcReg[0].Abs = GL_TRUE; + break; + case OPCODE_TEX: precalc_tex(c, inst); break; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c deleted file mode 100644 index 7fe8ab1..0000000 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ /dev/null @@ -1,1035 +0,0 @@ -#include "main/macros.h" -#include "program/prog_parameter.h" -#include "program/prog_print.h" -#include "program/prog_optimize.h" -#include "brw_context.h" -#include "brw_eu.h" -#include "brw_wm.h" - -static struct brw_reg get_dst_reg(struct brw_wm_compile *c, - const struct prog_instruction *inst, - GLuint component); - -/** - * Determine if the given fragment program uses GLSL features such - * as flow conditionals, loops, subroutines. - * Some GLSL shaders may use these features, others might not. - */ -GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp) -{ - int i; - - if (unlikely(INTEL_DEBUG & DEBUG_GLSL_FORCE)) - return GL_TRUE; - - for (i = 0; i < fp->Base.NumInstructions; i++) { - const struct prog_instruction *inst = &fp->Base.Instructions[i]; - switch (inst->Opcode) { - case OPCODE_ARL: - case OPCODE_IF: - case OPCODE_ENDIF: - case OPCODE_CAL: - case OPCODE_BRK: - case OPCODE_RET: - case OPCODE_BGNLOOP: - return GL_TRUE; - default: - break; - } - } - return GL_FALSE; -} - - - -static void -reclaim_temps(struct brw_wm_compile *c); - - -/** Mark GRF register as used. */ -static void -prealloc_grf(struct brw_wm_compile *c, int r) -{ - c->used_grf[r] = GL_TRUE; -} - - -/** Mark given GRF register as not in use. */ -static void -release_grf(struct brw_wm_compile *c, int r) -{ - /*assert(c->used_grf[r]);*/ - c->used_grf[r] = GL_FALSE; - c->first_free_grf = MIN2(c->first_free_grf, r); -} - - -/** Return index of a free GRF, mark it as used. */ -static int -alloc_grf(struct brw_wm_compile *c) -{ - GLuint r; - for (r = c->first_free_grf; r < BRW_WM_MAX_GRF; r++) { - if (!c->used_grf[r]) { - c->used_grf[r] = GL_TRUE; - c->first_free_grf = r + 1; /* a guess */ - return r; - } - } - - /* no free temps, try to reclaim some */ - reclaim_temps(c); - c->first_free_grf = 0; - - /* try alloc again */ - for (r = c->first_free_grf; r < BRW_WM_MAX_GRF; r++) { - if (!c->used_grf[r]) { - c->used_grf[r] = GL_TRUE; - c->first_free_grf = r + 1; /* a guess */ - return r; - } - } - - for (r = 0; r < BRW_WM_MAX_GRF; r++) { - assert(c->used_grf[r]); - } - - /* really, no free GRF regs found */ - if (!c->out_of_regs) { - /* print warning once per compilation */ - _mesa_warning(NULL, "i965: ran out of registers for fragment program"); - c->out_of_regs = GL_TRUE; - } - - return -1; -} - - -/** Return number of GRF registers used */ -static int -num_grf_used(const struct brw_wm_compile *c) -{ - int r; - for (r = BRW_WM_MAX_GRF - 1; r >= 0; r--) - if (c->used_grf[r]) - return r + 1; - return 0; -} - - - -/** - * Record the mapping of a Mesa register to a hardware register. - */ -static void set_reg(struct brw_wm_compile *c, int file, int index, - int component, struct brw_reg reg) -{ - c->wm_regs[file][index][component].reg = reg; - c->wm_regs[file][index][component].inited = GL_TRUE; -} - -static struct brw_reg alloc_tmp(struct brw_wm_compile *c) -{ - struct brw_reg reg; - - /* if we need to allocate another temp, grow the tmp_regs[] array */ - if (c->tmp_index == c->tmp_max) { - int r = alloc_grf(c); - if (r < 0) { - /*printf("Out of temps in %s\n", __FUNCTION__);*/ - r = 50; /* XXX random register! */ - } - c->tmp_regs[ c->tmp_max++ ] = r; - } - - /* form the GRF register */ - reg = brw_vec8_grf(c->tmp_regs[ c->tmp_index++ ], 0); - /*printf("alloc_temp %d\n", reg.nr);*/ - assert(reg.nr < BRW_WM_MAX_GRF); - return reg; - -} - -/** - * Save current temp register info. - * There must be a matching call to release_tmps(). - */ -static int mark_tmps(struct brw_wm_compile *c) -{ - return c->tmp_index; -} - -static void release_tmps(struct brw_wm_compile *c, int mark) -{ - c->tmp_index = mark; -} - -/** - * Convert Mesa src register to brw register. - * - * Since we're running in SOA mode each Mesa register corresponds to four - * hardware registers. We allocate the hardware registers as needed here. - * - * \param file register file, one of PROGRAM_x - * \param index register number - * \param component src component (X=0, Y=1, Z=2, W=3) - * \param nr not used?!? - * \param neg negate value? - * \param abs take absolute value? - */ -static struct brw_reg -get_reg(struct brw_wm_compile *c, int file, int index, int component, - int nr, GLuint neg, GLuint abs) -{ - struct brw_reg reg; - switch (file) { - case PROGRAM_STATE_VAR: - case PROGRAM_CONSTANT: - case PROGRAM_UNIFORM: - file = PROGRAM_STATE_VAR; - break; - case PROGRAM_UNDEFINED: - return brw_null_reg(); - case PROGRAM_TEMPORARY: - case PROGRAM_INPUT: - case PROGRAM_OUTPUT: - case PROGRAM_PAYLOAD: - break; - default: - _mesa_problem(NULL, "Unexpected file in get_reg()"); - return brw_null_reg(); - } - - assert(index < 256); - assert(component < 4); - - /* see if we've already allocated a HW register for this Mesa register */ - if (c->wm_regs[file][index][component].inited) { - /* yes, re-use */ - reg = c->wm_regs[file][index][component].reg; - } - else { - /* no, allocate new register */ - int grf = alloc_grf(c); - /*printf("alloc grf %d for reg %d:%d.%d\n", grf, file, index, component);*/ - if (grf < 0) { - /* totally out of temps */ - grf = 51; /* XXX random register! */ - } - - reg = brw_vec8_grf(grf, 0); - /*printf("Alloc new grf %d for %d.%d\n", reg.nr, index, component);*/ - - set_reg(c, file, index, component, reg); - } - - if (neg & (1 << component)) { - reg = negate(reg); - } - if (abs) - reg = brw_abs(reg); - return reg; -} - - - -/** - * This is called if we run out of GRF registers. Examine the live intervals - * of temp regs in the program and free those which won't be used again. - */ -static void -reclaim_temps(struct brw_wm_compile *c) -{ - GLint intBegin[MAX_PROGRAM_TEMPS]; - GLint intEnd[MAX_PROGRAM_TEMPS]; - int index; - - /*printf("Reclaim temps:\n");*/ - - _mesa_find_temp_intervals(c->prog_instructions, c->nr_fp_insns, - intBegin, intEnd); - - for (index = 0; index < MAX_PROGRAM_TEMPS; index++) { - if (intEnd[index] != -1 && intEnd[index] < c->cur_inst) { - /* program temp[i] can be freed */ - int component; - /*printf(" temp[%d] is dead\n", index);*/ - for (component = 0; component < 4; component++) { - if (c->wm_regs[PROGRAM_TEMPORARY][index][component].inited) { - int r = c->wm_regs[PROGRAM_TEMPORARY][index][component].reg.nr; - release_grf(c, r); - /* - printf(" Reclaim temp %d, reg %d at inst %d\n", - index, r, c->cur_inst); - */ - c->wm_regs[PROGRAM_TEMPORARY][index][component].inited = GL_FALSE; - } - } - } - } -} - - - - -/** - * Preallocate registers. This sets up the Mesa to hardware register - * mapping for certain registers, such as constants (uniforms/state vars) - * and shader inputs. - */ -static void prealloc_reg(struct brw_wm_compile *c) -{ - struct intel_context *intel = &c->func.brw->intel; - int i, j; - struct brw_reg reg; - int urb_read_length = 0; - GLuint inputs = FRAG_BIT_WPOS | c->fp_interp_emitted; - GLuint reg_index = 0; - - memset(c->used_grf, GL_FALSE, sizeof(c->used_grf)); - c->first_free_grf = 0; - - for (i = 0; i < 4; i++) { - if (i < (c->key.nr_payload_regs + 1) / 2) - reg = brw_vec8_grf(i * 2, 0); - else - reg = brw_vec8_grf(0, 0); - set_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, reg); - } - set_reg(c, PROGRAM_PAYLOAD, PAYLOAD_W, 0, - brw_vec8_grf(c->key.source_w_reg, 0)); - reg_index += c->key.nr_payload_regs; - - /* constants */ - { - const GLuint nr_params = c->fp->program.Base.Parameters->NumParameters; - const GLuint nr_temps = c->fp->program.Base.NumTemporaries; - - /* use a real constant buffer, or just use a section of the GRF? */ - /* XXX this heuristic may need adjustment... */ - if ((nr_params + nr_temps) * 4 + reg_index > 80) { - for (i = 0; i < nr_params; i++) { - float *pv = c->fp->program.Base.Parameters->ParameterValues[i]; - for (j = 0; j < 4; j++) { - c->prog_data.pull_param[c->prog_data.nr_pull_params] = &pv[j]; - c->prog_data.nr_pull_params++; - } - } - - c->prog_data.nr_params = 0; - } - /*printf("WM use_const_buffer = %d\n", c->fp->use_const_buffer);*/ - - if (!c->prog_data.nr_pull_params) { - const struct gl_program_parameter_list *plist = - c->fp->program.Base.Parameters; - int index = 0; - - /* number of float constants in CURBE */ - c->prog_data.nr_params = 4 * nr_params; - - /* loop over program constants (float[4]) */ - for (i = 0; i < nr_params; i++) { - /* loop over XYZW channels */ - for (j = 0; j < 4; j++, index++) { - reg = brw_vec1_grf(reg_index + index / 8, index % 8); - /* Save pointer to parameter/constant value. - * Constants will be copied in prepare_constant_buffer() - */ - c->prog_data.param[index] = &plist->ParameterValues[i][j]; - set_reg(c, PROGRAM_STATE_VAR, i, j, reg); - } - } - /* number of constant regs used (each reg is float[8]) */ - c->nr_creg = ALIGN(nr_params, 2) / 2; - reg_index += c->nr_creg; - } - } - - /* fragment shader inputs: One 2-reg pair of interpolation - * coefficients for each vec4 to be set up. - */ - if (intel->gen >= 6) { - for (i = 0; i < FRAG_ATTRIB_MAX; i++) { - if (!(c->fp->program.Base.InputsRead & BITFIELD64_BIT(i))) - continue; - - reg = brw_vec8_grf(reg_index, 0); - for (j = 0; j < 4; j++) { - set_reg(c, PROGRAM_PAYLOAD, i, j, reg); - } - reg_index += 2; - } - urb_read_length = reg_index; - } else { - for (i = 0; i < VERT_RESULT_MAX; i++) { - int fp_input; - - if (i >= VERT_RESULT_VAR0) - fp_input = i - VERT_RESULT_VAR0 + FRAG_ATTRIB_VAR0; - else if (i <= VERT_RESULT_TEX7) - fp_input = i; - else - fp_input = -1; - - if (fp_input >= 0 && inputs & (1 << fp_input)) { - urb_read_length = reg_index; - reg = brw_vec8_grf(reg_index, 0); - for (j = 0; j < 4; j++) - set_reg(c, PROGRAM_PAYLOAD, fp_input, j, reg); - } - if (c->key.vp_outputs_written & BITFIELD64_BIT(i)) { - reg_index += 2; - } - } - } - - c->prog_data.first_curbe_grf = c->key.nr_payload_regs; - c->prog_data.urb_read_length = urb_read_length; - c->prog_data.curb_read_length = c->nr_creg; - c->emit_mask_reg = brw_uw1_reg(BRW_GENERAL_REGISTER_FILE, reg_index, 0); - reg_index++; - c->stack = brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, reg_index, 0); - reg_index += 2; - - /* mark GRF regs [0..reg_index-1] as in-use */ - for (i = 0; i < reg_index; i++) - prealloc_grf(c, i); - - /* Don't use GRF 126, 127. Using them seems to lead to GPU lock-ups */ - prealloc_grf(c, 126); - prealloc_grf(c, 127); - - for (i = 0; i < c->nr_fp_insns; i++) { - const struct prog_instruction *inst = &c->prog_instructions[i]; - struct brw_reg dst[4]; - - switch (inst->Opcode) { - case OPCODE_TEX: - case OPCODE_TXB: - /* Allocate the channels of texture results contiguously, - * since they are written out that way by the sampler unit. - */ - for (j = 0; j < 4; j++) { - dst[j] = get_dst_reg(c, inst, j); - if (j != 0) - assert(dst[j].nr == dst[j - 1].nr + 1); - } - break; - default: - break; - } - } - - for (i = 0; i < c->nr_fp_insns; i++) { - const struct prog_instruction *inst = &c->prog_instructions[i]; - - switch (inst->Opcode) { - case WM_DELTAXY: - /* Allocate WM_DELTAXY destination on G45/GM45 to an - * even-numbered GRF if possible so that we can use the PLN - * instruction. - */ - if (inst->DstReg.WriteMask == WRITEMASK_XY && - !c->wm_regs[inst->DstReg.File][inst->DstReg.Index][0].inited && - !c->wm_regs[inst->DstReg.File][inst->DstReg.Index][1].inited && - (IS_G4X(intel->intelScreen->deviceID) || intel->gen == 5)) { - int grf; - - for (grf = c->first_free_grf & ~1; - grf < BRW_WM_MAX_GRF; - grf += 2) - { - if (!c->used_grf[grf] && !c->used_grf[grf + 1]) { - c->used_grf[grf] = GL_TRUE; - c->used_grf[grf + 1] = GL_TRUE; - c->first_free_grf = grf + 2; /* a guess */ - - set_reg(c, inst->DstReg.File, inst->DstReg.Index, 0, - brw_vec8_grf(grf, 0)); - set_reg(c, inst->DstReg.File, inst->DstReg.Index, 1, - brw_vec8_grf(grf + 1, 0)); - break; - } - } - } - default: - break; - } - } - - /* An instruction may reference up to three constants. - * They'll be found in these registers. - * XXX alloc these on demand! - */ - if (c->prog_data.nr_pull_params) { - for (i = 0; i < 3; i++) { - c->current_const[i].index = -1; - c->current_const[i].reg = brw_vec8_grf(alloc_grf(c), 0); - } - } -#if 0 - printf("USE CONST BUFFER? %d\n", c->fp->use_const_buffer); - printf("AFTER PRE_ALLOC, reg_index = %d\n", reg_index); -#endif -} - - -/** - * Check if any of the instruction's src registers are constants, uniforms, - * or statevars. If so, fetch any constants that we don't already have in - * the three GRF slots. - */ -static void fetch_constants(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - GLuint i; - - /* loop over instruction src regs */ - for (i = 0; i < 3; i++) { - const struct prog_src_register *src = &inst->SrcReg[i]; - if (src->File == PROGRAM_STATE_VAR || - src->File == PROGRAM_CONSTANT || - src->File == PROGRAM_UNIFORM) { - c->current_const[i].index = src->Index; - -#if 0 - printf(" fetch const[%d] for arg %d into reg %d\n", - src->Index, i, c->current_const[i].reg.nr); -#endif - - /* need to fetch the constant now */ - brw_oword_block_read(p, - c->current_const[i].reg, - brw_message_reg(1), - 16 * src->Index, - SURF_INDEX_FRAG_CONST_BUFFER); - } - } -} - - -/** - * Convert Mesa dst register to brw register. - */ -static struct brw_reg get_dst_reg(struct brw_wm_compile *c, - const struct prog_instruction *inst, - GLuint component) -{ - const int nr = 1; - return get_reg(c, inst->DstReg.File, inst->DstReg.Index, component, nr, - 0, 0); -} - - -static struct brw_reg -get_src_reg_const(struct brw_wm_compile *c, - const struct prog_instruction *inst, - GLuint srcRegIndex, GLuint component) -{ - /* We should have already fetched the constant from the constant - * buffer in fetch_constants(). Now we just have to return a - * register description that extracts the needed component and - * smears it across all eight vector components. - */ - const struct prog_src_register *src = &inst->SrcReg[srcRegIndex]; - struct brw_reg const_reg; - - assert(component < 4); - assert(srcRegIndex < 3); - assert(c->current_const[srcRegIndex].index != -1); - const_reg = c->current_const[srcRegIndex].reg; - - /* extract desired float from the const_reg, and smear */ - const_reg = stride(const_reg, 0, 1, 0); - const_reg.subnr = component * 4; - - if (src->Negate & (1 << component)) - const_reg = negate(const_reg); - if (src->Abs) - const_reg = brw_abs(const_reg); - -#if 0 - printf(" form const[%d].%d for arg %d, reg %d\n", - c->current_const[srcRegIndex].index, - component, - srcRegIndex, - const_reg.nr); -#endif - - return const_reg; -} - - -/** - * Convert Mesa src register to brw register. - */ -static struct brw_reg get_src_reg(struct brw_wm_compile *c, - const struct prog_instruction *inst, - GLuint srcRegIndex, GLuint channel) -{ - const struct prog_src_register *src = &inst->SrcReg[srcRegIndex]; - const GLuint nr = 1; - const GLuint component = GET_SWZ(src->Swizzle, channel); - - /* Only one immediate value can be used per native opcode, and it - * has be in the src1 slot, so not all Mesa instructions will get - * to take advantage of immediate constants. - */ - if (brw_wm_arg_can_be_immediate(inst->Opcode, srcRegIndex)) { - const struct gl_program_parameter_list *params; - - params = c->fp->program.Base.Parameters; - - /* Extended swizzle terms */ - if (component == SWIZZLE_ZERO) { - return brw_imm_f(0.0F); - } else if (component == SWIZZLE_ONE) { - if (src->Negate) - return brw_imm_f(-1.0F); - else - return brw_imm_f(1.0F); - } - - if (src->File == PROGRAM_CONSTANT) { - float f = params->ParameterValues[src->Index][component]; - - if (src->Abs) - f = fabs(f); - if (src->Negate) - f = -f; - - return brw_imm_f(f); - } - } - - if (c->prog_data.nr_pull_params && - (src->File == PROGRAM_STATE_VAR || - src->File == PROGRAM_CONSTANT || - src->File == PROGRAM_UNIFORM)) { - return get_src_reg_const(c, inst, srcRegIndex, component); - } - else { - /* other type of source register */ - return get_reg(c, src->File, src->Index, component, nr, - src->Negate, src->Abs); - } -} - -static void emit_arl(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - struct brw_reg src0, addr_reg; - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - addr_reg = brw_uw8_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_ADDRESS, 0); - src0 = get_src_reg(c, inst, 0, 0); /* channel 0 */ - brw_MOV(p, addr_reg, src0); - brw_set_saturate(p, 0); -} - -static INLINE struct brw_reg high_words( struct brw_reg reg ) -{ - return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_W ), 1 ), - 0, 8, 2 ); -} - -static INLINE struct brw_reg low_words( struct brw_reg reg ) -{ - return stride( retype( reg, BRW_REGISTER_TYPE_W ), 0, 8, 2 ); -} - -static INLINE struct brw_reg even_bytes( struct brw_reg reg ) -{ - return stride( retype( reg, BRW_REGISTER_TYPE_B ), 0, 16, 2 ); -} - -static INLINE struct brw_reg odd_bytes( struct brw_reg reg ) -{ - return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_B ), 1 ), - 0, 16, 2 ); -} - -/** - * Resolve subroutine calls after code emit is done. - */ -static void post_wm_emit( struct brw_wm_compile *c ) -{ - brw_resolve_cals(&c->func); -} - -static void -get_argument_regs(struct brw_wm_compile *c, - const struct prog_instruction *inst, - int index, - struct brw_reg *dst, - struct brw_reg *regs, - int mask) -{ - struct brw_compile *p = &c->func; - int i, j; - - for (i = 0; i < 4; i++) { - if (mask & (1 << i)) { - regs[i] = get_src_reg(c, inst, index, i); - - /* Unalias destination registers from our sources. */ - if (regs[i].file == BRW_GENERAL_REGISTER_FILE) { - for (j = 0; j < 4; j++) { - if (memcmp(®s[i], &dst[j], sizeof(regs[0])) == 0) { - struct brw_reg tmp = alloc_tmp(c); - brw_MOV(p, tmp, regs[i]); - regs[i] = tmp; - break; - } - } - } - } - } -} - -static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) -{ - struct intel_context *intel = &brw->intel; -#define MAX_IF_DEPTH 32 -#define MAX_LOOP_DEPTH 32 - struct brw_instruction *if_inst[MAX_IF_DEPTH], *loop_inst[MAX_LOOP_DEPTH]; - int if_depth_in_loop[MAX_LOOP_DEPTH]; - GLuint i, if_depth = 0, loop_depth = 0; - struct brw_compile *p = &c->func; - struct brw_indirect stack_index = brw_indirect(0, 0); - - c->out_of_regs = GL_FALSE; - - if_depth_in_loop[loop_depth] = 0; - - prealloc_reg(c); - brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_MOV(p, get_addr_reg(stack_index), brw_address(c->stack)); - - if (intel->gen >= 6) - brw_set_acc_write_control(p, 1); - - for (i = 0; i < c->nr_fp_insns; i++) { - const struct prog_instruction *inst = &c->prog_instructions[i]; - int dst_flags; - struct brw_reg args[3][4], dst[4]; - int j; - int mark = mark_tmps( c ); - - c->cur_inst = i; - -#if 0 - printf("Inst %d: ", i); - _mesa_print_instruction(inst); -#endif - - /* fetch any constants that this instruction needs */ - if (c->prog_data.nr_pull_params) - fetch_constants(c, inst); - - if (inst->Opcode != OPCODE_ARL) { - for (j = 0; j < 4; j++) { - if (inst->DstReg.WriteMask & (1 << j)) - dst[j] = get_dst_reg(c, inst, j); - else - dst[j] = brw_null_reg(); - } - } - for (j = 0; j < brw_wm_nr_args(inst->Opcode); j++) - get_argument_regs(c, inst, j, dst, args[j], WRITEMASK_XYZW); - - dst_flags = inst->DstReg.WriteMask; - if (inst->SaturateMode == SATURATE_ZERO_ONE) - dst_flags |= SATURATE; - - if (inst->CondUpdate) - brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); - else - brw_set_conditionalmod(p, BRW_CONDITIONAL_NONE); - - switch (inst->Opcode) { - case WM_PIXELXY: - emit_pixel_xy(c, dst, dst_flags); - break; - case WM_DELTAXY: - emit_delta_xy(p, dst, dst_flags, args[0]); - break; - case WM_PIXELW: - emit_pixel_w(c, dst, dst_flags, args[0], args[1]); - break; - case WM_LINTERP: - emit_linterp(p, dst, dst_flags, args[0], args[1]); - break; - case WM_PINTERP: - emit_pinterp(p, dst, dst_flags, args[0], args[1], args[2]); - break; - case WM_CINTERP: - emit_cinterp(p, dst, dst_flags, args[0]); - break; - case WM_WPOSXY: - emit_wpos_xy(c, dst, dst_flags, args[0]); - break; - case WM_FB_WRITE: - emit_fb_write(c, args[0], args[1], args[2], - INST_AUX_GET_TARGET(inst->Aux), - inst->Aux & INST_AUX_EOT); - break; - case WM_FRONTFACING: - emit_frontfacing(p, dst, dst_flags); - break; - case OPCODE_ADD: - emit_alu2(p, brw_ADD, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_ARL: - emit_arl(c, inst); - break; - case OPCODE_FRC: - emit_alu1(p, brw_FRC, dst, dst_flags, args[0]); - break; - case OPCODE_FLR: - emit_alu1(p, brw_RNDD, dst, dst_flags, args[0]); - break; - case OPCODE_LRP: - emit_lrp(p, dst, dst_flags, args[0], args[1], args[2]); - break; - case OPCODE_TRUNC: - emit_alu1(p, brw_RNDZ, dst, dst_flags, args[0]); - break; - case OPCODE_MOV: - case OPCODE_SWZ: - emit_alu1(p, brw_MOV, dst, dst_flags, args[0]); - break; - case OPCODE_DP2: - emit_dp2(p, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_DP3: - emit_dp3(p, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_DP4: - emit_dp4(p, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_XPD: - emit_xpd(p, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_DPH: - emit_dph(p, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_RCP: - emit_math1(c, BRW_MATH_FUNCTION_INV, dst, dst_flags, args[0]); - break; - case OPCODE_RSQ: - emit_math1(c, BRW_MATH_FUNCTION_RSQ, dst, dst_flags, args[0]); - break; - case OPCODE_SIN: - emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, dst_flags, args[0]); - break; - case OPCODE_COS: - emit_math1(c, BRW_MATH_FUNCTION_COS, dst, dst_flags, args[0]); - break; - case OPCODE_EX2: - emit_math1(c, BRW_MATH_FUNCTION_EXP, dst, dst_flags, args[0]); - break; - case OPCODE_LG2: - emit_math1(c, BRW_MATH_FUNCTION_LOG, dst, dst_flags, args[0]); - break; - case OPCODE_CMP: - emit_cmp(p, dst, dst_flags, args[0], args[1], args[2]); - break; - case OPCODE_MIN: - emit_min(p, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_MAX: - emit_max(p, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_DDX: - case OPCODE_DDY: - emit_ddxy(p, dst, dst_flags, (inst->Opcode == OPCODE_DDX), - args[0]); - break; - case OPCODE_SLT: - emit_sop(p, dst, dst_flags, - BRW_CONDITIONAL_L, args[0], args[1]); - break; - case OPCODE_SLE: - emit_sop(p, dst, dst_flags, - BRW_CONDITIONAL_LE, args[0], args[1]); - break; - case OPCODE_SGT: - emit_sop(p, dst, dst_flags, - BRW_CONDITIONAL_G, args[0], args[1]); - break; - case OPCODE_SGE: - emit_sop(p, dst, dst_flags, - BRW_CONDITIONAL_GE, args[0], args[1]); - break; - case OPCODE_SEQ: - emit_sop(p, dst, dst_flags, - BRW_CONDITIONAL_EQ, args[0], args[1]); - break; - case OPCODE_SNE: - emit_sop(p, dst, dst_flags, - BRW_CONDITIONAL_NEQ, args[0], args[1]); - break; - case OPCODE_SSG: - emit_sign(p, dst, dst_flags, args[0]); - break; - case OPCODE_MUL: - emit_alu2(p, brw_MUL, dst, dst_flags, args[0], args[1]); - break; - case OPCODE_POW: - emit_math2(c, BRW_MATH_FUNCTION_POW, - dst, dst_flags, args[0], args[1]); - break; - case OPCODE_MAD: - emit_mad(p, dst, dst_flags, args[0], args[1], args[2]); - break; - case OPCODE_TEX: - emit_tex(c, dst, dst_flags, args[0], - get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, - 0, 1, 0, 0), - inst->TexSrcTarget, - inst->TexSrcUnit, - (c->key.shadowtex_mask & (1 << inst->TexSrcUnit)) != 0); - break; - case OPCODE_TXB: - emit_txb(c, dst, dst_flags, args[0], - get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, - 0, 1, 0, 0), - inst->TexSrcTarget, - c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]); - break; - case OPCODE_KIL_NV: - emit_kil_nv(c); - break; - case OPCODE_IF: - assert(if_depth < MAX_IF_DEPTH); - if_inst[if_depth++] = brw_IF(p, BRW_EXECUTE_8); - if_depth_in_loop[loop_depth]++; - break; - case OPCODE_ELSE: - assert(if_depth > 0); - if_inst[if_depth-1] = brw_ELSE(p, if_inst[if_depth-1]); - break; - case OPCODE_ENDIF: - assert(if_depth > 0); - brw_ENDIF(p, if_inst[--if_depth]); - if_depth_in_loop[loop_depth]--; - break; - case OPCODE_BGNSUB: - brw_save_label(p, inst->Comment, p->nr_insn); - break; - case OPCODE_ENDSUB: - /* no-op */ - break; - case OPCODE_CAL: - brw_push_insn_state(p); - brw_set_mask_control(p, BRW_MASK_DISABLE); - brw_set_access_mode(p, BRW_ALIGN_1); - brw_ADD(p, deref_1ud(stack_index, 0), brw_ip_reg(), brw_imm_d(3*16)); - brw_set_access_mode(p, BRW_ALIGN_16); - brw_ADD(p, get_addr_reg(stack_index), - get_addr_reg(stack_index), brw_imm_d(4)); - brw_save_call(&c->func, inst->Comment, p->nr_insn); - brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); - brw_pop_insn_state(p); - break; - - case OPCODE_RET: - brw_push_insn_state(p); - brw_set_mask_control(p, BRW_MASK_DISABLE); - brw_ADD(p, get_addr_reg(stack_index), - get_addr_reg(stack_index), brw_imm_d(-4)); - brw_set_access_mode(p, BRW_ALIGN_1); - brw_MOV(p, brw_ip_reg(), deref_1ud(stack_index, 0)); - brw_set_access_mode(p, BRW_ALIGN_16); - brw_pop_insn_state(p); - - break; - case OPCODE_BGNLOOP: - /* XXX may need to invalidate the current_constant regs */ - loop_inst[loop_depth++] = brw_DO(p, BRW_EXECUTE_8); - if_depth_in_loop[loop_depth] = 0; - break; - case OPCODE_BRK: - brw_BREAK(p, if_depth_in_loop[loop_depth]); - brw_set_predicate_control(p, BRW_PREDICATE_NONE); - break; - case OPCODE_CONT: - brw_CONT(p, if_depth_in_loop[loop_depth]); - brw_set_predicate_control(p, BRW_PREDICATE_NONE); - break; - case OPCODE_ENDLOOP: - { - struct brw_instruction *inst0, *inst1; - GLuint br = 1; - - if (intel->gen == 5) - br = 2; - - assert(loop_depth > 0); - loop_depth--; - inst0 = inst1 = brw_WHILE(p, loop_inst[loop_depth]); - /* patch all the BREAK/CONT instructions from last BGNLOOP */ - while (inst0 > loop_inst[loop_depth]) { - inst0--; - if (inst0->header.opcode == BRW_OPCODE_BREAK && - inst0->bits3.if_else.jump_count == 0) { - inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); - } - else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && - inst0->bits3.if_else.jump_count == 0) { - inst0->bits3.if_else.jump_count = br * (inst1 - inst0); - } - } - } - break; - default: - printf("unsupported opcode %d (%s) in fragment shader\n", - inst->Opcode, inst->Opcode < MAX_OPCODE ? - _mesa_opcode_string(inst->Opcode) : "unknown"); - } - - /* Release temporaries containing any unaliased source regs. */ - release_tmps( c, mark ); - - if (inst->CondUpdate) - brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); - else - brw_set_predicate_control(p, BRW_PREDICATE_NONE); - } - post_wm_emit(c); - - if (unlikely(INTEL_DEBUG & DEBUG_WM)) { - printf("wm-native:\n"); - for (i = 0; i < p->nr_insn; i++) - brw_disasm(stdout, &p->store[i], intel->gen); - printf("\n"); - } -} - -/** - * Do GPU code generation for shaders that use GLSL features such as - * flow control. Other shaders will be compiled with the - */ -void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) -{ - if (unlikely(INTEL_DEBUG & DEBUG_WM)) { - printf("brw_wm_glsl_emit:\n"); - } - - /* initial instruction translation/simplification */ - brw_wm_pass_fp(c); - - /* actual code generation */ - brw_wm_emit_glsl(brw, c); - - if (unlikely(INTEL_DEBUG & DEBUG_WM)) { - brw_wm_print_program(c, "brw_wm_glsl_emit done"); - } - - c->prog_data.total_grf = num_grf_used(c); - c->prog_data.total_scratch = 0; -} diff --git a/src/mesa/drivers/dri/i965/brw_wm_iz.c b/src/mesa/drivers/dri/i965/brw_wm_iz.c index 62e5566..471ea1c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_iz.c +++ b/src/mesa/drivers/dri/i965/brw_wm_iz.c @@ -120,14 +120,14 @@ const struct { * \param line_aa AA_NEVER, AA_ALWAYS or AA_SOMETIMES * \param lookup bitmask of IZ_* flags */ -void brw_wm_lookup_iz( struct intel_context *intel, - GLuint line_aa, - GLuint lookup, - GLboolean ps_uses_depth, - struct brw_wm_prog_key *key ) +void brw_wm_lookup_iz(struct intel_context *intel, + struct brw_wm_compile *c) { GLuint reg = 2; GLboolean kill_stats_promoted_workaround = GL_FALSE; + int lookup = c->key.iz_lookup; + bool uses_depth = (c->fp->program.Base.InputsRead & + (1 << FRAG_ATTRIB_WPOS)) != 0; assert (lookup < IZ_BIT_MAX); @@ -136,36 +136,36 @@ void brw_wm_lookup_iz( struct intel_context *intel, * statistics are enabled..." paragraph of 11.5.3.2: Early Depth * Test Cases [Pre-DevGT] of the 3D Pipeline - Windower B-Spec. */ - if (intel->stats_wm && + if (c->key.stats_wm && (lookup & IZ_PS_KILL_ALPHATEST_BIT) && wm_iz_table[lookup].mode == P) { kill_stats_promoted_workaround = GL_TRUE; } if (lookup & IZ_PS_COMPUTES_DEPTH_BIT) - key->computes_depth = 1; + c->computes_depth = 1; - if (wm_iz_table[lookup].sd_present || ps_uses_depth || + if (wm_iz_table[lookup].sd_present || uses_depth || kill_stats_promoted_workaround) { - key->source_depth_reg = reg; + c->source_depth_reg = reg; reg += 2; } if (wm_iz_table[lookup].sd_to_rt || kill_stats_promoted_workaround) - key->source_depth_to_render_target = 1; + c->source_depth_to_render_target = 1; - if (wm_iz_table[lookup].ds_present || line_aa != AA_NEVER) { - key->aa_dest_stencil_reg = reg; - key->runtime_check_aads_emit = (!wm_iz_table[lookup].ds_present && - line_aa == AA_SOMETIMES); + if (wm_iz_table[lookup].ds_present || c->key.line_aa != AA_NEVER) { + c->aa_dest_stencil_reg = reg; + c->runtime_check_aads_emit = (!wm_iz_table[lookup].ds_present && + c->key.line_aa == AA_SOMETIMES); reg++; } if (wm_iz_table[lookup].dd_present) { - key->dest_depth_reg = reg; + c->dest_depth_reg = reg; reg+=2; } - key->nr_payload_regs = reg; + c->nr_payload_regs = reg; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index 8315252..f78bdc3 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -380,7 +380,7 @@ static void pass0_init_payload( struct brw_wm_compile *c ) GLuint i; for (i = 0; i < 4; i++) { - GLuint j = i >= (c->key.nr_payload_regs + 1) / 2 ? 0 : i; + GLuint j = i >= (c->nr_payload_regs + 1) / 2 ? 0 : i; pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, &c->payload.depth[j] ); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass1.c b/src/mesa/drivers/dri/i965/brw_wm_pass1.c index 3a2874b..7d6a3fa 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass1.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass1.c @@ -128,8 +128,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) if (inst->opcode == WM_FB_WRITE) { track_arg(c, inst, 0, WRITEMASK_XYZW); track_arg(c, inst, 1, WRITEMASK_XYZW); - if (c->key.source_depth_to_render_target && - c->key.computes_depth) + if (c->source_depth_to_render_target && c->computes_depth) track_arg(c, inst, 2, WRITEMASK_Z); else track_arg(c, inst, 2, 0); @@ -281,7 +280,6 @@ void brw_wm_pass1( struct brw_wm_compile *c ) case OPCODE_DST: case WM_FRONTFACING: - case OPCODE_KIL_NV: default: break; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass2.c b/src/mesa/drivers/dri/i965/brw_wm_pass2.c index 44e3953..8c2b9e7 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass2.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass2.c @@ -69,6 +69,8 @@ static void prealloc_reg(struct brw_wm_compile *c, */ static void init_registers( struct brw_wm_compile *c ) { + struct brw_context *brw = c->func.brw; + struct intel_context *intel = &brw->intel; GLuint nr_interp_regs = 0; GLuint i = 0; GLuint j; @@ -76,32 +78,41 @@ static void init_registers( struct brw_wm_compile *c ) for (j = 0; j < c->grf_limit; j++) c->pass2_grf[j].nextuse = BRW_WM_MAX_INSN; - for (j = 0; j < (c->key.nr_payload_regs + 1) / 2; j++) + for (j = 0; j < (c->nr_payload_regs + 1) / 2; j++) prealloc_reg(c, &c->payload.depth[j], i++); for (j = 0; j < c->nr_creg; j++) prealloc_reg(c, &c->creg[j], i++); - for (j = 0; j < VERT_RESULT_MAX; j++) { - if (c->key.vp_outputs_written & BITFIELD64_BIT(j)) { - int fp_index; - - if (j >= VERT_RESULT_VAR0) - fp_index = j - (VERT_RESULT_VAR0 - FRAG_ATTRIB_VAR0); - else if (j <= VERT_RESULT_TEX7) - fp_index = j; - else - fp_index = -1; - - nr_interp_regs++; - if (fp_index >= 0) - prealloc_reg(c, &c->payload.input_interp[fp_index], i++); + if (intel->gen >= 6) { + for (unsigned int j = 0; j < FRAG_ATTRIB_MAX; j++) { + if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(j)) { + nr_interp_regs++; + prealloc_reg(c, &c->payload.input_interp[j], i++); + } + } + } else { + for (j = 0; j < VERT_RESULT_MAX; j++) { + if (c->key.vp_outputs_written & BITFIELD64_BIT(j)) { + int fp_index; + + if (j >= VERT_RESULT_VAR0) + fp_index = j - (VERT_RESULT_VAR0 - FRAG_ATTRIB_VAR0); + else if (j <= VERT_RESULT_TEX7) + fp_index = j; + else + fp_index = -1; + + nr_interp_regs++; + if (fp_index >= 0) + prealloc_reg(c, &c->payload.input_interp[fp_index], i++); + } } + assert(nr_interp_regs >= 1); } - assert(nr_interp_regs >= 1); - c->prog_data.first_curbe_grf = ALIGN(c->key.nr_payload_regs, 2); + c->prog_data.first_curbe_grf = ALIGN(c->nr_payload_regs, 2); c->prog_data.urb_read_length = nr_interp_regs * 2; c->prog_data.curb_read_length = c->nr_creg * 2; diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index fea96d3..30672b4 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -69,12 +69,43 @@ static GLuint translate_wrap_mode( GLenum wrap ) static drm_intel_bo *upload_default_color( struct brw_context *brw, const GLfloat *color ) { - struct brw_sampler_default_color sdc; + struct intel_context *intel = &brw->intel; - COPY_4V(sdc.color, color); - - return brw_cache_data(&brw->cache, BRW_SAMPLER_DEFAULT_COLOR, - &sdc, sizeof(sdc)); + if (intel->gen >= 5) { + struct gen5_sampler_default_color sdc; + + memset(&sdc, 0, sizeof(sdc)); + + UNCLAMPED_FLOAT_TO_UBYTE(sdc.ub[0], color[0]); + UNCLAMPED_FLOAT_TO_UBYTE(sdc.ub[1], color[1]); + UNCLAMPED_FLOAT_TO_UBYTE(sdc.ub[2], color[2]); + UNCLAMPED_FLOAT_TO_UBYTE(sdc.ub[3], color[3]); + + UNCLAMPED_FLOAT_TO_USHORT(sdc.us[0], color[0]); + UNCLAMPED_FLOAT_TO_USHORT(sdc.us[1], color[1]); + UNCLAMPED_FLOAT_TO_USHORT(sdc.us[2], color[2]); + UNCLAMPED_FLOAT_TO_USHORT(sdc.us[3], color[3]); + + UNCLAMPED_FLOAT_TO_SHORT(sdc.s[0], color[0]); + UNCLAMPED_FLOAT_TO_SHORT(sdc.s[1], color[1]); + UNCLAMPED_FLOAT_TO_SHORT(sdc.s[2], color[2]); + UNCLAMPED_FLOAT_TO_SHORT(sdc.s[3], color[3]); + + /* XXX: Fill in half floats */ + /* XXX: Fill in signed bytes */ + + COPY_4V(sdc.f, color); + + return brw_cache_data(&brw->cache, BRW_SAMPLER_DEFAULT_COLOR, + &sdc, sizeof(sdc)); + } else { + struct brw_sampler_default_color sdc; + + COPY_4V(sdc.color, color); + + return brw_cache_data(&brw->cache, BRW_SAMPLER_DEFAULT_COLOR, + &sdc, sizeof(sdc)); + } } @@ -245,9 +276,8 @@ brw_wm_sampler_populate_key(struct brw_context *brw, struct wm_sampler_entry *entry = &key->sampler[unit]; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; struct gl_texture_object *texObj = texUnit->_Current; - struct intel_texture_object *intelObj = intel_texture_object(texObj); struct gl_texture_image *firstImage = - texObj->Image[0][intelObj->firstLevel]; + texObj->Image[0][texObj->BaseLevel]; memset(last_entry_end, 0, (char*)entry - last_entry_end + sizeof(*entry)); diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index 76de7b7..e9ef635 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -87,7 +87,6 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) { struct gl_context *ctx = &brw->intel.ctx; const struct gl_fragment_program *fp = brw->fragment_program; - const struct brw_fragment_program *bfp = (struct brw_fragment_program *) fp; struct intel_context *intel = &brw->intel; memset(key, 0, sizeof(*key)); @@ -132,7 +131,6 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) /* _NEW_COLOR */ key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled; - key->is_glsl = bfp->isGLSL; /* If using the fragment shader backend, the program is always * 8-wide. diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 76fc94d..233fe3b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -42,7 +42,7 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" - +#include "brw_wm.h" static GLuint translate_tex_target( GLenum target ) { @@ -68,104 +68,72 @@ static GLuint translate_tex_target( GLenum target ) } } +static uint32_t brw_format_for_mesa_format[MESA_FORMAT_COUNT] = +{ + [MESA_FORMAT_L8] = BRW_SURFACEFORMAT_L8_UNORM, + [MESA_FORMAT_I8] = BRW_SURFACEFORMAT_I8_UNORM, + [MESA_FORMAT_A8] = BRW_SURFACEFORMAT_A8_UNORM, + [MESA_FORMAT_AL88] = BRW_SURFACEFORMAT_L8A8_UNORM, + [MESA_FORMAT_AL1616] = BRW_SURFACEFORMAT_L16A16_UNORM, + [MESA_FORMAT_R8] = BRW_SURFACEFORMAT_R8_UNORM, + [MESA_FORMAT_R16] = BRW_SURFACEFORMAT_R16_UNORM, + [MESA_FORMAT_RG88] = BRW_SURFACEFORMAT_R8G8_UNORM, + [MESA_FORMAT_RG1616] = BRW_SURFACEFORMAT_R16G16_UNORM, + [MESA_FORMAT_ARGB8888] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM, + [MESA_FORMAT_XRGB8888] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM, + [MESA_FORMAT_RGB565] = BRW_SURFACEFORMAT_B5G6R5_UNORM, + [MESA_FORMAT_ARGB1555] = BRW_SURFACEFORMAT_B5G5R5A1_UNORM, + [MESA_FORMAT_ARGB4444] = BRW_SURFACEFORMAT_B4G4R4A4_UNORM, + [MESA_FORMAT_YCBCR_REV] = BRW_SURFACEFORMAT_YCRCB_NORMAL, + [MESA_FORMAT_YCBCR] = BRW_SURFACEFORMAT_YCRCB_SWAPUVY, + [MESA_FORMAT_RGB_FXT1] = BRW_SURFACEFORMAT_FXT1, + [MESA_FORMAT_RGBA_FXT1] = BRW_SURFACEFORMAT_FXT1, + [MESA_FORMAT_RGB_DXT1] = BRW_SURFACEFORMAT_DXT1_RGB, + [MESA_FORMAT_RGBA_DXT1] = BRW_SURFACEFORMAT_BC1_UNORM, + [MESA_FORMAT_RGBA_DXT3] = BRW_SURFACEFORMAT_BC2_UNORM, + [MESA_FORMAT_RGBA_DXT5] = BRW_SURFACEFORMAT_BC3_UNORM, + [MESA_FORMAT_SRGB_DXT1] = BRW_SURFACEFORMAT_DXT1_RGB_SRGB, + [MESA_FORMAT_SRGBA_DXT1] = BRW_SURFACEFORMAT_BC1_UNORM_SRGB, + [MESA_FORMAT_SRGBA_DXT3] = BRW_SURFACEFORMAT_BC2_UNORM_SRGB, + [MESA_FORMAT_SRGBA_DXT5] = BRW_SURFACEFORMAT_BC3_UNORM_SRGB, + [MESA_FORMAT_SARGB8] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB, + [MESA_FORMAT_SLA8] = BRW_SURFACEFORMAT_L8A8_UNORM_SRGB, + [MESA_FORMAT_SL8] = BRW_SURFACEFORMAT_L8_UNORM_SRGB, + [MESA_FORMAT_DUDV8] = BRW_SURFACEFORMAT_R8G8_SNORM, + [MESA_FORMAT_SIGNED_RGBA8888_REV] = BRW_SURFACEFORMAT_R8G8B8A8_SNORM, +}; + +bool +brw_render_target_supported(gl_format format) +{ + if (format == MESA_FORMAT_S8_Z24 || + format == MESA_FORMAT_X8_Z24 || + format == MESA_FORMAT_Z16) { + return true; + } + + /* Not exactly true, as some of those formats are not renderable. + * But at least we know how to translate them. + */ + return brw_format_for_mesa_format[format] != 0; +} static GLuint translate_tex_format( gl_format mesa_format, GLenum internal_format, GLenum depth_mode ) { switch( mesa_format ) { - case MESA_FORMAT_L8: - return BRW_SURFACEFORMAT_L8_UNORM; - - case MESA_FORMAT_I8: - return BRW_SURFACEFORMAT_I8_UNORM; - - case MESA_FORMAT_A8: - return BRW_SURFACEFORMAT_A8_UNORM; - - case MESA_FORMAT_AL88: - return BRW_SURFACEFORMAT_L8A8_UNORM; - - case MESA_FORMAT_AL1616: - return BRW_SURFACEFORMAT_L16A16_UNORM; - - case MESA_FORMAT_R8: - return BRW_SURFACEFORMAT_R8_UNORM; - - case MESA_FORMAT_R16: - return BRW_SURFACEFORMAT_R16_UNORM; - - case MESA_FORMAT_RG88: - return BRW_SURFACEFORMAT_R8G8_UNORM; - - case MESA_FORMAT_RG1616: - return BRW_SURFACEFORMAT_R16G16_UNORM; - - case MESA_FORMAT_RGB888: - assert(0); /* not supported for sampling */ - return BRW_SURFACEFORMAT_R8G8B8_UNORM; - - case MESA_FORMAT_ARGB8888: - return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - - case MESA_FORMAT_XRGB8888: - return BRW_SURFACEFORMAT_B8G8R8X8_UNORM; - - case MESA_FORMAT_RGBA8888_REV: - _mesa_problem(NULL, "unexpected format in i965:translate_tex_format()"); - return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; - - case MESA_FORMAT_RGB565: - return BRW_SURFACEFORMAT_B5G6R5_UNORM; - - case MESA_FORMAT_ARGB1555: - return BRW_SURFACEFORMAT_B5G5R5A1_UNORM; - - case MESA_FORMAT_ARGB4444: - return BRW_SURFACEFORMAT_B4G4R4A4_UNORM; - - case MESA_FORMAT_YCBCR_REV: - return BRW_SURFACEFORMAT_YCRCB_NORMAL; - - case MESA_FORMAT_YCBCR: - return BRW_SURFACEFORMAT_YCRCB_SWAPUVY; - - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - return BRW_SURFACEFORMAT_FXT1; case MESA_FORMAT_Z16: if (depth_mode == GL_INTENSITY) return BRW_SURFACEFORMAT_I16_UNORM; else if (depth_mode == GL_ALPHA) return BRW_SURFACEFORMAT_A16_UNORM; + else if (depth_mode == GL_RED) + return BRW_SURFACEFORMAT_R16_UNORM; else return BRW_SURFACEFORMAT_L16_UNORM; - case MESA_FORMAT_RGB_DXT1: - return BRW_SURFACEFORMAT_DXT1_RGB; - - case MESA_FORMAT_RGBA_DXT1: - return BRW_SURFACEFORMAT_BC1_UNORM; - - case MESA_FORMAT_RGBA_DXT3: - return BRW_SURFACEFORMAT_BC2_UNORM; - - case MESA_FORMAT_RGBA_DXT5: - return BRW_SURFACEFORMAT_BC3_UNORM; - - case MESA_FORMAT_SARGB8: - return BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB; - - case MESA_FORMAT_SLA8: - return BRW_SURFACEFORMAT_L8A8_UNORM_SRGB; - - case MESA_FORMAT_SL8: - return BRW_SURFACEFORMAT_L8_UNORM_SRGB; - - case MESA_FORMAT_SRGB_DXT1: - return BRW_SURFACEFORMAT_BC1_UNORM_SRGB; - case MESA_FORMAT_S8_Z24: /* XXX: these different surface formats don't seem to * make any difference for shadow sampler/compares. @@ -174,18 +142,14 @@ static GLuint translate_tex_format( gl_format mesa_format, return BRW_SURFACEFORMAT_I24X8_UNORM; else if (depth_mode == GL_ALPHA) return BRW_SURFACEFORMAT_A24X8_UNORM; + else if (depth_mode == GL_RED) + return BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS; else return BRW_SURFACEFORMAT_L24X8_UNORM; - case MESA_FORMAT_DUDV8: - return BRW_SURFACEFORMAT_R8G8_SNORM; - - case MESA_FORMAT_SIGNED_RGBA8888_REV: - return BRW_SURFACEFORMAT_R8G8B8A8_SNORM; - default: - assert(0); - return 0; + assert(brw_format_for_mesa_format[mesa_format] != 0); + return brw_format_for_mesa_format[mesa_format]; } } @@ -214,7 +178,7 @@ brw_update_texture_surface( struct gl_context *ctx, GLuint unit ) struct brw_context *brw = brw_context(ctx); struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; struct intel_texture_object *intelObj = intel_texture_object(tObj); - struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel]; + struct gl_texture_image *firstImage = tObj->Image[0][tObj->BaseLevel]; const GLuint surf_index = SURF_INDEX_TEXTURE(unit); struct brw_surface_state surf; void *map; @@ -232,7 +196,7 @@ brw_update_texture_surface( struct gl_context *ctx, GLuint unit ) /* surf.ss0.data_return_format = BRW_SURFACERETURNFORMAT_S1; */ surf.ss1.base_addr = intelObj->mt->region->buffer->offset; /* reloc */ - surf.ss2.mip_count = intelObj->lastLevel - intelObj->firstLevel; + surf.ss2.mip_count = intelObj->_MaxLevel - tObj->BaseLevel; surf.ss2.width = firstImage->Width - 1; surf.ss2.height = firstImage->Height - 1; brw_set_surface_tiling(&surf, intelObj->mt->region->tiling); @@ -274,6 +238,7 @@ brw_create_constant_surface(struct brw_context *brw, drm_intel_bo **out_bo, uint32_t *out_offset) { + struct intel_context *intel = &brw->intel; const GLint w = width - 1; struct brw_surface_state surf; void *map; @@ -284,6 +249,9 @@ brw_create_constant_surface(struct brw_context *brw, surf.ss0.surface_type = BRW_SURFACE_BUFFER; surf.ss0.surface_format = BRW_SURFACEFORMAT_R32G32B32A32_FLOAT; + if (intel->gen >= 6) + surf.ss0.render_cache_read_write = 1; + assert(bo); surf.ss1.base_addr = bo->offset; /* reloc */ @@ -404,6 +372,38 @@ const struct brw_tracked_state brw_wm_constant_surface = { .emit = upload_wm_constant_surface, }; +static void +brw_update_null_renderbuffer_surface(struct brw_context *brw, unsigned int unit) +{ + struct intel_context *intel = &brw->intel; + struct brw_surface_state surf; + void *map; + + memset(&surf, 0, sizeof(surf)); + + surf.ss0.surface_type = BRW_SURFACE_NULL; + surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + surf.ss1.base_addr = 0; + + surf.ss2.width = 0; + surf.ss2.height = 0; + brw_set_surface_tiling(&surf, I915_TILING_NONE); + surf.ss3.pitch = 0; + + if (intel->gen < 6) { + /* _NEW_COLOR */ + surf.ss0.color_blend = 0; + surf.ss0.writedisable_red = 1; + surf.ss0.writedisable_green = 1; + surf.ss0.writedisable_blue = 1; + surf.ss0.writedisable_alpha = 1; + } + + map = brw_state_batch(brw, sizeof(surf), 32, + &brw->wm.surf_bo[unit], + &brw->wm.surf_offset[unit]); + memcpy(map, &surf, sizeof(surf)); +} /** * Sets up a surface state structure to point at the given region. @@ -417,123 +417,53 @@ brw_update_renderbuffer_surface(struct brw_context *brw, { struct intel_context *intel = &brw->intel; struct gl_context *ctx = &intel->ctx; - drm_intel_bo *region_bo = NULL; struct intel_renderbuffer *irb = intel_renderbuffer(rb); - struct intel_region *region = irb ? irb->region : NULL; - struct { - unsigned int surface_type; - unsigned int surface_format; - unsigned int width, height, pitch, cpp; - GLubyte color_mask[4]; - GLboolean color_blend; - uint32_t tiling; - uint32_t draw_x; - uint32_t draw_y; - } key; + struct intel_region *region = irb->region; struct brw_surface_state surf; void *map; - memset(&key, 0, sizeof(key)); - - if (region != NULL) { - region_bo = region->buffer; - - key.surface_type = BRW_SURFACE_2D; - switch (irb->Base.Format) { - /* XRGB and ARGB are treated the same here because the chips in this - * family cannot render to XRGB targets. This means that we have to - * mask writes to alpha (ala glColorMask) and reconfigure the alpha - * blending hardware to use GL_ONE (or GL_ZERO) for cases where - * GL_DST_ALPHA (or GL_ONE_MINUS_DST_ALPHA) is used. - */ - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_XRGB8888: - key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - break; - case MESA_FORMAT_SARGB8: - key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB; - break; - case MESA_FORMAT_RGB565: - key.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM; - break; - case MESA_FORMAT_ARGB1555: - key.surface_format = BRW_SURFACEFORMAT_B5G5R5A1_UNORM; - break; - case MESA_FORMAT_ARGB4444: - key.surface_format = BRW_SURFACEFORMAT_B4G4R4A4_UNORM; - break; - case MESA_FORMAT_A8: - key.surface_format = BRW_SURFACEFORMAT_A8_UNORM; - break; - case MESA_FORMAT_R8: - key.surface_format = BRW_SURFACEFORMAT_R8_UNORM; - break; - case MESA_FORMAT_R16: - key.surface_format = BRW_SURFACEFORMAT_R16_UNORM; - break; - case MESA_FORMAT_RG88: - key.surface_format = BRW_SURFACEFORMAT_R8G8_UNORM; - break; - case MESA_FORMAT_RG1616: - key.surface_format = BRW_SURFACEFORMAT_R16G16_UNORM; - break; - default: - _mesa_problem(ctx, "Bad renderbuffer format: %d\n", irb->Base.Format); - } - key.tiling = region->tiling; - key.width = rb->Width; - key.height = rb->Height; - key.pitch = region->pitch; - key.cpp = region->cpp; - key.draw_x = region->draw_x; - key.draw_y = region->draw_y; - } else { - key.surface_type = BRW_SURFACE_NULL; - key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - key.tiling = I915_TILING_X; - key.width = 1; - key.height = 1; - key.cpp = 4; - key.draw_x = 0; - key.draw_y = 0; - } - - if (intel->gen < 6) { - /* _NEW_COLOR */ - memcpy(key.color_mask, ctx->Color.ColorMask[unit], - sizeof(key.color_mask)); + memset(&surf, 0, sizeof(surf)); - /* As mentioned above, disable writes to the alpha component when the - * renderbuffer is XRGB. + switch (irb->Base.Format) { + case MESA_FORMAT_XRGB8888: + /* XRGB is handled as ARGB because the chips in this family + * cannot render to XRGB targets. This means that we have to + * mask writes to alpha (ala glColorMask) and reconfigure the + * alpha blending hardware to use GL_ONE (or GL_ZERO) for + * cases where GL_DST_ALPHA (or GL_ONE_MINUS_DST_ALPHA) is + * used. */ - if (ctx->DrawBuffer->Visual.alphaBits == 0) - key.color_mask[3] = GL_FALSE; - - key.color_blend = (!ctx->Color._LogicOpEnabled && - (ctx->Color.BlendEnabled & (1 << unit))); + surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + break; + case MESA_FORMAT_SARGB8: + /* without GL_EXT_framebuffer_sRGB we shouldn't bind sRGB + surfaces to the blend/update as sRGB */ + surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + break; + default: + surf.ss0.surface_format = brw_format_for_mesa_format[irb->Base.Format]; + assert(surf.ss0.surface_format != 0); } - memset(&surf, 0, sizeof(surf)); - - surf.ss0.surface_format = key.surface_format; - surf.ss0.surface_type = key.surface_type; - if (key.tiling == I915_TILING_NONE) { - surf.ss1.base_addr = (key.draw_x + key.draw_y * key.pitch) * key.cpp; + surf.ss0.surface_type = BRW_SURFACE_2D; + if (region->tiling == I915_TILING_NONE) { + surf.ss1.base_addr = (region->draw_x + + region->draw_y * region->pitch) * region->cpp; } else { uint32_t tile_base, tile_x, tile_y; - uint32_t pitch = key.pitch * key.cpp; + uint32_t pitch = region->pitch * region->cpp; - if (key.tiling == I915_TILING_X) { - tile_x = key.draw_x % (512 / key.cpp); - tile_y = key.draw_y % 8; - tile_base = ((key.draw_y / 8) * (8 * pitch)); - tile_base += (key.draw_x - tile_x) / (512 / key.cpp) * 4096; + if (region->tiling == I915_TILING_X) { + tile_x = region->draw_x % (512 / region->cpp); + tile_y = region->draw_y % 8; + tile_base = ((region->draw_y / 8) * (8 * pitch)); + tile_base += (region->draw_x - tile_x) / (512 / region->cpp) * 4096; } else { /* Y */ - tile_x = key.draw_x % (128 / key.cpp); - tile_y = key.draw_y % 32; - tile_base = ((key.draw_y / 32) * (32 * pitch)); - tile_base += (key.draw_x - tile_x) / (128 / key.cpp) * 4096; + tile_x = region->draw_x % (128 / region->cpp); + tile_y = region->draw_y % 32; + tile_base = ((region->draw_y / 32) * (32 * pitch)); + tile_base += (region->draw_x - tile_x) / (128 / region->cpp) * 4096; } assert(brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0)); assert(tile_x % 4 == 0); @@ -545,21 +475,27 @@ brw_update_renderbuffer_surface(struct brw_context *brw, surf.ss5.x_offset = tile_x / 4; surf.ss5.y_offset = tile_y / 2; } - if (region_bo != NULL) - surf.ss1.base_addr += region_bo->offset; /* reloc */ + surf.ss1.base_addr += region->buffer->offset; /* reloc */ - surf.ss2.width = key.width - 1; - surf.ss2.height = key.height - 1; - brw_set_surface_tiling(&surf, key.tiling); - surf.ss3.pitch = (key.pitch * key.cpp) - 1; + surf.ss2.width = rb->Width - 1; + surf.ss2.height = rb->Height - 1; + brw_set_surface_tiling(&surf, region->tiling); + surf.ss3.pitch = (region->pitch * region->cpp) - 1; if (intel->gen < 6) { /* _NEW_COLOR */ - surf.ss0.color_blend = key.color_blend; - surf.ss0.writedisable_red = !key.color_mask[0]; - surf.ss0.writedisable_green = !key.color_mask[1]; - surf.ss0.writedisable_blue = !key.color_mask[2]; - surf.ss0.writedisable_alpha = !key.color_mask[3]; + surf.ss0.color_blend = (!ctx->Color._LogicOpEnabled && + (ctx->Color.BlendEnabled & (1 << unit))); + surf.ss0.writedisable_red = !ctx->Color.ColorMask[unit][0]; + surf.ss0.writedisable_green = !ctx->Color.ColorMask[unit][1]; + surf.ss0.writedisable_blue = !ctx->Color.ColorMask[unit][2]; + /* As mentioned above, disable writes to the alpha component when the + * renderbuffer is XRGB. + */ + if (ctx->DrawBuffer->Visual.alphaBits == 0) + surf.ss0.writedisable_alpha = 1; + else + surf.ss0.writedisable_alpha = !ctx->Color.ColorMask[unit][3]; } map = brw_state_batch(brw, sizeof(surf), 32, @@ -567,15 +503,13 @@ brw_update_renderbuffer_surface(struct brw_context *brw, &brw->wm.surf_offset[unit]); memcpy(map, &surf, sizeof(surf)); - if (region_bo != NULL) { - drm_intel_bo_emit_reloc(brw->wm.surf_bo[unit], - brw->wm.surf_offset[unit] + - offsetof(struct brw_surface_state, ss1), - region_bo, - surf.ss1.base_addr - region_bo->offset, - I915_GEM_DOMAIN_RENDER, - I915_GEM_DOMAIN_RENDER); - } + drm_intel_bo_emit_reloc(brw->wm.surf_bo[unit], + brw->wm.surf_offset[unit] + + offsetof(struct brw_surface_state, ss1), + region->buffer, + surf.ss1.base_addr - region->buffer->offset, + I915_GEM_DOMAIN_RENDER, + I915_GEM_DOMAIN_RENDER); } static void @@ -635,12 +569,16 @@ upload_wm_surfaces(struct brw_context *brw) /* Update surfaces for drawing buffers */ if (ctx->DrawBuffer->_NumColorDrawBuffers >= 1) { for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { - brw_update_renderbuffer_surface(brw, - ctx->DrawBuffer->_ColorDrawBuffers[i], - i); + if (intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[i])) { + brw_update_renderbuffer_surface(brw, + ctx->DrawBuffer->_ColorDrawBuffers[i], + i); + } else { + brw_update_null_renderbuffer_surface(brw, i); + } } } else { - brw_update_renderbuffer_surface(brw, NULL, 0); + brw_update_null_renderbuffer_surface(brw, 0); } /* Update surfaces for textures */ diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index 800a255..dbcdc5b 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -35,6 +35,7 @@ struct gen6_blend_state_key { GLboolean color_blend, alpha_enabled; GLboolean dither; + GLboolean color_mask[BRW_MAX_DRAW_BUFFERS][4]; GLenum logic_op; @@ -54,6 +55,9 @@ blend_state_populate_key(struct brw_context *brw, memset(key, 0, sizeof(*key)); /* _NEW_COLOR */ + memcpy(key->color_mask, ctx->Color.ColorMask, sizeof(key->color_mask)); + + /* _NEW_COLOR */ if (ctx->Color._LogicOpEnabled) key->logic_op = ctx->Color.LogicOp; else @@ -87,54 +91,62 @@ static drm_intel_bo * blend_state_create_from_key(struct brw_context *brw, struct gen6_blend_state_key *key) { - struct gen6_blend_state blend; + struct gen6_blend_state blend[BRW_MAX_DRAW_BUFFERS]; drm_intel_bo *bo; + int b; memset(&blend, 0, sizeof(blend)); - if (key->logic_op != GL_COPY) { - blend.blend1.logic_op_enable = 1; - blend.blend1.logic_op_func = intel_translate_logic_op(key->logic_op); - } else if (key->color_blend) { - GLenum eqRGB = key->blend_eq_rgb; - GLenum eqA = key->blend_eq_a; - GLenum srcRGB = key->blend_src_rgb; - GLenum dstRGB = key->blend_dst_rgb; - GLenum srcA = key->blend_src_a; - GLenum dstA = key->blend_dst_a; - - if (eqRGB == GL_MIN || eqRGB == GL_MAX) { - srcRGB = dstRGB = GL_ONE; - } - - if (eqA == GL_MIN || eqA == GL_MAX) { - srcA = dstA = GL_ONE; + for (b = 0; b < BRW_MAX_DRAW_BUFFERS; b++) { + if (key->logic_op != GL_COPY) { + blend[b].blend1.logic_op_enable = 1; + blend[b].blend1.logic_op_func = intel_translate_logic_op(key->logic_op); + } else if (key->color_blend & (1 << b)) { + GLenum eqRGB = key->blend_eq_rgb; + GLenum eqA = key->blend_eq_a; + GLenum srcRGB = key->blend_src_rgb; + GLenum dstRGB = key->blend_dst_rgb; + GLenum srcA = key->blend_src_a; + GLenum dstA = key->blend_dst_a; + + if (eqRGB == GL_MIN || eqRGB == GL_MAX) { + srcRGB = dstRGB = GL_ONE; + } + + if (eqA == GL_MIN || eqA == GL_MAX) { + srcA = dstA = GL_ONE; + } + + blend[b].blend0.dest_blend_factor = brw_translate_blend_factor(dstRGB); + blend[b].blend0.source_blend_factor = brw_translate_blend_factor(srcRGB); + blend[b].blend0.blend_func = brw_translate_blend_equation(eqRGB); + + blend[b].blend0.ia_dest_blend_factor = brw_translate_blend_factor(dstA); + blend[b].blend0.ia_source_blend_factor = brw_translate_blend_factor(srcA); + blend[b].blend0.ia_blend_func = brw_translate_blend_equation(eqA); + + blend[b].blend0.blend_enable = 1; + blend[b].blend0.ia_blend_enable = (srcA != srcRGB || + dstA != dstRGB || + eqA != eqRGB); } - blend.blend0.dest_blend_factor = brw_translate_blend_factor(dstRGB); - blend.blend0.source_blend_factor = brw_translate_blend_factor(srcRGB); - blend.blend0.blend_func = brw_translate_blend_equation(eqRGB); - - blend.blend0.ia_dest_blend_factor = brw_translate_blend_factor(dstA); - blend.blend0.ia_source_blend_factor = brw_translate_blend_factor(srcA); - blend.blend0.ia_blend_func = brw_translate_blend_equation(eqA); + if (key->alpha_enabled) { + blend[b].blend1.alpha_test_enable = 1; + blend[b].blend1.alpha_test_func = intel_translate_compare_func(key->alpha_func); - blend.blend0.blend_enable = 1; - blend.blend0.ia_blend_enable = (srcA != srcRGB || - dstA != dstRGB || - eqA != eqRGB); - } - - if (key->alpha_enabled) { - blend.blend1.alpha_test_enable = 1; - blend.blend1.alpha_test_func = intel_translate_compare_func(key->alpha_func); + } - } + if (key->dither) { + blend[b].blend1.dither_enable = 1; + blend[b].blend1.y_dither_offset = 0; + blend[b].blend1.x_dither_offset = 0; + } - if (key->dither) { - blend.blend1.dither_enable = 1; - blend.blend1.y_dither_offset = 0; - blend.blend1.x_dither_offset = 0; + blend[b].blend1.write_disable_r = !key->color_mask[b][0]; + blend[b].blend1.write_disable_g = !key->color_mask[b][1]; + blend[b].blend1.write_disable_b = !key->color_mask[b][2]; + blend[b].blend1.write_disable_a = !key->color_mask[b][3]; } bo = brw_upload_cache(&brw->cache, BRW_BLEND_STATE, @@ -172,7 +184,7 @@ const struct brw_tracked_state gen6_blend_state = { }; struct gen6_color_calc_state_key { - GLubyte blend_constant_color[4]; + float blend_constant_color[4]; GLclampf alpha_ref; GLubyte stencil_ref[2]; }; @@ -266,7 +278,7 @@ static void upload_cc_state_pointers(struct brw_context *brw) struct intel_context *intel = &brw->intel; BEGIN_BATCH(4); - OUT_BATCH(CMD_3D_CC_STATE_POINTERS << 16 | (4 - 2)); + OUT_BATCH(_3DSTATE_CC_STATE_POINTERS << 16 | (4 - 2)); OUT_RELOC(brw->cc.blend_state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); OUT_RELOC(brw->cc.depth_stencil_state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); OUT_RELOC(brw->cc.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index c65b41e..38c98f3 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -43,7 +43,10 @@ upload_clip_state(struct brw_context *brw) depth_clamp = GEN6_CLIP_Z_TEST; if (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION) { - provoking = 0; + provoking = + (0 << GEN6_CLIP_TRI_PROVOKE_SHIFT) | + (1 << GEN6_CLIP_TRIFAN_PROVOKE_SHIFT) | + (0 << GEN6_CLIP_LINE_PROVOKE_SHIFT); } else { provoking = (2 << GEN6_CLIP_TRI_PROVOKE_SHIFT) | @@ -55,7 +58,7 @@ upload_clip_state(struct brw_context *brw) userclip = (1 << brw_count_bits(ctx->Transform.ClipPlanesEnabled)) - 1; BEGIN_BATCH(4); - OUT_BATCH(CMD_3D_CLIP_STATE << 16 | (4 - 2)); + OUT_BATCH(_3DSTATE_CLIP << 16 | (4 - 2)); OUT_BATCH(GEN6_CLIP_STATISTICS_ENABLE); OUT_BATCH(GEN6_CLIP_ENABLE | GEN6_CLIP_API_OGL | @@ -64,7 +67,9 @@ upload_clip_state(struct brw_context *brw) userclip << GEN6_USER_CLIP_CLIP_DISTANCES_SHIFT | depth_clamp | provoking); - OUT_BATCH(GEN6_CLIP_FORCE_ZERO_RTAINDEX); + OUT_BATCH(U_FIXED(0.125, 3) << GEN6_CLIP_MIN_POINT_WIDTH_SHIFT | + U_FIXED(225.875, 3) << GEN6_CLIP_MAX_POINT_WIDTH_SHIFT | + GEN6_CLIP_FORCE_ZERO_RTAINDEX); ADVANCE_BATCH(); } diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 6127b91..7296c7c 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -37,7 +37,7 @@ upload_gs_state(struct brw_context *brw) /* Disable all the constant buffers. */ BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_GS_STATE << 16 | (5 - 2)); + OUT_BATCH(_3DSTATE_CONSTANT_GS << 16 | (5 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); @@ -46,7 +46,7 @@ upload_gs_state(struct brw_context *brw) if (brw->gs.prog_bo) { BEGIN_BATCH(7); - OUT_BATCH(CMD_3D_GS_STATE << 16 | (7 - 2)); + OUT_BATCH(_3DSTATE_GS << 16 | (7 - 2)); OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_BATCH(GEN6_GS_SPF_MODE | (0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | @@ -62,7 +62,7 @@ upload_gs_state(struct brw_context *brw) ADVANCE_BATCH(); } else { BEGIN_BATCH(7); - OUT_BATCH(CMD_3D_GS_STATE << 16 | (7 - 2)); + OUT_BATCH(_3DSTATE_GS << 16 | (7 - 2)); OUT_BATCH(0); /* prog_bo */ OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); diff --git a/src/mesa/drivers/dri/i965/gen6_sampler_state.c b/src/mesa/drivers/dri/i965/gen6_sampler_state.c index fc5d391..f65c651 100644 --- a/src/mesa/drivers/dri/i965/gen6_sampler_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sampler_state.c @@ -36,7 +36,7 @@ upload_sampler_state_pointers(struct brw_context *brw) struct intel_context *intel = &brw->intel; BEGIN_BATCH(4); - OUT_BATCH(CMD_3D_SAMPLER_STATE_POINTERS << 16 | + OUT_BATCH(_3DSTATE_SAMPLER_STATE_POINTERS << 16 | VS_SAMPLER_STATE_CHANGE | GS_SAMPLER_STATE_CHANGE | PS_SAMPLER_STATE_CHANGE | diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c index b57126c..12b6582 100644 --- a/src/mesa/drivers/dri/i965/gen6_scissor_state.c +++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c @@ -92,7 +92,7 @@ static void upload_scissor_state_pointers(struct brw_context *brw) struct intel_context *intel = &brw->intel; BEGIN_BATCH(2); - OUT_BATCH(CMD_3D_SCISSOR_STATE_POINTERS << 16 | (2 - 2)); + OUT_BATCH(_3DSTATE_SCISSOR_STATE_POINTERS << 16 | (2 - 2)); OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); ADVANCE_BATCH(); diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 471067e..f277829 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -33,9 +33,10 @@ #include "intel_batchbuffer.h" static uint32_t -get_attr_override(struct brw_context *brw, int fs_attr) +get_attr_override(struct brw_context *brw, int fs_attr, int two_side_color) { int attr_index = 0, i, vs_attr; + int bfc = 0; if (fs_attr <= FRAG_ATTRIB_TEX7) vs_attr = fs_attr; @@ -57,6 +58,30 @@ get_attr_override(struct brw_context *brw, int fs_attr) attr_index++; } + assert(attr_index < 32); + + if (two_side_color) { + if ((brw->vs.prog_data->outputs_written & BITFIELD64_BIT(VERT_RESULT_COL1)) && + (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC1))) { + assert(brw->vs.prog_data->outputs_written & BITFIELD64_BIT(VERT_RESULT_COL0)); + assert(brw->vs.prog_data->outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC0)); + bfc = 2; + } else if ((brw->vs.prog_data->outputs_written & BITFIELD64_BIT(VERT_RESULT_COL0)) && + (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC0))) + bfc = 1; + } + + if (bfc && (fs_attr <= FRAG_ATTRIB_TEX7 && fs_attr > FRAG_ATTRIB_WPOS)) { + if (fs_attr == FRAG_ATTRIB_COL0) + attr_index |= (ATTRIBUTE_SWIZZLE_INPUTATTR_FACING << ATTRIBUTE_SWIZZLE_SHIFT); + else if (fs_attr == FRAG_ATTRIB_COL1 && bfc == 2) { + attr_index++; + attr_index |= (ATTRIBUTE_SWIZZLE_INPUTATTR_FACING << ATTRIBUTE_SWIZZLE_SHIFT); + } else { + attr_index += bfc; + } + } + return attr_index; } @@ -67,13 +92,15 @@ upload_sf_state(struct brw_context *brw) struct gl_context *ctx = &intel->ctx; /* CACHE_NEW_VS_PROG */ uint32_t num_inputs = brw_count_bits(brw->vs.prog_data->outputs_written); + /* BRW_NEW_FRAGMENT_PROGRAM */ uint32_t num_outputs = brw_count_bits(brw->fragment_program->Base.InputsRead); - uint32_t dw1, dw2, dw3, dw4, dw16; + uint32_t dw1, dw2, dw3, dw4, dw16, dw17; int i; /* _NEW_BUFFER */ GLboolean render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; int attr = 0; int urb_start; + int two_side_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide); /* _NEW_TRANSFORM */ if (ctx->Transform.ClipPlanesEnabled) @@ -91,6 +118,7 @@ upload_sf_state(struct brw_context *brw) dw3 = 0; dw4 = 0; dw16 = 0; + dw17 = 0; /* _NEW_POLYGON */ if ((ctx->Polygon.FrontFace == GL_CCW) ^ render_to_fbo) @@ -99,6 +127,48 @@ upload_sf_state(struct brw_context *brw) if (ctx->Polygon.OffsetFill) dw2 |= GEN6_SF_GLOBAL_DEPTH_OFFSET_SOLID; + if (ctx->Polygon.OffsetLine) + dw2 |= GEN6_SF_GLOBAL_DEPTH_OFFSET_WIREFRAME; + + if (ctx->Polygon.OffsetPoint) + dw2 |= GEN6_SF_GLOBAL_DEPTH_OFFSET_POINT; + + switch (ctx->Polygon.FrontMode) { + case GL_FILL: + dw2 |= GEN6_SF_FRONT_SOLID; + break; + + case GL_LINE: + dw2 |= GEN6_SF_FRONT_WIREFRAME; + break; + + case GL_POINT: + dw2 |= GEN6_SF_FRONT_POINT; + break; + + default: + assert(0); + break; + } + + switch (ctx->Polygon.BackMode) { + case GL_FILL: + dw2 |= GEN6_SF_BACK_SOLID; + break; + + case GL_LINE: + dw2 |= GEN6_SF_BACK_WIREFRAME; + break; + + case GL_POINT: + dw2 |= GEN6_SF_BACK_POINT; + break; + + default: + assert(0); + break; + } + /* _NEW_SCISSOR */ if (ctx->Scissor.Enabled) dw3 |= GEN6_SF_SCISSOR_ENABLE; @@ -160,8 +230,14 @@ upload_sf_state(struct brw_context *brw) } } + /* flat shading */ + if (ctx->Light.ShadeModel == GL_FLAT) { + dw17 |= ((brw->fragment_program->Base.InputsRead & (FRAG_BIT_COL0 | FRAG_BIT_COL1)) >> + ((brw->fragment_program->Base.InputsRead & FRAG_BIT_WPOS) ? 0 : 1)); + } + BEGIN_BATCH(20); - OUT_BATCH(CMD_3D_SF_STATE << 16 | (20 - 2)); + OUT_BATCH(_3DSTATE_SF << 16 | (20 - 2)); OUT_BATCH(dw1); OUT_BATCH(dw2); OUT_BATCH(dw3); @@ -174,7 +250,7 @@ upload_sf_state(struct brw_context *brw) for (; attr < 64; attr++) { if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr)) { - attr_overrides |= get_attr_override(brw, attr); + attr_overrides |= get_attr_override(brw, attr, two_side_color); attr++; break; } @@ -182,7 +258,7 @@ upload_sf_state(struct brw_context *brw) for (; attr < 64; attr++) { if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr)) { - attr_overrides |= get_attr_override(brw, attr) << 16; + attr_overrides |= get_attr_override(brw, attr, two_side_color) << 16; attr++; break; } @@ -190,7 +266,7 @@ upload_sf_state(struct brw_context *brw) OUT_BATCH(attr_overrides); } OUT_BATCH(dw16); /* point sprite texcoord bitmask */ - OUT_BATCH(0); /* constant interp bitmask */ + OUT_BATCH(dw17); /* constant interp bitmask */ OUT_BATCH(0); /* wrapshortest enables 0-7 */ OUT_BATCH(0); /* wrapshortest enables 8-15 */ ADVANCE_BATCH(); @@ -205,7 +281,8 @@ const struct brw_tracked_state gen6_sf_state = { _NEW_BUFFERS | _NEW_POINT | _NEW_TRANSFORM), - .brw = BRW_NEW_CONTEXT, + .brw = (BRW_NEW_CONTEXT | + BRW_NEW_FRAGMENT_PROGRAM), .cache = CACHE_NEW_VS_PROG }, .emit = upload_sf_state, diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c index a341234..fc46c4c 100644 --- a/src/mesa/drivers/dri/i965/gen6_urb.c +++ b/src/mesa/drivers/dri/i965/gen6_urb.c @@ -60,7 +60,7 @@ upload_urb(struct brw_context *brw) assert(!brw->gs.prog_bo || brw->urb.vs_size < 5); BEGIN_BATCH(3); - OUT_BATCH(CMD_URB << 16 | (3 - 2)); + OUT_BATCH(_3DSTATE_URB << 16 | (3 - 2)); OUT_BATCH(((brw->urb.vs_size - 1) << GEN6_URB_VS_SIZE_SHIFT) | ((brw->urb.nr_vs_entries) << GEN6_URB_VS_ENTRIES_SHIFT)); OUT_BATCH(((brw->urb.vs_size - 1) << GEN6_URB_GS_SIZE_SHIFT) | @@ -72,7 +72,7 @@ const struct brw_tracked_state gen6_urb = { .dirty = { .mesa = 0, .brw = BRW_NEW_CONTEXT, - .cache = CACHE_NEW_VS_PROG, + .cache = (CACHE_NEW_VS_PROG | CACHE_NEW_GS_PROG), }, .prepare = prepare_urb, .emit = upload_urb, diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c index d691bbe..cd7d209 100644 --- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c @@ -117,7 +117,7 @@ static void upload_viewport_state_pointers(struct brw_context *brw) struct intel_context *intel = &brw->intel; BEGIN_BATCH(4); - OUT_BATCH(CMD_VIEWPORT_STATE_POINTERS << 16 | (4 - 2) | + OUT_BATCH(_3DSTATE_VIEWPORT_STATE_POINTERS << 16 | (4 - 2) | GEN6_CC_VIEWPORT_MODIFY | GEN6_SF_VIEWPORT_MODIFY | GEN6_CLIP_VIEWPORT_MODIFY); diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index e94d0c0..e68c0ac 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -47,14 +47,14 @@ upload_vs_state(struct brw_context *brw) if (brw->vs.prog_data->nr_params == 0 && !ctx->Transform.ClipPlanesEnabled) { /* Disable the push constant buffers. */ BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_VS_STATE << 16 | (5 - 2)); + OUT_BATCH(_3DSTATE_CONSTANT_VS << 16 | (5 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); } else { - int params_uploaded = 0; + int params_uploaded = 0, param_regs; float *param; if (brw->vertex_program->IsNVProgram) @@ -88,20 +88,11 @@ upload_vs_state(struct brw_context *brw) params_uploaded++; } - if (vp->use_const_buffer) { - for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) { - if (brw->vs.constant_map[i] != -1) { - memcpy(param + brw->vs.constant_map[i] * 4, - vp->program.Base.Parameters->ParameterValues[i], - 4 * sizeof(float)); - params_uploaded++; - } - } - } else { - for (i = 0; i < nr_params; i++) { - memcpy(param, vp->program.Base.Parameters->ParameterValues[i], + for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) { + if (brw->vs.constant_map[i] != -1) { + memcpy(param + brw->vs.constant_map[i] * 4, + vp->program.Base.Parameters->ParameterValues[i], 4 * sizeof(float)); - param += 4; params_uploaded++; } } @@ -117,13 +108,16 @@ upload_vs_state(struct brw_context *brw) drm_intel_gem_bo_unmap_gtt(constant_bo); + param_regs = (params_uploaded + 1) / 2; + assert(param_regs <= 32); + BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_VS_STATE << 16 | + OUT_BATCH(_3DSTATE_CONSTANT_VS << 16 | GEN6_CONSTANT_BUFFER_0_ENABLE | (5 - 2)); OUT_RELOC(constant_bo, I915_GEM_DOMAIN_RENDER, 0, /* XXX: bad domain */ - ALIGN(params_uploaded, 2) / 2 - 1); + param_regs - 1); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); @@ -133,9 +127,10 @@ upload_vs_state(struct brw_context *brw) } BEGIN_BATCH(6); - OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2)); + OUT_BATCH(_3DSTATE_VS << 16 | (6 - 2)); OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) | + GEN6_VS_FLOATING_POINT_MODE_ALT | (brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); OUT_BATCH(0); /* scratch space base offset */ OUT_BATCH((1 << GEN6_VS_DISPATCH_START_GRF_SHIFT) | diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index ea5418b..78901ec 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -66,6 +66,21 @@ prepare_wm_constants(struct brw_context *brw) constants[i] = convert_param(brw->wm.prog_data->param_convert[i], *brw->wm.prog_data->param[i]); } + + if (0) { + printf("WM constants:\n"); + for (i = 0; i < brw->wm.prog_data->nr_params; i++) { + if ((i & 7) == 0) + printf("g%d: ", brw->wm.prog_data->first_curbe_grf + i / 8); + printf("%8f ", constants[i]); + if ((i & 7) == 7) + printf("\n"); + } + if ((i & 7) != 0) + printf("\n"); + printf("\n"); + } + drm_intel_gem_bo_unmap_gtt(brw->wm.push_const_bo); } } @@ -88,10 +103,11 @@ upload_wm_state(struct brw_context *brw) brw_fragment_program_const(brw->fragment_program); uint32_t dw2, dw4, dw5, dw6; + /* CACHE_NEW_WM_PROG */ if (brw->wm.prog_data->nr_params == 0) { /* Disable the push constant buffers. */ BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | (5 - 2)); + OUT_BATCH(_3DSTATE_CONSTANT_PS << 16 | (5 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); @@ -99,12 +115,13 @@ upload_wm_state(struct brw_context *brw) ADVANCE_BATCH(); } else { BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | + OUT_BATCH(_3DSTATE_CONSTANT_PS << 16 | GEN6_CONSTANT_BUFFER_0_ENABLE | (5 - 2)); OUT_RELOC(brw->wm.push_const_bo, I915_GEM_DOMAIN_RENDER, 0, /* XXX: bad domain */ - ALIGN(brw->wm.prog_data->nr_params, 8) / 8 - 1); + ALIGN(brw->wm.prog_data->nr_params, + brw->wm.prog_data->dispatch_width) / 8 - 1); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); @@ -116,6 +133,9 @@ upload_wm_state(struct brw_context *brw) dw5 |= GEN6_WM_LINE_AA_WIDTH_1_0; dw5 |= GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5; + /* OpenGL non-ieee floating point mode */ + dw2 |= GEN6_WM_FLOATING_POINT_MODE_ALT; + /* BRW_NEW_NR_WM_SURFACES */ dw2 |= brw->wm.nr_surfaces << GEN6_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT; @@ -126,8 +146,8 @@ upload_wm_state(struct brw_context *brw) dw5 |= (40 - 1) << GEN6_WM_MAX_THREADS_SHIFT; - /* BRW_NEW_FRAGMENT_PROGRAM */ - if (fp->isGLSL) + /* CACHE_NEW_WM_PROG */ + if (brw->wm.prog_data->dispatch_width == 8) dw5 |= GEN6_WM_8_DISPATCH_ENABLE; else dw5 |= GEN6_WM_16_DISPATCH_ENABLE; @@ -161,7 +181,7 @@ upload_wm_state(struct brw_context *brw) GEN6_WM_NUM_SF_OUTPUTS_SHIFT; BEGIN_BATCH(9); - OUT_BATCH(CMD_3D_WM_STATE << 16 | (9 - 2)); + OUT_BATCH(_3DSTATE_WM << 16 | (9 - 2)); OUT_RELOC(brw->wm.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_BATCH(dw2); OUT_BATCH(0); /* scratch space base offset */ @@ -176,13 +196,14 @@ upload_wm_state(struct brw_context *brw) const struct brw_tracked_state gen6_wm_state = { .dirty = { .mesa = (_NEW_LINE | _NEW_POLYGONSTIPPLE | _NEW_COLOR | _NEW_BUFFERS | - _NEW_PROGRAM_CONSTANTS), + _NEW_PROGRAM_CONSTANTS | _NEW_POLYGON), .brw = (BRW_NEW_CURBE_OFFSETS | BRW_NEW_FRAGMENT_PROGRAM | BRW_NEW_NR_WM_SURFACES | BRW_NEW_URB_FENCE | BRW_NEW_BATCH), - .cache = CACHE_NEW_SAMPLER + .cache = (CACHE_NEW_SAMPLER | + CACHE_NEW_WM_PROG) }, .emit = upload_wm_state, }; diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 4b498f8..67ce8a4 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -92,9 +92,17 @@ do_flush_locked(struct intel_batchbuffer *batch, GLuint used) batch->ptr = NULL; - if (!intel->no_hw) { - drm_intel_bo_exec(batch->buf, used, NULL, 0, - (x_off & 0xffff) | (y_off << 16)); + if (!intel->intelScreen->no_hw) { + int ring; + + if (intel->gen < 6 || !intel->batch->is_blit) { + ring = I915_EXEC_RENDER; + } else { + ring = I915_EXEC_BLT; + } + + drm_intel_bo_mrb_exec(batch->buf, used, NULL, 0, + (x_off & 0xffff) | (y_off << 16), ring); } if (unlikely(INTEL_DEBUG & DEBUG_BATCH)) { @@ -242,10 +250,10 @@ intel_batchbuffer_emit_reloc_fenced(struct intel_batchbuffer *batch, void intel_batchbuffer_data(struct intel_batchbuffer *batch, - const void *data, GLuint bytes) + const void *data, GLuint bytes, bool is_blit) { assert((bytes & 3) == 0); - intel_batchbuffer_require_space(batch, bytes); + intel_batchbuffer_require_space(batch, bytes, is_blit); __memcpy(batch->ptr, data, bytes); batch->ptr += bytes; } @@ -262,22 +270,32 @@ intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch) struct intel_context *intel = batch->intel; if (intel->gen >= 6) { - BEGIN_BATCH(8); - - /* XXX workaround: issue any post sync != 0 before write cache flush = 1 */ - OUT_BATCH(_3DSTATE_PIPE_CONTROL); - OUT_BATCH(PIPE_CONTROL_WRITE_IMMEDIATE); - OUT_BATCH(0); /* write address */ - OUT_BATCH(0); /* write data */ - - OUT_BATCH(_3DSTATE_PIPE_CONTROL); - OUT_BATCH(PIPE_CONTROL_INSTRUCTION_FLUSH | - PIPE_CONTROL_WRITE_FLUSH | - PIPE_CONTROL_DEPTH_CACHE_FLUSH | - PIPE_CONTROL_NO_WRITE); - OUT_BATCH(0); /* write address */ - OUT_BATCH(0); /* write data */ - ADVANCE_BATCH(); + if (intel->batch->is_blit) { + BEGIN_BATCH_BLT(4); + OUT_BATCH(MI_FLUSH_DW); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } else { + BEGIN_BATCH(8); + /* XXX workaround: issue any post sync != 0 before write + * cache flush = 1 + */ + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_WRITE_IMMEDIATE); + OUT_BATCH(0); /* write address */ + OUT_BATCH(0); /* write data */ + + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_INSTRUCTION_FLUSH | + PIPE_CONTROL_WRITE_FLUSH | + PIPE_CONTROL_DEPTH_CACHE_FLUSH | + PIPE_CONTROL_NO_WRITE); + OUT_BATCH(0); /* write address */ + OUT_BATCH(0); /* write data */ + ADVANCE_BATCH(); + } } else if (intel->gen >= 4) { BEGIN_BATCH(4); OUT_BATCH(_3DSTATE_PIPE_CONTROL | diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 428c027..6357085 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -31,6 +31,7 @@ struct intel_batchbuffer } emit; #endif + bool is_blit; GLuint dirty_state; GLuint reserved_space; }; @@ -55,7 +56,7 @@ void intel_batchbuffer_reset(struct intel_batchbuffer *batch); * intel_buffer_dword() calls. */ void intel_batchbuffer_data(struct intel_batchbuffer *batch, - const void *data, GLuint bytes); + const void *data, GLuint bytes, bool is_blit); void intel_batchbuffer_release_space(struct intel_batchbuffer *batch, GLuint bytes); @@ -114,8 +115,16 @@ intel_batchbuffer_emit_float(struct intel_batchbuffer *batch, float f) static INLINE void intel_batchbuffer_require_space(struct intel_batchbuffer *batch, - GLuint sz) + GLuint sz, int is_blit) { + + if (batch->intel->gen >= 6 && batch->is_blit != is_blit && + batch->ptr != batch->map) { + intel_batchbuffer_flush(batch); + } + + batch->is_blit = is_blit; + #ifdef DEBUG assert(sz < batch->size - 8); #endif @@ -124,9 +133,10 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, } static INLINE void -intel_batchbuffer_begin(struct intel_batchbuffer *batch, int n) +intel_batchbuffer_begin(struct intel_batchbuffer *batch, int n, bool is_blit) { - intel_batchbuffer_require_space(batch, n * 4); + intel_batchbuffer_require_space(batch, n * 4, is_blit); + #ifdef DEBUG assert(batch->map); assert(batch->emit.start_ptr == NULL); @@ -154,7 +164,8 @@ intel_batchbuffer_advance(struct intel_batchbuffer *batch) */ #define BATCH_LOCALS -#define BEGIN_BATCH(n) intel_batchbuffer_begin(intel->batch, n) +#define BEGIN_BATCH(n) intel_batchbuffer_begin(intel->batch, n, false) +#define BEGIN_BATCH_BLT(n) intel_batchbuffer_begin(intel->batch, n, true) #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) #define OUT_BATCH_F(f) intel_batchbuffer_emit_float(intel->batch,f) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index c2917e9..6232e47 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -38,6 +38,7 @@ #include "intel_reg.h" #include "intel_regions.h" #include "intel_batchbuffer.h" +#include "intel_mipmap_tree.h" #define FILE_DEBUG_FLAG DEBUG_BLIT @@ -107,10 +108,6 @@ intelEmitCopyBlit(struct intel_context *intel, drm_intel_bo *aper_array[3]; BATCH_LOCALS; - /* Blits are in a different ringbuffer so we don't use them. */ - if (intel->gen >= 6) - return GL_FALSE; - if (dst_tiling != I915_TILING_NONE) { if (dst_offset & 4095) return GL_FALSE; @@ -140,7 +137,7 @@ intelEmitCopyBlit(struct intel_context *intel, if (pass >= 2) return GL_FALSE; - intel_batchbuffer_require_space(intel->batch, 8 * 4); + intel_batchbuffer_require_space(intel->batch, 8 * 4, true); DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", __FUNCTION__, src_buffer, src_pitch, src_offset, src_x, src_y, @@ -181,7 +178,7 @@ intelEmitCopyBlit(struct intel_context *intel, assert(dst_x < dst_x2); assert(dst_y < dst_y2); - BEGIN_BATCH(8); + BEGIN_BATCH_BLT(8); OUT_BATCH(CMD); OUT_BATCH(BR13 | (uint16_t)dst_pitch); OUT_BATCH((dst_y << 16) | dst_x); @@ -209,7 +206,7 @@ intelEmitCopyBlit(struct intel_context *intel, * which we're clearing with triangles. * \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear */ -void +GLbitfield intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) { struct intel_context *intel = intel_context(ctx); @@ -217,11 +214,9 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) GLuint clear_depth; GLboolean all; GLint cx, cy, cw, ch; + GLbitfield fail_mask = 0; BATCH_LOCALS; - /* Blits are in a different ringbuffer so we don't use them. */ - assert(intel->gen < 6); - /* * Compute values for clearing the buffers. */ @@ -242,7 +237,7 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) ch = fb->_Ymax - fb->_Ymin; if (cw == 0 || ch == 0) - return; + return 0; GLuint buf; all = (cw == fb->Width && ch == fb->Height); @@ -338,9 +333,9 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) clear[3], clear[3]); break; default: - _mesa_problem(ctx, "Unexpected renderbuffer format: %d\n", - irb->Base.Format); - clear_val = 0; + fail_mask |= bufBit; + mask &= ~bufBit; + continue; } } @@ -356,7 +351,7 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) intel_batchbuffer_flush(intel->batch); } - BEGIN_BATCH(6); + BEGIN_BATCH_BLT(6); OUT_BATCH(CMD); OUT_BATCH(BR13); OUT_BATCH((y1 << 16) | x1); @@ -375,6 +370,8 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) else mask &= ~bufBit; /* turn off bit, for faster loop exit */ } + + return fail_mask; } GLboolean @@ -393,10 +390,6 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, int dwords = ALIGN(src_size, 8) / 4; uint32_t opcode, br13, blit_cmd; - /* Blits are in a different ringbuffer so we don't use them. */ - if (intel->gen >= 6) - return GL_FALSE; - if (dst_tiling != I915_TILING_NONE) { if (dst_offset & 4095) return GL_FALSE; @@ -420,7 +413,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, intel_batchbuffer_require_space( intel->batch, (8 * 4) + (3 * 4) + - dwords * 4 ); + dwords * 4, true); opcode = XY_SETUP_BLT_CMD; if (cpp == 4) @@ -439,7 +432,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, if (dst_tiling != I915_TILING_NONE) blit_cmd |= XY_DST_TILED; - BEGIN_BATCH(8 + 3); + BEGIN_BATCH_BLT(8 + 3); OUT_BATCH(opcode); OUT_BATCH(br13); OUT_BATCH((0 << 16) | 0); /* clip x1, y1 */ @@ -456,9 +449,9 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, OUT_BATCH(((y + h) << 16) | (x + w)); ADVANCE_BATCH(); - intel_batchbuffer_data( intel->batch, - src_bits, - dwords * 4 ); + intel_batchbuffer_data(intel->batch, + src_bits, + dwords * 4, true); intel_batchbuffer_emit_mi_flush(intel->batch); @@ -480,9 +473,6 @@ intel_emit_linear_blit(struct intel_context *intel, GLuint pitch, height; GLboolean ok; - /* Blits are in a different ringbuffer so we don't use them. */ - assert(intel->gen < 6); - /* The pitch given to the GPU must be DWORD aligned, and * we want width to match pitch. Max width is (1 << 15 - 1), * rounding that down to the nearest DWORD is 1 << 15 - 4 @@ -514,3 +504,81 @@ intel_emit_linear_blit(struct intel_context *intel, assert(ok); } } + +/** + * Used to initialize the alpha value of an ARGB8888 teximage after + * loading it from an XRGB8888 source. + * + * This is very common with glCopyTexImage2D(). + */ +void +intel_set_teximage_alpha_to_one(struct gl_context *ctx, + struct intel_texture_image *intel_image) +{ + struct intel_context *intel = intel_context(ctx); + unsigned int image_x, image_y; + uint32_t x1, y1, x2, y2; + uint32_t BR13, CMD; + int pitch, cpp; + drm_intel_bo *aper_array[2]; + struct intel_region *region = intel_image->mt->region; + BATCH_LOCALS; + + assert(intel_image->base.TexFormat == MESA_FORMAT_ARGB8888); + + /* get dest x/y in destination texture */ + intel_miptree_get_image_offset(intel_image->mt, + intel_image->level, + intel_image->face, + 0, + &image_x, &image_y); + + x1 = image_x; + y1 = image_y; + x2 = image_x + intel_image->base.Width; + y2 = image_y + intel_image->base.Height; + + pitch = region->pitch; + cpp = region->cpp; + + DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n", + __FUNCTION__, + intel_image->mt->region->buffer, (pitch * region->cpp), + x1, y1, x2 - x1, y2 - y1); + + BR13 = br13_for_cpp(region->cpp) | 0xf0 << 16; + CMD = XY_COLOR_BLT_CMD; + CMD |= XY_BLT_WRITE_ALPHA; + + assert(region->tiling != I915_TILING_Y); + +#ifndef I915 + if (region->tiling != I915_TILING_NONE) { + CMD |= XY_DST_TILED; + pitch /= 4; + } +#endif + BR13 |= (pitch * region->cpp); + + /* do space check before going any further */ + aper_array[0] = intel->batch->buf; + aper_array[1] = region->buffer; + + if (drm_intel_bufmgr_check_aperture_space(aper_array, + ARRAY_SIZE(aper_array)) != 0) { + intel_batchbuffer_flush(intel->batch); + } + + BEGIN_BATCH_BLT(6); + OUT_BATCH(CMD); + OUT_BATCH(BR13); + OUT_BATCH((y1 << 16) | x1); + OUT_BATCH((y2 << 16) | x2); + OUT_RELOC_FENCED(region->buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + 0); + OUT_BATCH(0xffffffff); /* white, but only alpha gets written */ + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); +} diff --git a/src/mesa/drivers/dri/intel/intel_blit.h b/src/mesa/drivers/dri/intel/intel_blit.h index 0163146..88322c7 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.h +++ b/src/mesa/drivers/dri/intel/intel_blit.h @@ -33,7 +33,7 @@ extern void intelCopyBuffer(const __DRIdrawable * dpriv, const drm_clip_rect_t * rect); -extern void intelClearWithBlit(struct gl_context * ctx, GLbitfield mask); +extern GLbitfield intelClearWithBlit(struct gl_context * ctx, GLbitfield mask); GLboolean intelEmitCopyBlit(struct intel_context *intel, @@ -69,5 +69,7 @@ void intel_emit_linear_blit(struct intel_context *intel, drm_intel_bo *src_bo, unsigned int src_offset, unsigned int size); +void intel_set_teximage_alpha_to_one(struct gl_context *ctx, + struct intel_texture_image *intel_image); #endif diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 87da60a..d917161 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -27,6 +27,7 @@ #include "main/imports.h" +#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/macros.h" #include "main/bufferobj.h" diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index fa451f0..82d29e7 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -85,6 +85,8 @@ intelClear(struct gl_context *ctx, GLbitfield mask) GLbitfield blit_mask = 0; GLbitfield swrast_mask = 0; struct gl_framebuffer *fb = ctx->DrawBuffer; + struct intel_renderbuffer *irb; + int i; if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT)) { intel->front_buffer_dirty = GL_TRUE; @@ -93,6 +95,22 @@ intelClear(struct gl_context *ctx, GLbitfield mask) if (0) fprintf(stderr, "%s\n", __FUNCTION__); + /* Get SW clears out of the way: Anything without an intel_renderbuffer */ + for (i = 0; i < BUFFER_COUNT; i++) { + if (!(mask & (1 << i))) + continue; + + irb = intel_get_renderbuffer(fb, i); + if (unlikely(!irb)) { + swrast_mask |= (1 << i); + mask &= ~(1 << i); + } + } + if (unlikely(swrast_mask)) { + debug_mask("swrast", swrast_mask); + _swrast_Clear(ctx, swrast_mask); + } + /* HW color buffers (front, back, aux, generic FBO, etc) */ if (colorMask == ~0) { /* clear all R,G,B,A */ @@ -151,44 +169,18 @@ intelClear(struct gl_context *ctx, GLbitfield mask) } } - if (intel->gen >= 6) { - /* Blits are in a different ringbuffer so we don't use them. */ - tri_mask |= blit_mask; - blit_mask = 0; - } - - /* SW fallback clearing */ - swrast_mask = mask & ~tri_mask & ~blit_mask; - - { - /* look for non-Intel renderbuffers (clear them with swrast) */ - GLbitfield blit_or_tri = blit_mask | tri_mask; - while (blit_or_tri) { - GLuint i = _mesa_ffs(blit_or_tri) - 1; - GLbitfield bufBit = 1 << i; - if (!fb->Attachment[i].Renderbuffer->ClassID) { - blit_mask &= ~bufBit; - tri_mask &= ~bufBit; - swrast_mask |= bufBit; - } - blit_or_tri ^= bufBit; - } - } + /* Anything left, just use tris */ + tri_mask |= mask & ~blit_mask; if (blit_mask) { debug_mask("blit", blit_mask); - intelClearWithBlit(ctx, blit_mask); + tri_mask |= intelClearWithBlit(ctx, blit_mask); } if (tri_mask) { debug_mask("tri", tri_mask); _mesa_meta_Clear(&intel->ctx, tri_mask); } - - if (swrast_mask) { - debug_mask("swrast", swrast_mask); - _swrast_Clear(ctx, swrast_mask); - } } diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 152cdca..2a50299 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -519,7 +519,6 @@ static const struct dri_debug_control debug_control[] = { { "sing", DEBUG_SINGLE_THREAD }, { "thre", DEBUG_SINGLE_THREAD }, { "wm", DEBUG_WM }, - { "glsl_force", DEBUG_GLSL_FORCE }, { "urb", DEBUG_URB }, { "vs", DEBUG_VS }, { "clip", DEBUG_CLIP }, @@ -566,7 +565,8 @@ intel_glFlush(struct gl_context *ctx) intel_flush(ctx); intel_flush_front(ctx); - intel->need_throttle = GL_TRUE; + if (intel->is_front_buffer_rendering) + intel->need_throttle = GL_TRUE; } void @@ -683,6 +683,69 @@ intelInitContext(struct intel_context *intel, } } + memset(&ctx->TextureFormatSupported, 0, + sizeof(ctx->TextureFormatSupported)); + ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = GL_TRUE; + if (intel->has_xrgb_textures) + ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_ARGB4444] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_ARGB1555] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_L8] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_A8] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_I8] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_AL88] = GL_TRUE; + if (intel->gen >= 4) + ctx->TextureFormatSupported[MESA_FORMAT_AL1616] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_S8_Z24] = GL_TRUE; + /* + * This was disabled in initial FBO enabling to avoid combinations + * of depth+stencil that wouldn't work together. We since decided + * that it was OK, since it's up to the app to come up with the + * combo that actually works, so this can probably be re-enabled. + */ + /* + ctx->TextureFormatSupported[MESA_FORMAT_Z16] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_Z24] = GL_TRUE; + */ + + /* ctx->Extensions.MESA_ycbcr_texture */ + ctx->TextureFormatSupported[MESA_FORMAT_YCBCR] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_YCBCR_REV] = GL_TRUE; + + /* GL_3DFX_texture_compression_FXT1 */ + ctx->TextureFormatSupported[MESA_FORMAT_RGB_FXT1] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_RGBA_FXT1] = GL_TRUE; + + /* GL_EXT_texture_compression_s3tc */ + ctx->TextureFormatSupported[MESA_FORMAT_RGB_DXT1] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_RGBA_DXT1] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_RGBA_DXT3] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_RGBA_DXT5] = GL_TRUE; + +#ifndef I915 + /* GL_ARB_texture_rg */ + ctx->TextureFormatSupported[MESA_FORMAT_R8] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_R16] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_RG88] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_RG1616] = GL_TRUE; + + ctx->TextureFormatSupported[MESA_FORMAT_DUDV8] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_RGBA8888_REV] = GL_TRUE; + + /* GL_EXT_texture_sRGB */ + ctx->TextureFormatSupported[MESA_FORMAT_SARGB8] = GL_TRUE; + if (intel->gen >= 5 || intel->is_g4x) + ctx->TextureFormatSupported[MESA_FORMAT_SRGB_DXT1] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_SRGBA_DXT1] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_SRGBA_DXT3] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_SRGBA_DXT5] = GL_TRUE; + if (intel->has_luminance_srgb) { + ctx->TextureFormatSupported[MESA_FORMAT_SL8] = GL_TRUE; + ctx->TextureFormatSupported[MESA_FORMAT_SLA8] = GL_TRUE; + } +#endif + driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache, sPriv->myNum, (intel->gen >= 4) ? "i965" : "i915"); if (intelScreen->deviceID == PCI_CHIP_I865_G) @@ -800,11 +863,6 @@ intelInitContext(struct intel_context *intel, if (INTEL_DEBUG & DEBUG_BUFMGR) dri_bufmgr_set_debug(intel->bufmgr, GL_TRUE); - /* XXX force SIMD8 kernel for Sandybridge before we fixed - SIMD16 interpolation. */ - if (intel->gen == 6) - INTEL_DEBUG |= DEBUG_GLSL_FORCE; - intel->batch = intel_batchbuffer_alloc(intel); intel_fbo_init(intel); @@ -838,11 +896,6 @@ intelInitContext(struct intel_context *intel, intel->always_flush_cache = 1; } - /* Disable all hardware rendering (skip emitting batches and fences/waits - * to the kernel) - */ - intel->no_hw = getenv("INTEL_NO_HW") != NULL; - return GL_TRUE; } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 9d5139c..fd3c3ba 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -29,7 +29,7 @@ #define INTELCONTEXT_INC - +#include <stdbool.h> #include "main/mtypes.h" #include "main/mm.h" #include "dri_metaops.h" @@ -149,6 +149,7 @@ struct intel_context void (*assert_not_dirty) (struct intel_context *intel); void (*debug_batch)(struct intel_context *intel); + bool (*render_target_supported)(gl_format format); } vtbl; struct dri_metaops meta; @@ -207,7 +208,6 @@ struct intel_context GLboolean hw_stipple; GLboolean depth_buffer_is_float; GLboolean no_rast; - GLboolean no_hw; GLboolean always_flush_batch; GLboolean always_flush_cache; @@ -362,7 +362,6 @@ extern int INTEL_DEBUG; #define DEBUG_WM 0x800000 #define DEBUG_URB 0x1000000 #define DEBUG_VS 0x2000000 -#define DEBUG_GLSL_FORCE 0x4000000 #define DEBUG_CLIP 0x8000000 #define DBG(...) do { \ diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 556a419..fab533f 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -25,12 +25,15 @@ * **************************************************************************/ +#include "main/mfeatures.h" + #include "intel_chipset.h" #include "intel_context.h" #include "intel_extensions.h" #include "utils.h" +#define need_GL_ARB_ES2_compatibility #define need_GL_ARB_draw_elements_base_vertex #define need_GL_ARB_framebuffer_object #define need_GL_ARB_map_buffer_range @@ -78,8 +81,10 @@ * i965_dri. */ static const struct dri_extension card_extensions[] = { + { "GL_ARB_ES2_compatibility", GL_ARB_ES2_compatibility_functions }, { "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, { "GL_ARB_explicit_attrib_location", NULL }, + { "GL_ARB_framebuffer_object", GL_ARB_framebuffer_object_functions}, { "GL_ARB_half_float_pixel", NULL }, { "GL_ARB_map_buffer_range", GL_ARB_map_buffer_range_functions }, { "GL_ARB_multitexture", NULL }, @@ -161,7 +166,6 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_fragment_program", NULL }, { "GL_ARB_fragment_program_shadow", NULL }, { "GL_ARB_fragment_shader", NULL }, - { "GL_ARB_framebuffer_object", GL_ARB_framebuffer_object_functions}, { "GL_ARB_half_float_vertex", NULL }, { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_point_sprite", NULL }, diff --git a/src/mesa/drivers/dri/intel/intel_extensions_es2.c b/src/mesa/drivers/dri/intel/intel_extensions_es2.c index 71c8633..5ef6b05 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions_es2.c +++ b/src/mesa/drivers/dri/intel/intel_extensions_es2.c @@ -26,6 +26,7 @@ **************************************************************************/ #include "main/extensions.h" +#include "main/mfeatures.h" #include "intel_extensions.h" @@ -62,6 +63,7 @@ static const char *es2_extensions[] = { "GL_EXT_blend_minmax", "GL_EXT_blend_subtract", "GL_EXT_stencil_wrap", + "GL_NV_blend_square", /* Optional GLES2 */ "GL_ARB_framebuffer_object", @@ -79,6 +81,17 @@ static const char *es2_extensions[] = { }; /** + * \brief Extensions to disable. + * + * These extensions must be manually disabled because they may have been + * enabled by default. + */ +static const char* es2_extensions_disabled[] = { + "GL_OES_standard_derivatives", + NULL, +}; + +/** * Initializes potential list of extensions if ctx == NULL, or actually enables * extensions for a context. */ @@ -92,4 +105,6 @@ intelInitExtensionsES2(struct gl_context *ctx) for (i = 0; es2_extensions[i]; i++) _mesa_enable_extension(ctx, es2_extensions[i]); + for (i = 0; es2_extensions_disabled[i]; i++) + _mesa_disable_extension(ctx, es2_extensions_disabled[i]); } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 862a13d..0db5a49 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -28,6 +28,7 @@ #include "main/imports.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/fbobject.h" #include "main/framebuffer.h" @@ -42,6 +43,11 @@ #include "intel_fbo.h" #include "intel_mipmap_tree.h" #include "intel_regions.h" +#include "intel_tex.h" +#include "intel_span.h" +#ifndef I915 +#include "brw_context.h" +#endif #define FILE_DEBUG_FLAG DEBUG_FBO @@ -107,79 +113,27 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer ASSERT(rb->Name != 0); switch (internalFormat) { - case GL_RED: - case GL_R8: - rb->Format = MESA_FORMAT_R8; - rb->DataType = GL_UNSIGNED_BYTE; - break; - case GL_R16: - rb->Format = MESA_FORMAT_R16; - rb->DataType = GL_UNSIGNED_SHORT; - break; - case GL_RG: - case GL_RG8: - rb->Format = MESA_FORMAT_RG88; - rb->DataType = GL_UNSIGNED_BYTE; - break; - case GL_RG16: - rb->Format = MESA_FORMAT_RG1616; - rb->DataType = GL_UNSIGNED_SHORT; - break; - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - rb->Format = MESA_FORMAT_RGB565; - rb->DataType = GL_UNSIGNED_BYTE; - break; - case GL_RGB: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - rb->Format = MESA_FORMAT_XRGB8888; - rb->DataType = GL_UNSIGNED_BYTE; - break; - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - rb->Format = MESA_FORMAT_ARGB8888; - rb->DataType = GL_UNSIGNED_BYTE; - break; - case GL_ALPHA: - case GL_ALPHA8: - rb->Format = MESA_FORMAT_A8; - rb->DataType = GL_UNSIGNED_BYTE; - break; - case GL_DEPTH_COMPONENT16: - rb->Format = MESA_FORMAT_Z16; - rb->DataType = GL_UNSIGNED_SHORT; + default: + /* Use the same format-choice logic as for textures. + * Renderbuffers aren't any different from textures for us, + * except they're less useful because you can't texture with + * them. + */ + rb->Format = intel->ctx.Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); break; case GL_STENCIL_INDEX: case GL_STENCIL_INDEX1_EXT: case GL_STENCIL_INDEX4_EXT: case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - /* alloc a depth+stencil buffer */ + /* These aren't actual texture formats, so force them here. */ rb->Format = MESA_FORMAT_S8_Z24; - rb->DataType = GL_UNSIGNED_INT_24_8_EXT; break; - default: - _mesa_problem(ctx, - "Unexpected format in intel_alloc_renderbuffer_storage"); - return GL_FALSE; } rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + rb->DataType = intel_mesa_format_to_rb_datatype(rb->Format); cpp = _mesa_get_format_bytes(rb->Format); intel_flush(ctx); @@ -195,10 +149,15 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer DBG("Allocating %d x %d Intel RBO\n", width, height); tiling = I915_TILING_NONE; + if (intel->use_texture_tiling) { + GLenum base_format = _mesa_get_format_base_format(rb->Format); - /* Gen6 requires depth must be tiling */ - if (intel->gen >= 6 && rb->Format == MESA_FORMAT_S8_Z24) - tiling = I915_TILING_Y; + if (intel->gen >= 4 && (base_format == GL_DEPTH_COMPONENT || + base_format == GL_DEPTH_STENCIL)) + tiling = I915_TILING_Y; + else + tiling = I915_TILING_X; + } irb->region = intel_region_alloc(intel->intelScreen, tiling, cpp, width, height, GL_TRUE); @@ -334,53 +293,10 @@ intel_create_renderbuffer(gl_format format) _mesa_init_renderbuffer(&irb->Base, 0); irb->Base.ClassID = INTEL_RB_CLASS; - - switch (format) { - case MESA_FORMAT_RGB565: - irb->Base._BaseFormat = GL_RGB; - irb->Base.DataType = GL_UNSIGNED_BYTE; - break; - case MESA_FORMAT_XRGB8888: - irb->Base._BaseFormat = GL_RGB; - irb->Base.DataType = GL_UNSIGNED_BYTE; - break; - case MESA_FORMAT_ARGB8888: - irb->Base._BaseFormat = GL_RGBA; - irb->Base.DataType = GL_UNSIGNED_BYTE; - break; - case MESA_FORMAT_Z16: - irb->Base._BaseFormat = GL_DEPTH_COMPONENT; - irb->Base.DataType = GL_UNSIGNED_SHORT; - break; - case MESA_FORMAT_X8_Z24: - irb->Base._BaseFormat = GL_DEPTH_COMPONENT; - irb->Base.DataType = GL_UNSIGNED_INT; - break; - case MESA_FORMAT_S8_Z24: - irb->Base._BaseFormat = GL_DEPTH_STENCIL; - irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - break; - case MESA_FORMAT_A8: - irb->Base._BaseFormat = GL_ALPHA; - irb->Base.DataType = GL_UNSIGNED_BYTE; - break; - case MESA_FORMAT_R8: - irb->Base._BaseFormat = GL_RED; - irb->Base.DataType = GL_UNSIGNED_BYTE; - break; - case MESA_FORMAT_RG88: - irb->Base._BaseFormat = GL_RG; - irb->Base.DataType = GL_UNSIGNED_BYTE; - break; - default: - _mesa_problem(NULL, - "Unexpected intFormat in intel_create_renderbuffer"); - free(irb); - return NULL; - } - + irb->Base._BaseFormat = _mesa_get_format_base_format(format); irb->Base.Format = format; irb->Base.InternalFormat = irb->Base._BaseFormat; + irb->Base.DataType = intel_mesa_format_to_rb_datatype(format); /* intel-specific methods */ irb->Base.Delete = intel_delete_renderbuffer; @@ -457,66 +373,16 @@ static GLboolean intel_update_wrapper(struct gl_context *ctx, struct intel_renderbuffer *irb, struct gl_texture_image *texImage) { - if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to RGBA8 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_XRGB8888) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to XGBA8 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_SARGB8) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to SARGB8 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_RGB565) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to RGB5 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_ARGB1555) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to ARGB1555 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_ARGB4444) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to ARGB4444 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_A8) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to A8 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_R8) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to R8 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_RG88) { - irb->Base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to RG88 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_R16) { - irb->Base.DataType = GL_UNSIGNED_SHORT; - DBG("Render to R8 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_RG1616) { - irb->Base.DataType = GL_UNSIGNED_SHORT; - DBG("Render to RG88 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_Z16) { - irb->Base.DataType = GL_UNSIGNED_SHORT; - DBG("Render to DEPTH16 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) { - irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - DBG("Render to DEPTH_STENCIL texture OK\n"); - } - else { + if (!intel_span_supports_format(texImage->TexFormat)) { DBG("Render to texture BAD FORMAT %s\n", _mesa_get_format_name(texImage->TexFormat)); return GL_FALSE; + } else { + DBG("Render to texture %s\n", _mesa_get_format_name(texImage->TexFormat)); } irb->Base.Format = texImage->TexFormat; - + irb->Base.DataType = intel_mesa_format_to_rb_datatype(texImage->TexFormat); irb->Base.InternalFormat = texImage->InternalFormat; irb->Base._BaseFormat = _mesa_base_fbo_format(ctx, irb->Base.InternalFormat); irb->Base.Width = texImage->Width; @@ -558,6 +424,24 @@ intel_wrap_texture(struct gl_context * ctx, struct gl_texture_image *texImage) return irb; } +static void +intel_set_draw_offset_for_image(struct intel_texture_image *intel_image, + int zoffset) +{ + struct intel_mipmap_tree *mt = intel_image->mt; + unsigned int dst_x, dst_y; + + /* compute offset of the particular 2D image within the texture region */ + intel_miptree_get_image_offset(intel_image->mt, + intel_image->level, + intel_image->face, + zoffset, + &dst_x, &dst_y); + + mt->region->draw_offset = (dst_y * mt->region->pitch + dst_x) * mt->cpp; + mt->region->draw_x = dst_x; + mt->region->draw_y = dst_y; +} /** * Called by glFramebufferTexture[123]DEXT() (and other places) to @@ -574,7 +458,6 @@ intel_render_texture(struct gl_context * ctx, = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); struct intel_texture_image *intel_image; - GLuint dst_x, dst_y; (void) fb; @@ -620,19 +503,53 @@ intel_render_texture(struct gl_context * ctx, intel_region_reference(&irb->region, intel_image->mt->region); } - /* compute offset of the particular 2D image within the texture region */ - intel_miptree_get_image_offset(intel_image->mt, - att->TextureLevel, - att->CubeMapFace, - att->Zoffset, - &dst_x, &dst_y); - - intel_image->mt->region->draw_offset = (dst_y * intel_image->mt->region->pitch + - dst_x) * intel_image->mt->cpp; - intel_image->mt->region->draw_x = dst_x; - intel_image->mt->region->draw_y = dst_y; + intel_set_draw_offset_for_image(intel_image, att->Zoffset); intel_image->used_as_render_target = GL_TRUE; +#ifndef I915 + if (!brw_context(ctx)->has_surface_tile_offset && + (intel_image->mt->region->draw_offset & 4095) != 0) { + /* Original gen4 hardware couldn't draw to a non-tile-aligned + * destination in a miptree unless you actually setup your + * renderbuffer as a miptree and used the fragile + * lod/array_index/etc. controls to select the image. So, + * instead, we just make a new single-level miptree and render + * into that. + */ + struct intel_context *intel = intel_context(ctx); + struct intel_mipmap_tree *old_mt = intel_image->mt; + struct intel_mipmap_tree *new_mt; + int comp_byte = 0, texel_bytes; + + if (_mesa_is_format_compressed(intel_image->base.TexFormat)) + comp_byte = intel_compressed_num_bytes(intel_image->base.TexFormat); + + texel_bytes = _mesa_get_format_bytes(intel_image->base.TexFormat); + + new_mt = intel_miptree_create(intel, newImage->TexObject->Target, + intel_image->base._BaseFormat, + intel_image->base.InternalFormat, + intel_image->level, + intel_image->level, + intel_image->base.Width, + intel_image->base.Height, + intel_image->base.Depth, + texel_bytes, comp_byte, GL_TRUE); + + intel_miptree_image_copy(intel, + new_mt, + intel_image->face, + intel_image->level, + old_mt); + + intel_miptree_release(intel, &intel_image->mt); + intel_image->mt = new_mt; + intel_set_draw_offset_for_image(intel_image, att->Zoffset); + + intel_region_release(&irb->region); + intel_region_reference(&irb->region, intel_image->mt->region); + } +#endif /* update drawing region, etc */ intel_draw_buffer(ctx, fb); } @@ -655,7 +572,8 @@ intel_finish_render_texture(struct gl_context * ctx, _glthread_GetID(), att->Texture->Name); /* Flag that this image may now be validated into the object's miptree. */ - intel_image->used_as_render_target = GL_FALSE; + if (intel_image) + intel_image->used_as_render_target = GL_FALSE; /* Since we've (probably) rendered to the texture and will (likely) use * it in the texture domain later on in this batchbuffer, flush the @@ -671,6 +589,7 @@ intel_finish_render_texture(struct gl_context * ctx, static void intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) { + struct intel_context *intel = intel_context(ctx); const struct intel_renderbuffer *depthRb = intel_get_renderbuffer(fb, BUFFER_DEPTH); const struct intel_renderbuffer *stencilRb = @@ -678,10 +597,10 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) int i; if (depthRb && stencilRb && stencilRb != depthRb) { - if (ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Type == GL_TEXTURE && - ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Type == GL_TEXTURE && - (ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Texture->Name == - ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Texture->Name)) { + if (fb->Attachment[BUFFER_DEPTH].Type == GL_TEXTURE && + fb->Attachment[BUFFER_STENCIL].Type == GL_TEXTURE && + (fb->Attachment[BUFFER_DEPTH].Texture->Name == + fb->Attachment[BUFFER_STENCIL].Texture->Name)) { /* OK */ } else { /* we only support combined depth/stencil buffers, not separate @@ -694,33 +613,35 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) } } - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[i]; - struct intel_renderbuffer *irb = intel_renderbuffer(rb); + for (i = 0; i < Elements(fb->Attachment); i++) { + struct gl_renderbuffer *rb; + struct intel_renderbuffer *irb; + + if (fb->Attachment[i].Type == GL_NONE) + continue; - if (rb == NULL) + /* A supported attachment will have a Renderbuffer set either + * from being a Renderbuffer or being a texture that got the + * intel_wrap_texture() treatment. + */ + rb = fb->Attachment[i].Renderbuffer; + if (rb == NULL) { + DBG("attachment without renderbuffer\n"); + fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT; continue; + } + irb = intel_renderbuffer(rb); if (irb == NULL) { DBG("software rendering renderbuffer\n"); fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT; continue; } - switch (irb->Base.Format) { - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_XRGB8888: - case MESA_FORMAT_SARGB8: - case MESA_FORMAT_RGB565: - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_A8: - case MESA_FORMAT_R8: - case MESA_FORMAT_R16: - case MESA_FORMAT_RG88: - case MESA_FORMAT_RG1616: - break; - default: + if (!intel_span_supports_format(irb->Base.Format) || + !intel->vtbl.render_target_supported(irb->Base.Format)) { + DBG("Unsupported texture/renderbuffer format attached: %s\n", + _mesa_get_format_name(irb->Base.Format)); fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT; } } diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 9c4e5c5..a340927 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -157,8 +157,6 @@ struct intel_mipmap_tree * intel_miptree_create_for_region(struct intel_context *intel, GLenum target, GLenum internal_format, - GLuint first_level, - GLuint last_level, struct intel_region *region, GLuint depth0, GLuint compress_byte) @@ -166,7 +164,7 @@ intel_miptree_create_for_region(struct intel_context *intel, struct intel_mipmap_tree *mt; mt = intel_miptree_create_internal(intel, target, internal_format, - first_level, last_level, + 0, 0, region->width, region->height, 1, region->cpp, compress_byte, I915_TILING_NONE); diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index 21db2f4..760a8bc 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -137,8 +137,6 @@ struct intel_mipmap_tree * intel_miptree_create_for_region(struct intel_context *intel, GLenum target, GLenum internal_format, - GLuint first_level, - GLuint last_level, struct intel_region *region, GLuint depth0, GLuint compress_byte); diff --git a/src/mesa/drivers/dri/intel/intel_reg.h b/src/mesa/drivers/dri/intel/intel_reg.h index 955b100..5258699 100644 --- a/src/mesa/drivers/dri/intel/intel_reg.h +++ b/src/mesa/drivers/dri/intel/intel_reg.h @@ -37,6 +37,8 @@ #define FLUSH_MAP_CACHE (1 << 0) #define INHIBIT_FLUSH_RENDER_CACHE (1 << 2) +#define MI_FLUSH_DW (CMD_MI | (0x26 << 23) | 2) + /* Stalls command execution waiting for the given events to have occurred. */ #define MI_WAIT_FOR_EVENT (CMD_MI | (0x3 << 23)) #define MI_WAIT_FOR_PLANE_B_FLIP (1<<6) diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 061f0d2..5d14bcd 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -31,23 +31,11 @@ #include "main/renderbuffer.h" #include "main/hash.h" #include "main/fbobject.h" +#include "main/mfeatures.h" #include "utils.h" #include "xmlpool.h" -#include "intel_batchbuffer.h" -#include "intel_buffers.h" -#include "intel_bufmgr.h" -#include "intel_chipset.h" -#include "intel_fbo.h" -#include "intel_screen.h" -#include "intel_tex.h" -#include "intel_regions.h" - -#include "i915_drm.h" - -#define DRI_CONF_TEXTURE_TILING(def) \ - PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE @@ -92,6 +80,17 @@ DRI_CONF_END; const GLuint __driNConfigOptions = 11; +#include "intel_batchbuffer.h" +#include "intel_buffers.h" +#include "intel_bufmgr.h" +#include "intel_chipset.h" +#include "intel_fbo.h" +#include "intel_screen.h" +#include "intel_tex.h" +#include "intel_regions.h" + +#include "i915_drm.h" + #ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; #endif /*USE_NEW_INTERFACE */ @@ -452,7 +451,7 @@ intelCreateContext(gl_api api, return brwCreateContext(api, mesaVis, driContextPriv, sharedContextPrivate); #endif - fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID); + fprintf(stderr, "Unrecognized deviceID 0x%x\n", intelScreen->deviceID); return GL_FALSE; } @@ -462,7 +461,8 @@ intel_init_bufmgr(struct intel_screen *intelScreen) __DRIscreen *spriv = intelScreen->driScrnPriv; int num_fences = 0; - intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL; + intelScreen->no_hw = (getenv("INTEL_NO_HW") != NULL || + getenv("INTEL_DEVID_OVERRIDE") != NULL); intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ); if (intelScreen->bufmgr == NULL) { @@ -497,6 +497,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) GLenum fb_format[3]; GLenum fb_type[3]; unsigned int api_mask; + char *devid_override; static const GLenum back_buffer_modes[] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML @@ -523,6 +524,16 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) &intelScreen->deviceID)) return GL_FALSE; + /* Allow an override of the device ID for the purpose of making the + * driver produce dumps for debugging of new chipset enablement. + * This implies INTEL_NO_HW, to avoid programming your actual GPU + * incorrectly. + */ + devid_override = getenv("INTEL_DEVID_OVERRIDE"); + if (devid_override) { + intelScreen->deviceID = strtod(devid_override, NULL); + } + api_mask = (1 << __DRI_API_OPENGL); #if FEATURE_ES1 api_mask |= (1 << __DRI_API_GLES); diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 104cadf..1f41518 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include <stdbool.h> #include "main/glheader.h" #include "main/macros.h" #include "main/mtypes.h" @@ -113,6 +114,26 @@ intel_set_span_functions(struct intel_context *intel, #define TAG2(x,y) intel_##x##y##_A8 #include "spantmp2.h" +#define SPANTMP_MESA_FMT MESA_FORMAT_R8 +#define TAG(x) intel_##x##_R8 +#define TAG2(x,y) intel_##x##y##_R8 +#include "spantmp2.h" + +#define SPANTMP_MESA_FMT MESA_FORMAT_RG88 +#define TAG(x) intel_##x##_RG88 +#define TAG2(x,y) intel_##x##y##_RG88 +#include "spantmp2.h" + +#define SPANTMP_MESA_FMT MESA_FORMAT_R16 +#define TAG(x) intel_##x##_R16 +#define TAG2(x,y) intel_##x##y##_R16 +#include "spantmp2.h" + +#define SPANTMP_MESA_FMT MESA_FORMAT_RG1616 +#define TAG(x) intel_##x##_RG1616 +#define TAG2(x,y) intel_##x##y##_RG1616 +#include "spantmp2.h" + #define LOCAL_DEPTH_VARS \ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ const GLint yScale = rb->Name ? 1 : -1; \ @@ -339,6 +360,32 @@ intel_unmap_vertex_shader_textures(struct gl_context *ctx) } } +typedef void (*span_init_func)(struct gl_renderbuffer *rb); + +static span_init_func intel_span_init_funcs[MESA_FORMAT_COUNT] = +{ + [MESA_FORMAT_A8] = intel_InitPointers_A8, + [MESA_FORMAT_RGB565] = intel_InitPointers_RGB565, + [MESA_FORMAT_ARGB4444] = intel_InitPointers_ARGB4444, + [MESA_FORMAT_ARGB1555] = intel_InitPointers_ARGB1555, + [MESA_FORMAT_XRGB8888] = intel_InitPointers_xRGB8888, + [MESA_FORMAT_ARGB8888] = intel_InitPointers_ARGB8888, + [MESA_FORMAT_SARGB8] = intel_InitPointers_ARGB8888, + [MESA_FORMAT_Z16] = intel_InitDepthPointers_z16, + [MESA_FORMAT_X8_Z24] = intel_InitDepthPointers_z24_s8, + [MESA_FORMAT_S8_Z24] = intel_InitDepthPointers_z24_s8, + [MESA_FORMAT_R8] = intel_InitPointers_R8, + [MESA_FORMAT_RG88] = intel_InitPointers_RG88, + [MESA_FORMAT_R16] = intel_InitPointers_R16, + [MESA_FORMAT_RG1616] = intel_InitPointers_RG1616, +}; + +bool +intel_span_supports_format(gl_format format) +{ + return intel_span_init_funcs[format] != NULL; +} + /** * Plug in appropriate span read/write functions for the given renderbuffer. * These are used for the software fallbacks. @@ -349,37 +396,6 @@ intel_set_span_functions(struct intel_context *intel, { struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb; - switch (irb->Base.Format) { - case MESA_FORMAT_A8: - intel_InitPointers_A8(rb); - break; - case MESA_FORMAT_RGB565: - intel_InitPointers_RGB565(rb); - break; - case MESA_FORMAT_ARGB4444: - intel_InitPointers_ARGB4444(rb); - break; - case MESA_FORMAT_ARGB1555: - intel_InitPointers_ARGB1555(rb); - break; - case MESA_FORMAT_XRGB8888: - intel_InitPointers_xRGB8888(rb); - break; - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_SARGB8: - intel_InitPointers_ARGB8888(rb); - break; - case MESA_FORMAT_Z16: - intel_InitDepthPointers_z16(rb); - break; - case MESA_FORMAT_X8_Z24: - case MESA_FORMAT_S8_Z24: - intel_InitDepthPointers_z24_s8(rb); - break; - default: - _mesa_problem(NULL, - "Unexpected MesaFormat %d in intelSetSpanFunctions", - irb->Base.Format); - break; - } + assert(intel_span_init_funcs[irb->Base.Format]); + intel_span_init_funcs[irb->Base.Format](rb); } diff --git a/src/mesa/drivers/dri/intel/intel_span.h b/src/mesa/drivers/dri/intel/intel_span.h index aa8d08e..5a4c4e8 100644 --- a/src/mesa/drivers/dri/intel/intel_span.h +++ b/src/mesa/drivers/dri/intel/intel_span.h @@ -28,6 +28,9 @@ #ifndef _INTEL_SPAN_H #define _INTEL_SPAN_H +#include "main/formats.h" +#include <stdbool.h> + extern void intelInitSpanFuncs(struct gl_context * ctx); extern void intelSpanRenderFinish(struct gl_context * ctx); @@ -38,5 +41,6 @@ void intel_renderbuffer_unmap(struct intel_context *intel, struct gl_renderbuffer *rb); void intel_map_vertex_shader_textures(struct gl_context *ctx); void intel_unmap_vertex_shader_textures(struct gl_context *ctx); +bool intel_span_supports_format(gl_format format); #endif diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 2c21ea0..2c3eab2 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -113,7 +113,6 @@ intelGenerateMipmap(struct gl_context *ctx, GLenum target, void intelInitTextureFuncs(struct dd_function_table *functions) { - functions->ChooseTextureFormat = intelChooseTextureFormat; functions->GenerateMipmap = intelGenerateMipmap; functions->NewTextureObject = intelNewTextureObject; diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h index 7906554..6552ed0 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.h +++ b/src/mesa/drivers/dri/intel/intel_tex.h @@ -40,8 +40,7 @@ void intelInitTextureSubImageFuncs(struct dd_function_table *functions); void intelInitTextureCopyImageFuncs(struct dd_function_table *functions); -gl_format intelChooseTextureFormat(struct gl_context *ctx, GLint internalFormat, - GLenum format, GLenum type); +GLenum intel_mesa_format_to_rb_datatype(gl_format format); void intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *pDraw); diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 87b31bf..a40011a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -35,7 +35,6 @@ #include "intel_screen.h" #include "intel_context.h" -#include "intel_buffers.h" #include "intel_mipmap_tree.h" #include "intel_regions.h" #include "intel_fbo.h" @@ -50,44 +49,20 @@ * Do the best we can using the blitter. A future project is to use * the texture engine and fragment programs for these copies. */ -static const struct intel_region * -get_teximage_source(struct intel_context *intel, GLenum internalFormat) +static struct intel_renderbuffer * +get_teximage_readbuffer(struct intel_context *intel, GLenum internalFormat) { - struct intel_renderbuffer *irb; - DBG("%s %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(internalFormat)); switch (internalFormat) { case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: - irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH); - if (irb && irb->region && irb->region->cpp == 2) - return irb->region; - return NULL; case GL_DEPTH24_STENCIL8_EXT: case GL_DEPTH_STENCIL_EXT: - irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH); - if (irb && irb->region && irb->region->cpp == 4) - return irb->region; - return NULL; - case 4: - case GL_RGBA: - case GL_RGBA8: - irb = intel_renderbuffer(intel->ctx.ReadBuffer->_ColorReadBuffer); - /* We're required to set alpha to 1.0 in this case, but we can't - * do that with the blitter, so fall back. We could use the 3D - * engine or do two passes with the blitter, but it doesn't seem - * worth it for this case. */ - if (irb->Base._BaseFormat == GL_RGB) - return NULL; - return irb->region; - case 3: - case GL_RGB: - case GL_RGB8: - return intel_readbuf_region(intel); + return intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH); default: - return NULL; + return intel_renderbuffer(intel->ctx.ReadBuffer->_ColorReadBuffer); } } @@ -101,23 +76,34 @@ do_copy_texsubimage(struct intel_context *intel, GLint x, GLint y, GLsizei width, GLsizei height) { struct gl_context *ctx = &intel->ctx; - const struct intel_region *src = get_teximage_source(intel, internalFormat); + struct intel_renderbuffer *irb; + bool copy_supported_with_alpha_override = false; + + intel_prepare_render(intel); - if (!intelImage->mt || !src || !src->buffer) { + irb = get_teximage_readbuffer(intel, internalFormat); + if (!intelImage->mt || !irb || !irb->region) { if (unlikely(INTEL_DEBUG & DEBUG_FALLBACKS)) fprintf(stderr, "%s fail %p %p (0x%08x)\n", - __FUNCTION__, intelImage->mt, src, internalFormat); + __FUNCTION__, intelImage->mt, irb, internalFormat); return GL_FALSE; } - if (intelImage->mt->cpp != src->cpp) { - fallback_debug("%s fail %d vs %d cpp\n", - __FUNCTION__, intelImage->mt->cpp, src->cpp); + if (irb->Base.Format == MESA_FORMAT_XRGB8888 && + intelImage->base.TexFormat == MESA_FORMAT_ARGB8888) { + copy_supported_with_alpha_override = true; + } + + if (intelImage->base.TexFormat != irb->Base.Format && + !copy_supported_with_alpha_override) { + if (unlikely(INTEL_DEBUG & DEBUG_FALLBACKS)) + fprintf(stderr, "%s mismatched formats %s, %s\n", + __FUNCTION__, + _mesa_get_format_name(intelImage->base.TexFormat), + _mesa_get_format_name(irb->Base.Format)); return GL_FALSE; } - /* intel_flush(ctx); */ - intel_prepare_render(intel); { drm_intel_bo *dst_bo = intel_region_buffer(intel, intelImage->mt->region, @@ -140,24 +126,24 @@ do_copy_texsubimage(struct intel_context *intel, if (ctx->ReadBuffer->Name == 0) { /* Flip vertical orientation for system framebuffers */ y = ctx->ReadBuffer->Height - (y + height); - src_pitch = -src->pitch; + src_pitch = -irb->region->pitch; } else { /* reading from a FBO, y is already oriented the way we like */ - src_pitch = src->pitch; + src_pitch = irb->region->pitch; } /* blit from src buffer to texture */ if (!intelEmitCopyBlit(intel, intelImage->mt->cpp, src_pitch, - src->buffer, + irb->region->buffer, 0, - src->tiling, + irb->region->tiling, intelImage->mt->region->pitch, dst_bo, 0, intelImage->mt->region->tiling, - src->draw_x + x, src->draw_y + y, + irb->region->draw_x + x, irb->region->draw_y + y, image_x + dstx, image_y + dsty, width, height, GL_COPY)) { @@ -165,6 +151,9 @@ do_copy_texsubimage(struct intel_context *intel, } } + if (copy_supported_with_alpha_override) + intel_set_teximage_alpha_to_one(ctx, intelImage); + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index 9d73a2f..87745bc 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -4,224 +4,35 @@ #include "main/formats.h" /** - * Choose hardware texture format given the user's glTexImage parameters. - * - * It works out that this function is fine for all the supported - * hardware. However, there is still a need to map the formats onto - * hardware descriptors. - * - * Note that the i915 can actually support many more formats than - * these if we take the step of simply swizzling the colors - * immediately after sampling... + * Returns the renderbuffer DataType for a MESA_FORMAT. */ -gl_format -intelChooseTextureFormat(struct gl_context * ctx, GLint internalFormat, - GLenum format, GLenum type) +GLenum +intel_mesa_format_to_rb_datatype(gl_format format) { - struct intel_context *intel = intel_context(ctx); - -#if 0 - printf("%s intFmt=0x%x format=0x%x type=0x%x\n", - __FUNCTION__, internalFormat, format, type); -#endif - - switch (internalFormat) { - case 4: - case GL_RGBA: - case GL_COMPRESSED_RGBA: - if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) - return MESA_FORMAT_ARGB4444; - else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) - return MESA_FORMAT_ARGB1555; - else - return MESA_FORMAT_ARGB8888; - - case 3: - case GL_RGB: - case GL_COMPRESSED_RGB: - if (type == GL_UNSIGNED_SHORT_5_6_5) - return MESA_FORMAT_RGB565; - else if (intel->has_xrgb_textures) - return MESA_FORMAT_XRGB8888; - else - return MESA_FORMAT_ARGB8888; - - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return MESA_FORMAT_ARGB8888; - - case GL_RGBA4: - case GL_RGBA2: - return MESA_FORMAT_ARGB4444; - - case GL_RGB5_A1: - return MESA_FORMAT_ARGB1555; - - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - if (intel->has_xrgb_textures) - return MESA_FORMAT_XRGB8888; - else - return MESA_FORMAT_ARGB8888; - - case GL_RGB5: - case GL_RGB4: - case GL_R3_G3_B2: - return MESA_FORMAT_RGB565; - - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - case GL_COMPRESSED_ALPHA: - return MESA_FORMAT_A8; - - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - case GL_COMPRESSED_LUMINANCE: - return MESA_FORMAT_L8; - - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - /* i915 could implement this mode using MT_32BIT_RG1616. However, this - * would require an extra swizzle instruction in the fragment shader to - * convert the { R, G, 1.0, 1.0 } to { R, R, R, G }. - */ -#ifndef I915 - return MESA_FORMAT_AL1616; -#else - /* FALLTHROUGH */ -#endif - - case 2: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_COMPRESSED_LUMINANCE_ALPHA: - return MESA_FORMAT_AL88; - - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - case GL_COMPRESSED_INTENSITY: - return MESA_FORMAT_I8; - - case GL_YCBCR_MESA: - if (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE) - return MESA_FORMAT_YCBCR; - else - return MESA_FORMAT_YCBCR_REV; - - case GL_COMPRESSED_RGB_FXT1_3DFX: - return MESA_FORMAT_RGB_FXT1; - case GL_COMPRESSED_RGBA_FXT1_3DFX: - return MESA_FORMAT_RGBA_FXT1; - - case GL_RGB_S3TC: - case GL_RGB4_S3TC: - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return MESA_FORMAT_RGB_DXT1; - - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return MESA_FORMAT_RGBA_DXT1; - - case GL_RGBA_S3TC: - case GL_RGBA4_S3TC: - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return MESA_FORMAT_RGBA_DXT3; - - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return MESA_FORMAT_RGBA_DXT5; - - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: -#if 0 - return MESA_FORMAT_Z16; -#else - /* fall-through. - * 16bpp depth texture can't be paired with a stencil buffer so - * always used combined depth/stencil format. - */ -#endif - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return MESA_FORMAT_S8_Z24; - -#ifndef I915 - case GL_SRGB_EXT: - case GL_SRGB8_EXT: - case GL_SRGB_ALPHA_EXT: - case GL_SRGB8_ALPHA8_EXT: - case GL_COMPRESSED_SRGB_EXT: - case GL_COMPRESSED_SRGB_ALPHA_EXT: - case GL_COMPRESSED_SLUMINANCE_EXT: - case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return MESA_FORMAT_SARGB8; - case GL_SLUMINANCE_EXT: - case GL_SLUMINANCE8_EXT: - if (intel->has_luminance_srgb) - return MESA_FORMAT_SL8; - else - return MESA_FORMAT_SARGB8; - case GL_SLUMINANCE_ALPHA_EXT: - case GL_SLUMINANCE8_ALPHA8_EXT: - if (intel->has_luminance_srgb) - return MESA_FORMAT_SLA8; - else - return MESA_FORMAT_SARGB8; - case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return MESA_FORMAT_SRGB_DXT1; - - /* i915 could also do this */ - case GL_DUDV_ATI: - case GL_DU8DV8_ATI: - return MESA_FORMAT_DUDV8; - case GL_RGBA_SNORM: - case GL_RGBA8_SNORM: - return MESA_FORMAT_SIGNED_RGBA8888_REV; - - /* i915 can do a RG16, but it can't do any of the other RED or RG formats. - * In addition, it only implements the broken D3D mode where undefined - * components are read as 1.0. I'm not sure who thought reading - * { R, G, 1.0, 1.0 } from a red-green texture would be useful. - */ - case GL_RED: - case GL_R8: - return MESA_FORMAT_R8; - case GL_R16: - return MESA_FORMAT_R16; - case GL_RG: - case GL_RG8: - return MESA_FORMAT_RG88; - case GL_RG16: - return MESA_FORMAT_RG1616; -#endif - + switch (format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_SARGB8: + case MESA_FORMAT_R8: + case MESA_FORMAT_RG88: + case MESA_FORMAT_A8: + case MESA_FORMAT_AL88: + case MESA_FORMAT_RGB565: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_ARGB4444: + return GL_UNSIGNED_BYTE; + case MESA_FORMAT_R16: + case MESA_FORMAT_RG1616: + case MESA_FORMAT_Z16: + return GL_UNSIGNED_SHORT; + case MESA_FORMAT_X8_Z24: + return GL_UNSIGNED_INT; + case MESA_FORMAT_S8_Z24: + return GL_UNSIGNED_INT_24_8_EXT; default: - fprintf(stderr, "unexpected texture format %s in %s\n", - _mesa_lookup_enum_by_nr(internalFormat), __FUNCTION__); - return MESA_FORMAT_NONE; + _mesa_problem(NULL, "unexpected MESA_FORMAT for renderbuffer"); + return GL_UNSIGNED_BYTE; } - - return MESA_FORMAT_NONE; /* never get here */ } int intel_compressed_num_bytes(GLuint mesaFormat) diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 41cdbfd..cd8c4c2 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -1,6 +1,7 @@ #include "main/glheader.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/enums.h" #include "main/bufferobj.h" @@ -55,11 +56,11 @@ logbase2(int n) * 0)..(1x1). Consider pruning this tree at a validation if the * saving is worth it. */ -static void -guess_and_alloc_mipmap_tree(struct intel_context *intel, - struct intel_texture_object *intelObj, - struct intel_texture_image *intelImage, - GLboolean expect_accelerated_upload) +static struct intel_mipmap_tree * +intel_miptree_create_for_teximage(struct intel_context *intel, + struct intel_texture_object *intelObj, + struct intel_texture_image *intelImage, + GLboolean expect_accelerated_upload) { GLuint firstLevel; GLuint lastLevel; @@ -72,70 +73,71 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, DBG("%s\n", __FUNCTION__); if (intelImage->base.Border) - return; + return NULL; if (intelImage->level > intelObj->base.BaseLevel && (intelImage->base.Width == 1 || (intelObj->base.Target != GL_TEXTURE_1D && intelImage->base.Height == 1) || (intelObj->base.Target == GL_TEXTURE_3D && - intelImage->base.Depth == 1))) - return; - - /* If this image disrespects BaseLevel, allocate from level zero. - * Usually BaseLevel == 0, so it's unlikely to happen. - */ - if (intelImage->level < intelObj->base.BaseLevel) - firstLevel = 0; - else - firstLevel = intelObj->base.BaseLevel; - - - /* Figure out image dimensions at start level. - */ - for (i = intelImage->level; i > firstLevel; i--) { - width <<= 1; - if (height != 1) - height <<= 1; - if (depth != 1) - depth <<= 1; - } + intelImage->base.Depth == 1))) { + /* For this combination, we're at some lower mipmap level and + * some important dimension is 1. We can't extrapolate up to a + * likely base level width/height/depth for a full mipmap stack + * from this info, so just allocate this one level. + */ + firstLevel = intelImage->level; + lastLevel = intelImage->level; + } else { + /* If this image disrespects BaseLevel, allocate from level zero. + * Usually BaseLevel == 0, so it's unlikely to happen. + */ + if (intelImage->level < intelObj->base.BaseLevel) + firstLevel = 0; + else + firstLevel = intelObj->base.BaseLevel; + + /* Figure out image dimensions at start level. */ + for (i = intelImage->level; i > firstLevel; i--) { + width <<= 1; + if (height != 1) + height <<= 1; + if (depth != 1) + depth <<= 1; + } - /* Guess a reasonable value for lastLevel. This is probably going - * to be wrong fairly often and might mean that we have to look at - * resizable buffers, or require that buffers implement lazy - * pagetable arrangements. - */ - if ((intelObj->base.MinFilter == GL_NEAREST || - intelObj->base.MinFilter == GL_LINEAR) && - intelImage->level == firstLevel && - (intel->gen < 4 || firstLevel == 0)) { - lastLevel = firstLevel; - } - else { - lastLevel = firstLevel + logbase2(MAX2(MAX2(width, height), depth)); + /* Guess a reasonable value for lastLevel. This is probably going + * to be wrong fairly often and might mean that we have to look at + * resizable buffers, or require that buffers implement lazy + * pagetable arrangements. + */ + if ((intelObj->base.MinFilter == GL_NEAREST || + intelObj->base.MinFilter == GL_LINEAR) && + intelImage->level == firstLevel && + (intel->gen < 4 || firstLevel == 0)) { + lastLevel = firstLevel; + } else { + lastLevel = firstLevel + logbase2(MAX2(MAX2(width, height), depth)); + } } - assert(!intelObj->mt); if (_mesa_is_format_compressed(intelImage->base.TexFormat)) comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat); texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat); - intelObj->mt = intel_miptree_create(intel, - intelObj->base.Target, - intelImage->base._BaseFormat, - intelImage->base.InternalFormat, - firstLevel, - lastLevel, - width, - height, - depth, - texelBytes, - comp_byte, - expect_accelerated_upload); - - DBG("%s - success\n", __FUNCTION__); + return intel_miptree_create(intel, + intelObj->base.Target, + intelImage->base._BaseFormat, + intelImage->base.InternalFormat, + firstLevel, + lastLevel, + width, + height, + depth, + texelBytes, + comp_byte, + expect_accelerated_upload); } @@ -343,41 +345,29 @@ intelTexImage(struct gl_context * ctx, texImage->Data = NULL; } - if (!intelObj->mt) { - guess_and_alloc_mipmap_tree(intel, intelObj, intelImage, pixels == NULL); - if (!intelObj->mt) { - DBG("guess_and_alloc_mipmap_tree: failed\n"); - } - } - assert(!intelImage->mt); if (intelObj->mt && intel_miptree_match_image(intelObj->mt, &intelImage->base)) { - + /* Use an existing miptree when possible */ intel_miptree_reference(&intelImage->mt, intelObj->mt); assert(intelImage->mt); } else if (intelImage->base.Border == 0) { - int comp_byte = 0; - GLuint texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat); - GLenum baseFormat = _mesa_get_format_base_format(intelImage->base.TexFormat); - if (_mesa_is_format_compressed(intelImage->base.TexFormat)) { - comp_byte = - intel_compressed_num_bytes(intelImage->base.TexFormat); - } - /* Didn't fit in the object miptree, but it's suitable for inclusion in * a miptree, so create one just for our level and store it in the image. * It'll get moved into the object miptree at validate time. */ - intelImage->mt = intel_miptree_create(intel, target, - baseFormat, - internalFormat, - level, level, - width, height, depth, - texelBytes, - comp_byte, pixels == NULL); - + intelImage->mt = intel_miptree_create_for_teximage(intel, intelObj, + intelImage, + pixels == NULL); + + /* Even if the object currently has a mipmap tree associated + * with it, this one is a more likely candidate to represent the + * whole object since our level didn't fit what was there + * before, and any lower levels would fit into our miptree. + */ + if (intelImage->mt) + intel_miptree_reference(&intelObj->mt, intelImage->mt); } /* PBO fastpaths: @@ -711,8 +701,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, } mt = intel_miptree_create_for_region(intel, target, - internalFormat, - 0, 0, rb->region, 1, 0); + internalFormat, rb->region, 1, 0); if (mt == NULL) return; @@ -777,7 +766,7 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target, mt = intel_miptree_create_for_region(intel, target, image->internal_format, - 0, 0, image->region, 1, 0); + image->region, 1, 0); if (mt == NULL) return; diff --git a/src/mesa/drivers/dri/intel/intel_tex_obj.h b/src/mesa/drivers/dri/intel/intel_tex_obj.h index 5f60e0e..e93ef4a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_obj.h +++ b/src/mesa/drivers/dri/intel/intel_tex_obj.h @@ -32,11 +32,11 @@ struct intel_texture_object { struct gl_texture_object base; /* The "parent" object */ - /* The mipmap tree must include at least these levels once - * validated: + /* This is a mirror of base._MaxLevel, updated at validate time, + * except that we don't bother with the non-base levels for + * non-mipmapped textures. */ - GLuint firstLevel; - GLuint lastLevel; + unsigned int _MaxLevel; /* Offset for firstLevel image: */ diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index ed5c5d8..8537e7f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -8,72 +8,21 @@ #define FILE_DEBUG_FLAG DEBUG_TEXTURE /** - * Compute which mipmap levels that really need to be sent to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. + * When validating, we only care about the texture images that could + * be seen, so for non-mipmapped modes we want to ignore everything + * but BaseLevel. */ static void -intel_calculate_first_last_level(struct intel_context *intel, - struct intel_texture_object *intelObj) +intel_update_max_level(struct intel_context *intel, + struct intel_texture_object *intelObj) { struct gl_texture_object *tObj = &intelObj->base; - const struct gl_texture_image *const baseImage = - tObj->Image[0][tObj->BaseLevel]; - /* These must be signed values. MinLod and MaxLod can be negative numbers, - * and having firstLevel and lastLevel as signed prevents the need for - * extra sign checks. - */ - int firstLevel; - int lastLevel; - - /* Yes, this looks overly complicated, but it's all needed. - */ - switch (tObj->Target) { - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - case GL_TEXTURE_CUBE_MAP: - if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { - /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. - */ - firstLevel = lastLevel = tObj->BaseLevel; - } - else { - if (intel->gen == 2) { - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - } else { - /* Min/max LOD are taken into account in sampler state. We don't - * want to re-layout textures just because clamping has been applied - * since it means a bunch of blitting around and probably no memory - * savings (since we have to keep the other levels around anyway). - */ - firstLevel = tObj->BaseLevel; - lastLevel = MIN2(tObj->BaseLevel + baseImage->MaxLog2, - tObj->MaxLevel); - /* need at least one level */ - lastLevel = MAX2(firstLevel, lastLevel); - } - } - break; - case GL_TEXTURE_RECTANGLE_NV: - case GL_TEXTURE_4D_SGIS: - firstLevel = lastLevel = 0; - break; - default: - return; + if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + intelObj->_MaxLevel = tObj->BaseLevel; + } else { + intelObj->_MaxLevel = tObj->_MaxLevel; } - - /* save these values */ - intelObj->firstLevel = firstLevel; - intelObj->lastLevel = lastLevel; } /** @@ -135,8 +84,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* What levels must the tree include at a minimum? */ - intel_calculate_first_last_level(intel, intelObj); - firstImage = intel_texture_image(tObj->Image[0][intelObj->firstLevel]); + intel_update_max_level(intel, intelObj); + firstImage = intel_texture_image(tObj->Image[0][tObj->BaseLevel]); /* Fallback case: */ @@ -147,23 +96,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) return GL_FALSE; } - - /* If both firstImage and intelObj have a tree which can contain - * all active images, favour firstImage. Note that because of the - * completeness requirement, we know that the image dimensions - * will match. - */ - if (firstImage->mt && - firstImage->mt != intelObj->mt && - firstImage->mt->first_level <= intelObj->firstLevel && - firstImage->mt->last_level >= intelObj->lastLevel) { - - if (intelObj->mt) - intel_miptree_release(intel, &intelObj->mt); - - intel_miptree_reference(&intelObj->mt, firstImage->mt); - } - if (_mesa_is_format_compressed(firstImage->base.TexFormat)) { comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat); cpp = comp_byte; @@ -173,18 +105,17 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* Check tree can hold all active levels. Check tree matches * target, imageFormat, etc. - * - * XXX: For some layouts (eg i945?), the test might have to be - * first_level == firstLevel, as the tree isn't valid except at the - * original start level. Hope to get around this by - * programming minLod, maxLod, baseLevel into the hardware and - * leaving the tree alone. + * + * For pre-gen4, we have to match first_level == tObj->BaseLevel, + * because we don't have the control that gen4 does to make min/mag + * determination happen at a nonzero (hardware) baselevel. Because + * of that, we just always relayout on baselevel change. */ if (intelObj->mt && (intelObj->mt->target != intelObj->base.Target || intelObj->mt->internal_format != firstImage->base.InternalFormat || - intelObj->mt->first_level != intelObj->firstLevel || - intelObj->mt->last_level != intelObj->lastLevel || + intelObj->mt->first_level != tObj->BaseLevel || + intelObj->mt->last_level < intelObj->_MaxLevel || intelObj->mt->width0 != firstImage->base.Width || intelObj->mt->height0 != firstImage->base.Height || intelObj->mt->depth0 != firstImage->base.Depth || @@ -201,8 +132,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) intelObj->base.Target, firstImage->base._BaseFormat, firstImage->base.InternalFormat, - intelObj->firstLevel, - intelObj->lastLevel, + tObj->BaseLevel, + intelObj->_MaxLevel, firstImage->base.Width, firstImage->base.Height, firstImage->base.Depth, @@ -215,11 +146,13 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) */ nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; for (face = 0; face < nr_faces; face++) { - for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) { + for (i = tObj->BaseLevel; i <= intelObj->_MaxLevel; i++) { struct intel_texture_image *intelImage = intel_texture_image(intelObj->base.Image[face][i]); - - /* Need to import images in main memory or held in other trees. + /* skip too small size mipmap */ + if (intelImage == NULL) + break; + /* Need to import images in main memory or held in other trees. * If it's a render target, then its data isn't needed to be in * the object tree (otherwise we'd be FBO incomplete), and we need * to keep track of the image's MT as needing to be pulled in still, @@ -289,7 +222,7 @@ intel_tex_map_images(struct intel_context *intel, DBG("%s\n", __FUNCTION__); - for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) + for (i = intelObj->base.BaseLevel; i <= intelObj->_MaxLevel; i++) intel_tex_map_level_images(intel, intelObj, i); } @@ -299,6 +232,6 @@ intel_tex_unmap_images(struct intel_context *intel, { int i; - for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) + for (i = intelObj->base.BaseLevel; i <= intelObj->_MaxLevel; i++) intel_tex_unmap_level_images(intel, intelObj, i); } diff --git a/src/mesa/drivers/dri/mach64/mach64_context.h b/src/mesa/drivers/dri/mach64/mach64_context.h index 11e8f53..70bc0ae 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.h +++ b/src/mesa/drivers/dri/mach64/mach64_context.h @@ -295,11 +295,11 @@ extern GLboolean mach64UnbindContext( __DRIcontext *driContextPriv ); #define LE32_OUT( x, y ) do { *(GLuint *)(x) = (y); } while (0) #define LE32_OUT_FLOAT( x, y ) do { *(GLfloat *)(x) = (y); } while (0) #else -#ifndef __OpenBSD__ -#include <byteswap.h> -#else +#if defined(__OpenBSD__) || defined(__NetBSD__) #include <machine/endian.h> #define bswap_32 bswap32 +#else +#include <byteswap.h> #endif #define LE32_IN( x ) bswap_32( *(GLuint *)(x) ) diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c index 27e2892..45630be 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c @@ -24,6 +24,8 @@ * */ +#include "main/mfeatures.h" + #include "nouveau_driver.h" #include "nouveau_context.h" #include "nouveau_fbo.h" diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h index 8036b18..c5ac128 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h @@ -38,7 +38,6 @@ #include <assert.h> #include "nouveau_device.h" -#include "nouveau_pushbuf.h" #include "nouveau_grobj.h" #include "nouveau_channel.h" #include "nouveau_bo.h" @@ -46,6 +45,7 @@ #include "nouveau_screen.h" #include "nouveau_state.h" #include "nouveau_surface.h" +#include "nv04_pushbuf.h" #define DRIVER_DATE "20091015" #define DRIVER_AUTHOR "Nouveau" diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index 079b5d6..b36b578 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -32,6 +32,7 @@ #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/fbobject.h" +#include "main/mfeatures.h" static GLboolean set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat) diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 5abfc9d..9c045b7 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -38,6 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/simple_list.h" #include "main/imports.h" #include "main/extensions.h" +#include "main/mfeatures.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index 8a047e6..b622902 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -200,6 +200,7 @@ void r200EmitArrays( struct gl_context *ctx, GLubyte *vimap_rev ) } default: assert(0); + emitsize = 0; } if (!rmesa->radeon.tcl.aos[nr].bo) { rcommon_emit_vector( ctx, diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 0643247..092b757 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -37,6 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/enums.h" #include "main/image.h" +#include "main/mfeatures.h" #include "main/simple_list.h" #include "main/texstore.h" #include "main/teximage.h" diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index 7b9c316..e0d349b 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -24,6 +24,7 @@ #include <stdio.h> +#include "radeon_compiler_util.h" #include "radeon_dataflow.h" #include "radeon_emulate_branches.h" #include "radeon_emulate_loops.h" @@ -54,6 +55,8 @@ static void rc_rewrite_depth_out(struct radeon_compiler *cc, void *user) for (rci = c->Base.Program.Instructions.Next; rci != &c->Base.Program.Instructions; rci = rci->Next) { struct rc_sub_instruction * inst = &rci->U.I; + unsigned i; + const struct rc_opcode_info *info = rc_get_opcode_info(inst->Opcode); if (inst->DstReg.File != RC_FILE_OUTPUT || inst->DstReg.Index != c->OutputDepth) continue; @@ -65,27 +68,12 @@ static void rc_rewrite_depth_out(struct radeon_compiler *cc, void *user) continue; } - switch (inst->Opcode) { - case RC_OPCODE_FRC: - case RC_OPCODE_MOV: - inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); - break; - case RC_OPCODE_ADD: - case RC_OPCODE_MAX: - case RC_OPCODE_MIN: - case RC_OPCODE_MUL: - inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); - inst->SrcReg[1] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[1]); - break; - case RC_OPCODE_CMP: - case RC_OPCODE_MAD: - inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); - inst->SrcReg[1] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[1]); - inst->SrcReg[2] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[2]); - break; - default: - // Scalar instructions needn't be reswizzled - break; + if (!info->IsComponentwise) { + continue; + } + + for (i = 0; i < info->NumSrcRegs; i++) { + inst->SrcReg[i] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[i]); } } } @@ -93,7 +81,6 @@ static void rc_rewrite_depth_out(struct radeon_compiler *cc, void *user) void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) { int is_r500 = c->Base.is_r500; - int kill_consts = c->Base.remove_unused_constants; int opt = !c->Base.disable_optimizations; /* Lists of instruction transformations. */ @@ -133,7 +120,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) {"emulate loops", 1, !is_r500, rc_emulate_loops, NULL}, {"dataflow optimize", 1, opt, rc_optimize, NULL}, {"dataflow swizzles", 1, 1, rc_dataflow_swizzles, NULL}, - {"dead constants", 1, kill_consts, rc_remove_unused_constants, &c->code->constants_remap_table}, + {"dead constants", 1, 1, rc_remove_unused_constants, &c->code->constants_remap_table}, /* This pass makes it easier for the scheduler to group TEX * instructions and reduces the chances of creating too * many texture indirections.*/ @@ -150,9 +137,10 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) {NULL, 0, 0, NULL, NULL} }; + c->Base.type = RC_FRAGMENT_PROGRAM; c->Base.SwizzleCaps = c->Base.is_r500 ? &r500_swizzle_caps : &r300_swizzle_caps; - rc_run_compiler(&c->Base, fs_list, "Fragment Program"); + rc_run_compiler(&c->Base, fs_list); rc_constants_copy(&c->code->constants, &c->Base.Program.Constants); } diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index bf8341f..472029f 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -26,6 +26,7 @@ #include "../r300_reg.h" +#include "radeon_compiler_util.h" #include "radeon_dataflow.h" #include "radeon_program_alu.h" #include "radeon_swizzle.h" @@ -790,19 +791,14 @@ static void allocate_temporary_registers(struct radeon_compiler *c, void *user) if (!hwtemps[j]) break; } - if (j >= c->max_temp_regs) { - rc_error(c, "Too many temporaries\n"); - return; + ta[orig].Allocated = 1; + if (last_inst_src_reladdr && + last_inst_src_reladdr->IP > inst->IP) { + ta[orig].HwTemp = orig; } else { - ta[orig].Allocated = 1; - if (last_inst_src_reladdr && - last_inst_src_reladdr->IP > inst->IP) { - ta[orig].HwTemp = orig; - } else { - ta[orig].HwTemp = j; - } - hwtemps[ta[orig].HwTemp] = 1; + ta[orig].HwTemp = j; } + hwtemps[ta[orig].HwTemp] = 1; } inst->U.I.DstReg.Index = ta[orig].HwTemp; @@ -1018,7 +1014,6 @@ static struct rc_swizzle_caps r300_vertprog_swizzle_caps = { void r3xx_compile_vertex_program(struct r300_vertex_program_compiler *c) { int is_r500 = c->Base.is_r500; - int kill_consts = c->Base.remove_unused_constants; int opt = !c->Base.disable_optimizations; /* Lists of instruction transformations. */ @@ -1062,18 +1057,18 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler *c) {"dataflow optimize", 1, opt, rc_optimize, NULL}, /* This pass must be done after optimizations. */ {"source conflict resolve", 1, 1, rc_local_transform, resolve_src_conflicts}, - {"dataflow swizzles", 1, 1, rc_dataflow_swizzles, NULL}, {"register allocation", 1, opt, allocate_temporary_registers, NULL}, - {"dead constants", 1, kill_consts, rc_remove_unused_constants, &c->code->constants_remap_table}, + {"dead constants", 1, 1, rc_remove_unused_constants, &c->code->constants_remap_table}, {"final code validation", 0, 1, rc_validate_final_shader, NULL}, {"machine code generation", 0, 1, translate_vertex_program, NULL}, {"dump machine code", 0, c->Base.Debug & RC_DBG_LOG, r300_vertex_program_dump, NULL}, {NULL, 0, 0, NULL, NULL} }; + c->Base.type = RC_VERTEX_PROGRAM; c->Base.SwizzleCaps = &r300_vertprog_swizzle_caps; - rc_run_compiler(&c->Base, vs_list, "Vertex Program"); + rc_run_compiler(&c->Base, vs_list); c->code->InputsRead = c->Base.Program.InputsRead; c->code->OutputsWritten = c->Base.Program.OutputsWritten; diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 289bb87..ef81be4 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -29,6 +29,7 @@ #include <stdio.h> +#include "radeon_compiler_util.h" #include "../r300_reg.h" /** diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c index 4286bae..6554860 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c @@ -29,6 +29,7 @@ #include "radeon_dataflow.h" #include "radeon_program.h" #include "radeon_program_pair.h" +#include "radeon_compiler_util.h" void rc_init(struct radeon_compiler * c) @@ -356,66 +357,92 @@ void rc_transform_fragment_face(struct radeon_compiler *c, unsigned face) static void reg_count_callback(void * userdata, struct rc_instruction * inst, rc_register_file file, unsigned int index, unsigned int mask) { - unsigned int * max_reg = userdata; + int *max_reg = userdata; if (file == RC_FILE_TEMPORARY) - index > *max_reg ? *max_reg = index : 0; + (int)index > *max_reg ? *max_reg = index : 0; } -static void print_stats(struct radeon_compiler * c) +void rc_get_stats(struct radeon_compiler *c, struct rc_program_stats *s) { + int max_reg = -1; struct rc_instruction * tmp; - unsigned max_reg, insts, fc, tex, alpha, rgb, presub; - max_reg = insts = fc = tex = alpha = rgb = presub = 0; + memset(s, 0, sizeof(*s)); + for(tmp = c->Program.Instructions.Next; tmp != &c->Program.Instructions; tmp = tmp->Next){ const struct rc_opcode_info * info; rc_for_all_reads_mask(tmp, reg_count_callback, &max_reg); if (tmp->Type == RC_INSTRUCTION_NORMAL) { if (tmp->U.I.PreSub.Opcode != RC_PRESUB_NONE) - presub++; + s->num_presub_ops++; info = rc_get_opcode_info(tmp->U.I.Opcode); } else { if (tmp->U.P.RGB.Src[RC_PAIR_PRESUB_SRC].Used) - presub++; + s->num_presub_ops++; if (tmp->U.P.Alpha.Src[RC_PAIR_PRESUB_SRC].Used) - presub++; + s->num_presub_ops++; /* Assuming alpha will never be a flow control or * a tex instruction. */ if (tmp->U.P.Alpha.Opcode != RC_OPCODE_NOP) - alpha++; + s->num_alpha_insts++; if (tmp->U.P.RGB.Opcode != RC_OPCODE_NOP) - rgb++; + s->num_rgb_insts++; info = rc_get_opcode_info(tmp->U.P.RGB.Opcode); } if (info->IsFlowControl) - fc++; + s->num_fc_insts++; if (info->HasTexture) - tex++; - insts++; + s->num_tex_insts++; + s->num_insts++; } - if (insts < 4) - return; - fprintf(stderr,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" - "~%4u Instructions\n" - "~%4u Vector Instructions (RGB)\n" - "~%4u Scalar Instructions (Alpha)\n" - "~%4u Flow Control Instructions\n" - "~%4u Texture Instructions\n" - "~%4u Presub Operations\n" - "~%4u Temporary Registers\n" - "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", - insts, rgb, alpha, fc, tex, presub, max_reg + 1); + s->num_temp_regs = max_reg + 1; } -/* Executes a list of compiler passes given in the parameter 'list'. */ -void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list, - const char *shader_name) +static void print_stats(struct radeon_compiler * c) { - if (c->Debug & RC_DBG_LOG) { - fprintf(stderr, "%s: before compilation\n", shader_name); - rc_print_program(&c->Program); + struct rc_program_stats s; + + rc_get_stats(c, &s); + + if (s.num_insts < 4) + return; + + switch (c->type) { + case RC_VERTEX_PROGRAM: + fprintf(stderr,"~~~~~~~~~ VERTEX PROGRAM ~~~~~~~~\n" + "~%4u Instructions\n" + "~%4u Flow Control Instructions\n" + "~%4u Temporary Registers\n" + "~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~\n", + s.num_insts, s.num_fc_insts, s.num_temp_regs); + break; + + case RC_FRAGMENT_PROGRAM: + fprintf(stderr,"~~~~~~~~ FRAGMENT PROGRAM ~~~~~~~\n" + "~%4u Instructions\n" + "~%4u Vector Instructions (RGB)\n" + "~%4u Scalar Instructions (Alpha)\n" + "~%4u Flow Control Instructions\n" + "~%4u Texture Instructions\n" + "~%4u Presub Operations\n" + "~%4u Temporary Registers\n" + "~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~\n", + s.num_insts, s.num_rgb_insts, s.num_alpha_insts, + s.num_fc_insts, s.num_tex_insts, s.num_presub_ops, + s.num_temp_regs); + break; + default: + assert(0); } +} +static const char *shader_name[RC_NUM_PROGRAM_TYPES] = { + "Vertex Program", + "Fragment Program" +}; + +void rc_run_compiler_passes(struct radeon_compiler *c, struct radeon_compiler_pass *list) +{ for (unsigned i = 0; list[i].name; i++) { if (list[i].predicate) { list[i].run(c, list[i].user); @@ -424,11 +451,23 @@ void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *lis return; if ((c->Debug & RC_DBG_LOG) && list[i].dump) { - fprintf(stderr, "%s: after '%s'\n", shader_name, list[i].name); + fprintf(stderr, "%s: after '%s'\n", shader_name[c->type], list[i].name); rc_print_program(&c->Program); } } } +} + +/* Executes a list of compiler passes given in the parameter 'list'. */ +void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list) +{ + if (c->Debug & RC_DBG_LOG) { + fprintf(stderr, "%s: before compilation\n", shader_name[c->type]); + rc_print_program(&c->Program); + } + + rc_run_compiler_passes(c, list); + if (c->Debug & RC_DBG_STATS) print_stats(c); } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index 31fd469..e663339 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h @@ -35,9 +35,16 @@ struct rc_swizzle_caps; +enum rc_program_type { + RC_VERTEX_PROGRAM, + RC_FRAGMENT_PROGRAM, + RC_NUM_PROGRAM_TYPES +}; + struct radeon_compiler { struct memory_pool Pool; struct rc_program Program; + enum rc_program_type type; unsigned Debug:2; unsigned Error:1; char * ErrorMsg; @@ -140,9 +147,21 @@ struct radeon_compiler_pass { void *user; /* Optional parameter which is passed to the run function. */ }; +struct rc_program_stats { + unsigned num_insts; + unsigned num_fc_insts; + unsigned num_tex_insts; + unsigned num_rgb_insts; + unsigned num_alpha_insts; + unsigned num_presub_ops; + unsigned num_temp_regs; +}; + +void rc_get_stats(struct radeon_compiler *c, struct rc_program_stats *s); + /* Executes a list of compiler passes given in the parameter 'list'. */ -void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list, - const char *shader_name); +void rc_run_compiler_passes(struct radeon_compiler *c, struct radeon_compiler_pass *list); +void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list); void rc_validate_final_shader(struct radeon_compiler *c, void *user); #endif /* RADEON_COMPILER_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c index 2b8d284..2482fc6 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c @@ -48,6 +48,91 @@ unsigned int rc_swizzle_to_writemask(unsigned int swz) return mask; } +rc_swizzle get_swz(unsigned int swz, rc_swizzle idx) +{ + if (idx & 0x4) + return idx; + return GET_SWZ(swz, idx); +} + +unsigned int combine_swizzles4(unsigned int src, + rc_swizzle swz_x, rc_swizzle swz_y, rc_swizzle swz_z, rc_swizzle swz_w) +{ + unsigned int ret = 0; + + ret |= get_swz(src, swz_x); + ret |= get_swz(src, swz_y) << 3; + ret |= get_swz(src, swz_z) << 6; + ret |= get_swz(src, swz_w) << 9; + + return ret; +} + +unsigned int combine_swizzles(unsigned int src, unsigned int swz) +{ + unsigned int ret = 0; + + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_X)); + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Y)) << 3; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Z)) << 6; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_W)) << 9; + + return ret; +} + +/** + * @param mask Must be either RC_MASK_X, RC_MASK_Y, RC_MASK_Z, or RC_MASK_W + */ +rc_swizzle rc_mask_to_swizzle(unsigned int mask) +{ + switch (mask) { + case RC_MASK_X: return RC_SWIZZLE_X; + case RC_MASK_Y: return RC_SWIZZLE_Y; + case RC_MASK_Z: return RC_SWIZZLE_Z; + case RC_MASK_W: return RC_SWIZZLE_W; + } + return RC_SWIZZLE_UNUSED; +} + +/* Reorder mask bits according to swizzle. */ +unsigned swizzle_mask(unsigned swizzle, unsigned mask) +{ + unsigned ret = 0; + for (unsigned chan = 0; chan < 4; ++chan) { + unsigned swz = GET_SWZ(swizzle, chan); + if (swz < 4) + ret |= GET_BIT(mask, swz) << chan; + } + return ret; +} + +/** + * Left multiplication of a register with a swizzle + */ +struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg) +{ + struct rc_src_register tmp = srcreg; + int i; + tmp.Swizzle = 0; + tmp.Negate = 0; + for(i = 0; i < 4; ++i) { + rc_swizzle swz = GET_SWZ(swizzle, i); + if (swz < 4) { + tmp.Swizzle |= GET_SWZ(srcreg.Swizzle, swz) << (i*3); + tmp.Negate |= GET_BIT(srcreg.Negate, swz) << i; + } else { + tmp.Swizzle |= swz << (i*3); + } + } + return tmp; +} + +void reset_srcreg(struct rc_src_register* reg) +{ + memset(reg, 0, sizeof(struct rc_src_register)); + reg->Swizzle = RC_SWIZZLE_XYZW; +} + unsigned int rc_src_reads_dst_mask( rc_register_file src_file, unsigned int src_idx, @@ -138,7 +223,6 @@ unsigned int rc_inst_can_use_presub( { struct can_use_presub_data d; unsigned int num_presub_srcs; - unsigned int presub_src_type = rc_source_type_mask(presub_writemask); const struct rc_opcode_info * info = rc_get_opcode_info(inst->U.I.Opcode); @@ -168,13 +252,7 @@ unsigned int rc_inst_can_use_presub( num_presub_srcs = rc_presubtract_src_reg_count(presub_op); - if ((presub_src_type & RC_SOURCE_RGB) - && d.RGBCount + num_presub_srcs > 3) { - return 0; - } - - if ((presub_src_type & RC_SOURCE_ALPHA) - && d.AlphaCount + num_presub_srcs > 3) { + if (d.RGBCount + num_presub_srcs > 3 || d.AlphaCount + num_presub_srcs > 3) { return 0; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h index e50dfbd..461ab9f 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h @@ -8,6 +8,22 @@ struct rc_src_register; unsigned int rc_swizzle_to_writemask(unsigned int swz); +rc_swizzle get_swz(unsigned int swz, rc_swizzle idx); + +unsigned int combine_swizzles4(unsigned int src, + rc_swizzle swz_x, rc_swizzle swz_y, + rc_swizzle swz_z, rc_swizzle swz_w); + +unsigned int combine_swizzles(unsigned int src, unsigned int swz); + +rc_swizzle rc_mask_to_swizzle(unsigned int mask); + +unsigned swizzle_mask(unsigned swizzle, unsigned mask); + +struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg); + +void reset_srcreg(struct rc_src_register* reg); + unsigned int rc_src_reads_dst_mask( rc_register_file src_file, unsigned int src_idx, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c index a0f7bd8..133a9f7 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c @@ -56,6 +56,7 @@ static void rewrite_source(struct radeon_compiler * c, mov->U.I.DstReg.Index = tempreg; mov->U.I.DstReg.WriteMask = split.Phase[phase]; mov->U.I.SrcReg[0] = inst->U.I.SrcReg[src]; + mov->U.I.PreSub = inst->U.I.PreSub; phase_refmask = 0; for(unsigned int chan = 0; chan < 4; ++chan) { diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c index da495a3..25afd27 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c @@ -67,6 +67,13 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .IsComponentwise = 1 }, { + .Opcode = RC_OPCODE_CLAMP, + .Name = "CLAMP", + .NumSrcRegs = 3, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { .Opcode = RC_OPCODE_CMP, .Name = "CMP", .NumSrcRegs = 3, @@ -453,6 +460,7 @@ void rc_compute_sources_for_writemask( srcmasks[1] |= RC_MASK_XY; break; case RC_OPCODE_DP3: + case RC_OPCODE_XPD: srcmasks[0] |= RC_MASK_XYZ; srcmasks[1] |= RC_MASK_XYZ; break; @@ -460,6 +468,10 @@ void rc_compute_sources_for_writemask( srcmasks[0] |= RC_MASK_XYZW; srcmasks[1] |= RC_MASK_XYZW; break; + case RC_OPCODE_DPH: + srcmasks[0] |= RC_MASK_XYZ; + srcmasks[1] |= RC_MASK_XYZW; + break; case RC_OPCODE_TXB: case RC_OPCODE_TXP: srcmasks[0] |= RC_MASK_W; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h index d3f639c..7e66610 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -50,6 +50,9 @@ typedef enum { /** vec4 instruction: dst.c = ceil(src0.c) */ RC_OPCODE_CEIL, + /** vec4 instruction: dst.c = clamp(src0.c, src1.c, src2.c) */ + RC_OPCODE_CLAMP, + /** vec4 instruction: dst.c = src0.c < 0.0 ? src1.c : src2.c */ RC_OPCODE_CMP, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c index 27b10ff..44f4c0f 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c @@ -54,12 +54,7 @@ static struct rc_src_register chain_srcregs(struct rc_src_register outer, struct combine.Negate = outer.Negate; } else { combine.Abs = inner.Abs; - combine.Negate = 0; - for(unsigned int chan = 0; chan < 4; ++chan) { - unsigned int swz = GET_SWZ(outer.Swizzle, chan); - if (swz < 4) - combine.Negate |= GET_BIT(inner.Negate, swz) << chan; - } + combine.Negate = swizzle_mask(outer.Swizzle, inner.Negate); combine.Negate ^= outer.Negate; } combine.Swizzle = combine_swizzles(inner.Swizzle, outer.Swizzle); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c index 3f880c8..d53181e 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c @@ -217,9 +217,9 @@ static void compute_live_intervals(struct radeon_compiler *c, * instruction is used as the end of the live interval and * the BGNLOOP instruction is used as the beginning. */ if (inst->U.I.Opcode == RC_OPCODE_BGNLOOP && s->EndLoop < 0) { - s->BeginLoop = inst->IP; int loops = 1; struct rc_instruction * tmp; + s->BeginLoop = inst->IP; for(tmp = inst->Next; tmp != &s->C->Program.Instructions; tmp = tmp->Next) { diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c index cbb5ef6..9beb5d6 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -701,7 +701,7 @@ static int convert_rgb_to_alpha( get_reg_valuep(s, RC_FILE_TEMPORARY, pair_inst->RGB.DestIndex, - rc_mask_to_swz(old_mask)); + rc_mask_to_swizzle(old_mask)); new_index = i; *new_regvalp = *old_regvalp; *old_regvalp = NULL; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index d7bedc5..fe5756e 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -71,27 +71,6 @@ void rc_local_transform( } } -/** - * Left multiplication of a register with a swizzle - */ -struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg) -{ - struct rc_src_register tmp = srcreg; - int i; - tmp.Swizzle = 0; - tmp.Negate = 0; - for(i = 0; i < 4; ++i) { - rc_swizzle swz = GET_SWZ(swizzle, i); - if (swz < 4) { - tmp.Swizzle |= GET_SWZ(srcreg.Swizzle, swz) << (i*3); - tmp.Negate |= GET_BIT(srcreg.Negate, swz) << i; - } else { - tmp.Swizzle |= swz << (i*3); - } - } - return tmp; -} - struct get_used_temporaries_data { unsigned char * Used; unsigned int UsedLength; @@ -244,14 +223,3 @@ unsigned int rc_recompute_ips(struct radeon_compiler * c) return ip; } - -rc_swizzle rc_mask_to_swizzle(unsigned int mask) -{ - switch(mask) { - case RC_MASK_X: return RC_SWIZZLE_X; - case RC_MASK_Y: return RC_SWIZZLE_Y; - case RC_MASK_Z: return RC_SWIZZLE_Z; - case RC_MASK_W: return RC_SWIZZLE_W; - default: return RC_SWIZZLE_UNUSED; - } -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index be078b4..df6c94b 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -159,61 +159,6 @@ struct rc_program { struct rc_constant_list Constants; }; -static inline rc_swizzle get_swz(unsigned int swz, rc_swizzle idx) -{ - if (idx & 0x4) - return idx; - return GET_SWZ(swz, idx); -} - -static inline unsigned int combine_swizzles4(unsigned int src, - rc_swizzle swz_x, rc_swizzle swz_y, rc_swizzle swz_z, rc_swizzle swz_w) -{ - unsigned int ret = 0; - - ret |= get_swz(src, swz_x); - ret |= get_swz(src, swz_y) << 3; - ret |= get_swz(src, swz_z) << 6; - ret |= get_swz(src, swz_w) << 9; - - return ret; -} - -static inline unsigned int combine_swizzles(unsigned int src, unsigned int swz) -{ - unsigned int ret = 0; - - ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_X)); - ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Y)) << 3; - ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Z)) << 6; - ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_W)) << 9; - - return ret; -} - -/** - * @param mask Must be either RC_MASK_X, RC_MASK_Y, RC_MASK_Z, or RC_MASK_W - */ -static inline rc_swizzle rc_mask_to_swz(unsigned int mask) -{ - switch (mask) { - case RC_MASK_X: return RC_SWIZZLE_X; - case RC_MASK_Y: return RC_SWIZZLE_Y; - case RC_MASK_Z: return RC_SWIZZLE_Z; - case RC_MASK_W: return RC_SWIZZLE_W; - default: assert(0); - } - return RC_SWIZZLE_UNUSED; -} -struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg); - -static inline void reset_srcreg(struct rc_src_register* reg) -{ - memset(reg, 0, sizeof(struct rc_src_register)); - reg->Swizzle = RC_SWIZZLE_XYZW; -} - - /** * A transformation that can be passed to \ref rc_local_transform. * diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c index 3940884..c806317 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -36,6 +36,7 @@ #include "radeon_program_alu.h" #include "radeon_compiler.h" +#include "radeon_compiler_util.h" static struct rc_instruction *emit1( @@ -84,16 +85,6 @@ static struct rc_instruction *emit3( return fpi; } -static struct rc_dst_register dstreg(int file, int index) -{ - struct rc_dst_register dst; - dst.File = file; - dst.Index = index; - dst.WriteMask = RC_MASK_XYZW; - dst.RelAddr = 0; - return dst; -} - static struct rc_dst_register dstregtmpmask(int index, int mask) { struct rc_dst_register dst = {0}; @@ -186,6 +177,38 @@ static struct rc_src_register swizzle_wwww(struct rc_src_register reg) return swizzle_smear(reg, RC_SWIZZLE_W); } +static int is_dst_safe_to_reuse(struct rc_instruction *inst) +{ + const struct rc_opcode_info *info = rc_get_opcode_info(inst->U.I.Opcode); + unsigned i; + + assert(info->HasDstReg); + + if (inst->U.I.DstReg.File != RC_FILE_TEMPORARY) + return 0; + + for (i = 0; i < info->NumSrcRegs; i++) { + if (inst->U.I.SrcReg[i].File == RC_FILE_TEMPORARY && + inst->U.I.SrcReg[i].Index == inst->U.I.DstReg.Index) + return 0; + } + + return 1; +} + +static struct rc_dst_register try_to_reuse_dst(struct radeon_compiler *c, + struct rc_instruction *inst) +{ + unsigned tmp; + + if (is_dst_safe_to_reuse(inst)) + tmp = inst->U.I.DstReg.Index; + else + tmp = rc_find_free_temporary(c); + + return dstregtmpmask(tmp, inst->U.I.DstReg.WriteMask); +} + static void transform_ABS(struct radeon_compiler* c, struct rc_instruction* inst) { @@ -209,10 +232,26 @@ static void transform_CEIL(struct radeon_compiler* c, * ceil(x) = x+frac(-x) */ - int tempreg = rc_find_free_temporary(c); - emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstreg(RC_FILE_TEMPORARY, tempreg), negate(inst->U.I.SrcReg[0])); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dst, negate(inst->U.I.SrcReg[0])); emit2(c, inst->Prev, RC_OPCODE_ADD, inst->U.I.SaturateMode, inst->U.I.DstReg, - inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, tempreg)); + inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, dst.Index)); + rc_remove_instruction(inst); +} + +static void transform_CLAMP(struct radeon_compiler *c, + struct rc_instruction *inst) +{ + /* CLAMP dst, src, min, max + * into: + * MIN tmp, src, max + * MAX dst, tmp, min + */ + struct rc_dst_register dst = try_to_reuse_dst(c, inst); + emit2(c, inst->Prev, RC_OPCODE_MIN, 0, dst, + inst->U.I.SrcReg[0], inst->U.I.SrcReg[2]); + emit2(c, inst->Prev, RC_OPCODE_MAX, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, dst.Index), inst->U.I.SrcReg[1]); rc_remove_instruction(inst); } @@ -258,10 +297,10 @@ static void transform_DST(struct radeon_compiler* c, static void transform_FLR(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); - emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0]); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dst, inst->U.I.SrcReg[0]); emit2(c, inst->Prev, RC_OPCODE_ADD, inst->U.I.SaturateMode, inst->U.I.DstReg, - inst->U.I.SrcReg[0], negate(srcreg(RC_FILE_TEMPORARY, tempreg))); + inst->U.I.SrcReg[0], negate(srcreg(RC_FILE_TEMPORARY, dst.Index))); rc_remove_instruction(inst); } @@ -351,14 +390,14 @@ static void transform_LIT(struct radeon_compiler* c, static void transform_LRP(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); emit2(c, inst->Prev, RC_OPCODE_ADD, 0, - dstreg(RC_FILE_TEMPORARY, tempreg), + dst, inst->U.I.SrcReg[1], negate(inst->U.I.SrcReg[2])); emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode, inst->U.I.DstReg, - inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[2]); + inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, dst.Index), inst->U.I.SrcReg[2]); rc_remove_instruction(inst); } @@ -366,9 +405,8 @@ static void transform_LRP(struct radeon_compiler* c, static void transform_POW(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); - struct rc_dst_register tempdst = dstreg(RC_FILE_TEMPORARY, tempreg); - struct rc_src_register tempsrc = srcreg(RC_FILE_TEMPORARY, tempreg); + struct rc_dst_register tempdst = try_to_reuse_dst(c, inst); + struct rc_src_register tempsrc = srcreg(RC_FILE_TEMPORARY, tempdst.Index); tempdst.WriteMask = RC_MASK_W; tempsrc.Swizzle = RC_SWIZZLE_WWWW; @@ -388,11 +426,11 @@ static void transform_RSQ(struct radeon_compiler* c, static void transform_SEQ(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, - negate(absolute(srcreg(RC_FILE_TEMPORARY, tempreg))), builtin_zero, builtin_one); + negate(absolute(srcreg(RC_FILE_TEMPORARY, dst.Index))), builtin_zero, builtin_one); rc_remove_instruction(inst); } @@ -407,11 +445,11 @@ static void transform_SFL(struct radeon_compiler* c, static void transform_SGE(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, - srcreg(RC_FILE_TEMPORARY, tempreg), builtin_zero, builtin_one); + srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_zero, builtin_one); rc_remove_instruction(inst); } @@ -419,11 +457,11 @@ static void transform_SGE(struct radeon_compiler* c, static void transform_SGT(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, - srcreg(RC_FILE_TEMPORARY, tempreg), builtin_one, builtin_zero); + srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_one, builtin_zero); rc_remove_instruction(inst); } @@ -431,11 +469,11 @@ static void transform_SGT(struct radeon_compiler* c, static void transform_SLE(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, - srcreg(RC_FILE_TEMPORARY, tempreg), builtin_zero, builtin_one); + srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_zero, builtin_one); rc_remove_instruction(inst); } @@ -443,11 +481,11 @@ static void transform_SLE(struct radeon_compiler* c, static void transform_SLT(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, - srcreg(RC_FILE_TEMPORARY, tempreg), builtin_one, builtin_zero); + srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_one, builtin_zero); rc_remove_instruction(inst); } @@ -455,11 +493,11 @@ static void transform_SLT(struct radeon_compiler* c, static void transform_SNE(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, - negate(absolute(srcreg(RC_FILE_TEMPORARY, tempreg))), builtin_one, builtin_zero); + negate(absolute(srcreg(RC_FILE_TEMPORARY, dst.Index))), builtin_one, builtin_zero); rc_remove_instruction(inst); } @@ -473,12 +511,13 @@ static void transform_SSG(struct radeon_compiler* c, * CMP tmp1, x, 1, 0 * ADD result, tmp0, -tmp1; */ - unsigned tmp0, tmp1; + struct rc_dst_register dst0; + unsigned tmp1; /* 0 < x */ - tmp0 = rc_find_free_temporary(c); + dst0 = try_to_reuse_dst(c, inst); emit3(c, inst->Prev, RC_OPCODE_CMP, 0, - dstregtmpmask(tmp0, inst->U.I.DstReg.WriteMask), + dst0, negate(inst->U.I.SrcReg[0]), builtin_one, builtin_zero); @@ -495,7 +534,7 @@ static void transform_SSG(struct radeon_compiler* c, /* result = tmp0 - tmp1 */ emit2(c, inst->Prev, RC_OPCODE_ADD, 0, inst->U.I.DstReg, - srcreg(RC_FILE_TEMPORARY, tmp0), + srcreg(RC_FILE_TEMPORARY, dst0.Index), negate(srcreg(RC_FILE_TEMPORARY, tmp1))); rc_remove_instruction(inst); @@ -517,15 +556,15 @@ static void transform_SWZ(struct radeon_compiler* c, static void transform_XPD(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); - emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstreg(RC_FILE_TEMPORARY, tempreg), + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dst, swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W)); emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode, inst->U.I.DstReg, swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W), swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), - negate(srcreg(RC_FILE_TEMPORARY, tempreg))); + negate(srcreg(RC_FILE_TEMPORARY, dst.Index))); rc_remove_instruction(inst); } @@ -553,6 +592,7 @@ int radeonTransformALU( switch(inst->U.I.Opcode) { case RC_OPCODE_ABS: transform_ABS(c, inst); return 1; case RC_OPCODE_CEIL: transform_CEIL(c, inst); return 1; + case RC_OPCODE_CLAMP: transform_CLAMP(c, inst); return 1; case RC_OPCODE_DP2: transform_DP2(c, inst); return 1; case RC_OPCODE_DPH: transform_DPH(c, inst); return 1; case RC_OPCODE_DST: transform_DST(c, inst); return 1; @@ -592,7 +632,7 @@ static void transform_r300_vertex_CMP(struct radeon_compiler* c, { /* There is no decent CMP available, so let's rig one up. * CMP is defined as dst = src0 < 0.0 ? src1 : src2 - * The following sequence consumes two temps and two extra slots + * The following sequence consumes zero to two temps and two extra slots * (the second temp and the second slot is consumed by transform_LRP), * but should be equivalent: * @@ -600,18 +640,18 @@ static void transform_r300_vertex_CMP(struct radeon_compiler* c, * LRP dst, tmp0, src1, src2 * * Yes, I know, I'm a mad scientist. ~ C. & M. */ - int tempreg0 = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); /* SLT tmp0, src0, 0.0 */ emit2(c, inst->Prev, RC_OPCODE_SLT, 0, - dstreg(RC_FILE_TEMPORARY, tempreg0), + dst, inst->U.I.SrcReg[0], builtin_zero); /* LRP dst, tmp0, src1, src2 */ transform_LRP(c, emit3(c, inst->Prev, RC_OPCODE_LRP, 0, inst->U.I.DstReg, - srcreg(RC_FILE_TEMPORARY, tempreg0), inst->U.I.SrcReg[1], inst->U.I.SrcReg[2])); + srcreg(RC_FILE_TEMPORARY, dst.Index), inst->U.I.SrcReg[1], inst->U.I.SrcReg[2])); rc_remove_instruction(inst); } @@ -642,24 +682,25 @@ static void transform_r300_vertex_DP3(struct radeon_compiler* c, static void transform_r300_vertex_fix_LIT(struct radeon_compiler* c, struct rc_instruction* inst) { - int tempreg = rc_find_free_temporary(c); + struct rc_dst_register dst = try_to_reuse_dst(c, inst); unsigned constant_swizzle; int constant = rc_constants_add_immediate_scalar(&c->Program.Constants, 0.0000000000000000001, &constant_swizzle); /* MOV dst, src */ + dst.WriteMask = RC_MASK_XYZW; emit1(c, inst->Prev, RC_OPCODE_MOV, 0, - dstreg(RC_FILE_TEMPORARY, tempreg), + dst, inst->U.I.SrcReg[0]); - /* MAX dst.z, src, 0.00...001 */ + /* MAX dst.y, src, 0.00...001 */ emit2(c, inst->Prev, RC_OPCODE_MAX, 0, - dstregtmpmask(tempreg, RC_MASK_Y), - srcreg(RC_FILE_TEMPORARY, tempreg), + dstregtmpmask(dst.Index, RC_MASK_Y), + srcreg(RC_FILE_TEMPORARY, dst.Index), srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle)); - inst->U.I.SrcReg[0] = srcreg(RC_FILE_TEMPORARY, tempreg); + inst->U.I.SrcReg[0] = srcreg(RC_FILE_TEMPORARY, dst.Index); } static void transform_r300_vertex_SEQ(struct radeon_compiler *c, @@ -743,12 +784,13 @@ static void transform_r300_vertex_SSG(struct radeon_compiler* c, * SLT tmp1, x, 0; * ADD result, tmp0, -tmp1; */ - unsigned tmp0, tmp1; + struct rc_dst_register dst0 = try_to_reuse_dst(c, inst); + unsigned tmp1; /* 0 < x */ - tmp0 = rc_find_free_temporary(c); + dst0 = try_to_reuse_dst(c, inst); emit2(c, inst->Prev, RC_OPCODE_SLT, 0, - dstregtmpmask(tmp0, inst->U.I.DstReg.WriteMask), + dst0, builtin_zero, inst->U.I.SrcReg[0]); @@ -763,7 +805,7 @@ static void transform_r300_vertex_SSG(struct radeon_compiler* c, /* result = tmp0 - tmp1 */ emit2(c, inst->Prev, RC_OPCODE_ADD, 0, inst->U.I.DstReg, - srcreg(RC_FILE_TEMPORARY, tmp0), + srcreg(RC_FILE_TEMPORARY, dst0.Index), negate(srcreg(RC_FILE_TEMPORARY, tmp1))); rc_remove_instruction(inst); @@ -781,6 +823,7 @@ int r300_transform_vertex_alu( switch(inst->U.I.Opcode) { case RC_OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return 1; case RC_OPCODE_CEIL: transform_CEIL(c, inst); return 1; + case RC_OPCODE_CLAMP: transform_CLAMP(c, inst); return 1; case RC_OPCODE_CMP: transform_r300_vertex_CMP(c, inst); return 1; case RC_OPCODE_DP2: transform_r300_vertex_DP2(c, inst); return 1; case RC_OPCODE_DP3: transform_r300_vertex_DP3(c, inst); return 1; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c index 530afa5..f9d9f34 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c @@ -28,6 +28,8 @@ #include "radeon_program_tex.h" +#include "radeon_compiler_util.h" + /* Series of transformations to be done on textures. */ static struct rc_src_register shadow_ambient(struct r300_fragment_program_compiler *compiler, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c index 5f67f53..7d76585 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c @@ -87,8 +87,9 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) rc_for_all_reads_src(inst, mark_used, &d); } - /* Pass 2: If there is relative addressing, mark all externals as used. */ - if (has_rel_addr) { + /* Pass 2: If there is relative addressing or dead constant elimination + * is disabled, mark all externals as used. */ + if (has_rel_addr || !c->remove_unused_constants) { for (unsigned i = 0; i < c->Program.Constants.Count; i++) if (constants[i].Type == RC_CONSTANT_EXTERNAL) const_used[i] = 1; @@ -119,7 +120,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) /* is_identity ==> new_count == old_count * !is_identity ==> new_count < old_count */ assert( is_identity || new_count < c->Program.Constants.Count); - assert(!(has_rel_addr && are_externals_remapped)); + assert(!((has_rel_addr || !c->remove_unused_constants) && are_externals_remapped)); /* Pass 4: Redirect reads of all constants to their new locations. */ if (!is_identity) { @@ -127,7 +128,6 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) inst != &c->Program.Instructions; inst = inst->Next) { rc_remap_registers(inst, remap_regs, inv_remap_table); } - } /* Set the new constant count. Note that new_count may be less than diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c index 88165f7..5bd19c0 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c @@ -51,6 +51,14 @@ void rc_rename_regs(struct radeon_compiler *c, void *user) struct rc_reader_data reader_data; unsigned char * used; + /* XXX Remove this once the register allocation works with flow control. */ + for(inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; + inst = inst->Next) { + if (inst->U.I.Opcode == RC_OPCODE_BGNLOOP) + return; + } + used_length = 2 * rc_recompute_ips(c); used = memory_pool_malloc(&c->Pool, sizeof(unsigned char) * used_length); memset(used, 0, sizeof(unsigned char) * used_length); diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index c288834..0d8bd4f 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -43,6 +43,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/extensions.h" #include "main/bufferobj.h" #include "main/texobj.h" +#include "main/mfeatures.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index de66293..f930b4d 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -38,6 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/enums.h" #include "main/image.h" +#include "main/mfeatures.h" #include "main/mipmap.h" #include "main/simple_list.h" #include "main/texstore.h" diff --git a/src/mesa/drivers/dri/r600/evergreen_blit.c b/src/mesa/drivers/dri/r600/evergreen_blit.c index fc9fa9d..e07da8c 100644 --- a/src/mesa/drivers/dri/r600/evergreen_blit.c +++ b/src/mesa/drivers/dri/r600/evergreen_blit.c @@ -1406,9 +1406,95 @@ eg_set_default_state(context_t *context) num_hs_stack_entries = 85; num_ls_stack_entries = 85; break; + case CHIP_FAMILY_PALM: + num_ps_gprs = 93; + num_vs_gprs = 46; + num_temp_gprs = 4; + num_gs_gprs = 31; + num_es_gprs = 31; + num_hs_gprs = 23; + num_ls_gprs = 23; + num_ps_threads = 96; + num_vs_threads = 16; + num_gs_threads = 16; + num_es_threads = 16; + num_hs_threads = 16; + num_ls_threads = 16; + num_ps_stack_entries = 42; + num_vs_stack_entries = 42; + num_gs_stack_entries = 42; + num_es_stack_entries = 42; + num_hs_stack_entries = 42; + num_ls_stack_entries = 42; + break; + case CHIP_FAMILY_BARTS: + num_ps_gprs = 93; + num_vs_gprs = 46; + num_temp_gprs = 4; + num_gs_gprs = 31; + num_es_gprs = 31; + num_hs_gprs = 23; + num_ls_gprs = 23; + num_ps_threads = 128; + num_vs_threads = 20; + num_gs_threads = 20; + num_es_threads = 20; + num_hs_threads = 20; + num_ls_threads = 20; + num_ps_stack_entries = 85; + num_vs_stack_entries = 85; + num_gs_stack_entries = 85; + num_es_stack_entries = 85; + num_hs_stack_entries = 85; + num_ls_stack_entries = 85; + break; + case CHIP_FAMILY_TURKS: + num_ps_gprs = 93; + num_vs_gprs = 46; + num_temp_gprs = 4; + num_gs_gprs = 31; + num_es_gprs = 31; + num_hs_gprs = 23; + num_ls_gprs = 23; + num_ps_threads = 128; + num_vs_threads = 20; + num_gs_threads = 20; + num_es_threads = 20; + num_hs_threads = 20; + num_ls_threads = 20; + num_ps_stack_entries = 42; + num_vs_stack_entries = 42; + num_gs_stack_entries = 42; + num_es_stack_entries = 42; + num_hs_stack_entries = 42; + num_ls_stack_entries = 42; + break; + case CHIP_FAMILY_CAICOS: + num_ps_gprs = 93; + num_vs_gprs = 46; + num_temp_gprs = 4; + num_gs_gprs = 31; + num_es_gprs = 31; + num_hs_gprs = 23; + num_ls_gprs = 23; + num_ps_threads = 128; + num_vs_threads = 10; + num_gs_threads = 10; + num_es_threads = 10; + num_hs_threads = 10; + num_ls_threads = 10; + num_ps_stack_entries = 42; + num_vs_stack_entries = 42; + num_gs_stack_entries = 42; + num_es_stack_entries = 42; + num_hs_stack_entries = 42; + num_ls_stack_entries = 42; + break; } - if (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_CEDAR) + if ((context->radeon.radeonScreen->chip_family == CHIP_FAMILY_CEDAR) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_PALM) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_CAICOS)) CLEARbit(sq_config, EG_SQ_CONFIG__VC_ENABLE_bit); else SETbit(sq_config, EG_SQ_CONFIG__VC_ENABLE_bit); diff --git a/src/mesa/drivers/dri/r600/evergreen_state.c b/src/mesa/drivers/dri/r600/evergreen_state.c index 076a608..648cda0 100644 --- a/src/mesa/drivers/dri/r600/evergreen_state.c +++ b/src/mesa/drivers/dri/r600/evergreen_state.c @@ -1469,6 +1469,30 @@ static void evergreenInitSQConfig(struct gl_context * ctx) uMaxThreads = 192; uMaxStackEntries = 256; break; + case CHIP_FAMILY_BARTS: + uSqNumCfInsts = 2; + bVC_ENABLE = GL_TRUE; + uMaxGPRs = 256; + uPSThreadCount = 128; + uMaxThreads = 248; + uMaxStackEntries = 512; + break; + case CHIP_FAMILY_TURKS: + uSqNumCfInsts = 2; + bVC_ENABLE = GL_TRUE; + uMaxGPRs = 256; + uPSThreadCount = 128; + uMaxThreads = 248; + uMaxStackEntries = 256; + break; + case CHIP_FAMILY_CAICOS: + uSqNumCfInsts = 1; + bVC_ENABLE = GL_FALSE; + uMaxGPRs = 256; + uPSThreadCount = 128; + uMaxThreads = 192; + uMaxStackEntries = 256; + break; default: uSqNumCfInsts = 2; bVC_ENABLE = GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 057d98e..00708be 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -44,6 +44,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/bufferobj.h" #include "main/texobj.h" #include "main/points.h" +#include "main/mfeatures.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -259,7 +260,7 @@ static void r600InitConstValues(struct gl_context *ctx, radeonScreenPtr screen) R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); if( (context->radeon.radeonScreen->chip_family >= CHIP_FAMILY_CEDAR) - &&(context->radeon.radeonScreen->chip_family <= CHIP_FAMILY_PALM) ) + &&(context->radeon.radeonScreen->chip_family <= CHIP_FAMILY_CAICOS) ) { r700->bShaderUseMemConstant = GL_TRUE; } @@ -285,8 +286,13 @@ static void r600InitConstValues(struct gl_context *ctx, radeonScreenPtr screen) ctx->Const.MaxTextureMaxAnisotropy = 16.0; ctx->Const.MaxTextureLodBias = 16.0; - ctx->Const.MaxTextureLevels = 13; /* hw support 14 */ - ctx->Const.MaxTextureRectSize = 4096; /* hw support 8192 */ + if (screen->chip_family >= CHIP_FAMILY_CEDAR) { + ctx->Const.MaxTextureLevels = 15; + ctx->Const.MaxTextureRectSize = 16384; + } else { + ctx->Const.MaxTextureLevels = 14; + ctx->Const.MaxTextureRectSize = 8192; + } ctx->Const.MinPointSize = 0x0001 / 8.0; ctx->Const.MinPointSizeAA = 0x0001 / 8.0; diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c index c3d68c4..2a99ded 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.c +++ b/src/mesa/drivers/dri/r600/r600_tex.c @@ -38,6 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/enums.h" #include "main/image.h" +#include "main/mfeatures.h" #include "main/mipmap.h" #include "main/simple_list.h" #include "main/texstore.h" diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 2bf2409..024853c 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -481,6 +481,8 @@ unsigned int EG_GetNumOperands(GLuint opcode, GLuint nIsOp3) case EG_OP2_INST_FLT_TO_INT: case EG_OP2_INST_SIN: case EG_OP2_INST_COS: + case EG_OP2_INST_FLT_TO_INT_FLOOR: + case EG_OP2_INST_MOVA_INT: return 1; default: radeon_error( @@ -1134,7 +1136,7 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, EG_VTX_WORD1__DST_SEL_W_shift, EG_VTX_WORD1__DST_SEL_W_mask); - SETfield(vfetch_instruction_ptr->m_Word1.val, 0, /* use format here, in r6/r7, format used set in const, need to use same */ + SETfield(vfetch_instruction_ptr->m_Word1.val, 1, EG_VTX_WORD1__UCF_shift, EG_VTX_WORD1__UCF_bit); SETfield(vfetch_instruction_ptr->m_Word1.val, data_format, @@ -3297,23 +3299,76 @@ GLboolean assemble_ARL(r700_AssemblerBase *pAsm) return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP2_INST_MOVA_FLOOR; - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = 0; - pAsm->D.dst.writex = 0; - pAsm->D.dst.writey = 0; - pAsm->D.dst.writez = 0; - pAsm->D.dst.writew = 0; - - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + if(8 == pAsm->unAsic) { - return GL_FALSE; - } + /* Evergreen */ - if( GL_FALSE == next_ins(pAsm) ) + /* Float to Signed Integer Using FLOOR */ + pAsm->D.dst.opcode = EG_OP2_INST_FLT_TO_INT_FLOOR; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = 0; + pAsm->D.dst.writex = 0; + pAsm->D.dst.writey = 0; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + /* Copy Signed Integer To Integer in AR and GPR */ + pAsm->D.dst.opcode = EG_OP2_INST_MOVA_INT; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = 0; + pAsm->D.dst.writex = 0; + pAsm->D.dst.writey = 0; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + } + else { - return GL_FALSE; + /* r6xx/r7xx */ + + /* Truncate floating-point to the nearest integer + in the range [-256, +255], and copy to AR and + to a GPR. + */ + pAsm->D.dst.opcode = SQ_OP2_INST_MOVA_FLOOR; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = 0; + pAsm->D.dst.writex = 0; + pAsm->D.dst.writey = 0; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } } return GL_TRUE; @@ -3334,7 +3389,14 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP3_INST_CNDGE; + if(8 == pAsm->unAsic) + { + pAsm->D.dst.opcode = EG_OP3_INST_CNDGE; + } + else + { + pAsm->D.dst.opcode = SQ_OP3_INST_CNDGE; + } pAsm->D.dst.op3 = 1; tmp = (-1); @@ -3416,8 +3478,14 @@ GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) checkop1(pAsm); tmp = gethelpr(pAsm); - - pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + if(8 == pAsm->unAsic) + { + pAsm->D.dst.opcode = EG_OP3_INST_MULADD; + } + else + { + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + } pAsm->D.dst.op3 = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -3457,7 +3525,14 @@ GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) { return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + if(8 == pAsm->unAsic) + { + pAsm->D.dst.opcode = EG_OP3_INST_MULADD; + } + else + { + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + } pAsm->D.dst.op3 = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -4742,7 +4817,14 @@ GLboolean assemble_SCS(r700_AssemblerBase *pAsm) tmp = gethelpr(pAsm); - pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + if(8 == pAsm->unAsic) + { + pAsm->D.dst.opcode = EG_OP3_INST_MULADD; + } + else + { + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + } pAsm->D.dst.op3 = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -4782,7 +4864,14 @@ GLboolean assemble_SCS(r700_AssemblerBase *pAsm) { return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + if(8 == pAsm->unAsic) + { + pAsm->D.dst.opcode = EG_OP3_INST_MULADD; + } + else + { + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + } pAsm->D.dst.op3 = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -5010,7 +5099,14 @@ GLboolean assemble_SSG(r700_AssemblerBase *pAsm) GLuint tmp = gethelpr(pAsm); /* tmp = (src > 0 ? 1 : src) */ - pAsm->D.dst.opcode = SQ_OP3_INST_CNDGT; + if(8 == pAsm->unAsic) + { + pAsm->D.dst.opcode = EG_OP3_INST_CNDGT; + } + else + { + pAsm->D.dst.opcode = SQ_OP3_INST_CNDGT; + } pAsm->D.dst.op3 = 1; pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp; @@ -5033,7 +5129,14 @@ GLboolean assemble_SSG(r700_AssemblerBase *pAsm) } /* dst = (-tmp > 0 ? -1 : tmp) */ - pAsm->D.dst.opcode = SQ_OP3_INST_CNDGT; + if(8 == pAsm->unAsic) + { + pAsm->D.dst.opcode = EG_OP3_INST_CNDGT; + } + else + { + pAsm->D.dst.opcode = SQ_OP3_INST_CNDGT; + } pAsm->D.dst.op3 = 1; if( GL_FALSE == assemble_dst(pAsm) ) diff --git a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h index 6c2648b..60f1049 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h +++ b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h @@ -67,6 +67,9 @@ struct drm_radeon_info { #define DRM_RADEON_INFO 0x1 #endif +static inline void radeon_gem_get_kernel_name(struct radeon_bo *dummy, uint32_t *value) +{ +} static inline uint32_t radeon_gem_name_bo(struct radeon_bo *dummy) { diff --git a/src/mesa/drivers/dri/radeon/radeon_chipset.h b/src/mesa/drivers/dri/radeon/radeon_chipset.h index 82789ce..399052c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_chipset.h +++ b/src/mesa/drivers/dri/radeon/radeon_chipset.h @@ -445,6 +445,45 @@ #define PCI_CHIP_PALM_9804 0x9804 #define PCI_CHIP_PALM_9805 0x9805 +#define PCI_CHIP_BARTS_6720 0x6720 +#define PCI_CHIP_BARTS_6721 0x6721 +#define PCI_CHIP_BARTS_6722 0x6722 +#define PCI_CHIP_BARTS_6723 0x6723 +#define PCI_CHIP_BARTS_6724 0x6724 +#define PCI_CHIP_BARTS_6725 0x6725 +#define PCI_CHIP_BARTS_6726 0x6726 +#define PCI_CHIP_BARTS_6727 0x6727 +#define PCI_CHIP_BARTS_6728 0x6728 +#define PCI_CHIP_BARTS_6729 0x6729 +#define PCI_CHIP_BARTS_6738 0x6738 +#define PCI_CHIP_BARTS_6739 0x6739 + +#define PCI_CHIP_TURKS_6740 0x6740 +#define PCI_CHIP_TURKS_6741 0x6741 +#define PCI_CHIP_TURKS_6742 0x6742 +#define PCI_CHIP_TURKS_6743 0x6743 +#define PCI_CHIP_TURKS_6744 0x6744 +#define PCI_CHIP_TURKS_6745 0x6745 +#define PCI_CHIP_TURKS_6746 0x6746 +#define PCI_CHIP_TURKS_6747 0x6747 +#define PCI_CHIP_TURKS_6748 0x6748 +#define PCI_CHIP_TURKS_6749 0x6749 +#define PCI_CHIP_TURKS_6750 0x6750 +#define PCI_CHIP_TURKS_6758 0x6758 +#define PCI_CHIP_TURKS_6759 0x6759 + +#define PCI_CHIP_CAICOS_6760 0x6760 +#define PCI_CHIP_CAICOS_6761 0x6761 +#define PCI_CHIP_CAICOS_6762 0x6762 +#define PCI_CHIP_CAICOS_6763 0x6763 +#define PCI_CHIP_CAICOS_6764 0x6764 +#define PCI_CHIP_CAICOS_6765 0x6765 +#define PCI_CHIP_CAICOS_6766 0x6766 +#define PCI_CHIP_CAICOS_6767 0x6767 +#define PCI_CHIP_CAICOS_6768 0x6768 +#define PCI_CHIP_CAICOS_6770 0x6770 +#define PCI_CHIP_CAICOS_6779 0x6779 + enum { CHIP_FAMILY_R100, CHIP_FAMILY_RV100, @@ -489,6 +528,9 @@ enum { CHIP_FAMILY_CYPRESS, CHIP_FAMILY_HEMLOCK, CHIP_FAMILY_PALM, + CHIP_FAMILY_BARTS, + CHIP_FAMILY_TURKS, + CHIP_FAMILY_CAICOS, CHIP_FAMILY_LAST }; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index ca6ab46..a112448 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -100,6 +100,9 @@ static const char* get_chip_family_name(int chip_family) case CHIP_FAMILY_CYPRESS: return "CYPRESS"; case CHIP_FAMILY_HEMLOCK: return "HEMLOCK"; case CHIP_FAMILY_PALM: return "PALM"; + case CHIP_FAMILY_BARTS: return "BARTS"; + case CHIP_FAMILY_TURKS: return "TURKS"; + case CHIP_FAMILY_CAICOS: return "CAICOS"; default: return "unknown"; } } diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index e3de534..154a881 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/simple_list.h" #include "main/imports.h" #include "main/extensions.h" +#include "main/mfeatures.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index a36a1dc..6656d39 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -28,6 +28,7 @@ #include "main/imports.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/enums.h" #include "main/fbobject.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index 088f970..a68a976 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -49,7 +49,7 @@ struct _radeon_mipmap_level { }; /* store the max possible in the miptree */ -#define RADEON_MIPTREE_MAX_TEXTURE_LEVELS 13 +#define RADEON_MIPTREE_MAX_TEXTURE_LEVELS 15 /** * A mipmap tree contains texture images in the layout that the hardware diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 94e56c2..a35fcfe 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -1163,6 +1163,54 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id) screen->chip_flags = RADEON_CHIPSET_TCL; break; + case PCI_CHIP_BARTS_6720: + case PCI_CHIP_BARTS_6721: + case PCI_CHIP_BARTS_6722: + case PCI_CHIP_BARTS_6723: + case PCI_CHIP_BARTS_6724: + case PCI_CHIP_BARTS_6725: + case PCI_CHIP_BARTS_6726: + case PCI_CHIP_BARTS_6727: + case PCI_CHIP_BARTS_6728: + case PCI_CHIP_BARTS_6729: + case PCI_CHIP_BARTS_6738: + case PCI_CHIP_BARTS_6739: + screen->chip_family = CHIP_FAMILY_BARTS; + screen->chip_flags = RADEON_CHIPSET_TCL; + break; + + case PCI_CHIP_TURKS_6740: + case PCI_CHIP_TURKS_6741: + case PCI_CHIP_TURKS_6742: + case PCI_CHIP_TURKS_6743: + case PCI_CHIP_TURKS_6744: + case PCI_CHIP_TURKS_6745: + case PCI_CHIP_TURKS_6746: + case PCI_CHIP_TURKS_6747: + case PCI_CHIP_TURKS_6748: + case PCI_CHIP_TURKS_6749: + case PCI_CHIP_TURKS_6750: + case PCI_CHIP_TURKS_6758: + case PCI_CHIP_TURKS_6759: + screen->chip_family = CHIP_FAMILY_TURKS; + screen->chip_flags = RADEON_CHIPSET_TCL; + break; + + case PCI_CHIP_CAICOS_6760: + case PCI_CHIP_CAICOS_6761: + case PCI_CHIP_CAICOS_6762: + case PCI_CHIP_CAICOS_6763: + case PCI_CHIP_CAICOS_6764: + case PCI_CHIP_CAICOS_6765: + case PCI_CHIP_CAICOS_6766: + case PCI_CHIP_CAICOS_6767: + case PCI_CHIP_CAICOS_6768: + case PCI_CHIP_CAICOS_6770: + case PCI_CHIP_CAICOS_6779: + screen->chip_family = CHIP_FAMILY_CAICOS; + screen->chip_flags = RADEON_CHIPSET_TCL; + break; + default: fprintf(stderr, "unknown chip id 0x%x, can't guess.\n", device_id); diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index 83b1d1b..8a35c7d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -37,6 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/enums.h" #include "main/image.h" +#include "main/mfeatures.h" #include "main/simple_list.h" #include "main/texstore.h" #include "main/teximage.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 8b1e34f..cf85a5b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -33,6 +33,7 @@ #include "main/imports.h" #include "main/context.h" #include "main/enums.h" +#include "main/mfeatures.h" #include "main/mipmap.h" #include "main/texcompress.h" #include "main/texstore.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h index a1908c6..538a07f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.h +++ b/src/mesa/drivers/dri/radeon/radeon_texture.h @@ -32,6 +32,7 @@ #define RADEON_TEXTURE_H #include "main/formats.h" +#include "main/mfeatures.h" void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride, GLuint numrows, GLuint rowsize); diff --git a/src/mesa/drivers/dri/sis/server/sis_dri.h b/src/mesa/drivers/dri/sis/server/sis_dri.h index f0171f3..7d8f507 100644 --- a/src/mesa/drivers/dri/sis/server/sis_dri.h +++ b/src/mesa/drivers/dri/sis/server/sis_dri.h @@ -72,13 +72,4 @@ typedef struct { int dummy; } SISDRIContextRec, *SISDRIContextPtr; -#ifdef XFree86Server - -#include "screenint.h" - -Bool SISDRIScreenInit(ScreenPtr pScreen); -void SISDRICloseScreen(ScreenPtr pScreen); -Bool SISDRIFinishScreenInit(ScreenPtr pScreen); - -#endif #endif diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.h b/src/mesa/drivers/dri/tdfx/tdfx_context.h index fb38419..7e2f0e0 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.h @@ -41,11 +41,7 @@ #include <sys/time.h> #include "dri_util.h" -#ifdef XFree86Server -#include "GL/xf86glx.h" -#else #include "main/glheader.h" -#endif #if defined(__linux__) #include <signal.h> #endif diff --git a/src/mesa/drivers/dri/unichrome/server/via_dri.h b/src/mesa/drivers/dri/unichrome/server/via_dri.h index b47397d..c6eed03 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_dri.h +++ b/src/mesa/drivers/dri/unichrome/server/via_dri.h @@ -35,9 +35,7 @@ #define VIA_DRIDDX_VERSION_MINOR 0 #define VIA_DRIDDX_VERSION_PATCH 0 -#ifndef XFree86Server typedef int Bool; -#endif typedef struct { drm_handle_t handle; diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 10ba6b7..e1f0c69 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1356,7 +1356,7 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, /* this updates the visual's red/green/blue/alphaBits fields */ - _mesa_update_framebuffer_visual(osmesa->gl_buffer); + _mesa_update_framebuffer_visual(&osmesa->mesa, osmesa->gl_buffer); /* update the framebuffer size */ _mesa_resize_framebuffer(&osmesa->mesa, osmesa->gl_buffer, width, height); diff --git a/src/mesa/drivers/windows/gdi/InitCritSections.cpp b/src/mesa/drivers/windows/gdi/InitCritSections.cpp index 7145bff..69f03b8 100644 --- a/src/mesa/drivers/windows/gdi/InitCritSections.cpp +++ b/src/mesa/drivers/windows/gdi/InitCritSections.cpp @@ -1,7 +1,8 @@ #include "glapi.h" #include "glThread.h" -#ifdef WIN32_THREADS +#ifdef WIN32 + extern "C" _glthread_Mutex OneTimeLock; extern "C" _glthread_Mutex GenTexturesLock; @@ -29,4 +30,4 @@ public: _CriticalSectionInit _CriticalSectionInit::m_inst; -#endif +#endif /* WIN32 */ diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h index d88afba..ee00219 100644 --- a/src/mesa/drivers/x11/glxheader.h +++ b/src/mesa/drivers/x11/glxheader.h @@ -32,13 +32,6 @@ #include "main/glheader.h" -#ifdef XFree86Server - -# include "xorg-server.h" -# include "resource.h" -# include "windowstr.h" - -#else # include <X11/Xlib.h> # include <X11/Xlibint.h> @@ -51,7 +44,6 @@ # include <GL/glx.h> # include <sys/time.h> -#endif diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 00ceb96..b5eabad 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -158,14 +158,12 @@ static short hpcr_rgbTbl[3][256] = { /** * Return the host's byte order as LSBFirst or MSBFirst ala X. */ -#ifndef XFree86Server static int host_byte_order( void ) { int i = 1; char *cptr = (char *) &i; return (*cptr==1) ? LSBFirst : MSBFirst; } -#endif /** @@ -176,7 +174,7 @@ static int host_byte_order( void ) */ static int check_for_xshm( XMesaDisplay *display ) { -#if defined(USE_XSHM) && !defined(XFree86Server) +#if defined(USE_XSHM) int major, minor, ignore; Bool pixmaps; @@ -227,16 +225,6 @@ gamma_adjust( GLfloat gamma, GLint value, GLint max ) static int bits_per_pixel( XMesaVisual xmv ) { -#ifdef XFree86Server - const int depth = xmv->nplanes; - int i; - assert(depth > 0); - for (i = 0; i < screenInfo.numPixmapFormats; i++) { - if (screenInfo.formats[i].depth == depth) - return screenInfo.formats[i].bitsPerPixel; - } - return depth; /* should never get here, but this should be safe */ -#else XMesaDisplay *dpy = xmv->display; XMesaVisualInfo visinfo = xmv->visinfo; XMesaImage *img; @@ -257,7 +245,6 @@ bits_per_pixel( XMesaVisual xmv ) img->data = NULL; XMesaDestroyImage( img ); return bitsPerPixel; -#endif } @@ -271,7 +258,6 @@ bits_per_pixel( XMesaVisual xmv ) * Return: GL_TRUE - window exists * GL_FALSE - window doesn't exist */ -#ifndef XFree86Server static GLboolean WindowExistsFlag; static int window_exists_err_handler( XMesaDisplay* dpy, XErrorEvent* xerr ) @@ -306,7 +292,6 @@ get_drawable_size( XMesaDisplay *dpy, Drawable d, GLuint *width, GLuint *height *height = h; return stat; } -#endif /** @@ -319,10 +304,6 @@ void xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b, GLuint *width, GLuint *height) { -#ifdef XFree86Server - *width = MIN2(b->frontxrb->drawable->width, MAX_WIDTH); - *height = MIN2(b->frontxrb->drawable->height, MAX_HEIGHT); -#else Status stat; _glthread_LOCK_MUTEX(_xmesa_lock); @@ -335,7 +316,6 @@ xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b, _mesa_warning(NULL, "XGetGeometry failed!\n"); *width = *height = 1; } -#endif } @@ -549,16 +529,11 @@ noFaultXAllocColor( int client, XMesaColor *color, int *exact, int *alloced ) { -#ifdef XFree86Server - Pixel *ppixIn; - xrgb *ctable; -#else /* we'll try to cache ctable for better remote display performance */ static Display *prevDisplay = NULL; static XMesaColormap prevCmap = 0; static int prevCmapSize = 0; static XMesaColor *ctable = NULL; -#endif XMesaColor subColor; int i, bestmatch; double mindist; /* 3*2^16^2 exceeds long int precision. */ @@ -566,14 +541,7 @@ noFaultXAllocColor( int client, (void) client; /* First try just using XAllocColor. */ -#ifdef XFree86Server - if (AllocColor(cmap, - &color->red, &color->green, &color->blue, - &color->pixel, - client) == Success) -#else if (XAllocColor(dpy, cmap, color)) -#endif { *exact = 1; *alloced = 1; @@ -584,14 +552,6 @@ noFaultXAllocColor( int client, /* Retrieve color table entries. */ /* XXX alloca candidate. */ -#ifdef XFree86Server - ppixIn = (Pixel *) MALLOC(cmapSize * sizeof(Pixel)); - ctable = (xrgb *) MALLOC(cmapSize * sizeof(xrgb)); - for (i = 0; i < cmapSize; i++) { - ppixIn[i] = i; - } - QueryColors(cmap, cmapSize, ppixIn, ctable); -#else if (prevDisplay != dpy || prevCmap != cmap || prevCmapSize != cmapSize || !ctable) { /* free previously cached color table */ @@ -608,7 +568,6 @@ noFaultXAllocColor( int client, prevCmap = cmap; prevCmapSize = cmapSize; } -#endif /* Find best match. */ bestmatch = -1; @@ -632,14 +591,7 @@ noFaultXAllocColor( int client, * fail if the cell is read/write. Otherwise, we're incrementing * the cell's reference count. */ -#ifdef XFree86Server - if (AllocColor(cmap, - &subColor.red, &subColor.green, &subColor.blue, - &subColor.pixel, - client) == Success) { -#else if (XAllocColor(dpy, cmap, &subColor)) { -#endif *alloced = 1; } else { @@ -651,12 +603,7 @@ noFaultXAllocColor( int client, subColor.flags = DoRed | DoGreen | DoBlue; *alloced = 0; } -#ifdef XFree86Server - free(ppixIn); - free(ctable); -#else /* don't free table, save it for next time */ -#endif *color = subColor; *exact = 0; @@ -873,10 +820,8 @@ setup_8bit_hpcr(XMesaVisual v) v->hpcr_clear_pixmap = XMesaCreatePixmap(v->display, DefaultRootWindow(v->display), 16, 2, 8); -#ifndef XFree86Server v->hpcr_clear_ximage = XGetImage(v->display, v->hpcr_clear_pixmap, 0, 0, 16, 2, AllPlanes, ZPixmap); -#endif } } @@ -1049,9 +994,6 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, int client = 0; const int xclass = v->visualType; -#ifdef XFree86Server - client = (window) ? CLIENT_ID(window->id) : 0; -#endif ASSERT(!b || b->xm_visual == v); @@ -1120,40 +1062,23 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, } /* X11 graphics contexts */ -#ifdef XFree86Server - b->gc = CreateScratchGC(v->display, window->depth); -#else b->gc = XCreateGC( v->display, window, 0, NULL ); -#endif XMesaSetFunction( v->display, b->gc, GXcopy ); /* cleargc - for glClear() */ -#ifdef XFree86Server - b->cleargc = CreateScratchGC(v->display, window->depth); -#else b->cleargc = XCreateGC( v->display, window, 0, NULL ); -#endif XMesaSetFunction( v->display, b->cleargc, GXcopy ); /* * Don't generate Graphics Expose/NoExpose events in swapbuffers(). * Patch contributed by Michael Pichler May 15, 1995. */ -#ifdef XFree86Server - b->swapgc = CreateScratchGC(v->display, window->depth); - { - CARD32 v[1]; - v[0] = FALSE; - dixChangeGC(NullClient, b->swapgc, GCGraphicsExposures, v, NULL); - } -#else { XGCValues gcvalues; gcvalues.graphics_exposures = False; b->swapgc = XCreateGC(v->display, window, GCGraphicsExposures, &gcvalues); } -#endif XMesaSetFunction( v->display, b->swapgc, GXcopy ); /* * Set fill style and tile pixmap once for all for HPCR stuff @@ -1175,9 +1100,6 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, /* Initialize the row buffer XImage for use in write_color_span() */ data = (char*) MALLOC(MAX_WIDTH*4); -#ifdef XFree86Server - b->rowimage = XMesaCreateImage(GET_VISUAL_DEPTH(v), MAX_WIDTH, 1, data); -#else b->rowimage = XCreateImage( v->display, v->visinfo->visual, v->visinfo->depth, @@ -1186,7 +1108,6 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, MAX_WIDTH, 1, /*width, height*/ 32, /*bitmap_pad*/ 0 /*bytes_per_line*/ ); -#endif if (!b->rowimage) return GL_FALSE; } @@ -1334,7 +1255,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, XMesaVisual v; GLint red_bits, green_bits, blue_bits, alpha_bits; -#ifndef XFree86Server /* For debugging only */ if (_mesa_getenv("MESA_XSYNC")) { /* This makes debugging X easier. @@ -1343,7 +1263,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, */ XSynchronize( display, 1 ); } -#endif /* Color-index rendering not supported. */ if (!rgb_flag) @@ -1360,14 +1279,12 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, * the struct but we may need some of the information contained in it * at a later time. */ -#ifndef XFree86Server v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo)); if(!v->visinfo) { free(v); return NULL; } memcpy(v->visinfo, visinfo, sizeof(*visinfo)); -#endif /* check for MESA_GAMMA environment variable */ gamma = _mesa_getenv("MESA_GAMMA"); @@ -1384,30 +1301,13 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, v->ximage_flag = ximage_flag; -#ifdef XFree86Server - /* We could calculate these values by ourselves. nplanes is either the sum - * of the red, green, and blue bits or the number index bits. - * ColormapEntries is either (1U << index_bits) or - * (1U << max(redBits, greenBits, blueBits)). - */ - assert(visinfo->nplanes > 0); - v->nplanes = visinfo->nplanes; - v->ColormapEntries = visinfo->ColormapEntries; - - v->mesa_visual.redMask = visinfo->redMask; - v->mesa_visual.greenMask = visinfo->greenMask; - v->mesa_visual.blueMask = visinfo->blueMask; - v->visualID = visinfo->vid; - v->screen = 0; /* FIXME: What should be done here? */ -#else v->mesa_visual.redMask = visinfo->red_mask; v->mesa_visual.greenMask = visinfo->green_mask; v->mesa_visual.blueMask = visinfo->blue_mask; v->visualID = visinfo->visualid; v->screen = visinfo->screen; -#endif -#if defined(XFree86Server) || !(defined(__cplusplus) || defined(c_plusplus)) +#if !(defined(__cplusplus) || defined(c_plusplus)) v->visualType = xmesa_convert_from_x_visual_type(visinfo->class); #else v->visualType = xmesa_convert_from_x_visual_type(visinfo->c_class); @@ -1461,9 +1361,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, PUBLIC void XMesaDestroyVisual( XMesaVisual v ) { -#ifndef XFree86Server free(v->visinfo); -#endif free(v); } @@ -1532,12 +1430,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) _mesa_enable_extension(mesaCtx, "GL_EXT_timer_query"); #endif -#ifdef XFree86Server - /* If we're running in the X server, do bounds checking to prevent - * segfaults and server crashes! - */ - mesaCtx->Const.CheckArrayBounds = GL_TRUE; -#endif /* finish up xmesa context initializations */ c->swapbytes = CHECK_BYTE_ORDER(v) ? GL_FALSE : GL_TRUE; @@ -1602,9 +1494,7 @@ void XMesaDestroyContext( XMesaContext c ) PUBLIC XMesaBuffer XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) { -#ifndef XFree86Server XWindowAttributes attr; -#endif XMesaBuffer b; XMesaColormap cmap; int depth; @@ -1613,12 +1503,8 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) assert(w); /* Check that window depth matches visual depth */ -#ifdef XFree86Server - depth = ((XMesaDrawable)w)->depth; -#else XGetWindowAttributes( v->display, w, &attr ); depth = attr.depth; -#endif if (GET_VISUAL_DEPTH(v) != depth) { _mesa_warning(NULL, "XMesaCreateWindowBuffer: depth mismatch between visual (%d) and window (%d)!\n", GET_VISUAL_DEPTH(v), depth); @@ -1626,9 +1512,6 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) } /* Find colormap */ -#ifdef XFree86Server - cmap = (ColormapPtr)LookupIDByType(wColormap(w), RT_COLORMAP); -#else if (attr.colormap) { cmap = attr.colormap; } @@ -1638,7 +1521,6 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) /* OK, let's just allocate a new one and hope for the best */ cmap = XCreateColormap(v->display, w, attr.visual, AllocNone); } -#endif b = create_xmesa_buffer((XMesaDrawable) w, WINDOW, v, cmap); if (!b) @@ -1748,7 +1630,6 @@ XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, unsigned int width, unsigned int height) { -#ifndef XFree86Server XMesaWindow root; XMesaDrawable drawable; /* X Pixmap Drawable */ XMesaBuffer b; @@ -1770,9 +1651,6 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, } return b; -#else - return 0; -#endif } @@ -1931,40 +1809,6 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void ) } -#ifdef XFree86Server -PUBLIC -GLboolean XMesaForceCurrent(XMesaContext c) -{ - if (c) { - _glapi_set_dispatch(c->mesa.CurrentDispatch); - - if (&(c->mesa) != _mesa_get_current_context()) { - _mesa_make_current(&c->mesa, c->mesa.DrawBuffer, c->mesa.ReadBuffer); - } - } - else { - _mesa_make_current(NULL, NULL, NULL); - } - return GL_TRUE; -} - - -PUBLIC -GLboolean XMesaLoseCurrent(XMesaContext c) -{ - (void) c; - _mesa_make_current(NULL, NULL, NULL); - return GL_TRUE; -} - - -PUBLIC -GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mask ) -{ - _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask); - return GL_TRUE; -} -#endif /* XFree86Server */ #ifndef FX @@ -2004,7 +1848,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) #endif if (b->backxrb->ximage) { /* Copy Ximage (back buf) from client memory to server window */ -#if defined(USE_XSHM) && !defined(XFree86Server) +#if defined(USE_XSHM) if (b->shm) { /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, @@ -2041,9 +1885,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) if (b->swAlpha) _mesa_copy_soft_alpha_renderbuffers(ctx, &b->mesa_buffer); } -#if !defined(XFree86Server) XSync( b->xm_visual->display, False ); -#endif } @@ -2074,7 +1916,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) #endif if (b->backxrb->ximage) { /* Copy Ximage from host's memory to server's window */ -#if defined(USE_XSHM) && !defined(XFree86Server) +#if defined(USE_XSHM) if (b->shm) { /* XXX assuming width and height aren't too large! */ XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, @@ -2116,7 +1958,6 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) * Return: GL_TRUE = context is double buffered * GL_FALSE = context is single buffered */ -#ifndef XFree86Server GLboolean XMesaGetBackBuffer( XMesaBuffer b, XMesaPixmap *pixmap, XMesaImage **ximage ) @@ -2134,7 +1975,6 @@ GLboolean XMesaGetBackBuffer( XMesaBuffer b, return GL_FALSE; } } -#endif /* XFree86Server */ /* @@ -2171,11 +2011,7 @@ GLboolean XMesaGetDepthBuffer( XMesaBuffer b, GLint *width, GLint *height, void XMesaFlush( XMesaContext c ) { if (c && c->xm_visual) { -#ifdef XFree86Server - /* NOT_NEEDED */ -#else XSync( c->xm_visual->display, False ); -#endif } } @@ -2234,15 +2070,11 @@ void XMesaGarbageCollect( void ) for (b=XMesaBufferList; b; b=next) { next = b->Next; if (b->display && b->frontxrb->drawable && b->type == WINDOW) { -#ifdef XFree86Server - /* NOT_NEEDED */ -#else XSync(b->display, False); if (!window_exists( b->display, b->frontxrb->drawable )) { /* found a dead window, free the ancillary info */ XMesaDestroyBuffer( b ); } -#endif } } } diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 2683bd4..10829b4 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -37,7 +37,7 @@ #include "main/renderbuffer.h" -#if defined(USE_XSHM) && !defined(XFree86Server) +#if defined(USE_XSHM) static volatile int mesaXErrorFlag = 0; /** @@ -170,7 +170,7 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height) if (b->db_mode == BACK_XIMAGE) { /* Deallocate the old backxrb->ximage, if any */ if (b->backxrb->ximage) { -#if defined(USE_XSHM) && !defined(XFree86Server) +#if defined(USE_XSHM) if (b->shm) { XShmDetach(b->xm_visual->display, &b->shminfo); XDestroyImage(b->backxrb->ximage); @@ -188,10 +188,6 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height) /* Allocate new back buffer */ if (b->shm == 0 || !alloc_back_shm_ximage(b, width, height)) { /* Allocate a regular XImage for the back buffer. */ -#ifdef XFree86Server - b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel, - width, height, NULL); -#else b->backxrb->ximage = XCreateImage(b->xm_visual->display, b->xm_visual->visinfo->visual, GET_VISUAL_DEPTH(b->xm_visual), @@ -199,7 +195,6 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height) NULL, width, height, 8, 0); /* pad, bytes_per_line */ -#endif if (!b->backxrb->ximage) { _mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed.\n"); return; @@ -359,16 +354,8 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb) if (b->num_alloced > 0) { /* If no other buffer uses this X colormap then free the colors. */ if (!xmesa_find_buffer(b->display, b->cmap, b)) { -#ifdef XFree86Server - int client = 0; - if (b->frontxrb->drawable) - client = CLIENT_ID(b->frontxrb->drawable->id); - (void)FreeColors(b->cmap, client, - b->num_alloced, b->alloced_colors, 0); -#else XFreeColors(b->display, b->cmap, b->alloced_colors, b->num_alloced, 0); -#endif } } @@ -382,7 +369,7 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb) if (fb->Visual.doubleBufferMode) { /* free back ximage/pixmap/shmregion */ if (b->backxrb->ximage) { -#if defined(USE_XSHM) && !defined(XFree86Server) +#if defined(USE_XSHM) if (b->shm) { XShmDetach( b->display, &b->shminfo ); XDestroyImage( b->backxrb->ximage ); diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index acece20..b8d9e20 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -93,16 +93,12 @@ const int xmesa_kernel1[16] = { static void finish_or_flush( struct gl_context *ctx ) { -#ifdef XFree86Server - /* NOT_NEEDED */ -#else const XMesaContext xmesa = XMESA_CONTEXT(ctx); if (xmesa) { _glthread_LOCK_MUTEX(_xmesa_lock); XSync( xmesa->display, False ); _glthread_UNLOCK_MUTEX(_xmesa_lock); } -#endif } @@ -388,7 +384,6 @@ clear_buffers(struct gl_context *ctx, GLbitfield buffers) } -#ifndef XFree86Server /* XXX these functions haven't been tested in the Xserver environment */ @@ -731,7 +726,6 @@ xmesa_CopyPixels( struct gl_context *ctx, } } -#endif /* XFree86Server */ @@ -745,17 +739,9 @@ get_string( struct gl_context *ctx, GLenum name ) (void) ctx; switch (name) { case GL_RENDERER: -#ifdef XFree86Server - return (const GLubyte *) "Mesa GLX Indirect"; -#else return (const GLubyte *) "Mesa X11"; -#endif case GL_VENDOR: -#ifdef XFree86Server - return (const GLubyte *) "Mesa project: www.mesa3d.org"; -#else return NULL; -#endif default: return NULL; } @@ -948,43 +934,6 @@ xmesa_update_state( struct gl_context *ctx, GLbitfield new_state ) /** - * Called via ctx->Driver.TestProxyTeximage(). Normally, we'd just use - * the _mesa_test_proxy_teximage() fallback function, but we're going to - * special-case the 3D texture case to allow textures up to 512x512x32 - * texels. - */ -static GLboolean -test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, - GLint internalFormat, GLenum format, GLenum type, - GLint width, GLint height, GLint depth, GLint border) -{ - if (target == GL_PROXY_TEXTURE_3D) { - /* special case for 3D textures */ - if (width * height * depth > 512 * 512 * 64 || - width < 2 * border || - (!ctx->Extensions.ARB_texture_non_power_of_two && - _mesa_bitcount(width - 2 * border) != 1) || - height < 2 * border || - (!ctx->Extensions.ARB_texture_non_power_of_two && - _mesa_bitcount(height - 2 * border) != 1) || - depth < 2 * border || - (!ctx->Extensions.ARB_texture_non_power_of_two && - _mesa_bitcount(depth - 2 * border) != 1)) { - /* Bad size, or too many texels */ - return GL_FALSE; - } - return GL_TRUE; - } - else { - /* use the fallback routine for 1D, 2D, cube and rect targets */ - return _mesa_test_proxy_teximage(ctx, target, level, internalFormat, - format, type, width, height, depth, - border); - } -} - - -/** * In SW, we don't really compress GL_COMPRESSED_RGB[A] textures! */ static gl_format @@ -1124,7 +1073,6 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, } else { driver->Clear = clear_buffers; -#ifndef XFree86Server driver->CopyPixels = xmesa_CopyPixels; if (xmvisual->undithered_pf == PF_8R8G8B && xmvisual->dithered_pf == PF_8R8G8B && @@ -1134,9 +1082,8 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, else if (xmvisual->undithered_pf == PF_5R6G5B) { driver->DrawPixels = xmesa_DrawPixels_5R6G5B; } -#endif } - driver->TestProxyTexImage = test_proxy_teximage; + #if ENABLE_EXT_texure_compression_s3tc driver->ChooseTextureFormat = choose_tex_format; #else diff --git a/src/mesa/drivers/x11/xm_glide.c b/src/mesa/drivers/x11/xm_glide.c index cbd69b0..d8a0e6d 100644 --- a/src/mesa/drivers/x11/xm_glide.c +++ b/src/mesa/drivers/x11/xm_glide.c @@ -140,16 +140,8 @@ static void FXgetImage( XMesaBuffer b ) GLuint x, y; GLuint width, height; -#ifdef XFree86Server - x = b->frontxrb->pixmap->x; - y = b->frontxrb->pixmap->y; - width = b->frontxrb->pixmap->width; - height = b->frontxrb->pixmap->height; - depth = b->frontxrb->pixmap->depth; -#else xmesa_get_window_size(b->display, b, &width, &height); x = y = 0; -#endif if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) { b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width); b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height); diff --git a/src/mesa/drivers/x11/xm_image.c b/src/mesa/drivers/x11/xm_image.c index 087b4e4..12fef7d 100644 --- a/src/mesa/drivers/x11/xm_image.c +++ b/src/mesa/drivers/x11/xm_image.c @@ -37,97 +37,3 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glxheader.h" #include "xmesaP.h" -#ifdef XFree86Server - -#ifdef ROUNDUP -#undef ROUNDUP -#endif - -#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3)) - -XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data) -{ - XMesaImage *image; - - image = (XMesaImage *)xalloc(sizeof(XMesaImage)); - - if (image) { - image->width = width; - image->height = height; - image->data = data; - /* Always pad to 32 bits */ - image->bytes_per_line = ROUNDUP((bitsPerPixel * width), 32); - image->bits_per_pixel = bitsPerPixel; - } - - return image; -} - -void XMesaDestroyImage(XMesaImage *image) -{ - if (image->data) - free(image->data); - xfree(image); -} - -unsigned long XMesaGetPixel(XMesaImage *image, int x, int y) -{ - CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line); - CARD8 *i8; - CARD16 *i16; - CARD32 *i32; - switch (image->bits_per_pixel) { - case 8: - i8 = (CARD8 *)row; - return i8[x]; - break; - case 15: - case 16: - i16 = (CARD16 *)row; - return i16[x]; - break; - case 24: /* WARNING: architecture specific code */ - i8 = (CARD8 *)row; - return (((CARD32)i8[x*3]) | - (((CARD32)i8[x*3+1])<<8) | - (((CARD32)i8[x*3+2])<<16)); - break; - case 32: - i32 = (CARD32 *)row; - return i32[x]; - break; - } - return 0; -} - -#ifndef XMESA_USE_PUTPIXEL_MACRO -void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel) -{ - CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line); - CARD8 *i8; - CARD16 *i16; - CARD32 *i32; - switch (image->bits_per_pixel) { - case 8: - i8 = (CARD8 *)row; - i8[x] = (CARD8)pixel; - break; - case 15: - case 16: - i16 = (CARD16 *)row; - i16[x] = (CARD16)pixel; - break; - case 24: /* WARNING: architecture specific code */ - i8 = (CARD8 *)__row; - i8[x*3] = (CARD8)(p); - i8[x*3+1] = (CARD8)(p>>8); - i8[x*3+2] = (CARD8)(p>>16); - case 32: - i32 = (CARD32 *)row; - i32[x] = (CARD32)pixel; - break; - } -} -#endif - -#endif /* XFree86Server */ diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index f03f99f..04cedcd 100644 --- a/src/mesa/drivers/x11/xm_line.c +++ b/src/mesa/drivers/x11/xm_line.c @@ -537,7 +537,6 @@ void xmesa_choose_point( struct gl_context *ctx ) -#ifndef XFree86Server /** * Draw fast, XOR line with XDrawLine in front color buffer. * WARNING: this isn't fully OpenGL conformant because different pixels @@ -567,7 +566,6 @@ xor_line(struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1) XDrawLine(dpy, xrb->pixmap, gc, x0, y0, x1, y1); XMesaSetFunction(dpy, gc, GXcopy); /* this gc is used elsewhere */ } -#endif /* XFree86Server */ #endif /* CHAN_BITS == 8 */ @@ -660,7 +658,6 @@ get_line_func(struct gl_context *ctx) } } -#ifndef XFree86Server if (ctx->DrawBuffer->_NumColorDrawBuffers == 1 && ctx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT && swrast->_RasterMask == LOGIC_OP_BIT @@ -669,7 +666,6 @@ get_line_func(struct gl_context *ctx) && !ctx->Line.SmoothFlag) { return xor_line; } -#endif /* XFree86Server */ #endif /* CHAN_BITS == 8 */ return (swrast_line_func) NULL; diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index ab66c5e..294b93a 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -42,7 +42,6 @@ * generate BadMatch errors if the drawable isn't mapped. */ -#ifndef XFree86Server static int caught_xgetimage_error = 0; static int (*old_xerror_handler)( XMesaDisplay *dpy, XErrorEvent *ev ); static unsigned long xgetimage_serial; @@ -87,7 +86,6 @@ static int check_xgetimage_errors( void ) /* return 0=no error, 1=error caught */ return caught_xgetimage_error; } -#endif /* @@ -97,7 +95,6 @@ static unsigned long read_pixel( XMesaDisplay *dpy, XMesaDrawable d, int x, int y ) { unsigned long p; -#ifndef XFree86Server XMesaImage *pixel = NULL; int error; @@ -113,9 +110,6 @@ static unsigned long read_pixel( XMesaDisplay *dpy, if (pixel) { XMesaDestroyImage( pixel ); } -#else - (*dpy->GetImage)(d, x, y, 1, 1, ZPixmap, ~0L, (pointer)&p); -#endif return p; } @@ -3763,7 +3757,6 @@ static void put_values_ci_ximage( PUT_VALUES_ARGS ) /***** Pixel reading *****/ /**********************************************************************/ -#ifndef XFree86Server /** * Do clip testing prior to calling XGetImage. If any of the region lies * outside the screen's bounds, XGetImage will return NULL. @@ -3806,7 +3799,6 @@ clip_for_xgetimage(struct gl_context *ctx, XMesaPixmap pixmap, GLuint *n, GLint } return 0; } -#endif /* @@ -3824,7 +3816,6 @@ get_row_ci(struct gl_context *ctx, struct gl_renderbuffer *rb, y = YFLIP(xrb, y); if (xrb->pixmap) { -#ifndef XFree86Server XMesaImage *span = NULL; int error; int k = clip_for_xgetimage(ctx, xrb->pixmap, &n, &x, &y); @@ -3850,11 +3841,6 @@ get_row_ci(struct gl_context *ctx, struct gl_renderbuffer *rb, if (span) { XMesaDestroyImage( span ); } -#else - (*xmesa->display->GetImage)(xrb->drawable, - x, y, n, 1, ZPixmap, - ~0L, (pointer)index); -#endif } else if (xrb->ximage) { XMesaImage *img = xrb->ximage; @@ -3882,14 +3868,6 @@ get_row_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb, /* Read from Pixmap or Window */ XMesaImage *span = NULL; int error; -#ifdef XFree86Server - span = XMesaCreateImage(xmesa->xm_visual->BitsPerPixel, n, 1, NULL); - span->data = (char *)MALLOC(span->height * span->bytes_per_line); - error = (!span->data); - (*xmesa->display->GetImage)(xrb->drawable, - x, YFLIP(xrb, y), n, 1, ZPixmap, - ~0L, (pointer)span->data); -#else int k; y = YFLIP(xrb, y); k = clip_for_xgetimage(ctx, xrb->pixmap, &n, &x, &y); @@ -3900,7 +3878,6 @@ get_row_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb, span = XGetImage( xmesa->display, xrb->pixmap, x, y, n, 1, AllPlanes, ZPixmap ); error = check_xgetimage_errors(); -#endif if (span && !error) { switch (xmesa->pixelformat) { case PF_Truecolor: diff --git a/src/mesa/drivers/x11/xmesa.h b/src/mesa/drivers/x11/xmesa.h index f63626a..98737fa 100644 --- a/src/mesa/drivers/x11/xmesa.h +++ b/src/mesa/drivers/x11/xmesa.h @@ -72,13 +72,9 @@ and create a window, you must do the following to use the X/Mesa interface: extern "C" { #endif -#ifdef XFree86Server -#include "xmesa_xf86.h" -#else #include <X11/Xlib.h> #include <X11/Xutil.h> #include "xmesa_x.h" -#endif #include "GL/gl.h" #ifdef AMIWIN @@ -180,19 +176,6 @@ extern XMesaContext XMesaCreateContext( XMesaVisual v, extern void XMesaDestroyContext( XMesaContext c ); -#ifdef XFree86Server -/* - * These are the extra routines required for integration with XFree86. - * None of these routines should be user visible. -KEM - */ -extern GLboolean XMesaForceCurrent( XMesaContext c ); - -extern GLboolean XMesaLoseCurrent( XMesaContext c ); - -extern GLboolean XMesaCopyContext( XMesaContext src, - XMesaContext dst, - GLuint mask ); -#endif /* XFree86Server */ /* diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 5d34b43..63e3e21 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -33,9 +33,6 @@ #include "fxmesa.h" #include "xm_glide.h" #endif -#ifdef XFree86Server -#include "xm_image.h" -#endif extern _glthread_Mutex _xmesa_lock; @@ -88,13 +85,8 @@ struct xmesa_visual { XMesaDisplay *display; /* The X11 display */ int screen, visualID; int visualType; -#ifdef XFree86Server - GLint ColormapEntries; - GLint nplanes; -#else XMesaVisualInfo visinfo; /* X's visual info (pointer to private copy) */ XVisualInfo *vishandle; /* Only used in fakeglx.c */ -#endif GLint BitsPerPixel; /* True bits per pixel for XImages */ GLboolean ximage_flag; /* Use XImage for back buffer (not pixmap)? */ @@ -233,7 +225,7 @@ struct xmesa_buffer { /* 0 = not available */ /* 1 = XImage support available */ /* 2 = Pixmap support available too */ -#if defined(USE_XSHM) && !defined(XFree86Server) +#if defined(USE_XSHM) XShmSegmentInfo shminfo; #endif @@ -259,11 +251,7 @@ struct xmesa_buffer { /* Used to do XAllocColor/XFreeColors accounting: */ int num_alloced; -#if defined(XFree86Server) - Pixel alloced_colors[256]; -#else unsigned long alloced_colors[256]; -#endif #if defined( FX ) /* For 3Dfx Glide only */ @@ -578,9 +566,7 @@ extern void xmesa_register_swrast_functions( struct gl_context *ctx ); #define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */ -#ifdef XFree86Server -#define ENABLE_EXT_timer_query 0 -#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ENABLE_EXT_timer_query 1 /* should have 64-bit GLuint64EXT */ #else #define ENABLE_EXT_timer_query 0 /* may not have 64-bit GLuint64EXT */ diff --git a/src/mesa/gl.pc.in b/src/mesa/gl.pc.in index 97b8659..2d3bc91 100644 --- a/src/mesa/gl.pc.in +++ b/src/mesa/gl.pc.in @@ -10,3 +10,4 @@ Version: @VERSION@ Libs: -L${libdir} -l@GL_LIB@ Libs.private: @GL_PC_LIB_PRIV@ Cflags: -I${includedir} @GL_PC_CFLAGS@ +glx_tls: @GLX_TLS@ diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 4dc0b0d..50446a9 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -2004,6 +2004,14 @@ <value name="GL_UNSIGNED_INT_24_8_OES"/> </desc> </desc> + + <desc name="format" category="EXT_texture_format_BGRA8888"> + <value name="GL_BGRA_EXT"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + </desc> + </desc> </template> <template name="BindTexture"> @@ -3536,7 +3544,7 @@ <api name="mesa" implementation="true"> <category name="MESA"/> - <function name="Color4f" default_prefix="_vbo_" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="Color4f" default_prefix="_es_" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/> <function name="ClipPlane" template="ClipPlane" gltype="GLdouble"/> <function name="CullFace" template="CullFace"/> @@ -3554,8 +3562,8 @@ <function name="LineWidth" template="LineWidth" gltype="GLfloat"/> - <function name="Materialf" default_prefix="_vbo_" template="Material" gltype="GLfloat" expand_vector="true"/> - <function name="Materialfv" default_prefix="_vbo_" template="Material" gltype="GLfloat"/> + <function name="Materialf" default_prefix="_es_" template="Material" gltype="GLfloat" expand_vector="true"/> + <function name="Materialfv" default_prefix="_es_" template="Material" gltype="GLfloat"/> <function name="PointSize" template="PointSize" gltype="GLfloat"/> <function name="PointSizePointer" template="PointSizePointer"/> @@ -3582,6 +3590,7 @@ <function name="ClearColor" template="ClearColor" gltype="GLclampf"/> <function name="ClearStencil" template="ClearStencil"/> <function name="ClearDepth" template="ClearDepth" gltype="GLclampd"/> + <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/> <function name="StencilMask" template="StencilMask"/> <function name="StencilMaskSeparate" template="StencilMaskSeparate"/> @@ -3626,6 +3635,7 @@ <function name="IsEnabled" template="IsEnabled"/> <function name="DepthRange" template="DepthRange" gltype="GLclampd"/> + <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/> <function name="Frustum" template="Frustum" gltype="GLdouble"/> <function name="LoadIdentity" template="LoadIdentity"/> @@ -3650,7 +3660,7 @@ <function name="EnableClientState" template="EnableClientState"/> <function name="GetPointerv" template="GetPointer"/> - <function name="Normal3f" default_prefix="_vbo_" template="Normal" gltype="GLfloat" expand_vector="true"/> + <function name="Normal3f" default_prefix="_es_" template="Normal" gltype="GLfloat" expand_vector="true"/> <function name="NormalPointer" template="NormalPointer"/> <function name="TexCoordPointer" template="TexCoordPointer"/> <function name="VertexPointer" template="VertexPointer"/> @@ -3679,7 +3689,7 @@ <function name="ActiveTextureARB" template="ActiveTexture"/> <function name="ClientActiveTextureARB" template="ClientActiveTexture"/> - <function name="MultiTexCoord4f" default_prefix="_vbo_" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="MultiTexCoord4f" default_prefix="_es_" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/> <function name="SampleCoverageARB" template="SampleCoverage" gltype="GLclampf"/> @@ -3691,14 +3701,14 @@ <function name="PointParameterf" template="PointParameter" gltype="GLfloat" expand_vector="true"/> <function name="PointParameterfv" template="PointParameter" gltype="GLfloat"/> - <function name="VertexAttrib1f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/> - <function name="VertexAttrib2f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/> - <function name="VertexAttrib3f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/> - <function name="VertexAttrib4f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/> - <function name="VertexAttrib1fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="1"/> - <function name="VertexAttrib2fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="2"/> - <function name="VertexAttrib3fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="3"/> - <function name="VertexAttrib4fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="4"/> + <function name="VertexAttrib1f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/> + <function name="VertexAttrib2f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/> + <function name="VertexAttrib3f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/> + <function name="VertexAttrib4f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="VertexAttrib1fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="1"/> + <function name="VertexAttrib2fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="2"/> + <function name="VertexAttrib3fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="3"/> + <function name="VertexAttrib4fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="4"/> <function name="VertexAttribPointerARB" template="VertexAttribPointer"/> <function name="EnableVertexAttribArrayARB" template="EnableVertexAttribArray"/> @@ -3850,7 +3860,7 @@ <category name="OES_matrix_palette"/> - <function name="Color4f" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="Color4f" external="true" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/> <function name="Color4ub" template="Color" gltype="GLubyte" vector_size="4" expand_vector="true"/> <function name="Color4x" template="Color" gltype="GLfixed" vector_size="4" expand_vector="true"/> @@ -3880,8 +3890,8 @@ <function name="LineWidth" template="LineWidth" gltype="GLfloat"/> <function name="LineWidthx" template="LineWidth" gltype="GLfixed"/> - <function name="Materialf" template="Material" gltype="GLfloat" expand_vector="true"/> - <function name="Materialfv" template="Material" gltype="GLfloat"/> + <function name="Materialf" external="true" template="Material" gltype="GLfloat" expand_vector="true"/> + <function name="Materialfv" external="true" template="Material" gltype="GLfloat"/> <function name="Materialx" template="Material" gltype="GLfixed" expand_vector="true"/> <function name="Materialxv" template="Material" gltype="GLfixed"/> @@ -4012,7 +4022,7 @@ <function name="GetPointerv" template="GetPointer"/> - <function name="Normal3f" template="Normal" gltype="GLfloat" expand_vector="true"/> + <function name="Normal3f" external="true" template="Normal" gltype="GLfloat" expand_vector="true"/> <function name="Normal3x" template="Normal" gltype="GLfixed" expand_vector="true"/> <function name="NormalPointer" template="NormalPointer"/> <function name="TexCoordPointer" template="TexCoordPointer"/> @@ -4039,7 +4049,7 @@ <function name="ActiveTexture" template="ActiveTexture"/> <function name="ClientActiveTexture" template="ClientActiveTexture"/> - <function name="MultiTexCoord4f" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="MultiTexCoord4f" external="true" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/> <function name="SampleCoverage" template="SampleCoverage" gltype="GLclampf"/> <function name="SampleCoveragex" template="SampleCoverage" gltype="GLclampx"/> @@ -4227,14 +4237,14 @@ <function name="BlendFuncSeparate" template="BlendFuncSeparate"/> - <function name="VertexAttrib1f" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/> - <function name="VertexAttrib2f" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/> - <function name="VertexAttrib3f" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/> - <function name="VertexAttrib4f" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/> - <function name="VertexAttrib1fv" template="VertexAttrib" gltype="GLfloat" vector_size="1"/> - <function name="VertexAttrib2fv" template="VertexAttrib" gltype="GLfloat" vector_size="2"/> - <function name="VertexAttrib3fv" template="VertexAttrib" gltype="GLfloat" vector_size="3"/> - <function name="VertexAttrib4fv" template="VertexAttrib" gltype="GLfloat" vector_size="4"/> + <function name="VertexAttrib1f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/> + <function name="VertexAttrib2f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/> + <function name="VertexAttrib3f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/> + <function name="VertexAttrib4f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="VertexAttrib1fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="1"/> + <function name="VertexAttrib2fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="2"/> + <function name="VertexAttrib3fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="3"/> + <function name="VertexAttrib4fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="4"/> <function name="VertexAttribPointer" template="VertexAttribPointer"/> diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 9026110..940f398 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -27,6 +27,7 @@ #include "context.h" #include "imports.h" #include "macros.h" +#include "mfeatures.h" #include "state.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index c22e18c..b429e26 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -40,6 +40,8 @@ #include "context.h" #include "imports.h" #include "macros.h" +#include "mfeatures.h" +#include "mtypes.h" #include "main/dispatch.h" typedef void (GLAPIENTRY *array_func)( const void * ); diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h index 610e522..b90d713 100644 --- a/src/mesa/main/api_arrayelt.h +++ b/src/mesa/main/api_arrayelt.h @@ -28,6 +28,7 @@ #define API_ARRAYELT_H +#include "main/mfeatures.h" #include "main/mtypes.h" #if FEATURE_arrayelt diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 1427abd..f1e4f73 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -361,6 +361,10 @@ _mesa_create_exec_table(void) SET_PointParameterfvEXT(exec, _mesa_PointParameterfv); #endif + /* 95. GL_ARB_ES2_compatibility */ + SET_ClearDepthf(exec, _mesa_ClearDepthf); + SET_DepthRangef(exec, _mesa_DepthRangef); + /* 97. GL_EXT_compiled_vertex_array */ #if _HAVE_FULL_GL SET_LockArraysEXT(exec, _mesa_LockArraysEXT); diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 08b4b4a..7d3d332 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -30,6 +30,7 @@ #include "context.h" #include "light.h" #include "macros.h" +#include "mfeatures.h" #include "dlist.h" #include "eval.h" #include "main/dispatch.h" diff --git a/src/mesa/main/api_noop.h b/src/mesa/main/api_noop.h index e7fd49b..aca7f08 100644 --- a/src/mesa/main/api_noop.h +++ b/src/mesa/main/api_noop.h @@ -25,6 +25,7 @@ #ifndef _API_NOOP_H #define _API_NOOP_H +#include "main/mfeatures.h" #include "main/mtypes.h" #if FEATURE_beginend diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 0d64b7d..9e9728c 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -43,11 +43,13 @@ #include "hash.h" #include "imports.h" #include "context.h" +#include "mfeatures.h" #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" #endif #include "arrayobj.h" #include "macros.h" +#include "mtypes.h" #include "main/dispatch.h" diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c index ae2feb3..44097e1 100644 --- a/src/mesa/main/atifragshader.c +++ b/src/mesa/main/atifragshader.c @@ -26,6 +26,7 @@ #include "main/hash.h" #include "main/imports.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/enums.h" #include "main/mtypes.h" #include "main/dispatch.h" @@ -316,6 +317,7 @@ _mesa_DeleteFragmentShaderATI(GLuint id) if (prog) { prog->RefCount--; if (prog->RefCount <= 0) { + assert(prog != &DummyShader); free(prog); } } diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index fb6fbe5..adfec3b 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -43,6 +43,7 @@ #include "lines.h" #include "macros.h" #include "matrix.h" +#include "mfeatures.h" #include "multisample.h" #include "points.h" #include "polygon.h" diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 4d62f54..1f9a521 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -39,6 +39,8 @@ #include "context.h" #include "bufferobj.h" #include "fbobject.h" +#include "mfeatures.h" +#include "mtypes.h" #include "texobj.h" diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 4b97e34..09ccab3 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -29,6 +29,7 @@ #define BUFFEROBJ_H +#include "mfeatures.h" #include "mtypes.h" diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 8644631..5c37f3d 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -35,6 +35,7 @@ #include "colormac.h" #include "context.h" #include "enums.h" +#include "mtypes.h" #define BAD_MASK ~0u diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index c4c1d96e..43a9ccc 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -36,6 +36,7 @@ #include "colormac.h" #include "enums.h" #include "macros.h" +#include "mtypes.h" #include "state.h" diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index 245fb65..a328dcd 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -198,12 +198,23 @@ do { \ ((((B) & 0xf8) >> 1) | (((G) & 0xc0) >> 6) | (((G) & 0x38) << 10) | (((R) & 0xf8) << 5) | \ ((A) ? 0x80 : 0)) +#define PACK_COLOR_2101010_UB( A, B, G, R ) \ + (((B) << 22) | ((G) << 12) | ((R) << 2) | \ + (((A) & 0xc0) << 24)) + +#define PACK_COLOR_2101010_US( A, B, G, R ) \ + ((((B) >> 6) << 20) | (((G) >> 6) << 10) | ((R) >> 6) | \ + (((A) >> 14) << 30)) + #define PACK_COLOR_4444( R, G, B, A ) \ ((((R) & 0xf0) << 8) | (((G) & 0xf0) << 4) | ((B) & 0xf0) | ((A) >> 4)) #define PACK_COLOR_4444_REV( R, G, B, A ) \ ((((B) & 0xf0) << 8) | (((A) & 0xf0) << 4) | ((R) & 0xf0) | ((G) >> 4)) +#define PACK_COLOR_44( L, A ) \ + (((L) & 0xf0) | (((A) & 0xf0) >> 4)) + #define PACK_COLOR_88( L, A ) \ (((L) << 8) | (A)) diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index caa9583..b0ba31c 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -29,6 +29,8 @@ #include "context.h" #include "image.h" #include "macros.h" +#include "mfeatures.h" +#include "mtypes.h" #include "pack.h" #include "state.h" #include "teximage.h" diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 800eb83..5557a3b 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -358,6 +358,10 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) #define M_E (2.7182818284590452354) #endif +#ifndef M_LOG2E +#define M_LOG2E (1.4426950408889634074) +#endif + #ifndef ONE_DIV_LN2 #define ONE_DIV_LN2 (1.442695040888963456) #endif diff --git a/src/mesa/main/condrender.c b/src/mesa/main/condrender.c index 25b3dd6..352e2e2 100644 --- a/src/mesa/main/condrender.c +++ b/src/mesa/main/condrender.c @@ -34,6 +34,7 @@ #include "glheader.h" #include "condrender.h" #include "enums.h" +#include "mtypes.h" #include "queryobj.h" diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 0f2d1a8..fffb1a7 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -97,17 +97,20 @@ /** Max texture palette / color table size */ #define MAX_COLOR_TABLE_SIZE 256 +/** Max memory to allow for a single texture image (in megabytes) */ +#define MAX_TEXTURE_MBYTES 1024 + /** Number of 1D/2D texture mipmap levels */ -#define MAX_TEXTURE_LEVELS 13 +#define MAX_TEXTURE_LEVELS 15 /** Number of 3D texture mipmap levels */ -#define MAX_3D_TEXTURE_LEVELS 9 +#define MAX_3D_TEXTURE_LEVELS 15 /** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */ -#define MAX_CUBE_TEXTURE_LEVELS 13 +#define MAX_CUBE_TEXTURE_LEVELS 15 /** Maximum rectangular texture size - GL_NV_texture_rectangle */ -#define MAX_TEXTURE_RECT_SIZE 4096 +#define MAX_TEXTURE_RECT_SIZE 16384 /** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */ #define MAX_ARRAY_TEXTURE_LAYERS 64 @@ -140,11 +143,28 @@ */ #ifndef MAX_WIDTH -# define MAX_WIDTH 4096 +# define MAX_WIDTH 16384 #endif /** Maximum viewport/image height */ #ifndef MAX_HEIGHT -# define MAX_HEIGHT 4096 +# define MAX_HEIGHT 16384 +#endif + +/* XXX: hack to prevent stack overflow on windows until all temporary arrays + * [MAX_WIDTH] are allocated from the heap */ +#ifdef WIN32 +#undef MAX_TEXTURE_LEVELS +#undef MAX_3D_TEXTURE_LEVELS +#undef MAX_CUBE_TEXTURE_LEVELS +#undef MAX_TEXTURE_RECT_SIZE +#undef MAX_WIDTH +#undef MAX_HEIGHT +#define MAX_TEXTURE_LEVELS 13 +#define MAX_3D_TEXTURE_LEVELS 9 +#define MAX_CUBE_TEXTURE_LEVELS 13 +#define MAX_TEXTURE_RECT_SIZE 4096 +#define MAX_WIDTH 4096 +#define MAX_HEIGHT 4096 #endif /** Maxmimum size for CVA. May be overridden by the drivers. */ @@ -168,7 +188,7 @@ #define MAX_TEXTURE_MAX_ANISOTROPY 16.0 /** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */ -#define MAX_TEXTURE_LOD_BIAS 12.0 +#define MAX_TEXTURE_LOD_BIAS 14.0 /** For any program target/extension */ /*@{*/ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index e2c91c3..958ea10 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -96,6 +96,7 @@ #include "fbobject.h" #include "feedback.h" #include "fog.h" +#include "formats.h" #include "framebuffer.h" #include "hint.h" #include "hash.h" @@ -417,6 +418,10 @@ one_time_init( struct gl_context *ctx ) MESA_VERSION_STRING, __DATE__, __TIME__); } #endif + +#ifdef DEBUG + _mesa_test_formats(); +#endif } /* per-API one-time init */ @@ -535,6 +540,7 @@ _mesa_init_constants(struct gl_context *ctx) assert(ctx); /* Constants, may be overriden (usually only reduced) by device drivers */ + ctx->Const.MaxTextureMbytes = MAX_TEXTURE_MBYTES; ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS; ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS; ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS; @@ -954,6 +960,14 @@ _mesa_initialize_context_for_api(struct gl_context *ctx, ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; } + /* Mesa core handles all the formats that mesa core knows about. + * Drivers will want to override this list with just the formats + * they can handle, and confirm that appropriate fallbacks exist in + * _mesa_choose_tex_format(). + */ + memset(&ctx->TextureFormatSupported, GL_TRUE, + sizeof(ctx->TextureFormatSupported)); + switch (ctx->API) { case API_OPENGL: #if FEATURE_dlist diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 0231bcf..5d286eb 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -36,6 +36,7 @@ #include "colormac.h" #include "convolve.h" #include "macros.h" +#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/src/mesa/main/cpuinfo.c b/src/mesa/main/cpuinfo.c index 35de69b..6363512 100644 --- a/src/mesa/main/cpuinfo.c +++ b/src/mesa/main/cpuinfo.c @@ -23,7 +23,7 @@ */ -#include "main/imports.h" +#include "main/compiler.h" #include "main/cpuinfo.h" diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index c5a910e..0bb4773 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -56,6 +56,12 @@ _mesa_ClearDepth( GLclampd depth ) } +void GLAPIENTRY +_mesa_ClearDepthf( GLclampf depth ) +{ + _mesa_ClearDepth(depth); +} + void GLAPIENTRY _mesa_DepthFunc( GLenum func ) diff --git a/src/mesa/main/depth.h b/src/mesa/main/depth.h index b498a47..2f42862 100644 --- a/src/mesa/main/depth.h +++ b/src/mesa/main/depth.h @@ -44,6 +44,9 @@ extern void GLAPIENTRY _mesa_ClearDepth( GLclampd depth ); extern void GLAPIENTRY +_mesa_ClearDepthf( GLclampf depth ); + +extern void GLAPIENTRY _mesa_DepthFunc( GLenum func ); extern void GLAPIENTRY diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index 24241a4..160ed62 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -33,6 +33,7 @@ #define DLIST_H +#include "main/mfeatures.h" #include "main/mtypes.h" diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 757aae6..6fda3c5 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -30,6 +30,7 @@ #include "enums.h" #include "feedback.h" #include "framebuffer.h" +#include "mfeatures.h" #include "readpix.h" #include "state.h" #include "dispatch.h" diff --git a/src/mesa/main/drawtex.c b/src/mesa/main/drawtex.c index b9afc99..2089cdf 100644 --- a/src/mesa/main/drawtex.c +++ b/src/mesa/main/drawtex.c @@ -24,6 +24,8 @@ #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 diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index a038a95..d047586 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -33,6 +33,7 @@ #include "enable.h" #include "light.h" #include "simple_list.h" +#include "mfeatures.h" #include "mtypes.h" #include "enums.h" #include "api_arrayelt.h" diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 0ce62c0..9ceee99 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -5909,8 +5909,8 @@ static const unsigned reduced_enums[1551] = 1306, /* GL_PALETTE8_R5_G6_B5_OES */ 1309, /* GL_PALETTE8_RGBA4_OES */ 1307, /* GL_PALETTE8_RGB5_A1_OES */ - 726, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 724, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 725, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */ + 723, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */ 1355, /* GL_POINT_SIZE_ARRAY_OES */ 2014, /* GL_TEXTURE_CROP_RECT_OES */ 996, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */ diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index c607e6a..9ab5507 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -43,6 +43,7 @@ #include "context.h" #include "eval.h" #include "macros.h" +#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index bd908f0..bfeeebd 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -37,6 +37,7 @@ #define EVAL_H +#include "main/mfeatures.h" #include "main/mtypes.h" diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index a7bdfcc..2440499 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -24,206 +24,349 @@ */ +/** + * \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, +}; -#define F(x) offsetof(struct gl_extensions, x) -#define ON GL_TRUE -#define OFF GL_FALSE +/** + * \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; +}; + + +/** + * 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 { - GLboolean enabled; - const char *name; - int flag_offset; -} default_extensions[] = { - { OFF, "GL_ARB_blend_func_extended", F(ARB_blend_func_extended) }, - { ON, "GL_ARB_copy_buffer", F(ARB_copy_buffer) }, - { OFF, "GL_ARB_depth_buffer_float", F(ARB_depth_buffer_float) }, - { OFF, "GL_ARB_depth_clamp", F(ARB_depth_clamp) }, - { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, - { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, - { OFF, "GL_ARB_draw_elements_base_vertex", F(ARB_draw_elements_base_vertex) }, - { OFF, "GL_ARB_draw_instanced", F(ARB_draw_instanced) }, - { OFF, "GL_ARB_explicit_attrib_location", F(ARB_explicit_attrib_location) }, - { OFF, "GL_ARB_fragment_coord_conventions", F(ARB_fragment_coord_conventions) }, - { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, - { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, - { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, - { OFF, "GL_ARB_framebuffer_object", F(ARB_framebuffer_object) }, - /* TODO: reenable this when the new GLSL compiler actually supports them */ - /* { OFF, "GL_ARB_geometry_shader4", F(ARB_geometry_shader4) }, */ - { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, - { OFF, "GL_ARB_half_float_vertex", F(ARB_half_float_vertex) }, - { OFF, "GL_ARB_instanced_arrays", F(ARB_instanced_arrays) }, - { OFF, "GL_ARB_map_buffer_range", F(ARB_map_buffer_range) }, - { ON, "GL_ARB_multisample", F(ARB_multisample) }, - { OFF, "GL_ARB_multitexture", F(ARB_multitexture) }, - { OFF, "GL_ARB_occlusion_query", F(ARB_occlusion_query) }, - { OFF, "GL_ARB_occlusion_query2", F(ARB_occlusion_query2) }, - { OFF, "GL_ARB_pixel_buffer_object", F(EXT_pixel_buffer_object) }, - { OFF, "GL_ARB_point_parameters", F(EXT_point_parameters) }, - { OFF, "GL_ARB_point_sprite", F(ARB_point_sprite) }, - { OFF, "GL_ARB_provoking_vertex", F(EXT_provoking_vertex) }, - { OFF, "GL_ARB_sampler_objects", F(ARB_sampler_objects) }, - { OFF, "GL_ARB_seamless_cube_map", F(ARB_seamless_cube_map) }, - { OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) }, - { OFF, "GL_ARB_shader_stencil_export", F(ARB_shader_stencil_export) }, - { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, - { OFF, "GL_ARB_shadow", F(ARB_shadow) }, - { OFF, "GL_ARB_shadow_ambient", F(ARB_shadow_ambient) }, - { OFF, "GL_ARB_sync", F(ARB_sync) }, - { OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) }, - { OFF, "GL_ARB_texture_buffer_object", F(ARB_texture_buffer_object) }, - { ON, "GL_ARB_texture_compression", F(ARB_texture_compression) }, - { OFF, "GL_ARB_texture_compression_rgtc", F(ARB_texture_compression_rgtc) }, - { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, - { OFF, "GL_ARB_texture_env_add", F(EXT_texture_env_add) }, - { OFF, "GL_ARB_texture_env_combine", F(ARB_texture_env_combine) }, - { OFF, "GL_ARB_texture_env_crossbar", F(ARB_texture_env_crossbar) }, - { OFF, "GL_ARB_texture_env_dot3", F(ARB_texture_env_dot3) }, - { OFF, "GL_MESAX_texture_float", F(ARB_texture_float) }, - { OFF, "GL_ARB_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)}, - { OFF, "GL_ARB_texture_multisample", F(ARB_texture_multisample) }, - { OFF, "GL_ARB_texture_non_power_of_two", F(ARB_texture_non_power_of_two)}, - { OFF, "GL_ARB_texture_rectangle", F(NV_texture_rectangle) }, - { OFF, "GL_ARB_texture_rg", F(ARB_texture_rg) }, - { OFF, "GL_ARB_texture_rgb10_a2ui", F(ARB_texture_rgb10_a2ui) }, - { OFF, "GL_ARB_texture_swizzle", F(EXT_texture_swizzle) }, - { ON, "GL_ARB_transpose_matrix", F(ARB_transpose_matrix) }, - { OFF, "GL_ARB_transform_feedback2", F(ARB_transform_feedback2) }, - { OFF, "GL_ARB_uniform_buffer_object", F(ARB_uniform_buffer_object) }, - { OFF, "GL_ARB_vertex_array_bgra", F(EXT_vertex_array_bgra) }, - { OFF, "GL_ARB_vertex_array_object", F(ARB_vertex_array_object) }, - { ON, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) }, - { OFF, "GL_ARB_vertex_program", F(ARB_vertex_program) }, - { OFF, "GL_ARB_vertex_shader", F(ARB_vertex_shader) }, - { OFF, "GL_ARB_vertex_type_2_10_10_10_rev", F(ARB_vertex_type_2_10_10_10_rev) }, - { ON, "GL_ARB_window_pos", F(ARB_window_pos) }, - { ON, "GL_EXT_abgr", F(EXT_abgr) }, - { ON, "GL_EXT_bgra", F(EXT_bgra) }, - { OFF, "GL_EXT_blend_color", F(EXT_blend_color) }, - { OFF, "GL_EXT_blend_equation_separate", F(EXT_blend_equation_separate) }, - { OFF, "GL_EXT_blend_func_separate", F(EXT_blend_func_separate) }, - { OFF, "GL_EXT_blend_logic_op", F(EXT_blend_logic_op) }, - { OFF, "GL_EXT_blend_minmax", F(EXT_blend_minmax) }, - { OFF, "GL_EXT_blend_subtract", F(EXT_blend_subtract) }, - { OFF, "GL_EXT_clip_volume_hint", F(EXT_clip_volume_hint) }, - { ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) }, - { ON, "GL_EXT_copy_texture", F(EXT_copy_texture) }, - { OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) }, - { OFF, "GL_EXT_draw_buffers2", F(EXT_draw_buffers2) }, - { OFF, "GL_EXT_draw_instanced", F(ARB_draw_instanced) }, - { ON, "GL_EXT_draw_range_elements", F(EXT_draw_range_elements) }, - { OFF, "GL_EXT_framebuffer_blit", F(EXT_framebuffer_blit) }, - { OFF, "GL_EXT_framebuffer_multisample", F(EXT_framebuffer_multisample) }, - { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, - { OFF, "GL_EXT_framebuffer_sRGB", F(EXT_framebuffer_sRGB) }, - { OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) }, - { OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) }, - { OFF, "GL_EXT_gpu_shader4", F(EXT_gpu_shader4) }, - { ON, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) }, - { OFF, "GL_EXT_packed_depth_stencil", F(EXT_packed_depth_stencil) }, - { OFF, "GL_EXT_packed_float", F(EXT_packed_float) }, - { ON, "GL_EXT_packed_pixels", F(EXT_packed_pixels) }, - { OFF, "GL_EXT_paletted_texture", F(EXT_paletted_texture) }, - { OFF, "GL_EXT_pixel_buffer_object", F(EXT_pixel_buffer_object) }, - { OFF, "GL_EXT_point_parameters", F(EXT_point_parameters) }, - { ON, "GL_EXT_polygon_offset", F(EXT_polygon_offset) }, - { OFF, "GL_EXT_provoking_vertex", F(EXT_provoking_vertex) }, - { ON, "GL_EXT_rescale_normal", F(EXT_rescale_normal) }, - { OFF, "GL_EXT_secondary_color", F(EXT_secondary_color) }, - { OFF, "GL_EXT_separate_shader_objects", F(EXT_separate_shader_objects) }, - { ON, "GL_EXT_separate_specular_color", F(EXT_separate_specular_color) }, - { OFF, "GL_EXT_shadow_funcs", F(EXT_shadow_funcs) }, - { OFF, "GL_EXT_shared_texture_palette", F(EXT_shared_texture_palette) }, - { OFF, "GL_EXT_stencil_two_side", F(EXT_stencil_two_side) }, - { OFF, "GL_EXT_stencil_wrap", F(EXT_stencil_wrap) }, - { ON, "GL_EXT_subtexture", F(EXT_subtexture) }, - { ON, "GL_EXT_texture", F(EXT_texture) }, - { ON, "GL_EXT_texture3D", F(EXT_texture3D) }, - { OFF, "GL_EXT_texture_array", F(EXT_texture_array) }, - { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) }, - { OFF, "GL_EXT_texture_compression_rgtc", F(ARB_texture_compression_rgtc) }, - { OFF, "GL_EXT_texture_cube_map", F(ARB_texture_cube_map) }, - { ON, "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, - { OFF, "GL_EXT_texture_env_add", F(EXT_texture_env_add) }, - { OFF, "GL_EXT_texture_env_combine", F(EXT_texture_env_combine) }, - { OFF, "GL_EXT_texture_env_dot3", F(EXT_texture_env_dot3) }, - { OFF, "GL_EXT_texture_filter_anisotropic", F(EXT_texture_filter_anisotropic) }, - { OFF, "GL_EXT_texture_integer", F(EXT_texture_integer) }, - { OFF, "GL_EXT_texture_lod_bias", F(EXT_texture_lod_bias) }, - { OFF, "GL_EXT_texture_mirror_clamp", F(EXT_texture_mirror_clamp) }, - { ON, "GL_EXT_texture_object", F(EXT_texture_object) }, - { OFF, "GL_EXT_texture_rectangle", F(NV_texture_rectangle) }, - { OFF, "GL_EXT_texture_shared_exponent", F(EXT_texture_shared_exponent) }, - { OFF, "GL_EXT_texture_sRGB", F(EXT_texture_sRGB) }, - { OFF, "GL_EXT_texture_swizzle", F(EXT_texture_swizzle) }, - { OFF, "GL_EXT_timer_query", F(EXT_timer_query) }, - { OFF, "GL_EXT_transform_feedback", F(EXT_transform_feedback) }, - { ON, "GL_EXT_vertex_array", F(EXT_vertex_array) }, - { OFF, "GL_EXT_vertex_array_bgra", F(EXT_vertex_array_bgra) }, - { OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) }, - { OFF, "GL_3DFX_texture_compression_FXT1", F(TDFX_texture_compression_FXT1) }, - { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }, - { ON, "GL_APPLE_packed_pixels", F(APPLE_packed_pixels) }, - { OFF, "GL_APPLE_vertex_array_object", F(APPLE_vertex_array_object) }, - { OFF, "GL_APPLE_object_purgeable", F(APPLE_object_purgeable) }, - { OFF, "GL_ATI_blend_equation_separate", F(EXT_blend_equation_separate) }, - { OFF, "GL_ATI_envmap_bumpmap", F(ATI_envmap_bumpmap) }, - { OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)}, - { OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)}, - { OFF, "GL_ATI_fragment_shader", F(ATI_fragment_shader)}, - { OFF, "GL_ATI_separate_stencil", F(ATI_separate_stencil)}, - { ON, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) }, - { ON, "GL_IBM_rasterpos_clip", F(IBM_rasterpos_clip) }, - { OFF, "GL_IBM_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)}, - { OFF, "GL_INGR_blend_func_separate", F(EXT_blend_func_separate) }, - { OFF, "GL_MESA_pack_invert", F(MESA_pack_invert) }, - { OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) }, - { OFF, "GL_MESA_texture_array", F(MESA_texture_array) }, - { OFF, "GL_MESA_texture_signed_rgba", F(MESA_texture_signed_rgba) }, - { OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) }, - { ON, "GL_MESA_window_pos", F(ARB_window_pos) }, - { OFF, "GL_NV_blend_square", F(NV_blend_square) }, - { OFF, "GL_NV_conditional_render", F(NV_conditional_render) }, - { OFF, "GL_NV_depth_clamp", F(ARB_depth_clamp) }, - { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, - { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, - { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, - { OFF, "GL_NV_packed_depth_stencil", F(EXT_packed_depth_stencil) }, - { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, - { OFF, "GL_NV_primitive_restart", F(NV_primitive_restart) }, - { ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) }, - { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) }, - { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) }, - { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, - { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) }, - { ON, "GL_OES_read_format", F(OES_read_format) }, - { OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) }, - { ON, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, - { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, - { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, - { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, - { ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, - { OFF, "GL_S3_s3tc", F(S3_s3tc) }, - { OFF, "GL_EXT_texture_format_BGRA8888", F(EXT_texture_format_BGRA8888) }, -#if FEATURE_OES_EGL_image - { OFF, "GL_OES_EGL_image", F(OES_EGL_image) }, -#endif +static const struct extension extension_table[] = { + /* ARB Extensions */ + { "GL_ARB_ES2_compatibility", o(ARB_ES2_compatibility), GL }, + { "GL_ARB_blend_func_extended", o(ARB_blend_func_extended), GL }, + { "GL_ARB_copy_buffer", o(ARB_copy_buffer), GL }, + { "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL }, + { "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL }, + { "GL_ARB_depth_texture", o(ARB_depth_texture), GL }, + { "GL_ARB_draw_buffers", o(ARB_draw_buffers), GL }, + { "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL }, + { "GL_ARB_draw_instanced", o(ARB_draw_instanced), GL }, + { "GL_ARB_explicit_attrib_location", o(ARB_explicit_attrib_location), GL }, + { "GL_ARB_fragment_coord_conventions", o(ARB_fragment_coord_conventions), GL }, + { "GL_ARB_fragment_program", o(ARB_fragment_program), GL }, + { "GL_ARB_fragment_program_shadow", o(ARB_fragment_program_shadow), GL }, + { "GL_ARB_fragment_shader", o(ARB_fragment_shader), GL }, + { "GL_ARB_framebuffer_object", o(ARB_framebuffer_object), GL }, + { "GL_ARB_half_float_pixel", o(ARB_half_float_pixel), GL }, + { "GL_ARB_half_float_vertex", o(ARB_half_float_vertex), GL }, + { "GL_ARB_instanced_arrays", o(ARB_instanced_arrays), GL }, + { "GL_ARB_map_buffer_range", o(ARB_map_buffer_range), GL }, + { "GL_ARB_multisample", o(ARB_multisample), GL }, + { "GL_ARB_multitexture", o(ARB_multitexture), GL }, + { "GL_ARB_occlusion_query2", o(ARB_occlusion_query2), GL }, + { "GL_ARB_occlusion_query", o(ARB_occlusion_query), GL }, + { "GL_ARB_pixel_buffer_object", o(EXT_pixel_buffer_object), GL }, + { "GL_ARB_point_parameters", o(EXT_point_parameters), GL }, + { "GL_ARB_point_sprite", o(ARB_point_sprite), GL }, + { "GL_ARB_provoking_vertex", o(EXT_provoking_vertex), GL }, + { "GL_ARB_sampler_objects", o(ARB_sampler_objects), GL }, + { "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL }, + { "GL_ARB_shader_objects", o(ARB_shader_objects), GL }, + { "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL }, + { "GL_ARB_shading_language_100", o(ARB_shading_language_100), GL }, + { "GL_ARB_shadow_ambient", o(ARB_shadow_ambient), GL }, + { "GL_ARB_shadow", o(ARB_shadow), GL }, + { "GL_ARB_sync", o(ARB_sync), GL }, + { "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GL }, + { "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GL }, + { "GL_ARB_texture_compression", o(ARB_texture_compression), GL }, + { "GL_ARB_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL }, + { "GL_ARB_texture_cube_map", o(ARB_texture_cube_map), GL }, + { "GL_ARB_texture_env_add", o(EXT_texture_env_add), GL }, + { "GL_ARB_texture_env_combine", o(ARB_texture_env_combine), GL }, + { "GL_ARB_texture_env_crossbar", o(ARB_texture_env_crossbar), GL }, + { "GL_ARB_texture_env_dot3", o(ARB_texture_env_dot3), GL }, + { "GL_ARB_texture_mirrored_repeat", o(ARB_texture_mirrored_repeat), GL }, + { "GL_ARB_texture_multisample", o(ARB_texture_multisample), GL }, + { "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), GL }, + { "GL_ARB_texture_rectangle", o(NV_texture_rectangle), GL }, + { "GL_ARB_texture_rgb10_a2ui", o(ARB_texture_rgb10_a2ui), GL }, + { "GL_ARB_texture_rg", o(ARB_texture_rg), GL }, + { "GL_ARB_texture_swizzle", o(EXT_texture_swizzle), GL }, + { "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL }, + { "GL_ARB_transpose_matrix", o(ARB_transpose_matrix), GL }, + { "GL_ARB_uniform_buffer_object", o(ARB_uniform_buffer_object), GL }, + { "GL_ARB_vertex_array_bgra", o(EXT_vertex_array_bgra), GL }, + { "GL_ARB_vertex_array_object", o(ARB_vertex_array_object), GL }, + { "GL_ARB_vertex_buffer_object", o(ARB_vertex_buffer_object), GL }, + { "GL_ARB_vertex_program", o(ARB_vertex_program), GL }, + { "GL_ARB_vertex_shader", o(ARB_vertex_shader), GL }, + { "GL_ARB_vertex_type_2_10_10_10_rev", o(ARB_vertex_type_2_10_10_10_rev), GL }, + { "GL_ARB_window_pos", o(ARB_window_pos), GL }, + + /* EXT extensions */ + { "GL_EXT_abgr", o(EXT_abgr), GL }, + { "GL_EXT_bgra", o(EXT_bgra), GL }, + { "GL_EXT_blend_color", o(EXT_blend_color), GL }, + { "GL_EXT_blend_equation_separate", o(EXT_blend_equation_separate), GL }, + { "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), GL }, + { "GL_EXT_blend_logic_op", o(EXT_blend_logic_op), GL }, + { "GL_EXT_blend_minmax", o(EXT_blend_minmax), GL | ES1 | ES2 }, + { "GL_EXT_blend_subtract", o(EXT_blend_subtract), GL }, + { "GL_EXT_clip_volume_hint", o(EXT_clip_volume_hint), GL }, + { "GL_EXT_compiled_vertex_array", o(EXT_compiled_vertex_array), GL }, + { "GL_EXT_copy_texture", o(EXT_copy_texture), GL }, + { "GL_EXT_depth_bounds_test", o(EXT_depth_bounds_test), GL }, + { "GL_EXT_draw_buffers2", o(EXT_draw_buffers2), GL }, + { "GL_EXT_draw_instanced", o(ARB_draw_instanced), GL }, + { "GL_EXT_draw_range_elements", o(EXT_draw_range_elements), GL }, + { "GL_EXT_fog_coord", o(EXT_fog_coord), GL }, + { "GL_EXT_framebuffer_blit", o(EXT_framebuffer_blit), GL }, + { "GL_EXT_framebuffer_multisample", o(EXT_framebuffer_multisample), GL }, + { "GL_EXT_framebuffer_object", o(EXT_framebuffer_object), GL }, + { "GL_EXT_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL }, + { "GL_EXT_gpu_program_parameters", o(EXT_gpu_program_parameters), GL }, + { "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL }, + { "GL_EXT_multi_draw_arrays", o(EXT_multi_draw_arrays), GL | ES1 | ES2 }, + { "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL }, + { "GL_EXT_packed_float", o(EXT_packed_float), GL }, + { "GL_EXT_packed_pixels", o(EXT_packed_pixels), GL }, + { "GL_EXT_paletted_texture", o(EXT_paletted_texture), GL }, + { "GL_EXT_pixel_buffer_object", o(EXT_pixel_buffer_object), GL }, + { "GL_EXT_point_parameters", o(EXT_point_parameters), GL }, + { "GL_EXT_polygon_offset", o(EXT_polygon_offset), GL }, + { "GL_EXT_provoking_vertex", o(EXT_provoking_vertex), GL }, + { "GL_EXT_rescale_normal", o(EXT_rescale_normal), GL }, + { "GL_EXT_secondary_color", o(EXT_secondary_color), GL }, + { "GL_EXT_separate_shader_objects", o(EXT_separate_shader_objects), GL }, + { "GL_EXT_separate_specular_color", o(EXT_separate_specular_color), GL }, + { "GL_EXT_shadow_funcs", o(EXT_shadow_funcs), GL }, + { "GL_EXT_shared_texture_palette", o(EXT_shared_texture_palette), GL }, + { "GL_EXT_stencil_two_side", o(EXT_stencil_two_side), GL }, + { "GL_EXT_stencil_wrap", o(EXT_stencil_wrap), GL }, + { "GL_EXT_subtexture", o(EXT_subtexture), GL }, + { "GL_EXT_texture3D", o(EXT_texture3D), GL }, + { "GL_EXT_texture_array", o(EXT_texture_array), GL }, + { "GL_EXT_texture_compression_dxt1", o(EXT_texture_compression_s3tc), GL | ES1 | ES2 }, + { "GL_EXT_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL }, + { "GL_EXT_texture_compression_s3tc", o(EXT_texture_compression_s3tc), GL }, + { "GL_EXT_texture_cube_map", o(ARB_texture_cube_map), GL }, + { "GL_EXT_texture_edge_clamp", o(SGIS_texture_edge_clamp), GL }, + { "GL_EXT_texture_env_add", o(EXT_texture_env_add), GL }, + { "GL_EXT_texture_env_combine", o(EXT_texture_env_combine), GL }, + { "GL_EXT_texture_env_dot3", o(EXT_texture_env_dot3), GL }, + { "GL_EXT_texture_filter_anisotropic", o(EXT_texture_filter_anisotropic), GL | ES1 | ES2 }, + { "GL_EXT_texture_format_BGRA8888", o(EXT_texture_format_BGRA8888), ES1 | ES2 }, + { "GL_EXT_texture_integer", o(EXT_texture_integer), GL }, + { "GL_EXT_texture_lod_bias", o(EXT_texture_lod_bias), GL | ES1 }, + { "GL_EXT_texture_mirror_clamp", o(EXT_texture_mirror_clamp), GL }, + { "GL_EXT_texture_object", o(EXT_texture_object), GL }, + { "GL_EXT_texture", o(EXT_texture), GL }, + { "GL_EXT_texture_rectangle", o(NV_texture_rectangle), GL }, + { "GL_EXT_texture_shared_exponent", o(EXT_texture_shared_exponent), GL }, + { "GL_EXT_texture_sRGB", o(EXT_texture_sRGB), GL }, + { "GL_EXT_texture_swizzle", o(EXT_texture_swizzle), GL }, + { "GL_EXT_texture_type_2_10_10_10_REV", o(dummy_true), ES2 }, + { "GL_EXT_timer_query", o(EXT_timer_query), GL }, + { "GL_EXT_transform_feedback", o(EXT_transform_feedback), GL }, + { "GL_EXT_vertex_array_bgra", o(EXT_vertex_array_bgra), GL }, + { "GL_EXT_vertex_array", o(EXT_vertex_array), GL }, + { "GL_EXT_vertex_array_set", o(EXT_vertex_array_set), GL }, + + /* OES extensions */ + { "GL_OES_blend_equation_separate", o(EXT_blend_equation_separate), ES1 }, + { "GL_OES_blend_func_separate", o(EXT_blend_func_separate), ES1 }, + { "GL_OES_blend_subtract", o(EXT_blend_subtract), ES1 }, + { "GL_OES_byte_coordinates", o(dummy_true), ES1 }, + { "GL_OES_compressed_paletted_texture", o(dummy_false), DISABLE }, + { "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2 }, + { "GL_OES_depth32", o(dummy_false), DISABLE }, + { "GL_OES_depth_texture", o(ARB_depth_texture), ES2 }, #if FEATURE_OES_draw_texture - { OFF, "GL_OES_draw_texture", F(OES_draw_texture) }, -#endif /* FEATURE_OES_draw_texture */ + { "GL_OES_draw_texture", o(OES_draw_texture), ES1 | ES2 }, +#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 }, +#endif + { "GL_OES_element_index_uint", o(EXT_vertex_array), ES1 | ES2 }, + { "GL_OES_fbo_render_mipmap", o(EXT_framebuffer_object), ES1 | ES2 }, + { "GL_OES_fixed_point", o(dummy_true), ES1 }, + { "GL_OES_framebuffer_object", o(EXT_framebuffer_object), ES1 }, + { "GL_OES_mapbuffer", o(ARB_vertex_buffer_object), ES1 | ES2 }, + { "GL_OES_matrix_get", o(dummy_true), ES1 }, + { "GL_OES_packed_depth_stencil", o(EXT_packed_depth_stencil), ES1 | ES2 }, + { "GL_OES_point_size_array", o(dummy_true), ES1 }, + { "GL_OES_point_sprite", o(ARB_point_sprite), ES1 }, + { "GL_OES_query_matrix", o(dummy_true), ES1 }, + { "GL_OES_read_format", o(OES_read_format), GL | ES1 }, + { "GL_OES_rgb8_rgba8", o(EXT_framebuffer_object), ES1 | ES2 }, + { "GL_OES_single_precision", o(dummy_true), ES1 }, + { "GL_OES_standard_derivatives", o(OES_standard_derivatives), ES2 }, + { "GL_OES_stencil1", o(dummy_false), DISABLE }, + { "GL_OES_stencil4", o(dummy_false), DISABLE }, + { "GL_OES_stencil8", o(EXT_framebuffer_object), ES1 | ES2 }, + { "GL_OES_stencil_wrap", o(EXT_stencil_wrap), ES1 }, + /* GL_OES_texture_3D is disabled due to missing GLSL support. */ + { "GL_OES_texture_3D", o(EXT_texture3D), DISABLE }, + { "GL_OES_texture_cube_map", o(ARB_texture_cube_map), ES1 }, + { "GL_OES_texture_env_crossbar", o(ARB_texture_env_crossbar), ES1 }, + { "GL_OES_texture_mirrored_repeat", o(ARB_texture_mirrored_repeat), ES1 }, + { "GL_OES_texture_npot", o(ARB_texture_non_power_of_two), ES2 }, + + /* Vendor extensions */ + { "GL_3DFX_texture_compression_FXT1", o(TDFX_texture_compression_FXT1), GL }, + { "GL_APPLE_client_storage", o(APPLE_client_storage), GL }, + { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), GL }, + { "GL_APPLE_packed_pixels", o(APPLE_packed_pixels), GL }, + { "GL_APPLE_vertex_array_object", o(APPLE_vertex_array_object), GL }, + { "GL_ATI_blend_equation_separate", o(EXT_blend_equation_separate), GL }, + { "GL_ATI_envmap_bumpmap", o(ATI_envmap_bumpmap), GL }, + { "GL_ATI_fragment_shader", o(ATI_fragment_shader), GL }, + { "GL_ATI_separate_stencil", o(ATI_separate_stencil), GL }, + { "GL_ATI_texture_env_combine3", o(ATI_texture_env_combine3), GL }, + { "GL_ATI_texture_mirror_once", o(ATI_texture_mirror_once), GL }, + { "GL_IBM_multimode_draw_arrays", o(IBM_multimode_draw_arrays), GL }, + { "GL_IBM_rasterpos_clip", o(IBM_rasterpos_clip), GL }, + { "GL_IBM_texture_mirrored_repeat", o(ARB_texture_mirrored_repeat), GL }, + { "GL_INGR_blend_func_separate", o(EXT_blend_func_separate), GL }, + { "GL_MESA_pack_invert", o(MESA_pack_invert), GL }, + { "GL_MESA_resize_buffers", o(MESA_resize_buffers), GL }, + { "GL_MESA_texture_array", o(MESA_texture_array), GL }, + { "GL_MESA_texture_signed_rgba", o(MESA_texture_signed_rgba), GL }, + { "GL_MESA_window_pos", o(ARB_window_pos), GL }, + { "GL_MESAX_texture_float", o(ARB_texture_float), GL }, + { "GL_MESA_ycbcr_texture", o(MESA_ycbcr_texture), GL }, + { "GL_NV_blend_square", o(NV_blend_square), GL }, + { "GL_NV_conditional_render", o(NV_conditional_render), GL }, + { "GL_NV_depth_clamp", o(ARB_depth_clamp), GL }, + { "GL_NV_fragment_program", o(NV_fragment_program), GL }, + { "GL_NV_fragment_program_option", o(NV_fragment_program_option), GL }, + { "GL_NV_light_max_exponent", o(NV_light_max_exponent), GL }, + { "GL_NV_packed_depth_stencil", o(EXT_packed_depth_stencil), GL }, + { "GL_NV_point_sprite", o(NV_point_sprite), GL }, + { "GL_NV_primitive_restart", o(NV_primitive_restart), GL }, + { "GL_NV_texgen_reflection", o(NV_texgen_reflection), GL }, + { "GL_NV_texture_env_combine4", o(NV_texture_env_combine4), GL }, + { "GL_NV_texture_rectangle", o(NV_texture_rectangle), GL }, + { "GL_NV_vertex_program1_1", o(NV_vertex_program1_1), GL }, + { "GL_NV_vertex_program", o(NV_vertex_program), GL }, + { "GL_S3_s3tc", o(S3_s3tc), GL }, + { "GL_SGIS_generate_mipmap", o(SGIS_generate_mipmap), GL }, + { "GL_SGIS_texture_border_clamp", o(ARB_texture_border_clamp), GL }, + { "GL_SGIS_texture_edge_clamp", o(SGIS_texture_edge_clamp), GL }, + { "GL_SGIS_texture_lod", o(SGIS_texture_lod), GL }, + { "GL_SGI_texture_color_table", o(SGI_texture_color_table), GL }, + { "GL_SUN_multi_draw_arrays", o(EXT_multi_draw_arrays), GL }, + + { 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. @@ -250,7 +393,8 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) #if FEATURE_ARB_framebuffer_object ctx->Extensions.ARB_framebuffer_object = GL_TRUE; #endif -#if FEATURE_ARB_geometry_shader4 +#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; @@ -259,6 +403,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) 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 @@ -511,8 +656,7 @@ _mesa_enable_2_1_extensions(struct gl_context *ctx) static GLboolean set_extension( struct gl_context *ctx, const char *name, GLboolean state ) { - GLboolean *base = (GLboolean *) &ctx->Extensions; - GLuint i; + size_t offset; if (ctx->Extensions.String) { /* The string was already queried - can't change it now! */ @@ -520,16 +664,20 @@ set_extension( struct gl_context *ctx, const char *name, GLboolean state ) return GL_FALSE; } - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (strcmp(default_extensions[i].name, name) == 0) { - if (default_extensions[i].flag_offset) { - GLboolean *enabled = base + default_extensions[i].flag_offset; - *enabled = state; - } - return GL_TRUE; - } + 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; } - return GL_FALSE; } @@ -558,36 +706,22 @@ _mesa_disable_extension( struct gl_context *ctx, const char *name ) /** - * Check if the i-th extension is enabled. - */ -static GLboolean -extension_enabled(struct gl_context *ctx, GLuint index) -{ - const GLboolean *base = (const GLboolean *) &ctx->Extensions; - if (!default_extensions[index].flag_offset || - *(base + default_extensions[index].flag_offset)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - - -/** * Test if the named extension is enabled in this context. */ GLboolean _mesa_extension_is_enabled( struct gl_context *ctx, const char *name ) { - GLuint i; + size_t offset; + GLboolean *base; - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (strcmp(default_extensions[i].name, name) == 0) { - return extension_enabled(ctx, i); - } - } - return GL_FALSE; + if (name == 0) + return GL_FALSE; + + offset = name_to_offset(name); + if (offset == 0) + return GL_FALSE; + base = (GLboolean *) &ctx->Extensions; + return base[offset]; } @@ -618,8 +752,10 @@ append(const char *a, const char *b) * For extension names that are recognized, turn them on. For extension * names that are recognized and prefixed with '-', turn them off. * Return a string of the unknown/leftover names. + * + * Returnd string needs to be freed. */ -static const char * +static char * get_extension_override( struct gl_context *ctx ) { const char *envExt = _mesa_getenv("MESA_EXTENSION_OVERRIDE"); @@ -666,22 +802,27 @@ get_extension_override( struct gl_context *ctx ) /** - * Run through the default_extensions array above and set the - * ctx->Extensions.ARB/EXT_* flags accordingly. - * To be called during context initialization. + * \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; - GLuint i; - - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (default_extensions[i].enabled && - default_extensions[i].flag_offset) { - *(base + default_extensions[i].flag_offset) = GL_TRUE; - } - } + 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; } @@ -689,254 +830,46 @@ _mesa_init_extensions( struct gl_context *ctx ) * Construct the GL_EXTENSIONS string. Called the first time that * glGetString(GL_EXTENSIONS) is called. */ -static GLubyte * -compute_extensions( struct gl_context *ctx ) +GLubyte* +_mesa_make_extension_string(struct gl_context *ctx) { - const char *extraExt = get_extension_override(ctx); - GLuint extStrLen = 0; - char *s; - GLuint i; + /* The extension string. */ + char *exts = 0; + /* Length of extension string. */ + size_t length = 0; + /* String of extra extensions. */ + char *extra_extensions = get_extension_override(ctx); + GLboolean *base = (GLboolean *) &ctx->Extensions; + const struct extension *i; - /* first, compute length of the extension string */ - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (extension_enabled(ctx, i)) { - extStrLen += (GLuint) strlen(default_extensions[i].name) + 1; + /* Compute length of the extension string. */ + for (i = extension_table; i->name != 0; ++i) { + if (base[i->offset] && (i->api_set & (1 << ctx->API))) { + length += strlen(i->name) + 1; /* +1 for space */ } } + if (extra_extensions != NULL) + length += 1 + strlen(extra_extensions); /* +1 for space */ - if (extraExt) - extStrLen += strlen(extraExt) + 1; /* +1 for space */ - - /* allocate the extension string */ - s = (char *) malloc(extStrLen); - if (!s) + exts = (char *) calloc(length + 1, sizeof(char)); + if (exts == NULL) { + free(extra_extensions); return NULL; - - /* second, build the extension string */ - extStrLen = 0; - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (extension_enabled(ctx, i)) { - GLuint len = (GLuint) strlen(default_extensions[i].name); - memcpy(s + extStrLen, default_extensions[i].name, len); - extStrLen += len; - s[extStrLen] = ' '; - extStrLen++; - } } - ASSERT(extStrLen > 0); - - s[extStrLen - 1] = 0; /* -1 to overwrite trailing the ' ' */ - - if (extraExt) { - s = append(s, " "); - s = append(s, extraExt); - } - - return (GLubyte *) s; -} -static size_t -append_extension(GLubyte **str, const char *ext) -{ - GLubyte *s = *str; - size_t len = strlen(ext); - - if (s) { - memcpy(s, ext, len); - s[len++] = ' '; - s[len] = '\0'; - - *str += len; + /* Build the extension string.*/ + for (i = extension_table; i->name != 0; ++i) { + if (base[i->offset] && (i->api_set & (1 << ctx->API))) { + strcat(exts, i->name); + strcat(exts, " "); + } } - else { - len++; + if (extra_extensions != 0) { + strcat(exts, extra_extensions); + free(extra_extensions); } - return len; -} - - -static size_t -make_extension_string_es1(const struct gl_context *ctx, GLubyte *str) -{ - size_t len = 0; - - /* Core additions */ - len += append_extension(&str, "GL_OES_byte_coordinates"); - len += append_extension(&str, "GL_OES_fixed_point"); - len += append_extension(&str, "GL_OES_single_precision"); - len += append_extension(&str, "GL_OES_matrix_get"); - - /* 1.1 required extensions */ - len += append_extension(&str, "GL_OES_read_format"); - len += append_extension(&str, "GL_OES_compressed_paletted_texture"); - len += append_extension(&str, "GL_OES_point_size_array"); - len += append_extension(&str, "GL_OES_point_sprite"); - - /* 1.1 deprecated extensions */ - len += append_extension(&str, "GL_OES_query_matrix"); - -#if FEATURE_OES_draw_texture - if (ctx->Extensions.OES_draw_texture) - len += append_extension(&str, "GL_OES_draw_texture"); -#endif - - if (ctx->Extensions.EXT_blend_equation_separate) - len += append_extension(&str, "GL_OES_blend_equation_separate"); - if (ctx->Extensions.EXT_blend_func_separate) - len += append_extension(&str, "GL_OES_blend_func_separate"); - if (ctx->Extensions.EXT_blend_subtract) - len += append_extension(&str, "GL_OES_blend_subtract"); - - if (ctx->Extensions.EXT_stencil_wrap) - len += append_extension(&str, "GL_OES_stencil_wrap"); - - if (ctx->Extensions.ARB_texture_cube_map) - len += append_extension(&str, "GL_OES_texture_cube_map"); - if (ctx->Extensions.ARB_texture_env_crossbar) - len += append_extension(&str, "GL_OES_texture_env_crossbar"); - if (ctx->Extensions.ARB_texture_mirrored_repeat) - len += append_extension(&str, "GL_OES_texture_mirrored_repeat"); - - if (ctx->Extensions.ARB_framebuffer_object) { - len += append_extension(&str, "GL_OES_framebuffer_object"); - len += append_extension(&str, "GL_OES_depth24"); - len += append_extension(&str, "GL_OES_depth32"); - len += append_extension(&str, "GL_OES_fbo_render_mipmap"); - len += append_extension(&str, "GL_OES_rgb8_rgba8"); - len += append_extension(&str, "GL_OES_stencil1"); - len += append_extension(&str, "GL_OES_stencil4"); - len += append_extension(&str, "GL_OES_stencil8"); - } - - if (ctx->Extensions.EXT_vertex_array) - len += append_extension(&str, "GL_OES_element_index_uint"); - if (ctx->Extensions.ARB_vertex_buffer_object) - len += append_extension(&str, "GL_OES_mapbuffer"); - if (ctx->Extensions.EXT_texture_filter_anisotropic) - len += append_extension(&str, "GL_EXT_texture_filter_anisotropic"); - - /* some applications check this for NPOT support */ - if (ctx->Extensions.ARB_texture_non_power_of_two) - len += append_extension(&str, "GL_ARB_texture_non_power_of_two"); - - if (ctx->Extensions.EXT_texture_compression_s3tc) - len += append_extension(&str, "GL_EXT_texture_compression_dxt1"); - if (ctx->Extensions.EXT_texture_lod_bias) - len += append_extension(&str, "GL_EXT_texture_lod_bias"); - if (ctx->Extensions.EXT_blend_minmax) - len += append_extension(&str, "GL_EXT_blend_minmax"); - if (ctx->Extensions.EXT_multi_draw_arrays) - len += append_extension(&str, "GL_EXT_multi_draw_arrays"); - -#if FEATURE_OES_EGL_image - if (ctx->Extensions.OES_EGL_image) - len += append_extension(&str, "GL_OES_EGL_image"); -#endif - - return len; -} - - -static GLubyte * -compute_extensions_es1(const struct gl_context *ctx) -{ - GLubyte *s; - unsigned int len; - - len = make_extension_string_es1(ctx, NULL); - s = malloc(len + 1); - if (!s) - return NULL; - make_extension_string_es1(ctx, s); - - return s; -} - -static size_t -make_extension_string_es2(const struct gl_context *ctx, GLubyte *str) -{ - size_t len = 0; - - len += append_extension(&str, "GL_OES_compressed_paletted_texture"); - - if (ctx->Extensions.ARB_framebuffer_object) { - len += append_extension(&str, "GL_OES_depth24"); - len += append_extension(&str, "GL_OES_depth32"); - len += append_extension(&str, "GL_OES_fbo_render_mipmap"); - len += append_extension(&str, "GL_OES_rgb8_rgba8"); - len += append_extension(&str, "GL_OES_stencil1"); - len += append_extension(&str, "GL_OES_stencil4"); - } - - if (ctx->Extensions.EXT_vertex_array) - len += append_extension(&str, "GL_OES_element_index_uint"); - if (ctx->Extensions.ARB_vertex_buffer_object) - len += append_extension(&str, "GL_OES_mapbuffer"); - - if (ctx->Extensions.EXT_texture3D) - len += append_extension(&str, "GL_OES_texture_3D"); - if (ctx->Extensions.ARB_texture_non_power_of_two) - len += append_extension(&str, "GL_OES_texture_npot"); - if (ctx->Extensions.EXT_texture_filter_anisotropic) - len += append_extension(&str, "GL_EXT_texture_filter_anisotropic"); - - len += append_extension(&str, "GL_EXT_texture_type_2_10_10_10_REV"); - if (ctx->Extensions.ARB_depth_texture) - len += append_extension(&str, "GL_OES_depth_texture"); - if (ctx->Extensions.EXT_packed_depth_stencil) - len += append_extension(&str, "GL_OES_packed_depth_stencil"); - if (ctx->Extensions.ARB_fragment_shader) - len += append_extension(&str, "GL_OES_standard_derivatives"); - - if (ctx->Extensions.EXT_texture_compression_s3tc) - len += append_extension(&str, "GL_EXT_texture_compression_dxt1"); - if (ctx->Extensions.EXT_blend_minmax) - len += append_extension(&str, "GL_EXT_blend_minmax"); - if (ctx->Extensions.EXT_multi_draw_arrays) - len += append_extension(&str, "GL_EXT_multi_draw_arrays"); - -#if FEATURE_OES_EGL_image - if (ctx->Extensions.OES_EGL_image) - len += append_extension(&str, "GL_OES_EGL_image"); -#endif - - if (ctx->Extensions.EXT_texture_format_BGRA8888) - len += append_extension(&str, "GL_EXT_texture_format_BGRA8888"); - - return len; -} - -static GLubyte * -compute_extensions_es2(struct gl_context *ctx) -{ - GLubyte *s; - unsigned int len; - - len = make_extension_string_es2(ctx, NULL); - s = malloc(len + 1); - if (!s) - return NULL; - make_extension_string_es2(ctx, s); - - return s; -} - - -GLubyte * -_mesa_make_extension_string(struct gl_context *ctx) -{ - switch (ctx->API) { - case API_OPENGL: - return compute_extensions(ctx); - case API_OPENGLES2: - return compute_extensions_es2(ctx); - case API_OPENGLES: - return compute_extensions_es1(ctx); - default: - assert(0); - return NULL; - } + return (GLubyte *) exts; } /** @@ -945,38 +878,42 @@ _mesa_make_extension_string(struct gl_context *ctx) GLuint _mesa_get_extension_count(struct gl_context *ctx) { - GLuint i; + GLboolean *base; + const struct extension *i; /* only count once */ - if (!ctx->Extensions.Count) { - for (i = 0; i < Elements(default_extensions); i++) { - if (extension_enabled(ctx, i)) { - ctx->Extensions.Count++; - } + 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++; } } - - if (0) - _mesa_debug(ctx, "%u of %d extensions enabled\n", ctx->Extensions.Count, - (int) Elements(default_extensions)); - return ctx->Extensions.Count; } - /** * Return name of i-th enabled extension */ const GLubyte * _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index) { - GLuint i; + const GLboolean *base; + size_t n; + const struct extension *i; + + if (index < 0) + return NULL; - for (i = 0; i < Elements(default_extensions); i++) { - if (extension_enabled(ctx, i)) { - if (index == 0) - return (const GLubyte *) default_extensions[i].name; - index--; + 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; } } diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 7c33570..f31d8b3 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -40,6 +40,8 @@ #include "framebuffer.h" #include "hash.h" #include "macros.h" +#include "mfeatures.h" +#include "mtypes.h" #include "renderbuffer.h" #include "state.h" #include "teximage.h" @@ -402,8 +404,8 @@ fbo_incomplete(const char *msg, int index) /** * Is the given base format a legal format for a color renderbuffer? */ -static GLboolean -is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat) +GLboolean +_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat) { switch (baseFormat) { case GL_RGB: @@ -488,7 +490,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, baseFormat = _mesa_get_format_base_format(texImage->TexFormat); if (format == GL_COLOR) { - if (!is_legal_color_format(ctx, baseFormat)) { + if (!_mesa_is_legal_color_format(ctx, baseFormat)) { att_incomplete("bad format"); att->Complete = GL_FALSE; return; @@ -542,8 +544,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, return; } if (format == GL_COLOR) { - if (baseFormat != GL_RGB && - baseFormat != GL_RGBA) { + if (!_mesa_is_legal_color_format(ctx, baseFormat)) { att_incomplete("bad renderbuffer color format"); att->Complete = GL_FALSE; return; @@ -669,7 +670,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, f = texImg->_BaseFormat; mesaFormat = texImg->TexFormat; numImages++; - if (!is_legal_color_format(ctx, f) && + if (!_mesa_is_legal_color_format(ctx, f) && !is_legal_depth_format(ctx, f)) { fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; fbo_incomplete("texture attachment incomplete", -1); @@ -793,7 +794,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, fb->Height = minHeight; /* finally, update the visual info for the framebuffer */ - _mesa_update_framebuffer_visual(fb); + _mesa_update_framebuffer_visual(ctx, fb); } } @@ -959,67 +960,42 @@ _mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) /** - * Given an internal format token for a render buffer, return the + * Given an internal format token for a renderbuffer, return the * corresponding base format. - * This is very similar to _mesa_base_tex_format() but the set of valid - * internal formats is somewhat different. - * - * \return one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT - * GL_DEPTH_STENCIL_EXT or zero if error. - * - * XXX in the future when we support red-only and red-green formats - * we'll also return GL_RED and GL_RG. */ GLenum _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) { + GLenum baseFormat; + switch (internalFormat) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return GL_ALPHA; - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return GL_RGB; - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: case GL_RGBA16_SNORM: + /* This is used internally by Mesa for accum buffers. */ return GL_RGBA; case GL_STENCIL_INDEX: case GL_STENCIL_INDEX1_EXT: case GL_STENCIL_INDEX4_EXT: case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: + /* This is not a valid texture internalFormat, but valid for + * renderbuffers. + */ return GL_STENCIL_INDEX; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: + /* This is an override of _mesa_base_tex_format's check that + * ARB_depth_texture is present. We allow depth RBs without it. + */ return GL_DEPTH_COMPONENT; - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil) - return GL_DEPTH_STENCIL_EXT; - else - return 0; - /* XXX add floating point formats eventually */ - default: - return 0; } + + baseFormat = _mesa_base_tex_format(ctx, internalFormat); + if (baseFormat < 0) + return 0; + + return baseFormat; } @@ -1055,6 +1031,14 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, return; } + if (baseFormat != GL_DEPTH_COMPONENT && + baseFormat != GL_STENCIL_INDEX && + baseFormat != GL_DEPTH_STENCIL && + !_mesa_is_legal_color_format(ctx, baseFormat)) { + _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func); + return; + } + if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func); return; @@ -1172,8 +1156,17 @@ get_component_bits(GLenum pname, GLenum baseFormat, gl_format format) switch (pname) { case GL_RENDERBUFFER_RED_SIZE_EXT: case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA || + baseFormat == GL_RG || baseFormat == GL_RED) + return _mesa_get_format_bits(format, pname); + else + return 0; case GL_RENDERBUFFER_GREEN_SIZE_EXT: case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA || baseFormat == GL_RG) + return _mesa_get_format_bits(format, pname); + else + return 0; case GL_RENDERBUFFER_BLUE_SIZE_EXT: case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: if (baseFormat == GL_RGB || baseFormat == GL_RGBA) @@ -1182,7 +1175,8 @@ get_component_bits(GLenum pname, GLenum baseFormat, gl_format format) return 0; case GL_RENDERBUFFER_ALPHA_SIZE_EXT: case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: - if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA) + if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA || + baseFormat == GL_LUMINANCE_ALPHA) return _mesa_get_format_bits(format, pname); else return 0; @@ -1913,6 +1907,13 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, " renderbuffer %u)", renderbuffer); return; } + else if (rb == &DummyRenderbuffer) { + /* This is what NVIDIA does */ + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferRenderbufferEXT(renderbuffer %u)", + renderbuffer); + return; + } } else { /* remove renderbuffer attachment */ @@ -1940,7 +1941,7 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, /* Some subsequent GL commands may depend on the framebuffer's visual * after the binding is updated. Update visual info now. */ - _mesa_update_framebuffer_visual(fb); + _mesa_update_framebuffer_visual(ctx, fb); } @@ -2014,7 +2015,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, switch (pname) { case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: - *params = att->Type; + *params = buffer->Name == 0 ? GL_FRAMEBUFFER_DEFAULT : att->Type; return; case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT: if (att->Type == GL_RENDERBUFFER_EXT) { @@ -2024,8 +2025,8 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, *params = att->Texture->Name; } else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + assert(att->Type == GL_NONE); + *params = 0; } return; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT: @@ -2146,6 +2147,7 @@ _mesa_GenerateMipmapEXT(GLenum target) /* OK, legal value */ break; default: + /* XXX need to implement GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY */ _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)"); return; } @@ -2157,6 +2159,13 @@ _mesa_GenerateMipmapEXT(GLenum target) return; } + if (texObj->Target == GL_TEXTURE_CUBE_MAP && + !_mesa_cube_complete(texObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGenerateMipmap(incomplete cube map)"); + return; + } + _mesa_lock_texture(ctx, texObj); if (target == GL_TEXTURE_CUBE_MAP) { GLuint face; diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index 2aace2e..8763f99 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -71,6 +71,9 @@ _mesa_framebuffer_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb extern void _mesa_test_framebuffer_completeness(struct gl_context *ctx, struct gl_framebuffer *fb); +extern GLboolean +_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat); + extern GLenum _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat); diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index ffdecae..fcb089f 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -35,6 +35,7 @@ #include "enums.h" #include "feedback.h" #include "macros.h" +#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h index f9fbbce..0039a0b 100644 --- a/src/mesa/main/feedback.h +++ b/src/mesa/main/feedback.h @@ -27,6 +27,7 @@ #define FEEDBACK_H +#include "main/mfeatures.h" #include "main/mtypes.h" diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 0f2c313..b8e49a3 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -36,6 +36,7 @@ #include "main/glheader.h" #include "main/mtypes.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/enums.h" #include "main/ffvertex_prog.h" #include "program/program.h" diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 88a04e8..1bc7272 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -40,9 +40,10 @@ struct gl_format_info const char *StrName; /** - * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, - * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX, - * GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL. + * Base format is one of GL_RED, GL_RG, GL_RGB, GL_RGBA, GL_ALPHA, + * GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_YCBCR_MESA, + * GL_COLOR_INDEX, GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, + * GL_DEPTH_STENCIL, GL_DUDV_ATI. */ GLenum BaseFormat; @@ -222,6 +223,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { + MESA_FORMAT_AL44, /* Name */ + "MESA_FORMAT_AL44", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 4, /* Red/Green/Blue/AlphaBits */ + 4, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { MESA_FORMAT_AL88, /* Name */ "MESA_FORMAT_AL88", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ @@ -276,6 +286,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { + MESA_FORMAT_A16, /* Name */ + "MESA_FORMAT_A16", /* StrName */ + GL_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { MESA_FORMAT_L8, /* Name */ "MESA_FORMAT_L8", /* StrName */ GL_LUMINANCE, /* BaseFormat */ @@ -285,6 +304,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { + MESA_FORMAT_L16, /* Name */ + "MESA_FORMAT_L16", /* StrName */ + GL_LUMINANCE, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { MESA_FORMAT_I8, /* Name */ "MESA_FORMAT_I8", /* StrName */ GL_INTENSITY, /* BaseFormat */ @@ -294,6 +322,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { + MESA_FORMAT_I16, /* Name */ + "MESA_FORMAT_I16", /* StrName */ + GL_INTENSITY, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 16, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { MESA_FORMAT_CI8, /* Name */ "MESA_FORMAT_CI8", /* StrName */ GL_COLOR_INDEX, /* BaseFormat */ @@ -375,6 +412,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { + MESA_FORMAT_ARGB2101010, + "MESA_FORMAT_ARGB2101010", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 10, 10, 10, 2, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { MESA_FORMAT_Z24_S8, /* Name */ "MESA_FORMAT_Z24_S8", /* StrName */ GL_DEPTH_STENCIL, /* BaseFormat */ @@ -756,7 +802,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_SIGNED_R8, /* Name */ "MESA_FORMAT_SIGNED_R8", /* StrName */ - GL_RGBA, /* BaseFormat */ + GL_RED, /* BaseFormat */ GL_SIGNED_NORMALIZED, /* DataType */ 8, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ @@ -765,7 +811,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_SIGNED_RG88, "MESA_FORMAT_SIGNED_RG88", - GL_RGBA, + GL_RG, GL_SIGNED_NORMALIZED, 8, 8, 0, 0, 0, 0, 0, 0, 0, @@ -774,7 +820,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_SIGNED_RGBX8888, "MESA_FORMAT_SIGNED_RGBX8888", - GL_RGBA, + GL_RGB, GL_SIGNED_NORMALIZED, 8, 8, 8, 0, 0, 0, 0, 0, 0, @@ -803,7 +849,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_SIGNED_R_16, "MESA_FORMAT_SIGNED_R_16", - GL_RGBA, + GL_RED, GL_SIGNED_NORMALIZED, 16, 0, 0, 0, 0, 0, 0, 0, 0, @@ -812,7 +858,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_SIGNED_RG_16, "MESA_FORMAT_SIGNED_RG_16", - GL_RGBA, + GL_RG, GL_SIGNED_NORMALIZED, 16, 16, 0, 0, 0, 0, 0, 0, 0, @@ -821,7 +867,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_SIGNED_RGB_16, "MESA_FORMAT_SIGNED_RGB_16", - GL_RGBA, + GL_RGB, GL_SIGNED_NORMALIZED, 16, 16, 16, 0, 0, 0, 0, 0, 0, @@ -863,7 +909,6 @@ const char * _mesa_get_format_name(gl_format format) { const struct gl_format_info *info = _mesa_get_format_info(format); - ASSERT(info->BytesPerBlock); return info->StrName; } @@ -1057,11 +1102,12 @@ _mesa_format_image_size(gl_format format, GLsizei width, const struct gl_format_info *info = _mesa_get_format_info(format); /* Strictly speaking, a conditional isn't needed here */ if (info->BlockWidth > 1 || info->BlockHeight > 1) { - /* compressed format */ + /* compressed format (2D only for now) */ const GLuint bw = info->BlockWidth, bh = info->BlockHeight; const GLuint wblocks = (width + bw - 1) / bw; const GLuint hblocks = (height + bh - 1) / bh; const GLuint sz = wblocks * hblocks * info->BytesPerBlock; + assert(depth == 1); return sz; } else { @@ -1072,6 +1118,36 @@ _mesa_format_image_size(gl_format format, GLsizei width, } +/** + * Same as _mesa_format_image_size() but returns a 64-bit value to + * accomodate very large textures. + */ +uint64_t +_mesa_format_image_size64(gl_format format, GLsizei width, + GLsizei height, GLsizei depth) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + /* Strictly speaking, a conditional isn't needed here */ + if (info->BlockWidth > 1 || info->BlockHeight > 1) { + /* compressed format (2D only for now) */ + const uint64_t bw = info->BlockWidth, bh = info->BlockHeight; + const uint64_t wblocks = (width + bw - 1) / bw; + const uint64_t hblocks = (height + bh - 1) / bh; + const uint64_t sz = wblocks * hblocks * info->BytesPerBlock; + assert(depth == 1); + return sz; + } + else { + /* non-compressed */ + const uint64_t sz = ((uint64_t) width * + (uint64_t) height * + (uint64_t) depth * + info->BytesPerBlock); + return sz; + } +} + + GLint _mesa_format_row_stride(gl_format format, GLsizei width) @@ -1092,6 +1168,27 @@ _mesa_format_row_stride(gl_format format, GLsizei width) } +/** + * Debug/test: check that all formats are handled in the + * _mesa_format_to_type_and_comps() function. When new pixel formats + * are added to Mesa, that function needs to be updated. + * This is a no-op after the first call. + */ +static void +check_format_to_type_and_comps(void) +{ + gl_format f; + + for (f = MESA_FORMAT_NONE + 1; f < MESA_FORMAT_COUNT; f++) { + GLenum datatype = 0; + GLuint comps = 0; + /* This function will emit a problem/warning if the format is + * not handled. + */ + _mesa_format_to_type_and_comps(f, &datatype, &comps); + } +} + /** * Do sanity checking of the format info table. @@ -1116,7 +1213,7 @@ _mesa_test_formats(void) if (info->RedBits > 0) { GLuint t = info->RedBits + info->GreenBits + info->BlueBits + info->AlphaBits; - assert(t / 8 == info->BytesPerBlock); + assert(t / 8 <= info->BytesPerBlock); (void) t; } } @@ -1124,6 +1221,7 @@ _mesa_test_formats(void) assert(info->DataType == GL_UNSIGNED_NORMALIZED || info->DataType == GL_SIGNED_NORMALIZED || info->DataType == GL_UNSIGNED_INT || + info->DataType == GL_INT || info->DataType == GL_FLOAT); if (info->BaseFormat == GL_RGB) { @@ -1174,8 +1272,9 @@ _mesa_test_formats(void) assert(info->LuminanceBits == 0); assert(info->IntensityBits > 0); } - } + + check_format_to_type_and_comps(); } @@ -1221,11 +1320,17 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; + case MESA_FORMAT_ARGB2101010: + *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; + *comps = 4; + return; + case MESA_FORMAT_RGBA5551: *datatype = GL_UNSIGNED_SHORT_5_5_5_1; *comps = 4; return; + case MESA_FORMAT_AL44: /* XXX this isn't plain GL_UNSIGNED_BYTE */ case MESA_FORMAT_AL88: case MESA_FORMAT_AL88_REV: case MESA_FORMAT_RG88: @@ -1243,6 +1348,9 @@ _mesa_format_to_type_and_comps(gl_format format, return; case MESA_FORMAT_R16: + case MESA_FORMAT_A16: + case MESA_FORMAT_L16: + case MESA_FORMAT_I16: *datatype = GL_UNSIGNED_SHORT; *comps = 1; return; @@ -1447,10 +1555,13 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; - case MESA_FORMAT_NONE: case MESA_FORMAT_COUNT: + assert(0); + return; + + case MESA_FORMAT_NONE: /* For debug builds, warn if any formats are not handled */ -#ifndef DEBUG +#ifdef DEBUG default: #endif _mesa_problem(NULL, "bad format %s in _mesa_format_to_type_and_comps", diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index eeb460d..b8e7666 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -65,14 +65,18 @@ typedef enum MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ + MESA_FORMAT_AL44, /* AAAA LLLL */ MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ MESA_FORMAT_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ MESA_FORMAT_AL1616_REV, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */ MESA_FORMAT_RGB332, /* RRRG GGBB */ MESA_FORMAT_A8, /* AAAA AAAA */ + MESA_FORMAT_A16, /* AAAA AAAA AAAA AAAA */ MESA_FORMAT_L8, /* LLLL LLLL */ + MESA_FORMAT_L16, /* LLLL LLLL LLLL LLLL */ MESA_FORMAT_I8, /* IIII IIII */ + MESA_FORMAT_I16, /* IIII IIII IIII IIII */ MESA_FORMAT_CI8, /* CCCC CCCC */ MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ @@ -82,6 +86,7 @@ typedef enum MESA_FORMAT_R16, /* RRRR RRRR RRRR RRRR */ MESA_FORMAT_RG1616, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ MESA_FORMAT_RG1616_REV, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ + MESA_FORMAT_ARGB2101010, /* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ @@ -209,6 +214,10 @@ extern GLuint _mesa_format_image_size(gl_format format, GLsizei width, GLsizei height, GLsizei depth); +extern uint64_t +_mesa_format_image_size64(gl_format format, GLsizei width, + GLsizei height, GLsizei depth); + extern GLint _mesa_format_row_stride(gl_format format, GLsizei width); diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 5530c51..63da71c 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -522,7 +522,8 @@ _mesa_update_draw_buffer_bounds(struct gl_context *ctx) * integer Z values. */ void -_mesa_update_framebuffer_visual(struct gl_framebuffer *fb) +_mesa_update_framebuffer_visual(struct gl_context *ctx, + struct gl_framebuffer *fb) { GLuint i; @@ -542,9 +543,8 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); const gl_format fmt = rb->Format; - - if (baseFormat == GL_RGBA || baseFormat == GL_RGB || - baseFormat == GL_ALPHA) { + + if (_mesa_is_legal_color_format(ctx, baseFormat)) { fb->Visual.redBits = _mesa_get_format_bits(fmt, GL_RED_BITS); fb->Visual.greenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS); fb->Visual.blueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS); diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h index 20e3ff5..c3bd638 100644 --- a/src/mesa/main/framebuffer.h +++ b/src/mesa/main/framebuffer.h @@ -70,7 +70,8 @@ extern void _mesa_update_draw_buffer_bounds(struct gl_context *ctx); extern void -_mesa_update_framebuffer_visual(struct gl_framebuffer *fb); +_mesa_update_framebuffer_visual(struct gl_context *ctx, + struct gl_framebuffer *fb); extern void _mesa_update_depth_buffer(struct gl_context *ctx, struct gl_framebuffer *fb, diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index b54af6e..ba273ce 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -29,6 +29,7 @@ #include "extensions.h" #include "get.h" #include "macros.h" +#include "mfeatures.h" #include "mtypes.h" #include "state.h" #include "texcompress.h" @@ -272,6 +273,7 @@ static const int extra_EXT_gpu_shader4[] = { }; +EXTRA_EXT(ARB_ES2_compatibility); EXTRA_EXT(ARB_multitexture); EXTRA_EXT(ARB_texture_cube_map); EXTRA_EXT(MESA_texture_array); @@ -314,6 +316,7 @@ EXTRA_EXT2(ARB_vertex_program, NV_vertex_program); EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program); EXTRA_EXT(ARB_vertex_buffer_object); EXTRA_EXT(ARB_geometry_shader4); +EXTRA_EXT(ARB_copy_buffer); static const int extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = { @@ -469,6 +472,10 @@ static const struct value_desc values[] = { { GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_vertex_buffer_object }, + /* GL_ARB_copy_buffer */ + { GL_COPY_READ_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer }, + { GL_COPY_WRITE_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer }, + /* GL_OES_read_format */ { GL_IMPLEMENTATION_COLOR_READ_TYPE_OES, LOC_CUSTOM, TYPE_INT, 0, extra_new_buffers_OES_read_format }, @@ -581,6 +588,15 @@ static const struct value_desc values[] = { { GL_TEXTURE_COORD_ARRAY_STRIDE, LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_client_array, Stride), NO_EXTRA }, + /* GL_ARB_ES2_compatibility */ + { GL_SHADER_COMPILER, CONST(1), extra_ARB_ES2_compatibility }, + { GL_MAX_VARYING_VECTORS, CONTEXT_INT(Const.MaxVarying), + extra_ARB_ES2_compatibility }, + { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, + extra_ARB_ES2_compatibility }, + { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, + extra_ARB_ES2_compatibility }, + /* GL_ARB_multitexture */ { GL_MAX_TEXTURE_UNITS_ARB, CONTEXT_INT(Const.MaxTextureUnits), extra_ARB_multitexture }, @@ -700,12 +716,9 @@ static const struct value_desc values[] = { #if FEATURE_ES2 /* Enums unique to OpenGL ES 2.0 */ { 0, 0, TYPE_API_MASK, API_OPENGLES2_BIT, NO_EXTRA }, - { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_context, Const.FragmentProgram.MaxUniformComponents), NO_EXTRA }, - { GL_MAX_VARYING_VECTORS, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_context, Const.MaxVarying), NO_EXTRA }, - { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_context, Const.VertexProgram.MaxUniformComponents), NO_EXTRA }, + { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA }, + { GL_MAX_VARYING_VECTORS, CONTEXT_INT(Const.MaxVarying), NO_EXTRA }, + { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA }, { GL_SHADER_COMPILER, CONST(1), NO_EXTRA }, /* OES_get_program_binary */ { GL_NUM_SHADER_BINARY_FORMATS, CONST(0), NO_EXTRA }, @@ -1112,6 +1125,14 @@ static const struct value_desc values[] = { extra_valid_draw_buffer }, { GL_DRAW_BUFFER3_ARB, BUFFER_ENUM(ColorDrawBuffer[3]), extra_valid_draw_buffer }, + { GL_DRAW_BUFFER4_ARB, BUFFER_ENUM(ColorDrawBuffer[4]), + extra_valid_draw_buffer }, + { GL_DRAW_BUFFER5_ARB, BUFFER_ENUM(ColorDrawBuffer[5]), + extra_valid_draw_buffer }, + { GL_DRAW_BUFFER6_ARB, BUFFER_ENUM(ColorDrawBuffer[6]), + extra_valid_draw_buffer }, + { GL_DRAW_BUFFER7_ARB, BUFFER_ENUM(ColorDrawBuffer[7]), + extra_valid_draw_buffer }, /* GL_ATI_fragment_shader */ { GL_NUM_FRAGMENT_REGISTERS_ATI, CONST(6), extra_ATI_fragment_shader }, @@ -1564,6 +1585,14 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int = ctx->Array.ElementArrayBufferObj->Name; break; + /* ARB_copy_buffer */ + case GL_COPY_READ_BUFFER: + v->value_int = ctx->CopyReadBuffer->Name; + break; + case GL_COPY_WRITE_BUFFER: + v->value_int = ctx->CopyWriteBuffer->Name; + break; + case GL_FRAGMENT_PROGRAM_BINDING_NV: v->value_int = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0; @@ -1604,6 +1633,14 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: v->value_int = ctx->Array.ArrayObj->PointSize.BufferObj->Name; break; + + case GL_MAX_VERTEX_UNIFORM_VECTORS: + v->value_int = ctx->Const.VertexProgram.MaxUniformComponents / 4; + break; + + case GL_MAX_FRAGMENT_UNIFORM_VECTORS: + v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4; + break; } } @@ -1733,16 +1770,18 @@ find_value(const char *func, GLenum pname, void **p, union value *v) hash = (pname * prime_factor); while (1) { d = &values[table[hash & mask]]; - if (likely(d->pname == pname)) - break; /* If the enum isn't valid, the hash walk ends with index 0, * which is the API mask entry at the beginning of values[]. */ - if (d->type == TYPE_API_MASK) { + if (unlikely(d->type == TYPE_API_MASK)) { _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func, _mesa_lookup_enum_by_nr(pname)); return &error_value; } + + if (likely(d->pname == pname)) + break; + hash += prime_step; } @@ -2282,8 +2321,10 @@ void GLAPIENTRY _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params ) { union value v; + enum value_type type = + find_value_indexed("glGetBooleanIndexedv", pname, index, &v); - switch (find_value_indexed("glGetBooleanIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = INT_TO_BOOLEAN(v.value_int); break; @@ -2297,7 +2338,7 @@ _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params ) params[0] = INT64_TO_BOOLEAN(v.value_int); break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } @@ -2305,8 +2346,10 @@ void GLAPIENTRY _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) { union value v; + enum value_type type = + find_value_indexed("glGetIntegerIndexedv", pname, index, &v); - switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = v.value_int; break; @@ -2320,7 +2363,7 @@ _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) params[0] = INT64_TO_INT(v.value_int); break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } @@ -2329,8 +2372,10 @@ void GLAPIENTRY _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) { union value v; + enum value_type type = + find_value_indexed("glGetIntegerIndexedv", pname, index, &v); - switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = v.value_int; break; @@ -2344,7 +2389,7 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) params[0] = v.value_int; break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } #endif /* FEATURE_ARB_sync */ diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index bfa283f..f8866f6 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -29,6 +29,8 @@ #include "get.h" #include "enums.h" #include "extensions.h" +#include "mfeatures.h" +#include "mtypes.h" /** diff --git a/src/mesa/main/glapidispatch.h b/src/mesa/main/glapidispatch.h index 8778426..29823d0 100644 --- a/src/mesa/main/glapidispatch.h +++ b/src/mesa/main/glapidispatch.h @@ -59,7 +59,7 @@ } while(0) /* total number of offsets below */ -#define _gloffset_COUNT 881 +#define _gloffset_COUNT 886 #define _gloffset_NewList 0 #define _gloffset_EndList 1 @@ -664,291 +664,296 @@ #define _gloffset_IsTransformFeedback 597 #define _gloffset_PauseTransformFeedback 598 #define _gloffset_ResumeTransformFeedback 599 -#define _gloffset_PolygonOffsetEXT 600 -#define _gloffset_GetPixelTexGenParameterfvSGIS 601 -#define _gloffset_GetPixelTexGenParameterivSGIS 602 -#define _gloffset_PixelTexGenParameterfSGIS 603 -#define _gloffset_PixelTexGenParameterfvSGIS 604 -#define _gloffset_PixelTexGenParameteriSGIS 605 -#define _gloffset_PixelTexGenParameterivSGIS 606 -#define _gloffset_SampleMaskSGIS 607 -#define _gloffset_SamplePatternSGIS 608 -#define _gloffset_ColorPointerEXT 609 -#define _gloffset_EdgeFlagPointerEXT 610 -#define _gloffset_IndexPointerEXT 611 -#define _gloffset_NormalPointerEXT 612 -#define _gloffset_TexCoordPointerEXT 613 -#define _gloffset_VertexPointerEXT 614 -#define _gloffset_PointParameterfEXT 615 -#define _gloffset_PointParameterfvEXT 616 -#define _gloffset_LockArraysEXT 617 -#define _gloffset_UnlockArraysEXT 618 -#define _gloffset_SecondaryColor3bEXT 619 -#define _gloffset_SecondaryColor3bvEXT 620 -#define _gloffset_SecondaryColor3dEXT 621 -#define _gloffset_SecondaryColor3dvEXT 622 -#define _gloffset_SecondaryColor3fEXT 623 -#define _gloffset_SecondaryColor3fvEXT 624 -#define _gloffset_SecondaryColor3iEXT 625 -#define _gloffset_SecondaryColor3ivEXT 626 -#define _gloffset_SecondaryColor3sEXT 627 -#define _gloffset_SecondaryColor3svEXT 628 -#define _gloffset_SecondaryColor3ubEXT 629 -#define _gloffset_SecondaryColor3ubvEXT 630 -#define _gloffset_SecondaryColor3uiEXT 631 -#define _gloffset_SecondaryColor3uivEXT 632 -#define _gloffset_SecondaryColor3usEXT 633 -#define _gloffset_SecondaryColor3usvEXT 634 -#define _gloffset_SecondaryColorPointerEXT 635 -#define _gloffset_MultiDrawArraysEXT 636 -#define _gloffset_MultiDrawElementsEXT 637 -#define _gloffset_FogCoordPointerEXT 638 -#define _gloffset_FogCoorddEXT 639 -#define _gloffset_FogCoorddvEXT 640 -#define _gloffset_FogCoordfEXT 641 -#define _gloffset_FogCoordfvEXT 642 -#define _gloffset_PixelTexGenSGIX 643 -#define _gloffset_BlendFuncSeparateEXT 644 -#define _gloffset_FlushVertexArrayRangeNV 645 -#define _gloffset_VertexArrayRangeNV 646 -#define _gloffset_CombinerInputNV 647 -#define _gloffset_CombinerOutputNV 648 -#define _gloffset_CombinerParameterfNV 649 -#define _gloffset_CombinerParameterfvNV 650 -#define _gloffset_CombinerParameteriNV 651 -#define _gloffset_CombinerParameterivNV 652 -#define _gloffset_FinalCombinerInputNV 653 -#define _gloffset_GetCombinerInputParameterfvNV 654 -#define _gloffset_GetCombinerInputParameterivNV 655 -#define _gloffset_GetCombinerOutputParameterfvNV 656 -#define _gloffset_GetCombinerOutputParameterivNV 657 -#define _gloffset_GetFinalCombinerInputParameterfvNV 658 -#define _gloffset_GetFinalCombinerInputParameterivNV 659 -#define _gloffset_ResizeBuffersMESA 660 -#define _gloffset_WindowPos2dMESA 661 -#define _gloffset_WindowPos2dvMESA 662 -#define _gloffset_WindowPos2fMESA 663 -#define _gloffset_WindowPos2fvMESA 664 -#define _gloffset_WindowPos2iMESA 665 -#define _gloffset_WindowPos2ivMESA 666 -#define _gloffset_WindowPos2sMESA 667 -#define _gloffset_WindowPos2svMESA 668 -#define _gloffset_WindowPos3dMESA 669 -#define _gloffset_WindowPos3dvMESA 670 -#define _gloffset_WindowPos3fMESA 671 -#define _gloffset_WindowPos3fvMESA 672 -#define _gloffset_WindowPos3iMESA 673 -#define _gloffset_WindowPos3ivMESA 674 -#define _gloffset_WindowPos3sMESA 675 -#define _gloffset_WindowPos3svMESA 676 -#define _gloffset_WindowPos4dMESA 677 -#define _gloffset_WindowPos4dvMESA 678 -#define _gloffset_WindowPos4fMESA 679 -#define _gloffset_WindowPos4fvMESA 680 -#define _gloffset_WindowPos4iMESA 681 -#define _gloffset_WindowPos4ivMESA 682 -#define _gloffset_WindowPos4sMESA 683 -#define _gloffset_WindowPos4svMESA 684 -#define _gloffset_MultiModeDrawArraysIBM 685 -#define _gloffset_MultiModeDrawElementsIBM 686 -#define _gloffset_DeleteFencesNV 687 -#define _gloffset_FinishFenceNV 688 -#define _gloffset_GenFencesNV 689 -#define _gloffset_GetFenceivNV 690 -#define _gloffset_IsFenceNV 691 -#define _gloffset_SetFenceNV 692 -#define _gloffset_TestFenceNV 693 -#define _gloffset_AreProgramsResidentNV 694 -#define _gloffset_BindProgramNV 695 -#define _gloffset_DeleteProgramsNV 696 -#define _gloffset_ExecuteProgramNV 697 -#define _gloffset_GenProgramsNV 698 -#define _gloffset_GetProgramParameterdvNV 699 -#define _gloffset_GetProgramParameterfvNV 700 -#define _gloffset_GetProgramStringNV 701 -#define _gloffset_GetProgramivNV 702 -#define _gloffset_GetTrackMatrixivNV 703 -#define _gloffset_GetVertexAttribPointervNV 704 -#define _gloffset_GetVertexAttribdvNV 705 -#define _gloffset_GetVertexAttribfvNV 706 -#define _gloffset_GetVertexAttribivNV 707 -#define _gloffset_IsProgramNV 708 -#define _gloffset_LoadProgramNV 709 -#define _gloffset_ProgramParameters4dvNV 710 -#define _gloffset_ProgramParameters4fvNV 711 -#define _gloffset_RequestResidentProgramsNV 712 -#define _gloffset_TrackMatrixNV 713 -#define _gloffset_VertexAttrib1dNV 714 -#define _gloffset_VertexAttrib1dvNV 715 -#define _gloffset_VertexAttrib1fNV 716 -#define _gloffset_VertexAttrib1fvNV 717 -#define _gloffset_VertexAttrib1sNV 718 -#define _gloffset_VertexAttrib1svNV 719 -#define _gloffset_VertexAttrib2dNV 720 -#define _gloffset_VertexAttrib2dvNV 721 -#define _gloffset_VertexAttrib2fNV 722 -#define _gloffset_VertexAttrib2fvNV 723 -#define _gloffset_VertexAttrib2sNV 724 -#define _gloffset_VertexAttrib2svNV 725 -#define _gloffset_VertexAttrib3dNV 726 -#define _gloffset_VertexAttrib3dvNV 727 -#define _gloffset_VertexAttrib3fNV 728 -#define _gloffset_VertexAttrib3fvNV 729 -#define _gloffset_VertexAttrib3sNV 730 -#define _gloffset_VertexAttrib3svNV 731 -#define _gloffset_VertexAttrib4dNV 732 -#define _gloffset_VertexAttrib4dvNV 733 -#define _gloffset_VertexAttrib4fNV 734 -#define _gloffset_VertexAttrib4fvNV 735 -#define _gloffset_VertexAttrib4sNV 736 -#define _gloffset_VertexAttrib4svNV 737 -#define _gloffset_VertexAttrib4ubNV 738 -#define _gloffset_VertexAttrib4ubvNV 739 -#define _gloffset_VertexAttribPointerNV 740 -#define _gloffset_VertexAttribs1dvNV 741 -#define _gloffset_VertexAttribs1fvNV 742 -#define _gloffset_VertexAttribs1svNV 743 -#define _gloffset_VertexAttribs2dvNV 744 -#define _gloffset_VertexAttribs2fvNV 745 -#define _gloffset_VertexAttribs2svNV 746 -#define _gloffset_VertexAttribs3dvNV 747 -#define _gloffset_VertexAttribs3fvNV 748 -#define _gloffset_VertexAttribs3svNV 749 -#define _gloffset_VertexAttribs4dvNV 750 -#define _gloffset_VertexAttribs4fvNV 751 -#define _gloffset_VertexAttribs4svNV 752 -#define _gloffset_VertexAttribs4ubvNV 753 -#define _gloffset_GetTexBumpParameterfvATI 754 -#define _gloffset_GetTexBumpParameterivATI 755 -#define _gloffset_TexBumpParameterfvATI 756 -#define _gloffset_TexBumpParameterivATI 757 -#define _gloffset_AlphaFragmentOp1ATI 758 -#define _gloffset_AlphaFragmentOp2ATI 759 -#define _gloffset_AlphaFragmentOp3ATI 760 -#define _gloffset_BeginFragmentShaderATI 761 -#define _gloffset_BindFragmentShaderATI 762 -#define _gloffset_ColorFragmentOp1ATI 763 -#define _gloffset_ColorFragmentOp2ATI 764 -#define _gloffset_ColorFragmentOp3ATI 765 -#define _gloffset_DeleteFragmentShaderATI 766 -#define _gloffset_EndFragmentShaderATI 767 -#define _gloffset_GenFragmentShadersATI 768 -#define _gloffset_PassTexCoordATI 769 -#define _gloffset_SampleMapATI 770 -#define _gloffset_SetFragmentShaderConstantATI 771 -#define _gloffset_PointParameteriNV 772 -#define _gloffset_PointParameterivNV 773 -#define _gloffset_ActiveStencilFaceEXT 774 -#define _gloffset_BindVertexArrayAPPLE 775 -#define _gloffset_DeleteVertexArraysAPPLE 776 -#define _gloffset_GenVertexArraysAPPLE 777 -#define _gloffset_IsVertexArrayAPPLE 778 -#define _gloffset_GetProgramNamedParameterdvNV 779 -#define _gloffset_GetProgramNamedParameterfvNV 780 -#define _gloffset_ProgramNamedParameter4dNV 781 -#define _gloffset_ProgramNamedParameter4dvNV 782 -#define _gloffset_ProgramNamedParameter4fNV 783 -#define _gloffset_ProgramNamedParameter4fvNV 784 -#define _gloffset_PrimitiveRestartIndexNV 785 -#define _gloffset_PrimitiveRestartNV 786 -#define _gloffset_DepthBoundsEXT 787 -#define _gloffset_BlendEquationSeparateEXT 788 -#define _gloffset_BindFramebufferEXT 789 -#define _gloffset_BindRenderbufferEXT 790 -#define _gloffset_CheckFramebufferStatusEXT 791 -#define _gloffset_DeleteFramebuffersEXT 792 -#define _gloffset_DeleteRenderbuffersEXT 793 -#define _gloffset_FramebufferRenderbufferEXT 794 -#define _gloffset_FramebufferTexture1DEXT 795 -#define _gloffset_FramebufferTexture2DEXT 796 -#define _gloffset_FramebufferTexture3DEXT 797 -#define _gloffset_GenFramebuffersEXT 798 -#define _gloffset_GenRenderbuffersEXT 799 -#define _gloffset_GenerateMipmapEXT 800 -#define _gloffset_GetFramebufferAttachmentParameterivEXT 801 -#define _gloffset_GetRenderbufferParameterivEXT 802 -#define _gloffset_IsFramebufferEXT 803 -#define _gloffset_IsRenderbufferEXT 804 -#define _gloffset_RenderbufferStorageEXT 805 -#define _gloffset_BlitFramebufferEXT 806 -#define _gloffset_BufferParameteriAPPLE 807 -#define _gloffset_FlushMappedBufferRangeAPPLE 808 -#define _gloffset_BindFragDataLocationEXT 809 -#define _gloffset_GetFragDataLocationEXT 810 -#define _gloffset_GetUniformuivEXT 811 -#define _gloffset_GetVertexAttribIivEXT 812 -#define _gloffset_GetVertexAttribIuivEXT 813 -#define _gloffset_Uniform1uiEXT 814 -#define _gloffset_Uniform1uivEXT 815 -#define _gloffset_Uniform2uiEXT 816 -#define _gloffset_Uniform2uivEXT 817 -#define _gloffset_Uniform3uiEXT 818 -#define _gloffset_Uniform3uivEXT 819 -#define _gloffset_Uniform4uiEXT 820 -#define _gloffset_Uniform4uivEXT 821 -#define _gloffset_VertexAttribI1iEXT 822 -#define _gloffset_VertexAttribI1ivEXT 823 -#define _gloffset_VertexAttribI1uiEXT 824 -#define _gloffset_VertexAttribI1uivEXT 825 -#define _gloffset_VertexAttribI2iEXT 826 -#define _gloffset_VertexAttribI2ivEXT 827 -#define _gloffset_VertexAttribI2uiEXT 828 -#define _gloffset_VertexAttribI2uivEXT 829 -#define _gloffset_VertexAttribI3iEXT 830 -#define _gloffset_VertexAttribI3ivEXT 831 -#define _gloffset_VertexAttribI3uiEXT 832 -#define _gloffset_VertexAttribI3uivEXT 833 -#define _gloffset_VertexAttribI4bvEXT 834 -#define _gloffset_VertexAttribI4iEXT 835 -#define _gloffset_VertexAttribI4ivEXT 836 -#define _gloffset_VertexAttribI4svEXT 837 -#define _gloffset_VertexAttribI4ubvEXT 838 -#define _gloffset_VertexAttribI4uiEXT 839 -#define _gloffset_VertexAttribI4uivEXT 840 -#define _gloffset_VertexAttribI4usvEXT 841 -#define _gloffset_VertexAttribIPointerEXT 842 -#define _gloffset_FramebufferTextureLayerEXT 843 -#define _gloffset_ColorMaskIndexedEXT 844 -#define _gloffset_DisableIndexedEXT 845 -#define _gloffset_EnableIndexedEXT 846 -#define _gloffset_GetBooleanIndexedvEXT 847 -#define _gloffset_GetIntegerIndexedvEXT 848 -#define _gloffset_IsEnabledIndexedEXT 849 -#define _gloffset_ClearColorIiEXT 850 -#define _gloffset_ClearColorIuiEXT 851 -#define _gloffset_GetTexParameterIivEXT 852 -#define _gloffset_GetTexParameterIuivEXT 853 -#define _gloffset_TexParameterIivEXT 854 -#define _gloffset_TexParameterIuivEXT 855 -#define _gloffset_BeginConditionalRenderNV 856 -#define _gloffset_EndConditionalRenderNV 857 -#define _gloffset_BeginTransformFeedbackEXT 858 -#define _gloffset_BindBufferBaseEXT 859 -#define _gloffset_BindBufferOffsetEXT 860 -#define _gloffset_BindBufferRangeEXT 861 -#define _gloffset_EndTransformFeedbackEXT 862 -#define _gloffset_GetTransformFeedbackVaryingEXT 863 -#define _gloffset_TransformFeedbackVaryingsEXT 864 -#define _gloffset_ProvokingVertexEXT 865 -#define _gloffset_GetTexParameterPointervAPPLE 866 -#define _gloffset_TextureRangeAPPLE 867 -#define _gloffset_GetObjectParameterivAPPLE 868 -#define _gloffset_ObjectPurgeableAPPLE 869 -#define _gloffset_ObjectUnpurgeableAPPLE 870 -#define _gloffset_ActiveProgramEXT 871 -#define _gloffset_CreateShaderProgramEXT 872 -#define _gloffset_UseShaderProgramEXT 873 -#define _gloffset_StencilFuncSeparateATI 874 -#define _gloffset_ProgramEnvParameters4fvEXT 875 -#define _gloffset_ProgramLocalParameters4fvEXT 876 -#define _gloffset_GetQueryObjecti64vEXT 877 -#define _gloffset_GetQueryObjectui64vEXT 878 -#define _gloffset_EGLImageTargetRenderbufferStorageOES 879 -#define _gloffset_EGLImageTargetTexture2DOES 880 +#define _gloffset_ClearDepthf 600 +#define _gloffset_DepthRangef 601 +#define _gloffset_GetShaderPrecisionFormat 602 +#define _gloffset_ReleaseShaderCompiler 603 +#define _gloffset_ShaderBinary 604 +#define _gloffset_PolygonOffsetEXT 605 +#define _gloffset_GetPixelTexGenParameterfvSGIS 606 +#define _gloffset_GetPixelTexGenParameterivSGIS 607 +#define _gloffset_PixelTexGenParameterfSGIS 608 +#define _gloffset_PixelTexGenParameterfvSGIS 609 +#define _gloffset_PixelTexGenParameteriSGIS 610 +#define _gloffset_PixelTexGenParameterivSGIS 611 +#define _gloffset_SampleMaskSGIS 612 +#define _gloffset_SamplePatternSGIS 613 +#define _gloffset_ColorPointerEXT 614 +#define _gloffset_EdgeFlagPointerEXT 615 +#define _gloffset_IndexPointerEXT 616 +#define _gloffset_NormalPointerEXT 617 +#define _gloffset_TexCoordPointerEXT 618 +#define _gloffset_VertexPointerEXT 619 +#define _gloffset_PointParameterfEXT 620 +#define _gloffset_PointParameterfvEXT 621 +#define _gloffset_LockArraysEXT 622 +#define _gloffset_UnlockArraysEXT 623 +#define _gloffset_SecondaryColor3bEXT 624 +#define _gloffset_SecondaryColor3bvEXT 625 +#define _gloffset_SecondaryColor3dEXT 626 +#define _gloffset_SecondaryColor3dvEXT 627 +#define _gloffset_SecondaryColor3fEXT 628 +#define _gloffset_SecondaryColor3fvEXT 629 +#define _gloffset_SecondaryColor3iEXT 630 +#define _gloffset_SecondaryColor3ivEXT 631 +#define _gloffset_SecondaryColor3sEXT 632 +#define _gloffset_SecondaryColor3svEXT 633 +#define _gloffset_SecondaryColor3ubEXT 634 +#define _gloffset_SecondaryColor3ubvEXT 635 +#define _gloffset_SecondaryColor3uiEXT 636 +#define _gloffset_SecondaryColor3uivEXT 637 +#define _gloffset_SecondaryColor3usEXT 638 +#define _gloffset_SecondaryColor3usvEXT 639 +#define _gloffset_SecondaryColorPointerEXT 640 +#define _gloffset_MultiDrawArraysEXT 641 +#define _gloffset_MultiDrawElementsEXT 642 +#define _gloffset_FogCoordPointerEXT 643 +#define _gloffset_FogCoorddEXT 644 +#define _gloffset_FogCoorddvEXT 645 +#define _gloffset_FogCoordfEXT 646 +#define _gloffset_FogCoordfvEXT 647 +#define _gloffset_PixelTexGenSGIX 648 +#define _gloffset_BlendFuncSeparateEXT 649 +#define _gloffset_FlushVertexArrayRangeNV 650 +#define _gloffset_VertexArrayRangeNV 651 +#define _gloffset_CombinerInputNV 652 +#define _gloffset_CombinerOutputNV 653 +#define _gloffset_CombinerParameterfNV 654 +#define _gloffset_CombinerParameterfvNV 655 +#define _gloffset_CombinerParameteriNV 656 +#define _gloffset_CombinerParameterivNV 657 +#define _gloffset_FinalCombinerInputNV 658 +#define _gloffset_GetCombinerInputParameterfvNV 659 +#define _gloffset_GetCombinerInputParameterivNV 660 +#define _gloffset_GetCombinerOutputParameterfvNV 661 +#define _gloffset_GetCombinerOutputParameterivNV 662 +#define _gloffset_GetFinalCombinerInputParameterfvNV 663 +#define _gloffset_GetFinalCombinerInputParameterivNV 664 +#define _gloffset_ResizeBuffersMESA 665 +#define _gloffset_WindowPos2dMESA 666 +#define _gloffset_WindowPos2dvMESA 667 +#define _gloffset_WindowPos2fMESA 668 +#define _gloffset_WindowPos2fvMESA 669 +#define _gloffset_WindowPos2iMESA 670 +#define _gloffset_WindowPos2ivMESA 671 +#define _gloffset_WindowPos2sMESA 672 +#define _gloffset_WindowPos2svMESA 673 +#define _gloffset_WindowPos3dMESA 674 +#define _gloffset_WindowPos3dvMESA 675 +#define _gloffset_WindowPos3fMESA 676 +#define _gloffset_WindowPos3fvMESA 677 +#define _gloffset_WindowPos3iMESA 678 +#define _gloffset_WindowPos3ivMESA 679 +#define _gloffset_WindowPos3sMESA 680 +#define _gloffset_WindowPos3svMESA 681 +#define _gloffset_WindowPos4dMESA 682 +#define _gloffset_WindowPos4dvMESA 683 +#define _gloffset_WindowPos4fMESA 684 +#define _gloffset_WindowPos4fvMESA 685 +#define _gloffset_WindowPos4iMESA 686 +#define _gloffset_WindowPos4ivMESA 687 +#define _gloffset_WindowPos4sMESA 688 +#define _gloffset_WindowPos4svMESA 689 +#define _gloffset_MultiModeDrawArraysIBM 690 +#define _gloffset_MultiModeDrawElementsIBM 691 +#define _gloffset_DeleteFencesNV 692 +#define _gloffset_FinishFenceNV 693 +#define _gloffset_GenFencesNV 694 +#define _gloffset_GetFenceivNV 695 +#define _gloffset_IsFenceNV 696 +#define _gloffset_SetFenceNV 697 +#define _gloffset_TestFenceNV 698 +#define _gloffset_AreProgramsResidentNV 699 +#define _gloffset_BindProgramNV 700 +#define _gloffset_DeleteProgramsNV 701 +#define _gloffset_ExecuteProgramNV 702 +#define _gloffset_GenProgramsNV 703 +#define _gloffset_GetProgramParameterdvNV 704 +#define _gloffset_GetProgramParameterfvNV 705 +#define _gloffset_GetProgramStringNV 706 +#define _gloffset_GetProgramivNV 707 +#define _gloffset_GetTrackMatrixivNV 708 +#define _gloffset_GetVertexAttribPointervNV 709 +#define _gloffset_GetVertexAttribdvNV 710 +#define _gloffset_GetVertexAttribfvNV 711 +#define _gloffset_GetVertexAttribivNV 712 +#define _gloffset_IsProgramNV 713 +#define _gloffset_LoadProgramNV 714 +#define _gloffset_ProgramParameters4dvNV 715 +#define _gloffset_ProgramParameters4fvNV 716 +#define _gloffset_RequestResidentProgramsNV 717 +#define _gloffset_TrackMatrixNV 718 +#define _gloffset_VertexAttrib1dNV 719 +#define _gloffset_VertexAttrib1dvNV 720 +#define _gloffset_VertexAttrib1fNV 721 +#define _gloffset_VertexAttrib1fvNV 722 +#define _gloffset_VertexAttrib1sNV 723 +#define _gloffset_VertexAttrib1svNV 724 +#define _gloffset_VertexAttrib2dNV 725 +#define _gloffset_VertexAttrib2dvNV 726 +#define _gloffset_VertexAttrib2fNV 727 +#define _gloffset_VertexAttrib2fvNV 728 +#define _gloffset_VertexAttrib2sNV 729 +#define _gloffset_VertexAttrib2svNV 730 +#define _gloffset_VertexAttrib3dNV 731 +#define _gloffset_VertexAttrib3dvNV 732 +#define _gloffset_VertexAttrib3fNV 733 +#define _gloffset_VertexAttrib3fvNV 734 +#define _gloffset_VertexAttrib3sNV 735 +#define _gloffset_VertexAttrib3svNV 736 +#define _gloffset_VertexAttrib4dNV 737 +#define _gloffset_VertexAttrib4dvNV 738 +#define _gloffset_VertexAttrib4fNV 739 +#define _gloffset_VertexAttrib4fvNV 740 +#define _gloffset_VertexAttrib4sNV 741 +#define _gloffset_VertexAttrib4svNV 742 +#define _gloffset_VertexAttrib4ubNV 743 +#define _gloffset_VertexAttrib4ubvNV 744 +#define _gloffset_VertexAttribPointerNV 745 +#define _gloffset_VertexAttribs1dvNV 746 +#define _gloffset_VertexAttribs1fvNV 747 +#define _gloffset_VertexAttribs1svNV 748 +#define _gloffset_VertexAttribs2dvNV 749 +#define _gloffset_VertexAttribs2fvNV 750 +#define _gloffset_VertexAttribs2svNV 751 +#define _gloffset_VertexAttribs3dvNV 752 +#define _gloffset_VertexAttribs3fvNV 753 +#define _gloffset_VertexAttribs3svNV 754 +#define _gloffset_VertexAttribs4dvNV 755 +#define _gloffset_VertexAttribs4fvNV 756 +#define _gloffset_VertexAttribs4svNV 757 +#define _gloffset_VertexAttribs4ubvNV 758 +#define _gloffset_GetTexBumpParameterfvATI 759 +#define _gloffset_GetTexBumpParameterivATI 760 +#define _gloffset_TexBumpParameterfvATI 761 +#define _gloffset_TexBumpParameterivATI 762 +#define _gloffset_AlphaFragmentOp1ATI 763 +#define _gloffset_AlphaFragmentOp2ATI 764 +#define _gloffset_AlphaFragmentOp3ATI 765 +#define _gloffset_BeginFragmentShaderATI 766 +#define _gloffset_BindFragmentShaderATI 767 +#define _gloffset_ColorFragmentOp1ATI 768 +#define _gloffset_ColorFragmentOp2ATI 769 +#define _gloffset_ColorFragmentOp3ATI 770 +#define _gloffset_DeleteFragmentShaderATI 771 +#define _gloffset_EndFragmentShaderATI 772 +#define _gloffset_GenFragmentShadersATI 773 +#define _gloffset_PassTexCoordATI 774 +#define _gloffset_SampleMapATI 775 +#define _gloffset_SetFragmentShaderConstantATI 776 +#define _gloffset_PointParameteriNV 777 +#define _gloffset_PointParameterivNV 778 +#define _gloffset_ActiveStencilFaceEXT 779 +#define _gloffset_BindVertexArrayAPPLE 780 +#define _gloffset_DeleteVertexArraysAPPLE 781 +#define _gloffset_GenVertexArraysAPPLE 782 +#define _gloffset_IsVertexArrayAPPLE 783 +#define _gloffset_GetProgramNamedParameterdvNV 784 +#define _gloffset_GetProgramNamedParameterfvNV 785 +#define _gloffset_ProgramNamedParameter4dNV 786 +#define _gloffset_ProgramNamedParameter4dvNV 787 +#define _gloffset_ProgramNamedParameter4fNV 788 +#define _gloffset_ProgramNamedParameter4fvNV 789 +#define _gloffset_PrimitiveRestartIndexNV 790 +#define _gloffset_PrimitiveRestartNV 791 +#define _gloffset_DepthBoundsEXT 792 +#define _gloffset_BlendEquationSeparateEXT 793 +#define _gloffset_BindFramebufferEXT 794 +#define _gloffset_BindRenderbufferEXT 795 +#define _gloffset_CheckFramebufferStatusEXT 796 +#define _gloffset_DeleteFramebuffersEXT 797 +#define _gloffset_DeleteRenderbuffersEXT 798 +#define _gloffset_FramebufferRenderbufferEXT 799 +#define _gloffset_FramebufferTexture1DEXT 800 +#define _gloffset_FramebufferTexture2DEXT 801 +#define _gloffset_FramebufferTexture3DEXT 802 +#define _gloffset_GenFramebuffersEXT 803 +#define _gloffset_GenRenderbuffersEXT 804 +#define _gloffset_GenerateMipmapEXT 805 +#define _gloffset_GetFramebufferAttachmentParameterivEXT 806 +#define _gloffset_GetRenderbufferParameterivEXT 807 +#define _gloffset_IsFramebufferEXT 808 +#define _gloffset_IsRenderbufferEXT 809 +#define _gloffset_RenderbufferStorageEXT 810 +#define _gloffset_BlitFramebufferEXT 811 +#define _gloffset_BufferParameteriAPPLE 812 +#define _gloffset_FlushMappedBufferRangeAPPLE 813 +#define _gloffset_BindFragDataLocationEXT 814 +#define _gloffset_GetFragDataLocationEXT 815 +#define _gloffset_GetUniformuivEXT 816 +#define _gloffset_GetVertexAttribIivEXT 817 +#define _gloffset_GetVertexAttribIuivEXT 818 +#define _gloffset_Uniform1uiEXT 819 +#define _gloffset_Uniform1uivEXT 820 +#define _gloffset_Uniform2uiEXT 821 +#define _gloffset_Uniform2uivEXT 822 +#define _gloffset_Uniform3uiEXT 823 +#define _gloffset_Uniform3uivEXT 824 +#define _gloffset_Uniform4uiEXT 825 +#define _gloffset_Uniform4uivEXT 826 +#define _gloffset_VertexAttribI1iEXT 827 +#define _gloffset_VertexAttribI1ivEXT 828 +#define _gloffset_VertexAttribI1uiEXT 829 +#define _gloffset_VertexAttribI1uivEXT 830 +#define _gloffset_VertexAttribI2iEXT 831 +#define _gloffset_VertexAttribI2ivEXT 832 +#define _gloffset_VertexAttribI2uiEXT 833 +#define _gloffset_VertexAttribI2uivEXT 834 +#define _gloffset_VertexAttribI3iEXT 835 +#define _gloffset_VertexAttribI3ivEXT 836 +#define _gloffset_VertexAttribI3uiEXT 837 +#define _gloffset_VertexAttribI3uivEXT 838 +#define _gloffset_VertexAttribI4bvEXT 839 +#define _gloffset_VertexAttribI4iEXT 840 +#define _gloffset_VertexAttribI4ivEXT 841 +#define _gloffset_VertexAttribI4svEXT 842 +#define _gloffset_VertexAttribI4ubvEXT 843 +#define _gloffset_VertexAttribI4uiEXT 844 +#define _gloffset_VertexAttribI4uivEXT 845 +#define _gloffset_VertexAttribI4usvEXT 846 +#define _gloffset_VertexAttribIPointerEXT 847 +#define _gloffset_FramebufferTextureLayerEXT 848 +#define _gloffset_ColorMaskIndexedEXT 849 +#define _gloffset_DisableIndexedEXT 850 +#define _gloffset_EnableIndexedEXT 851 +#define _gloffset_GetBooleanIndexedvEXT 852 +#define _gloffset_GetIntegerIndexedvEXT 853 +#define _gloffset_IsEnabledIndexedEXT 854 +#define _gloffset_ClearColorIiEXT 855 +#define _gloffset_ClearColorIuiEXT 856 +#define _gloffset_GetTexParameterIivEXT 857 +#define _gloffset_GetTexParameterIuivEXT 858 +#define _gloffset_TexParameterIivEXT 859 +#define _gloffset_TexParameterIuivEXT 860 +#define _gloffset_BeginConditionalRenderNV 861 +#define _gloffset_EndConditionalRenderNV 862 +#define _gloffset_BeginTransformFeedbackEXT 863 +#define _gloffset_BindBufferBaseEXT 864 +#define _gloffset_BindBufferOffsetEXT 865 +#define _gloffset_BindBufferRangeEXT 866 +#define _gloffset_EndTransformFeedbackEXT 867 +#define _gloffset_GetTransformFeedbackVaryingEXT 868 +#define _gloffset_TransformFeedbackVaryingsEXT 869 +#define _gloffset_ProvokingVertexEXT 870 +#define _gloffset_GetTexParameterPointervAPPLE 871 +#define _gloffset_TextureRangeAPPLE 872 +#define _gloffset_GetObjectParameterivAPPLE 873 +#define _gloffset_ObjectPurgeableAPPLE 874 +#define _gloffset_ObjectUnpurgeableAPPLE 875 +#define _gloffset_ActiveProgramEXT 876 +#define _gloffset_CreateShaderProgramEXT 877 +#define _gloffset_UseShaderProgramEXT 878 +#define _gloffset_StencilFuncSeparateATI 879 +#define _gloffset_ProgramEnvParameters4fvEXT 880 +#define _gloffset_ProgramLocalParameters4fvEXT 881 +#define _gloffset_GetQueryObjecti64vEXT 882 +#define _gloffset_GetQueryObjectui64vEXT 883 +#define _gloffset_EGLImageTargetRenderbufferStorageOES 884 +#define _gloffset_EGLImageTargetTexture2DOES 885 #else /* !_GLAPI_USE_REMAP_TABLE */ -#define driDispatchRemapTable_size 473 +#define driDispatchRemapTable_size 478 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define AttachShader_remap_index 0 @@ -1143,287 +1148,292 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define IsTransformFeedback_remap_index 189 #define PauseTransformFeedback_remap_index 190 #define ResumeTransformFeedback_remap_index 191 -#define PolygonOffsetEXT_remap_index 192 -#define GetPixelTexGenParameterfvSGIS_remap_index 193 -#define GetPixelTexGenParameterivSGIS_remap_index 194 -#define PixelTexGenParameterfSGIS_remap_index 195 -#define PixelTexGenParameterfvSGIS_remap_index 196 -#define PixelTexGenParameteriSGIS_remap_index 197 -#define PixelTexGenParameterivSGIS_remap_index 198 -#define SampleMaskSGIS_remap_index 199 -#define SamplePatternSGIS_remap_index 200 -#define ColorPointerEXT_remap_index 201 -#define EdgeFlagPointerEXT_remap_index 202 -#define IndexPointerEXT_remap_index 203 -#define NormalPointerEXT_remap_index 204 -#define TexCoordPointerEXT_remap_index 205 -#define VertexPointerEXT_remap_index 206 -#define PointParameterfEXT_remap_index 207 -#define PointParameterfvEXT_remap_index 208 -#define LockArraysEXT_remap_index 209 -#define UnlockArraysEXT_remap_index 210 -#define SecondaryColor3bEXT_remap_index 211 -#define SecondaryColor3bvEXT_remap_index 212 -#define SecondaryColor3dEXT_remap_index 213 -#define SecondaryColor3dvEXT_remap_index 214 -#define SecondaryColor3fEXT_remap_index 215 -#define SecondaryColor3fvEXT_remap_index 216 -#define SecondaryColor3iEXT_remap_index 217 -#define SecondaryColor3ivEXT_remap_index 218 -#define SecondaryColor3sEXT_remap_index 219 -#define SecondaryColor3svEXT_remap_index 220 -#define SecondaryColor3ubEXT_remap_index 221 -#define SecondaryColor3ubvEXT_remap_index 222 -#define SecondaryColor3uiEXT_remap_index 223 -#define SecondaryColor3uivEXT_remap_index 224 -#define SecondaryColor3usEXT_remap_index 225 -#define SecondaryColor3usvEXT_remap_index 226 -#define SecondaryColorPointerEXT_remap_index 227 -#define MultiDrawArraysEXT_remap_index 228 -#define MultiDrawElementsEXT_remap_index 229 -#define FogCoordPointerEXT_remap_index 230 -#define FogCoorddEXT_remap_index 231 -#define FogCoorddvEXT_remap_index 232 -#define FogCoordfEXT_remap_index 233 -#define FogCoordfvEXT_remap_index 234 -#define PixelTexGenSGIX_remap_index 235 -#define BlendFuncSeparateEXT_remap_index 236 -#define FlushVertexArrayRangeNV_remap_index 237 -#define VertexArrayRangeNV_remap_index 238 -#define CombinerInputNV_remap_index 239 -#define CombinerOutputNV_remap_index 240 -#define CombinerParameterfNV_remap_index 241 -#define CombinerParameterfvNV_remap_index 242 -#define CombinerParameteriNV_remap_index 243 -#define CombinerParameterivNV_remap_index 244 -#define FinalCombinerInputNV_remap_index 245 -#define GetCombinerInputParameterfvNV_remap_index 246 -#define GetCombinerInputParameterivNV_remap_index 247 -#define GetCombinerOutputParameterfvNV_remap_index 248 -#define GetCombinerOutputParameterivNV_remap_index 249 -#define GetFinalCombinerInputParameterfvNV_remap_index 250 -#define GetFinalCombinerInputParameterivNV_remap_index 251 -#define ResizeBuffersMESA_remap_index 252 -#define WindowPos2dMESA_remap_index 253 -#define WindowPos2dvMESA_remap_index 254 -#define WindowPos2fMESA_remap_index 255 -#define WindowPos2fvMESA_remap_index 256 -#define WindowPos2iMESA_remap_index 257 -#define WindowPos2ivMESA_remap_index 258 -#define WindowPos2sMESA_remap_index 259 -#define WindowPos2svMESA_remap_index 260 -#define WindowPos3dMESA_remap_index 261 -#define WindowPos3dvMESA_remap_index 262 -#define WindowPos3fMESA_remap_index 263 -#define WindowPos3fvMESA_remap_index 264 -#define WindowPos3iMESA_remap_index 265 -#define WindowPos3ivMESA_remap_index 266 -#define WindowPos3sMESA_remap_index 267 -#define WindowPos3svMESA_remap_index 268 -#define WindowPos4dMESA_remap_index 269 -#define WindowPos4dvMESA_remap_index 270 -#define WindowPos4fMESA_remap_index 271 -#define WindowPos4fvMESA_remap_index 272 -#define WindowPos4iMESA_remap_index 273 -#define WindowPos4ivMESA_remap_index 274 -#define WindowPos4sMESA_remap_index 275 -#define WindowPos4svMESA_remap_index 276 -#define MultiModeDrawArraysIBM_remap_index 277 -#define MultiModeDrawElementsIBM_remap_index 278 -#define DeleteFencesNV_remap_index 279 -#define FinishFenceNV_remap_index 280 -#define GenFencesNV_remap_index 281 -#define GetFenceivNV_remap_index 282 -#define IsFenceNV_remap_index 283 -#define SetFenceNV_remap_index 284 -#define TestFenceNV_remap_index 285 -#define AreProgramsResidentNV_remap_index 286 -#define BindProgramNV_remap_index 287 -#define DeleteProgramsNV_remap_index 288 -#define ExecuteProgramNV_remap_index 289 -#define GenProgramsNV_remap_index 290 -#define GetProgramParameterdvNV_remap_index 291 -#define GetProgramParameterfvNV_remap_index 292 -#define GetProgramStringNV_remap_index 293 -#define GetProgramivNV_remap_index 294 -#define GetTrackMatrixivNV_remap_index 295 -#define GetVertexAttribPointervNV_remap_index 296 -#define GetVertexAttribdvNV_remap_index 297 -#define GetVertexAttribfvNV_remap_index 298 -#define GetVertexAttribivNV_remap_index 299 -#define IsProgramNV_remap_index 300 -#define LoadProgramNV_remap_index 301 -#define ProgramParameters4dvNV_remap_index 302 -#define ProgramParameters4fvNV_remap_index 303 -#define RequestResidentProgramsNV_remap_index 304 -#define TrackMatrixNV_remap_index 305 -#define VertexAttrib1dNV_remap_index 306 -#define VertexAttrib1dvNV_remap_index 307 -#define VertexAttrib1fNV_remap_index 308 -#define VertexAttrib1fvNV_remap_index 309 -#define VertexAttrib1sNV_remap_index 310 -#define VertexAttrib1svNV_remap_index 311 -#define VertexAttrib2dNV_remap_index 312 -#define VertexAttrib2dvNV_remap_index 313 -#define VertexAttrib2fNV_remap_index 314 -#define VertexAttrib2fvNV_remap_index 315 -#define VertexAttrib2sNV_remap_index 316 -#define VertexAttrib2svNV_remap_index 317 -#define VertexAttrib3dNV_remap_index 318 -#define VertexAttrib3dvNV_remap_index 319 -#define VertexAttrib3fNV_remap_index 320 -#define VertexAttrib3fvNV_remap_index 321 -#define VertexAttrib3sNV_remap_index 322 -#define VertexAttrib3svNV_remap_index 323 -#define VertexAttrib4dNV_remap_index 324 -#define VertexAttrib4dvNV_remap_index 325 -#define VertexAttrib4fNV_remap_index 326 -#define VertexAttrib4fvNV_remap_index 327 -#define VertexAttrib4sNV_remap_index 328 -#define VertexAttrib4svNV_remap_index 329 -#define VertexAttrib4ubNV_remap_index 330 -#define VertexAttrib4ubvNV_remap_index 331 -#define VertexAttribPointerNV_remap_index 332 -#define VertexAttribs1dvNV_remap_index 333 -#define VertexAttribs1fvNV_remap_index 334 -#define VertexAttribs1svNV_remap_index 335 -#define VertexAttribs2dvNV_remap_index 336 -#define VertexAttribs2fvNV_remap_index 337 -#define VertexAttribs2svNV_remap_index 338 -#define VertexAttribs3dvNV_remap_index 339 -#define VertexAttribs3fvNV_remap_index 340 -#define VertexAttribs3svNV_remap_index 341 -#define VertexAttribs4dvNV_remap_index 342 -#define VertexAttribs4fvNV_remap_index 343 -#define VertexAttribs4svNV_remap_index 344 -#define VertexAttribs4ubvNV_remap_index 345 -#define GetTexBumpParameterfvATI_remap_index 346 -#define GetTexBumpParameterivATI_remap_index 347 -#define TexBumpParameterfvATI_remap_index 348 -#define TexBumpParameterivATI_remap_index 349 -#define AlphaFragmentOp1ATI_remap_index 350 -#define AlphaFragmentOp2ATI_remap_index 351 -#define AlphaFragmentOp3ATI_remap_index 352 -#define BeginFragmentShaderATI_remap_index 353 -#define BindFragmentShaderATI_remap_index 354 -#define ColorFragmentOp1ATI_remap_index 355 -#define ColorFragmentOp2ATI_remap_index 356 -#define ColorFragmentOp3ATI_remap_index 357 -#define DeleteFragmentShaderATI_remap_index 358 -#define EndFragmentShaderATI_remap_index 359 -#define GenFragmentShadersATI_remap_index 360 -#define PassTexCoordATI_remap_index 361 -#define SampleMapATI_remap_index 362 -#define SetFragmentShaderConstantATI_remap_index 363 -#define PointParameteriNV_remap_index 364 -#define PointParameterivNV_remap_index 365 -#define ActiveStencilFaceEXT_remap_index 366 -#define BindVertexArrayAPPLE_remap_index 367 -#define DeleteVertexArraysAPPLE_remap_index 368 -#define GenVertexArraysAPPLE_remap_index 369 -#define IsVertexArrayAPPLE_remap_index 370 -#define GetProgramNamedParameterdvNV_remap_index 371 -#define GetProgramNamedParameterfvNV_remap_index 372 -#define ProgramNamedParameter4dNV_remap_index 373 -#define ProgramNamedParameter4dvNV_remap_index 374 -#define ProgramNamedParameter4fNV_remap_index 375 -#define ProgramNamedParameter4fvNV_remap_index 376 -#define PrimitiveRestartIndexNV_remap_index 377 -#define PrimitiveRestartNV_remap_index 378 -#define DepthBoundsEXT_remap_index 379 -#define BlendEquationSeparateEXT_remap_index 380 -#define BindFramebufferEXT_remap_index 381 -#define BindRenderbufferEXT_remap_index 382 -#define CheckFramebufferStatusEXT_remap_index 383 -#define DeleteFramebuffersEXT_remap_index 384 -#define DeleteRenderbuffersEXT_remap_index 385 -#define FramebufferRenderbufferEXT_remap_index 386 -#define FramebufferTexture1DEXT_remap_index 387 -#define FramebufferTexture2DEXT_remap_index 388 -#define FramebufferTexture3DEXT_remap_index 389 -#define GenFramebuffersEXT_remap_index 390 -#define GenRenderbuffersEXT_remap_index 391 -#define GenerateMipmapEXT_remap_index 392 -#define GetFramebufferAttachmentParameterivEXT_remap_index 393 -#define GetRenderbufferParameterivEXT_remap_index 394 -#define IsFramebufferEXT_remap_index 395 -#define IsRenderbufferEXT_remap_index 396 -#define RenderbufferStorageEXT_remap_index 397 -#define BlitFramebufferEXT_remap_index 398 -#define BufferParameteriAPPLE_remap_index 399 -#define FlushMappedBufferRangeAPPLE_remap_index 400 -#define BindFragDataLocationEXT_remap_index 401 -#define GetFragDataLocationEXT_remap_index 402 -#define GetUniformuivEXT_remap_index 403 -#define GetVertexAttribIivEXT_remap_index 404 -#define GetVertexAttribIuivEXT_remap_index 405 -#define Uniform1uiEXT_remap_index 406 -#define Uniform1uivEXT_remap_index 407 -#define Uniform2uiEXT_remap_index 408 -#define Uniform2uivEXT_remap_index 409 -#define Uniform3uiEXT_remap_index 410 -#define Uniform3uivEXT_remap_index 411 -#define Uniform4uiEXT_remap_index 412 -#define Uniform4uivEXT_remap_index 413 -#define VertexAttribI1iEXT_remap_index 414 -#define VertexAttribI1ivEXT_remap_index 415 -#define VertexAttribI1uiEXT_remap_index 416 -#define VertexAttribI1uivEXT_remap_index 417 -#define VertexAttribI2iEXT_remap_index 418 -#define VertexAttribI2ivEXT_remap_index 419 -#define VertexAttribI2uiEXT_remap_index 420 -#define VertexAttribI2uivEXT_remap_index 421 -#define VertexAttribI3iEXT_remap_index 422 -#define VertexAttribI3ivEXT_remap_index 423 -#define VertexAttribI3uiEXT_remap_index 424 -#define VertexAttribI3uivEXT_remap_index 425 -#define VertexAttribI4bvEXT_remap_index 426 -#define VertexAttribI4iEXT_remap_index 427 -#define VertexAttribI4ivEXT_remap_index 428 -#define VertexAttribI4svEXT_remap_index 429 -#define VertexAttribI4ubvEXT_remap_index 430 -#define VertexAttribI4uiEXT_remap_index 431 -#define VertexAttribI4uivEXT_remap_index 432 -#define VertexAttribI4usvEXT_remap_index 433 -#define VertexAttribIPointerEXT_remap_index 434 -#define FramebufferTextureLayerEXT_remap_index 435 -#define ColorMaskIndexedEXT_remap_index 436 -#define DisableIndexedEXT_remap_index 437 -#define EnableIndexedEXT_remap_index 438 -#define GetBooleanIndexedvEXT_remap_index 439 -#define GetIntegerIndexedvEXT_remap_index 440 -#define IsEnabledIndexedEXT_remap_index 441 -#define ClearColorIiEXT_remap_index 442 -#define ClearColorIuiEXT_remap_index 443 -#define GetTexParameterIivEXT_remap_index 444 -#define GetTexParameterIuivEXT_remap_index 445 -#define TexParameterIivEXT_remap_index 446 -#define TexParameterIuivEXT_remap_index 447 -#define BeginConditionalRenderNV_remap_index 448 -#define EndConditionalRenderNV_remap_index 449 -#define BeginTransformFeedbackEXT_remap_index 450 -#define BindBufferBaseEXT_remap_index 451 -#define BindBufferOffsetEXT_remap_index 452 -#define BindBufferRangeEXT_remap_index 453 -#define EndTransformFeedbackEXT_remap_index 454 -#define GetTransformFeedbackVaryingEXT_remap_index 455 -#define TransformFeedbackVaryingsEXT_remap_index 456 -#define ProvokingVertexEXT_remap_index 457 -#define GetTexParameterPointervAPPLE_remap_index 458 -#define TextureRangeAPPLE_remap_index 459 -#define GetObjectParameterivAPPLE_remap_index 460 -#define ObjectPurgeableAPPLE_remap_index 461 -#define ObjectUnpurgeableAPPLE_remap_index 462 -#define ActiveProgramEXT_remap_index 463 -#define CreateShaderProgramEXT_remap_index 464 -#define UseShaderProgramEXT_remap_index 465 -#define StencilFuncSeparateATI_remap_index 466 -#define ProgramEnvParameters4fvEXT_remap_index 467 -#define ProgramLocalParameters4fvEXT_remap_index 468 -#define GetQueryObjecti64vEXT_remap_index 469 -#define GetQueryObjectui64vEXT_remap_index 470 -#define EGLImageTargetRenderbufferStorageOES_remap_index 471 -#define EGLImageTargetTexture2DOES_remap_index 472 +#define ClearDepthf_remap_index 192 +#define DepthRangef_remap_index 193 +#define GetShaderPrecisionFormat_remap_index 194 +#define ReleaseShaderCompiler_remap_index 195 +#define ShaderBinary_remap_index 196 +#define PolygonOffsetEXT_remap_index 197 +#define GetPixelTexGenParameterfvSGIS_remap_index 198 +#define GetPixelTexGenParameterivSGIS_remap_index 199 +#define PixelTexGenParameterfSGIS_remap_index 200 +#define PixelTexGenParameterfvSGIS_remap_index 201 +#define PixelTexGenParameteriSGIS_remap_index 202 +#define PixelTexGenParameterivSGIS_remap_index 203 +#define SampleMaskSGIS_remap_index 204 +#define SamplePatternSGIS_remap_index 205 +#define ColorPointerEXT_remap_index 206 +#define EdgeFlagPointerEXT_remap_index 207 +#define IndexPointerEXT_remap_index 208 +#define NormalPointerEXT_remap_index 209 +#define TexCoordPointerEXT_remap_index 210 +#define VertexPointerEXT_remap_index 211 +#define PointParameterfEXT_remap_index 212 +#define PointParameterfvEXT_remap_index 213 +#define LockArraysEXT_remap_index 214 +#define UnlockArraysEXT_remap_index 215 +#define SecondaryColor3bEXT_remap_index 216 +#define SecondaryColor3bvEXT_remap_index 217 +#define SecondaryColor3dEXT_remap_index 218 +#define SecondaryColor3dvEXT_remap_index 219 +#define SecondaryColor3fEXT_remap_index 220 +#define SecondaryColor3fvEXT_remap_index 221 +#define SecondaryColor3iEXT_remap_index 222 +#define SecondaryColor3ivEXT_remap_index 223 +#define SecondaryColor3sEXT_remap_index 224 +#define SecondaryColor3svEXT_remap_index 225 +#define SecondaryColor3ubEXT_remap_index 226 +#define SecondaryColor3ubvEXT_remap_index 227 +#define SecondaryColor3uiEXT_remap_index 228 +#define SecondaryColor3uivEXT_remap_index 229 +#define SecondaryColor3usEXT_remap_index 230 +#define SecondaryColor3usvEXT_remap_index 231 +#define SecondaryColorPointerEXT_remap_index 232 +#define MultiDrawArraysEXT_remap_index 233 +#define MultiDrawElementsEXT_remap_index 234 +#define FogCoordPointerEXT_remap_index 235 +#define FogCoorddEXT_remap_index 236 +#define FogCoorddvEXT_remap_index 237 +#define FogCoordfEXT_remap_index 238 +#define FogCoordfvEXT_remap_index 239 +#define PixelTexGenSGIX_remap_index 240 +#define BlendFuncSeparateEXT_remap_index 241 +#define FlushVertexArrayRangeNV_remap_index 242 +#define VertexArrayRangeNV_remap_index 243 +#define CombinerInputNV_remap_index 244 +#define CombinerOutputNV_remap_index 245 +#define CombinerParameterfNV_remap_index 246 +#define CombinerParameterfvNV_remap_index 247 +#define CombinerParameteriNV_remap_index 248 +#define CombinerParameterivNV_remap_index 249 +#define FinalCombinerInputNV_remap_index 250 +#define GetCombinerInputParameterfvNV_remap_index 251 +#define GetCombinerInputParameterivNV_remap_index 252 +#define GetCombinerOutputParameterfvNV_remap_index 253 +#define GetCombinerOutputParameterivNV_remap_index 254 +#define GetFinalCombinerInputParameterfvNV_remap_index 255 +#define GetFinalCombinerInputParameterivNV_remap_index 256 +#define ResizeBuffersMESA_remap_index 257 +#define WindowPos2dMESA_remap_index 258 +#define WindowPos2dvMESA_remap_index 259 +#define WindowPos2fMESA_remap_index 260 +#define WindowPos2fvMESA_remap_index 261 +#define WindowPos2iMESA_remap_index 262 +#define WindowPos2ivMESA_remap_index 263 +#define WindowPos2sMESA_remap_index 264 +#define WindowPos2svMESA_remap_index 265 +#define WindowPos3dMESA_remap_index 266 +#define WindowPos3dvMESA_remap_index 267 +#define WindowPos3fMESA_remap_index 268 +#define WindowPos3fvMESA_remap_index 269 +#define WindowPos3iMESA_remap_index 270 +#define WindowPos3ivMESA_remap_index 271 +#define WindowPos3sMESA_remap_index 272 +#define WindowPos3svMESA_remap_index 273 +#define WindowPos4dMESA_remap_index 274 +#define WindowPos4dvMESA_remap_index 275 +#define WindowPos4fMESA_remap_index 276 +#define WindowPos4fvMESA_remap_index 277 +#define WindowPos4iMESA_remap_index 278 +#define WindowPos4ivMESA_remap_index 279 +#define WindowPos4sMESA_remap_index 280 +#define WindowPos4svMESA_remap_index 281 +#define MultiModeDrawArraysIBM_remap_index 282 +#define MultiModeDrawElementsIBM_remap_index 283 +#define DeleteFencesNV_remap_index 284 +#define FinishFenceNV_remap_index 285 +#define GenFencesNV_remap_index 286 +#define GetFenceivNV_remap_index 287 +#define IsFenceNV_remap_index 288 +#define SetFenceNV_remap_index 289 +#define TestFenceNV_remap_index 290 +#define AreProgramsResidentNV_remap_index 291 +#define BindProgramNV_remap_index 292 +#define DeleteProgramsNV_remap_index 293 +#define ExecuteProgramNV_remap_index 294 +#define GenProgramsNV_remap_index 295 +#define GetProgramParameterdvNV_remap_index 296 +#define GetProgramParameterfvNV_remap_index 297 +#define GetProgramStringNV_remap_index 298 +#define GetProgramivNV_remap_index 299 +#define GetTrackMatrixivNV_remap_index 300 +#define GetVertexAttribPointervNV_remap_index 301 +#define GetVertexAttribdvNV_remap_index 302 +#define GetVertexAttribfvNV_remap_index 303 +#define GetVertexAttribivNV_remap_index 304 +#define IsProgramNV_remap_index 305 +#define LoadProgramNV_remap_index 306 +#define ProgramParameters4dvNV_remap_index 307 +#define ProgramParameters4fvNV_remap_index 308 +#define RequestResidentProgramsNV_remap_index 309 +#define TrackMatrixNV_remap_index 310 +#define VertexAttrib1dNV_remap_index 311 +#define VertexAttrib1dvNV_remap_index 312 +#define VertexAttrib1fNV_remap_index 313 +#define VertexAttrib1fvNV_remap_index 314 +#define VertexAttrib1sNV_remap_index 315 +#define VertexAttrib1svNV_remap_index 316 +#define VertexAttrib2dNV_remap_index 317 +#define VertexAttrib2dvNV_remap_index 318 +#define VertexAttrib2fNV_remap_index 319 +#define VertexAttrib2fvNV_remap_index 320 +#define VertexAttrib2sNV_remap_index 321 +#define VertexAttrib2svNV_remap_index 322 +#define VertexAttrib3dNV_remap_index 323 +#define VertexAttrib3dvNV_remap_index 324 +#define VertexAttrib3fNV_remap_index 325 +#define VertexAttrib3fvNV_remap_index 326 +#define VertexAttrib3sNV_remap_index 327 +#define VertexAttrib3svNV_remap_index 328 +#define VertexAttrib4dNV_remap_index 329 +#define VertexAttrib4dvNV_remap_index 330 +#define VertexAttrib4fNV_remap_index 331 +#define VertexAttrib4fvNV_remap_index 332 +#define VertexAttrib4sNV_remap_index 333 +#define VertexAttrib4svNV_remap_index 334 +#define VertexAttrib4ubNV_remap_index 335 +#define VertexAttrib4ubvNV_remap_index 336 +#define VertexAttribPointerNV_remap_index 337 +#define VertexAttribs1dvNV_remap_index 338 +#define VertexAttribs1fvNV_remap_index 339 +#define VertexAttribs1svNV_remap_index 340 +#define VertexAttribs2dvNV_remap_index 341 +#define VertexAttribs2fvNV_remap_index 342 +#define VertexAttribs2svNV_remap_index 343 +#define VertexAttribs3dvNV_remap_index 344 +#define VertexAttribs3fvNV_remap_index 345 +#define VertexAttribs3svNV_remap_index 346 +#define VertexAttribs4dvNV_remap_index 347 +#define VertexAttribs4fvNV_remap_index 348 +#define VertexAttribs4svNV_remap_index 349 +#define VertexAttribs4ubvNV_remap_index 350 +#define GetTexBumpParameterfvATI_remap_index 351 +#define GetTexBumpParameterivATI_remap_index 352 +#define TexBumpParameterfvATI_remap_index 353 +#define TexBumpParameterivATI_remap_index 354 +#define AlphaFragmentOp1ATI_remap_index 355 +#define AlphaFragmentOp2ATI_remap_index 356 +#define AlphaFragmentOp3ATI_remap_index 357 +#define BeginFragmentShaderATI_remap_index 358 +#define BindFragmentShaderATI_remap_index 359 +#define ColorFragmentOp1ATI_remap_index 360 +#define ColorFragmentOp2ATI_remap_index 361 +#define ColorFragmentOp3ATI_remap_index 362 +#define DeleteFragmentShaderATI_remap_index 363 +#define EndFragmentShaderATI_remap_index 364 +#define GenFragmentShadersATI_remap_index 365 +#define PassTexCoordATI_remap_index 366 +#define SampleMapATI_remap_index 367 +#define SetFragmentShaderConstantATI_remap_index 368 +#define PointParameteriNV_remap_index 369 +#define PointParameterivNV_remap_index 370 +#define ActiveStencilFaceEXT_remap_index 371 +#define BindVertexArrayAPPLE_remap_index 372 +#define DeleteVertexArraysAPPLE_remap_index 373 +#define GenVertexArraysAPPLE_remap_index 374 +#define IsVertexArrayAPPLE_remap_index 375 +#define GetProgramNamedParameterdvNV_remap_index 376 +#define GetProgramNamedParameterfvNV_remap_index 377 +#define ProgramNamedParameter4dNV_remap_index 378 +#define ProgramNamedParameter4dvNV_remap_index 379 +#define ProgramNamedParameter4fNV_remap_index 380 +#define ProgramNamedParameter4fvNV_remap_index 381 +#define PrimitiveRestartIndexNV_remap_index 382 +#define PrimitiveRestartNV_remap_index 383 +#define DepthBoundsEXT_remap_index 384 +#define BlendEquationSeparateEXT_remap_index 385 +#define BindFramebufferEXT_remap_index 386 +#define BindRenderbufferEXT_remap_index 387 +#define CheckFramebufferStatusEXT_remap_index 388 +#define DeleteFramebuffersEXT_remap_index 389 +#define DeleteRenderbuffersEXT_remap_index 390 +#define FramebufferRenderbufferEXT_remap_index 391 +#define FramebufferTexture1DEXT_remap_index 392 +#define FramebufferTexture2DEXT_remap_index 393 +#define FramebufferTexture3DEXT_remap_index 394 +#define GenFramebuffersEXT_remap_index 395 +#define GenRenderbuffersEXT_remap_index 396 +#define GenerateMipmapEXT_remap_index 397 +#define GetFramebufferAttachmentParameterivEXT_remap_index 398 +#define GetRenderbufferParameterivEXT_remap_index 399 +#define IsFramebufferEXT_remap_index 400 +#define IsRenderbufferEXT_remap_index 401 +#define RenderbufferStorageEXT_remap_index 402 +#define BlitFramebufferEXT_remap_index 403 +#define BufferParameteriAPPLE_remap_index 404 +#define FlushMappedBufferRangeAPPLE_remap_index 405 +#define BindFragDataLocationEXT_remap_index 406 +#define GetFragDataLocationEXT_remap_index 407 +#define GetUniformuivEXT_remap_index 408 +#define GetVertexAttribIivEXT_remap_index 409 +#define GetVertexAttribIuivEXT_remap_index 410 +#define Uniform1uiEXT_remap_index 411 +#define Uniform1uivEXT_remap_index 412 +#define Uniform2uiEXT_remap_index 413 +#define Uniform2uivEXT_remap_index 414 +#define Uniform3uiEXT_remap_index 415 +#define Uniform3uivEXT_remap_index 416 +#define Uniform4uiEXT_remap_index 417 +#define Uniform4uivEXT_remap_index 418 +#define VertexAttribI1iEXT_remap_index 419 +#define VertexAttribI1ivEXT_remap_index 420 +#define VertexAttribI1uiEXT_remap_index 421 +#define VertexAttribI1uivEXT_remap_index 422 +#define VertexAttribI2iEXT_remap_index 423 +#define VertexAttribI2ivEXT_remap_index 424 +#define VertexAttribI2uiEXT_remap_index 425 +#define VertexAttribI2uivEXT_remap_index 426 +#define VertexAttribI3iEXT_remap_index 427 +#define VertexAttribI3ivEXT_remap_index 428 +#define VertexAttribI3uiEXT_remap_index 429 +#define VertexAttribI3uivEXT_remap_index 430 +#define VertexAttribI4bvEXT_remap_index 431 +#define VertexAttribI4iEXT_remap_index 432 +#define VertexAttribI4ivEXT_remap_index 433 +#define VertexAttribI4svEXT_remap_index 434 +#define VertexAttribI4ubvEXT_remap_index 435 +#define VertexAttribI4uiEXT_remap_index 436 +#define VertexAttribI4uivEXT_remap_index 437 +#define VertexAttribI4usvEXT_remap_index 438 +#define VertexAttribIPointerEXT_remap_index 439 +#define FramebufferTextureLayerEXT_remap_index 440 +#define ColorMaskIndexedEXT_remap_index 441 +#define DisableIndexedEXT_remap_index 442 +#define EnableIndexedEXT_remap_index 443 +#define GetBooleanIndexedvEXT_remap_index 444 +#define GetIntegerIndexedvEXT_remap_index 445 +#define IsEnabledIndexedEXT_remap_index 446 +#define ClearColorIiEXT_remap_index 447 +#define ClearColorIuiEXT_remap_index 448 +#define GetTexParameterIivEXT_remap_index 449 +#define GetTexParameterIuivEXT_remap_index 450 +#define TexParameterIivEXT_remap_index 451 +#define TexParameterIuivEXT_remap_index 452 +#define BeginConditionalRenderNV_remap_index 453 +#define EndConditionalRenderNV_remap_index 454 +#define BeginTransformFeedbackEXT_remap_index 455 +#define BindBufferBaseEXT_remap_index 456 +#define BindBufferOffsetEXT_remap_index 457 +#define BindBufferRangeEXT_remap_index 458 +#define EndTransformFeedbackEXT_remap_index 459 +#define GetTransformFeedbackVaryingEXT_remap_index 460 +#define TransformFeedbackVaryingsEXT_remap_index 461 +#define ProvokingVertexEXT_remap_index 462 +#define GetTexParameterPointervAPPLE_remap_index 463 +#define TextureRangeAPPLE_remap_index 464 +#define GetObjectParameterivAPPLE_remap_index 465 +#define ObjectPurgeableAPPLE_remap_index 466 +#define ObjectUnpurgeableAPPLE_remap_index 467 +#define ActiveProgramEXT_remap_index 468 +#define CreateShaderProgramEXT_remap_index 469 +#define UseShaderProgramEXT_remap_index 470 +#define StencilFuncSeparateATI_remap_index 471 +#define ProgramEnvParameters4fvEXT_remap_index 472 +#define ProgramLocalParameters4fvEXT_remap_index 473 +#define GetQueryObjecti64vEXT_remap_index 474 +#define GetQueryObjectui64vEXT_remap_index 475 +#define EGLImageTargetRenderbufferStorageOES_remap_index 476 +#define EGLImageTargetTexture2DOES_remap_index 477 #define _gloffset_AttachShader driDispatchRemapTable[AttachShader_remap_index] #define _gloffset_CreateProgram driDispatchRemapTable[CreateProgram_remap_index] @@ -1617,6 +1627,11 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define _gloffset_IsTransformFeedback driDispatchRemapTable[IsTransformFeedback_remap_index] #define _gloffset_PauseTransformFeedback driDispatchRemapTable[PauseTransformFeedback_remap_index] #define _gloffset_ResumeTransformFeedback driDispatchRemapTable[ResumeTransformFeedback_remap_index] +#define _gloffset_ClearDepthf driDispatchRemapTable[ClearDepthf_remap_index] +#define _gloffset_DepthRangef driDispatchRemapTable[DepthRangef_remap_index] +#define _gloffset_GetShaderPrecisionFormat driDispatchRemapTable[GetShaderPrecisionFormat_remap_index] +#define _gloffset_ReleaseShaderCompiler driDispatchRemapTable[ReleaseShaderCompiler_remap_index] +#define _gloffset_ShaderBinary driDispatchRemapTable[ShaderBinary_remap_index] #define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index] #define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index] #define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index] @@ -3701,6 +3716,21 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_ResumeTransformFeedback(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), _gloffset_ResumeTransformFeedback, parameters) #define GET_ResumeTransformFeedback(disp) GET_by_offset(disp, _gloffset_ResumeTransformFeedback) #define SET_ResumeTransformFeedback(disp, fn) SET_by_offset(disp, _gloffset_ResumeTransformFeedback, fn) +#define CALL_ClearDepthf(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf)), _gloffset_ClearDepthf, parameters) +#define GET_ClearDepthf(disp) GET_by_offset(disp, _gloffset_ClearDepthf) +#define SET_ClearDepthf(disp, fn) SET_by_offset(disp, _gloffset_ClearDepthf, fn) +#define CALL_DepthRangef(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLclampf)), _gloffset_DepthRangef, parameters) +#define GET_DepthRangef(disp) GET_by_offset(disp, _gloffset_DepthRangef) +#define SET_DepthRangef(disp, fn) SET_by_offset(disp, _gloffset_DepthRangef, fn) +#define CALL_GetShaderPrecisionFormat(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *, GLint *)), _gloffset_GetShaderPrecisionFormat, parameters) +#define GET_GetShaderPrecisionFormat(disp) GET_by_offset(disp, _gloffset_GetShaderPrecisionFormat) +#define SET_GetShaderPrecisionFormat(disp, fn) SET_by_offset(disp, _gloffset_GetShaderPrecisionFormat, fn) +#define CALL_ReleaseShaderCompiler(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), _gloffset_ReleaseShaderCompiler, parameters) +#define GET_ReleaseShaderCompiler(disp) GET_by_offset(disp, _gloffset_ReleaseShaderCompiler) +#define SET_ReleaseShaderCompiler(disp, fn) SET_by_offset(disp, _gloffset_ReleaseShaderCompiler, fn) +#define CALL_ShaderBinary(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *, GLenum, const GLvoid *, GLsizei)), _gloffset_ShaderBinary, parameters) +#define GET_ShaderBinary(disp) GET_by_offset(disp, _gloffset_ShaderBinary) +#define SET_ShaderBinary(disp, fn) SET_by_offset(disp, _gloffset_ShaderBinary, fn) #define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), _gloffset_PolygonOffsetEXT, parameters) #define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, _gloffset_PolygonOffsetEXT) #define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, _gloffset_PolygonOffsetEXT, fn) diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index 878f10d..bdbd751 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -29,6 +29,7 @@ #include "context.h" #include "hint.h" #include "imports.h" +#include "mtypes.h" diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index b98e321..75bb925 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -28,6 +28,7 @@ #include "colormac.h" #include "histogram.h" #include "macros.h" +#include "mfeatures.h" #include "main/dispatch.h" diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index df1527b..909c18e 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -35,6 +35,8 @@ #include "image.h" #include "imports.h" #include "macros.h" +#include "mfeatures.h" +#include "mtypes.h" /** @@ -154,6 +156,8 @@ _mesa_sizeof_type( GLenum type ) return sizeof(GLdouble); case GL_HALF_FLOAT_ARB: return sizeof(GLhalfARB); + case GL_FIXED: + return sizeof(GLfixed); default: return -1; } diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index bcca4ed..bd1fd7c 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -46,6 +46,7 @@ #include "imports.h" #include "context.h" +#include "mtypes.h" #include "version.h" #ifdef _GNU_SOURCE @@ -88,7 +89,8 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) #if defined(HAVE_POSIX_MEMALIGN) void *mem; int err = posix_memalign(& mem, alignment, bytes); - (void) err; + if (err) + return NULL; return mem; #elif defined(_WIN32) && defined(_MSC_VER) return _aligned_malloc(bytes, alignment); diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 105d4a3..76c7e1c 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -40,6 +40,7 @@ #include "context.h" #include "enums.h" #include "macros.h" +#include "mfeatures.h" #include "matrix.h" #include "mtypes.h" #include "math/m_matrix.h" diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index ad63b17..e073e17 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -30,6 +30,7 @@ #include "imports.h" #include "formats.h" #include "mipmap.h" +#include "mtypes.h" #include "teximage.h" #include "texstore.h" #include "image.h" diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 417f8df..1522332 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -40,6 +40,7 @@ #include "glapi/glapi.h" #include "math/m_matrix.h" /* GLmatrix */ #include "main/simple_list.h" /* struct simple_node */ +#include "main/formats.h" /* MESA_FORMAT_COUNT */ /** @@ -2211,6 +2212,7 @@ struct gl_shader_compiler_options GLboolean EmitNoCont; /**< Emit CONT opcode? */ GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */ GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */ + GLboolean EmitNoPow; /**< Emit POW opcodes? */ /** * \name Forms of indirect addressing the driver cannot do. @@ -2580,6 +2582,7 @@ struct gl_program_constants */ struct gl_constants { + GLint MaxTextureMbytes; /**< Max memory per image, in MB */ GLint MaxTextureLevels; /**< Max mipmap levels. */ GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ @@ -2666,6 +2669,9 @@ struct gl_constants struct gl_extensions { GLboolean dummy; /* don't remove this! */ + GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */ + GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */ + GLboolean ARB_ES2_compatibility; GLboolean ARB_blend_func_extended; GLboolean ARB_copy_buffer; GLboolean ARB_depth_buffer_float; @@ -2781,6 +2787,7 @@ struct gl_extensions GLboolean EXT_vertex_array; GLboolean EXT_vertex_array_bgra; GLboolean EXT_vertex_array_set; + GLboolean OES_standard_derivatives; /* vendor extensions */ GLboolean APPLE_client_storage; GLboolean APPLE_packed_pixels; @@ -2820,6 +2827,7 @@ struct gl_extensions GLboolean OES_EGL_image; GLboolean OES_draw_texture; GLboolean EXT_texture_format_BGRA8888; + GLboolean extension_sentinel; /** The extension string */ const GLubyte *String; /** Number of supported extensions */ @@ -3252,6 +3260,8 @@ struct gl_context /** software compression/decompression supported or not */ GLboolean Mesa_DXTn; + GLboolean TextureFormatSupported[MESA_FORMAT_COUNT]; + /** * Use dp4 (rather than mul/mad) instructions for position * transformation? diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index 5487d45..67fdb8c 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -27,6 +27,7 @@ #include "main/context.h" #include "main/macros.h" #include "main/multisample.h" +#include "main/mtypes.h" /** diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c index 36cea3b..dd198b8 100644 --- a/src/mesa/main/nvprogram.c +++ b/src/mesa/main/nvprogram.c @@ -42,6 +42,7 @@ #include "main/hash.h" #include "main/imports.h" #include "main/macros.h" +#include "main/mtypes.h" #include "main/nvprogram.h" #include "program/arbprogparse.h" #include "program/nvfragparse.h" diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index fdb647c..512835c 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -34,6 +34,7 @@ #include "enums.h" #include "image.h" #include "imports.h" +#include "mtypes.h" #include "pack.h" #include "pixeltransfer.h" #include "imports.h" @@ -484,11 +485,25 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], const struct gl_pixelstore_attrib *dstPacking, GLbitfield transferOps) { - GLfloat luminance[MAX_WIDTH]; + GLfloat *luminance; const GLint comps = _mesa_components_in_format(dstFormat); const GLboolean intDstFormat = _mesa_is_integer_format(dstFormat); GLuint i; + if (dstFormat == GL_LUMINANCE || + dstFormat == GL_LUMINANCE_ALPHA || + dstFormat == GL_LUMINANCE_INTEGER_EXT || + dstFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT) { + luminance = (GLfloat *) malloc(n * sizeof(GLfloat)); + if (!luminance) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing"); + return; + } + } + else { + luminance = NULL; + } + /* XXX * This test should probably go away. Have the caller set/clear the * IMAGE_CLAMP_BIT as needed. @@ -1907,6 +1922,8 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], } } } + + free(luminance); } @@ -3462,7 +3479,12 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx, { GLint dstComponents; GLint rDst, gDst, bDst, aDst, lDst, iDst; - GLfloat rgba[MAX_WIDTH][4]; + GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat)); + + if (!rgba) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } dstComponents = _mesa_components_in_format( dstFormat ); /* source & dest image formats should have been error checked by now */ @@ -3471,9 +3493,14 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx, /* * Extract image data and convert to RGBA floats */ - assert(n <= MAX_WIDTH); if (srcFormat == GL_COLOR_INDEX) { - GLuint indexes[MAX_WIDTH]; + GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint)); + + if (!indexes) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } + extract_uint_indexes(n, indexes, srcFormat, srcType, source, srcPacking); @@ -3484,6 +3511,8 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx, for (i = 0; i < n; i++) { dest[i] = (GLchan) (indexes[i] & 0xff); } + free(indexes); + free(rgba); return; } else { @@ -3498,6 +3527,8 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx, * with color indexes. */ transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT); + + free(indexes); } else { /* non-color index data */ @@ -3575,6 +3606,8 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx, dst += dstComponents; } } + + free(rgba); } } @@ -3652,7 +3685,12 @@ _mesa_unpack_color_span_float( struct gl_context *ctx, { GLint dstComponents; GLint rDst, gDst, bDst, aDst, lDst, iDst; - GLfloat rgba[MAX_WIDTH][4]; + GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat)); + + if (!rgba) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } dstComponents = _mesa_components_in_format( dstFormat ); /* source & dest image formats should have been error checked by now */ @@ -3661,9 +3699,15 @@ _mesa_unpack_color_span_float( struct gl_context *ctx, /* * Extract image data and convert to RGBA floats */ - assert(n <= MAX_WIDTH); if (srcFormat == GL_COLOR_INDEX) { - GLuint indexes[MAX_WIDTH]; + GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint)); + + if (!indexes) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + free(rgba); + return; + } + extract_uint_indexes(n, indexes, srcFormat, srcType, source, srcPacking); @@ -3674,6 +3718,8 @@ _mesa_unpack_color_span_float( struct gl_context *ctx, for (i = 0; i < n; i++) { dest[i] = (GLchan) (indexes[i] & 0xff); } + free(indexes); + free(rgba); return; } else { @@ -3688,6 +3734,8 @@ _mesa_unpack_color_span_float( struct gl_context *ctx, * with color indexes. */ transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT); + + free(indexes); } else { /* non-color index data */ @@ -3760,6 +3808,8 @@ _mesa_unpack_color_span_float( struct gl_context *ctx, dst += dstComponents; } } + + free(rgba); } } @@ -3776,9 +3826,12 @@ _mesa_unpack_color_span_uint(struct gl_context *ctx, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking) { - GLuint rgba[MAX_WIDTH][4]; + GLuint (*rgba)[4] = (GLuint (*)[4]) malloc(n * 4 * sizeof(GLfloat)); - ASSERT(n <= MAX_WIDTH); + if (!rgba) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } ASSERT(dstFormat == GL_ALPHA || dstFormat == GL_LUMINANCE || @@ -3912,6 +3965,8 @@ _mesa_unpack_color_span_uint(struct gl_context *ctx, } } } + + free(rgba); } @@ -3943,9 +3998,14 @@ _mesa_unpack_dudv_span_byte( struct gl_context *ctx, /* general solution */ { GLint dstComponents; - GLfloat rgba[MAX_WIDTH][4]; GLbyte *dst = dest; GLuint i; + GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat)); + + if (!rgba) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } dstComponents = _mesa_components_in_format( dstFormat ); /* source & dest image formats should have been error checked by now */ @@ -3954,7 +4014,6 @@ _mesa_unpack_dudv_span_byte( struct gl_context *ctx, /* * Extract image data and convert to RGBA floats */ - assert(n <= MAX_WIDTH); extract_float_rgba(n, rgba, srcFormat, srcType, source, srcPacking->SwapBytes); @@ -3970,6 +4029,8 @@ _mesa_unpack_dudv_span_byte( struct gl_context *ctx, dst[1] = FLOAT_TO_BYTE(rgba[i][GCOMP]); dst += dstComponents; } + + free(rgba); } } @@ -3988,7 +4049,7 @@ _mesa_unpack_dudv_span_byte( struct gl_context *ctx, * transferOps - the pixel transfer operations to apply */ void -_mesa_unpack_index_span( const struct gl_context *ctx, GLuint n, +_mesa_unpack_index_span( struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, @@ -4026,8 +4087,12 @@ _mesa_unpack_index_span( const struct gl_context *ctx, GLuint n, /* * general solution */ - GLuint indexes[MAX_WIDTH]; - assert(n <= MAX_WIDTH); + GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint)); + + if (!indexes) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source, srcPacking); @@ -4061,19 +4126,24 @@ _mesa_unpack_index_span( const struct gl_context *ctx, GLuint n, default: _mesa_problem(ctx, "bad dstType in _mesa_unpack_index_span"); } + + free(indexes); } } void -_mesa_pack_index_span( const struct gl_context *ctx, GLuint n, +_mesa_pack_index_span( struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLuint *source, const struct gl_pixelstore_attrib *dstPacking, GLbitfield transferOps ) { - GLuint indexes[MAX_WIDTH]; + GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint)); - ASSERT(n <= MAX_WIDTH); + if (!indexes) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing"); + return; + } transferOps &= (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT); @@ -4178,6 +4248,8 @@ _mesa_pack_index_span( const struct gl_context *ctx, GLuint n, default: _mesa_problem(ctx, "bad type in _mesa_pack_index_span"); } + + free(indexes); } @@ -4196,7 +4268,7 @@ _mesa_pack_index_span( const struct gl_context *ctx, GLuint n, * transferOps - apply offset/bias/lookup ops? */ void -_mesa_unpack_stencil_span( const struct gl_context *ctx, GLuint n, +_mesa_unpack_stencil_span( struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, @@ -4240,8 +4312,12 @@ _mesa_unpack_stencil_span( const struct gl_context *ctx, GLuint n, /* * general solution */ - GLuint indexes[MAX_WIDTH]; - assert(n <= MAX_WIDTH); + GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint)); + + if (!indexes) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "stencil unpacking"); + return; + } extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source, srcPacking); @@ -4286,18 +4362,23 @@ _mesa_unpack_stencil_span( const struct gl_context *ctx, GLuint n, default: _mesa_problem(ctx, "bad dstType in _mesa_unpack_stencil_span"); } + + free(indexes); } } void -_mesa_pack_stencil_span( const struct gl_context *ctx, GLuint n, +_mesa_pack_stencil_span( struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLstencil *source, const struct gl_pixelstore_attrib *dstPacking ) { - GLstencil stencil[MAX_WIDTH]; + GLstencil *stencil = (GLstencil *) malloc(n * sizeof(GLstencil)); - ASSERT(n <= MAX_WIDTH); + if (!stencil) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "stencil packing"); + return; + } if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag) { @@ -4436,6 +4517,8 @@ _mesa_pack_stencil_span( const struct gl_context *ctx, GLuint n, default: _mesa_problem(ctx, "bad type in _mesa_pack_index_span"); } + + free(stencil); } #define DEPTH_VALUES(GLTYPE, GLTYPE2FLOAT) \ @@ -4466,12 +4549,12 @@ _mesa_pack_stencil_span( const struct gl_context *ctx, GLuint n, * (ignored for GLfloat). */ void -_mesa_unpack_depth_span( const struct gl_context *ctx, GLuint n, +_mesa_unpack_depth_span( struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLuint depthMax, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking ) { - GLfloat depthTemp[MAX_WIDTH], *depthValues; + GLfloat *depthTemp, *depthValues; GLboolean needClamp = GL_FALSE; /* Look for special cases first. @@ -4517,6 +4600,12 @@ _mesa_unpack_depth_span( const struct gl_context *ctx, GLuint n, /* general case path follows */ + depthTemp = (GLfloat *) malloc(n * sizeof(GLfloat)); + if (!depthTemp) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } + if (dstType == GL_FLOAT) { depthValues = (GLfloat *) dest; } @@ -4599,6 +4688,7 @@ _mesa_unpack_depth_span( const struct gl_context *ctx, GLuint n, break; default: _mesa_problem(NULL, "bad type in _mesa_unpack_depth_span()"); + free(depthTemp); return; } @@ -4658,6 +4748,8 @@ _mesa_unpack_depth_span( const struct gl_context *ctx, GLuint n, ASSERT(dstType == GL_FLOAT); /*ASSERT(depthMax == 1.0F);*/ } + + free(depthTemp); } @@ -4665,13 +4757,15 @@ _mesa_unpack_depth_span( const struct gl_context *ctx, GLuint n, * Pack an array of depth values. The values are floats in [0,1]. */ void -_mesa_pack_depth_span( const struct gl_context *ctx, GLuint n, GLvoid *dest, +_mesa_pack_depth_span( struct gl_context *ctx, GLuint n, GLvoid *dest, GLenum dstType, const GLfloat *depthSpan, const struct gl_pixelstore_attrib *dstPacking ) { - GLfloat depthCopy[MAX_WIDTH]; - - ASSERT(n <= MAX_WIDTH); + GLfloat *depthCopy = (GLfloat *) malloc(n * sizeof(GLfloat)); + if (!depthCopy) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing"); + return; + } if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { memcpy(depthCopy, depthSpan, n * sizeof(GLfloat)); @@ -4773,6 +4867,8 @@ _mesa_pack_depth_span( const struct gl_context *ctx, GLuint n, GLvoid *dest, default: _mesa_problem(ctx, "bad type in _mesa_pack_depth_span"); } + + free(depthCopy); } @@ -4781,16 +4877,21 @@ _mesa_pack_depth_span( const struct gl_context *ctx, GLuint n, GLvoid *dest, * Pack depth and stencil values as GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8. */ void -_mesa_pack_depth_stencil_span(const struct gl_context *ctx, GLuint n, GLuint *dest, +_mesa_pack_depth_stencil_span(struct gl_context *ctx, GLuint n, GLuint *dest, const GLfloat *depthVals, const GLstencil *stencilVals, const struct gl_pixelstore_attrib *dstPacking) { - GLfloat depthCopy[MAX_WIDTH]; - GLstencil stencilCopy[MAX_WIDTH]; + GLfloat *depthCopy = (GLfloat *) malloc(n * sizeof(GLfloat)); + GLstencil *stencilCopy = (GLstencil *) malloc(n * sizeof(GLstencil)); GLuint i; - ASSERT(n <= MAX_WIDTH); + if (!depthCopy || !stencilCopy) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing"); + free(depthCopy); + free(stencilCopy); + return; + } if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { memcpy(depthCopy, depthVals, n * sizeof(GLfloat)); @@ -4814,6 +4915,9 @@ _mesa_pack_depth_stencil_span(const struct gl_context *ctx, GLuint n, GLuint *de if (dstPacking->SwapBytes) { _mesa_swap4(dest, n); } + + free(depthCopy); + free(stencilCopy); } diff --git a/src/mesa/main/pack.h b/src/mesa/main/pack.h index 65d3f7a..78238ea 100644 --- a/src/mesa/main/pack.h +++ b/src/mesa/main/pack.h @@ -90,7 +90,7 @@ _mesa_unpack_dudv_span_byte(struct gl_context *ctx, GLbitfield transferOps); extern void -_mesa_unpack_index_span(const struct gl_context *ctx, GLuint n, +_mesa_unpack_index_span(struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, @@ -98,39 +98,39 @@ _mesa_unpack_index_span(const struct gl_context *ctx, GLuint n, extern void -_mesa_pack_index_span(const struct gl_context *ctx, GLuint n, +_mesa_pack_index_span(struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLuint *source, const struct gl_pixelstore_attrib *dstPacking, GLbitfield transferOps); extern void -_mesa_unpack_stencil_span(const struct gl_context *ctx, GLuint n, +_mesa_unpack_stencil_span(struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, GLbitfield transferOps); extern void -_mesa_pack_stencil_span(const struct gl_context *ctx, GLuint n, +_mesa_pack_stencil_span(struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLstencil *source, const struct gl_pixelstore_attrib *dstPacking); extern void -_mesa_unpack_depth_span(const struct gl_context *ctx, GLuint n, +_mesa_unpack_depth_span(struct gl_context *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLuint depthMax, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking); extern void -_mesa_pack_depth_span(const struct gl_context *ctx, GLuint n, GLvoid *dest, +_mesa_pack_depth_span(struct gl_context *ctx, GLuint n, GLvoid *dest, GLenum dstType, const GLfloat *depthSpan, const struct gl_pixelstore_attrib *dstPacking); extern void -_mesa_pack_depth_stencil_span(const struct gl_context *ctx, +_mesa_pack_depth_stencil_span(struct gl_context *ctx, GLuint n, GLuint *dest, const GLfloat *depthVals, const GLstencil *stencilVals, diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 5f824b3..0254980 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -33,6 +33,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" +#include "mfeatures.h" #include "pixel.h" #include "mtypes.h" #include "main/dispatch.h" diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c index b16d27a..9d78eec 100644 --- a/src/mesa/main/pixelstore.c +++ b/src/mesa/main/pixelstore.c @@ -32,6 +32,7 @@ #include "bufferobj.h" #include "context.h" #include "pixelstore.h" +#include "mfeatures.h" #include "mtypes.h" diff --git a/src/mesa/main/pixeltransfer.c b/src/mesa/main/pixeltransfer.c index 711181f..c183297 100644 --- a/src/mesa/main/pixeltransfer.c +++ b/src/mesa/main/pixeltransfer.c @@ -33,6 +33,7 @@ #include "colormac.h" #include "pixeltransfer.h" #include "imports.h" +#include "mtypes.h" /* diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 8874397..ef6460b 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -28,6 +28,7 @@ #include "hash.h" #include "imports.h" #include "queryobj.h" +#include "mfeatures.h" #include "mtypes.h" #include "main/dispatch.h" @@ -143,6 +144,11 @@ get_query_binding_point(struct gl_context *ctx, GLenum target) return &ctx->Query.CurrentOcclusionObject; else return NULL; + case GL_ANY_SAMPLES_PASSED: + if (ctx->Extensions.ARB_occlusion_query2) + return &ctx->Query.CurrentOcclusionObject; + else + return NULL; case GL_TIME_ELAPSED_EXT: if (ctx->Extensions.EXT_timer_query) return &ctx->Query.CurrentTimerObject; @@ -378,11 +384,18 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) if (!q->Ready) ctx->Driver.WaitQuery(ctx, q); /* if result is too large for returned type, clamp to max value */ - if (q->Result > 0x7fffffff) { - *params = 0x7fffffff; - } - else { - *params = (GLint)q->Result; + if (q->Target == GL_ANY_SAMPLES_PASSED) { + if (q->Result) + *params = GL_TRUE; + else + *params = GL_FALSE; + } else { + if (q->Result > 0x7fffffff) { + *params = 0x7fffffff; + } + else { + *params = (GLint)q->Result; + } } break; case GL_QUERY_RESULT_AVAILABLE_ARB: @@ -418,11 +431,18 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) if (!q->Ready) ctx->Driver.WaitQuery(ctx, q); /* if result is too large for returned type, clamp to max value */ - if (q->Result > 0xffffffff) { - *params = 0xffffffff; - } - else { - *params = (GLuint)q->Result; + if (q->Target == GL_ANY_SAMPLES_PASSED) { + if (q->Result) + *params = GL_TRUE; + else + *params = GL_FALSE; + } else { + if (q->Result > 0xffffffff) { + *params = 0xffffffff; + } + else { + *params = (GLuint)q->Result; + } } break; case GL_QUERY_RESULT_AVAILABLE_ARB: diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h index e289625..e4ad96b 100644 --- a/src/mesa/main/queryobj.h +++ b/src/mesa/main/queryobj.h @@ -27,6 +27,7 @@ #define QUERYOBJ_H +#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/hash.h" diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 6f52f07..a1f6f42 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -32,6 +32,8 @@ #include "context.h" #include "feedback.h" #include "macros.h" +#include "mfeatures.h" +#include "mtypes.h" #include "rastpos.h" #include "state.h" #include "main/dispatch.h" diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index a5612e3..e5b85ca 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -30,6 +30,7 @@ #include "framebuffer.h" #include "formats.h" #include "image.h" +#include "mtypes.h" #include "state.h" diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index 7368c76..a332f5d 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -70,4666 +70,4686 @@ static const char _mesa_function_pool[] = "\0" "glLoadIdentity\0" "\0" - /* _mesa_function_pool[216]: SampleCoverageARB (will be remapped) */ + /* _mesa_function_pool[216]: GetCombinerOutputParameterfvNV (will be remapped) */ + "iiip\0" + "glGetCombinerOutputParameterfvNV\0" + "\0" + /* _mesa_function_pool[255]: SampleCoverageARB (will be remapped) */ "fi\0" "glSampleCoverage\0" "glSampleCoverageARB\0" "\0" - /* _mesa_function_pool[257]: ConvolutionFilter1D (offset 348) */ + /* _mesa_function_pool[296]: ConvolutionFilter1D (offset 348) */ "iiiiip\0" "glConvolutionFilter1D\0" "glConvolutionFilter1DEXT\0" "\0" - /* _mesa_function_pool[312]: BeginQueryARB (will be remapped) */ + /* _mesa_function_pool[351]: BeginQueryARB (will be remapped) */ "ii\0" "glBeginQuery\0" "glBeginQueryARB\0" "\0" - /* _mesa_function_pool[345]: RasterPos3dv (offset 71) */ + /* _mesa_function_pool[384]: RasterPos3dv (offset 71) */ "p\0" "glRasterPos3dv\0" "\0" - /* _mesa_function_pool[363]: PointParameteriNV (will be remapped) */ + /* _mesa_function_pool[402]: PointParameteriNV (will be remapped) */ "ii\0" "glPointParameteri\0" "glPointParameteriNV\0" "\0" - /* _mesa_function_pool[405]: GetProgramiv (will be remapped) */ + /* _mesa_function_pool[444]: GetProgramiv (will be remapped) */ "iip\0" "glGetProgramiv\0" "\0" - /* _mesa_function_pool[425]: MultiTexCoord3sARB (offset 398) */ + /* _mesa_function_pool[464]: MultiTexCoord3sARB (offset 398) */ "iiii\0" "glMultiTexCoord3s\0" "glMultiTexCoord3sARB\0" "\0" - /* _mesa_function_pool[470]: SecondaryColor3iEXT (will be remapped) */ + /* _mesa_function_pool[509]: SecondaryColor3iEXT (will be remapped) */ "iii\0" "glSecondaryColor3i\0" "glSecondaryColor3iEXT\0" "\0" - /* _mesa_function_pool[516]: WindowPos3fMESA (will be remapped) */ + /* _mesa_function_pool[555]: WindowPos3fMESA (will be remapped) */ "fff\0" "glWindowPos3f\0" "glWindowPos3fARB\0" "glWindowPos3fMESA\0" "\0" - /* _mesa_function_pool[570]: TexCoord1iv (offset 99) */ + /* _mesa_function_pool[609]: TexCoord1iv (offset 99) */ "p\0" "glTexCoord1iv\0" "\0" - /* _mesa_function_pool[587]: TexCoord4sv (offset 125) */ + /* _mesa_function_pool[626]: TexCoord4sv (offset 125) */ "p\0" "glTexCoord4sv\0" "\0" - /* _mesa_function_pool[604]: RasterPos4s (offset 84) */ + /* _mesa_function_pool[643]: RasterPos4s (offset 84) */ "iiii\0" "glRasterPos4s\0" "\0" - /* _mesa_function_pool[624]: PixelTexGenParameterfvSGIS (will be remapped) */ + /* _mesa_function_pool[663]: PixelTexGenParameterfvSGIS (will be remapped) */ "ip\0" "glPixelTexGenParameterfvSGIS\0" "\0" - /* _mesa_function_pool[657]: ActiveTextureARB (offset 374) */ + /* _mesa_function_pool[696]: ActiveTextureARB (offset 374) */ "i\0" "glActiveTexture\0" "glActiveTextureARB\0" "\0" - /* _mesa_function_pool[695]: BlitFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[734]: BlitFramebufferEXT (will be remapped) */ "iiiiiiiiii\0" "glBlitFramebuffer\0" "glBlitFramebufferEXT\0" "\0" - /* _mesa_function_pool[746]: TexCoord1f (offset 96) */ + /* _mesa_function_pool[785]: TexCoord1f (offset 96) */ "f\0" "glTexCoord1f\0" "\0" - /* _mesa_function_pool[762]: TexCoord1d (offset 94) */ + /* _mesa_function_pool[801]: TexCoord1d (offset 94) */ "d\0" "glTexCoord1d\0" "\0" - /* _mesa_function_pool[778]: VertexAttrib4ubvNV (will be remapped) */ + /* _mesa_function_pool[817]: VertexAttrib4ubvNV (will be remapped) */ "ip\0" "glVertexAttrib4ubvNV\0" "\0" - /* _mesa_function_pool[803]: TexCoord1i (offset 98) */ + /* _mesa_function_pool[842]: TexCoord1i (offset 98) */ "i\0" "glTexCoord1i\0" "\0" - /* _mesa_function_pool[819]: GetProgramNamedParameterdvNV (will be remapped) */ + /* _mesa_function_pool[858]: GetProgramNamedParameterdvNV (will be remapped) */ "iipp\0" "glGetProgramNamedParameterdvNV\0" "\0" - /* _mesa_function_pool[856]: Histogram (offset 367) */ + /* _mesa_function_pool[895]: Histogram (offset 367) */ "iiii\0" "glHistogram\0" "glHistogramEXT\0" "\0" - /* _mesa_function_pool[889]: TexCoord1s (offset 100) */ + /* _mesa_function_pool[928]: TexCoord1s (offset 100) */ "i\0" "glTexCoord1s\0" "\0" - /* _mesa_function_pool[905]: GetMapfv (offset 267) */ + /* _mesa_function_pool[944]: GetMapfv (offset 267) */ "iip\0" "glGetMapfv\0" "\0" - /* _mesa_function_pool[921]: EvalCoord1f (offset 230) */ + /* _mesa_function_pool[960]: EvalCoord1f (offset 230) */ "f\0" "glEvalCoord1f\0" "\0" - /* _mesa_function_pool[938]: FramebufferTexture (will be remapped) */ + /* _mesa_function_pool[977]: FramebufferTexture (will be remapped) */ "iiii\0" "glFramebufferTexture\0" "\0" - /* _mesa_function_pool[965]: VertexAttribI1ivEXT (will be remapped) */ + /* _mesa_function_pool[1004]: VertexAttribI1ivEXT (will be remapped) */ "ip\0" "glVertexAttribI1ivEXT\0" "glVertexAttribI1iv\0" "\0" - /* _mesa_function_pool[1010]: TexImage4DSGIS (dynamic) */ + /* _mesa_function_pool[1049]: TexImage4DSGIS (dynamic) */ "iiiiiiiiiip\0" "glTexImage4DSGIS\0" "\0" - /* _mesa_function_pool[1040]: PolygonStipple (offset 175) */ + /* _mesa_function_pool[1079]: PolygonStipple (offset 175) */ "p\0" "glPolygonStipple\0" "\0" - /* _mesa_function_pool[1060]: WindowPos2dvMESA (will be remapped) */ + /* _mesa_function_pool[1099]: WindowPos2dvMESA (will be remapped) */ "p\0" "glWindowPos2dv\0" "glWindowPos2dvARB\0" "glWindowPos2dvMESA\0" "\0" - /* _mesa_function_pool[1115]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[1154]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[1159]: BlendEquationSeparateEXT (will be remapped) */ + /* _mesa_function_pool[1198]: BlendEquationSeparateEXT (will be remapped) */ "ii\0" "glBlendEquationSeparate\0" "glBlendEquationSeparateEXT\0" "glBlendEquationSeparateATI\0" "\0" - /* _mesa_function_pool[1241]: ListParameterfSGIX (dynamic) */ + /* _mesa_function_pool[1280]: ListParameterfSGIX (dynamic) */ "iif\0" "glListParameterfSGIX\0" "\0" - /* _mesa_function_pool[1267]: SecondaryColor3bEXT (will be remapped) */ + /* _mesa_function_pool[1306]: SecondaryColor3bEXT (will be remapped) */ "iii\0" "glSecondaryColor3b\0" "glSecondaryColor3bEXT\0" "\0" - /* _mesa_function_pool[1313]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */ + /* _mesa_function_pool[1352]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */ "pppp\0" "glTexCoord4fColor4fNormal3fVertex4fvSUN\0" "\0" - /* _mesa_function_pool[1359]: GetPixelMapfv (offset 271) */ + /* _mesa_function_pool[1398]: GetPixelMapfv (offset 271) */ "ip\0" "glGetPixelMapfv\0" "\0" - /* _mesa_function_pool[1379]: Color3uiv (offset 22) */ + /* _mesa_function_pool[1418]: Color3uiv (offset 22) */ "p\0" "glColor3uiv\0" "\0" - /* _mesa_function_pool[1394]: IsEnabled (offset 286) */ + /* _mesa_function_pool[1433]: IsEnabled (offset 286) */ "i\0" "glIsEnabled\0" "\0" - /* _mesa_function_pool[1409]: VertexAttrib4svNV (will be remapped) */ + /* _mesa_function_pool[1448]: VertexAttrib4svNV (will be remapped) */ "ip\0" "glVertexAttrib4svNV\0" "\0" - /* _mesa_function_pool[1433]: EvalCoord2fv (offset 235) */ + /* _mesa_function_pool[1472]: EvalCoord2fv (offset 235) */ "p\0" "glEvalCoord2fv\0" "\0" - /* _mesa_function_pool[1451]: GetBufferSubDataARB (will be remapped) */ + /* _mesa_function_pool[1490]: GetBufferSubDataARB (will be remapped) */ "iiip\0" "glGetBufferSubData\0" "glGetBufferSubDataARB\0" "\0" - /* _mesa_function_pool[1498]: BufferSubDataARB (will be remapped) */ + /* _mesa_function_pool[1537]: BufferSubDataARB (will be remapped) */ "iiip\0" "glBufferSubData\0" "glBufferSubDataARB\0" "\0" - /* _mesa_function_pool[1539]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[1578]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[1577]: AttachShader (will be remapped) */ + /* _mesa_function_pool[1616]: AttachShader (will be remapped) */ "ii\0" "glAttachShader\0" "\0" - /* _mesa_function_pool[1596]: VertexAttrib2fARB (will be remapped) */ + /* _mesa_function_pool[1635]: VertexAttrib2fARB (will be remapped) */ "iff\0" "glVertexAttrib2f\0" "glVertexAttrib2fARB\0" "\0" - /* _mesa_function_pool[1638]: GetDebugLogLengthMESA (dynamic) */ + /* _mesa_function_pool[1677]: GetDebugLogLengthMESA (dynamic) */ "iii\0" "glGetDebugLogLengthMESA\0" "\0" - /* _mesa_function_pool[1667]: GetMapiv (offset 268) */ + /* _mesa_function_pool[1706]: GetMapiv (offset 268) */ "iip\0" "glGetMapiv\0" "\0" - /* _mesa_function_pool[1683]: VertexAttrib3fARB (will be remapped) */ + /* _mesa_function_pool[1722]: VertexAttrib3fARB (will be remapped) */ "ifff\0" "glVertexAttrib3f\0" "glVertexAttrib3fARB\0" "\0" - /* _mesa_function_pool[1726]: Indexubv (offset 316) */ + /* _mesa_function_pool[1765]: Indexubv (offset 316) */ "p\0" "glIndexubv\0" "\0" - /* _mesa_function_pool[1740]: GetQueryivARB (will be remapped) */ + /* _mesa_function_pool[1779]: GetQueryivARB (will be remapped) */ "iip\0" "glGetQueryiv\0" "glGetQueryivARB\0" "\0" - /* _mesa_function_pool[1774]: TexImage3D (offset 371) */ + /* _mesa_function_pool[1813]: TexImage3D (offset 371) */ "iiiiiiiiip\0" "glTexImage3D\0" "glTexImage3DEXT\0" "\0" - /* _mesa_function_pool[1815]: BindFragDataLocationEXT (will be remapped) */ + /* _mesa_function_pool[1854]: BindFragDataLocationEXT (will be remapped) */ "iip\0" "glBindFragDataLocationEXT\0" "glBindFragDataLocation\0" "\0" - /* _mesa_function_pool[1869]: ReplacementCodeuiVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[1908]: ReplacementCodeuiVertex3fvSUN (dynamic) */ "pp\0" "glReplacementCodeuiVertex3fvSUN\0" "\0" - /* _mesa_function_pool[1905]: EdgeFlagPointer (offset 312) */ + /* _mesa_function_pool[1944]: EdgeFlagPointer (offset 312) */ "ip\0" "glEdgeFlagPointer\0" "\0" - /* _mesa_function_pool[1927]: Color3ubv (offset 20) */ + /* _mesa_function_pool[1966]: Color3ubv (offset 20) */ "p\0" "glColor3ubv\0" "\0" - /* _mesa_function_pool[1942]: GetQueryObjectivARB (will be remapped) */ + /* _mesa_function_pool[1981]: GetQueryObjectivARB (will be remapped) */ "iip\0" "glGetQueryObjectiv\0" "glGetQueryObjectivARB\0" "\0" - /* _mesa_function_pool[1988]: Vertex3dv (offset 135) */ + /* _mesa_function_pool[2027]: Vertex3dv (offset 135) */ "p\0" "glVertex3dv\0" "\0" - /* _mesa_function_pool[2003]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[2042]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiTexCoord2fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[2050]: CompressedTexSubImage2DARB (will be remapped) */ + /* _mesa_function_pool[2089]: CompressedTexSubImage2DARB (will be remapped) */ "iiiiiiiip\0" "glCompressedTexSubImage2D\0" "glCompressedTexSubImage2DARB\0" "\0" - /* _mesa_function_pool[2116]: CombinerOutputNV (will be remapped) */ + /* _mesa_function_pool[2155]: CombinerOutputNV (will be remapped) */ "iiiiiiiiii\0" "glCombinerOutputNV\0" "\0" - /* _mesa_function_pool[2147]: VertexAttribs3fvNV (will be remapped) */ + /* _mesa_function_pool[2186]: VertexAttribs3fvNV (will be remapped) */ "iip\0" "glVertexAttribs3fvNV\0" "\0" - /* _mesa_function_pool[2173]: Uniform2fARB (will be remapped) */ + /* _mesa_function_pool[2212]: Uniform2fARB (will be remapped) */ "iff\0" "glUniform2f\0" "glUniform2fARB\0" "\0" - /* _mesa_function_pool[2205]: LightModeliv (offset 166) */ + /* _mesa_function_pool[2244]: LightModeliv (offset 166) */ "ip\0" "glLightModeliv\0" "\0" - /* _mesa_function_pool[2224]: VertexAttrib1svARB (will be remapped) */ + /* _mesa_function_pool[2263]: VertexAttrib1svARB (will be remapped) */ "ip\0" "glVertexAttrib1sv\0" "glVertexAttrib1svARB\0" "\0" - /* _mesa_function_pool[2267]: VertexAttribs1dvNV (will be remapped) */ + /* _mesa_function_pool[2306]: VertexAttribs1dvNV (will be remapped) */ "iip\0" "glVertexAttribs1dvNV\0" "\0" - /* _mesa_function_pool[2293]: Uniform2ivARB (will be remapped) */ + /* _mesa_function_pool[2332]: Uniform2ivARB (will be remapped) */ "iip\0" "glUniform2iv\0" "glUniform2ivARB\0" "\0" - /* _mesa_function_pool[2327]: GetImageTransformParameterfvHP (dynamic) */ + /* _mesa_function_pool[2366]: GetImageTransformParameterfvHP (dynamic) */ "iip\0" "glGetImageTransformParameterfvHP\0" "\0" - /* _mesa_function_pool[2365]: Normal3bv (offset 53) */ + /* _mesa_function_pool[2404]: Normal3bv (offset 53) */ "p\0" "glNormal3bv\0" "\0" - /* _mesa_function_pool[2380]: TexGeniv (offset 193) */ + /* _mesa_function_pool[2419]: TexGeniv (offset 193) */ "iip\0" "glTexGeniv\0" "\0" - /* _mesa_function_pool[2396]: WeightubvARB (dynamic) */ + /* _mesa_function_pool[2435]: WeightubvARB (dynamic) */ "ip\0" "glWeightubvARB\0" "\0" - /* _mesa_function_pool[2415]: VertexAttrib1fvNV (will be remapped) */ + /* _mesa_function_pool[2454]: VertexAttrib1fvNV (will be remapped) */ "ip\0" "glVertexAttrib1fvNV\0" "\0" - /* _mesa_function_pool[2439]: Vertex3iv (offset 139) */ + /* _mesa_function_pool[2478]: Vertex3iv (offset 139) */ "p\0" "glVertex3iv\0" "\0" - /* _mesa_function_pool[2454]: CopyConvolutionFilter1D (offset 354) */ + /* _mesa_function_pool[2493]: CopyConvolutionFilter1D (offset 354) */ "iiiii\0" "glCopyConvolutionFilter1D\0" "glCopyConvolutionFilter1DEXT\0" "\0" - /* _mesa_function_pool[2516]: VertexAttribI1uiEXT (will be remapped) */ + /* _mesa_function_pool[2555]: VertexAttribI1uiEXT (will be remapped) */ "ii\0" "glVertexAttribI1uiEXT\0" "glVertexAttribI1ui\0" "\0" - /* _mesa_function_pool[2561]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[2600]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */ "iffffff\0" "glReplacementCodeuiNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[2609]: DeleteSync (will be remapped) */ + /* _mesa_function_pool[2648]: DeleteSync (will be remapped) */ "i\0" "glDeleteSync\0" "\0" - /* _mesa_function_pool[2625]: FragmentMaterialfvSGIX (dynamic) */ + /* _mesa_function_pool[2664]: FragmentMaterialfvSGIX (dynamic) */ "iip\0" "glFragmentMaterialfvSGIX\0" "\0" - /* _mesa_function_pool[2655]: BlendColor (offset 336) */ + /* _mesa_function_pool[2694]: BlendColor (offset 336) */ "ffff\0" "glBlendColor\0" "glBlendColorEXT\0" "\0" - /* _mesa_function_pool[2690]: UniformMatrix4fvARB (will be remapped) */ + /* _mesa_function_pool[2729]: UniformMatrix4fvARB (will be remapped) */ "iiip\0" "glUniformMatrix4fv\0" "glUniformMatrix4fvARB\0" "\0" - /* _mesa_function_pool[2737]: DeleteVertexArraysAPPLE (will be remapped) */ + /* _mesa_function_pool[2776]: DeleteVertexArraysAPPLE (will be remapped) */ "ip\0" "glDeleteVertexArrays\0" "glDeleteVertexArraysAPPLE\0" "\0" - /* _mesa_function_pool[2788]: TexBuffer (will be remapped) */ + /* _mesa_function_pool[2827]: TexBuffer (will be remapped) */ "iii\0" "glTexBuffer\0" "\0" - /* _mesa_function_pool[2805]: ReadInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[2844]: ReadInstrumentsSGIX (dynamic) */ "i\0" "glReadInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[2830]: CallLists (offset 3) */ + /* _mesa_function_pool[2869]: CallLists (offset 3) */ "iip\0" "glCallLists\0" "\0" - /* _mesa_function_pool[2847]: UniformMatrix2x4fv (will be remapped) */ + /* _mesa_function_pool[2886]: UniformMatrix2x4fv (will be remapped) */ "iiip\0" "glUniformMatrix2x4fv\0" "\0" - /* _mesa_function_pool[2874]: Color4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[2913]: Color4ubVertex3fvSUN (dynamic) */ "pp\0" "glColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[2901]: Normal3iv (offset 59) */ + /* _mesa_function_pool[2940]: Normal3iv (offset 59) */ "p\0" "glNormal3iv\0" "\0" - /* _mesa_function_pool[2916]: PassThrough (offset 199) */ + /* _mesa_function_pool[2955]: PassThrough (offset 199) */ "f\0" "glPassThrough\0" "\0" - /* _mesa_function_pool[2933]: GetVertexAttribIivEXT (will be remapped) */ + /* _mesa_function_pool[2972]: GetVertexAttribIivEXT (will be remapped) */ "iip\0" "glGetVertexAttribIivEXT\0" "glGetVertexAttribIiv\0" "\0" - /* _mesa_function_pool[2983]: TexParameterIivEXT (will be remapped) */ + /* _mesa_function_pool[3022]: TexParameterIivEXT (will be remapped) */ "iip\0" "glTexParameterIivEXT\0" "glTexParameterIiv\0" "\0" - /* _mesa_function_pool[3027]: FramebufferTextureLayerEXT (will be remapped) */ + /* _mesa_function_pool[3066]: FramebufferTextureLayerEXT (will be remapped) */ "iiiii\0" "glFramebufferTextureLayer\0" "glFramebufferTextureLayerEXT\0" "\0" - /* _mesa_function_pool[3089]: GetListParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[3128]: GetListParameterfvSGIX (dynamic) */ "iip\0" "glGetListParameterfvSGIX\0" "\0" - /* _mesa_function_pool[3119]: Viewport (offset 305) */ + /* _mesa_function_pool[3158]: Viewport (offset 305) */ "iiii\0" "glViewport\0" "\0" - /* _mesa_function_pool[3136]: VertexAttrib4NusvARB (will be remapped) */ + /* _mesa_function_pool[3175]: VertexAttrib4NusvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nusv\0" "glVertexAttrib4NusvARB\0" "\0" - /* _mesa_function_pool[3183]: WindowPos4svMESA (will be remapped) */ + /* _mesa_function_pool[3222]: WindowPos4svMESA (will be remapped) */ "p\0" "glWindowPos4svMESA\0" "\0" - /* _mesa_function_pool[3205]: CreateProgramObjectARB (will be remapped) */ + /* _mesa_function_pool[3244]: CreateProgramObjectARB (will be remapped) */ "\0" "glCreateProgramObjectARB\0" "\0" - /* _mesa_function_pool[3232]: DeleteTransformFeedbacks (will be remapped) */ + /* _mesa_function_pool[3271]: DeleteTransformFeedbacks (will be remapped) */ "ip\0" "glDeleteTransformFeedbacks\0" "\0" - /* _mesa_function_pool[3263]: UniformMatrix4x3fv (will be remapped) */ + /* _mesa_function_pool[3302]: UniformMatrix4x3fv (will be remapped) */ "iiip\0" "glUniformMatrix4x3fv\0" "\0" - /* _mesa_function_pool[3290]: PrioritizeTextures (offset 331) */ + /* _mesa_function_pool[3329]: PrioritizeTextures (offset 331) */ "ipp\0" "glPrioritizeTextures\0" "glPrioritizeTexturesEXT\0" "\0" - /* _mesa_function_pool[3340]: VertexAttribI3uiEXT (will be remapped) */ + /* _mesa_function_pool[3379]: VertexAttribI3uiEXT (will be remapped) */ "iiii\0" "glVertexAttribI3uiEXT\0" "glVertexAttribI3ui\0" "\0" - /* _mesa_function_pool[3387]: AsyncMarkerSGIX (dynamic) */ + /* _mesa_function_pool[3426]: AsyncMarkerSGIX (dynamic) */ "i\0" "glAsyncMarkerSGIX\0" "\0" - /* _mesa_function_pool[3408]: GlobalAlphaFactorubSUN (dynamic) */ + /* _mesa_function_pool[3447]: GlobalAlphaFactorubSUN (dynamic) */ "i\0" "glGlobalAlphaFactorubSUN\0" "\0" - /* _mesa_function_pool[3436]: ClearColorIuiEXT (will be remapped) */ + /* _mesa_function_pool[3475]: ClearColorIuiEXT (will be remapped) */ "iiii\0" "glClearColorIuiEXT\0" "\0" - /* _mesa_function_pool[3461]: ClearDebugLogMESA (dynamic) */ + /* _mesa_function_pool[3500]: ClearDebugLogMESA (dynamic) */ "iii\0" "glClearDebugLogMESA\0" "\0" - /* _mesa_function_pool[3486]: Uniform4uiEXT (will be remapped) */ + /* _mesa_function_pool[3525]: Uniform4uiEXT (will be remapped) */ "iiiii\0" "glUniform4uiEXT\0" "glUniform4ui\0" "\0" - /* _mesa_function_pool[3522]: ResetHistogram (offset 369) */ + /* _mesa_function_pool[3561]: ResetHistogram (offset 369) */ "i\0" "glResetHistogram\0" "glResetHistogramEXT\0" "\0" - /* _mesa_function_pool[3562]: GetProgramNamedParameterfvNV (will be remapped) */ + /* _mesa_function_pool[3601]: GetProgramNamedParameterfvNV (will be remapped) */ "iipp\0" "glGetProgramNamedParameterfvNV\0" "\0" - /* _mesa_function_pool[3599]: PointParameterfEXT (will be remapped) */ + /* _mesa_function_pool[3638]: PointParameterfEXT (will be remapped) */ "if\0" "glPointParameterf\0" "glPointParameterfARB\0" "glPointParameterfEXT\0" "glPointParameterfSGIS\0" "\0" - /* _mesa_function_pool[3685]: LoadIdentityDeformationMapSGIX (dynamic) */ + /* _mesa_function_pool[3724]: LoadIdentityDeformationMapSGIX (dynamic) */ "i\0" "glLoadIdentityDeformationMapSGIX\0" "\0" - /* _mesa_function_pool[3721]: GenFencesNV (will be remapped) */ + /* _mesa_function_pool[3760]: GenFencesNV (will be remapped) */ "ip\0" "glGenFencesNV\0" "\0" - /* _mesa_function_pool[3739]: ImageTransformParameterfHP (dynamic) */ + /* _mesa_function_pool[3778]: ImageTransformParameterfHP (dynamic) */ "iif\0" "glImageTransformParameterfHP\0" "\0" - /* _mesa_function_pool[3773]: MatrixIndexusvARB (dynamic) */ + /* _mesa_function_pool[3812]: MatrixIndexusvARB (dynamic) */ "ip\0" "glMatrixIndexusvARB\0" "\0" - /* _mesa_function_pool[3797]: DrawElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[3836]: DrawElementsBaseVertex (will be remapped) */ "iiipi\0" "glDrawElementsBaseVertex\0" "\0" - /* _mesa_function_pool[3829]: DisableVertexAttribArrayARB (will be remapped) */ + /* _mesa_function_pool[3868]: DisableVertexAttribArrayARB (will be remapped) */ "i\0" "glDisableVertexAttribArray\0" "glDisableVertexAttribArrayARB\0" "\0" - /* _mesa_function_pool[3889]: TexCoord2sv (offset 109) */ + /* _mesa_function_pool[3928]: TexCoord2sv (offset 109) */ "p\0" "glTexCoord2sv\0" "\0" - /* _mesa_function_pool[3906]: Vertex4dv (offset 143) */ + /* _mesa_function_pool[3945]: Vertex4dv (offset 143) */ "p\0" "glVertex4dv\0" "\0" - /* _mesa_function_pool[3921]: StencilMaskSeparate (will be remapped) */ + /* _mesa_function_pool[3960]: StencilMaskSeparate (will be remapped) */ "ii\0" "glStencilMaskSeparate\0" "\0" - /* _mesa_function_pool[3947]: ProgramLocalParameter4dARB (will be remapped) */ + /* _mesa_function_pool[3986]: ProgramLocalParameter4dARB (will be remapped) */ "iidddd\0" "glProgramLocalParameter4dARB\0" "\0" - /* _mesa_function_pool[3984]: CompressedTexImage3DARB (will be remapped) */ + /* _mesa_function_pool[4023]: CompressedTexImage3DARB (will be remapped) */ "iiiiiiiip\0" "glCompressedTexImage3D\0" "glCompressedTexImage3DARB\0" "\0" - /* _mesa_function_pool[4044]: Color3sv (offset 18) */ + /* _mesa_function_pool[4083]: Color3sv (offset 18) */ "p\0" "glColor3sv\0" "\0" - /* _mesa_function_pool[4058]: GetConvolutionParameteriv (offset 358) */ + /* _mesa_function_pool[4097]: GetConvolutionParameteriv (offset 358) */ "iip\0" "glGetConvolutionParameteriv\0" "glGetConvolutionParameterivEXT\0" "\0" - /* _mesa_function_pool[4122]: VertexAttrib1fARB (will be remapped) */ + /* _mesa_function_pool[4161]: VertexAttrib1fARB (will be remapped) */ "if\0" "glVertexAttrib1f\0" "glVertexAttrib1fARB\0" "\0" - /* _mesa_function_pool[4163]: Vertex2dv (offset 127) */ + /* _mesa_function_pool[4202]: Vertex2dv (offset 127) */ "p\0" "glVertex2dv\0" "\0" - /* _mesa_function_pool[4178]: TestFenceNV (will be remapped) */ + /* _mesa_function_pool[4217]: TestFenceNV (will be remapped) */ "i\0" "glTestFenceNV\0" "\0" - /* _mesa_function_pool[4195]: GetVertexAttribIuivEXT (will be remapped) */ - "iip\0" - "glGetVertexAttribIuivEXT\0" - "glGetVertexAttribIuiv\0" - "\0" - /* _mesa_function_pool[4247]: MultiTexCoord1fvARB (offset 379) */ + /* _mesa_function_pool[4234]: MultiTexCoord1fvARB (offset 379) */ "ip\0" "glMultiTexCoord1fv\0" "glMultiTexCoord1fvARB\0" "\0" - /* _mesa_function_pool[4292]: TexCoord3iv (offset 115) */ + /* _mesa_function_pool[4279]: TexCoord3iv (offset 115) */ "p\0" "glTexCoord3iv\0" "\0" - /* _mesa_function_pool[4309]: Uniform2uivEXT (will be remapped) */ + /* _mesa_function_pool[4296]: Uniform2uivEXT (will be remapped) */ "iip\0" "glUniform2uivEXT\0" "glUniform2uiv\0" "\0" - /* _mesa_function_pool[4345]: ColorFragmentOp2ATI (will be remapped) */ + /* _mesa_function_pool[4332]: ColorFragmentOp2ATI (will be remapped) */ "iiiiiiiiii\0" "glColorFragmentOp2ATI\0" "\0" - /* _mesa_function_pool[4379]: SecondaryColorPointerListIBM (dynamic) */ + /* _mesa_function_pool[4366]: SecondaryColorPointerListIBM (dynamic) */ "iiipi\0" "glSecondaryColorPointerListIBM\0" "\0" - /* _mesa_function_pool[4417]: GetPixelTexGenParameterivSGIS (will be remapped) */ + /* _mesa_function_pool[4404]: GetPixelTexGenParameterivSGIS (will be remapped) */ "ip\0" "glGetPixelTexGenParameterivSGIS\0" "\0" - /* _mesa_function_pool[4453]: Color3fv (offset 14) */ + /* _mesa_function_pool[4440]: Color3fv (offset 14) */ "p\0" "glColor3fv\0" "\0" - /* _mesa_function_pool[4467]: VertexAttrib4fNV (will be remapped) */ + /* _mesa_function_pool[4454]: VertexAttrib4fNV (will be remapped) */ "iffff\0" "glVertexAttrib4fNV\0" "\0" - /* _mesa_function_pool[4493]: ReplacementCodeubSUN (dynamic) */ + /* _mesa_function_pool[4480]: ReplacementCodeubSUN (dynamic) */ "i\0" "glReplacementCodeubSUN\0" "\0" - /* _mesa_function_pool[4519]: FinishAsyncSGIX (dynamic) */ + /* _mesa_function_pool[4506]: FinishAsyncSGIX (dynamic) */ "p\0" "glFinishAsyncSGIX\0" "\0" - /* _mesa_function_pool[4540]: GetDebugLogMESA (dynamic) */ + /* _mesa_function_pool[4527]: GetDebugLogMESA (dynamic) */ "iiiipp\0" "glGetDebugLogMESA\0" "\0" - /* _mesa_function_pool[4566]: FogCoorddEXT (will be remapped) */ + /* _mesa_function_pool[4553]: FogCoorddEXT (will be remapped) */ "d\0" "glFogCoordd\0" "glFogCoorddEXT\0" "\0" - /* _mesa_function_pool[4596]: BeginConditionalRenderNV (will be remapped) */ + /* _mesa_function_pool[4583]: BeginConditionalRenderNV (will be remapped) */ "ii\0" "glBeginConditionalRenderNV\0" "glBeginConditionalRender\0" "\0" - /* _mesa_function_pool[4652]: Color4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[4639]: Color4ubVertex3fSUN (dynamic) */ "iiiifff\0" "glColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[4683]: FogCoordfEXT (will be remapped) */ + /* _mesa_function_pool[4670]: FogCoordfEXT (will be remapped) */ "f\0" "glFogCoordf\0" "glFogCoordfEXT\0" "\0" - /* _mesa_function_pool[4713]: PointSize (offset 173) */ + /* _mesa_function_pool[4700]: PointSize (offset 173) */ "f\0" "glPointSize\0" "\0" - /* _mesa_function_pool[4728]: VertexAttribI2uivEXT (will be remapped) */ + /* _mesa_function_pool[4715]: VertexAttribI2uivEXT (will be remapped) */ "ip\0" "glVertexAttribI2uivEXT\0" "glVertexAttribI2uiv\0" "\0" - /* _mesa_function_pool[4775]: TexCoord2fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[4762]: TexCoord2fVertex3fSUN (dynamic) */ "fffff\0" "glTexCoord2fVertex3fSUN\0" "\0" - /* _mesa_function_pool[4806]: PopName (offset 200) */ + /* _mesa_function_pool[4793]: PopName (offset 200) */ "\0" "glPopName\0" "\0" - /* _mesa_function_pool[4818]: GlobalAlphaFactoriSUN (dynamic) */ + /* _mesa_function_pool[4805]: GlobalAlphaFactoriSUN (dynamic) */ "i\0" "glGlobalAlphaFactoriSUN\0" "\0" - /* _mesa_function_pool[4845]: VertexAttrib2dNV (will be remapped) */ + /* _mesa_function_pool[4832]: VertexAttrib2dNV (will be remapped) */ "idd\0" "glVertexAttrib2dNV\0" "\0" - /* _mesa_function_pool[4869]: GetProgramInfoLog (will be remapped) */ + /* _mesa_function_pool[4856]: GetProgramInfoLog (will be remapped) */ "iipp\0" "glGetProgramInfoLog\0" "\0" - /* _mesa_function_pool[4895]: VertexAttrib4NbvARB (will be remapped) */ + /* _mesa_function_pool[4882]: VertexAttrib4NbvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nbv\0" "glVertexAttrib4NbvARB\0" "\0" - /* _mesa_function_pool[4940]: GetActiveAttribARB (will be remapped) */ + /* _mesa_function_pool[4927]: GetActiveAttribARB (will be remapped) */ "iiipppp\0" "glGetActiveAttrib\0" "glGetActiveAttribARB\0" "\0" - /* _mesa_function_pool[4988]: Vertex4sv (offset 149) */ + /* _mesa_function_pool[4975]: Vertex4sv (offset 149) */ "p\0" "glVertex4sv\0" "\0" - /* _mesa_function_pool[5003]: VertexAttrib4ubNV (will be remapped) */ + /* _mesa_function_pool[4990]: VertexAttrib4ubNV (will be remapped) */ "iiiii\0" "glVertexAttrib4ubNV\0" "\0" - /* _mesa_function_pool[5030]: ClampColor (will be remapped) */ + /* _mesa_function_pool[5017]: ClampColor (will be remapped) */ "ii\0" "glClampColor\0" "\0" - /* _mesa_function_pool[5047]: TextureRangeAPPLE (will be remapped) */ + /* _mesa_function_pool[5034]: TextureRangeAPPLE (will be remapped) */ "iip\0" "glTextureRangeAPPLE\0" "\0" - /* _mesa_function_pool[5072]: GetTexEnvfv (offset 276) */ + /* _mesa_function_pool[5059]: GetTexEnvfv (offset 276) */ "iip\0" "glGetTexEnvfv\0" "\0" - /* _mesa_function_pool[5091]: BindTransformFeedback (will be remapped) */ + /* _mesa_function_pool[5078]: BindTransformFeedback (will be remapped) */ "ii\0" "glBindTransformFeedback\0" "\0" - /* _mesa_function_pool[5119]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[5106]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ "ffffffffffff\0" "glTexCoord2fColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[5172]: Indexub (offset 315) */ + /* _mesa_function_pool[5159]: Indexub (offset 315) */ "i\0" "glIndexub\0" "\0" - /* _mesa_function_pool[5185]: TexEnvi (offset 186) */ + /* _mesa_function_pool[5172]: ColorMaskIndexedEXT (will be remapped) */ + "iiiii\0" + "glColorMaskIndexedEXT\0" + "glColorMaski\0" + "\0" + /* _mesa_function_pool[5214]: TexEnvi (offset 186) */ "iii\0" "glTexEnvi\0" "\0" - /* _mesa_function_pool[5200]: GetClipPlane (offset 259) */ + /* _mesa_function_pool[5229]: GetClipPlane (offset 259) */ "ip\0" "glGetClipPlane\0" "\0" - /* _mesa_function_pool[5219]: CombinerParameterfvNV (will be remapped) */ + /* _mesa_function_pool[5248]: CombinerParameterfvNV (will be remapped) */ "ip\0" "glCombinerParameterfvNV\0" "\0" - /* _mesa_function_pool[5247]: VertexAttribs3dvNV (will be remapped) */ + /* _mesa_function_pool[5276]: VertexAttribs3dvNV (will be remapped) */ "iip\0" "glVertexAttribs3dvNV\0" "\0" - /* _mesa_function_pool[5273]: VertexAttribI2uiEXT (will be remapped) */ + /* _mesa_function_pool[5302]: VertexAttribI2uiEXT (will be remapped) */ "iii\0" "glVertexAttribI2uiEXT\0" "glVertexAttribI2ui\0" "\0" - /* _mesa_function_pool[5319]: VertexAttribs4fvNV (will be remapped) */ + /* _mesa_function_pool[5348]: VertexAttribs4fvNV (will be remapped) */ "iip\0" "glVertexAttribs4fvNV\0" "\0" - /* _mesa_function_pool[5345]: VertexArrayRangeNV (will be remapped) */ + /* _mesa_function_pool[5374]: VertexArrayRangeNV (will be remapped) */ "ip\0" "glVertexArrayRangeNV\0" "\0" - /* _mesa_function_pool[5370]: FragmentLightiSGIX (dynamic) */ + /* _mesa_function_pool[5399]: FragmentLightiSGIX (dynamic) */ "iii\0" "glFragmentLightiSGIX\0" "\0" - /* _mesa_function_pool[5396]: PolygonOffsetEXT (will be remapped) */ + /* _mesa_function_pool[5425]: PolygonOffsetEXT (will be remapped) */ "ff\0" "glPolygonOffsetEXT\0" "\0" - /* _mesa_function_pool[5419]: VertexAttribI4uivEXT (will be remapped) */ + /* _mesa_function_pool[5448]: VertexAttribI4uivEXT (will be remapped) */ "ip\0" "glVertexAttribI4uivEXT\0" "glVertexAttribI4uiv\0" "\0" - /* _mesa_function_pool[5466]: PollAsyncSGIX (dynamic) */ + /* _mesa_function_pool[5495]: PollAsyncSGIX (dynamic) */ "p\0" "glPollAsyncSGIX\0" "\0" - /* _mesa_function_pool[5485]: DeleteFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[5514]: DeleteFragmentShaderATI (will be remapped) */ "i\0" "glDeleteFragmentShaderATI\0" "\0" - /* _mesa_function_pool[5514]: Scaled (offset 301) */ + /* _mesa_function_pool[5543]: Scaled (offset 301) */ "ddd\0" "glScaled\0" "\0" - /* _mesa_function_pool[5528]: ResumeTransformFeedback (will be remapped) */ + /* _mesa_function_pool[5557]: ResumeTransformFeedback (will be remapped) */ "\0" "glResumeTransformFeedback\0" "\0" - /* _mesa_function_pool[5556]: Scalef (offset 302) */ + /* _mesa_function_pool[5585]: Scalef (offset 302) */ "fff\0" "glScalef\0" "\0" - /* _mesa_function_pool[5570]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[5599]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[5608]: MultTransposeMatrixdARB (will be remapped) */ + /* _mesa_function_pool[5637]: MultTransposeMatrixdARB (will be remapped) */ "p\0" "glMultTransposeMatrixd\0" "glMultTransposeMatrixdARB\0" "\0" - /* _mesa_function_pool[5660]: ColorMaskIndexedEXT (will be remapped) */ - "iiiii\0" - "glColorMaskIndexedEXT\0" - "glColorMaski\0" - "\0" - /* _mesa_function_pool[5702]: ObjectUnpurgeableAPPLE (will be remapped) */ + /* _mesa_function_pool[5689]: ObjectUnpurgeableAPPLE (will be remapped) */ "iii\0" "glObjectUnpurgeableAPPLE\0" "\0" - /* _mesa_function_pool[5732]: AlphaFunc (offset 240) */ + /* _mesa_function_pool[5719]: AlphaFunc (offset 240) */ "if\0" "glAlphaFunc\0" "\0" - /* _mesa_function_pool[5748]: WindowPos2svMESA (will be remapped) */ + /* _mesa_function_pool[5735]: WindowPos2svMESA (will be remapped) */ "p\0" "glWindowPos2sv\0" "glWindowPos2svARB\0" "glWindowPos2svMESA\0" "\0" - /* _mesa_function_pool[5803]: EdgeFlag (offset 41) */ + /* _mesa_function_pool[5790]: EdgeFlag (offset 41) */ "i\0" "glEdgeFlag\0" "\0" - /* _mesa_function_pool[5817]: TexCoord2iv (offset 107) */ + /* _mesa_function_pool[5804]: TexCoord2iv (offset 107) */ "p\0" "glTexCoord2iv\0" "\0" - /* _mesa_function_pool[5834]: CompressedTexImage1DARB (will be remapped) */ + /* _mesa_function_pool[5821]: CompressedTexImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexImage1D\0" "glCompressedTexImage1DARB\0" "\0" - /* _mesa_function_pool[5892]: Rotated (offset 299) */ + /* _mesa_function_pool[5879]: Rotated (offset 299) */ "dddd\0" "glRotated\0" "\0" - /* _mesa_function_pool[5908]: GetTexParameterIuivEXT (will be remapped) */ + /* _mesa_function_pool[5895]: GetTexParameterIuivEXT (will be remapped) */ "iip\0" "glGetTexParameterIuivEXT\0" "glGetTexParameterIuiv\0" "\0" - /* _mesa_function_pool[5960]: VertexAttrib2sNV (will be remapped) */ + /* _mesa_function_pool[5947]: VertexAttrib2sNV (will be remapped) */ "iii\0" "glVertexAttrib2sNV\0" "\0" - /* _mesa_function_pool[5984]: ReadPixels (offset 256) */ + /* _mesa_function_pool[5971]: ReadPixels (offset 256) */ "iiiiiip\0" "glReadPixels\0" "\0" - /* _mesa_function_pool[6006]: EdgeFlagv (offset 42) */ + /* _mesa_function_pool[5993]: EdgeFlagv (offset 42) */ "p\0" "glEdgeFlagv\0" "\0" - /* _mesa_function_pool[6021]: NormalPointerListIBM (dynamic) */ + /* _mesa_function_pool[6008]: NormalPointerListIBM (dynamic) */ "iipi\0" "glNormalPointerListIBM\0" "\0" - /* _mesa_function_pool[6050]: IndexPointerEXT (will be remapped) */ + /* _mesa_function_pool[6037]: IndexPointerEXT (will be remapped) */ "iiip\0" "glIndexPointerEXT\0" "\0" - /* _mesa_function_pool[6074]: Color4iv (offset 32) */ + /* _mesa_function_pool[6061]: Color4iv (offset 32) */ "p\0" "glColor4iv\0" "\0" - /* _mesa_function_pool[6088]: TexParameterf (offset 178) */ + /* _mesa_function_pool[6075]: TexParameterf (offset 178) */ "iif\0" "glTexParameterf\0" "\0" - /* _mesa_function_pool[6109]: TexParameteri (offset 180) */ + /* _mesa_function_pool[6096]: TexParameteri (offset 180) */ "iii\0" "glTexParameteri\0" "\0" - /* _mesa_function_pool[6130]: NormalPointerEXT (will be remapped) */ + /* _mesa_function_pool[6117]: NormalPointerEXT (will be remapped) */ "iiip\0" "glNormalPointerEXT\0" "\0" - /* _mesa_function_pool[6155]: MultiTexCoord3dARB (offset 392) */ + /* _mesa_function_pool[6142]: MultiTexCoord3dARB (offset 392) */ "iddd\0" "glMultiTexCoord3d\0" "glMultiTexCoord3dARB\0" "\0" - /* _mesa_function_pool[6200]: MultiTexCoord2iARB (offset 388) */ + /* _mesa_function_pool[6187]: MultiTexCoord2iARB (offset 388) */ "iii\0" "glMultiTexCoord2i\0" "glMultiTexCoord2iARB\0" "\0" - /* _mesa_function_pool[6244]: DrawPixels (offset 257) */ + /* _mesa_function_pool[6231]: DrawPixels (offset 257) */ "iiiip\0" "glDrawPixels\0" "\0" - /* _mesa_function_pool[6264]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[6251]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ "iffffffff\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[6324]: MultiTexCoord2svARB (offset 391) */ + /* _mesa_function_pool[6311]: MultiTexCoord2svARB (offset 391) */ "ip\0" "glMultiTexCoord2sv\0" "glMultiTexCoord2svARB\0" "\0" - /* _mesa_function_pool[6369]: ReplacementCodeubvSUN (dynamic) */ + /* _mesa_function_pool[6356]: ReplacementCodeubvSUN (dynamic) */ "p\0" "glReplacementCodeubvSUN\0" "\0" - /* _mesa_function_pool[6396]: Uniform3iARB (will be remapped) */ + /* _mesa_function_pool[6383]: Uniform3iARB (will be remapped) */ "iiii\0" "glUniform3i\0" "glUniform3iARB\0" "\0" - /* _mesa_function_pool[6429]: DrawTransformFeedback (will be remapped) */ + /* _mesa_function_pool[6416]: DrawTransformFeedback (will be remapped) */ "ii\0" "glDrawTransformFeedback\0" "\0" - /* _mesa_function_pool[6457]: DrawElementsInstancedARB (will be remapped) */ + /* _mesa_function_pool[6444]: DrawElementsInstancedARB (will be remapped) */ "iiipi\0" "glDrawElementsInstancedARB\0" "glDrawElementsInstancedEXT\0" "glDrawElementsInstanced\0" "\0" - /* _mesa_function_pool[6542]: GetShaderInfoLog (will be remapped) */ + /* _mesa_function_pool[6529]: GetShaderInfoLog (will be remapped) */ "iipp\0" "glGetShaderInfoLog\0" "\0" - /* _mesa_function_pool[6567]: WeightivARB (dynamic) */ + /* _mesa_function_pool[6554]: WeightivARB (dynamic) */ "ip\0" "glWeightivARB\0" "\0" - /* _mesa_function_pool[6585]: PollInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[6572]: PollInstrumentsSGIX (dynamic) */ "p\0" "glPollInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[6610]: GlobalAlphaFactordSUN (dynamic) */ + /* _mesa_function_pool[6597]: GlobalAlphaFactordSUN (dynamic) */ "d\0" "glGlobalAlphaFactordSUN\0" "\0" - /* _mesa_function_pool[6637]: GetFinalCombinerInputParameterfvNV (will be remapped) */ + /* _mesa_function_pool[6624]: GetFinalCombinerInputParameterfvNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterfvNV\0" "\0" - /* _mesa_function_pool[6679]: GenerateMipmapEXT (will be remapped) */ + /* _mesa_function_pool[6666]: GenerateMipmapEXT (will be remapped) */ "i\0" "glGenerateMipmap\0" "glGenerateMipmapEXT\0" "\0" - /* _mesa_function_pool[6719]: GenLists (offset 5) */ + /* _mesa_function_pool[6706]: GenLists (offset 5) */ "i\0" "glGenLists\0" "\0" - /* _mesa_function_pool[6733]: SetFragmentShaderConstantATI (will be remapped) */ - "ip\0" - "glSetFragmentShaderConstantATI\0" + /* _mesa_function_pool[6720]: DepthRangef (will be remapped) */ + "ff\0" + "glDepthRangef\0" "\0" - /* _mesa_function_pool[6768]: GetMapAttribParameterivNV (dynamic) */ + /* _mesa_function_pool[6738]: GetMapAttribParameterivNV (dynamic) */ "iiip\0" "glGetMapAttribParameterivNV\0" "\0" - /* _mesa_function_pool[6802]: CreateShaderObjectARB (will be remapped) */ + /* _mesa_function_pool[6772]: CreateShaderObjectARB (will be remapped) */ "i\0" "glCreateShaderObjectARB\0" "\0" - /* _mesa_function_pool[6829]: GetSharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[6799]: GetSharpenTexFuncSGIS (dynamic) */ "ip\0" "glGetSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[6857]: BufferDataARB (will be remapped) */ + /* _mesa_function_pool[6827]: BufferDataARB (will be remapped) */ "iipi\0" "glBufferData\0" "glBufferDataARB\0" "\0" - /* _mesa_function_pool[6892]: FlushVertexArrayRangeNV (will be remapped) */ + /* _mesa_function_pool[6862]: FlushVertexArrayRangeNV (will be remapped) */ "\0" "glFlushVertexArrayRangeNV\0" "\0" - /* _mesa_function_pool[6920]: MapGrid2d (offset 226) */ + /* _mesa_function_pool[6890]: MapGrid2d (offset 226) */ "iddidd\0" "glMapGrid2d\0" "\0" - /* _mesa_function_pool[6940]: MapGrid2f (offset 227) */ + /* _mesa_function_pool[6910]: MapGrid2f (offset 227) */ "iffiff\0" "glMapGrid2f\0" "\0" - /* _mesa_function_pool[6960]: SampleMapATI (will be remapped) */ + /* _mesa_function_pool[6930]: SampleMapATI (will be remapped) */ "iii\0" "glSampleMapATI\0" "\0" - /* _mesa_function_pool[6980]: VertexPointerEXT (will be remapped) */ + /* _mesa_function_pool[6950]: VertexPointerEXT (will be remapped) */ "iiiip\0" "glVertexPointerEXT\0" "\0" - /* _mesa_function_pool[7006]: GetTexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[6976]: GetTexFilterFuncSGIS (dynamic) */ "iip\0" "glGetTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[7034]: Scissor (offset 176) */ + /* _mesa_function_pool[7004]: Scissor (offset 176) */ "iiii\0" "glScissor\0" "\0" - /* _mesa_function_pool[7050]: Fogf (offset 153) */ + /* _mesa_function_pool[7020]: Fogf (offset 153) */ "if\0" "glFogf\0" "\0" - /* _mesa_function_pool[7061]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[7031]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[7106]: TexSubImage1D (offset 332) */ + /* _mesa_function_pool[7076]: TexSubImage1D (offset 332) */ "iiiiiip\0" "glTexSubImage1D\0" "glTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[7150]: VertexAttrib1sARB (will be remapped) */ + /* _mesa_function_pool[7120]: VertexAttrib1sARB (will be remapped) */ "ii\0" "glVertexAttrib1s\0" "glVertexAttrib1sARB\0" "\0" - /* _mesa_function_pool[7191]: FenceSync (will be remapped) */ + /* _mesa_function_pool[7161]: FenceSync (will be remapped) */ "ii\0" "glFenceSync\0" "\0" - /* _mesa_function_pool[7207]: Color4usv (offset 40) */ + /* _mesa_function_pool[7177]: Color4usv (offset 40) */ "p\0" "glColor4usv\0" "\0" - /* _mesa_function_pool[7222]: Fogi (offset 155) */ + /* _mesa_function_pool[7192]: Fogi (offset 155) */ "ii\0" "glFogi\0" "\0" - /* _mesa_function_pool[7233]: DepthRange (offset 288) */ + /* _mesa_function_pool[7203]: DepthRange (offset 288) */ "dd\0" "glDepthRange\0" "\0" - /* _mesa_function_pool[7250]: RasterPos3iv (offset 75) */ + /* _mesa_function_pool[7220]: RasterPos3iv (offset 75) */ "p\0" "glRasterPos3iv\0" "\0" - /* _mesa_function_pool[7268]: FinalCombinerInputNV (will be remapped) */ + /* _mesa_function_pool[7238]: FinalCombinerInputNV (will be remapped) */ "iiii\0" "glFinalCombinerInputNV\0" "\0" - /* _mesa_function_pool[7297]: TexCoord2i (offset 106) */ + /* _mesa_function_pool[7267]: TexCoord2i (offset 106) */ "ii\0" "glTexCoord2i\0" "\0" - /* _mesa_function_pool[7314]: PixelMapfv (offset 251) */ + /* _mesa_function_pool[7284]: PixelMapfv (offset 251) */ "iip\0" "glPixelMapfv\0" "\0" - /* _mesa_function_pool[7332]: Color4ui (offset 37) */ + /* _mesa_function_pool[7302]: Color4ui (offset 37) */ "iiii\0" "glColor4ui\0" "\0" - /* _mesa_function_pool[7349]: RasterPos3s (offset 76) */ + /* _mesa_function_pool[7319]: RasterPos3s (offset 76) */ "iii\0" "glRasterPos3s\0" "\0" - /* _mesa_function_pool[7368]: Color3usv (offset 24) */ + /* _mesa_function_pool[7338]: Color3usv (offset 24) */ "p\0" "glColor3usv\0" "\0" - /* _mesa_function_pool[7383]: FlushRasterSGIX (dynamic) */ + /* _mesa_function_pool[7353]: FlushRasterSGIX (dynamic) */ "\0" "glFlushRasterSGIX\0" "\0" - /* _mesa_function_pool[7403]: TexCoord2f (offset 104) */ + /* _mesa_function_pool[7373]: TexCoord2f (offset 104) */ "ff\0" "glTexCoord2f\0" "\0" - /* _mesa_function_pool[7420]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[7390]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ "ifffff\0" "glReplacementCodeuiTexCoord2fVertex3fSUN\0" "\0" - /* _mesa_function_pool[7469]: TexCoord2d (offset 102) */ + /* _mesa_function_pool[7439]: TexCoord2d (offset 102) */ "dd\0" "glTexCoord2d\0" "\0" - /* _mesa_function_pool[7486]: RasterPos3d (offset 70) */ + /* _mesa_function_pool[7456]: RasterPos3d (offset 70) */ "ddd\0" "glRasterPos3d\0" "\0" - /* _mesa_function_pool[7505]: RasterPos3f (offset 72) */ + /* _mesa_function_pool[7475]: RasterPos3f (offset 72) */ "fff\0" "glRasterPos3f\0" "\0" - /* _mesa_function_pool[7524]: Uniform1fARB (will be remapped) */ + /* _mesa_function_pool[7494]: Uniform1fARB (will be remapped) */ "if\0" "glUniform1f\0" "glUniform1fARB\0" "\0" - /* _mesa_function_pool[7555]: AreTexturesResident (offset 322) */ + /* _mesa_function_pool[7525]: AreTexturesResident (offset 322) */ "ipp\0" "glAreTexturesResident\0" "glAreTexturesResidentEXT\0" "\0" - /* _mesa_function_pool[7607]: TexCoord2s (offset 108) */ + /* _mesa_function_pool[7577]: TexCoord2s (offset 108) */ "ii\0" "glTexCoord2s\0" "\0" - /* _mesa_function_pool[7624]: StencilOpSeparate (will be remapped) */ + /* _mesa_function_pool[7594]: StencilOpSeparate (will be remapped) */ "iiii\0" "glStencilOpSeparate\0" "glStencilOpSeparateATI\0" "\0" - /* _mesa_function_pool[7673]: ColorTableParameteriv (offset 341) */ + /* _mesa_function_pool[7643]: ColorTableParameteriv (offset 341) */ "iip\0" "glColorTableParameteriv\0" "glColorTableParameterivSGI\0" "\0" - /* _mesa_function_pool[7729]: FogCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[7699]: FogCoordPointerListIBM (dynamic) */ "iipi\0" "glFogCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[7760]: WindowPos3dMESA (will be remapped) */ + /* _mesa_function_pool[7730]: WindowPos3dMESA (will be remapped) */ "ddd\0" "glWindowPos3d\0" "glWindowPos3dARB\0" "glWindowPos3dMESA\0" "\0" - /* _mesa_function_pool[7814]: Color4us (offset 39) */ + /* _mesa_function_pool[7784]: Color4us (offset 39) */ "iiii\0" "glColor4us\0" "\0" - /* _mesa_function_pool[7831]: PointParameterfvEXT (will be remapped) */ + /* _mesa_function_pool[7801]: PointParameterfvEXT (will be remapped) */ "ip\0" "glPointParameterfv\0" "glPointParameterfvARB\0" "glPointParameterfvEXT\0" "glPointParameterfvSGIS\0" "\0" - /* _mesa_function_pool[7921]: Color3bv (offset 10) */ + /* _mesa_function_pool[7891]: Color3bv (offset 10) */ "p\0" "glColor3bv\0" "\0" - /* _mesa_function_pool[7935]: WindowPos2fvMESA (will be remapped) */ + /* _mesa_function_pool[7905]: WindowPos2fvMESA (will be remapped) */ "p\0" "glWindowPos2fv\0" "glWindowPos2fvARB\0" "glWindowPos2fvMESA\0" "\0" - /* _mesa_function_pool[7990]: SecondaryColor3bvEXT (will be remapped) */ + /* _mesa_function_pool[7960]: SecondaryColor3bvEXT (will be remapped) */ "p\0" "glSecondaryColor3bv\0" "glSecondaryColor3bvEXT\0" "\0" - /* _mesa_function_pool[8036]: VertexPointerListIBM (dynamic) */ + /* _mesa_function_pool[8006]: VertexPointerListIBM (dynamic) */ "iiipi\0" "glVertexPointerListIBM\0" "\0" - /* _mesa_function_pool[8066]: GetProgramLocalParameterfvARB (will be remapped) */ + /* _mesa_function_pool[8036]: GetProgramLocalParameterfvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterfvARB\0" "\0" - /* _mesa_function_pool[8103]: FragmentMaterialfSGIX (dynamic) */ + /* _mesa_function_pool[8073]: FragmentMaterialfSGIX (dynamic) */ "iif\0" "glFragmentMaterialfSGIX\0" "\0" - /* _mesa_function_pool[8132]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[8102]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[8174]: RenderbufferStorageEXT (will be remapped) */ + /* _mesa_function_pool[8144]: RenderbufferStorageEXT (will be remapped) */ "iiii\0" "glRenderbufferStorage\0" "glRenderbufferStorageEXT\0" "\0" - /* _mesa_function_pool[8227]: IsFenceNV (will be remapped) */ + /* _mesa_function_pool[8197]: IsFenceNV (will be remapped) */ "i\0" "glIsFenceNV\0" "\0" - /* _mesa_function_pool[8242]: AttachObjectARB (will be remapped) */ + /* _mesa_function_pool[8212]: AttachObjectARB (will be remapped) */ "ii\0" "glAttachObjectARB\0" "\0" - /* _mesa_function_pool[8264]: GetFragmentLightivSGIX (dynamic) */ + /* _mesa_function_pool[8234]: GetFragmentLightivSGIX (dynamic) */ "iip\0" "glGetFragmentLightivSGIX\0" "\0" - /* _mesa_function_pool[8294]: UniformMatrix2fvARB (will be remapped) */ + /* _mesa_function_pool[8264]: UniformMatrix2fvARB (will be remapped) */ "iiip\0" "glUniformMatrix2fv\0" "glUniformMatrix2fvARB\0" "\0" - /* _mesa_function_pool[8341]: MultiTexCoord2fARB (offset 386) */ + /* _mesa_function_pool[8311]: MultiTexCoord2fARB (offset 386) */ "iff\0" "glMultiTexCoord2f\0" "glMultiTexCoord2fARB\0" "\0" - /* _mesa_function_pool[8385]: ColorTable (offset 339) */ + /* _mesa_function_pool[8355]: ColorTable (offset 339) */ "iiiiip\0" "glColorTable\0" "glColorTableSGI\0" "glColorTableEXT\0" "\0" - /* _mesa_function_pool[8438]: IndexPointer (offset 314) */ + /* _mesa_function_pool[8408]: IndexPointer (offset 314) */ "iip\0" "glIndexPointer\0" "\0" - /* _mesa_function_pool[8458]: Accum (offset 213) */ + /* _mesa_function_pool[8428]: Accum (offset 213) */ "if\0" "glAccum\0" "\0" - /* _mesa_function_pool[8470]: GetTexImage (offset 281) */ + /* _mesa_function_pool[8440]: GetTexImage (offset 281) */ "iiiip\0" "glGetTexImage\0" "\0" - /* _mesa_function_pool[8491]: MapControlPointsNV (dynamic) */ + /* _mesa_function_pool[8461]: MapControlPointsNV (dynamic) */ "iiiiiiiip\0" "glMapControlPointsNV\0" "\0" - /* _mesa_function_pool[8523]: ConvolutionFilter2D (offset 349) */ + /* _mesa_function_pool[8493]: ConvolutionFilter2D (offset 349) */ "iiiiiip\0" "glConvolutionFilter2D\0" "glConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[8579]: Finish (offset 216) */ + /* _mesa_function_pool[8549]: Finish (offset 216) */ "\0" "glFinish\0" "\0" - /* _mesa_function_pool[8590]: MapParameterfvNV (dynamic) */ + /* _mesa_function_pool[8560]: MapParameterfvNV (dynamic) */ "iip\0" "glMapParameterfvNV\0" "\0" - /* _mesa_function_pool[8614]: ClearStencil (offset 207) */ + /* _mesa_function_pool[8584]: ClearStencil (offset 207) */ "i\0" "glClearStencil\0" "\0" - /* _mesa_function_pool[8632]: VertexAttrib3dvARB (will be remapped) */ + /* _mesa_function_pool[8602]: VertexAttrib3dvARB (will be remapped) */ "ip\0" "glVertexAttrib3dv\0" "glVertexAttrib3dvARB\0" "\0" - /* _mesa_function_pool[8675]: Uniform4uivEXT (will be remapped) */ + /* _mesa_function_pool[8645]: Uniform4uivEXT (will be remapped) */ "iip\0" "glUniform4uivEXT\0" "glUniform4uiv\0" "\0" - /* _mesa_function_pool[8711]: HintPGI (dynamic) */ + /* _mesa_function_pool[8681]: HintPGI (dynamic) */ "ii\0" "glHintPGI\0" "\0" - /* _mesa_function_pool[8725]: ConvolutionParameteriv (offset 353) */ + /* _mesa_function_pool[8695]: ConvolutionParameteriv (offset 353) */ "iip\0" "glConvolutionParameteriv\0" "glConvolutionParameterivEXT\0" "\0" - /* _mesa_function_pool[8783]: Color4s (offset 33) */ + /* _mesa_function_pool[8753]: Color4s (offset 33) */ "iiii\0" "glColor4s\0" "\0" - /* _mesa_function_pool[8799]: InterleavedArrays (offset 317) */ + /* _mesa_function_pool[8769]: InterleavedArrays (offset 317) */ "iip\0" "glInterleavedArrays\0" "\0" - /* _mesa_function_pool[8824]: RasterPos2fv (offset 65) */ + /* _mesa_function_pool[8794]: RasterPos2fv (offset 65) */ "p\0" "glRasterPos2fv\0" "\0" - /* _mesa_function_pool[8842]: TexCoord1fv (offset 97) */ + /* _mesa_function_pool[8812]: TexCoord1fv (offset 97) */ "p\0" "glTexCoord1fv\0" "\0" - /* _mesa_function_pool[8859]: Vertex2d (offset 126) */ + /* _mesa_function_pool[8829]: Vertex2d (offset 126) */ "dd\0" "glVertex2d\0" "\0" - /* _mesa_function_pool[8874]: CullParameterdvEXT (dynamic) */ + /* _mesa_function_pool[8844]: CullParameterdvEXT (dynamic) */ "ip\0" "glCullParameterdvEXT\0" "\0" - /* _mesa_function_pool[8899]: ProgramNamedParameter4fNV (will be remapped) */ + /* _mesa_function_pool[8869]: ProgramNamedParameter4fNV (will be remapped) */ "iipffff\0" "glProgramNamedParameter4fNV\0" "\0" - /* _mesa_function_pool[8936]: Color3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[8906]: Color3fVertex3fSUN (dynamic) */ "ffffff\0" "glColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[8965]: ProgramEnvParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[8935]: ProgramEnvParameter4fvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4fvARB\0" "glProgramParameter4fvNV\0" "\0" - /* _mesa_function_pool[9022]: Color4i (offset 31) */ + /* _mesa_function_pool[8992]: Color4i (offset 31) */ "iiii\0" "glColor4i\0" "\0" - /* _mesa_function_pool[9038]: Color4f (offset 29) */ + /* _mesa_function_pool[9008]: Color4f (offset 29) */ "ffff\0" "glColor4f\0" "\0" - /* _mesa_function_pool[9054]: RasterPos4fv (offset 81) */ + /* _mesa_function_pool[9024]: RasterPos4fv (offset 81) */ "p\0" "glRasterPos4fv\0" "\0" - /* _mesa_function_pool[9072]: Color4d (offset 27) */ + /* _mesa_function_pool[9042]: Color4d (offset 27) */ "dddd\0" "glColor4d\0" "\0" - /* _mesa_function_pool[9088]: ClearIndex (offset 205) */ + /* _mesa_function_pool[9058]: ClearIndex (offset 205) */ "f\0" "glClearIndex\0" "\0" - /* _mesa_function_pool[9104]: Color4b (offset 25) */ + /* _mesa_function_pool[9074]: Color4b (offset 25) */ "iiii\0" "glColor4b\0" "\0" - /* _mesa_function_pool[9120]: LoadMatrixd (offset 292) */ + /* _mesa_function_pool[9090]: LoadMatrixd (offset 292) */ "p\0" "glLoadMatrixd\0" "\0" - /* _mesa_function_pool[9137]: FragmentLightModeliSGIX (dynamic) */ + /* _mesa_function_pool[9107]: FragmentLightModeliSGIX (dynamic) */ "ii\0" "glFragmentLightModeliSGIX\0" "\0" - /* _mesa_function_pool[9167]: RasterPos2dv (offset 63) */ + /* _mesa_function_pool[9137]: RasterPos2dv (offset 63) */ "p\0" "glRasterPos2dv\0" "\0" - /* _mesa_function_pool[9185]: ConvolutionParameterfv (offset 351) */ + /* _mesa_function_pool[9155]: ConvolutionParameterfv (offset 351) */ "iip\0" "glConvolutionParameterfv\0" "glConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[9243]: TbufferMask3DFX (dynamic) */ + /* _mesa_function_pool[9213]: TbufferMask3DFX (dynamic) */ "i\0" "glTbufferMask3DFX\0" "\0" - /* _mesa_function_pool[9264]: GetTexGendv (offset 278) */ + /* _mesa_function_pool[9234]: GetTexGendv (offset 278) */ "iip\0" "glGetTexGendv\0" "\0" - /* _mesa_function_pool[9283]: GetVertexAttribfvNV (will be remapped) */ + /* _mesa_function_pool[9253]: GetVertexAttribfvNV (will be remapped) */ "iip\0" "glGetVertexAttribfvNV\0" "\0" - /* _mesa_function_pool[9310]: BeginTransformFeedbackEXT (will be remapped) */ + /* _mesa_function_pool[9280]: BeginTransformFeedbackEXT (will be remapped) */ "i\0" "glBeginTransformFeedbackEXT\0" "glBeginTransformFeedback\0" "\0" - /* _mesa_function_pool[9366]: LoadProgramNV (will be remapped) */ + /* _mesa_function_pool[9336]: LoadProgramNV (will be remapped) */ "iiip\0" "glLoadProgramNV\0" "\0" - /* _mesa_function_pool[9388]: WaitSync (will be remapped) */ + /* _mesa_function_pool[9358]: WaitSync (will be remapped) */ "iii\0" "glWaitSync\0" "\0" - /* _mesa_function_pool[9404]: EndList (offset 1) */ + /* _mesa_function_pool[9374]: EndList (offset 1) */ "\0" "glEndList\0" "\0" - /* _mesa_function_pool[9416]: VertexAttrib4fvNV (will be remapped) */ + /* _mesa_function_pool[9386]: VertexAttrib4fvNV (will be remapped) */ "ip\0" "glVertexAttrib4fvNV\0" "\0" - /* _mesa_function_pool[9440]: GetAttachedObjectsARB (will be remapped) */ + /* _mesa_function_pool[9410]: GetAttachedObjectsARB (will be remapped) */ "iipp\0" "glGetAttachedObjectsARB\0" "\0" - /* _mesa_function_pool[9470]: Uniform3fvARB (will be remapped) */ + /* _mesa_function_pool[9440]: Uniform3fvARB (will be remapped) */ "iip\0" "glUniform3fv\0" "glUniform3fvARB\0" "\0" - /* _mesa_function_pool[9504]: EvalCoord1fv (offset 231) */ + /* _mesa_function_pool[9474]: EvalCoord1fv (offset 231) */ "p\0" "glEvalCoord1fv\0" "\0" - /* _mesa_function_pool[9522]: DrawRangeElements (offset 338) */ + /* _mesa_function_pool[9492]: DrawRangeElements (offset 338) */ "iiiiip\0" "glDrawRangeElements\0" "glDrawRangeElementsEXT\0" "\0" - /* _mesa_function_pool[9573]: EvalMesh2 (offset 238) */ + /* _mesa_function_pool[9543]: EvalMesh2 (offset 238) */ "iiiii\0" "glEvalMesh2\0" "\0" - /* _mesa_function_pool[9592]: Vertex4fv (offset 145) */ + /* _mesa_function_pool[9562]: Vertex4fv (offset 145) */ "p\0" "glVertex4fv\0" "\0" - /* _mesa_function_pool[9607]: GenTransformFeedbacks (will be remapped) */ + /* _mesa_function_pool[9577]: GenTransformFeedbacks (will be remapped) */ "ip\0" "glGenTransformFeedbacks\0" "\0" - /* _mesa_function_pool[9635]: SpriteParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[9605]: SpriteParameterfvSGIX (dynamic) */ "ip\0" "glSpriteParameterfvSGIX\0" "\0" - /* _mesa_function_pool[9663]: CheckFramebufferStatusEXT (will be remapped) */ + /* _mesa_function_pool[9633]: CheckFramebufferStatusEXT (will be remapped) */ "i\0" "glCheckFramebufferStatus\0" "glCheckFramebufferStatusEXT\0" "\0" - /* _mesa_function_pool[9719]: GlobalAlphaFactoruiSUN (dynamic) */ + /* _mesa_function_pool[9689]: GlobalAlphaFactoruiSUN (dynamic) */ "i\0" "glGlobalAlphaFactoruiSUN\0" "\0" - /* _mesa_function_pool[9747]: GetHandleARB (will be remapped) */ + /* _mesa_function_pool[9717]: GetHandleARB (will be remapped) */ "i\0" "glGetHandleARB\0" "\0" - /* _mesa_function_pool[9765]: GetVertexAttribivARB (will be remapped) */ + /* _mesa_function_pool[9735]: GetVertexAttribivARB (will be remapped) */ "iip\0" "glGetVertexAttribiv\0" "glGetVertexAttribivARB\0" "\0" - /* _mesa_function_pool[9813]: GetCombinerInputParameterfvNV (will be remapped) */ + /* _mesa_function_pool[9783]: GetCombinerInputParameterfvNV (will be remapped) */ "iiiip\0" "glGetCombinerInputParameterfvNV\0" "\0" - /* _mesa_function_pool[9852]: GetTexParameterIivEXT (will be remapped) */ + /* _mesa_function_pool[9822]: GetTexParameterIivEXT (will be remapped) */ "iip\0" "glGetTexParameterIivEXT\0" "glGetTexParameterIiv\0" "\0" - /* _mesa_function_pool[9902]: CreateProgram (will be remapped) */ + /* _mesa_function_pool[9872]: CreateProgram (will be remapped) */ "\0" "glCreateProgram\0" "\0" - /* _mesa_function_pool[9920]: LoadTransposeMatrixdARB (will be remapped) */ + /* _mesa_function_pool[9890]: LoadTransposeMatrixdARB (will be remapped) */ "p\0" "glLoadTransposeMatrixd\0" "glLoadTransposeMatrixdARB\0" "\0" - /* _mesa_function_pool[9972]: GetMinmax (offset 364) */ + /* _mesa_function_pool[9942]: ReleaseShaderCompiler (will be remapped) */ + "\0" + "glReleaseShaderCompiler\0" + "\0" + /* _mesa_function_pool[9968]: GetMinmax (offset 364) */ "iiiip\0" "glGetMinmax\0" "glGetMinmaxEXT\0" "\0" - /* _mesa_function_pool[10006]: StencilFuncSeparate (will be remapped) */ + /* _mesa_function_pool[10002]: StencilFuncSeparate (will be remapped) */ "iiii\0" "glStencilFuncSeparate\0" "\0" - /* _mesa_function_pool[10034]: SecondaryColor3sEXT (will be remapped) */ + /* _mesa_function_pool[10030]: SecondaryColor3sEXT (will be remapped) */ "iii\0" "glSecondaryColor3s\0" "glSecondaryColor3sEXT\0" "\0" - /* _mesa_function_pool[10080]: Color3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[10076]: Color3fVertex3fvSUN (dynamic) */ "pp\0" "glColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[10106]: GetInteger64i_v (will be remapped) */ + /* _mesa_function_pool[10102]: GetInteger64i_v (will be remapped) */ "iip\0" "glGetInteger64i_v\0" "\0" - /* _mesa_function_pool[10129]: Normal3fv (offset 57) */ + /* _mesa_function_pool[10125]: Normal3fv (offset 57) */ "p\0" "glNormal3fv\0" "\0" - /* _mesa_function_pool[10144]: GlobalAlphaFactorbSUN (dynamic) */ + /* _mesa_function_pool[10140]: GlobalAlphaFactorbSUN (dynamic) */ "i\0" "glGlobalAlphaFactorbSUN\0" "\0" - /* _mesa_function_pool[10171]: Color3us (offset 23) */ + /* _mesa_function_pool[10167]: Color3us (offset 23) */ "iii\0" "glColor3us\0" "\0" - /* _mesa_function_pool[10187]: ImageTransformParameterfvHP (dynamic) */ + /* _mesa_function_pool[10183]: ImageTransformParameterfvHP (dynamic) */ "iip\0" "glImageTransformParameterfvHP\0" "\0" - /* _mesa_function_pool[10222]: VertexAttrib4ivARB (will be remapped) */ + /* _mesa_function_pool[10218]: VertexAttrib4ivARB (will be remapped) */ "ip\0" "glVertexAttrib4iv\0" "glVertexAttrib4ivARB\0" "\0" - /* _mesa_function_pool[10265]: End (offset 43) */ + /* _mesa_function_pool[10261]: End (offset 43) */ "\0" "glEnd\0" "\0" - /* _mesa_function_pool[10273]: VertexAttrib3fNV (will be remapped) */ + /* _mesa_function_pool[10269]: VertexAttrib3fNV (will be remapped) */ "ifff\0" "glVertexAttrib3fNV\0" "\0" - /* _mesa_function_pool[10298]: VertexAttribs2dvNV (will be remapped) */ + /* _mesa_function_pool[10294]: VertexAttribs2dvNV (will be remapped) */ "iip\0" "glVertexAttribs2dvNV\0" "\0" - /* _mesa_function_pool[10324]: GetQueryObjectui64vEXT (will be remapped) */ + /* _mesa_function_pool[10320]: GetQueryObjectui64vEXT (will be remapped) */ "iip\0" "glGetQueryObjectui64vEXT\0" "\0" - /* _mesa_function_pool[10354]: MultiTexCoord3fvARB (offset 395) */ + /* _mesa_function_pool[10350]: MultiTexCoord3fvARB (offset 395) */ "ip\0" "glMultiTexCoord3fv\0" "glMultiTexCoord3fvARB\0" "\0" - /* _mesa_function_pool[10399]: SecondaryColor3dEXT (will be remapped) */ + /* _mesa_function_pool[10395]: SecondaryColor3dEXT (will be remapped) */ "ddd\0" "glSecondaryColor3d\0" "glSecondaryColor3dEXT\0" "\0" - /* _mesa_function_pool[10445]: Color3ub (offset 19) */ + /* _mesa_function_pool[10441]: Color3ub (offset 19) */ "iii\0" "glColor3ub\0" "\0" - /* _mesa_function_pool[10461]: GetProgramParameterfvNV (will be remapped) */ + /* _mesa_function_pool[10457]: GetProgramParameterfvNV (will be remapped) */ "iiip\0" "glGetProgramParameterfvNV\0" "\0" - /* _mesa_function_pool[10493]: TangentPointerEXT (dynamic) */ + /* _mesa_function_pool[10489]: TangentPointerEXT (dynamic) */ "iip\0" "glTangentPointerEXT\0" "\0" - /* _mesa_function_pool[10518]: Color4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[10514]: Color4fNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[10553]: GetInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[10549]: GetInstrumentsSGIX (dynamic) */ "\0" "glGetInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[10576]: GetUniformuivEXT (will be remapped) */ + /* _mesa_function_pool[10572]: GetUniformuivEXT (will be remapped) */ "iip\0" "glGetUniformuivEXT\0" "glGetUniformuiv\0" "\0" - /* _mesa_function_pool[10616]: Color3ui (offset 21) */ + /* _mesa_function_pool[10612]: Color3ui (offset 21) */ "iii\0" "glColor3ui\0" "\0" - /* _mesa_function_pool[10632]: EvalMapsNV (dynamic) */ + /* _mesa_function_pool[10628]: EvalMapsNV (dynamic) */ "ii\0" "glEvalMapsNV\0" "\0" - /* _mesa_function_pool[10649]: TexSubImage2D (offset 333) */ + /* _mesa_function_pool[10645]: TexSubImage2D (offset 333) */ "iiiiiiiip\0" "glTexSubImage2D\0" "glTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[10695]: FragmentLightivSGIX (dynamic) */ + /* _mesa_function_pool[10691]: FragmentLightivSGIX (dynamic) */ "iip\0" "glFragmentLightivSGIX\0" "\0" - /* _mesa_function_pool[10722]: GetTexParameterPointervAPPLE (will be remapped) */ + /* _mesa_function_pool[10718]: GetTexParameterPointervAPPLE (will be remapped) */ "iip\0" "glGetTexParameterPointervAPPLE\0" "\0" - /* _mesa_function_pool[10758]: TexGenfv (offset 191) */ + /* _mesa_function_pool[10754]: TexGenfv (offset 191) */ "iip\0" "glTexGenfv\0" "\0" - /* _mesa_function_pool[10774]: GetTransformFeedbackVaryingEXT (will be remapped) */ + /* _mesa_function_pool[10770]: GetTransformFeedbackVaryingEXT (will be remapped) */ "iiipppp\0" "glGetTransformFeedbackVaryingEXT\0" "glGetTransformFeedbackVarying\0" "\0" - /* _mesa_function_pool[10846]: VertexAttrib4bvARB (will be remapped) */ + /* _mesa_function_pool[10842]: VertexAttrib4bvARB (will be remapped) */ "ip\0" "glVertexAttrib4bv\0" "glVertexAttrib4bvARB\0" "\0" - /* _mesa_function_pool[10889]: AlphaFragmentOp2ATI (will be remapped) */ - "iiiiiiiii\0" - "glAlphaFragmentOp2ATI\0" + /* _mesa_function_pool[10885]: ShaderBinary (will be remapped) */ + "ipipi\0" + "glShaderBinary\0" "\0" - /* _mesa_function_pool[10922]: GetIntegerIndexedvEXT (will be remapped) */ + /* _mesa_function_pool[10907]: GetIntegerIndexedvEXT (will be remapped) */ "iip\0" "glGetIntegerIndexedvEXT\0" "glGetIntegeri_v\0" "\0" - /* _mesa_function_pool[10967]: MultiTexCoord4sARB (offset 406) */ + /* _mesa_function_pool[10952]: MultiTexCoord4sARB (offset 406) */ "iiiii\0" "glMultiTexCoord4s\0" "glMultiTexCoord4sARB\0" "\0" - /* _mesa_function_pool[11013]: GetFragmentMaterialivSGIX (dynamic) */ + /* _mesa_function_pool[10998]: GetFragmentMaterialivSGIX (dynamic) */ "iip\0" "glGetFragmentMaterialivSGIX\0" "\0" - /* _mesa_function_pool[11046]: WindowPos4dMESA (will be remapped) */ + /* _mesa_function_pool[11031]: WindowPos4dMESA (will be remapped) */ "dddd\0" "glWindowPos4dMESA\0" "\0" - /* _mesa_function_pool[11070]: WeightPointerARB (dynamic) */ + /* _mesa_function_pool[11055]: WeightPointerARB (dynamic) */ "iiip\0" "glWeightPointerARB\0" "\0" - /* _mesa_function_pool[11095]: WindowPos2dMESA (will be remapped) */ + /* _mesa_function_pool[11080]: WindowPos2dMESA (will be remapped) */ "dd\0" "glWindowPos2d\0" "glWindowPos2dARB\0" "glWindowPos2dMESA\0" "\0" - /* _mesa_function_pool[11148]: FramebufferTexture3DEXT (will be remapped) */ + /* _mesa_function_pool[11133]: FramebufferTexture3DEXT (will be remapped) */ "iiiiii\0" "glFramebufferTexture3D\0" "glFramebufferTexture3DEXT\0" "\0" - /* _mesa_function_pool[11205]: BlendEquation (offset 337) */ + /* _mesa_function_pool[11190]: BlendEquation (offset 337) */ "i\0" "glBlendEquation\0" "glBlendEquationEXT\0" "\0" - /* _mesa_function_pool[11243]: VertexAttrib3dNV (will be remapped) */ + /* _mesa_function_pool[11228]: VertexAttrib3dNV (will be remapped) */ "iddd\0" "glVertexAttrib3dNV\0" "\0" - /* _mesa_function_pool[11268]: VertexAttrib3dARB (will be remapped) */ + /* _mesa_function_pool[11253]: VertexAttrib3dARB (will be remapped) */ "iddd\0" "glVertexAttrib3d\0" "glVertexAttrib3dARB\0" "\0" - /* _mesa_function_pool[11311]: VertexAttribI4usvEXT (will be remapped) */ + /* _mesa_function_pool[11296]: VertexAttribI4usvEXT (will be remapped) */ "ip\0" "glVertexAttribI4usvEXT\0" "glVertexAttribI4usv\0" "\0" - /* _mesa_function_pool[11358]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[11343]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "ppppp\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[11422]: VertexAttrib4fARB (will be remapped) */ + /* _mesa_function_pool[11407]: VertexAttrib4fARB (will be remapped) */ "iffff\0" "glVertexAttrib4f\0" "glVertexAttrib4fARB\0" "\0" - /* _mesa_function_pool[11466]: GetError (offset 261) */ + /* _mesa_function_pool[11451]: GetError (offset 261) */ "\0" "glGetError\0" "\0" - /* _mesa_function_pool[11479]: IndexFuncEXT (dynamic) */ + /* _mesa_function_pool[11464]: IndexFuncEXT (dynamic) */ "if\0" "glIndexFuncEXT\0" "\0" - /* _mesa_function_pool[11498]: TexCoord3dv (offset 111) */ + /* _mesa_function_pool[11483]: TexCoord3dv (offset 111) */ "p\0" "glTexCoord3dv\0" "\0" - /* _mesa_function_pool[11515]: Indexdv (offset 45) */ + /* _mesa_function_pool[11500]: Indexdv (offset 45) */ "p\0" "glIndexdv\0" "\0" - /* _mesa_function_pool[11528]: FramebufferTexture2DEXT (will be remapped) */ + /* _mesa_function_pool[11513]: FramebufferTexture2DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture2D\0" "glFramebufferTexture2DEXT\0" "\0" - /* _mesa_function_pool[11584]: Normal3s (offset 60) */ + /* _mesa_function_pool[11569]: Normal3s (offset 60) */ "iii\0" "glNormal3s\0" "\0" - /* _mesa_function_pool[11600]: GetObjectParameterivAPPLE (will be remapped) */ + /* _mesa_function_pool[11585]: GetObjectParameterivAPPLE (will be remapped) */ "iiip\0" "glGetObjectParameterivAPPLE\0" "\0" - /* _mesa_function_pool[11634]: PushName (offset 201) */ + /* _mesa_function_pool[11619]: PushName (offset 201) */ "i\0" "glPushName\0" "\0" - /* _mesa_function_pool[11648]: MultiTexCoord2dvARB (offset 385) */ + /* _mesa_function_pool[11633]: MultiTexCoord2dvARB (offset 385) */ "ip\0" "glMultiTexCoord2dv\0" "glMultiTexCoord2dvARB\0" "\0" - /* _mesa_function_pool[11693]: CullParameterfvEXT (dynamic) */ + /* _mesa_function_pool[11678]: CullParameterfvEXT (dynamic) */ "ip\0" "glCullParameterfvEXT\0" "\0" - /* _mesa_function_pool[11718]: Normal3i (offset 58) */ + /* _mesa_function_pool[11703]: Normal3i (offset 58) */ "iii\0" "glNormal3i\0" "\0" - /* _mesa_function_pool[11734]: ProgramNamedParameter4fvNV (will be remapped) */ + /* _mesa_function_pool[11719]: ProgramNamedParameter4fvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4fvNV\0" "\0" - /* _mesa_function_pool[11769]: SecondaryColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[11754]: SecondaryColorPointerEXT (will be remapped) */ "iiip\0" "glSecondaryColorPointer\0" "glSecondaryColorPointerEXT\0" "\0" - /* _mesa_function_pool[11826]: VertexAttrib4fvARB (will be remapped) */ + /* _mesa_function_pool[11811]: VertexAttrib4fvARB (will be remapped) */ "ip\0" "glVertexAttrib4fv\0" "glVertexAttrib4fvARB\0" "\0" - /* _mesa_function_pool[11869]: ColorPointerListIBM (dynamic) */ + /* _mesa_function_pool[11854]: ColorPointerListIBM (dynamic) */ "iiipi\0" "glColorPointerListIBM\0" "\0" - /* _mesa_function_pool[11898]: GetActiveUniformARB (will be remapped) */ + /* _mesa_function_pool[11883]: GetActiveUniformARB (will be remapped) */ "iiipppp\0" "glGetActiveUniform\0" "glGetActiveUniformARB\0" "\0" - /* _mesa_function_pool[11948]: ImageTransformParameteriHP (dynamic) */ + /* _mesa_function_pool[11933]: ImageTransformParameteriHP (dynamic) */ "iii\0" "glImageTransformParameteriHP\0" "\0" - /* _mesa_function_pool[11982]: Normal3b (offset 52) */ + /* _mesa_function_pool[11967]: Normal3b (offset 52) */ "iii\0" "glNormal3b\0" "\0" - /* _mesa_function_pool[11998]: Normal3d (offset 54) */ + /* _mesa_function_pool[11983]: Normal3d (offset 54) */ "ddd\0" "glNormal3d\0" "\0" - /* _mesa_function_pool[12014]: Uniform1uiEXT (will be remapped) */ + /* _mesa_function_pool[11999]: Uniform1uiEXT (will be remapped) */ "ii\0" "glUniform1uiEXT\0" "glUniform1ui\0" "\0" - /* _mesa_function_pool[12047]: Normal3f (offset 56) */ + /* _mesa_function_pool[12032]: Normal3f (offset 56) */ "fff\0" "glNormal3f\0" "\0" - /* _mesa_function_pool[12063]: MultiTexCoord1svARB (offset 383) */ + /* _mesa_function_pool[12048]: MultiTexCoord1svARB (offset 383) */ "ip\0" "glMultiTexCoord1sv\0" "glMultiTexCoord1svARB\0" "\0" - /* _mesa_function_pool[12108]: Indexi (offset 48) */ + /* _mesa_function_pool[12093]: Indexi (offset 48) */ "i\0" "glIndexi\0" "\0" - /* _mesa_function_pool[12120]: EGLImageTargetTexture2DOES (will be remapped) */ + /* _mesa_function_pool[12105]: EGLImageTargetTexture2DOES (will be remapped) */ "ip\0" "glEGLImageTargetTexture2DOES\0" "\0" - /* _mesa_function_pool[12153]: EndQueryARB (will be remapped) */ + /* _mesa_function_pool[12138]: EndQueryARB (will be remapped) */ "i\0" "glEndQuery\0" "glEndQueryARB\0" "\0" - /* _mesa_function_pool[12181]: DeleteFencesNV (will be remapped) */ + /* _mesa_function_pool[12166]: DeleteFencesNV (will be remapped) */ "ip\0" "glDeleteFencesNV\0" "\0" - /* _mesa_function_pool[12202]: BindBufferRangeEXT (will be remapped) */ + /* _mesa_function_pool[12187]: DeformationMap3dSGIX (dynamic) */ + "iddiiddiiddiip\0" + "glDeformationMap3dSGIX\0" + "\0" + /* _mesa_function_pool[12226]: BindBufferRangeEXT (will be remapped) */ "iiiii\0" "glBindBufferRangeEXT\0" "glBindBufferRange\0" "\0" - /* _mesa_function_pool[12248]: DepthMask (offset 211) */ + /* _mesa_function_pool[12272]: DepthMask (offset 211) */ "i\0" "glDepthMask\0" "\0" - /* _mesa_function_pool[12263]: IsShader (will be remapped) */ + /* _mesa_function_pool[12287]: IsShader (will be remapped) */ "i\0" "glIsShader\0" "\0" - /* _mesa_function_pool[12277]: Indexf (offset 46) */ + /* _mesa_function_pool[12301]: Indexf (offset 46) */ "f\0" "glIndexf\0" "\0" - /* _mesa_function_pool[12289]: GetImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[12313]: GetImageTransformParameterivHP (dynamic) */ "iip\0" "glGetImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[12327]: Indexd (offset 44) */ + /* _mesa_function_pool[12351]: Indexd (offset 44) */ "d\0" "glIndexd\0" "\0" - /* _mesa_function_pool[12339]: GetMaterialiv (offset 270) */ + /* _mesa_function_pool[12363]: GetMaterialiv (offset 270) */ "iip\0" "glGetMaterialiv\0" "\0" - /* _mesa_function_pool[12360]: StencilOp (offset 244) */ + /* _mesa_function_pool[12384]: StencilOp (offset 244) */ "iii\0" "glStencilOp\0" "\0" - /* _mesa_function_pool[12377]: WindowPos4ivMESA (will be remapped) */ + /* _mesa_function_pool[12401]: WindowPos4ivMESA (will be remapped) */ "p\0" "glWindowPos4ivMESA\0" "\0" - /* _mesa_function_pool[12399]: FramebufferTextureLayer (dynamic) */ + /* _mesa_function_pool[12423]: FramebufferTextureLayer (dynamic) */ "iiiii\0" "glFramebufferTextureLayerARB\0" "\0" - /* _mesa_function_pool[12435]: MultiTexCoord3svARB (offset 399) */ + /* _mesa_function_pool[12459]: MultiTexCoord3svARB (offset 399) */ "ip\0" "glMultiTexCoord3sv\0" "glMultiTexCoord3svARB\0" "\0" - /* _mesa_function_pool[12480]: TexEnvfv (offset 185) */ + /* _mesa_function_pool[12504]: TexEnvfv (offset 185) */ "iip\0" "glTexEnvfv\0" "\0" - /* _mesa_function_pool[12496]: MultiTexCoord4iARB (offset 404) */ + /* _mesa_function_pool[12520]: MultiTexCoord4iARB (offset 404) */ "iiiii\0" "glMultiTexCoord4i\0" "glMultiTexCoord4iARB\0" "\0" - /* _mesa_function_pool[12542]: Indexs (offset 50) */ + /* _mesa_function_pool[12566]: Indexs (offset 50) */ "i\0" "glIndexs\0" "\0" - /* _mesa_function_pool[12554]: Binormal3ivEXT (dynamic) */ + /* _mesa_function_pool[12578]: Binormal3ivEXT (dynamic) */ "p\0" "glBinormal3ivEXT\0" "\0" - /* _mesa_function_pool[12574]: ResizeBuffersMESA (will be remapped) */ + /* _mesa_function_pool[12598]: ResizeBuffersMESA (will be remapped) */ "\0" "glResizeBuffersMESA\0" "\0" - /* _mesa_function_pool[12596]: GetUniformivARB (will be remapped) */ + /* _mesa_function_pool[12620]: GetUniformivARB (will be remapped) */ "iip\0" "glGetUniformiv\0" "glGetUniformivARB\0" "\0" - /* _mesa_function_pool[12634]: PixelTexGenParameteriSGIS (will be remapped) */ + /* _mesa_function_pool[12658]: PixelTexGenParameteriSGIS (will be remapped) */ "ii\0" "glPixelTexGenParameteriSGIS\0" "\0" - /* _mesa_function_pool[12666]: VertexPointervINTEL (dynamic) */ + /* _mesa_function_pool[12690]: VertexPointervINTEL (dynamic) */ "iip\0" "glVertexPointervINTEL\0" "\0" - /* _mesa_function_pool[12693]: Vertex2i (offset 130) */ + /* _mesa_function_pool[12717]: Vertex2i (offset 130) */ "ii\0" "glVertex2i\0" "\0" - /* _mesa_function_pool[12708]: LoadMatrixf (offset 291) */ + /* _mesa_function_pool[12732]: LoadMatrixf (offset 291) */ "p\0" "glLoadMatrixf\0" "\0" - /* _mesa_function_pool[12725]: VertexAttribI1uivEXT (will be remapped) */ + /* _mesa_function_pool[12749]: VertexAttribI1uivEXT (will be remapped) */ "ip\0" "glVertexAttribI1uivEXT\0" "glVertexAttribI1uiv\0" "\0" - /* _mesa_function_pool[12772]: Vertex2f (offset 128) */ + /* _mesa_function_pool[12796]: Vertex2f (offset 128) */ "ff\0" "glVertex2f\0" "\0" - /* _mesa_function_pool[12787]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[12811]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[12840]: Color4bv (offset 26) */ + /* _mesa_function_pool[12864]: Color4bv (offset 26) */ "p\0" "glColor4bv\0" "\0" - /* _mesa_function_pool[12854]: VertexPointer (offset 321) */ + /* _mesa_function_pool[12878]: VertexPointer (offset 321) */ "iiip\0" "glVertexPointer\0" "\0" - /* _mesa_function_pool[12876]: SecondaryColor3uiEXT (will be remapped) */ + /* _mesa_function_pool[12900]: SecondaryColor3uiEXT (will be remapped) */ "iii\0" "glSecondaryColor3ui\0" "glSecondaryColor3uiEXT\0" "\0" - /* _mesa_function_pool[12924]: StartInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[12948]: StartInstrumentsSGIX (dynamic) */ "\0" "glStartInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[12949]: SecondaryColor3usvEXT (will be remapped) */ + /* _mesa_function_pool[12973]: SecondaryColor3usvEXT (will be remapped) */ "p\0" "glSecondaryColor3usv\0" "glSecondaryColor3usvEXT\0" "\0" - /* _mesa_function_pool[12997]: VertexAttrib2fvNV (will be remapped) */ + /* _mesa_function_pool[13021]: VertexAttrib2fvNV (will be remapped) */ "ip\0" "glVertexAttrib2fvNV\0" "\0" - /* _mesa_function_pool[13021]: ProgramLocalParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[13045]: ProgramLocalParameter4dvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4dvARB\0" "\0" - /* _mesa_function_pool[13056]: DeleteLists (offset 4) */ + /* _mesa_function_pool[13080]: DeleteLists (offset 4) */ "ii\0" "glDeleteLists\0" "\0" - /* _mesa_function_pool[13074]: LogicOp (offset 242) */ + /* _mesa_function_pool[13098]: LogicOp (offset 242) */ "i\0" "glLogicOp\0" "\0" - /* _mesa_function_pool[13087]: MatrixIndexuivARB (dynamic) */ + /* _mesa_function_pool[13111]: MatrixIndexuivARB (dynamic) */ "ip\0" "glMatrixIndexuivARB\0" "\0" - /* _mesa_function_pool[13111]: Vertex2s (offset 132) */ + /* _mesa_function_pool[13135]: Vertex2s (offset 132) */ "ii\0" "glVertex2s\0" "\0" - /* _mesa_function_pool[13126]: RenderbufferStorageMultisample (will be remapped) */ + /* _mesa_function_pool[13150]: RenderbufferStorageMultisample (will be remapped) */ "iiiii\0" "glRenderbufferStorageMultisample\0" "glRenderbufferStorageMultisampleEXT\0" "\0" - /* _mesa_function_pool[13202]: TexCoord4fv (offset 121) */ + /* _mesa_function_pool[13226]: TexCoord4fv (offset 121) */ "p\0" "glTexCoord4fv\0" "\0" - /* _mesa_function_pool[13219]: Tangent3sEXT (dynamic) */ + /* _mesa_function_pool[13243]: Tangent3sEXT (dynamic) */ "iii\0" "glTangent3sEXT\0" "\0" - /* _mesa_function_pool[13239]: GlobalAlphaFactorfSUN (dynamic) */ + /* _mesa_function_pool[13263]: GlobalAlphaFactorfSUN (dynamic) */ "f\0" "glGlobalAlphaFactorfSUN\0" "\0" - /* _mesa_function_pool[13266]: MultiTexCoord3iARB (offset 396) */ + /* _mesa_function_pool[13290]: MultiTexCoord3iARB (offset 396) */ "iiii\0" "glMultiTexCoord3i\0" "glMultiTexCoord3iARB\0" "\0" - /* _mesa_function_pool[13311]: IsProgram (will be remapped) */ + /* _mesa_function_pool[13335]: IsProgram (will be remapped) */ "i\0" "glIsProgram\0" "\0" - /* _mesa_function_pool[13326]: TexCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[13350]: TexCoordPointerListIBM (dynamic) */ "iiipi\0" "glTexCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[13358]: VertexAttribI4svEXT (will be remapped) */ + /* _mesa_function_pool[13382]: VertexAttribI4svEXT (will be remapped) */ "ip\0" "glVertexAttribI4svEXT\0" "glVertexAttribI4sv\0" "\0" - /* _mesa_function_pool[13403]: GlobalAlphaFactorusSUN (dynamic) */ + /* _mesa_function_pool[13427]: GlobalAlphaFactorusSUN (dynamic) */ "i\0" "glGlobalAlphaFactorusSUN\0" "\0" - /* _mesa_function_pool[13431]: VertexAttrib2dvNV (will be remapped) */ + /* _mesa_function_pool[13455]: VertexAttrib2dvNV (will be remapped) */ "ip\0" "glVertexAttrib2dvNV\0" "\0" - /* _mesa_function_pool[13455]: FramebufferRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[13479]: FramebufferRenderbufferEXT (will be remapped) */ "iiii\0" "glFramebufferRenderbuffer\0" "glFramebufferRenderbufferEXT\0" "\0" - /* _mesa_function_pool[13516]: ClearBufferuiv (will be remapped) */ + /* _mesa_function_pool[13540]: ClearBufferuiv (will be remapped) */ "iip\0" "glClearBufferuiv\0" "\0" - /* _mesa_function_pool[13538]: VertexAttrib1dvNV (will be remapped) */ + /* _mesa_function_pool[13562]: VertexAttrib1dvNV (will be remapped) */ "ip\0" "glVertexAttrib1dvNV\0" "\0" - /* _mesa_function_pool[13562]: GenTextures (offset 328) */ + /* _mesa_function_pool[13586]: GenTextures (offset 328) */ "ip\0" "glGenTextures\0" "glGenTexturesEXT\0" "\0" - /* _mesa_function_pool[13597]: FramebufferTextureARB (will be remapped) */ + /* _mesa_function_pool[13621]: FramebufferTextureARB (will be remapped) */ "iiii\0" "glFramebufferTextureARB\0" "\0" - /* _mesa_function_pool[13627]: SetFenceNV (will be remapped) */ + /* _mesa_function_pool[13651]: SetFenceNV (will be remapped) */ "ii\0" "glSetFenceNV\0" "\0" - /* _mesa_function_pool[13644]: FramebufferTexture1DEXT (will be remapped) */ + /* _mesa_function_pool[13668]: FramebufferTexture1DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture1D\0" "glFramebufferTexture1DEXT\0" "\0" - /* _mesa_function_pool[13700]: GetCombinerOutputParameterivNV (will be remapped) */ + /* _mesa_function_pool[13724]: GetCombinerOutputParameterivNV (will be remapped) */ "iiip\0" "glGetCombinerOutputParameterivNV\0" "\0" - /* _mesa_function_pool[13739]: MultiModeDrawArraysIBM (will be remapped) */ - "pppii\0" - "glMultiModeDrawArraysIBM\0" - "\0" - /* _mesa_function_pool[13771]: PixelTexGenParameterivSGIS (will be remapped) */ + /* _mesa_function_pool[13763]: PixelTexGenParameterivSGIS (will be remapped) */ "ip\0" "glPixelTexGenParameterivSGIS\0" "\0" - /* _mesa_function_pool[13804]: TextureNormalEXT (dynamic) */ + /* _mesa_function_pool[13796]: TextureNormalEXT (dynamic) */ "i\0" "glTextureNormalEXT\0" "\0" - /* _mesa_function_pool[13826]: IndexPointerListIBM (dynamic) */ + /* _mesa_function_pool[13818]: IndexPointerListIBM (dynamic) */ "iipi\0" "glIndexPointerListIBM\0" "\0" - /* _mesa_function_pool[13854]: WeightfvARB (dynamic) */ + /* _mesa_function_pool[13846]: WeightfvARB (dynamic) */ "ip\0" "glWeightfvARB\0" "\0" - /* _mesa_function_pool[13872]: GetCombinerOutputParameterfvNV (will be remapped) */ - "iiip\0" - "glGetCombinerOutputParameterfvNV\0" - "\0" - /* _mesa_function_pool[13911]: RasterPos2sv (offset 69) */ + /* _mesa_function_pool[13864]: RasterPos2sv (offset 69) */ "p\0" "glRasterPos2sv\0" "\0" - /* _mesa_function_pool[13929]: Color4ubv (offset 36) */ + /* _mesa_function_pool[13882]: Color4ubv (offset 36) */ "p\0" "glColor4ubv\0" "\0" - /* _mesa_function_pool[13944]: DrawBuffer (offset 202) */ + /* _mesa_function_pool[13897]: DrawBuffer (offset 202) */ "i\0" "glDrawBuffer\0" "\0" - /* _mesa_function_pool[13960]: TexCoord2fv (offset 105) */ + /* _mesa_function_pool[13913]: TexCoord2fv (offset 105) */ "p\0" "glTexCoord2fv\0" "\0" - /* _mesa_function_pool[13977]: WindowPos4fMESA (will be remapped) */ + /* _mesa_function_pool[13930]: WindowPos4fMESA (will be remapped) */ "ffff\0" "glWindowPos4fMESA\0" "\0" - /* _mesa_function_pool[14001]: TexCoord1sv (offset 101) */ + /* _mesa_function_pool[13954]: TexCoord1sv (offset 101) */ "p\0" "glTexCoord1sv\0" "\0" - /* _mesa_function_pool[14018]: WindowPos3dvMESA (will be remapped) */ + /* _mesa_function_pool[13971]: WindowPos3dvMESA (will be remapped) */ "p\0" "glWindowPos3dv\0" "glWindowPos3dvARB\0" "glWindowPos3dvMESA\0" "\0" - /* _mesa_function_pool[14073]: DepthFunc (offset 245) */ + /* _mesa_function_pool[14026]: DepthFunc (offset 245) */ "i\0" "glDepthFunc\0" "\0" - /* _mesa_function_pool[14088]: PixelMapusv (offset 253) */ + /* _mesa_function_pool[14041]: PixelMapusv (offset 253) */ "iip\0" "glPixelMapusv\0" "\0" - /* _mesa_function_pool[14107]: GetQueryObjecti64vEXT (will be remapped) */ + /* _mesa_function_pool[14060]: GetQueryObjecti64vEXT (will be remapped) */ "iip\0" "glGetQueryObjecti64vEXT\0" "\0" - /* _mesa_function_pool[14136]: MultiTexCoord1dARB (offset 376) */ + /* _mesa_function_pool[14089]: MultiTexCoord1dARB (offset 376) */ "id\0" "glMultiTexCoord1d\0" "glMultiTexCoord1dARB\0" "\0" - /* _mesa_function_pool[14179]: PointParameterivNV (will be remapped) */ + /* _mesa_function_pool[14132]: PointParameterivNV (will be remapped) */ "ip\0" "glPointParameteriv\0" "glPointParameterivNV\0" "\0" - /* _mesa_function_pool[14223]: BlendFunc (offset 241) */ + /* _mesa_function_pool[14176]: BlendFunc (offset 241) */ "ii\0" "glBlendFunc\0" "\0" - /* _mesa_function_pool[14239]: EndTransformFeedbackEXT (will be remapped) */ + /* _mesa_function_pool[14192]: EndTransformFeedbackEXT (will be remapped) */ "\0" "glEndTransformFeedbackEXT\0" "glEndTransformFeedback\0" "\0" - /* _mesa_function_pool[14290]: Uniform2fvARB (will be remapped) */ + /* _mesa_function_pool[14243]: Uniform2fvARB (will be remapped) */ "iip\0" "glUniform2fv\0" "glUniform2fvARB\0" "\0" - /* _mesa_function_pool[14324]: BufferParameteriAPPLE (will be remapped) */ + /* _mesa_function_pool[14277]: BufferParameteriAPPLE (will be remapped) */ "iii\0" "glBufferParameteriAPPLE\0" "\0" - /* _mesa_function_pool[14353]: MultiTexCoord3dvARB (offset 393) */ + /* _mesa_function_pool[14306]: MultiTexCoord3dvARB (offset 393) */ "ip\0" "glMultiTexCoord3dv\0" "glMultiTexCoord3dvARB\0" "\0" - /* _mesa_function_pool[14398]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[14351]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[14454]: DeleteObjectARB (will be remapped) */ + /* _mesa_function_pool[14407]: DeleteObjectARB (will be remapped) */ "i\0" "glDeleteObjectARB\0" "\0" - /* _mesa_function_pool[14475]: MatrixIndexPointerARB (dynamic) */ + /* _mesa_function_pool[14428]: GetShaderPrecisionFormat (will be remapped) */ + "iipp\0" + "glGetShaderPrecisionFormat\0" + "\0" + /* _mesa_function_pool[14461]: MatrixIndexPointerARB (dynamic) */ "iiip\0" "glMatrixIndexPointerARB\0" "\0" - /* _mesa_function_pool[14505]: ProgramNamedParameter4dvNV (will be remapped) */ + /* _mesa_function_pool[14491]: ProgramNamedParameter4dvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4dvNV\0" "\0" - /* _mesa_function_pool[14540]: Tangent3fvEXT (dynamic) */ + /* _mesa_function_pool[14526]: Tangent3fvEXT (dynamic) */ "p\0" "glTangent3fvEXT\0" "\0" - /* _mesa_function_pool[14559]: Flush (offset 217) */ + /* _mesa_function_pool[14545]: Flush (offset 217) */ "\0" "glFlush\0" "\0" - /* _mesa_function_pool[14569]: Color4uiv (offset 38) */ + /* _mesa_function_pool[14555]: Color4uiv (offset 38) */ "p\0" "glColor4uiv\0" "\0" - /* _mesa_function_pool[14584]: VertexAttribI4iEXT (will be remapped) */ + /* _mesa_function_pool[14570]: VertexAttribI4iEXT (will be remapped) */ "iiiii\0" "glVertexAttribI4iEXT\0" "glVertexAttribI4i\0" "\0" - /* _mesa_function_pool[14630]: GenVertexArrays (will be remapped) */ + /* _mesa_function_pool[14616]: GenVertexArrays (will be remapped) */ "ip\0" "glGenVertexArrays\0" "\0" - /* _mesa_function_pool[14652]: Uniform3uivEXT (will be remapped) */ + /* _mesa_function_pool[14638]: Uniform3uivEXT (will be remapped) */ "iip\0" "glUniform3uivEXT\0" "glUniform3uiv\0" "\0" - /* _mesa_function_pool[14688]: RasterPos3sv (offset 77) */ + /* _mesa_function_pool[14674]: RasterPos3sv (offset 77) */ "p\0" "glRasterPos3sv\0" "\0" - /* _mesa_function_pool[14706]: BindFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[14692]: BindFramebufferEXT (will be remapped) */ "ii\0" "glBindFramebuffer\0" "glBindFramebufferEXT\0" "\0" - /* _mesa_function_pool[14749]: ReferencePlaneSGIX (dynamic) */ + /* _mesa_function_pool[14735]: ReferencePlaneSGIX (dynamic) */ "p\0" "glReferencePlaneSGIX\0" "\0" - /* _mesa_function_pool[14773]: PushAttrib (offset 219) */ + /* _mesa_function_pool[14759]: PushAttrib (offset 219) */ "i\0" "glPushAttrib\0" "\0" - /* _mesa_function_pool[14789]: RasterPos2i (offset 66) */ + /* _mesa_function_pool[14775]: RasterPos2i (offset 66) */ "ii\0" "glRasterPos2i\0" "\0" - /* _mesa_function_pool[14807]: ValidateProgramARB (will be remapped) */ + /* _mesa_function_pool[14793]: ValidateProgramARB (will be remapped) */ "i\0" "glValidateProgram\0" "glValidateProgramARB\0" "\0" - /* _mesa_function_pool[14849]: TexParameteriv (offset 181) */ + /* _mesa_function_pool[14835]: TexParameteriv (offset 181) */ "iip\0" "glTexParameteriv\0" "\0" - /* _mesa_function_pool[14871]: UnlockArraysEXT (will be remapped) */ + /* _mesa_function_pool[14857]: UnlockArraysEXT (will be remapped) */ "\0" "glUnlockArraysEXT\0" "\0" - /* _mesa_function_pool[14891]: TexCoord2fColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[14877]: TexCoord2fColor3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[14932]: WindowPos3fvMESA (will be remapped) */ + /* _mesa_function_pool[14918]: WindowPos3fvMESA (will be remapped) */ "p\0" "glWindowPos3fv\0" "glWindowPos3fvARB\0" "glWindowPos3fvMESA\0" "\0" - /* _mesa_function_pool[14987]: RasterPos2f (offset 64) */ + /* _mesa_function_pool[14973]: RasterPos2f (offset 64) */ "ff\0" "glRasterPos2f\0" "\0" - /* _mesa_function_pool[15005]: VertexAttrib1svNV (will be remapped) */ + /* _mesa_function_pool[14991]: VertexAttrib1svNV (will be remapped) */ "ip\0" "glVertexAttrib1svNV\0" "\0" - /* _mesa_function_pool[15029]: RasterPos2d (offset 62) */ + /* _mesa_function_pool[15015]: RasterPos2d (offset 62) */ "dd\0" "glRasterPos2d\0" "\0" - /* _mesa_function_pool[15047]: RasterPos3fv (offset 73) */ + /* _mesa_function_pool[15033]: RasterPos3fv (offset 73) */ "p\0" "glRasterPos3fv\0" "\0" - /* _mesa_function_pool[15065]: CopyTexSubImage3D (offset 373) */ + /* _mesa_function_pool[15051]: CopyTexSubImage3D (offset 373) */ "iiiiiiiii\0" "glCopyTexSubImage3D\0" "glCopyTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[15119]: VertexAttrib2dARB (will be remapped) */ + /* _mesa_function_pool[15105]: VertexAttrib2dARB (will be remapped) */ "idd\0" "glVertexAttrib2d\0" "glVertexAttrib2dARB\0" "\0" - /* _mesa_function_pool[15161]: Color4ub (offset 35) */ + /* _mesa_function_pool[15147]: Color4ub (offset 35) */ "iiii\0" "glColor4ub\0" "\0" - /* _mesa_function_pool[15178]: GetInteger64v (will be remapped) */ + /* _mesa_function_pool[15164]: GetInteger64v (will be remapped) */ "ip\0" "glGetInteger64v\0" "\0" - /* _mesa_function_pool[15198]: TextureColorMaskSGIS (dynamic) */ + /* _mesa_function_pool[15184]: TextureColorMaskSGIS (dynamic) */ "iiii\0" "glTextureColorMaskSGIS\0" "\0" - /* _mesa_function_pool[15227]: RasterPos2s (offset 68) */ + /* _mesa_function_pool[15213]: RasterPos2s (offset 68) */ "ii\0" "glRasterPos2s\0" "\0" - /* _mesa_function_pool[15245]: GetColorTable (offset 343) */ + /* _mesa_function_pool[15231]: GetColorTable (offset 343) */ "iiip\0" "glGetColorTable\0" "glGetColorTableSGI\0" "glGetColorTableEXT\0" "\0" - /* _mesa_function_pool[15305]: SelectBuffer (offset 195) */ + /* _mesa_function_pool[15291]: SelectBuffer (offset 195) */ "ip\0" "glSelectBuffer\0" "\0" - /* _mesa_function_pool[15324]: Indexiv (offset 49) */ + /* _mesa_function_pool[15310]: Indexiv (offset 49) */ "p\0" "glIndexiv\0" "\0" - /* _mesa_function_pool[15337]: TexCoord3i (offset 114) */ + /* _mesa_function_pool[15323]: TexCoord3i (offset 114) */ "iii\0" "glTexCoord3i\0" "\0" - /* _mesa_function_pool[15355]: CopyColorTable (offset 342) */ + /* _mesa_function_pool[15341]: CopyColorTable (offset 342) */ "iiiii\0" "glCopyColorTable\0" "glCopyColorTableSGI\0" "\0" - /* _mesa_function_pool[15399]: GetHistogramParameterfv (offset 362) */ + /* _mesa_function_pool[15385]: GetHistogramParameterfv (offset 362) */ "iip\0" "glGetHistogramParameterfv\0" "glGetHistogramParameterfvEXT\0" "\0" - /* _mesa_function_pool[15459]: Frustum (offset 289) */ + /* _mesa_function_pool[15445]: Frustum (offset 289) */ "dddddd\0" "glFrustum\0" "\0" - /* _mesa_function_pool[15477]: GetString (offset 275) */ + /* _mesa_function_pool[15463]: GetString (offset 275) */ "i\0" "glGetString\0" "\0" - /* _mesa_function_pool[15492]: ColorPointervINTEL (dynamic) */ + /* _mesa_function_pool[15478]: ColorPointervINTEL (dynamic) */ "iip\0" "glColorPointervINTEL\0" "\0" - /* _mesa_function_pool[15518]: TexEnvf (offset 184) */ + /* _mesa_function_pool[15504]: TexEnvf (offset 184) */ "iif\0" "glTexEnvf\0" "\0" - /* _mesa_function_pool[15533]: TexCoord3d (offset 110) */ + /* _mesa_function_pool[15519]: TexCoord3d (offset 110) */ "ddd\0" "glTexCoord3d\0" "\0" - /* _mesa_function_pool[15551]: AlphaFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[15537]: AlphaFragmentOp1ATI (will be remapped) */ "iiiiii\0" "glAlphaFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[15581]: TexCoord3f (offset 112) */ + /* _mesa_function_pool[15567]: TexCoord3f (offset 112) */ "fff\0" "glTexCoord3f\0" "\0" - /* _mesa_function_pool[15599]: MultiTexCoord3ivARB (offset 397) */ + /* _mesa_function_pool[15585]: MultiTexCoord3ivARB (offset 397) */ "ip\0" "glMultiTexCoord3iv\0" "glMultiTexCoord3ivARB\0" "\0" - /* _mesa_function_pool[15644]: MultiTexCoord2sARB (offset 390) */ + /* _mesa_function_pool[15630]: MultiTexCoord2sARB (offset 390) */ "iii\0" "glMultiTexCoord2s\0" "glMultiTexCoord2sARB\0" "\0" - /* _mesa_function_pool[15688]: VertexAttrib1dvARB (will be remapped) */ + /* _mesa_function_pool[15674]: VertexAttrib1dvARB (will be remapped) */ "ip\0" "glVertexAttrib1dv\0" "glVertexAttrib1dvARB\0" "\0" - /* _mesa_function_pool[15731]: DeleteTextures (offset 327) */ + /* _mesa_function_pool[15717]: DeleteTextures (offset 327) */ "ip\0" "glDeleteTextures\0" "glDeleteTexturesEXT\0" "\0" - /* _mesa_function_pool[15772]: TexCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[15758]: TexCoordPointerEXT (will be remapped) */ "iiiip\0" "glTexCoordPointerEXT\0" "\0" - /* _mesa_function_pool[15800]: TexSubImage4DSGIS (dynamic) */ + /* _mesa_function_pool[15786]: TexSubImage4DSGIS (dynamic) */ "iiiiiiiiiiiip\0" "glTexSubImage4DSGIS\0" "\0" - /* _mesa_function_pool[15835]: TexCoord3s (offset 116) */ + /* _mesa_function_pool[15821]: TexCoord3s (offset 116) */ "iii\0" "glTexCoord3s\0" "\0" - /* _mesa_function_pool[15853]: GetTexLevelParameteriv (offset 285) */ + /* _mesa_function_pool[15839]: GetTexLevelParameteriv (offset 285) */ "iiip\0" "glGetTexLevelParameteriv\0" "\0" - /* _mesa_function_pool[15884]: CombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[15870]: CombinerStageParameterfvNV (dynamic) */ "iip\0" "glCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[15918]: StopInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[15904]: StopInstrumentsSGIX (dynamic) */ "i\0" "glStopInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[15943]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[15929]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ "fffffffffffffff\0" "glTexCoord4fColor4fNormal3fVertex4fSUN\0" "\0" - /* _mesa_function_pool[15999]: ClearAccum (offset 204) */ + /* _mesa_function_pool[15985]: ClearAccum (offset 204) */ "ffff\0" "glClearAccum\0" "\0" - /* _mesa_function_pool[16018]: DeformSGIX (dynamic) */ + /* _mesa_function_pool[16004]: DeformSGIX (dynamic) */ "i\0" "glDeformSGIX\0" "\0" - /* _mesa_function_pool[16034]: GetVertexAttribfvARB (will be remapped) */ + /* _mesa_function_pool[16020]: GetVertexAttribfvARB (will be remapped) */ "iip\0" "glGetVertexAttribfv\0" "glGetVertexAttribfvARB\0" "\0" - /* _mesa_function_pool[16082]: SecondaryColor3ivEXT (will be remapped) */ + /* _mesa_function_pool[16068]: SecondaryColor3ivEXT (will be remapped) */ "p\0" "glSecondaryColor3iv\0" "glSecondaryColor3ivEXT\0" "\0" - /* _mesa_function_pool[16128]: TexCoord4iv (offset 123) */ + /* _mesa_function_pool[16114]: TexCoord4iv (offset 123) */ "p\0" "glTexCoord4iv\0" "\0" - /* _mesa_function_pool[16145]: VertexAttribI4uiEXT (will be remapped) */ + /* _mesa_function_pool[16131]: VertexAttribI4uiEXT (will be remapped) */ "iiiii\0" "glVertexAttribI4uiEXT\0" "glVertexAttribI4ui\0" "\0" - /* _mesa_function_pool[16193]: GetFragmentMaterialfvSGIX (dynamic) */ + /* _mesa_function_pool[16179]: GetFragmentMaterialfvSGIX (dynamic) */ "iip\0" "glGetFragmentMaterialfvSGIX\0" "\0" - /* _mesa_function_pool[16226]: UniformMatrix4x2fv (will be remapped) */ + /* _mesa_function_pool[16212]: UniformMatrix4x2fv (will be remapped) */ "iiip\0" "glUniformMatrix4x2fv\0" "\0" - /* _mesa_function_pool[16253]: GetDetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[16239]: GetDetailTexFuncSGIS (dynamic) */ "ip\0" "glGetDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[16280]: GetCombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[16266]: GetCombinerStageParameterfvNV (dynamic) */ "iip\0" "glGetCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[16317]: PolygonOffset (offset 319) */ + /* _mesa_function_pool[16303]: PolygonOffset (offset 319) */ "ff\0" "glPolygonOffset\0" "\0" - /* _mesa_function_pool[16337]: BindVertexArray (will be remapped) */ + /* _mesa_function_pool[16323]: BindVertexArray (will be remapped) */ "i\0" "glBindVertexArray\0" "\0" - /* _mesa_function_pool[16358]: Color4ubVertex2fvSUN (dynamic) */ + /* _mesa_function_pool[16344]: Color4ubVertex2fvSUN (dynamic) */ "pp\0" "glColor4ubVertex2fvSUN\0" "\0" - /* _mesa_function_pool[16385]: Rectd (offset 86) */ + /* _mesa_function_pool[16371]: Rectd (offset 86) */ "dddd\0" "glRectd\0" "\0" - /* _mesa_function_pool[16399]: TexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[16385]: TexFilterFuncSGIS (dynamic) */ "iiip\0" "glTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[16425]: SampleMaskSGIS (will be remapped) */ + /* _mesa_function_pool[16411]: SampleMaskSGIS (will be remapped) */ "fi\0" "glSampleMaskSGIS\0" "glSampleMaskEXT\0" "\0" - /* _mesa_function_pool[16462]: VertexAttribI4ubvEXT (will be remapped) */ + /* _mesa_function_pool[16448]: VertexAttribI4ubvEXT (will be remapped) */ "ip\0" "glVertexAttribI4ubvEXT\0" "glVertexAttribI4ubv\0" "\0" - /* _mesa_function_pool[16509]: GetAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[16495]: GetAttribLocationARB (will be remapped) */ "ip\0" "glGetAttribLocation\0" "glGetAttribLocationARB\0" "\0" - /* _mesa_function_pool[16556]: RasterPos3i (offset 74) */ + /* _mesa_function_pool[16542]: RasterPos3i (offset 74) */ "iii\0" "glRasterPos3i\0" "\0" - /* _mesa_function_pool[16575]: VertexAttrib4ubvARB (will be remapped) */ + /* _mesa_function_pool[16561]: VertexAttrib4ubvARB (will be remapped) */ "ip\0" "glVertexAttrib4ubv\0" "glVertexAttrib4ubvARB\0" "\0" - /* _mesa_function_pool[16620]: DetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[16606]: DetailTexFuncSGIS (dynamic) */ "iip\0" "glDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[16645]: Normal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[16631]: Normal3fVertex3fSUN (dynamic) */ "ffffff\0" "glNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[16675]: CopyTexImage2D (offset 324) */ + /* _mesa_function_pool[16661]: CopyTexImage2D (offset 324) */ "iiiiiiii\0" "glCopyTexImage2D\0" "glCopyTexImage2DEXT\0" "\0" - /* _mesa_function_pool[16722]: GetBufferPointervARB (will be remapped) */ + /* _mesa_function_pool[16708]: GetBufferPointervARB (will be remapped) */ "iip\0" "glGetBufferPointerv\0" "glGetBufferPointervARB\0" "\0" - /* _mesa_function_pool[16770]: ProgramEnvParameter4fARB (will be remapped) */ + /* _mesa_function_pool[16756]: ProgramEnvParameter4fARB (will be remapped) */ "iiffff\0" "glProgramEnvParameter4fARB\0" "glProgramParameter4fNV\0" "\0" - /* _mesa_function_pool[16828]: Uniform3ivARB (will be remapped) */ + /* _mesa_function_pool[16814]: Uniform3ivARB (will be remapped) */ "iip\0" "glUniform3iv\0" "glUniform3ivARB\0" "\0" - /* _mesa_function_pool[16862]: Lightfv (offset 160) */ + /* _mesa_function_pool[16848]: Lightfv (offset 160) */ "iip\0" "glLightfv\0" "\0" - /* _mesa_function_pool[16877]: PrimitiveRestartIndexNV (will be remapped) */ + /* _mesa_function_pool[16863]: PrimitiveRestartIndexNV (will be remapped) */ "i\0" "glPrimitiveRestartIndexNV\0" "glPrimitiveRestartIndex\0" "\0" - /* _mesa_function_pool[16930]: ClearDepth (offset 208) */ + /* _mesa_function_pool[16916]: ClearDepth (offset 208) */ "d\0" "glClearDepth\0" "\0" - /* _mesa_function_pool[16946]: GetFenceivNV (will be remapped) */ + /* _mesa_function_pool[16932]: GetFenceivNV (will be remapped) */ "iip\0" "glGetFenceivNV\0" "\0" - /* _mesa_function_pool[16966]: WindowPos4dvMESA (will be remapped) */ + /* _mesa_function_pool[16952]: WindowPos4dvMESA (will be remapped) */ "p\0" "glWindowPos4dvMESA\0" "\0" - /* _mesa_function_pool[16988]: ColorSubTable (offset 346) */ + /* _mesa_function_pool[16974]: ColorSubTable (offset 346) */ "iiiiip\0" "glColorSubTable\0" "glColorSubTableEXT\0" "\0" - /* _mesa_function_pool[17031]: Color4fv (offset 30) */ + /* _mesa_function_pool[17017]: Color4fv (offset 30) */ "p\0" "glColor4fv\0" "\0" - /* _mesa_function_pool[17045]: MultiTexCoord4ivARB (offset 405) */ + /* _mesa_function_pool[17031]: MultiTexCoord4ivARB (offset 405) */ "ip\0" "glMultiTexCoord4iv\0" "glMultiTexCoord4ivARB\0" "\0" - /* _mesa_function_pool[17090]: ProgramLocalParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[17076]: ProgramLocalParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramLocalParameters4fvEXT\0" "\0" - /* _mesa_function_pool[17127]: ColorPointer (offset 308) */ + /* _mesa_function_pool[17113]: ColorPointer (offset 308) */ "iiip\0" "glColorPointer\0" "\0" - /* _mesa_function_pool[17148]: Rects (offset 92) */ + /* _mesa_function_pool[17134]: Rects (offset 92) */ "iiii\0" "glRects\0" "\0" - /* _mesa_function_pool[17162]: GetMapAttribParameterfvNV (dynamic) */ + /* _mesa_function_pool[17148]: GetMapAttribParameterfvNV (dynamic) */ "iiip\0" "glGetMapAttribParameterfvNV\0" "\0" - /* _mesa_function_pool[17196]: CreateShaderProgramEXT (will be remapped) */ + /* _mesa_function_pool[17182]: CreateShaderProgramEXT (will be remapped) */ "ip\0" "glCreateShaderProgramEXT\0" "\0" - /* _mesa_function_pool[17225]: ActiveProgramEXT (will be remapped) */ + /* _mesa_function_pool[17211]: ActiveProgramEXT (will be remapped) */ "i\0" "glActiveProgramEXT\0" "\0" - /* _mesa_function_pool[17247]: Lightiv (offset 162) */ + /* _mesa_function_pool[17233]: Lightiv (offset 162) */ "iip\0" "glLightiv\0" "\0" - /* _mesa_function_pool[17262]: VertexAttrib4sARB (will be remapped) */ + /* _mesa_function_pool[17248]: VertexAttrib4sARB (will be remapped) */ "iiiii\0" "glVertexAttrib4s\0" "glVertexAttrib4sARB\0" "\0" - /* _mesa_function_pool[17306]: GetQueryObjectuivARB (will be remapped) */ + /* _mesa_function_pool[17292]: GetQueryObjectuivARB (will be remapped) */ "iip\0" "glGetQueryObjectuiv\0" "glGetQueryObjectuivARB\0" "\0" - /* _mesa_function_pool[17354]: GetTexParameteriv (offset 283) */ + /* _mesa_function_pool[17340]: GetTexParameteriv (offset 283) */ "iip\0" "glGetTexParameteriv\0" "\0" - /* _mesa_function_pool[17379]: MapParameterivNV (dynamic) */ + /* _mesa_function_pool[17365]: MapParameterivNV (dynamic) */ "iip\0" "glMapParameterivNV\0" "\0" - /* _mesa_function_pool[17403]: GenRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[17389]: GenRenderbuffersEXT (will be remapped) */ "ip\0" "glGenRenderbuffers\0" "glGenRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[17448]: ClearBufferfv (will be remapped) */ + /* _mesa_function_pool[17434]: ClearBufferfv (will be remapped) */ "iip\0" "glClearBufferfv\0" "\0" - /* _mesa_function_pool[17469]: VertexAttrib2dvARB (will be remapped) */ + /* _mesa_function_pool[17455]: VertexAttrib2dvARB (will be remapped) */ "ip\0" "glVertexAttrib2dv\0" "glVertexAttrib2dvARB\0" "\0" - /* _mesa_function_pool[17512]: EdgeFlagPointerEXT (will be remapped) */ + /* _mesa_function_pool[17498]: EdgeFlagPointerEXT (will be remapped) */ "iip\0" "glEdgeFlagPointerEXT\0" "\0" - /* _mesa_function_pool[17538]: VertexAttribs2svNV (will be remapped) */ + /* _mesa_function_pool[17524]: VertexAttribs2svNV (will be remapped) */ "iip\0" "glVertexAttribs2svNV\0" "\0" - /* _mesa_function_pool[17564]: WeightbvARB (dynamic) */ + /* _mesa_function_pool[17550]: WeightbvARB (dynamic) */ "ip\0" "glWeightbvARB\0" "\0" - /* _mesa_function_pool[17582]: VertexAttrib2fvARB (will be remapped) */ + /* _mesa_function_pool[17568]: VertexAttrib2fvARB (will be remapped) */ "ip\0" "glVertexAttrib2fv\0" "glVertexAttrib2fvARB\0" "\0" - /* _mesa_function_pool[17625]: GetBufferParameterivARB (will be remapped) */ + /* _mesa_function_pool[17611]: GetBufferParameterivARB (will be remapped) */ "iip\0" "glGetBufferParameteriv\0" "glGetBufferParameterivARB\0" "\0" - /* _mesa_function_pool[17679]: Rectdv (offset 87) */ + /* _mesa_function_pool[17665]: Rectdv (offset 87) */ "pp\0" "glRectdv\0" "\0" - /* _mesa_function_pool[17692]: ListParameteriSGIX (dynamic) */ + /* _mesa_function_pool[17678]: ListParameteriSGIX (dynamic) */ "iii\0" "glListParameteriSGIX\0" "\0" - /* _mesa_function_pool[17718]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[17704]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffff\0" "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[17777]: InstrumentsBufferSGIX (dynamic) */ + /* _mesa_function_pool[17763]: InstrumentsBufferSGIX (dynamic) */ "ip\0" "glInstrumentsBufferSGIX\0" "\0" - /* _mesa_function_pool[17805]: VertexAttrib4NivARB (will be remapped) */ + /* _mesa_function_pool[17791]: VertexAttrib4NivARB (will be remapped) */ "ip\0" "glVertexAttrib4Niv\0" "glVertexAttrib4NivARB\0" "\0" - /* _mesa_function_pool[17850]: DrawArraysInstancedARB (will be remapped) */ + /* _mesa_function_pool[17836]: DrawArraysInstancedARB (will be remapped) */ "iiii\0" "glDrawArraysInstancedARB\0" "glDrawArraysInstancedEXT\0" "glDrawArraysInstanced\0" "\0" - /* _mesa_function_pool[17928]: GetAttachedShaders (will be remapped) */ + /* _mesa_function_pool[17914]: GetAttachedShaders (will be remapped) */ "iipp\0" "glGetAttachedShaders\0" "\0" - /* _mesa_function_pool[17955]: GenVertexArraysAPPLE (will be remapped) */ + /* _mesa_function_pool[17941]: GenVertexArraysAPPLE (will be remapped) */ "ip\0" "glGenVertexArraysAPPLE\0" "\0" - /* _mesa_function_pool[17982]: ClearBufferfi (will be remapped) */ + /* _mesa_function_pool[17968]: ClearBufferfi (will be remapped) */ "iifi\0" "glClearBufferfi\0" "\0" - /* _mesa_function_pool[18004]: Materialiv (offset 172) */ + /* _mesa_function_pool[17990]: Materialiv (offset 172) */ "iip\0" "glMaterialiv\0" "\0" - /* _mesa_function_pool[18022]: PushClientAttrib (offset 335) */ + /* _mesa_function_pool[18008]: PushClientAttrib (offset 335) */ "i\0" "glPushClientAttrib\0" "\0" - /* _mesa_function_pool[18044]: ProgramEnvParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[18030]: ProgramEnvParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramEnvParameters4fvEXT\0" "\0" - /* _mesa_function_pool[18079]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[18065]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[18125]: WindowPos2iMESA (will be remapped) */ + /* _mesa_function_pool[18111]: WindowPos2iMESA (will be remapped) */ "ii\0" "glWindowPos2i\0" "glWindowPos2iARB\0" "glWindowPos2iMESA\0" "\0" - /* _mesa_function_pool[18178]: SecondaryColor3fvEXT (will be remapped) */ + /* _mesa_function_pool[18164]: SecondaryColor3fvEXT (will be remapped) */ "p\0" "glSecondaryColor3fv\0" "glSecondaryColor3fvEXT\0" "\0" - /* _mesa_function_pool[18224]: PolygonMode (offset 174) */ + /* _mesa_function_pool[18210]: PolygonMode (offset 174) */ "ii\0" "glPolygonMode\0" "\0" - /* _mesa_function_pool[18242]: CompressedTexSubImage1DARB (will be remapped) */ + /* _mesa_function_pool[18228]: CompressedTexSubImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexSubImage1D\0" "glCompressedTexSubImage1DARB\0" "\0" - /* _mesa_function_pool[18306]: VertexAttribI1iEXT (will be remapped) */ + /* _mesa_function_pool[18292]: VertexAttribI1iEXT (will be remapped) */ "ii\0" "glVertexAttribI1iEXT\0" "glVertexAttribI1i\0" "\0" - /* _mesa_function_pool[18349]: GetVertexAttribivNV (will be remapped) */ + /* _mesa_function_pool[18335]: GetVertexAttribivNV (will be remapped) */ "iip\0" "glGetVertexAttribivNV\0" "\0" - /* _mesa_function_pool[18376]: GetProgramStringARB (will be remapped) */ + /* _mesa_function_pool[18362]: GetProgramStringARB (will be remapped) */ "iip\0" "glGetProgramStringARB\0" "\0" - /* _mesa_function_pool[18403]: VertexAttribIPointerEXT (will be remapped) */ + /* _mesa_function_pool[18389]: VertexAttribIPointerEXT (will be remapped) */ "iiiip\0" "glVertexAttribIPointerEXT\0" "glVertexAttribIPointer\0" "\0" - /* _mesa_function_pool[18459]: TexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[18445]: TexBumpParameterfvATI (will be remapped) */ "ip\0" "glTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[18487]: CompileShaderARB (will be remapped) */ + /* _mesa_function_pool[18473]: CompileShaderARB (will be remapped) */ "i\0" "glCompileShader\0" "glCompileShaderARB\0" "\0" - /* _mesa_function_pool[18525]: DeleteShader (will be remapped) */ + /* _mesa_function_pool[18511]: DeleteShader (will be remapped) */ "i\0" "glDeleteShader\0" "\0" - /* _mesa_function_pool[18543]: DisableClientState (offset 309) */ + /* _mesa_function_pool[18529]: DisableClientState (offset 309) */ "i\0" "glDisableClientState\0" "\0" - /* _mesa_function_pool[18567]: TexGeni (offset 192) */ + /* _mesa_function_pool[18553]: TexGeni (offset 192) */ "iii\0" "glTexGeni\0" "\0" - /* _mesa_function_pool[18582]: TexGenf (offset 190) */ + /* _mesa_function_pool[18568]: TexGenf (offset 190) */ "iif\0" "glTexGenf\0" "\0" - /* _mesa_function_pool[18597]: Uniform3fARB (will be remapped) */ + /* _mesa_function_pool[18583]: Uniform3fARB (will be remapped) */ "ifff\0" "glUniform3f\0" "glUniform3fARB\0" "\0" - /* _mesa_function_pool[18630]: TexGend (offset 188) */ + /* _mesa_function_pool[18616]: TexGend (offset 188) */ "iid\0" "glTexGend\0" "\0" - /* _mesa_function_pool[18645]: ListParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[18631]: ListParameterfvSGIX (dynamic) */ "iip\0" "glListParameterfvSGIX\0" "\0" - /* _mesa_function_pool[18672]: GetPolygonStipple (offset 274) */ + /* _mesa_function_pool[18658]: GetPolygonStipple (offset 274) */ "p\0" "glGetPolygonStipple\0" "\0" - /* _mesa_function_pool[18695]: Tangent3dvEXT (dynamic) */ + /* _mesa_function_pool[18681]: Tangent3dvEXT (dynamic) */ "p\0" "glTangent3dvEXT\0" "\0" - /* _mesa_function_pool[18714]: BindBufferOffsetEXT (will be remapped) */ + /* _mesa_function_pool[18700]: BindBufferOffsetEXT (will be remapped) */ "iiii\0" "glBindBufferOffsetEXT\0" "\0" - /* _mesa_function_pool[18742]: WindowPos3sMESA (will be remapped) */ + /* _mesa_function_pool[18728]: WindowPos3sMESA (will be remapped) */ "iii\0" "glWindowPos3s\0" "glWindowPos3sARB\0" "glWindowPos3sMESA\0" "\0" - /* _mesa_function_pool[18796]: VertexAttrib2svNV (will be remapped) */ + /* _mesa_function_pool[18782]: VertexAttrib2svNV (will be remapped) */ "ip\0" "glVertexAttrib2svNV\0" "\0" - /* _mesa_function_pool[18820]: DisableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[18806]: DisableIndexedEXT (will be remapped) */ "ii\0" "glDisableIndexedEXT\0" "glDisablei\0" "\0" - /* _mesa_function_pool[18855]: BindBufferBaseEXT (will be remapped) */ + /* _mesa_function_pool[18841]: BindBufferBaseEXT (will be remapped) */ "iii\0" "glBindBufferBaseEXT\0" "glBindBufferBase\0" "\0" - /* _mesa_function_pool[18897]: TexCoord2fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[18883]: TexCoord2fVertex3fvSUN (dynamic) */ "pp\0" "glTexCoord2fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[18926]: WindowPos4sMESA (will be remapped) */ + /* _mesa_function_pool[18912]: WindowPos4sMESA (will be remapped) */ "iiii\0" "glWindowPos4sMESA\0" "\0" - /* _mesa_function_pool[18950]: VertexAttrib4NuivARB (will be remapped) */ + /* _mesa_function_pool[18936]: VertexAttrib4NuivARB (will be remapped) */ "ip\0" "glVertexAttrib4Nuiv\0" "glVertexAttrib4NuivARB\0" "\0" - /* _mesa_function_pool[18997]: ClientActiveTextureARB (offset 375) */ + /* _mesa_function_pool[18983]: ClientActiveTextureARB (offset 375) */ "i\0" "glClientActiveTexture\0" "glClientActiveTextureARB\0" "\0" - /* _mesa_function_pool[19047]: PixelTexGenSGIX (will be remapped) */ + /* _mesa_function_pool[19033]: PixelTexGenSGIX (will be remapped) */ "i\0" "glPixelTexGenSGIX\0" "\0" - /* _mesa_function_pool[19068]: ReplacementCodeusvSUN (dynamic) */ + /* _mesa_function_pool[19054]: ReplacementCodeusvSUN (dynamic) */ "p\0" "glReplacementCodeusvSUN\0" "\0" - /* _mesa_function_pool[19095]: Uniform4fARB (will be remapped) */ + /* _mesa_function_pool[19081]: Uniform4fARB (will be remapped) */ "iffff\0" "glUniform4f\0" "glUniform4fARB\0" "\0" - /* _mesa_function_pool[19129]: Color4sv (offset 34) */ + /* _mesa_function_pool[19115]: Color4sv (offset 34) */ "p\0" "glColor4sv\0" "\0" - /* _mesa_function_pool[19143]: FlushMappedBufferRange (will be remapped) */ + /* _mesa_function_pool[19129]: FlushMappedBufferRange (will be remapped) */ "iii\0" "glFlushMappedBufferRange\0" "\0" - /* _mesa_function_pool[19173]: IsProgramNV (will be remapped) */ + /* _mesa_function_pool[19159]: IsProgramNV (will be remapped) */ "i\0" "glIsProgramARB\0" "glIsProgramNV\0" "\0" - /* _mesa_function_pool[19205]: FlushMappedBufferRangeAPPLE (will be remapped) */ + /* _mesa_function_pool[19191]: FlushMappedBufferRangeAPPLE (will be remapped) */ "iii\0" "glFlushMappedBufferRangeAPPLE\0" "\0" - /* _mesa_function_pool[19240]: PixelZoom (offset 246) */ + /* _mesa_function_pool[19226]: PixelZoom (offset 246) */ "ff\0" "glPixelZoom\0" "\0" - /* _mesa_function_pool[19256]: ReplacementCodePointerSUN (dynamic) */ + /* _mesa_function_pool[19242]: ReplacementCodePointerSUN (dynamic) */ "iip\0" "glReplacementCodePointerSUN\0" "\0" - /* _mesa_function_pool[19289]: ProgramEnvParameter4dARB (will be remapped) */ + /* _mesa_function_pool[19275]: ProgramEnvParameter4dARB (will be remapped) */ "iidddd\0" "glProgramEnvParameter4dARB\0" "glProgramParameter4dNV\0" "\0" - /* _mesa_function_pool[19347]: ColorTableParameterfv (offset 340) */ + /* _mesa_function_pool[19333]: ColorTableParameterfv (offset 340) */ "iip\0" "glColorTableParameterfv\0" "glColorTableParameterfvSGI\0" "\0" - /* _mesa_function_pool[19403]: FragmentLightModelfSGIX (dynamic) */ + /* _mesa_function_pool[19389]: FragmentLightModelfSGIX (dynamic) */ "if\0" "glFragmentLightModelfSGIX\0" "\0" - /* _mesa_function_pool[19433]: Binormal3bvEXT (dynamic) */ + /* _mesa_function_pool[19419]: Binormal3bvEXT (dynamic) */ "p\0" "glBinormal3bvEXT\0" "\0" - /* _mesa_function_pool[19453]: PixelMapuiv (offset 252) */ + /* _mesa_function_pool[19439]: PixelMapuiv (offset 252) */ "iip\0" "glPixelMapuiv\0" "\0" - /* _mesa_function_pool[19472]: Color3dv (offset 12) */ + /* _mesa_function_pool[19458]: Color3dv (offset 12) */ "p\0" "glColor3dv\0" "\0" - /* _mesa_function_pool[19486]: IsTexture (offset 330) */ + /* _mesa_function_pool[19472]: IsTexture (offset 330) */ "i\0" "glIsTexture\0" "glIsTextureEXT\0" "\0" - /* _mesa_function_pool[19516]: VertexWeightfvEXT (dynamic) */ + /* _mesa_function_pool[19502]: VertexWeightfvEXT (dynamic) */ "p\0" "glVertexWeightfvEXT\0" "\0" - /* _mesa_function_pool[19539]: VertexAttrib1dARB (will be remapped) */ + /* _mesa_function_pool[19525]: VertexAttrib1dARB (will be remapped) */ "id\0" "glVertexAttrib1d\0" "glVertexAttrib1dARB\0" "\0" - /* _mesa_function_pool[19580]: ImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[19566]: ImageTransformParameterivHP (dynamic) */ "iip\0" "glImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[19615]: TexCoord4i (offset 122) */ + /* _mesa_function_pool[19601]: TexCoord4i (offset 122) */ "iiii\0" "glTexCoord4i\0" "\0" - /* _mesa_function_pool[19634]: DeleteQueriesARB (will be remapped) */ + /* _mesa_function_pool[19620]: DeleteQueriesARB (will be remapped) */ "ip\0" "glDeleteQueries\0" "glDeleteQueriesARB\0" "\0" - /* _mesa_function_pool[19673]: Color4ubVertex2fSUN (dynamic) */ + /* _mesa_function_pool[19659]: Color4ubVertex2fSUN (dynamic) */ "iiiiff\0" "glColor4ubVertex2fSUN\0" "\0" - /* _mesa_function_pool[19703]: FragmentColorMaterialSGIX (dynamic) */ + /* _mesa_function_pool[19689]: FragmentColorMaterialSGIX (dynamic) */ "ii\0" "glFragmentColorMaterialSGIX\0" "\0" - /* _mesa_function_pool[19735]: CurrentPaletteMatrixARB (dynamic) */ + /* _mesa_function_pool[19721]: CurrentPaletteMatrixARB (dynamic) */ "i\0" "glCurrentPaletteMatrixARB\0" "\0" - /* _mesa_function_pool[19764]: GetMapdv (offset 266) */ + /* _mesa_function_pool[19750]: GetMapdv (offset 266) */ "iip\0" "glGetMapdv\0" "\0" - /* _mesa_function_pool[19780]: ObjectPurgeableAPPLE (will be remapped) */ + /* _mesa_function_pool[19766]: ObjectPurgeableAPPLE (will be remapped) */ "iii\0" "glObjectPurgeableAPPLE\0" "\0" - /* _mesa_function_pool[19808]: GetStringi (will be remapped) */ + /* _mesa_function_pool[19794]: GetStringi (will be remapped) */ "ii\0" "glGetStringi\0" "\0" - /* _mesa_function_pool[19825]: SamplePatternSGIS (will be remapped) */ + /* _mesa_function_pool[19811]: SamplePatternSGIS (will be remapped) */ "i\0" "glSamplePatternSGIS\0" "glSamplePatternEXT\0" "\0" - /* _mesa_function_pool[19867]: PixelStoref (offset 249) */ + /* _mesa_function_pool[19853]: PixelStoref (offset 249) */ "if\0" "glPixelStoref\0" "\0" - /* _mesa_function_pool[19885]: IsQueryARB (will be remapped) */ + /* _mesa_function_pool[19871]: IsQueryARB (will be remapped) */ "i\0" "glIsQuery\0" "glIsQueryARB\0" "\0" - /* _mesa_function_pool[19911]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[19897]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ "iiiiifff\0" "glReplacementCodeuiColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[19960]: PixelStorei (offset 250) */ + /* _mesa_function_pool[19946]: PixelStorei (offset 250) */ "ii\0" "glPixelStorei\0" "\0" - /* _mesa_function_pool[19978]: VertexAttrib4usvARB (will be remapped) */ + /* _mesa_function_pool[19964]: VertexAttrib4usvARB (will be remapped) */ "ip\0" "glVertexAttrib4usv\0" "glVertexAttrib4usvARB\0" "\0" - /* _mesa_function_pool[20023]: LinkProgramARB (will be remapped) */ + /* _mesa_function_pool[20009]: LinkProgramARB (will be remapped) */ "i\0" "glLinkProgram\0" "glLinkProgramARB\0" "\0" - /* _mesa_function_pool[20057]: VertexAttrib2fNV (will be remapped) */ + /* _mesa_function_pool[20043]: VertexAttrib2fNV (will be remapped) */ "iff\0" "glVertexAttrib2fNV\0" "\0" - /* _mesa_function_pool[20081]: ShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[20067]: ShaderSourceARB (will be remapped) */ "iipp\0" "glShaderSource\0" "glShaderSourceARB\0" "\0" - /* _mesa_function_pool[20120]: FragmentMaterialiSGIX (dynamic) */ + /* _mesa_function_pool[20106]: FragmentMaterialiSGIX (dynamic) */ "iii\0" "glFragmentMaterialiSGIX\0" "\0" - /* _mesa_function_pool[20149]: EvalCoord2dv (offset 233) */ + /* _mesa_function_pool[20135]: EvalCoord2dv (offset 233) */ "p\0" "glEvalCoord2dv\0" "\0" - /* _mesa_function_pool[20167]: VertexAttrib3svARB (will be remapped) */ + /* _mesa_function_pool[20153]: VertexAttrib3svARB (will be remapped) */ "ip\0" "glVertexAttrib3sv\0" "glVertexAttrib3svARB\0" "\0" - /* _mesa_function_pool[20210]: ColorMaterial (offset 151) */ + /* _mesa_function_pool[20196]: ColorMaterial (offset 151) */ "ii\0" "glColorMaterial\0" "\0" - /* _mesa_function_pool[20230]: CompressedTexSubImage3DARB (will be remapped) */ + /* _mesa_function_pool[20216]: CompressedTexSubImage3DARB (will be remapped) */ "iiiiiiiiiip\0" "glCompressedTexSubImage3D\0" "glCompressedTexSubImage3DARB\0" "\0" - /* _mesa_function_pool[20298]: WindowPos2ivMESA (will be remapped) */ + /* _mesa_function_pool[20284]: WindowPos2ivMESA (will be remapped) */ "p\0" "glWindowPos2iv\0" "glWindowPos2ivARB\0" "glWindowPos2ivMESA\0" "\0" - /* _mesa_function_pool[20353]: IsFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[20339]: IsFramebufferEXT (will be remapped) */ "i\0" "glIsFramebuffer\0" "glIsFramebufferEXT\0" "\0" - /* _mesa_function_pool[20391]: Uniform4ivARB (will be remapped) */ + /* _mesa_function_pool[20377]: Uniform4ivARB (will be remapped) */ "iip\0" "glUniform4iv\0" "glUniform4ivARB\0" "\0" - /* _mesa_function_pool[20425]: GetVertexAttribdvARB (will be remapped) */ + /* _mesa_function_pool[20411]: GetVertexAttribdvARB (will be remapped) */ "iip\0" "glGetVertexAttribdv\0" "glGetVertexAttribdvARB\0" "\0" - /* _mesa_function_pool[20473]: TexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[20459]: TexBumpParameterivATI (will be remapped) */ "ip\0" "glTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[20501]: GetSeparableFilter (offset 359) */ + /* _mesa_function_pool[20487]: GetSeparableFilter (offset 359) */ "iiippp\0" "glGetSeparableFilter\0" "glGetSeparableFilterEXT\0" "\0" - /* _mesa_function_pool[20554]: Binormal3dEXT (dynamic) */ + /* _mesa_function_pool[20540]: Binormal3dEXT (dynamic) */ "ddd\0" "glBinormal3dEXT\0" "\0" - /* _mesa_function_pool[20575]: SpriteParameteriSGIX (dynamic) */ + /* _mesa_function_pool[20561]: SpriteParameteriSGIX (dynamic) */ "ii\0" "glSpriteParameteriSGIX\0" "\0" - /* _mesa_function_pool[20602]: RequestResidentProgramsNV (will be remapped) */ + /* _mesa_function_pool[20588]: RequestResidentProgramsNV (will be remapped) */ "ip\0" "glRequestResidentProgramsNV\0" "\0" - /* _mesa_function_pool[20634]: TagSampleBufferSGIX (dynamic) */ + /* _mesa_function_pool[20620]: TagSampleBufferSGIX (dynamic) */ "\0" "glTagSampleBufferSGIX\0" "\0" - /* _mesa_function_pool[20658]: TransformFeedbackVaryingsEXT (will be remapped) */ + /* _mesa_function_pool[20644]: TransformFeedbackVaryingsEXT (will be remapped) */ "iipi\0" "glTransformFeedbackVaryingsEXT\0" "glTransformFeedbackVaryings\0" "\0" - /* _mesa_function_pool[20723]: FeedbackBuffer (offset 194) */ + /* _mesa_function_pool[20709]: FeedbackBuffer (offset 194) */ "iip\0" "glFeedbackBuffer\0" "\0" - /* _mesa_function_pool[20745]: RasterPos2iv (offset 67) */ + /* _mesa_function_pool[20731]: RasterPos2iv (offset 67) */ "p\0" "glRasterPos2iv\0" "\0" - /* _mesa_function_pool[20763]: TexImage1D (offset 182) */ + /* _mesa_function_pool[20749]: TexImage1D (offset 182) */ "iiiiiiip\0" "glTexImage1D\0" "\0" - /* _mesa_function_pool[20786]: ListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[20772]: ListParameterivSGIX (dynamic) */ "iip\0" "glListParameterivSGIX\0" "\0" - /* _mesa_function_pool[20813]: MultiDrawElementsEXT (will be remapped) */ + /* _mesa_function_pool[20799]: MultiDrawElementsEXT (will be remapped) */ "ipipi\0" "glMultiDrawElements\0" "glMultiDrawElementsEXT\0" "\0" - /* _mesa_function_pool[20863]: Color3s (offset 17) */ + /* _mesa_function_pool[20849]: Color3s (offset 17) */ "iii\0" "glColor3s\0" "\0" - /* _mesa_function_pool[20878]: Uniform1ivARB (will be remapped) */ + /* _mesa_function_pool[20864]: Uniform1ivARB (will be remapped) */ "iip\0" "glUniform1iv\0" "glUniform1ivARB\0" "\0" - /* _mesa_function_pool[20912]: WindowPos2sMESA (will be remapped) */ + /* _mesa_function_pool[20898]: WindowPos2sMESA (will be remapped) */ "ii\0" "glWindowPos2s\0" "glWindowPos2sARB\0" "glWindowPos2sMESA\0" "\0" - /* _mesa_function_pool[20965]: WeightusvARB (dynamic) */ + /* _mesa_function_pool[20951]: WeightusvARB (dynamic) */ "ip\0" "glWeightusvARB\0" "\0" - /* _mesa_function_pool[20984]: TexCoordPointer (offset 320) */ + /* _mesa_function_pool[20970]: TexCoordPointer (offset 320) */ "iiip\0" "glTexCoordPointer\0" "\0" - /* _mesa_function_pool[21008]: FogCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[20994]: FogCoordPointerEXT (will be remapped) */ "iip\0" "glFogCoordPointer\0" "glFogCoordPointerEXT\0" "\0" - /* _mesa_function_pool[21052]: IndexMaterialEXT (dynamic) */ + /* _mesa_function_pool[21038]: IndexMaterialEXT (dynamic) */ "ii\0" "glIndexMaterialEXT\0" "\0" - /* _mesa_function_pool[21075]: Color3i (offset 15) */ + /* _mesa_function_pool[21061]: Color3i (offset 15) */ "iii\0" "glColor3i\0" "\0" - /* _mesa_function_pool[21090]: FrontFace (offset 157) */ + /* _mesa_function_pool[21076]: FrontFace (offset 157) */ "i\0" "glFrontFace\0" "\0" - /* _mesa_function_pool[21105]: EvalCoord2d (offset 232) */ + /* _mesa_function_pool[21091]: EvalCoord2d (offset 232) */ "dd\0" "glEvalCoord2d\0" "\0" - /* _mesa_function_pool[21123]: SecondaryColor3ubvEXT (will be remapped) */ + /* _mesa_function_pool[21109]: SecondaryColor3ubvEXT (will be remapped) */ "p\0" "glSecondaryColor3ubv\0" "glSecondaryColor3ubvEXT\0" "\0" - /* _mesa_function_pool[21171]: EvalCoord2f (offset 234) */ + /* _mesa_function_pool[21157]: EvalCoord2f (offset 234) */ "ff\0" "glEvalCoord2f\0" "\0" - /* _mesa_function_pool[21189]: VertexAttrib4dvARB (will be remapped) */ + /* _mesa_function_pool[21175]: VertexAttrib4dvARB (will be remapped) */ "ip\0" "glVertexAttrib4dv\0" "glVertexAttrib4dvARB\0" "\0" - /* _mesa_function_pool[21232]: BindAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[21218]: BindAttribLocationARB (will be remapped) */ "iip\0" "glBindAttribLocation\0" "glBindAttribLocationARB\0" "\0" - /* _mesa_function_pool[21282]: Color3b (offset 9) */ + /* _mesa_function_pool[21268]: Color3b (offset 9) */ "iii\0" "glColor3b\0" "\0" - /* _mesa_function_pool[21297]: MultiTexCoord2dARB (offset 384) */ + /* _mesa_function_pool[21283]: MultiTexCoord2dARB (offset 384) */ "idd\0" "glMultiTexCoord2d\0" "glMultiTexCoord2dARB\0" "\0" - /* _mesa_function_pool[21341]: ExecuteProgramNV (will be remapped) */ + /* _mesa_function_pool[21327]: ExecuteProgramNV (will be remapped) */ "iip\0" "glExecuteProgramNV\0" "\0" - /* _mesa_function_pool[21365]: Color3f (offset 13) */ + /* _mesa_function_pool[21351]: Color3f (offset 13) */ "fff\0" "glColor3f\0" "\0" - /* _mesa_function_pool[21380]: LightEnviSGIX (dynamic) */ + /* _mesa_function_pool[21366]: LightEnviSGIX (dynamic) */ "ii\0" "glLightEnviSGIX\0" "\0" - /* _mesa_function_pool[21400]: Color3d (offset 11) */ + /* _mesa_function_pool[21386]: Color3d (offset 11) */ "ddd\0" "glColor3d\0" "\0" - /* _mesa_function_pool[21415]: Normal3dv (offset 55) */ + /* _mesa_function_pool[21401]: Normal3dv (offset 55) */ "p\0" "glNormal3dv\0" "\0" - /* _mesa_function_pool[21430]: Lightf (offset 159) */ + /* _mesa_function_pool[21416]: Lightf (offset 159) */ "iif\0" "glLightf\0" "\0" - /* _mesa_function_pool[21444]: ReplacementCodeuiSUN (dynamic) */ + /* _mesa_function_pool[21430]: ReplacementCodeuiSUN (dynamic) */ "i\0" "glReplacementCodeuiSUN\0" "\0" - /* _mesa_function_pool[21470]: MatrixMode (offset 293) */ + /* _mesa_function_pool[21456]: MatrixMode (offset 293) */ "i\0" "glMatrixMode\0" "\0" - /* _mesa_function_pool[21486]: GetPixelMapusv (offset 273) */ + /* _mesa_function_pool[21472]: GetPixelMapusv (offset 273) */ "ip\0" "glGetPixelMapusv\0" "\0" - /* _mesa_function_pool[21507]: Lighti (offset 161) */ + /* _mesa_function_pool[21493]: Lighti (offset 161) */ "iii\0" "glLighti\0" "\0" - /* _mesa_function_pool[21521]: VertexAttribPointerNV (will be remapped) */ + /* _mesa_function_pool[21507]: VertexAttribPointerNV (will be remapped) */ "iiiip\0" "glVertexAttribPointerNV\0" "\0" - /* _mesa_function_pool[21552]: GetBooleanIndexedvEXT (will be remapped) */ + /* _mesa_function_pool[21538]: ClearDepthf (will be remapped) */ + "f\0" + "glClearDepthf\0" + "\0" + /* _mesa_function_pool[21555]: GetBooleanIndexedvEXT (will be remapped) */ "iip\0" "glGetBooleanIndexedvEXT\0" "glGetBooleani_v\0" "\0" - /* _mesa_function_pool[21597]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ + /* _mesa_function_pool[21600]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ "iiip\0" "glGetFramebufferAttachmentParameteriv\0" "glGetFramebufferAttachmentParameterivEXT\0" "\0" - /* _mesa_function_pool[21682]: PixelTransformParameterfEXT (dynamic) */ + /* _mesa_function_pool[21685]: PixelTransformParameterfEXT (dynamic) */ "iif\0" "glPixelTransformParameterfEXT\0" "\0" - /* _mesa_function_pool[21717]: MultiTexCoord4dvARB (offset 401) */ + /* _mesa_function_pool[21720]: MultiTexCoord4dvARB (offset 401) */ "ip\0" "glMultiTexCoord4dv\0" "glMultiTexCoord4dvARB\0" "\0" - /* _mesa_function_pool[21762]: PixelTransformParameteriEXT (dynamic) */ + /* _mesa_function_pool[21765]: PixelTransformParameteriEXT (dynamic) */ "iii\0" "glPixelTransformParameteriEXT\0" "\0" - /* _mesa_function_pool[21797]: GetDoublev (offset 260) */ + /* _mesa_function_pool[21800]: GetDoublev (offset 260) */ "ip\0" "glGetDoublev\0" "\0" - /* _mesa_function_pool[21814]: MultMatrixd (offset 295) */ + /* _mesa_function_pool[21817]: MultMatrixd (offset 295) */ "p\0" "glMultMatrixd\0" "\0" - /* _mesa_function_pool[21831]: MultMatrixf (offset 294) */ + /* _mesa_function_pool[21834]: MultMatrixf (offset 294) */ "p\0" "glMultMatrixf\0" "\0" - /* _mesa_function_pool[21848]: VertexAttribI4bvEXT (will be remapped) */ + /* _mesa_function_pool[21851]: VertexAttribI4bvEXT (will be remapped) */ "ip\0" "glVertexAttribI4bvEXT\0" "glVertexAttribI4bv\0" "\0" - /* _mesa_function_pool[21893]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[21896]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ "ffiiiifff\0" "glTexCoord2fColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[21936]: Uniform1iARB (will be remapped) */ + /* _mesa_function_pool[21939]: Uniform1iARB (will be remapped) */ "ii\0" "glUniform1i\0" "glUniform1iARB\0" "\0" - /* _mesa_function_pool[21967]: VertexAttribPointerARB (will be remapped) */ + /* _mesa_function_pool[21970]: VertexAttribPointerARB (will be remapped) */ "iiiiip\0" "glVertexAttribPointer\0" "glVertexAttribPointerARB\0" "\0" - /* _mesa_function_pool[22022]: VertexAttrib3sNV (will be remapped) */ + /* _mesa_function_pool[22025]: VertexAttrib3sNV (will be remapped) */ "iiii\0" "glVertexAttrib3sNV\0" "\0" - /* _mesa_function_pool[22047]: SharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[22050]: SharpenTexFuncSGIS (dynamic) */ "iip\0" "glSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[22073]: MultiTexCoord4fvARB (offset 403) */ + /* _mesa_function_pool[22076]: MultiTexCoord4fvARB (offset 403) */ "ip\0" "glMultiTexCoord4fv\0" "glMultiTexCoord4fvARB\0" "\0" - /* _mesa_function_pool[22118]: Uniform2uiEXT (will be remapped) */ + /* _mesa_function_pool[22121]: Uniform2uiEXT (will be remapped) */ "iii\0" "glUniform2uiEXT\0" "glUniform2ui\0" "\0" - /* _mesa_function_pool[22152]: UniformMatrix2x3fv (will be remapped) */ + /* _mesa_function_pool[22155]: UniformMatrix2x3fv (will be remapped) */ "iiip\0" "glUniformMatrix2x3fv\0" "\0" - /* _mesa_function_pool[22179]: TrackMatrixNV (will be remapped) */ + /* _mesa_function_pool[22182]: TrackMatrixNV (will be remapped) */ "iiii\0" "glTrackMatrixNV\0" "\0" - /* _mesa_function_pool[22201]: CombinerParameteriNV (will be remapped) */ + /* _mesa_function_pool[22204]: CombinerParameteriNV (will be remapped) */ "ii\0" "glCombinerParameteriNV\0" "\0" - /* _mesa_function_pool[22228]: DeleteAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[22231]: DeleteAsyncMarkersSGIX (dynamic) */ "ii\0" "glDeleteAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[22257]: ReplacementCodeusSUN (dynamic) */ + /* _mesa_function_pool[22260]: ReplacementCodeusSUN (dynamic) */ "i\0" "glReplacementCodeusSUN\0" "\0" - /* _mesa_function_pool[22283]: IsAsyncMarkerSGIX (dynamic) */ + /* _mesa_function_pool[22286]: IsAsyncMarkerSGIX (dynamic) */ "i\0" "glIsAsyncMarkerSGIX\0" "\0" - /* _mesa_function_pool[22306]: FrameZoomSGIX (dynamic) */ + /* _mesa_function_pool[22309]: FrameZoomSGIX (dynamic) */ "i\0" "glFrameZoomSGIX\0" "\0" - /* _mesa_function_pool[22325]: Normal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[22328]: Normal3fVertex3fvSUN (dynamic) */ "pp\0" "glNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[22352]: RasterPos4sv (offset 85) */ + /* _mesa_function_pool[22355]: RasterPos4sv (offset 85) */ "p\0" "glRasterPos4sv\0" "\0" - /* _mesa_function_pool[22370]: VertexAttrib4NsvARB (will be remapped) */ + /* _mesa_function_pool[22373]: VertexAttrib4NsvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nsv\0" "glVertexAttrib4NsvARB\0" "\0" - /* _mesa_function_pool[22415]: VertexAttrib3fvARB (will be remapped) */ + /* _mesa_function_pool[22418]: VertexAttrib3fvARB (will be remapped) */ "ip\0" "glVertexAttrib3fv\0" "glVertexAttrib3fvARB\0" "\0" - /* _mesa_function_pool[22458]: ClearColor (offset 206) */ + /* _mesa_function_pool[22461]: ClearColor (offset 206) */ "ffff\0" "glClearColor\0" "\0" - /* _mesa_function_pool[22477]: GetSynciv (will be remapped) */ + /* _mesa_function_pool[22480]: GetSynciv (will be remapped) */ "iiipp\0" "glGetSynciv\0" "\0" - /* _mesa_function_pool[22496]: ClearColorIiEXT (will be remapped) */ + /* _mesa_function_pool[22499]: ClearColorIiEXT (will be remapped) */ "iiii\0" "glClearColorIiEXT\0" "\0" - /* _mesa_function_pool[22520]: DeleteFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[22523]: DeleteFramebuffersEXT (will be remapped) */ "ip\0" "glDeleteFramebuffers\0" "glDeleteFramebuffersEXT\0" "\0" - /* _mesa_function_pool[22569]: GlobalAlphaFactorsSUN (dynamic) */ + /* _mesa_function_pool[22572]: GlobalAlphaFactorsSUN (dynamic) */ "i\0" "glGlobalAlphaFactorsSUN\0" "\0" - /* _mesa_function_pool[22596]: IsEnabledIndexedEXT (will be remapped) */ + /* _mesa_function_pool[22599]: IsEnabledIndexedEXT (will be remapped) */ "ii\0" "glIsEnabledIndexedEXT\0" "glIsEnabledi\0" "\0" - /* _mesa_function_pool[22635]: TexEnviv (offset 187) */ + /* _mesa_function_pool[22638]: TexEnviv (offset 187) */ "iip\0" "glTexEnviv\0" "\0" - /* _mesa_function_pool[22651]: TexSubImage3D (offset 372) */ + /* _mesa_function_pool[22654]: TexSubImage3D (offset 372) */ "iiiiiiiiiip\0" "glTexSubImage3D\0" "glTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[22699]: Tangent3fEXT (dynamic) */ + /* _mesa_function_pool[22702]: Tangent3fEXT (dynamic) */ "fff\0" "glTangent3fEXT\0" "\0" - /* _mesa_function_pool[22719]: SecondaryColor3uivEXT (will be remapped) */ + /* _mesa_function_pool[22722]: SecondaryColor3uivEXT (will be remapped) */ "p\0" "glSecondaryColor3uiv\0" "glSecondaryColor3uivEXT\0" "\0" - /* _mesa_function_pool[22767]: MatrixIndexubvARB (dynamic) */ + /* _mesa_function_pool[22770]: MatrixIndexubvARB (dynamic) */ "ip\0" "glMatrixIndexubvARB\0" "\0" - /* _mesa_function_pool[22791]: Color4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[22794]: Color4fNormal3fVertex3fSUN (dynamic) */ "ffffffffff\0" "glColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[22832]: PixelTexGenParameterfSGIS (will be remapped) */ + /* _mesa_function_pool[22835]: PixelTexGenParameterfSGIS (will be remapped) */ "if\0" "glPixelTexGenParameterfSGIS\0" "\0" - /* _mesa_function_pool[22864]: CreateShader (will be remapped) */ + /* _mesa_function_pool[22867]: CreateShader (will be remapped) */ "i\0" "glCreateShader\0" "\0" - /* _mesa_function_pool[22882]: GetColorTableParameterfv (offset 344) */ + /* _mesa_function_pool[22885]: GetColorTableParameterfv (offset 344) */ "iip\0" "glGetColorTableParameterfv\0" "glGetColorTableParameterfvSGI\0" "glGetColorTableParameterfvEXT\0" "\0" - /* _mesa_function_pool[22974]: FragmentLightModelfvSGIX (dynamic) */ + /* _mesa_function_pool[22977]: FragmentLightModelfvSGIX (dynamic) */ "ip\0" "glFragmentLightModelfvSGIX\0" "\0" - /* _mesa_function_pool[23005]: Bitmap (offset 8) */ + /* _mesa_function_pool[23008]: Bitmap (offset 8) */ "iiffffp\0" "glBitmap\0" "\0" - /* _mesa_function_pool[23023]: MultiTexCoord3fARB (offset 394) */ + /* _mesa_function_pool[23026]: MultiTexCoord3fARB (offset 394) */ "ifff\0" "glMultiTexCoord3f\0" "glMultiTexCoord3fARB\0" "\0" - /* _mesa_function_pool[23068]: GetTexLevelParameterfv (offset 284) */ + /* _mesa_function_pool[23071]: GetTexLevelParameterfv (offset 284) */ "iiip\0" "glGetTexLevelParameterfv\0" "\0" - /* _mesa_function_pool[23099]: GetPixelTexGenParameterfvSGIS (will be remapped) */ + /* _mesa_function_pool[23102]: GetPixelTexGenParameterfvSGIS (will be remapped) */ "ip\0" "glGetPixelTexGenParameterfvSGIS\0" "\0" - /* _mesa_function_pool[23135]: GenFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[23138]: GenFramebuffersEXT (will be remapped) */ "ip\0" "glGenFramebuffers\0" "glGenFramebuffersEXT\0" "\0" - /* _mesa_function_pool[23178]: VertexAttribDivisor (will be remapped) */ + /* _mesa_function_pool[23181]: VertexAttribDivisor (will be remapped) */ "ii\0" "glVertexAttribDivisor\0" "\0" - /* _mesa_function_pool[23204]: GetProgramParameterdvNV (will be remapped) */ + /* _mesa_function_pool[23207]: GetProgramParameterdvNV (will be remapped) */ "iiip\0" "glGetProgramParameterdvNV\0" "\0" - /* _mesa_function_pool[23236]: Vertex2sv (offset 133) */ + /* _mesa_function_pool[23239]: Vertex2sv (offset 133) */ "p\0" "glVertex2sv\0" "\0" - /* _mesa_function_pool[23251]: GetIntegerv (offset 263) */ + /* _mesa_function_pool[23254]: GetIntegerv (offset 263) */ "ip\0" "glGetIntegerv\0" "\0" - /* _mesa_function_pool[23269]: IsVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[23272]: IsVertexArrayAPPLE (will be remapped) */ "i\0" "glIsVertexArray\0" "glIsVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[23309]: FragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[23312]: FragmentLightfvSGIX (dynamic) */ "iip\0" "glFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[23336]: DetachShader (will be remapped) */ + /* _mesa_function_pool[23339]: DetachShader (will be remapped) */ "ii\0" "glDetachShader\0" "\0" - /* _mesa_function_pool[23355]: VertexAttrib4NubARB (will be remapped) */ + /* _mesa_function_pool[23358]: VertexAttrib4NubARB (will be remapped) */ "iiiii\0" "glVertexAttrib4Nub\0" "glVertexAttrib4NubARB\0" "\0" - /* _mesa_function_pool[23403]: GetProgramEnvParameterfvARB (will be remapped) */ + /* _mesa_function_pool[23406]: GetProgramEnvParameterfvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterfvARB\0" "\0" - /* _mesa_function_pool[23438]: GetTrackMatrixivNV (will be remapped) */ + /* _mesa_function_pool[23441]: GetTrackMatrixivNV (will be remapped) */ "iiip\0" "glGetTrackMatrixivNV\0" "\0" - /* _mesa_function_pool[23465]: VertexAttrib3svNV (will be remapped) */ + /* _mesa_function_pool[23468]: VertexAttrib3svNV (will be remapped) */ "ip\0" "glVertexAttrib3svNV\0" "\0" - /* _mesa_function_pool[23489]: Uniform4fvARB (will be remapped) */ + /* _mesa_function_pool[23492]: Uniform4fvARB (will be remapped) */ "iip\0" "glUniform4fv\0" "glUniform4fvARB\0" "\0" - /* _mesa_function_pool[23523]: MultTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[23526]: MultTransposeMatrixfARB (will be remapped) */ "p\0" "glMultTransposeMatrixf\0" "glMultTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[23575]: GetTexEnviv (offset 277) */ + /* _mesa_function_pool[23578]: GetTexEnviv (offset 277) */ "iip\0" "glGetTexEnviv\0" "\0" - /* _mesa_function_pool[23594]: ColorFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[23597]: ColorFragmentOp1ATI (will be remapped) */ "iiiiiii\0" "glColorFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[23625]: GetUniformfvARB (will be remapped) */ + /* _mesa_function_pool[23628]: GetUniformfvARB (will be remapped) */ "iip\0" "glGetUniformfv\0" "glGetUniformfvARB\0" "\0" - /* _mesa_function_pool[23663]: EGLImageTargetRenderbufferStorageOES (will be remapped) */ + /* _mesa_function_pool[23666]: EGLImageTargetRenderbufferStorageOES (will be remapped) */ "ip\0" "glEGLImageTargetRenderbufferStorageOES\0" "\0" - /* _mesa_function_pool[23706]: VertexAttribI2ivEXT (will be remapped) */ + /* _mesa_function_pool[23709]: VertexAttribI2ivEXT (will be remapped) */ "ip\0" "glVertexAttribI2ivEXT\0" "glVertexAttribI2iv\0" "\0" - /* _mesa_function_pool[23751]: PopClientAttrib (offset 334) */ + /* _mesa_function_pool[23754]: PopClientAttrib (offset 334) */ "\0" "glPopClientAttrib\0" "\0" - /* _mesa_function_pool[23771]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[23774]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffffff\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[23842]: DetachObjectARB (will be remapped) */ + /* _mesa_function_pool[23845]: DetachObjectARB (will be remapped) */ "ii\0" "glDetachObjectARB\0" "\0" - /* _mesa_function_pool[23864]: VertexBlendARB (dynamic) */ + /* _mesa_function_pool[23867]: VertexBlendARB (dynamic) */ "i\0" "glVertexBlendARB\0" "\0" - /* _mesa_function_pool[23884]: WindowPos3iMESA (will be remapped) */ + /* _mesa_function_pool[23887]: WindowPos3iMESA (will be remapped) */ "iii\0" "glWindowPos3i\0" "glWindowPos3iARB\0" "glWindowPos3iMESA\0" "\0" - /* _mesa_function_pool[23938]: SeparableFilter2D (offset 360) */ + /* _mesa_function_pool[23941]: SeparableFilter2D (offset 360) */ "iiiiiipp\0" "glSeparableFilter2D\0" "glSeparableFilter2DEXT\0" "\0" - /* _mesa_function_pool[23991]: ProgramParameteriARB (will be remapped) */ + /* _mesa_function_pool[23994]: ProgramParameteriARB (will be remapped) */ "iii\0" "glProgramParameteriARB\0" "\0" - /* _mesa_function_pool[24019]: Map1d (offset 220) */ + /* _mesa_function_pool[24022]: Map1d (offset 220) */ "iddiip\0" "glMap1d\0" "\0" - /* _mesa_function_pool[24035]: Map1f (offset 221) */ + /* _mesa_function_pool[24038]: Map1f (offset 221) */ "iffiip\0" "glMap1f\0" "\0" - /* _mesa_function_pool[24051]: CompressedTexImage2DARB (will be remapped) */ + /* _mesa_function_pool[24054]: CompressedTexImage2DARB (will be remapped) */ "iiiiiiip\0" "glCompressedTexImage2D\0" "glCompressedTexImage2DARB\0" "\0" - /* _mesa_function_pool[24110]: ArrayElement (offset 306) */ + /* _mesa_function_pool[24113]: ArrayElement (offset 306) */ "i\0" "glArrayElement\0" "glArrayElementEXT\0" "\0" - /* _mesa_function_pool[24146]: TexImage2D (offset 183) */ + /* _mesa_function_pool[24149]: TexImage2D (offset 183) */ "iiiiiiiip\0" "glTexImage2D\0" "\0" - /* _mesa_function_pool[24170]: DepthBoundsEXT (will be remapped) */ + /* _mesa_function_pool[24173]: DepthBoundsEXT (will be remapped) */ "dd\0" "glDepthBoundsEXT\0" "\0" - /* _mesa_function_pool[24191]: ProgramParameters4fvNV (will be remapped) */ + /* _mesa_function_pool[24194]: ProgramParameters4fvNV (will be remapped) */ "iiip\0" "glProgramParameters4fvNV\0" "\0" - /* _mesa_function_pool[24222]: DeformationMap3fSGIX (dynamic) */ + /* _mesa_function_pool[24225]: DeformationMap3fSGIX (dynamic) */ "iffiiffiiffiip\0" "glDeformationMap3fSGIX\0" "\0" - /* _mesa_function_pool[24261]: GetProgramivNV (will be remapped) */ + /* _mesa_function_pool[24264]: GetProgramivNV (will be remapped) */ "iip\0" "glGetProgramivNV\0" "\0" - /* _mesa_function_pool[24283]: GetFragDataLocationEXT (will be remapped) */ + /* _mesa_function_pool[24286]: GetFragDataLocationEXT (will be remapped) */ "ip\0" "glGetFragDataLocationEXT\0" "glGetFragDataLocation\0" "\0" - /* _mesa_function_pool[24334]: GetMinmaxParameteriv (offset 366) */ + /* _mesa_function_pool[24337]: GetMinmaxParameteriv (offset 366) */ "iip\0" "glGetMinmaxParameteriv\0" "glGetMinmaxParameterivEXT\0" "\0" - /* _mesa_function_pool[24388]: PixelTransferf (offset 247) */ + /* _mesa_function_pool[24391]: PixelTransferf (offset 247) */ "if\0" "glPixelTransferf\0" "\0" - /* _mesa_function_pool[24409]: CopyTexImage1D (offset 323) */ + /* _mesa_function_pool[24412]: CopyTexImage1D (offset 323) */ "iiiiiii\0" "glCopyTexImage1D\0" "glCopyTexImage1DEXT\0" "\0" - /* _mesa_function_pool[24455]: PushMatrix (offset 298) */ + /* _mesa_function_pool[24458]: PushMatrix (offset 298) */ "\0" "glPushMatrix\0" "\0" - /* _mesa_function_pool[24470]: Fogiv (offset 156) */ + /* _mesa_function_pool[24473]: Fogiv (offset 156) */ "ip\0" "glFogiv\0" "\0" - /* _mesa_function_pool[24482]: TexCoord1dv (offset 95) */ + /* _mesa_function_pool[24485]: TexCoord1dv (offset 95) */ "p\0" "glTexCoord1dv\0" "\0" - /* _mesa_function_pool[24499]: AlphaFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[24502]: AlphaFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiii\0" "glAlphaFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[24535]: PixelTransferi (offset 248) */ + /* _mesa_function_pool[24538]: PixelTransferi (offset 248) */ "ii\0" "glPixelTransferi\0" "\0" - /* _mesa_function_pool[24556]: GetVertexAttribdvNV (will be remapped) */ + /* _mesa_function_pool[24559]: GetVertexAttribdvNV (will be remapped) */ "iip\0" "glGetVertexAttribdvNV\0" "\0" - /* _mesa_function_pool[24583]: VertexAttrib3fvNV (will be remapped) */ + /* _mesa_function_pool[24586]: VertexAttrib3fvNV (will be remapped) */ "ip\0" "glVertexAttrib3fvNV\0" "\0" - /* _mesa_function_pool[24607]: Rotatef (offset 300) */ + /* _mesa_function_pool[24610]: Rotatef (offset 300) */ "ffff\0" "glRotatef\0" "\0" - /* _mesa_function_pool[24623]: GetFinalCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[24626]: GetFinalCombinerInputParameterivNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[24665]: Vertex3i (offset 138) */ + /* _mesa_function_pool[24668]: Vertex3i (offset 138) */ "iii\0" "glVertex3i\0" "\0" - /* _mesa_function_pool[24681]: Vertex3f (offset 136) */ + /* _mesa_function_pool[24684]: Vertex3f (offset 136) */ "fff\0" "glVertex3f\0" "\0" - /* _mesa_function_pool[24697]: Clear (offset 203) */ + /* _mesa_function_pool[24700]: Clear (offset 203) */ "i\0" "glClear\0" "\0" - /* _mesa_function_pool[24708]: Vertex3d (offset 134) */ + /* _mesa_function_pool[24711]: Vertex3d (offset 134) */ "ddd\0" "glVertex3d\0" "\0" - /* _mesa_function_pool[24724]: GetMapParameterivNV (dynamic) */ + /* _mesa_function_pool[24727]: GetMapParameterivNV (dynamic) */ "iip\0" "glGetMapParameterivNV\0" "\0" - /* _mesa_function_pool[24751]: Uniform4iARB (will be remapped) */ + /* _mesa_function_pool[24754]: Uniform4iARB (will be remapped) */ "iiiii\0" "glUniform4i\0" "glUniform4iARB\0" "\0" - /* _mesa_function_pool[24785]: ReadBuffer (offset 254) */ + /* _mesa_function_pool[24788]: ReadBuffer (offset 254) */ "i\0" "glReadBuffer\0" "\0" - /* _mesa_function_pool[24801]: ConvolutionParameteri (offset 352) */ + /* _mesa_function_pool[24804]: ConvolutionParameteri (offset 352) */ "iii\0" "glConvolutionParameteri\0" "glConvolutionParameteriEXT\0" "\0" - /* _mesa_function_pool[24857]: Ortho (offset 296) */ + /* _mesa_function_pool[24860]: Ortho (offset 296) */ "dddddd\0" "glOrtho\0" "\0" - /* _mesa_function_pool[24873]: Binormal3sEXT (dynamic) */ + /* _mesa_function_pool[24876]: Binormal3sEXT (dynamic) */ "iii\0" "glBinormal3sEXT\0" "\0" - /* _mesa_function_pool[24894]: ListBase (offset 6) */ + /* _mesa_function_pool[24897]: ListBase (offset 6) */ "i\0" "glListBase\0" "\0" - /* _mesa_function_pool[24908]: Vertex3s (offset 140) */ + /* _mesa_function_pool[24911]: Vertex3s (offset 140) */ "iii\0" "glVertex3s\0" "\0" - /* _mesa_function_pool[24924]: ConvolutionParameterf (offset 350) */ + /* _mesa_function_pool[24927]: ConvolutionParameterf (offset 350) */ "iif\0" "glConvolutionParameterf\0" "glConvolutionParameterfEXT\0" "\0" - /* _mesa_function_pool[24980]: GetColorTableParameteriv (offset 345) */ + /* _mesa_function_pool[24983]: GetColorTableParameteriv (offset 345) */ "iip\0" "glGetColorTableParameteriv\0" "glGetColorTableParameterivSGI\0" "glGetColorTableParameterivEXT\0" "\0" - /* _mesa_function_pool[25072]: ProgramEnvParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[25075]: ProgramEnvParameter4dvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4dvARB\0" "glProgramParameter4dvNV\0" "\0" - /* _mesa_function_pool[25129]: ShadeModel (offset 177) */ + /* _mesa_function_pool[25132]: ShadeModel (offset 177) */ "i\0" "glShadeModel\0" "\0" - /* _mesa_function_pool[25145]: VertexAttribs2fvNV (will be remapped) */ + /* _mesa_function_pool[25148]: VertexAttribs2fvNV (will be remapped) */ "iip\0" "glVertexAttribs2fvNV\0" "\0" - /* _mesa_function_pool[25171]: Rectiv (offset 91) */ + /* _mesa_function_pool[25174]: Rectiv (offset 91) */ "pp\0" "glRectiv\0" "\0" - /* _mesa_function_pool[25184]: UseProgramObjectARB (will be remapped) */ + /* _mesa_function_pool[25187]: UseProgramObjectARB (will be remapped) */ "i\0" "glUseProgram\0" "glUseProgramObjectARB\0" "\0" - /* _mesa_function_pool[25222]: GetMapParameterfvNV (dynamic) */ + /* _mesa_function_pool[25225]: GetMapParameterfvNV (dynamic) */ "iip\0" "glGetMapParameterfvNV\0" "\0" - /* _mesa_function_pool[25249]: EndConditionalRenderNV (will be remapped) */ + /* _mesa_function_pool[25252]: EndConditionalRenderNV (will be remapped) */ "\0" "glEndConditionalRenderNV\0" "glEndConditionalRender\0" "\0" - /* _mesa_function_pool[25299]: PassTexCoordATI (will be remapped) */ + /* _mesa_function_pool[25302]: PassTexCoordATI (will be remapped) */ "iii\0" "glPassTexCoordATI\0" "\0" - /* _mesa_function_pool[25322]: DeleteProgram (will be remapped) */ + /* _mesa_function_pool[25325]: DeleteProgram (will be remapped) */ "i\0" "glDeleteProgram\0" "\0" - /* _mesa_function_pool[25341]: Tangent3ivEXT (dynamic) */ + /* _mesa_function_pool[25344]: Tangent3ivEXT (dynamic) */ "p\0" "glTangent3ivEXT\0" "\0" - /* _mesa_function_pool[25360]: Tangent3dEXT (dynamic) */ + /* _mesa_function_pool[25363]: Tangent3dEXT (dynamic) */ "ddd\0" "glTangent3dEXT\0" "\0" - /* _mesa_function_pool[25380]: SecondaryColor3dvEXT (will be remapped) */ + /* _mesa_function_pool[25383]: SecondaryColor3dvEXT (will be remapped) */ "p\0" "glSecondaryColor3dv\0" "glSecondaryColor3dvEXT\0" "\0" - /* _mesa_function_pool[25426]: Vertex2fv (offset 129) */ + /* _mesa_function_pool[25429]: AlphaFragmentOp2ATI (will be remapped) */ + "iiiiiiiii\0" + "glAlphaFragmentOp2ATI\0" + "\0" + /* _mesa_function_pool[25462]: Vertex2fv (offset 129) */ "p\0" "glVertex2fv\0" "\0" - /* _mesa_function_pool[25441]: MultiDrawArraysEXT (will be remapped) */ + /* _mesa_function_pool[25477]: MultiDrawArraysEXT (will be remapped) */ "ippi\0" "glMultiDrawArrays\0" "glMultiDrawArraysEXT\0" "\0" - /* _mesa_function_pool[25486]: BindRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[25522]: BindRenderbufferEXT (will be remapped) */ "ii\0" "glBindRenderbuffer\0" "glBindRenderbufferEXT\0" "\0" - /* _mesa_function_pool[25531]: MultiTexCoord4dARB (offset 400) */ + /* _mesa_function_pool[25567]: MultiTexCoord4dARB (offset 400) */ "idddd\0" "glMultiTexCoord4d\0" "glMultiTexCoord4dARB\0" "\0" - /* _mesa_function_pool[25577]: FramebufferTextureFaceARB (will be remapped) */ + /* _mesa_function_pool[25613]: FramebufferTextureFaceARB (will be remapped) */ "iiiii\0" "glFramebufferTextureFaceARB\0" "\0" - /* _mesa_function_pool[25612]: Vertex3sv (offset 141) */ + /* _mesa_function_pool[25648]: Vertex3sv (offset 141) */ "p\0" "glVertex3sv\0" "\0" - /* _mesa_function_pool[25627]: SecondaryColor3usEXT (will be remapped) */ + /* _mesa_function_pool[25663]: SecondaryColor3usEXT (will be remapped) */ "iii\0" "glSecondaryColor3us\0" "glSecondaryColor3usEXT\0" "\0" - /* _mesa_function_pool[25675]: ProgramLocalParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[25711]: ProgramLocalParameter4fvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4fvARB\0" "\0" - /* _mesa_function_pool[25710]: DeleteProgramsNV (will be remapped) */ + /* _mesa_function_pool[25746]: DeleteProgramsNV (will be remapped) */ "ip\0" "glDeleteProgramsARB\0" "glDeleteProgramsNV\0" "\0" - /* _mesa_function_pool[25753]: EvalMesh1 (offset 236) */ + /* _mesa_function_pool[25789]: EvalMesh1 (offset 236) */ "iii\0" "glEvalMesh1\0" "\0" - /* _mesa_function_pool[25770]: PauseTransformFeedback (will be remapped) */ + /* _mesa_function_pool[25806]: PauseTransformFeedback (will be remapped) */ "\0" "glPauseTransformFeedback\0" "\0" - /* _mesa_function_pool[25797]: MultiTexCoord1sARB (offset 382) */ + /* _mesa_function_pool[25833]: MultiTexCoord1sARB (offset 382) */ "ii\0" "glMultiTexCoord1s\0" "glMultiTexCoord1sARB\0" "\0" - /* _mesa_function_pool[25840]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[25876]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ "iffffff\0" "glReplacementCodeuiColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[25887]: GetVertexAttribPointervNV (will be remapped) */ + /* _mesa_function_pool[25923]: GetVertexAttribPointervNV (will be remapped) */ "iip\0" "glGetVertexAttribPointerv\0" "glGetVertexAttribPointervARB\0" "glGetVertexAttribPointervNV\0" "\0" - /* _mesa_function_pool[25975]: VertexAttribs1fvNV (will be remapped) */ + /* _mesa_function_pool[26011]: VertexAttribs1fvNV (will be remapped) */ "iip\0" "glVertexAttribs1fvNV\0" "\0" - /* _mesa_function_pool[26001]: MultiTexCoord1dvARB (offset 377) */ + /* _mesa_function_pool[26037]: MultiTexCoord1dvARB (offset 377) */ "ip\0" "glMultiTexCoord1dv\0" "glMultiTexCoord1dvARB\0" "\0" - /* _mesa_function_pool[26046]: Uniform2iARB (will be remapped) */ + /* _mesa_function_pool[26082]: Uniform2iARB (will be remapped) */ "iii\0" "glUniform2i\0" "glUniform2iARB\0" "\0" - /* _mesa_function_pool[26078]: Vertex2iv (offset 131) */ + /* _mesa_function_pool[26114]: Vertex2iv (offset 131) */ "p\0" "glVertex2iv\0" "\0" - /* _mesa_function_pool[26093]: GetProgramStringNV (will be remapped) */ + /* _mesa_function_pool[26129]: GetProgramStringNV (will be remapped) */ "iip\0" "glGetProgramStringNV\0" "\0" - /* _mesa_function_pool[26119]: ColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[26155]: ColorPointerEXT (will be remapped) */ "iiiip\0" "glColorPointerEXT\0" "\0" - /* _mesa_function_pool[26144]: LineWidth (offset 168) */ + /* _mesa_function_pool[26180]: LineWidth (offset 168) */ "f\0" "glLineWidth\0" "\0" - /* _mesa_function_pool[26159]: MapBufferARB (will be remapped) */ + /* _mesa_function_pool[26195]: MapBufferARB (will be remapped) */ "ii\0" "glMapBuffer\0" "glMapBufferARB\0" "\0" - /* _mesa_function_pool[26190]: MultiDrawElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[26226]: MultiDrawElementsBaseVertex (will be remapped) */ "ipipip\0" "glMultiDrawElementsBaseVertex\0" "\0" - /* _mesa_function_pool[26228]: TexParameterIuivEXT (will be remapped) */ + /* _mesa_function_pool[26264]: TexParameterIuivEXT (will be remapped) */ "iip\0" "glTexParameterIuivEXT\0" "glTexParameterIuiv\0" "\0" - /* _mesa_function_pool[26274]: Binormal3svEXT (dynamic) */ + /* _mesa_function_pool[26310]: Binormal3svEXT (dynamic) */ "p\0" "glBinormal3svEXT\0" "\0" - /* _mesa_function_pool[26294]: ApplyTextureEXT (dynamic) */ + /* _mesa_function_pool[26330]: ApplyTextureEXT (dynamic) */ "i\0" "glApplyTextureEXT\0" "\0" - /* _mesa_function_pool[26315]: GetBufferParameteri64v (will be remapped) */ + /* _mesa_function_pool[26351]: GetBufferParameteri64v (will be remapped) */ "iip\0" "glGetBufferParameteri64v\0" "\0" - /* _mesa_function_pool[26345]: TexGendv (offset 189) */ + /* _mesa_function_pool[26381]: TexGendv (offset 189) */ "iip\0" "glTexGendv\0" "\0" - /* _mesa_function_pool[26361]: VertexAttribI3iEXT (will be remapped) */ + /* _mesa_function_pool[26397]: VertexAttribI3iEXT (will be remapped) */ "iiii\0" "glVertexAttribI3iEXT\0" "glVertexAttribI3i\0" "\0" - /* _mesa_function_pool[26406]: EnableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[26442]: EnableIndexedEXT (will be remapped) */ "ii\0" "glEnableIndexedEXT\0" "glEnablei\0" "\0" - /* _mesa_function_pool[26439]: TextureMaterialEXT (dynamic) */ + /* _mesa_function_pool[26475]: TextureMaterialEXT (dynamic) */ "ii\0" "glTextureMaterialEXT\0" "\0" - /* _mesa_function_pool[26464]: TextureLightEXT (dynamic) */ + /* _mesa_function_pool[26500]: TextureLightEXT (dynamic) */ "i\0" "glTextureLightEXT\0" "\0" - /* _mesa_function_pool[26485]: ResetMinmax (offset 370) */ + /* _mesa_function_pool[26521]: ResetMinmax (offset 370) */ "i\0" "glResetMinmax\0" "glResetMinmaxEXT\0" "\0" - /* _mesa_function_pool[26519]: SpriteParameterfSGIX (dynamic) */ + /* _mesa_function_pool[26555]: SpriteParameterfSGIX (dynamic) */ "if\0" "glSpriteParameterfSGIX\0" "\0" - /* _mesa_function_pool[26546]: EnableClientState (offset 313) */ + /* _mesa_function_pool[26582]: EnableClientState (offset 313) */ "i\0" "glEnableClientState\0" "\0" - /* _mesa_function_pool[26569]: VertexAttrib4sNV (will be remapped) */ + /* _mesa_function_pool[26605]: VertexAttrib4sNV (will be remapped) */ "iiiii\0" "glVertexAttrib4sNV\0" "\0" - /* _mesa_function_pool[26595]: GetConvolutionParameterfv (offset 357) */ + /* _mesa_function_pool[26631]: GetConvolutionParameterfv (offset 357) */ "iip\0" "glGetConvolutionParameterfv\0" "glGetConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[26659]: VertexAttribs4dvNV (will be remapped) */ + /* _mesa_function_pool[26695]: VertexAttribs4dvNV (will be remapped) */ "iip\0" "glVertexAttribs4dvNV\0" "\0" - /* _mesa_function_pool[26685]: VertexAttrib4dARB (will be remapped) */ + /* _mesa_function_pool[26721]: MultiModeDrawArraysIBM (will be remapped) */ + "pppii\0" + "glMultiModeDrawArraysIBM\0" + "\0" + /* _mesa_function_pool[26753]: VertexAttrib4dARB (will be remapped) */ "idddd\0" "glVertexAttrib4d\0" "glVertexAttrib4dARB\0" "\0" - /* _mesa_function_pool[26729]: GetTexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[26797]: GetTexBumpParameterfvATI (will be remapped) */ "ip\0" "glGetTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[26760]: ProgramNamedParameter4dNV (will be remapped) */ + /* _mesa_function_pool[26828]: ProgramNamedParameter4dNV (will be remapped) */ "iipdddd\0" "glProgramNamedParameter4dNV\0" "\0" - /* _mesa_function_pool[26797]: GetMaterialfv (offset 269) */ + /* _mesa_function_pool[26865]: GetMaterialfv (offset 269) */ "iip\0" "glGetMaterialfv\0" "\0" - /* _mesa_function_pool[26818]: VertexWeightfEXT (dynamic) */ + /* _mesa_function_pool[26886]: VertexWeightfEXT (dynamic) */ "f\0" "glVertexWeightfEXT\0" "\0" - /* _mesa_function_pool[26840]: Binormal3fEXT (dynamic) */ + /* _mesa_function_pool[26908]: SetFragmentShaderConstantATI (will be remapped) */ + "ip\0" + "glSetFragmentShaderConstantATI\0" + "\0" + /* _mesa_function_pool[26943]: Binormal3fEXT (dynamic) */ "fff\0" "glBinormal3fEXT\0" "\0" - /* _mesa_function_pool[26861]: CallList (offset 2) */ + /* _mesa_function_pool[26964]: CallList (offset 2) */ "i\0" "glCallList\0" "\0" - /* _mesa_function_pool[26875]: Materialfv (offset 170) */ + /* _mesa_function_pool[26978]: Materialfv (offset 170) */ "iip\0" "glMaterialfv\0" "\0" - /* _mesa_function_pool[26893]: TexCoord3fv (offset 113) */ + /* _mesa_function_pool[26996]: TexCoord3fv (offset 113) */ "p\0" "glTexCoord3fv\0" "\0" - /* _mesa_function_pool[26910]: FogCoordfvEXT (will be remapped) */ + /* _mesa_function_pool[27013]: FogCoordfvEXT (will be remapped) */ "p\0" "glFogCoordfv\0" "glFogCoordfvEXT\0" "\0" - /* _mesa_function_pool[26942]: MultiTexCoord1ivARB (offset 381) */ + /* _mesa_function_pool[27045]: MultiTexCoord1ivARB (offset 381) */ "ip\0" "glMultiTexCoord1iv\0" "glMultiTexCoord1ivARB\0" "\0" - /* _mesa_function_pool[26987]: SecondaryColor3ubEXT (will be remapped) */ + /* _mesa_function_pool[27090]: SecondaryColor3ubEXT (will be remapped) */ "iii\0" "glSecondaryColor3ub\0" "glSecondaryColor3ubEXT\0" "\0" - /* _mesa_function_pool[27035]: MultiTexCoord2ivARB (offset 389) */ + /* _mesa_function_pool[27138]: MultiTexCoord2ivARB (offset 389) */ "ip\0" "glMultiTexCoord2iv\0" "glMultiTexCoord2ivARB\0" "\0" - /* _mesa_function_pool[27080]: FogFuncSGIS (dynamic) */ + /* _mesa_function_pool[27183]: FogFuncSGIS (dynamic) */ "ip\0" "glFogFuncSGIS\0" "\0" - /* _mesa_function_pool[27098]: CopyTexSubImage2D (offset 326) */ + /* _mesa_function_pool[27201]: CopyTexSubImage2D (offset 326) */ "iiiiiiii\0" "glCopyTexSubImage2D\0" "glCopyTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[27151]: GetObjectParameterivARB (will be remapped) */ + /* _mesa_function_pool[27254]: GetObjectParameterivARB (will be remapped) */ "iip\0" "glGetObjectParameterivARB\0" "\0" - /* _mesa_function_pool[27182]: Color3iv (offset 16) */ + /* _mesa_function_pool[27285]: Color3iv (offset 16) */ "p\0" "glColor3iv\0" "\0" - /* _mesa_function_pool[27196]: TexCoord4fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[27299]: TexCoord4fVertex4fSUN (dynamic) */ "ffffffff\0" "glTexCoord4fVertex4fSUN\0" "\0" - /* _mesa_function_pool[27230]: DrawElements (offset 311) */ + /* _mesa_function_pool[27333]: DrawElements (offset 311) */ "iiip\0" "glDrawElements\0" "\0" - /* _mesa_function_pool[27251]: BindVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[27354]: BindVertexArrayAPPLE (will be remapped) */ "i\0" "glBindVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[27277]: GetProgramLocalParameterdvARB (will be remapped) */ + /* _mesa_function_pool[27380]: GetProgramLocalParameterdvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterdvARB\0" "\0" - /* _mesa_function_pool[27314]: GetHistogramParameteriv (offset 363) */ + /* _mesa_function_pool[27417]: GetHistogramParameteriv (offset 363) */ "iip\0" "glGetHistogramParameteriv\0" "glGetHistogramParameterivEXT\0" "\0" - /* _mesa_function_pool[27374]: MultiTexCoord1iARB (offset 380) */ + /* _mesa_function_pool[27477]: MultiTexCoord1iARB (offset 380) */ "ii\0" "glMultiTexCoord1i\0" "glMultiTexCoord1iARB\0" "\0" - /* _mesa_function_pool[27417]: GetConvolutionFilter (offset 356) */ + /* _mesa_function_pool[27520]: GetConvolutionFilter (offset 356) */ "iiip\0" "glGetConvolutionFilter\0" "glGetConvolutionFilterEXT\0" "\0" - /* _mesa_function_pool[27472]: GetProgramivARB (will be remapped) */ + /* _mesa_function_pool[27575]: GetProgramivARB (will be remapped) */ "iip\0" "glGetProgramivARB\0" "\0" - /* _mesa_function_pool[27495]: BlendFuncSeparateEXT (will be remapped) */ + /* _mesa_function_pool[27598]: BlendFuncSeparateEXT (will be remapped) */ "iiii\0" "glBlendFuncSeparate\0" "glBlendFuncSeparateEXT\0" "glBlendFuncSeparateINGR\0" "\0" - /* _mesa_function_pool[27568]: MapBufferRange (will be remapped) */ + /* _mesa_function_pool[27671]: MapBufferRange (will be remapped) */ "iiii\0" "glMapBufferRange\0" "\0" - /* _mesa_function_pool[27591]: ProgramParameters4dvNV (will be remapped) */ + /* _mesa_function_pool[27694]: ProgramParameters4dvNV (will be remapped) */ "iiip\0" "glProgramParameters4dvNV\0" "\0" - /* _mesa_function_pool[27622]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[27725]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[27659]: EvalPoint2 (offset 239) */ + /* _mesa_function_pool[27762]: EvalPoint2 (offset 239) */ "ii\0" "glEvalPoint2\0" "\0" - /* _mesa_function_pool[27676]: Uniform1uivEXT (will be remapped) */ + /* _mesa_function_pool[27779]: Uniform1uivEXT (will be remapped) */ "iip\0" "glUniform1uivEXT\0" "glUniform1uiv\0" "\0" - /* _mesa_function_pool[27712]: EvalPoint1 (offset 237) */ + /* _mesa_function_pool[27815]: EvalPoint1 (offset 237) */ "i\0" "glEvalPoint1\0" "\0" - /* _mesa_function_pool[27728]: Binormal3dvEXT (dynamic) */ + /* _mesa_function_pool[27831]: Binormal3dvEXT (dynamic) */ "p\0" "glBinormal3dvEXT\0" "\0" - /* _mesa_function_pool[27748]: PopMatrix (offset 297) */ + /* _mesa_function_pool[27851]: PopMatrix (offset 297) */ "\0" "glPopMatrix\0" "\0" - /* _mesa_function_pool[27762]: FinishFenceNV (will be remapped) */ + /* _mesa_function_pool[27865]: GetVertexAttribIuivEXT (will be remapped) */ + "iip\0" + "glGetVertexAttribIuivEXT\0" + "glGetVertexAttribIuiv\0" + "\0" + /* _mesa_function_pool[27917]: FinishFenceNV (will be remapped) */ "i\0" "glFinishFenceNV\0" "\0" - /* _mesa_function_pool[27781]: GetFogFuncSGIS (dynamic) */ + /* _mesa_function_pool[27936]: GetFogFuncSGIS (dynamic) */ "p\0" "glGetFogFuncSGIS\0" "\0" - /* _mesa_function_pool[27801]: GetUniformLocationARB (will be remapped) */ + /* _mesa_function_pool[27956]: GetUniformLocationARB (will be remapped) */ "ip\0" "glGetUniformLocation\0" "glGetUniformLocationARB\0" "\0" - /* _mesa_function_pool[27850]: SecondaryColor3fEXT (will be remapped) */ + /* _mesa_function_pool[28005]: SecondaryColor3fEXT (will be remapped) */ "fff\0" "glSecondaryColor3f\0" "glSecondaryColor3fEXT\0" "\0" - /* _mesa_function_pool[27896]: GetTexGeniv (offset 280) */ + /* _mesa_function_pool[28051]: GetTexGeniv (offset 280) */ "iip\0" "glGetTexGeniv\0" "\0" - /* _mesa_function_pool[27915]: CombinerInputNV (will be remapped) */ + /* _mesa_function_pool[28070]: CombinerInputNV (will be remapped) */ "iiiiii\0" "glCombinerInputNV\0" "\0" - /* _mesa_function_pool[27941]: VertexAttrib3sARB (will be remapped) */ + /* _mesa_function_pool[28096]: VertexAttrib3sARB (will be remapped) */ "iiii\0" "glVertexAttrib3s\0" "glVertexAttrib3sARB\0" "\0" - /* _mesa_function_pool[27984]: IsTransformFeedback (will be remapped) */ + /* _mesa_function_pool[28139]: IsTransformFeedback (will be remapped) */ "i\0" "glIsTransformFeedback\0" "\0" - /* _mesa_function_pool[28009]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[28164]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[28054]: Map2d (offset 222) */ + /* _mesa_function_pool[28209]: Map2d (offset 222) */ "iddiiddiip\0" "glMap2d\0" "\0" - /* _mesa_function_pool[28074]: Map2f (offset 223) */ + /* _mesa_function_pool[28229]: Map2f (offset 223) */ "iffiiffiip\0" "glMap2f\0" "\0" - /* _mesa_function_pool[28094]: ProgramStringARB (will be remapped) */ + /* _mesa_function_pool[28249]: ProgramStringARB (will be remapped) */ "iiip\0" "glProgramStringARB\0" "\0" - /* _mesa_function_pool[28119]: Vertex4s (offset 148) */ + /* _mesa_function_pool[28274]: Vertex4s (offset 148) */ "iiii\0" "glVertex4s\0" "\0" - /* _mesa_function_pool[28136]: TexCoord4fVertex4fvSUN (dynamic) */ + /* _mesa_function_pool[28291]: TexCoord4fVertex4fvSUN (dynamic) */ "pp\0" "glTexCoord4fVertex4fvSUN\0" "\0" - /* _mesa_function_pool[28165]: FragmentLightModelivSGIX (dynamic) */ + /* _mesa_function_pool[28320]: FragmentLightModelivSGIX (dynamic) */ "ip\0" "glFragmentLightModelivSGIX\0" "\0" - /* _mesa_function_pool[28196]: VertexAttrib1fNV (will be remapped) */ + /* _mesa_function_pool[28351]: VertexAttrib1fNV (will be remapped) */ "if\0" "glVertexAttrib1fNV\0" "\0" - /* _mesa_function_pool[28219]: Vertex4f (offset 144) */ + /* _mesa_function_pool[28374]: Vertex4f (offset 144) */ "ffff\0" "glVertex4f\0" "\0" - /* _mesa_function_pool[28236]: EvalCoord1d (offset 228) */ + /* _mesa_function_pool[28391]: EvalCoord1d (offset 228) */ "d\0" "glEvalCoord1d\0" "\0" - /* _mesa_function_pool[28253]: Vertex4d (offset 142) */ + /* _mesa_function_pool[28408]: Vertex4d (offset 142) */ "dddd\0" "glVertex4d\0" "\0" - /* _mesa_function_pool[28270]: RasterPos4dv (offset 79) */ + /* _mesa_function_pool[28425]: RasterPos4dv (offset 79) */ "p\0" "glRasterPos4dv\0" "\0" - /* _mesa_function_pool[28288]: UseShaderProgramEXT (will be remapped) */ + /* _mesa_function_pool[28443]: UseShaderProgramEXT (will be remapped) */ "ii\0" "glUseShaderProgramEXT\0" "\0" - /* _mesa_function_pool[28314]: FragmentLightfSGIX (dynamic) */ + /* _mesa_function_pool[28469]: FragmentLightfSGIX (dynamic) */ "iif\0" "glFragmentLightfSGIX\0" "\0" - /* _mesa_function_pool[28340]: GetCompressedTexImageARB (will be remapped) */ + /* _mesa_function_pool[28495]: GetCompressedTexImageARB (will be remapped) */ "iip\0" "glGetCompressedTexImage\0" "glGetCompressedTexImageARB\0" "\0" - /* _mesa_function_pool[28396]: GetTexGenfv (offset 279) */ + /* _mesa_function_pool[28551]: GetTexGenfv (offset 279) */ "iip\0" "glGetTexGenfv\0" "\0" - /* _mesa_function_pool[28415]: Vertex4i (offset 146) */ + /* _mesa_function_pool[28570]: Vertex4i (offset 146) */ "iiii\0" "glVertex4i\0" "\0" - /* _mesa_function_pool[28432]: VertexWeightPointerEXT (dynamic) */ + /* _mesa_function_pool[28587]: VertexWeightPointerEXT (dynamic) */ "iiip\0" "glVertexWeightPointerEXT\0" "\0" - /* _mesa_function_pool[28463]: GetHistogram (offset 361) */ + /* _mesa_function_pool[28618]: GetHistogram (offset 361) */ "iiiip\0" "glGetHistogram\0" "glGetHistogramEXT\0" "\0" - /* _mesa_function_pool[28503]: ActiveStencilFaceEXT (will be remapped) */ + /* _mesa_function_pool[28658]: ActiveStencilFaceEXT (will be remapped) */ "i\0" "glActiveStencilFaceEXT\0" "\0" - /* _mesa_function_pool[28529]: StencilFuncSeparateATI (will be remapped) */ + /* _mesa_function_pool[28684]: StencilFuncSeparateATI (will be remapped) */ "iiii\0" "glStencilFuncSeparateATI\0" "\0" - /* _mesa_function_pool[28560]: Materialf (offset 169) */ + /* _mesa_function_pool[28715]: Materialf (offset 169) */ "iif\0" "glMaterialf\0" "\0" - /* _mesa_function_pool[28577]: GetShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[28732]: GetShaderSourceARB (will be remapped) */ "iipp\0" "glGetShaderSource\0" "glGetShaderSourceARB\0" "\0" - /* _mesa_function_pool[28622]: IglooInterfaceSGIX (dynamic) */ + /* _mesa_function_pool[28777]: IglooInterfaceSGIX (dynamic) */ "ip\0" "glIglooInterfaceSGIX\0" "\0" - /* _mesa_function_pool[28647]: Materiali (offset 171) */ + /* _mesa_function_pool[28802]: Materiali (offset 171) */ "iii\0" "glMateriali\0" "\0" - /* _mesa_function_pool[28664]: VertexAttrib4dNV (will be remapped) */ + /* _mesa_function_pool[28819]: VertexAttrib4dNV (will be remapped) */ "idddd\0" "glVertexAttrib4dNV\0" "\0" - /* _mesa_function_pool[28690]: MultiModeDrawElementsIBM (will be remapped) */ + /* _mesa_function_pool[28845]: MultiModeDrawElementsIBM (will be remapped) */ "ppipii\0" "glMultiModeDrawElementsIBM\0" "\0" - /* _mesa_function_pool[28725]: Indexsv (offset 51) */ + /* _mesa_function_pool[28880]: Indexsv (offset 51) */ "p\0" "glIndexsv\0" "\0" - /* _mesa_function_pool[28738]: MultiTexCoord4svARB (offset 407) */ + /* _mesa_function_pool[28893]: MultiTexCoord4svARB (offset 407) */ "ip\0" "glMultiTexCoord4sv\0" "glMultiTexCoord4svARB\0" "\0" - /* _mesa_function_pool[28783]: LightModelfv (offset 164) */ + /* _mesa_function_pool[28938]: LightModelfv (offset 164) */ "ip\0" "glLightModelfv\0" "\0" - /* _mesa_function_pool[28802]: TexCoord2dv (offset 103) */ + /* _mesa_function_pool[28957]: TexCoord2dv (offset 103) */ "p\0" "glTexCoord2dv\0" "\0" - /* _mesa_function_pool[28819]: GenQueriesARB (will be remapped) */ + /* _mesa_function_pool[28974]: GenQueriesARB (will be remapped) */ "ip\0" "glGenQueries\0" "glGenQueriesARB\0" "\0" - /* _mesa_function_pool[28852]: EvalCoord1dv (offset 229) */ + /* _mesa_function_pool[29007]: EvalCoord1dv (offset 229) */ "p\0" "glEvalCoord1dv\0" "\0" - /* _mesa_function_pool[28870]: ReplacementCodeuiVertex3fSUN (dynamic) */ + /* _mesa_function_pool[29025]: ReplacementCodeuiVertex3fSUN (dynamic) */ "ifff\0" "glReplacementCodeuiVertex3fSUN\0" "\0" - /* _mesa_function_pool[28907]: Translated (offset 303) */ + /* _mesa_function_pool[29062]: Translated (offset 303) */ "ddd\0" "glTranslated\0" "\0" - /* _mesa_function_pool[28925]: Translatef (offset 304) */ + /* _mesa_function_pool[29080]: Translatef (offset 304) */ "fff\0" "glTranslatef\0" "\0" - /* _mesa_function_pool[28943]: Uniform3uiEXT (will be remapped) */ + /* _mesa_function_pool[29098]: Uniform3uiEXT (will be remapped) */ "iiii\0" "glUniform3uiEXT\0" "glUniform3ui\0" "\0" - /* _mesa_function_pool[28978]: StencilMask (offset 209) */ + /* _mesa_function_pool[29133]: StencilMask (offset 209) */ "i\0" "glStencilMask\0" "\0" - /* _mesa_function_pool[28995]: Tangent3iEXT (dynamic) */ + /* _mesa_function_pool[29150]: Tangent3iEXT (dynamic) */ "iii\0" "glTangent3iEXT\0" "\0" - /* _mesa_function_pool[29015]: GetLightiv (offset 265) */ + /* _mesa_function_pool[29170]: GetLightiv (offset 265) */ "iip\0" "glGetLightiv\0" "\0" - /* _mesa_function_pool[29033]: DrawMeshArraysSUN (dynamic) */ + /* _mesa_function_pool[29188]: DrawMeshArraysSUN (dynamic) */ "iiii\0" "glDrawMeshArraysSUN\0" "\0" - /* _mesa_function_pool[29059]: IsList (offset 287) */ + /* _mesa_function_pool[29214]: IsList (offset 287) */ "i\0" "glIsList\0" "\0" - /* _mesa_function_pool[29071]: IsSync (will be remapped) */ + /* _mesa_function_pool[29226]: IsSync (will be remapped) */ "i\0" "glIsSync\0" "\0" - /* _mesa_function_pool[29083]: RenderMode (offset 196) */ + /* _mesa_function_pool[29238]: RenderMode (offset 196) */ "i\0" "glRenderMode\0" "\0" - /* _mesa_function_pool[29099]: GetMapControlPointsNV (dynamic) */ + /* _mesa_function_pool[29254]: GetMapControlPointsNV (dynamic) */ "iiiiiip\0" "glGetMapControlPointsNV\0" "\0" - /* _mesa_function_pool[29132]: DrawBuffersARB (will be remapped) */ + /* _mesa_function_pool[29287]: DrawBuffersARB (will be remapped) */ "ip\0" "glDrawBuffers\0" "glDrawBuffersARB\0" "glDrawBuffersATI\0" "\0" - /* _mesa_function_pool[29184]: ClearBufferiv (will be remapped) */ + /* _mesa_function_pool[29339]: ClearBufferiv (will be remapped) */ "iip\0" "glClearBufferiv\0" "\0" - /* _mesa_function_pool[29205]: ProgramLocalParameter4fARB (will be remapped) */ + /* _mesa_function_pool[29360]: ProgramLocalParameter4fARB (will be remapped) */ "iiffff\0" "glProgramLocalParameter4fARB\0" "\0" - /* _mesa_function_pool[29242]: SpriteParameterivSGIX (dynamic) */ + /* _mesa_function_pool[29397]: SpriteParameterivSGIX (dynamic) */ "ip\0" "glSpriteParameterivSGIX\0" "\0" - /* _mesa_function_pool[29270]: ProvokingVertexEXT (will be remapped) */ + /* _mesa_function_pool[29425]: ProvokingVertexEXT (will be remapped) */ "i\0" "glProvokingVertexEXT\0" "glProvokingVertex\0" "\0" - /* _mesa_function_pool[29312]: MultiTexCoord1fARB (offset 378) */ + /* _mesa_function_pool[29467]: MultiTexCoord1fARB (offset 378) */ "if\0" "glMultiTexCoord1f\0" "glMultiTexCoord1fARB\0" "\0" - /* _mesa_function_pool[29355]: LoadName (offset 198) */ + /* _mesa_function_pool[29510]: LoadName (offset 198) */ "i\0" "glLoadName\0" "\0" - /* _mesa_function_pool[29369]: VertexAttribs4ubvNV (will be remapped) */ + /* _mesa_function_pool[29524]: VertexAttribs4ubvNV (will be remapped) */ "iip\0" "glVertexAttribs4ubvNV\0" "\0" - /* _mesa_function_pool[29396]: WeightsvARB (dynamic) */ + /* _mesa_function_pool[29551]: WeightsvARB (dynamic) */ "ip\0" "glWeightsvARB\0" "\0" - /* _mesa_function_pool[29414]: Uniform1fvARB (will be remapped) */ + /* _mesa_function_pool[29569]: Uniform1fvARB (will be remapped) */ "iip\0" "glUniform1fv\0" "glUniform1fvARB\0" "\0" - /* _mesa_function_pool[29448]: CopyTexSubImage1D (offset 325) */ + /* _mesa_function_pool[29603]: CopyTexSubImage1D (offset 325) */ "iiiiii\0" "glCopyTexSubImage1D\0" "glCopyTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[29499]: CullFace (offset 152) */ + /* _mesa_function_pool[29654]: CullFace (offset 152) */ "i\0" "glCullFace\0" "\0" - /* _mesa_function_pool[29513]: BindTexture (offset 307) */ + /* _mesa_function_pool[29668]: BindTexture (offset 307) */ "ii\0" "glBindTexture\0" "glBindTextureEXT\0" "\0" - /* _mesa_function_pool[29548]: BeginFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[29703]: BeginFragmentShaderATI (will be remapped) */ "\0" "glBeginFragmentShaderATI\0" "\0" - /* _mesa_function_pool[29575]: MultiTexCoord4fARB (offset 402) */ + /* _mesa_function_pool[29730]: MultiTexCoord4fARB (offset 402) */ "iffff\0" "glMultiTexCoord4f\0" "glMultiTexCoord4fARB\0" "\0" - /* _mesa_function_pool[29621]: VertexAttribs3svNV (will be remapped) */ + /* _mesa_function_pool[29776]: VertexAttribs3svNV (will be remapped) */ "iip\0" "glVertexAttribs3svNV\0" "\0" - /* _mesa_function_pool[29647]: StencilFunc (offset 243) */ + /* _mesa_function_pool[29802]: StencilFunc (offset 243) */ "iii\0" "glStencilFunc\0" "\0" - /* _mesa_function_pool[29666]: CopyPixels (offset 255) */ + /* _mesa_function_pool[29821]: CopyPixels (offset 255) */ "iiiii\0" "glCopyPixels\0" "\0" - /* _mesa_function_pool[29686]: Rectsv (offset 93) */ + /* _mesa_function_pool[29841]: Rectsv (offset 93) */ "pp\0" "glRectsv\0" "\0" - /* _mesa_function_pool[29699]: ReplacementCodeuivSUN (dynamic) */ + /* _mesa_function_pool[29854]: ReplacementCodeuivSUN (dynamic) */ "p\0" "glReplacementCodeuivSUN\0" "\0" - /* _mesa_function_pool[29726]: EnableVertexAttribArrayARB (will be remapped) */ + /* _mesa_function_pool[29881]: EnableVertexAttribArrayARB (will be remapped) */ "i\0" "glEnableVertexAttribArray\0" "glEnableVertexAttribArrayARB\0" "\0" - /* _mesa_function_pool[29784]: NormalPointervINTEL (dynamic) */ + /* _mesa_function_pool[29939]: NormalPointervINTEL (dynamic) */ "ip\0" "glNormalPointervINTEL\0" "\0" - /* _mesa_function_pool[29810]: CopyConvolutionFilter2D (offset 355) */ + /* _mesa_function_pool[29965]: CopyConvolutionFilter2D (offset 355) */ "iiiiii\0" "glCopyConvolutionFilter2D\0" "glCopyConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[29873]: WindowPos3ivMESA (will be remapped) */ + /* _mesa_function_pool[30028]: WindowPos3ivMESA (will be remapped) */ "p\0" "glWindowPos3iv\0" "glWindowPos3ivARB\0" "glWindowPos3ivMESA\0" "\0" - /* _mesa_function_pool[29928]: CopyBufferSubData (will be remapped) */ + /* _mesa_function_pool[30083]: CopyBufferSubData (will be remapped) */ "iiiii\0" "glCopyBufferSubData\0" "\0" - /* _mesa_function_pool[29955]: NormalPointer (offset 318) */ + /* _mesa_function_pool[30110]: NormalPointer (offset 318) */ "iip\0" "glNormalPointer\0" "\0" - /* _mesa_function_pool[29976]: TexParameterfv (offset 179) */ + /* _mesa_function_pool[30131]: TexParameterfv (offset 179) */ "iip\0" "glTexParameterfv\0" "\0" - /* _mesa_function_pool[29998]: IsBufferARB (will be remapped) */ + /* _mesa_function_pool[30153]: IsBufferARB (will be remapped) */ "i\0" "glIsBuffer\0" "glIsBufferARB\0" "\0" - /* _mesa_function_pool[30026]: WindowPos4iMESA (will be remapped) */ + /* _mesa_function_pool[30181]: WindowPos4iMESA (will be remapped) */ "iiii\0" "glWindowPos4iMESA\0" "\0" - /* _mesa_function_pool[30050]: VertexAttrib4uivARB (will be remapped) */ + /* _mesa_function_pool[30205]: VertexAttrib4uivARB (will be remapped) */ "ip\0" "glVertexAttrib4uiv\0" "glVertexAttrib4uivARB\0" "\0" - /* _mesa_function_pool[30095]: Tangent3bvEXT (dynamic) */ + /* _mesa_function_pool[30250]: Tangent3bvEXT (dynamic) */ "p\0" "glTangent3bvEXT\0" "\0" - /* _mesa_function_pool[30114]: VertexAttribI3uivEXT (will be remapped) */ + /* _mesa_function_pool[30269]: VertexAttribI3uivEXT (will be remapped) */ "ip\0" "glVertexAttribI3uivEXT\0" "glVertexAttribI3uiv\0" "\0" - /* _mesa_function_pool[30161]: UniformMatrix3x4fv (will be remapped) */ + /* _mesa_function_pool[30316]: UniformMatrix3x4fv (will be remapped) */ "iiip\0" "glUniformMatrix3x4fv\0" "\0" - /* _mesa_function_pool[30188]: ClipPlane (offset 150) */ + /* _mesa_function_pool[30343]: ClipPlane (offset 150) */ "ip\0" "glClipPlane\0" "\0" - /* _mesa_function_pool[30204]: Recti (offset 90) */ + /* _mesa_function_pool[30359]: Recti (offset 90) */ "iiii\0" "glRecti\0" "\0" - /* _mesa_function_pool[30218]: VertexAttribI3ivEXT (will be remapped) */ + /* _mesa_function_pool[30373]: VertexAttribI3ivEXT (will be remapped) */ "ip\0" "glVertexAttribI3ivEXT\0" "glVertexAttribI3iv\0" "\0" - /* _mesa_function_pool[30263]: DrawRangeElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[30418]: DrawRangeElementsBaseVertex (will be remapped) */ "iiiiipi\0" "glDrawRangeElementsBaseVertex\0" "\0" - /* _mesa_function_pool[30302]: TexCoordPointervINTEL (dynamic) */ + /* _mesa_function_pool[30457]: TexCoordPointervINTEL (dynamic) */ "iip\0" "glTexCoordPointervINTEL\0" "\0" - /* _mesa_function_pool[30331]: DeleteBuffersARB (will be remapped) */ + /* _mesa_function_pool[30486]: DeleteBuffersARB (will be remapped) */ "ip\0" "glDeleteBuffers\0" "glDeleteBuffersARB\0" "\0" - /* _mesa_function_pool[30370]: PixelTransformParameterfvEXT (dynamic) */ + /* _mesa_function_pool[30525]: PixelTransformParameterfvEXT (dynamic) */ "iip\0" "glPixelTransformParameterfvEXT\0" "\0" - /* _mesa_function_pool[30406]: PrimitiveRestartNV (will be remapped) */ + /* _mesa_function_pool[30561]: PrimitiveRestartNV (will be remapped) */ "\0" "glPrimitiveRestartNV\0" "\0" - /* _mesa_function_pool[30429]: WindowPos4fvMESA (will be remapped) */ + /* _mesa_function_pool[30584]: WindowPos4fvMESA (will be remapped) */ "p\0" "glWindowPos4fvMESA\0" "\0" - /* _mesa_function_pool[30451]: GetPixelMapuiv (offset 272) */ + /* _mesa_function_pool[30606]: GetPixelMapuiv (offset 272) */ "ip\0" "glGetPixelMapuiv\0" "\0" - /* _mesa_function_pool[30472]: Rectf (offset 88) */ + /* _mesa_function_pool[30627]: Rectf (offset 88) */ "ffff\0" "glRectf\0" "\0" - /* _mesa_function_pool[30486]: VertexAttrib1sNV (will be remapped) */ + /* _mesa_function_pool[30641]: VertexAttrib1sNV (will be remapped) */ "ii\0" "glVertexAttrib1sNV\0" "\0" - /* _mesa_function_pool[30509]: Indexfv (offset 47) */ + /* _mesa_function_pool[30664]: Indexfv (offset 47) */ "p\0" "glIndexfv\0" "\0" - /* _mesa_function_pool[30522]: SecondaryColor3svEXT (will be remapped) */ + /* _mesa_function_pool[30677]: SecondaryColor3svEXT (will be remapped) */ "p\0" "glSecondaryColor3sv\0" "glSecondaryColor3svEXT\0" "\0" - /* _mesa_function_pool[30568]: LoadTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[30723]: LoadTransposeMatrixfARB (will be remapped) */ "p\0" "glLoadTransposeMatrixf\0" "glLoadTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[30620]: GetPointerv (offset 329) */ + /* _mesa_function_pool[30775]: GetPointerv (offset 329) */ "ip\0" "glGetPointerv\0" "glGetPointervEXT\0" "\0" - /* _mesa_function_pool[30655]: Tangent3bEXT (dynamic) */ + /* _mesa_function_pool[30810]: Tangent3bEXT (dynamic) */ "iii\0" "glTangent3bEXT\0" "\0" - /* _mesa_function_pool[30675]: CombinerParameterfNV (will be remapped) */ + /* _mesa_function_pool[30830]: CombinerParameterfNV (will be remapped) */ "if\0" "glCombinerParameterfNV\0" "\0" - /* _mesa_function_pool[30702]: IndexMask (offset 212) */ + /* _mesa_function_pool[30857]: IndexMask (offset 212) */ "i\0" "glIndexMask\0" "\0" - /* _mesa_function_pool[30717]: BindProgramNV (will be remapped) */ + /* _mesa_function_pool[30872]: BindProgramNV (will be remapped) */ "ii\0" "glBindProgramARB\0" "glBindProgramNV\0" "\0" - /* _mesa_function_pool[30754]: VertexAttrib4svARB (will be remapped) */ + /* _mesa_function_pool[30909]: VertexAttrib4svARB (will be remapped) */ "ip\0" "glVertexAttrib4sv\0" "glVertexAttrib4svARB\0" "\0" - /* _mesa_function_pool[30797]: GetFloatv (offset 262) */ + /* _mesa_function_pool[30952]: GetFloatv (offset 262) */ "ip\0" "glGetFloatv\0" "\0" - /* _mesa_function_pool[30813]: CreateDebugObjectMESA (dynamic) */ + /* _mesa_function_pool[30968]: CreateDebugObjectMESA (dynamic) */ "\0" "glCreateDebugObjectMESA\0" "\0" - /* _mesa_function_pool[30839]: GetShaderiv (will be remapped) */ + /* _mesa_function_pool[30994]: GetShaderiv (will be remapped) */ "iip\0" "glGetShaderiv\0" "\0" - /* _mesa_function_pool[30858]: ClientWaitSync (will be remapped) */ + /* _mesa_function_pool[31013]: ClientWaitSync (will be remapped) */ "iii\0" "glClientWaitSync\0" "\0" - /* _mesa_function_pool[30880]: TexCoord4s (offset 124) */ + /* _mesa_function_pool[31035]: TexCoord4s (offset 124) */ "iiii\0" "glTexCoord4s\0" "\0" - /* _mesa_function_pool[30899]: TexCoord3sv (offset 117) */ + /* _mesa_function_pool[31054]: TexCoord3sv (offset 117) */ "p\0" "glTexCoord3sv\0" "\0" - /* _mesa_function_pool[30916]: BindFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[31071]: BindFragmentShaderATI (will be remapped) */ "i\0" "glBindFragmentShaderATI\0" "\0" - /* _mesa_function_pool[30943]: PopAttrib (offset 218) */ + /* _mesa_function_pool[31098]: PopAttrib (offset 218) */ "\0" "glPopAttrib\0" "\0" - /* _mesa_function_pool[30957]: Fogfv (offset 154) */ + /* _mesa_function_pool[31112]: Fogfv (offset 154) */ "ip\0" "glFogfv\0" "\0" - /* _mesa_function_pool[30969]: UnmapBufferARB (will be remapped) */ + /* _mesa_function_pool[31124]: UnmapBufferARB (will be remapped) */ "i\0" "glUnmapBuffer\0" "glUnmapBufferARB\0" "\0" - /* _mesa_function_pool[31003]: InitNames (offset 197) */ + /* _mesa_function_pool[31158]: InitNames (offset 197) */ "\0" "glInitNames\0" "\0" - /* _mesa_function_pool[31017]: Normal3sv (offset 61) */ + /* _mesa_function_pool[31172]: Normal3sv (offset 61) */ "p\0" "glNormal3sv\0" "\0" - /* _mesa_function_pool[31032]: Minmax (offset 368) */ + /* _mesa_function_pool[31187]: Minmax (offset 368) */ "iii\0" "glMinmax\0" "glMinmaxEXT\0" "\0" - /* _mesa_function_pool[31058]: TexCoord4d (offset 118) */ + /* _mesa_function_pool[31213]: TexCoord4d (offset 118) */ "dddd\0" "glTexCoord4d\0" "\0" - /* _mesa_function_pool[31077]: DeformationMap3dSGIX (dynamic) */ - "iddiiddiiddiip\0" - "glDeformationMap3dSGIX\0" - "\0" - /* _mesa_function_pool[31116]: TexCoord4f (offset 120) */ + /* _mesa_function_pool[31232]: TexCoord4f (offset 120) */ "ffff\0" "glTexCoord4f\0" "\0" - /* _mesa_function_pool[31135]: FogCoorddvEXT (will be remapped) */ + /* _mesa_function_pool[31251]: FogCoorddvEXT (will be remapped) */ "p\0" "glFogCoorddv\0" "glFogCoorddvEXT\0" "\0" - /* _mesa_function_pool[31167]: FinishTextureSUNX (dynamic) */ + /* _mesa_function_pool[31283]: FinishTextureSUNX (dynamic) */ "\0" "glFinishTextureSUNX\0" "\0" - /* _mesa_function_pool[31189]: GetFragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[31305]: GetFragmentLightfvSGIX (dynamic) */ "iip\0" "glGetFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[31219]: Binormal3fvEXT (dynamic) */ + /* _mesa_function_pool[31335]: Binormal3fvEXT (dynamic) */ "p\0" "glBinormal3fvEXT\0" "\0" - /* _mesa_function_pool[31239]: GetBooleanv (offset 258) */ + /* _mesa_function_pool[31355]: GetBooleanv (offset 258) */ "ip\0" "glGetBooleanv\0" "\0" - /* _mesa_function_pool[31257]: ColorFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[31373]: ColorFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiiii\0" "glColorFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[31294]: Hint (offset 158) */ + /* _mesa_function_pool[31410]: Hint (offset 158) */ "ii\0" "glHint\0" "\0" - /* _mesa_function_pool[31305]: Color4dv (offset 28) */ + /* _mesa_function_pool[31421]: Color4dv (offset 28) */ "p\0" "glColor4dv\0" "\0" - /* _mesa_function_pool[31319]: VertexAttrib2svARB (will be remapped) */ + /* _mesa_function_pool[31435]: VertexAttrib2svARB (will be remapped) */ "ip\0" "glVertexAttrib2sv\0" "glVertexAttrib2svARB\0" "\0" - /* _mesa_function_pool[31362]: AreProgramsResidentNV (will be remapped) */ + /* _mesa_function_pool[31478]: AreProgramsResidentNV (will be remapped) */ "ipp\0" "glAreProgramsResidentNV\0" "\0" - /* _mesa_function_pool[31391]: WindowPos3svMESA (will be remapped) */ + /* _mesa_function_pool[31507]: WindowPos3svMESA (will be remapped) */ "p\0" "glWindowPos3sv\0" "glWindowPos3svARB\0" "glWindowPos3svMESA\0" "\0" - /* _mesa_function_pool[31446]: CopyColorSubTable (offset 347) */ + /* _mesa_function_pool[31562]: CopyColorSubTable (offset 347) */ "iiiii\0" "glCopyColorSubTable\0" "glCopyColorSubTableEXT\0" "\0" - /* _mesa_function_pool[31496]: WeightdvARB (dynamic) */ + /* _mesa_function_pool[31612]: WeightdvARB (dynamic) */ "ip\0" "glWeightdvARB\0" "\0" - /* _mesa_function_pool[31514]: DeleteRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[31630]: DeleteRenderbuffersEXT (will be remapped) */ "ip\0" "glDeleteRenderbuffers\0" "glDeleteRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[31565]: VertexAttrib4NubvARB (will be remapped) */ + /* _mesa_function_pool[31681]: VertexAttrib4NubvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nubv\0" "glVertexAttrib4NubvARB\0" "\0" - /* _mesa_function_pool[31612]: VertexAttrib3dvNV (will be remapped) */ + /* _mesa_function_pool[31728]: VertexAttrib3dvNV (will be remapped) */ "ip\0" "glVertexAttrib3dvNV\0" "\0" - /* _mesa_function_pool[31636]: GetObjectParameterfvARB (will be remapped) */ + /* _mesa_function_pool[31752]: GetObjectParameterfvARB (will be remapped) */ "iip\0" "glGetObjectParameterfvARB\0" "\0" - /* _mesa_function_pool[31667]: Vertex4iv (offset 147) */ + /* _mesa_function_pool[31783]: Vertex4iv (offset 147) */ "p\0" "glVertex4iv\0" "\0" - /* _mesa_function_pool[31682]: GetProgramEnvParameterdvARB (will be remapped) */ + /* _mesa_function_pool[31798]: GetProgramEnvParameterdvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterdvARB\0" "\0" - /* _mesa_function_pool[31717]: TexCoord4dv (offset 119) */ + /* _mesa_function_pool[31833]: TexCoord4dv (offset 119) */ "p\0" "glTexCoord4dv\0" "\0" - /* _mesa_function_pool[31734]: LockArraysEXT (will be remapped) */ + /* _mesa_function_pool[31850]: LockArraysEXT (will be remapped) */ "ii\0" "glLockArraysEXT\0" "\0" - /* _mesa_function_pool[31754]: Begin (offset 7) */ + /* _mesa_function_pool[31870]: Begin (offset 7) */ "i\0" "glBegin\0" "\0" - /* _mesa_function_pool[31765]: LightModeli (offset 165) */ + /* _mesa_function_pool[31881]: LightModeli (offset 165) */ "ii\0" "glLightModeli\0" "\0" - /* _mesa_function_pool[31783]: VertexAttribI4ivEXT (will be remapped) */ + /* _mesa_function_pool[31899]: VertexAttribI4ivEXT (will be remapped) */ "ip\0" "glVertexAttribI4ivEXT\0" "glVertexAttribI4iv\0" "\0" - /* _mesa_function_pool[31828]: Rectfv (offset 89) */ + /* _mesa_function_pool[31944]: Rectfv (offset 89) */ "pp\0" "glRectfv\0" "\0" - /* _mesa_function_pool[31841]: LightModelf (offset 163) */ + /* _mesa_function_pool[31957]: LightModelf (offset 163) */ "if\0" "glLightModelf\0" "\0" - /* _mesa_function_pool[31859]: GetTexParameterfv (offset 282) */ + /* _mesa_function_pool[31975]: GetTexParameterfv (offset 282) */ "iip\0" "glGetTexParameterfv\0" "\0" - /* _mesa_function_pool[31884]: GetLightfv (offset 264) */ + /* _mesa_function_pool[32000]: GetLightfv (offset 264) */ "iip\0" "glGetLightfv\0" "\0" - /* _mesa_function_pool[31902]: PixelTransformParameterivEXT (dynamic) */ + /* _mesa_function_pool[32018]: PixelTransformParameterivEXT (dynamic) */ "iip\0" "glPixelTransformParameterivEXT\0" "\0" - /* _mesa_function_pool[31938]: BinormalPointerEXT (dynamic) */ + /* _mesa_function_pool[32054]: BinormalPointerEXT (dynamic) */ "iip\0" "glBinormalPointerEXT\0" "\0" - /* _mesa_function_pool[31964]: VertexAttrib1dNV (will be remapped) */ + /* _mesa_function_pool[32080]: VertexAttrib1dNV (will be remapped) */ "id\0" "glVertexAttrib1dNV\0" "\0" - /* _mesa_function_pool[31987]: GetCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[32103]: GetCombinerInputParameterivNV (will be remapped) */ "iiiip\0" "glGetCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[32026]: Disable (offset 214) */ + /* _mesa_function_pool[32142]: Disable (offset 214) */ "i\0" "glDisable\0" "\0" - /* _mesa_function_pool[32039]: MultiTexCoord2fvARB (offset 387) */ + /* _mesa_function_pool[32155]: MultiTexCoord2fvARB (offset 387) */ "ip\0" "glMultiTexCoord2fv\0" "glMultiTexCoord2fvARB\0" "\0" - /* _mesa_function_pool[32084]: GetRenderbufferParameterivEXT (will be remapped) */ + /* _mesa_function_pool[32200]: GetRenderbufferParameterivEXT (will be remapped) */ "iip\0" "glGetRenderbufferParameteriv\0" "glGetRenderbufferParameterivEXT\0" "\0" - /* _mesa_function_pool[32150]: CombinerParameterivNV (will be remapped) */ + /* _mesa_function_pool[32266]: CombinerParameterivNV (will be remapped) */ "ip\0" "glCombinerParameterivNV\0" "\0" - /* _mesa_function_pool[32178]: GenFragmentShadersATI (will be remapped) */ + /* _mesa_function_pool[32294]: GenFragmentShadersATI (will be remapped) */ "i\0" "glGenFragmentShadersATI\0" "\0" - /* _mesa_function_pool[32205]: DrawArrays (offset 310) */ + /* _mesa_function_pool[32321]: DrawArrays (offset 310) */ "iii\0" "glDrawArrays\0" "glDrawArraysEXT\0" "\0" - /* _mesa_function_pool[32239]: WeightuivARB (dynamic) */ + /* _mesa_function_pool[32355]: WeightuivARB (dynamic) */ "ip\0" "glWeightuivARB\0" "\0" - /* _mesa_function_pool[32258]: VertexAttrib2sARB (will be remapped) */ + /* _mesa_function_pool[32374]: VertexAttrib2sARB (will be remapped) */ "iii\0" "glVertexAttrib2s\0" "glVertexAttrib2sARB\0" "\0" - /* _mesa_function_pool[32300]: ColorMask (offset 210) */ + /* _mesa_function_pool[32416]: ColorMask (offset 210) */ "iiii\0" "glColorMask\0" "\0" - /* _mesa_function_pool[32318]: GenAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[32434]: GenAsyncMarkersSGIX (dynamic) */ "i\0" "glGenAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[32343]: Tangent3svEXT (dynamic) */ + /* _mesa_function_pool[32459]: Tangent3svEXT (dynamic) */ "p\0" "glTangent3svEXT\0" "\0" - /* _mesa_function_pool[32362]: GetListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[32478]: GetListParameterivSGIX (dynamic) */ "iip\0" "glGetListParameterivSGIX\0" "\0" - /* _mesa_function_pool[32392]: BindBufferARB (will be remapped) */ + /* _mesa_function_pool[32508]: BindBufferARB (will be remapped) */ "ii\0" "glBindBuffer\0" "glBindBufferARB\0" "\0" - /* _mesa_function_pool[32425]: GetInfoLogARB (will be remapped) */ + /* _mesa_function_pool[32541]: GetInfoLogARB (will be remapped) */ "iipp\0" "glGetInfoLogARB\0" "\0" - /* _mesa_function_pool[32447]: RasterPos4iv (offset 83) */ + /* _mesa_function_pool[32563]: RasterPos4iv (offset 83) */ "p\0" "glRasterPos4iv\0" "\0" - /* _mesa_function_pool[32465]: Enable (offset 215) */ + /* _mesa_function_pool[32581]: Enable (offset 215) */ "i\0" "glEnable\0" "\0" - /* _mesa_function_pool[32477]: LineStipple (offset 167) */ + /* _mesa_function_pool[32593]: LineStipple (offset 167) */ "ii\0" "glLineStipple\0" "\0" - /* _mesa_function_pool[32495]: VertexAttribs4svNV (will be remapped) */ + /* _mesa_function_pool[32611]: VertexAttribs4svNV (will be remapped) */ "iip\0" "glVertexAttribs4svNV\0" "\0" - /* _mesa_function_pool[32521]: EdgeFlagPointerListIBM (dynamic) */ + /* _mesa_function_pool[32637]: EdgeFlagPointerListIBM (dynamic) */ "ipi\0" "glEdgeFlagPointerListIBM\0" "\0" - /* _mesa_function_pool[32551]: UniformMatrix3x2fv (will be remapped) */ + /* _mesa_function_pool[32667]: UniformMatrix3x2fv (will be remapped) */ "iiip\0" "glUniformMatrix3x2fv\0" "\0" - /* _mesa_function_pool[32578]: GetMinmaxParameterfv (offset 365) */ + /* _mesa_function_pool[32694]: GetMinmaxParameterfv (offset 365) */ "iip\0" "glGetMinmaxParameterfv\0" "glGetMinmaxParameterfvEXT\0" "\0" - /* _mesa_function_pool[32632]: VertexAttrib1fvARB (will be remapped) */ + /* _mesa_function_pool[32748]: VertexAttrib1fvARB (will be remapped) */ "ip\0" "glVertexAttrib1fv\0" "glVertexAttrib1fvARB\0" "\0" - /* _mesa_function_pool[32675]: GenBuffersARB (will be remapped) */ + /* _mesa_function_pool[32791]: GenBuffersARB (will be remapped) */ "ip\0" "glGenBuffers\0" "glGenBuffersARB\0" "\0" - /* _mesa_function_pool[32708]: VertexAttribs1svNV (will be remapped) */ + /* _mesa_function_pool[32824]: VertexAttribs1svNV (will be remapped) */ "iip\0" "glVertexAttribs1svNV\0" "\0" - /* _mesa_function_pool[32734]: Vertex3fv (offset 137) */ + /* _mesa_function_pool[32850]: Vertex3fv (offset 137) */ "p\0" "glVertex3fv\0" "\0" - /* _mesa_function_pool[32749]: GetTexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[32865]: GetTexBumpParameterivATI (will be remapped) */ "ip\0" "glGetTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[32780]: Binormal3bEXT (dynamic) */ + /* _mesa_function_pool[32896]: Binormal3bEXT (dynamic) */ "iii\0" "glBinormal3bEXT\0" "\0" - /* _mesa_function_pool[32801]: FragmentMaterialivSGIX (dynamic) */ + /* _mesa_function_pool[32917]: FragmentMaterialivSGIX (dynamic) */ "iip\0" "glFragmentMaterialivSGIX\0" "\0" - /* _mesa_function_pool[32831]: IsRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[32947]: IsRenderbufferEXT (will be remapped) */ "i\0" "glIsRenderbuffer\0" "glIsRenderbufferEXT\0" "\0" - /* _mesa_function_pool[32871]: GenProgramsNV (will be remapped) */ + /* _mesa_function_pool[32987]: GenProgramsNV (will be remapped) */ "ip\0" "glGenProgramsARB\0" "glGenProgramsNV\0" "\0" - /* _mesa_function_pool[32908]: VertexAttrib4dvNV (will be remapped) */ + /* _mesa_function_pool[33024]: VertexAttrib4dvNV (will be remapped) */ "ip\0" "glVertexAttrib4dvNV\0" "\0" - /* _mesa_function_pool[32932]: EndFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[33048]: EndFragmentShaderATI (will be remapped) */ "\0" "glEndFragmentShaderATI\0" "\0" - /* _mesa_function_pool[32957]: Binormal3iEXT (dynamic) */ + /* _mesa_function_pool[33073]: Binormal3iEXT (dynamic) */ "iii\0" "glBinormal3iEXT\0" "\0" - /* _mesa_function_pool[32978]: WindowPos2fMESA (will be remapped) */ + /* _mesa_function_pool[33094]: WindowPos2fMESA (will be remapped) */ "ff\0" "glWindowPos2f\0" "glWindowPos2fARB\0" @@ -4739,589 +4759,594 @@ static const char _mesa_function_pool[] = /* these functions need to be remapped */ static const struct gl_function_pool_remap MESA_remap_table_functions[] = { - { 1577, AttachShader_remap_index }, - { 9902, CreateProgram_remap_index }, - { 22864, CreateShader_remap_index }, - { 25322, DeleteProgram_remap_index }, - { 18525, DeleteShader_remap_index }, - { 23336, DetachShader_remap_index }, - { 17928, GetAttachedShaders_remap_index }, - { 4869, GetProgramInfoLog_remap_index }, - { 405, GetProgramiv_remap_index }, - { 6542, GetShaderInfoLog_remap_index }, - { 30839, GetShaderiv_remap_index }, - { 13311, IsProgram_remap_index }, - { 12263, IsShader_remap_index }, - { 10006, StencilFuncSeparate_remap_index }, - { 3921, StencilMaskSeparate_remap_index }, - { 7624, StencilOpSeparate_remap_index }, - { 22152, UniformMatrix2x3fv_remap_index }, - { 2847, UniformMatrix2x4fv_remap_index }, - { 32551, UniformMatrix3x2fv_remap_index }, - { 30161, UniformMatrix3x4fv_remap_index }, - { 16226, UniformMatrix4x2fv_remap_index }, - { 3263, UniformMatrix4x3fv_remap_index }, - { 5030, ClampColor_remap_index }, - { 17982, ClearBufferfi_remap_index }, - { 17448, ClearBufferfv_remap_index }, - { 29184, ClearBufferiv_remap_index }, - { 13516, ClearBufferuiv_remap_index }, - { 19808, GetStringi_remap_index }, - { 2788, TexBuffer_remap_index }, - { 938, FramebufferTexture_remap_index }, - { 26315, GetBufferParameteri64v_remap_index }, - { 10106, GetInteger64i_v_remap_index }, - { 23178, VertexAttribDivisor_remap_index }, - { 9920, LoadTransposeMatrixdARB_remap_index }, - { 30568, LoadTransposeMatrixfARB_remap_index }, - { 5608, MultTransposeMatrixdARB_remap_index }, - { 23523, MultTransposeMatrixfARB_remap_index }, - { 216, SampleCoverageARB_remap_index }, - { 5834, CompressedTexImage1DARB_remap_index }, - { 24051, CompressedTexImage2DARB_remap_index }, - { 3984, CompressedTexImage3DARB_remap_index }, - { 18242, CompressedTexSubImage1DARB_remap_index }, - { 2050, CompressedTexSubImage2DARB_remap_index }, - { 20230, CompressedTexSubImage3DARB_remap_index }, - { 28340, GetCompressedTexImageARB_remap_index }, - { 3829, DisableVertexAttribArrayARB_remap_index }, - { 29726, EnableVertexAttribArrayARB_remap_index }, - { 31682, GetProgramEnvParameterdvARB_remap_index }, - { 23403, GetProgramEnvParameterfvARB_remap_index }, - { 27277, GetProgramLocalParameterdvARB_remap_index }, - { 8066, GetProgramLocalParameterfvARB_remap_index }, - { 18376, GetProgramStringARB_remap_index }, - { 27472, GetProgramivARB_remap_index }, - { 20425, GetVertexAttribdvARB_remap_index }, - { 16034, GetVertexAttribfvARB_remap_index }, - { 9765, GetVertexAttribivARB_remap_index }, - { 19289, ProgramEnvParameter4dARB_remap_index }, - { 25072, ProgramEnvParameter4dvARB_remap_index }, - { 16770, ProgramEnvParameter4fARB_remap_index }, - { 8965, ProgramEnvParameter4fvARB_remap_index }, - { 3947, ProgramLocalParameter4dARB_remap_index }, - { 13021, ProgramLocalParameter4dvARB_remap_index }, - { 29205, ProgramLocalParameter4fARB_remap_index }, - { 25675, ProgramLocalParameter4fvARB_remap_index }, - { 28094, ProgramStringARB_remap_index }, - { 19539, VertexAttrib1dARB_remap_index }, - { 15688, VertexAttrib1dvARB_remap_index }, - { 4122, VertexAttrib1fARB_remap_index }, - { 32632, VertexAttrib1fvARB_remap_index }, - { 7150, VertexAttrib1sARB_remap_index }, - { 2224, VertexAttrib1svARB_remap_index }, - { 15119, VertexAttrib2dARB_remap_index }, - { 17469, VertexAttrib2dvARB_remap_index }, - { 1596, VertexAttrib2fARB_remap_index }, - { 17582, VertexAttrib2fvARB_remap_index }, - { 32258, VertexAttrib2sARB_remap_index }, - { 31319, VertexAttrib2svARB_remap_index }, - { 11268, VertexAttrib3dARB_remap_index }, - { 8632, VertexAttrib3dvARB_remap_index }, - { 1683, VertexAttrib3fARB_remap_index }, - { 22415, VertexAttrib3fvARB_remap_index }, - { 27941, VertexAttrib3sARB_remap_index }, - { 20167, VertexAttrib3svARB_remap_index }, - { 4895, VertexAttrib4NbvARB_remap_index }, - { 17805, VertexAttrib4NivARB_remap_index }, - { 22370, VertexAttrib4NsvARB_remap_index }, - { 23355, VertexAttrib4NubARB_remap_index }, - { 31565, VertexAttrib4NubvARB_remap_index }, - { 18950, VertexAttrib4NuivARB_remap_index }, - { 3136, VertexAttrib4NusvARB_remap_index }, - { 10846, VertexAttrib4bvARB_remap_index }, - { 26685, VertexAttrib4dARB_remap_index }, - { 21189, VertexAttrib4dvARB_remap_index }, - { 11422, VertexAttrib4fARB_remap_index }, - { 11826, VertexAttrib4fvARB_remap_index }, - { 10222, VertexAttrib4ivARB_remap_index }, - { 17262, VertexAttrib4sARB_remap_index }, - { 30754, VertexAttrib4svARB_remap_index }, - { 16575, VertexAttrib4ubvARB_remap_index }, - { 30050, VertexAttrib4uivARB_remap_index }, - { 19978, VertexAttrib4usvARB_remap_index }, - { 21967, VertexAttribPointerARB_remap_index }, - { 32392, BindBufferARB_remap_index }, - { 6857, BufferDataARB_remap_index }, - { 1498, BufferSubDataARB_remap_index }, - { 30331, DeleteBuffersARB_remap_index }, - { 32675, GenBuffersARB_remap_index }, - { 17625, GetBufferParameterivARB_remap_index }, - { 16722, GetBufferPointervARB_remap_index }, - { 1451, GetBufferSubDataARB_remap_index }, - { 29998, IsBufferARB_remap_index }, - { 26159, MapBufferARB_remap_index }, - { 30969, UnmapBufferARB_remap_index }, - { 312, BeginQueryARB_remap_index }, - { 19634, DeleteQueriesARB_remap_index }, - { 12153, EndQueryARB_remap_index }, - { 28819, GenQueriesARB_remap_index }, - { 1942, GetQueryObjectivARB_remap_index }, - { 17306, GetQueryObjectuivARB_remap_index }, - { 1740, GetQueryivARB_remap_index }, - { 19885, IsQueryARB_remap_index }, - { 8242, AttachObjectARB_remap_index }, - { 18487, CompileShaderARB_remap_index }, - { 3205, CreateProgramObjectARB_remap_index }, - { 6802, CreateShaderObjectARB_remap_index }, - { 14454, DeleteObjectARB_remap_index }, - { 23842, DetachObjectARB_remap_index }, - { 11898, GetActiveUniformARB_remap_index }, - { 9440, GetAttachedObjectsARB_remap_index }, - { 9747, GetHandleARB_remap_index }, - { 32425, GetInfoLogARB_remap_index }, - { 31636, GetObjectParameterfvARB_remap_index }, - { 27151, GetObjectParameterivARB_remap_index }, - { 28577, GetShaderSourceARB_remap_index }, - { 27801, GetUniformLocationARB_remap_index }, - { 23625, GetUniformfvARB_remap_index }, - { 12596, GetUniformivARB_remap_index }, - { 20023, LinkProgramARB_remap_index }, - { 20081, ShaderSourceARB_remap_index }, - { 7524, Uniform1fARB_remap_index }, - { 29414, Uniform1fvARB_remap_index }, - { 21936, Uniform1iARB_remap_index }, - { 20878, Uniform1ivARB_remap_index }, - { 2173, Uniform2fARB_remap_index }, - { 14290, Uniform2fvARB_remap_index }, - { 26046, Uniform2iARB_remap_index }, - { 2293, Uniform2ivARB_remap_index }, - { 18597, Uniform3fARB_remap_index }, - { 9470, Uniform3fvARB_remap_index }, - { 6396, Uniform3iARB_remap_index }, - { 16828, Uniform3ivARB_remap_index }, - { 19095, Uniform4fARB_remap_index }, - { 23489, Uniform4fvARB_remap_index }, - { 24751, Uniform4iARB_remap_index }, - { 20391, Uniform4ivARB_remap_index }, - { 8294, UniformMatrix2fvARB_remap_index }, + { 1616, AttachShader_remap_index }, + { 9872, CreateProgram_remap_index }, + { 22867, CreateShader_remap_index }, + { 25325, DeleteProgram_remap_index }, + { 18511, DeleteShader_remap_index }, + { 23339, DetachShader_remap_index }, + { 17914, GetAttachedShaders_remap_index }, + { 4856, GetProgramInfoLog_remap_index }, + { 444, GetProgramiv_remap_index }, + { 6529, GetShaderInfoLog_remap_index }, + { 30994, GetShaderiv_remap_index }, + { 13335, IsProgram_remap_index }, + { 12287, IsShader_remap_index }, + { 10002, StencilFuncSeparate_remap_index }, + { 3960, StencilMaskSeparate_remap_index }, + { 7594, StencilOpSeparate_remap_index }, + { 22155, UniformMatrix2x3fv_remap_index }, + { 2886, UniformMatrix2x4fv_remap_index }, + { 32667, UniformMatrix3x2fv_remap_index }, + { 30316, UniformMatrix3x4fv_remap_index }, + { 16212, UniformMatrix4x2fv_remap_index }, + { 3302, UniformMatrix4x3fv_remap_index }, + { 5017, ClampColor_remap_index }, + { 17968, ClearBufferfi_remap_index }, + { 17434, ClearBufferfv_remap_index }, + { 29339, ClearBufferiv_remap_index }, + { 13540, ClearBufferuiv_remap_index }, + { 19794, GetStringi_remap_index }, + { 2827, TexBuffer_remap_index }, + { 977, FramebufferTexture_remap_index }, + { 26351, GetBufferParameteri64v_remap_index }, + { 10102, GetInteger64i_v_remap_index }, + { 23181, VertexAttribDivisor_remap_index }, + { 9890, LoadTransposeMatrixdARB_remap_index }, + { 30723, LoadTransposeMatrixfARB_remap_index }, + { 5637, MultTransposeMatrixdARB_remap_index }, + { 23526, MultTransposeMatrixfARB_remap_index }, + { 255, SampleCoverageARB_remap_index }, + { 5821, CompressedTexImage1DARB_remap_index }, + { 24054, CompressedTexImage2DARB_remap_index }, + { 4023, CompressedTexImage3DARB_remap_index }, + { 18228, CompressedTexSubImage1DARB_remap_index }, + { 2089, CompressedTexSubImage2DARB_remap_index }, + { 20216, CompressedTexSubImage3DARB_remap_index }, + { 28495, GetCompressedTexImageARB_remap_index }, + { 3868, DisableVertexAttribArrayARB_remap_index }, + { 29881, EnableVertexAttribArrayARB_remap_index }, + { 31798, GetProgramEnvParameterdvARB_remap_index }, + { 23406, GetProgramEnvParameterfvARB_remap_index }, + { 27380, GetProgramLocalParameterdvARB_remap_index }, + { 8036, GetProgramLocalParameterfvARB_remap_index }, + { 18362, GetProgramStringARB_remap_index }, + { 27575, GetProgramivARB_remap_index }, + { 20411, GetVertexAttribdvARB_remap_index }, + { 16020, GetVertexAttribfvARB_remap_index }, + { 9735, GetVertexAttribivARB_remap_index }, + { 19275, ProgramEnvParameter4dARB_remap_index }, + { 25075, ProgramEnvParameter4dvARB_remap_index }, + { 16756, ProgramEnvParameter4fARB_remap_index }, + { 8935, ProgramEnvParameter4fvARB_remap_index }, + { 3986, ProgramLocalParameter4dARB_remap_index }, + { 13045, ProgramLocalParameter4dvARB_remap_index }, + { 29360, ProgramLocalParameter4fARB_remap_index }, + { 25711, ProgramLocalParameter4fvARB_remap_index }, + { 28249, ProgramStringARB_remap_index }, + { 19525, VertexAttrib1dARB_remap_index }, + { 15674, VertexAttrib1dvARB_remap_index }, + { 4161, VertexAttrib1fARB_remap_index }, + { 32748, VertexAttrib1fvARB_remap_index }, + { 7120, VertexAttrib1sARB_remap_index }, + { 2263, VertexAttrib1svARB_remap_index }, + { 15105, VertexAttrib2dARB_remap_index }, + { 17455, VertexAttrib2dvARB_remap_index }, + { 1635, VertexAttrib2fARB_remap_index }, + { 17568, VertexAttrib2fvARB_remap_index }, + { 32374, VertexAttrib2sARB_remap_index }, + { 31435, VertexAttrib2svARB_remap_index }, + { 11253, VertexAttrib3dARB_remap_index }, + { 8602, VertexAttrib3dvARB_remap_index }, + { 1722, VertexAttrib3fARB_remap_index }, + { 22418, VertexAttrib3fvARB_remap_index }, + { 28096, VertexAttrib3sARB_remap_index }, + { 20153, VertexAttrib3svARB_remap_index }, + { 4882, VertexAttrib4NbvARB_remap_index }, + { 17791, VertexAttrib4NivARB_remap_index }, + { 22373, VertexAttrib4NsvARB_remap_index }, + { 23358, VertexAttrib4NubARB_remap_index }, + { 31681, VertexAttrib4NubvARB_remap_index }, + { 18936, VertexAttrib4NuivARB_remap_index }, + { 3175, VertexAttrib4NusvARB_remap_index }, + { 10842, VertexAttrib4bvARB_remap_index }, + { 26753, VertexAttrib4dARB_remap_index }, + { 21175, VertexAttrib4dvARB_remap_index }, + { 11407, VertexAttrib4fARB_remap_index }, + { 11811, VertexAttrib4fvARB_remap_index }, + { 10218, VertexAttrib4ivARB_remap_index }, + { 17248, VertexAttrib4sARB_remap_index }, + { 30909, VertexAttrib4svARB_remap_index }, + { 16561, VertexAttrib4ubvARB_remap_index }, + { 30205, VertexAttrib4uivARB_remap_index }, + { 19964, VertexAttrib4usvARB_remap_index }, + { 21970, VertexAttribPointerARB_remap_index }, + { 32508, BindBufferARB_remap_index }, + { 6827, BufferDataARB_remap_index }, + { 1537, BufferSubDataARB_remap_index }, + { 30486, DeleteBuffersARB_remap_index }, + { 32791, GenBuffersARB_remap_index }, + { 17611, GetBufferParameterivARB_remap_index }, + { 16708, GetBufferPointervARB_remap_index }, + { 1490, GetBufferSubDataARB_remap_index }, + { 30153, IsBufferARB_remap_index }, + { 26195, MapBufferARB_remap_index }, + { 31124, UnmapBufferARB_remap_index }, + { 351, BeginQueryARB_remap_index }, + { 19620, DeleteQueriesARB_remap_index }, + { 12138, EndQueryARB_remap_index }, + { 28974, GenQueriesARB_remap_index }, + { 1981, GetQueryObjectivARB_remap_index }, + { 17292, GetQueryObjectuivARB_remap_index }, + { 1779, GetQueryivARB_remap_index }, + { 19871, IsQueryARB_remap_index }, + { 8212, AttachObjectARB_remap_index }, + { 18473, CompileShaderARB_remap_index }, + { 3244, CreateProgramObjectARB_remap_index }, + { 6772, CreateShaderObjectARB_remap_index }, + { 14407, DeleteObjectARB_remap_index }, + { 23845, DetachObjectARB_remap_index }, + { 11883, GetActiveUniformARB_remap_index }, + { 9410, GetAttachedObjectsARB_remap_index }, + { 9717, GetHandleARB_remap_index }, + { 32541, GetInfoLogARB_remap_index }, + { 31752, GetObjectParameterfvARB_remap_index }, + { 27254, GetObjectParameterivARB_remap_index }, + { 28732, GetShaderSourceARB_remap_index }, + { 27956, GetUniformLocationARB_remap_index }, + { 23628, GetUniformfvARB_remap_index }, + { 12620, GetUniformivARB_remap_index }, + { 20009, LinkProgramARB_remap_index }, + { 20067, ShaderSourceARB_remap_index }, + { 7494, Uniform1fARB_remap_index }, + { 29569, Uniform1fvARB_remap_index }, + { 21939, Uniform1iARB_remap_index }, + { 20864, Uniform1ivARB_remap_index }, + { 2212, Uniform2fARB_remap_index }, + { 14243, Uniform2fvARB_remap_index }, + { 26082, Uniform2iARB_remap_index }, + { 2332, Uniform2ivARB_remap_index }, + { 18583, Uniform3fARB_remap_index }, + { 9440, Uniform3fvARB_remap_index }, + { 6383, Uniform3iARB_remap_index }, + { 16814, Uniform3ivARB_remap_index }, + { 19081, Uniform4fARB_remap_index }, + { 23492, Uniform4fvARB_remap_index }, + { 24754, Uniform4iARB_remap_index }, + { 20377, Uniform4ivARB_remap_index }, + { 8264, UniformMatrix2fvARB_remap_index }, { 17, UniformMatrix3fvARB_remap_index }, - { 2690, UniformMatrix4fvARB_remap_index }, - { 25184, UseProgramObjectARB_remap_index }, - { 14807, ValidateProgramARB_remap_index }, - { 21232, BindAttribLocationARB_remap_index }, - { 4940, GetActiveAttribARB_remap_index }, - { 16509, GetAttribLocationARB_remap_index }, - { 29132, DrawBuffersARB_remap_index }, - { 17850, DrawArraysInstancedARB_remap_index }, - { 6457, DrawElementsInstancedARB_remap_index }, - { 13126, RenderbufferStorageMultisample_remap_index }, - { 13597, FramebufferTextureARB_remap_index }, - { 25577, FramebufferTextureFaceARB_remap_index }, - { 23991, ProgramParameteriARB_remap_index }, - { 19143, FlushMappedBufferRange_remap_index }, - { 27568, MapBufferRange_remap_index }, - { 16337, BindVertexArray_remap_index }, - { 14630, GenVertexArrays_remap_index }, - { 29928, CopyBufferSubData_remap_index }, - { 30858, ClientWaitSync_remap_index }, - { 2609, DeleteSync_remap_index }, - { 7191, FenceSync_remap_index }, - { 15178, GetInteger64v_remap_index }, - { 22477, GetSynciv_remap_index }, - { 29071, IsSync_remap_index }, - { 9388, WaitSync_remap_index }, - { 3797, DrawElementsBaseVertex_remap_index }, - { 30263, DrawRangeElementsBaseVertex_remap_index }, - { 26190, MultiDrawElementsBaseVertex_remap_index }, - { 5091, BindTransformFeedback_remap_index }, - { 3232, DeleteTransformFeedbacks_remap_index }, - { 6429, DrawTransformFeedback_remap_index }, - { 9607, GenTransformFeedbacks_remap_index }, - { 27984, IsTransformFeedback_remap_index }, - { 25770, PauseTransformFeedback_remap_index }, - { 5528, ResumeTransformFeedback_remap_index }, - { 5396, PolygonOffsetEXT_remap_index }, - { 23099, GetPixelTexGenParameterfvSGIS_remap_index }, - { 4417, GetPixelTexGenParameterivSGIS_remap_index }, - { 22832, PixelTexGenParameterfSGIS_remap_index }, - { 624, PixelTexGenParameterfvSGIS_remap_index }, - { 12634, PixelTexGenParameteriSGIS_remap_index }, - { 13771, PixelTexGenParameterivSGIS_remap_index }, - { 16425, SampleMaskSGIS_remap_index }, - { 19825, SamplePatternSGIS_remap_index }, - { 26119, ColorPointerEXT_remap_index }, - { 17512, EdgeFlagPointerEXT_remap_index }, - { 6050, IndexPointerEXT_remap_index }, - { 6130, NormalPointerEXT_remap_index }, - { 15772, TexCoordPointerEXT_remap_index }, - { 6980, VertexPointerEXT_remap_index }, - { 3599, PointParameterfEXT_remap_index }, - { 7831, PointParameterfvEXT_remap_index }, - { 31734, LockArraysEXT_remap_index }, - { 14871, UnlockArraysEXT_remap_index }, - { 1267, SecondaryColor3bEXT_remap_index }, - { 7990, SecondaryColor3bvEXT_remap_index }, - { 10399, SecondaryColor3dEXT_remap_index }, - { 25380, SecondaryColor3dvEXT_remap_index }, - { 27850, SecondaryColor3fEXT_remap_index }, - { 18178, SecondaryColor3fvEXT_remap_index }, - { 470, SecondaryColor3iEXT_remap_index }, - { 16082, SecondaryColor3ivEXT_remap_index }, - { 10034, SecondaryColor3sEXT_remap_index }, - { 30522, SecondaryColor3svEXT_remap_index }, - { 26987, SecondaryColor3ubEXT_remap_index }, - { 21123, SecondaryColor3ubvEXT_remap_index }, - { 12876, SecondaryColor3uiEXT_remap_index }, - { 22719, SecondaryColor3uivEXT_remap_index }, - { 25627, SecondaryColor3usEXT_remap_index }, - { 12949, SecondaryColor3usvEXT_remap_index }, - { 11769, SecondaryColorPointerEXT_remap_index }, - { 25441, MultiDrawArraysEXT_remap_index }, - { 20813, MultiDrawElementsEXT_remap_index }, - { 21008, FogCoordPointerEXT_remap_index }, - { 4566, FogCoorddEXT_remap_index }, - { 31135, FogCoorddvEXT_remap_index }, - { 4683, FogCoordfEXT_remap_index }, - { 26910, FogCoordfvEXT_remap_index }, - { 19047, PixelTexGenSGIX_remap_index }, - { 27495, BlendFuncSeparateEXT_remap_index }, - { 6892, FlushVertexArrayRangeNV_remap_index }, - { 5345, VertexArrayRangeNV_remap_index }, - { 27915, CombinerInputNV_remap_index }, - { 2116, CombinerOutputNV_remap_index }, - { 30675, CombinerParameterfNV_remap_index }, - { 5219, CombinerParameterfvNV_remap_index }, - { 22201, CombinerParameteriNV_remap_index }, - { 32150, CombinerParameterivNV_remap_index }, - { 7268, FinalCombinerInputNV_remap_index }, - { 9813, GetCombinerInputParameterfvNV_remap_index }, - { 31987, GetCombinerInputParameterivNV_remap_index }, - { 13872, GetCombinerOutputParameterfvNV_remap_index }, - { 13700, GetCombinerOutputParameterivNV_remap_index }, - { 6637, GetFinalCombinerInputParameterfvNV_remap_index }, - { 24623, GetFinalCombinerInputParameterivNV_remap_index }, - { 12574, ResizeBuffersMESA_remap_index }, - { 11095, WindowPos2dMESA_remap_index }, - { 1060, WindowPos2dvMESA_remap_index }, - { 32978, WindowPos2fMESA_remap_index }, - { 7935, WindowPos2fvMESA_remap_index }, - { 18125, WindowPos2iMESA_remap_index }, - { 20298, WindowPos2ivMESA_remap_index }, - { 20912, WindowPos2sMESA_remap_index }, - { 5748, WindowPos2svMESA_remap_index }, - { 7760, WindowPos3dMESA_remap_index }, - { 14018, WindowPos3dvMESA_remap_index }, - { 516, WindowPos3fMESA_remap_index }, - { 14932, WindowPos3fvMESA_remap_index }, - { 23884, WindowPos3iMESA_remap_index }, - { 29873, WindowPos3ivMESA_remap_index }, - { 18742, WindowPos3sMESA_remap_index }, - { 31391, WindowPos3svMESA_remap_index }, - { 11046, WindowPos4dMESA_remap_index }, - { 16966, WindowPos4dvMESA_remap_index }, - { 13977, WindowPos4fMESA_remap_index }, - { 30429, WindowPos4fvMESA_remap_index }, - { 30026, WindowPos4iMESA_remap_index }, - { 12377, WindowPos4ivMESA_remap_index }, - { 18926, WindowPos4sMESA_remap_index }, - { 3183, WindowPos4svMESA_remap_index }, - { 13739, MultiModeDrawArraysIBM_remap_index }, - { 28690, MultiModeDrawElementsIBM_remap_index }, - { 12181, DeleteFencesNV_remap_index }, - { 27762, FinishFenceNV_remap_index }, - { 3721, GenFencesNV_remap_index }, - { 16946, GetFenceivNV_remap_index }, - { 8227, IsFenceNV_remap_index }, - { 13627, SetFenceNV_remap_index }, - { 4178, TestFenceNV_remap_index }, - { 31362, AreProgramsResidentNV_remap_index }, - { 30717, BindProgramNV_remap_index }, - { 25710, DeleteProgramsNV_remap_index }, - { 21341, ExecuteProgramNV_remap_index }, - { 32871, GenProgramsNV_remap_index }, - { 23204, GetProgramParameterdvNV_remap_index }, - { 10461, GetProgramParameterfvNV_remap_index }, - { 26093, GetProgramStringNV_remap_index }, - { 24261, GetProgramivNV_remap_index }, - { 23438, GetTrackMatrixivNV_remap_index }, - { 25887, GetVertexAttribPointervNV_remap_index }, - { 24556, GetVertexAttribdvNV_remap_index }, - { 9283, GetVertexAttribfvNV_remap_index }, - { 18349, GetVertexAttribivNV_remap_index }, - { 19173, IsProgramNV_remap_index }, - { 9366, LoadProgramNV_remap_index }, - { 27591, ProgramParameters4dvNV_remap_index }, - { 24191, ProgramParameters4fvNV_remap_index }, - { 20602, RequestResidentProgramsNV_remap_index }, - { 22179, TrackMatrixNV_remap_index }, - { 31964, VertexAttrib1dNV_remap_index }, - { 13538, VertexAttrib1dvNV_remap_index }, - { 28196, VertexAttrib1fNV_remap_index }, - { 2415, VertexAttrib1fvNV_remap_index }, - { 30486, VertexAttrib1sNV_remap_index }, - { 15005, VertexAttrib1svNV_remap_index }, - { 4845, VertexAttrib2dNV_remap_index }, - { 13431, VertexAttrib2dvNV_remap_index }, - { 20057, VertexAttrib2fNV_remap_index }, - { 12997, VertexAttrib2fvNV_remap_index }, - { 5960, VertexAttrib2sNV_remap_index }, - { 18796, VertexAttrib2svNV_remap_index }, - { 11243, VertexAttrib3dNV_remap_index }, - { 31612, VertexAttrib3dvNV_remap_index }, - { 10273, VertexAttrib3fNV_remap_index }, - { 24583, VertexAttrib3fvNV_remap_index }, - { 22022, VertexAttrib3sNV_remap_index }, - { 23465, VertexAttrib3svNV_remap_index }, - { 28664, VertexAttrib4dNV_remap_index }, - { 32908, VertexAttrib4dvNV_remap_index }, - { 4467, VertexAttrib4fNV_remap_index }, - { 9416, VertexAttrib4fvNV_remap_index }, - { 26569, VertexAttrib4sNV_remap_index }, - { 1409, VertexAttrib4svNV_remap_index }, - { 5003, VertexAttrib4ubNV_remap_index }, - { 778, VertexAttrib4ubvNV_remap_index }, - { 21521, VertexAttribPointerNV_remap_index }, - { 2267, VertexAttribs1dvNV_remap_index }, - { 25975, VertexAttribs1fvNV_remap_index }, - { 32708, VertexAttribs1svNV_remap_index }, - { 10298, VertexAttribs2dvNV_remap_index }, - { 25145, VertexAttribs2fvNV_remap_index }, - { 17538, VertexAttribs2svNV_remap_index }, - { 5247, VertexAttribs3dvNV_remap_index }, - { 2147, VertexAttribs3fvNV_remap_index }, - { 29621, VertexAttribs3svNV_remap_index }, - { 26659, VertexAttribs4dvNV_remap_index }, - { 5319, VertexAttribs4fvNV_remap_index }, - { 32495, VertexAttribs4svNV_remap_index }, - { 29369, VertexAttribs4ubvNV_remap_index }, - { 26729, GetTexBumpParameterfvATI_remap_index }, - { 32749, GetTexBumpParameterivATI_remap_index }, - { 18459, TexBumpParameterfvATI_remap_index }, - { 20473, TexBumpParameterivATI_remap_index }, - { 15551, AlphaFragmentOp1ATI_remap_index }, - { 10889, AlphaFragmentOp2ATI_remap_index }, - { 24499, AlphaFragmentOp3ATI_remap_index }, - { 29548, BeginFragmentShaderATI_remap_index }, - { 30916, BindFragmentShaderATI_remap_index }, - { 23594, ColorFragmentOp1ATI_remap_index }, - { 4345, ColorFragmentOp2ATI_remap_index }, - { 31257, ColorFragmentOp3ATI_remap_index }, - { 5485, DeleteFragmentShaderATI_remap_index }, - { 32932, EndFragmentShaderATI_remap_index }, - { 32178, GenFragmentShadersATI_remap_index }, - { 25299, PassTexCoordATI_remap_index }, - { 6960, SampleMapATI_remap_index }, - { 6733, SetFragmentShaderConstantATI_remap_index }, - { 363, PointParameteriNV_remap_index }, - { 14179, PointParameterivNV_remap_index }, - { 28503, ActiveStencilFaceEXT_remap_index }, - { 27251, BindVertexArrayAPPLE_remap_index }, - { 2737, DeleteVertexArraysAPPLE_remap_index }, - { 17955, GenVertexArraysAPPLE_remap_index }, - { 23269, IsVertexArrayAPPLE_remap_index }, - { 819, GetProgramNamedParameterdvNV_remap_index }, - { 3562, GetProgramNamedParameterfvNV_remap_index }, - { 26760, ProgramNamedParameter4dNV_remap_index }, - { 14505, ProgramNamedParameter4dvNV_remap_index }, - { 8899, ProgramNamedParameter4fNV_remap_index }, - { 11734, ProgramNamedParameter4fvNV_remap_index }, - { 16877, PrimitiveRestartIndexNV_remap_index }, - { 30406, PrimitiveRestartNV_remap_index }, - { 24170, DepthBoundsEXT_remap_index }, - { 1159, BlendEquationSeparateEXT_remap_index }, - { 14706, BindFramebufferEXT_remap_index }, - { 25486, BindRenderbufferEXT_remap_index }, - { 9663, CheckFramebufferStatusEXT_remap_index }, - { 22520, DeleteFramebuffersEXT_remap_index }, - { 31514, DeleteRenderbuffersEXT_remap_index }, - { 13455, FramebufferRenderbufferEXT_remap_index }, - { 13644, FramebufferTexture1DEXT_remap_index }, - { 11528, FramebufferTexture2DEXT_remap_index }, - { 11148, FramebufferTexture3DEXT_remap_index }, - { 23135, GenFramebuffersEXT_remap_index }, - { 17403, GenRenderbuffersEXT_remap_index }, - { 6679, GenerateMipmapEXT_remap_index }, - { 21597, GetFramebufferAttachmentParameterivEXT_remap_index }, - { 32084, GetRenderbufferParameterivEXT_remap_index }, - { 20353, IsFramebufferEXT_remap_index }, - { 32831, IsRenderbufferEXT_remap_index }, - { 8174, RenderbufferStorageEXT_remap_index }, - { 695, BlitFramebufferEXT_remap_index }, - { 14324, BufferParameteriAPPLE_remap_index }, - { 19205, FlushMappedBufferRangeAPPLE_remap_index }, - { 1815, BindFragDataLocationEXT_remap_index }, - { 24283, GetFragDataLocationEXT_remap_index }, - { 10576, GetUniformuivEXT_remap_index }, - { 2933, GetVertexAttribIivEXT_remap_index }, - { 4195, GetVertexAttribIuivEXT_remap_index }, - { 12014, Uniform1uiEXT_remap_index }, - { 27676, Uniform1uivEXT_remap_index }, - { 22118, Uniform2uiEXT_remap_index }, - { 4309, Uniform2uivEXT_remap_index }, - { 28943, Uniform3uiEXT_remap_index }, - { 14652, Uniform3uivEXT_remap_index }, - { 3486, Uniform4uiEXT_remap_index }, - { 8675, Uniform4uivEXT_remap_index }, - { 18306, VertexAttribI1iEXT_remap_index }, - { 965, VertexAttribI1ivEXT_remap_index }, - { 2516, VertexAttribI1uiEXT_remap_index }, - { 12725, VertexAttribI1uivEXT_remap_index }, + { 2729, UniformMatrix4fvARB_remap_index }, + { 25187, UseProgramObjectARB_remap_index }, + { 14793, ValidateProgramARB_remap_index }, + { 21218, BindAttribLocationARB_remap_index }, + { 4927, GetActiveAttribARB_remap_index }, + { 16495, GetAttribLocationARB_remap_index }, + { 29287, DrawBuffersARB_remap_index }, + { 17836, DrawArraysInstancedARB_remap_index }, + { 6444, DrawElementsInstancedARB_remap_index }, + { 13150, RenderbufferStorageMultisample_remap_index }, + { 13621, FramebufferTextureARB_remap_index }, + { 25613, FramebufferTextureFaceARB_remap_index }, + { 23994, ProgramParameteriARB_remap_index }, + { 19129, FlushMappedBufferRange_remap_index }, + { 27671, MapBufferRange_remap_index }, + { 16323, BindVertexArray_remap_index }, + { 14616, GenVertexArrays_remap_index }, + { 30083, CopyBufferSubData_remap_index }, + { 31013, ClientWaitSync_remap_index }, + { 2648, DeleteSync_remap_index }, + { 7161, FenceSync_remap_index }, + { 15164, GetInteger64v_remap_index }, + { 22480, GetSynciv_remap_index }, + { 29226, IsSync_remap_index }, + { 9358, WaitSync_remap_index }, + { 3836, DrawElementsBaseVertex_remap_index }, + { 30418, DrawRangeElementsBaseVertex_remap_index }, + { 26226, MultiDrawElementsBaseVertex_remap_index }, + { 5078, BindTransformFeedback_remap_index }, + { 3271, DeleteTransformFeedbacks_remap_index }, + { 6416, DrawTransformFeedback_remap_index }, + { 9577, GenTransformFeedbacks_remap_index }, + { 28139, IsTransformFeedback_remap_index }, + { 25806, PauseTransformFeedback_remap_index }, + { 5557, ResumeTransformFeedback_remap_index }, + { 21538, ClearDepthf_remap_index }, + { 6720, DepthRangef_remap_index }, + { 14428, GetShaderPrecisionFormat_remap_index }, + { 9942, ReleaseShaderCompiler_remap_index }, + { 10885, ShaderBinary_remap_index }, + { 5425, PolygonOffsetEXT_remap_index }, + { 23102, GetPixelTexGenParameterfvSGIS_remap_index }, + { 4404, GetPixelTexGenParameterivSGIS_remap_index }, + { 22835, PixelTexGenParameterfSGIS_remap_index }, + { 663, PixelTexGenParameterfvSGIS_remap_index }, + { 12658, PixelTexGenParameteriSGIS_remap_index }, + { 13763, PixelTexGenParameterivSGIS_remap_index }, + { 16411, SampleMaskSGIS_remap_index }, + { 19811, SamplePatternSGIS_remap_index }, + { 26155, ColorPointerEXT_remap_index }, + { 17498, EdgeFlagPointerEXT_remap_index }, + { 6037, IndexPointerEXT_remap_index }, + { 6117, NormalPointerEXT_remap_index }, + { 15758, TexCoordPointerEXT_remap_index }, + { 6950, VertexPointerEXT_remap_index }, + { 3638, PointParameterfEXT_remap_index }, + { 7801, PointParameterfvEXT_remap_index }, + { 31850, LockArraysEXT_remap_index }, + { 14857, UnlockArraysEXT_remap_index }, + { 1306, SecondaryColor3bEXT_remap_index }, + { 7960, SecondaryColor3bvEXT_remap_index }, + { 10395, SecondaryColor3dEXT_remap_index }, + { 25383, SecondaryColor3dvEXT_remap_index }, + { 28005, SecondaryColor3fEXT_remap_index }, + { 18164, SecondaryColor3fvEXT_remap_index }, + { 509, SecondaryColor3iEXT_remap_index }, + { 16068, SecondaryColor3ivEXT_remap_index }, + { 10030, SecondaryColor3sEXT_remap_index }, + { 30677, SecondaryColor3svEXT_remap_index }, + { 27090, SecondaryColor3ubEXT_remap_index }, + { 21109, SecondaryColor3ubvEXT_remap_index }, + { 12900, SecondaryColor3uiEXT_remap_index }, + { 22722, SecondaryColor3uivEXT_remap_index }, + { 25663, SecondaryColor3usEXT_remap_index }, + { 12973, SecondaryColor3usvEXT_remap_index }, + { 11754, SecondaryColorPointerEXT_remap_index }, + { 25477, MultiDrawArraysEXT_remap_index }, + { 20799, MultiDrawElementsEXT_remap_index }, + { 20994, FogCoordPointerEXT_remap_index }, + { 4553, FogCoorddEXT_remap_index }, + { 31251, FogCoorddvEXT_remap_index }, + { 4670, FogCoordfEXT_remap_index }, + { 27013, FogCoordfvEXT_remap_index }, + { 19033, PixelTexGenSGIX_remap_index }, + { 27598, BlendFuncSeparateEXT_remap_index }, + { 6862, FlushVertexArrayRangeNV_remap_index }, + { 5374, VertexArrayRangeNV_remap_index }, + { 28070, CombinerInputNV_remap_index }, + { 2155, CombinerOutputNV_remap_index }, + { 30830, CombinerParameterfNV_remap_index }, + { 5248, CombinerParameterfvNV_remap_index }, + { 22204, CombinerParameteriNV_remap_index }, + { 32266, CombinerParameterivNV_remap_index }, + { 7238, FinalCombinerInputNV_remap_index }, + { 9783, GetCombinerInputParameterfvNV_remap_index }, + { 32103, GetCombinerInputParameterivNV_remap_index }, + { 216, GetCombinerOutputParameterfvNV_remap_index }, + { 13724, GetCombinerOutputParameterivNV_remap_index }, + { 6624, GetFinalCombinerInputParameterfvNV_remap_index }, + { 24626, GetFinalCombinerInputParameterivNV_remap_index }, + { 12598, ResizeBuffersMESA_remap_index }, + { 11080, WindowPos2dMESA_remap_index }, + { 1099, WindowPos2dvMESA_remap_index }, + { 33094, WindowPos2fMESA_remap_index }, + { 7905, WindowPos2fvMESA_remap_index }, + { 18111, WindowPos2iMESA_remap_index }, + { 20284, WindowPos2ivMESA_remap_index }, + { 20898, WindowPos2sMESA_remap_index }, + { 5735, WindowPos2svMESA_remap_index }, + { 7730, WindowPos3dMESA_remap_index }, + { 13971, WindowPos3dvMESA_remap_index }, + { 555, WindowPos3fMESA_remap_index }, + { 14918, WindowPos3fvMESA_remap_index }, + { 23887, WindowPos3iMESA_remap_index }, + { 30028, WindowPos3ivMESA_remap_index }, + { 18728, WindowPos3sMESA_remap_index }, + { 31507, WindowPos3svMESA_remap_index }, + { 11031, WindowPos4dMESA_remap_index }, + { 16952, WindowPos4dvMESA_remap_index }, + { 13930, WindowPos4fMESA_remap_index }, + { 30584, WindowPos4fvMESA_remap_index }, + { 30181, WindowPos4iMESA_remap_index }, + { 12401, WindowPos4ivMESA_remap_index }, + { 18912, WindowPos4sMESA_remap_index }, + { 3222, WindowPos4svMESA_remap_index }, + { 26721, MultiModeDrawArraysIBM_remap_index }, + { 28845, MultiModeDrawElementsIBM_remap_index }, + { 12166, DeleteFencesNV_remap_index }, + { 27917, FinishFenceNV_remap_index }, + { 3760, GenFencesNV_remap_index }, + { 16932, GetFenceivNV_remap_index }, + { 8197, IsFenceNV_remap_index }, + { 13651, SetFenceNV_remap_index }, + { 4217, TestFenceNV_remap_index }, + { 31478, AreProgramsResidentNV_remap_index }, + { 30872, BindProgramNV_remap_index }, + { 25746, DeleteProgramsNV_remap_index }, + { 21327, ExecuteProgramNV_remap_index }, + { 32987, GenProgramsNV_remap_index }, + { 23207, GetProgramParameterdvNV_remap_index }, + { 10457, GetProgramParameterfvNV_remap_index }, + { 26129, GetProgramStringNV_remap_index }, + { 24264, GetProgramivNV_remap_index }, + { 23441, GetTrackMatrixivNV_remap_index }, + { 25923, GetVertexAttribPointervNV_remap_index }, + { 24559, GetVertexAttribdvNV_remap_index }, + { 9253, GetVertexAttribfvNV_remap_index }, + { 18335, GetVertexAttribivNV_remap_index }, + { 19159, IsProgramNV_remap_index }, + { 9336, LoadProgramNV_remap_index }, + { 27694, ProgramParameters4dvNV_remap_index }, + { 24194, ProgramParameters4fvNV_remap_index }, + { 20588, RequestResidentProgramsNV_remap_index }, + { 22182, TrackMatrixNV_remap_index }, + { 32080, VertexAttrib1dNV_remap_index }, + { 13562, VertexAttrib1dvNV_remap_index }, + { 28351, VertexAttrib1fNV_remap_index }, + { 2454, VertexAttrib1fvNV_remap_index }, + { 30641, VertexAttrib1sNV_remap_index }, + { 14991, VertexAttrib1svNV_remap_index }, + { 4832, VertexAttrib2dNV_remap_index }, + { 13455, VertexAttrib2dvNV_remap_index }, + { 20043, VertexAttrib2fNV_remap_index }, + { 13021, VertexAttrib2fvNV_remap_index }, + { 5947, VertexAttrib2sNV_remap_index }, + { 18782, VertexAttrib2svNV_remap_index }, + { 11228, VertexAttrib3dNV_remap_index }, + { 31728, VertexAttrib3dvNV_remap_index }, + { 10269, VertexAttrib3fNV_remap_index }, + { 24586, VertexAttrib3fvNV_remap_index }, + { 22025, VertexAttrib3sNV_remap_index }, + { 23468, VertexAttrib3svNV_remap_index }, + { 28819, VertexAttrib4dNV_remap_index }, + { 33024, VertexAttrib4dvNV_remap_index }, + { 4454, VertexAttrib4fNV_remap_index }, + { 9386, VertexAttrib4fvNV_remap_index }, + { 26605, VertexAttrib4sNV_remap_index }, + { 1448, VertexAttrib4svNV_remap_index }, + { 4990, VertexAttrib4ubNV_remap_index }, + { 817, VertexAttrib4ubvNV_remap_index }, + { 21507, VertexAttribPointerNV_remap_index }, + { 2306, VertexAttribs1dvNV_remap_index }, + { 26011, VertexAttribs1fvNV_remap_index }, + { 32824, VertexAttribs1svNV_remap_index }, + { 10294, VertexAttribs2dvNV_remap_index }, + { 25148, VertexAttribs2fvNV_remap_index }, + { 17524, VertexAttribs2svNV_remap_index }, + { 5276, VertexAttribs3dvNV_remap_index }, + { 2186, VertexAttribs3fvNV_remap_index }, + { 29776, VertexAttribs3svNV_remap_index }, + { 26695, VertexAttribs4dvNV_remap_index }, + { 5348, VertexAttribs4fvNV_remap_index }, + { 32611, VertexAttribs4svNV_remap_index }, + { 29524, VertexAttribs4ubvNV_remap_index }, + { 26797, GetTexBumpParameterfvATI_remap_index }, + { 32865, GetTexBumpParameterivATI_remap_index }, + { 18445, TexBumpParameterfvATI_remap_index }, + { 20459, TexBumpParameterivATI_remap_index }, + { 15537, AlphaFragmentOp1ATI_remap_index }, + { 25429, AlphaFragmentOp2ATI_remap_index }, + { 24502, AlphaFragmentOp3ATI_remap_index }, + { 29703, BeginFragmentShaderATI_remap_index }, + { 31071, BindFragmentShaderATI_remap_index }, + { 23597, ColorFragmentOp1ATI_remap_index }, + { 4332, ColorFragmentOp2ATI_remap_index }, + { 31373, ColorFragmentOp3ATI_remap_index }, + { 5514, DeleteFragmentShaderATI_remap_index }, + { 33048, EndFragmentShaderATI_remap_index }, + { 32294, GenFragmentShadersATI_remap_index }, + { 25302, PassTexCoordATI_remap_index }, + { 6930, SampleMapATI_remap_index }, + { 26908, SetFragmentShaderConstantATI_remap_index }, + { 402, PointParameteriNV_remap_index }, + { 14132, PointParameterivNV_remap_index }, + { 28658, ActiveStencilFaceEXT_remap_index }, + { 27354, BindVertexArrayAPPLE_remap_index }, + { 2776, DeleteVertexArraysAPPLE_remap_index }, + { 17941, GenVertexArraysAPPLE_remap_index }, + { 23272, IsVertexArrayAPPLE_remap_index }, + { 858, GetProgramNamedParameterdvNV_remap_index }, + { 3601, GetProgramNamedParameterfvNV_remap_index }, + { 26828, ProgramNamedParameter4dNV_remap_index }, + { 14491, ProgramNamedParameter4dvNV_remap_index }, + { 8869, ProgramNamedParameter4fNV_remap_index }, + { 11719, ProgramNamedParameter4fvNV_remap_index }, + { 16863, PrimitiveRestartIndexNV_remap_index }, + { 30561, PrimitiveRestartNV_remap_index }, + { 24173, DepthBoundsEXT_remap_index }, + { 1198, BlendEquationSeparateEXT_remap_index }, + { 14692, BindFramebufferEXT_remap_index }, + { 25522, BindRenderbufferEXT_remap_index }, + { 9633, CheckFramebufferStatusEXT_remap_index }, + { 22523, DeleteFramebuffersEXT_remap_index }, + { 31630, DeleteRenderbuffersEXT_remap_index }, + { 13479, FramebufferRenderbufferEXT_remap_index }, + { 13668, FramebufferTexture1DEXT_remap_index }, + { 11513, FramebufferTexture2DEXT_remap_index }, + { 11133, FramebufferTexture3DEXT_remap_index }, + { 23138, GenFramebuffersEXT_remap_index }, + { 17389, GenRenderbuffersEXT_remap_index }, + { 6666, GenerateMipmapEXT_remap_index }, + { 21600, GetFramebufferAttachmentParameterivEXT_remap_index }, + { 32200, GetRenderbufferParameterivEXT_remap_index }, + { 20339, IsFramebufferEXT_remap_index }, + { 32947, IsRenderbufferEXT_remap_index }, + { 8144, RenderbufferStorageEXT_remap_index }, + { 734, BlitFramebufferEXT_remap_index }, + { 14277, BufferParameteriAPPLE_remap_index }, + { 19191, FlushMappedBufferRangeAPPLE_remap_index }, + { 1854, BindFragDataLocationEXT_remap_index }, + { 24286, GetFragDataLocationEXT_remap_index }, + { 10572, GetUniformuivEXT_remap_index }, + { 2972, GetVertexAttribIivEXT_remap_index }, + { 27865, GetVertexAttribIuivEXT_remap_index }, + { 11999, Uniform1uiEXT_remap_index }, + { 27779, Uniform1uivEXT_remap_index }, + { 22121, Uniform2uiEXT_remap_index }, + { 4296, Uniform2uivEXT_remap_index }, + { 29098, Uniform3uiEXT_remap_index }, + { 14638, Uniform3uivEXT_remap_index }, + { 3525, Uniform4uiEXT_remap_index }, + { 8645, Uniform4uivEXT_remap_index }, + { 18292, VertexAttribI1iEXT_remap_index }, + { 1004, VertexAttribI1ivEXT_remap_index }, + { 2555, VertexAttribI1uiEXT_remap_index }, + { 12749, VertexAttribI1uivEXT_remap_index }, { 81, VertexAttribI2iEXT_remap_index }, - { 23706, VertexAttribI2ivEXT_remap_index }, - { 5273, VertexAttribI2uiEXT_remap_index }, - { 4728, VertexAttribI2uivEXT_remap_index }, - { 26361, VertexAttribI3iEXT_remap_index }, - { 30218, VertexAttribI3ivEXT_remap_index }, - { 3340, VertexAttribI3uiEXT_remap_index }, - { 30114, VertexAttribI3uivEXT_remap_index }, - { 21848, VertexAttribI4bvEXT_remap_index }, - { 14584, VertexAttribI4iEXT_remap_index }, - { 31783, VertexAttribI4ivEXT_remap_index }, - { 13358, VertexAttribI4svEXT_remap_index }, - { 16462, VertexAttribI4ubvEXT_remap_index }, - { 16145, VertexAttribI4uiEXT_remap_index }, - { 5419, VertexAttribI4uivEXT_remap_index }, - { 11311, VertexAttribI4usvEXT_remap_index }, - { 18403, VertexAttribIPointerEXT_remap_index }, - { 3027, FramebufferTextureLayerEXT_remap_index }, - { 5660, ColorMaskIndexedEXT_remap_index }, - { 18820, DisableIndexedEXT_remap_index }, - { 26406, EnableIndexedEXT_remap_index }, - { 21552, GetBooleanIndexedvEXT_remap_index }, - { 10922, GetIntegerIndexedvEXT_remap_index }, - { 22596, IsEnabledIndexedEXT_remap_index }, - { 22496, ClearColorIiEXT_remap_index }, - { 3436, ClearColorIuiEXT_remap_index }, - { 9852, GetTexParameterIivEXT_remap_index }, - { 5908, GetTexParameterIuivEXT_remap_index }, - { 2983, TexParameterIivEXT_remap_index }, - { 26228, TexParameterIuivEXT_remap_index }, - { 4596, BeginConditionalRenderNV_remap_index }, - { 25249, EndConditionalRenderNV_remap_index }, - { 9310, BeginTransformFeedbackEXT_remap_index }, - { 18855, BindBufferBaseEXT_remap_index }, - { 18714, BindBufferOffsetEXT_remap_index }, - { 12202, BindBufferRangeEXT_remap_index }, - { 14239, EndTransformFeedbackEXT_remap_index }, - { 10774, GetTransformFeedbackVaryingEXT_remap_index }, - { 20658, TransformFeedbackVaryingsEXT_remap_index }, - { 29270, ProvokingVertexEXT_remap_index }, - { 10722, GetTexParameterPointervAPPLE_remap_index }, - { 5047, TextureRangeAPPLE_remap_index }, - { 11600, GetObjectParameterivAPPLE_remap_index }, - { 19780, ObjectPurgeableAPPLE_remap_index }, - { 5702, ObjectUnpurgeableAPPLE_remap_index }, - { 17225, ActiveProgramEXT_remap_index }, - { 17196, CreateShaderProgramEXT_remap_index }, - { 28288, UseShaderProgramEXT_remap_index }, - { 28529, StencilFuncSeparateATI_remap_index }, - { 18044, ProgramEnvParameters4fvEXT_remap_index }, - { 17090, ProgramLocalParameters4fvEXT_remap_index }, - { 14107, GetQueryObjecti64vEXT_remap_index }, - { 10324, GetQueryObjectui64vEXT_remap_index }, - { 23663, EGLImageTargetRenderbufferStorageOES_remap_index }, - { 12120, EGLImageTargetTexture2DOES_remap_index }, + { 23709, VertexAttribI2ivEXT_remap_index }, + { 5302, VertexAttribI2uiEXT_remap_index }, + { 4715, VertexAttribI2uivEXT_remap_index }, + { 26397, VertexAttribI3iEXT_remap_index }, + { 30373, VertexAttribI3ivEXT_remap_index }, + { 3379, VertexAttribI3uiEXT_remap_index }, + { 30269, VertexAttribI3uivEXT_remap_index }, + { 21851, VertexAttribI4bvEXT_remap_index }, + { 14570, VertexAttribI4iEXT_remap_index }, + { 31899, VertexAttribI4ivEXT_remap_index }, + { 13382, VertexAttribI4svEXT_remap_index }, + { 16448, VertexAttribI4ubvEXT_remap_index }, + { 16131, VertexAttribI4uiEXT_remap_index }, + { 5448, VertexAttribI4uivEXT_remap_index }, + { 11296, VertexAttribI4usvEXT_remap_index }, + { 18389, VertexAttribIPointerEXT_remap_index }, + { 3066, FramebufferTextureLayerEXT_remap_index }, + { 5172, ColorMaskIndexedEXT_remap_index }, + { 18806, DisableIndexedEXT_remap_index }, + { 26442, EnableIndexedEXT_remap_index }, + { 21555, GetBooleanIndexedvEXT_remap_index }, + { 10907, GetIntegerIndexedvEXT_remap_index }, + { 22599, IsEnabledIndexedEXT_remap_index }, + { 22499, ClearColorIiEXT_remap_index }, + { 3475, ClearColorIuiEXT_remap_index }, + { 9822, GetTexParameterIivEXT_remap_index }, + { 5895, GetTexParameterIuivEXT_remap_index }, + { 3022, TexParameterIivEXT_remap_index }, + { 26264, TexParameterIuivEXT_remap_index }, + { 4583, BeginConditionalRenderNV_remap_index }, + { 25252, EndConditionalRenderNV_remap_index }, + { 9280, BeginTransformFeedbackEXT_remap_index }, + { 18841, BindBufferBaseEXT_remap_index }, + { 18700, BindBufferOffsetEXT_remap_index }, + { 12226, BindBufferRangeEXT_remap_index }, + { 14192, EndTransformFeedbackEXT_remap_index }, + { 10770, GetTransformFeedbackVaryingEXT_remap_index }, + { 20644, TransformFeedbackVaryingsEXT_remap_index }, + { 29425, ProvokingVertexEXT_remap_index }, + { 10718, GetTexParameterPointervAPPLE_remap_index }, + { 5034, TextureRangeAPPLE_remap_index }, + { 11585, GetObjectParameterivAPPLE_remap_index }, + { 19766, ObjectPurgeableAPPLE_remap_index }, + { 5689, ObjectUnpurgeableAPPLE_remap_index }, + { 17211, ActiveProgramEXT_remap_index }, + { 17182, CreateShaderProgramEXT_remap_index }, + { 28443, UseShaderProgramEXT_remap_index }, + { 28684, StencilFuncSeparateATI_remap_index }, + { 18030, ProgramEnvParameters4fvEXT_remap_index }, + { 17076, ProgramLocalParameters4fvEXT_remap_index }, + { 14060, GetQueryObjecti64vEXT_remap_index }, + { 10320, GetQueryObjectui64vEXT_remap_index }, + { 23666, EGLImageTargetRenderbufferStorageOES_remap_index }, + { 12105, EGLImageTargetTexture2DOES_remap_index }, { -1, -1 } }; /* these functions are in the ABI, but have alternative names */ static const struct gl_function_remap MESA_alt_functions[] = { /* from GL_EXT_blend_color */ - { 2655, _gloffset_BlendColor }, + { 2694, _gloffset_BlendColor }, /* from GL_EXT_blend_minmax */ - { 11205, _gloffset_BlendEquation }, + { 11190, _gloffset_BlendEquation }, /* from GL_EXT_color_subtable */ - { 16988, _gloffset_ColorSubTable }, - { 31446, _gloffset_CopyColorSubTable }, + { 16974, _gloffset_ColorSubTable }, + { 31562, _gloffset_CopyColorSubTable }, /* from GL_EXT_convolution */ - { 257, _gloffset_ConvolutionFilter1D }, - { 2454, _gloffset_CopyConvolutionFilter1D }, - { 4058, _gloffset_GetConvolutionParameteriv }, - { 8523, _gloffset_ConvolutionFilter2D }, - { 8725, _gloffset_ConvolutionParameteriv }, - { 9185, _gloffset_ConvolutionParameterfv }, - { 20501, _gloffset_GetSeparableFilter }, - { 23938, _gloffset_SeparableFilter2D }, - { 24801, _gloffset_ConvolutionParameteri }, - { 24924, _gloffset_ConvolutionParameterf }, - { 26595, _gloffset_GetConvolutionParameterfv }, - { 27417, _gloffset_GetConvolutionFilter }, - { 29810, _gloffset_CopyConvolutionFilter2D }, + { 296, _gloffset_ConvolutionFilter1D }, + { 2493, _gloffset_CopyConvolutionFilter1D }, + { 4097, _gloffset_GetConvolutionParameteriv }, + { 8493, _gloffset_ConvolutionFilter2D }, + { 8695, _gloffset_ConvolutionParameteriv }, + { 9155, _gloffset_ConvolutionParameterfv }, + { 20487, _gloffset_GetSeparableFilter }, + { 23941, _gloffset_SeparableFilter2D }, + { 24804, _gloffset_ConvolutionParameteri }, + { 24927, _gloffset_ConvolutionParameterf }, + { 26631, _gloffset_GetConvolutionParameterfv }, + { 27520, _gloffset_GetConvolutionFilter }, + { 29965, _gloffset_CopyConvolutionFilter2D }, /* from GL_EXT_copy_texture */ - { 15065, _gloffset_CopyTexSubImage3D }, - { 16675, _gloffset_CopyTexImage2D }, - { 24409, _gloffset_CopyTexImage1D }, - { 27098, _gloffset_CopyTexSubImage2D }, - { 29448, _gloffset_CopyTexSubImage1D }, + { 15051, _gloffset_CopyTexSubImage3D }, + { 16661, _gloffset_CopyTexImage2D }, + { 24412, _gloffset_CopyTexImage1D }, + { 27201, _gloffset_CopyTexSubImage2D }, + { 29603, _gloffset_CopyTexSubImage1D }, /* from GL_EXT_draw_range_elements */ - { 9522, _gloffset_DrawRangeElements }, + { 9492, _gloffset_DrawRangeElements }, /* from GL_EXT_histogram */ - { 856, _gloffset_Histogram }, - { 3522, _gloffset_ResetHistogram }, - { 9972, _gloffset_GetMinmax }, - { 15399, _gloffset_GetHistogramParameterfv }, - { 24334, _gloffset_GetMinmaxParameteriv }, - { 26485, _gloffset_ResetMinmax }, - { 27314, _gloffset_GetHistogramParameteriv }, - { 28463, _gloffset_GetHistogram }, - { 31032, _gloffset_Minmax }, - { 32578, _gloffset_GetMinmaxParameterfv }, + { 895, _gloffset_Histogram }, + { 3561, _gloffset_ResetHistogram }, + { 9968, _gloffset_GetMinmax }, + { 15385, _gloffset_GetHistogramParameterfv }, + { 24337, _gloffset_GetMinmaxParameteriv }, + { 26521, _gloffset_ResetMinmax }, + { 27417, _gloffset_GetHistogramParameteriv }, + { 28618, _gloffset_GetHistogram }, + { 31187, _gloffset_Minmax }, + { 32694, _gloffset_GetMinmaxParameterfv }, /* from GL_EXT_paletted_texture */ - { 8385, _gloffset_ColorTable }, - { 15245, _gloffset_GetColorTable }, - { 22882, _gloffset_GetColorTableParameterfv }, - { 24980, _gloffset_GetColorTableParameteriv }, + { 8355, _gloffset_ColorTable }, + { 15231, _gloffset_GetColorTable }, + { 22885, _gloffset_GetColorTableParameterfv }, + { 24983, _gloffset_GetColorTableParameteriv }, /* from GL_EXT_subtexture */ - { 7106, _gloffset_TexSubImage1D }, - { 10649, _gloffset_TexSubImage2D }, + { 7076, _gloffset_TexSubImage1D }, + { 10645, _gloffset_TexSubImage2D }, /* from GL_EXT_texture3D */ - { 1774, _gloffset_TexImage3D }, - { 22651, _gloffset_TexSubImage3D }, + { 1813, _gloffset_TexImage3D }, + { 22654, _gloffset_TexSubImage3D }, /* from GL_EXT_texture_object */ - { 3290, _gloffset_PrioritizeTextures }, - { 7555, _gloffset_AreTexturesResident }, - { 13562, _gloffset_GenTextures }, - { 15731, _gloffset_DeleteTextures }, - { 19486, _gloffset_IsTexture }, - { 29513, _gloffset_BindTexture }, + { 3329, _gloffset_PrioritizeTextures }, + { 7525, _gloffset_AreTexturesResident }, + { 13586, _gloffset_GenTextures }, + { 15717, _gloffset_DeleteTextures }, + { 19472, _gloffset_IsTexture }, + { 29668, _gloffset_BindTexture }, /* from GL_EXT_vertex_array */ - { 24110, _gloffset_ArrayElement }, - { 30620, _gloffset_GetPointerv }, - { 32205, _gloffset_DrawArrays }, + { 24113, _gloffset_ArrayElement }, + { 30775, _gloffset_GetPointerv }, + { 32321, _gloffset_DrawArrays }, /* from GL_SGI_color_table */ - { 7673, _gloffset_ColorTableParameteriv }, - { 8385, _gloffset_ColorTable }, - { 15245, _gloffset_GetColorTable }, - { 15355, _gloffset_CopyColorTable }, - { 19347, _gloffset_ColorTableParameterfv }, - { 22882, _gloffset_GetColorTableParameterfv }, - { 24980, _gloffset_GetColorTableParameteriv }, + { 7643, _gloffset_ColorTableParameteriv }, + { 8355, _gloffset_ColorTable }, + { 15231, _gloffset_GetColorTable }, + { 15341, _gloffset_CopyColorTable }, + { 19333, _gloffset_ColorTableParameterfv }, + { 22885, _gloffset_GetColorTableParameterfv }, + { 24983, _gloffset_GetColorTableParameteriv }, /* from GL_VERSION_1_3 */ - { 425, _gloffset_MultiTexCoord3sARB }, - { 657, _gloffset_ActiveTextureARB }, - { 4247, _gloffset_MultiTexCoord1fvARB }, - { 6155, _gloffset_MultiTexCoord3dARB }, - { 6200, _gloffset_MultiTexCoord2iARB }, - { 6324, _gloffset_MultiTexCoord2svARB }, - { 8341, _gloffset_MultiTexCoord2fARB }, - { 10354, _gloffset_MultiTexCoord3fvARB }, - { 10967, _gloffset_MultiTexCoord4sARB }, - { 11648, _gloffset_MultiTexCoord2dvARB }, - { 12063, _gloffset_MultiTexCoord1svARB }, - { 12435, _gloffset_MultiTexCoord3svARB }, - { 12496, _gloffset_MultiTexCoord4iARB }, - { 13266, _gloffset_MultiTexCoord3iARB }, - { 14136, _gloffset_MultiTexCoord1dARB }, - { 14353, _gloffset_MultiTexCoord3dvARB }, - { 15599, _gloffset_MultiTexCoord3ivARB }, - { 15644, _gloffset_MultiTexCoord2sARB }, - { 17045, _gloffset_MultiTexCoord4ivARB }, - { 18997, _gloffset_ClientActiveTextureARB }, - { 21297, _gloffset_MultiTexCoord2dARB }, - { 21717, _gloffset_MultiTexCoord4dvARB }, - { 22073, _gloffset_MultiTexCoord4fvARB }, - { 23023, _gloffset_MultiTexCoord3fARB }, - { 25531, _gloffset_MultiTexCoord4dARB }, - { 25797, _gloffset_MultiTexCoord1sARB }, - { 26001, _gloffset_MultiTexCoord1dvARB }, - { 26942, _gloffset_MultiTexCoord1ivARB }, - { 27035, _gloffset_MultiTexCoord2ivARB }, - { 27374, _gloffset_MultiTexCoord1iARB }, - { 28738, _gloffset_MultiTexCoord4svARB }, - { 29312, _gloffset_MultiTexCoord1fARB }, - { 29575, _gloffset_MultiTexCoord4fARB }, - { 32039, _gloffset_MultiTexCoord2fvARB }, + { 464, _gloffset_MultiTexCoord3sARB }, + { 696, _gloffset_ActiveTextureARB }, + { 4234, _gloffset_MultiTexCoord1fvARB }, + { 6142, _gloffset_MultiTexCoord3dARB }, + { 6187, _gloffset_MultiTexCoord2iARB }, + { 6311, _gloffset_MultiTexCoord2svARB }, + { 8311, _gloffset_MultiTexCoord2fARB }, + { 10350, _gloffset_MultiTexCoord3fvARB }, + { 10952, _gloffset_MultiTexCoord4sARB }, + { 11633, _gloffset_MultiTexCoord2dvARB }, + { 12048, _gloffset_MultiTexCoord1svARB }, + { 12459, _gloffset_MultiTexCoord3svARB }, + { 12520, _gloffset_MultiTexCoord4iARB }, + { 13290, _gloffset_MultiTexCoord3iARB }, + { 14089, _gloffset_MultiTexCoord1dARB }, + { 14306, _gloffset_MultiTexCoord3dvARB }, + { 15585, _gloffset_MultiTexCoord3ivARB }, + { 15630, _gloffset_MultiTexCoord2sARB }, + { 17031, _gloffset_MultiTexCoord4ivARB }, + { 18983, _gloffset_ClientActiveTextureARB }, + { 21283, _gloffset_MultiTexCoord2dARB }, + { 21720, _gloffset_MultiTexCoord4dvARB }, + { 22076, _gloffset_MultiTexCoord4fvARB }, + { 23026, _gloffset_MultiTexCoord3fARB }, + { 25567, _gloffset_MultiTexCoord4dARB }, + { 25833, _gloffset_MultiTexCoord1sARB }, + { 26037, _gloffset_MultiTexCoord1dvARB }, + { 27045, _gloffset_MultiTexCoord1ivARB }, + { 27138, _gloffset_MultiTexCoord2ivARB }, + { 27477, _gloffset_MultiTexCoord1iARB }, + { 28893, _gloffset_MultiTexCoord4svARB }, + { 29467, _gloffset_MultiTexCoord1fARB }, + { 29730, _gloffset_MultiTexCoord4fARB }, + { 32155, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; @@ -5329,7 +5354,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[] = { - { 9243, -1 }, /* TbufferMask3DFX */ + { 9213, -1 }, /* TbufferMask3DFX */ { -1, -1 } }; #endif @@ -5362,6 +5387,13 @@ static const struct gl_function_remap GL_APPLE_vertex_array_object_functions[] = }; #endif +#if defined(need_GL_ARB_ES2_compatibility) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_ES2_compatibility_functions[] = { + { -1, -1 } +}; +#endif + #if defined(need_GL_ARB_copy_buffer) /* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_ARB_copy_buffer_functions[] = { @@ -5400,7 +5432,7 @@ 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[] = { - { 12399, -1 }, /* FramebufferTextureLayer */ + { 12423, -1 }, /* FramebufferTextureLayer */ { -1, -1 } }; #endif @@ -5414,11 +5446,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[] = { - { 3773, -1 }, /* MatrixIndexusvARB */ - { 13087, -1 }, /* MatrixIndexuivARB */ - { 14475, -1 }, /* MatrixIndexPointerARB */ - { 19735, -1 }, /* CurrentPaletteMatrixARB */ - { 22767, -1 }, /* MatrixIndexubvARB */ + { 3812, -1 }, /* MatrixIndexusvARB */ + { 13111, -1 }, /* MatrixIndexuivARB */ + { 14461, -1 }, /* MatrixIndexPointerARB */ + { 19721, -1 }, /* CurrentPaletteMatrixARB */ + { 22770, -1 }, /* MatrixIndexubvARB */ { -1, -1 } }; #endif @@ -5495,16 +5527,16 @@ 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[] = { - { 2396, -1 }, /* WeightubvARB */ - { 6567, -1 }, /* WeightivARB */ - { 11070, -1 }, /* WeightPointerARB */ - { 13854, -1 }, /* WeightfvARB */ - { 17564, -1 }, /* WeightbvARB */ - { 20965, -1 }, /* WeightusvARB */ - { 23864, -1 }, /* VertexBlendARB */ - { 29396, -1 }, /* WeightsvARB */ - { 31496, -1 }, /* WeightdvARB */ - { 32239, -1 }, /* WeightuivARB */ + { 2435, -1 }, /* WeightubvARB */ + { 6554, -1 }, /* WeightivARB */ + { 11055, -1 }, /* WeightPointerARB */ + { 13846, -1 }, /* WeightfvARB */ + { 17550, -1 }, /* WeightbvARB */ + { 20951, -1 }, /* WeightusvARB */ + { 23867, -1 }, /* VertexBlendARB */ + { 29551, -1 }, /* WeightsvARB */ + { 31612, -1 }, /* WeightdvARB */ + { 32355, -1 }, /* WeightuivARB */ { -1, -1 } }; #endif @@ -5574,7 +5606,7 @@ static const struct gl_function_remap GL_ATI_separate_stencil_functions[] = { #if defined(need_GL_EXT_blend_color) static const struct gl_function_remap GL_EXT_blend_color_functions[] = { - { 2655, _gloffset_BlendColor }, + { 2694, _gloffset_BlendColor }, { -1, -1 } }; #endif @@ -5595,15 +5627,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[] = { - { 11205, _gloffset_BlendEquation }, + { 11190, _gloffset_BlendEquation }, { -1, -1 } }; #endif #if defined(need_GL_EXT_color_subtable) static const struct gl_function_remap GL_EXT_color_subtable_functions[] = { - { 16988, _gloffset_ColorSubTable }, - { 31446, _gloffset_CopyColorSubTable }, + { 16974, _gloffset_ColorSubTable }, + { 31562, _gloffset_CopyColorSubTable }, { -1, -1 } }; #endif @@ -5617,66 +5649,66 @@ static const struct gl_function_remap GL_EXT_compiled_vertex_array_functions[] = #if defined(need_GL_EXT_convolution) static const struct gl_function_remap GL_EXT_convolution_functions[] = { - { 257, _gloffset_ConvolutionFilter1D }, - { 2454, _gloffset_CopyConvolutionFilter1D }, - { 4058, _gloffset_GetConvolutionParameteriv }, - { 8523, _gloffset_ConvolutionFilter2D }, - { 8725, _gloffset_ConvolutionParameteriv }, - { 9185, _gloffset_ConvolutionParameterfv }, - { 20501, _gloffset_GetSeparableFilter }, - { 23938, _gloffset_SeparableFilter2D }, - { 24801, _gloffset_ConvolutionParameteri }, - { 24924, _gloffset_ConvolutionParameterf }, - { 26595, _gloffset_GetConvolutionParameterfv }, - { 27417, _gloffset_GetConvolutionFilter }, - { 29810, _gloffset_CopyConvolutionFilter2D }, + { 296, _gloffset_ConvolutionFilter1D }, + { 2493, _gloffset_CopyConvolutionFilter1D }, + { 4097, _gloffset_GetConvolutionParameteriv }, + { 8493, _gloffset_ConvolutionFilter2D }, + { 8695, _gloffset_ConvolutionParameteriv }, + { 9155, _gloffset_ConvolutionParameterfv }, + { 20487, _gloffset_GetSeparableFilter }, + { 23941, _gloffset_SeparableFilter2D }, + { 24804, _gloffset_ConvolutionParameteri }, + { 24927, _gloffset_ConvolutionParameterf }, + { 26631, _gloffset_GetConvolutionParameterfv }, + { 27520, _gloffset_GetConvolutionFilter }, + { 29965, _gloffset_CopyConvolutionFilter2D }, { -1, -1 } }; #endif #if defined(need_GL_EXT_coordinate_frame) static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { - { 10493, -1 }, /* TangentPointerEXT */ - { 12554, -1 }, /* Binormal3ivEXT */ - { 13219, -1 }, /* Tangent3sEXT */ - { 14540, -1 }, /* Tangent3fvEXT */ - { 18695, -1 }, /* Tangent3dvEXT */ - { 19433, -1 }, /* Binormal3bvEXT */ - { 20554, -1 }, /* Binormal3dEXT */ - { 22699, -1 }, /* Tangent3fEXT */ - { 24873, -1 }, /* Binormal3sEXT */ - { 25341, -1 }, /* Tangent3ivEXT */ - { 25360, -1 }, /* Tangent3dEXT */ - { 26274, -1 }, /* Binormal3svEXT */ - { 26840, -1 }, /* Binormal3fEXT */ - { 27728, -1 }, /* Binormal3dvEXT */ - { 28995, -1 }, /* Tangent3iEXT */ - { 30095, -1 }, /* Tangent3bvEXT */ - { 30655, -1 }, /* Tangent3bEXT */ - { 31219, -1 }, /* Binormal3fvEXT */ - { 31938, -1 }, /* BinormalPointerEXT */ - { 32343, -1 }, /* Tangent3svEXT */ - { 32780, -1 }, /* Binormal3bEXT */ - { 32957, -1 }, /* Binormal3iEXT */ + { 10489, -1 }, /* TangentPointerEXT */ + { 12578, -1 }, /* Binormal3ivEXT */ + { 13243, -1 }, /* Tangent3sEXT */ + { 14526, -1 }, /* Tangent3fvEXT */ + { 18681, -1 }, /* Tangent3dvEXT */ + { 19419, -1 }, /* Binormal3bvEXT */ + { 20540, -1 }, /* Binormal3dEXT */ + { 22702, -1 }, /* Tangent3fEXT */ + { 24876, -1 }, /* Binormal3sEXT */ + { 25344, -1 }, /* Tangent3ivEXT */ + { 25363, -1 }, /* Tangent3dEXT */ + { 26310, -1 }, /* Binormal3svEXT */ + { 26943, -1 }, /* Binormal3fEXT */ + { 27831, -1 }, /* Binormal3dvEXT */ + { 29150, -1 }, /* Tangent3iEXT */ + { 30250, -1 }, /* Tangent3bvEXT */ + { 30810, -1 }, /* Tangent3bEXT */ + { 31335, -1 }, /* Binormal3fvEXT */ + { 32054, -1 }, /* BinormalPointerEXT */ + { 32459, -1 }, /* Tangent3svEXT */ + { 32896, -1 }, /* Binormal3bEXT */ + { 33073, -1 }, /* Binormal3iEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_copy_texture) static const struct gl_function_remap GL_EXT_copy_texture_functions[] = { - { 15065, _gloffset_CopyTexSubImage3D }, - { 16675, _gloffset_CopyTexImage2D }, - { 24409, _gloffset_CopyTexImage1D }, - { 27098, _gloffset_CopyTexSubImage2D }, - { 29448, _gloffset_CopyTexSubImage1D }, + { 15051, _gloffset_CopyTexSubImage3D }, + { 16661, _gloffset_CopyTexImage2D }, + { 24412, _gloffset_CopyTexImage1D }, + { 27201, _gloffset_CopyTexSubImage2D }, + { 29603, _gloffset_CopyTexSubImage1D }, { -1, -1 } }; #endif #if defined(need_GL_EXT_cull_vertex) static const struct gl_function_remap GL_EXT_cull_vertex_functions[] = { - { 8874, -1 }, /* CullParameterdvEXT */ - { 11693, -1 }, /* CullParameterfvEXT */ + { 8844, -1 }, /* CullParameterdvEXT */ + { 11678, -1 }, /* CullParameterfvEXT */ { -1, -1 } }; #endif @@ -5704,7 +5736,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[] = { - { 9522, _gloffset_DrawRangeElements }, + { 9492, _gloffset_DrawRangeElements }, { -1, -1 } }; #endif @@ -5753,39 +5785,39 @@ 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 }, - { 3522, _gloffset_ResetHistogram }, - { 9972, _gloffset_GetMinmax }, - { 15399, _gloffset_GetHistogramParameterfv }, - { 24334, _gloffset_GetMinmaxParameteriv }, - { 26485, _gloffset_ResetMinmax }, - { 27314, _gloffset_GetHistogramParameteriv }, - { 28463, _gloffset_GetHistogram }, - { 31032, _gloffset_Minmax }, - { 32578, _gloffset_GetMinmaxParameterfv }, + { 895, _gloffset_Histogram }, + { 3561, _gloffset_ResetHistogram }, + { 9968, _gloffset_GetMinmax }, + { 15385, _gloffset_GetHistogramParameterfv }, + { 24337, _gloffset_GetMinmaxParameteriv }, + { 26521, _gloffset_ResetMinmax }, + { 27417, _gloffset_GetHistogramParameteriv }, + { 28618, _gloffset_GetHistogram }, + { 31187, _gloffset_Minmax }, + { 32694, _gloffset_GetMinmaxParameterfv }, { -1, -1 } }; #endif #if defined(need_GL_EXT_index_func) static const struct gl_function_remap GL_EXT_index_func_functions[] = { - { 11479, -1 }, /* IndexFuncEXT */ + { 11464, -1 }, /* IndexFuncEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_index_material) static const struct gl_function_remap GL_EXT_index_material_functions[] = { - { 21052, -1 }, /* IndexMaterialEXT */ + { 21038, -1 }, /* IndexMaterialEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_light_texture) static const struct gl_function_remap GL_EXT_light_texture_functions[] = { - { 26294, -1 }, /* ApplyTextureEXT */ - { 26439, -1 }, /* TextureMaterialEXT */ - { 26464, -1 }, /* TextureLightEXT */ + { 26330, -1 }, /* ApplyTextureEXT */ + { 26475, -1 }, /* TextureMaterialEXT */ + { 26500, -1 }, /* TextureLightEXT */ { -1, -1 } }; #endif @@ -5806,20 +5838,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[] = { - { 8385, _gloffset_ColorTable }, - { 15245, _gloffset_GetColorTable }, - { 22882, _gloffset_GetColorTableParameterfv }, - { 24980, _gloffset_GetColorTableParameteriv }, + { 8355, _gloffset_ColorTable }, + { 15231, _gloffset_GetColorTable }, + { 22885, _gloffset_GetColorTableParameterfv }, + { 24983, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif #if defined(need_GL_EXT_pixel_transform) static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = { - { 21682, -1 }, /* PixelTransformParameterfEXT */ - { 21762, -1 }, /* PixelTransformParameteriEXT */ - { 30370, -1 }, /* PixelTransformParameterfvEXT */ - { 31902, -1 }, /* PixelTransformParameterivEXT */ + { 21685, -1 }, /* PixelTransformParameterfEXT */ + { 21765, -1 }, /* PixelTransformParameteriEXT */ + { 30525, -1 }, /* PixelTransformParameterfvEXT */ + { 32018, -1 }, /* PixelTransformParameterivEXT */ { -1, -1 } }; #endif @@ -5868,16 +5900,16 @@ 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[] = { - { 7106, _gloffset_TexSubImage1D }, - { 10649, _gloffset_TexSubImage2D }, + { 7076, _gloffset_TexSubImage1D }, + { 10645, _gloffset_TexSubImage2D }, { -1, -1 } }; #endif #if defined(need_GL_EXT_texture3D) static const struct gl_function_remap GL_EXT_texture3D_functions[] = { - { 1774, _gloffset_TexImage3D }, - { 22651, _gloffset_TexSubImage3D }, + { 1813, _gloffset_TexImage3D }, + { 22654, _gloffset_TexSubImage3D }, { -1, -1 } }; #endif @@ -5898,19 +5930,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[] = { - { 3290, _gloffset_PrioritizeTextures }, - { 7555, _gloffset_AreTexturesResident }, - { 13562, _gloffset_GenTextures }, - { 15731, _gloffset_DeleteTextures }, - { 19486, _gloffset_IsTexture }, - { 29513, _gloffset_BindTexture }, + { 3329, _gloffset_PrioritizeTextures }, + { 7525, _gloffset_AreTexturesResident }, + { 13586, _gloffset_GenTextures }, + { 15717, _gloffset_DeleteTextures }, + { 19472, _gloffset_IsTexture }, + { 29668, _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[] = { - { 13804, -1 }, /* TextureNormalEXT */ + { 13796, -1 }, /* TextureNormalEXT */ { -1, -1 } }; #endif @@ -5932,30 +5964,30 @@ 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[] = { - { 24110, _gloffset_ArrayElement }, - { 30620, _gloffset_GetPointerv }, - { 32205, _gloffset_DrawArrays }, + { 24113, _gloffset_ArrayElement }, + { 30775, _gloffset_GetPointerv }, + { 32321, _gloffset_DrawArrays }, { -1, -1 } }; #endif #if defined(need_GL_EXT_vertex_weighting) static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { - { 19516, -1 }, /* VertexWeightfvEXT */ - { 26818, -1 }, /* VertexWeightfEXT */ - { 28432, -1 }, /* VertexWeightPointerEXT */ + { 19502, -1 }, /* VertexWeightfvEXT */ + { 26886, -1 }, /* VertexWeightfEXT */ + { 28587, -1 }, /* VertexWeightPointerEXT */ { -1, -1 } }; #endif #if defined(need_GL_HP_image_transform) static const struct gl_function_remap GL_HP_image_transform_functions[] = { - { 2327, -1 }, /* GetImageTransformParameterfvHP */ - { 3739, -1 }, /* ImageTransformParameterfHP */ - { 10187, -1 }, /* ImageTransformParameterfvHP */ - { 11948, -1 }, /* ImageTransformParameteriHP */ - { 12289, -1 }, /* GetImageTransformParameterivHP */ - { 19580, -1 }, /* ImageTransformParameterivHP */ + { 2366, -1 }, /* GetImageTransformParameterfvHP */ + { 3778, -1 }, /* ImageTransformParameterfHP */ + { 10183, -1 }, /* ImageTransformParameterfvHP */ + { 11933, -1 }, /* ImageTransformParameteriHP */ + { 12313, -1 }, /* GetImageTransformParameterivHP */ + { 19566, -1 }, /* ImageTransformParameterivHP */ { -1, -1 } }; #endif @@ -5969,14 +6001,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[] = { - { 4379, -1 }, /* SecondaryColorPointerListIBM */ - { 6021, -1 }, /* NormalPointerListIBM */ - { 7729, -1 }, /* FogCoordPointerListIBM */ - { 8036, -1 }, /* VertexPointerListIBM */ - { 11869, -1 }, /* ColorPointerListIBM */ - { 13326, -1 }, /* TexCoordPointerListIBM */ - { 13826, -1 }, /* IndexPointerListIBM */ - { 32521, -1 }, /* EdgeFlagPointerListIBM */ + { 4366, -1 }, /* SecondaryColorPointerListIBM */ + { 6008, -1 }, /* NormalPointerListIBM */ + { 7699, -1 }, /* FogCoordPointerListIBM */ + { 8006, -1 }, /* VertexPointerListIBM */ + { 11854, -1 }, /* ColorPointerListIBM */ + { 13350, -1 }, /* TexCoordPointerListIBM */ + { 13818, -1 }, /* IndexPointerListIBM */ + { 32637, -1 }, /* EdgeFlagPointerListIBM */ { -1, -1 } }; #endif @@ -5990,10 +6022,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[] = { - { 12666, -1 }, /* VertexPointervINTEL */ - { 15492, -1 }, /* ColorPointervINTEL */ - { 29784, -1 }, /* NormalPointervINTEL */ - { 30302, -1 }, /* TexCoordPointervINTEL */ + { 12690, -1 }, /* VertexPointervINTEL */ + { 15478, -1 }, /* ColorPointervINTEL */ + { 29939, -1 }, /* NormalPointervINTEL */ + { 30457, -1 }, /* TexCoordPointervINTEL */ { -1, -1 } }; #endif @@ -6007,10 +6039,10 @@ 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[] = { - { 1638, -1 }, /* GetDebugLogLengthMESA */ - { 3461, -1 }, /* ClearDebugLogMESA */ - { 4540, -1 }, /* GetDebugLogMESA */ - { 30813, -1 }, /* CreateDebugObjectMESA */ + { 1677, -1 }, /* GetDebugLogLengthMESA */ + { 3500, -1 }, /* ClearDebugLogMESA */ + { 4527, -1 }, /* GetDebugLogMESA */ + { 30968, -1 }, /* CreateDebugObjectMESA */ { -1, -1 } }; #endif @@ -6031,15 +6063,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[] = { - { 6768, -1 }, /* GetMapAttribParameterivNV */ - { 8491, -1 }, /* MapControlPointsNV */ - { 8590, -1 }, /* MapParameterfvNV */ - { 10632, -1 }, /* EvalMapsNV */ - { 17162, -1 }, /* GetMapAttribParameterfvNV */ - { 17379, -1 }, /* MapParameterivNV */ - { 24724, -1 }, /* GetMapParameterivNV */ - { 25222, -1 }, /* GetMapParameterfvNV */ - { 29099, -1 }, /* GetMapControlPointsNV */ + { 6738, -1 }, /* GetMapAttribParameterivNV */ + { 8461, -1 }, /* MapControlPointsNV */ + { 8560, -1 }, /* MapParameterfvNV */ + { 10628, -1 }, /* EvalMapsNV */ + { 17148, -1 }, /* GetMapAttribParameterfvNV */ + { 17365, -1 }, /* MapParameterivNV */ + { 24727, -1 }, /* GetMapParameterivNV */ + { 25225, -1 }, /* GetMapParameterfvNV */ + { 29254, -1 }, /* GetMapControlPointsNV */ { -1, -1 } }; #endif @@ -6081,8 +6113,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[] = { - { 15884, -1 }, /* CombinerStageParameterfvNV */ - { 16280, -1 }, /* GetCombinerStageParameterfvNV */ + { 15870, -1 }, /* CombinerStageParameterfvNV */ + { 16266, -1 }, /* GetCombinerStageParameterfvNV */ { -1, -1 } }; #endif @@ -6110,23 +6142,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[] = { - { 8711, -1 }, /* HintPGI */ + { 8681, -1 }, /* HintPGI */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_detail_texture) static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = { - { 16253, -1 }, /* GetDetailTexFuncSGIS */ - { 16620, -1 }, /* DetailTexFuncSGIS */ + { 16239, -1 }, /* GetDetailTexFuncSGIS */ + { 16606, -1 }, /* DetailTexFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_fog_function) static const struct gl_function_remap GL_SGIS_fog_function_functions[] = { - { 27080, -1 }, /* FogFuncSGIS */ - { 27781, -1 }, /* GetFogFuncSGIS */ + { 27183, -1 }, /* FogFuncSGIS */ + { 27936, -1 }, /* GetFogFuncSGIS */ { -1, -1 } }; #endif @@ -6154,112 +6186,112 @@ 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[] = { - { 6829, -1 }, /* GetSharpenTexFuncSGIS */ - { 22047, -1 }, /* SharpenTexFuncSGIS */ + { 6799, -1 }, /* GetSharpenTexFuncSGIS */ + { 22050, -1 }, /* SharpenTexFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture4D) static const struct gl_function_remap GL_SGIS_texture4D_functions[] = { - { 1010, -1 }, /* TexImage4DSGIS */ - { 15800, -1 }, /* TexSubImage4DSGIS */ + { 1049, -1 }, /* TexImage4DSGIS */ + { 15786, -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[] = { - { 15198, -1 }, /* TextureColorMaskSGIS */ + { 15184, -1 }, /* TextureColorMaskSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture_filter4) static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = { - { 7006, -1 }, /* GetTexFilterFuncSGIS */ - { 16399, -1 }, /* TexFilterFuncSGIS */ + { 6976, -1 }, /* GetTexFilterFuncSGIS */ + { 16385, -1 }, /* TexFilterFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_async) static const struct gl_function_remap GL_SGIX_async_functions[] = { - { 3387, -1 }, /* AsyncMarkerSGIX */ - { 4519, -1 }, /* FinishAsyncSGIX */ - { 5466, -1 }, /* PollAsyncSGIX */ - { 22228, -1 }, /* DeleteAsyncMarkersSGIX */ - { 22283, -1 }, /* IsAsyncMarkerSGIX */ - { 32318, -1 }, /* GenAsyncMarkersSGIX */ + { 3426, -1 }, /* AsyncMarkerSGIX */ + { 4506, -1 }, /* FinishAsyncSGIX */ + { 5495, -1 }, /* PollAsyncSGIX */ + { 22231, -1 }, /* DeleteAsyncMarkersSGIX */ + { 22286, -1 }, /* IsAsyncMarkerSGIX */ + { 32434, -1 }, /* GenAsyncMarkersSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_flush_raster) static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = { - { 7383, -1 }, /* FlushRasterSGIX */ + { 7353, -1 }, /* FlushRasterSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_fragment_lighting) static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { - { 2625, -1 }, /* FragmentMaterialfvSGIX */ - { 5370, -1 }, /* FragmentLightiSGIX */ - { 8103, -1 }, /* FragmentMaterialfSGIX */ - { 8264, -1 }, /* GetFragmentLightivSGIX */ - { 9137, -1 }, /* FragmentLightModeliSGIX */ - { 10695, -1 }, /* FragmentLightivSGIX */ - { 11013, -1 }, /* GetFragmentMaterialivSGIX */ - { 16193, -1 }, /* GetFragmentMaterialfvSGIX */ - { 19403, -1 }, /* FragmentLightModelfSGIX */ - { 19703, -1 }, /* FragmentColorMaterialSGIX */ - { 20120, -1 }, /* FragmentMaterialiSGIX */ - { 21380, -1 }, /* LightEnviSGIX */ - { 22974, -1 }, /* FragmentLightModelfvSGIX */ - { 23309, -1 }, /* FragmentLightfvSGIX */ - { 28165, -1 }, /* FragmentLightModelivSGIX */ - { 28314, -1 }, /* FragmentLightfSGIX */ - { 31189, -1 }, /* GetFragmentLightfvSGIX */ - { 32801, -1 }, /* FragmentMaterialivSGIX */ + { 2664, -1 }, /* FragmentMaterialfvSGIX */ + { 5399, -1 }, /* FragmentLightiSGIX */ + { 8073, -1 }, /* FragmentMaterialfSGIX */ + { 8234, -1 }, /* GetFragmentLightivSGIX */ + { 9107, -1 }, /* FragmentLightModeliSGIX */ + { 10691, -1 }, /* FragmentLightivSGIX */ + { 10998, -1 }, /* GetFragmentMaterialivSGIX */ + { 16179, -1 }, /* GetFragmentMaterialfvSGIX */ + { 19389, -1 }, /* FragmentLightModelfSGIX */ + { 19689, -1 }, /* FragmentColorMaterialSGIX */ + { 20106, -1 }, /* FragmentMaterialiSGIX */ + { 21366, -1 }, /* LightEnviSGIX */ + { 22977, -1 }, /* FragmentLightModelfvSGIX */ + { 23312, -1 }, /* FragmentLightfvSGIX */ + { 28320, -1 }, /* FragmentLightModelivSGIX */ + { 28469, -1 }, /* FragmentLightfSGIX */ + { 31305, -1 }, /* GetFragmentLightfvSGIX */ + { 32917, -1 }, /* FragmentMaterialivSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_framezoom) static const struct gl_function_remap GL_SGIX_framezoom_functions[] = { - { 22306, -1 }, /* FrameZoomSGIX */ + { 22309, -1 }, /* FrameZoomSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_igloo_interface) static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { - { 28622, -1 }, /* IglooInterfaceSGIX */ + { 28777, -1 }, /* IglooInterfaceSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_instruments) static const struct gl_function_remap GL_SGIX_instruments_functions[] = { - { 2805, -1 }, /* ReadInstrumentsSGIX */ - { 6585, -1 }, /* PollInstrumentsSGIX */ - { 10553, -1 }, /* GetInstrumentsSGIX */ - { 12924, -1 }, /* StartInstrumentsSGIX */ - { 15918, -1 }, /* StopInstrumentsSGIX */ - { 17777, -1 }, /* InstrumentsBufferSGIX */ + { 2844, -1 }, /* ReadInstrumentsSGIX */ + { 6572, -1 }, /* PollInstrumentsSGIX */ + { 10549, -1 }, /* GetInstrumentsSGIX */ + { 12948, -1 }, /* StartInstrumentsSGIX */ + { 15904, -1 }, /* StopInstrumentsSGIX */ + { 17763, -1 }, /* InstrumentsBufferSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_list_priority) static const struct gl_function_remap GL_SGIX_list_priority_functions[] = { - { 1241, -1 }, /* ListParameterfSGIX */ - { 3089, -1 }, /* GetListParameterfvSGIX */ - { 17692, -1 }, /* ListParameteriSGIX */ - { 18645, -1 }, /* ListParameterfvSGIX */ - { 20786, -1 }, /* ListParameterivSGIX */ - { 32362, -1 }, /* GetListParameterivSGIX */ + { 1280, -1 }, /* ListParameterfSGIX */ + { 3128, -1 }, /* GetListParameterfvSGIX */ + { 17678, -1 }, /* ListParameteriSGIX */ + { 18631, -1 }, /* ListParameterfvSGIX */ + { 20772, -1 }, /* ListParameterivSGIX */ + { 32478, -1 }, /* GetListParameterivSGIX */ { -1, -1 } }; #endif @@ -6273,134 +6305,134 @@ 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[] = { - { 3685, -1 }, /* LoadIdentityDeformationMapSGIX */ - { 16018, -1 }, /* DeformSGIX */ - { 24222, -1 }, /* DeformationMap3fSGIX */ - { 31077, -1 }, /* DeformationMap3dSGIX */ + { 3724, -1 }, /* LoadIdentityDeformationMapSGIX */ + { 12187, -1 }, /* DeformationMap3dSGIX */ + { 16004, -1 }, /* DeformSGIX */ + { 24225, -1 }, /* DeformationMap3fSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_reference_plane) static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { - { 14749, -1 }, /* ReferencePlaneSGIX */ + { 14735, -1 }, /* ReferencePlaneSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_sprite) static const struct gl_function_remap GL_SGIX_sprite_functions[] = { - { 9635, -1 }, /* SpriteParameterfvSGIX */ - { 20575, -1 }, /* SpriteParameteriSGIX */ - { 26519, -1 }, /* SpriteParameterfSGIX */ - { 29242, -1 }, /* SpriteParameterivSGIX */ + { 9605, -1 }, /* SpriteParameterfvSGIX */ + { 20561, -1 }, /* SpriteParameteriSGIX */ + { 26555, -1 }, /* SpriteParameterfSGIX */ + { 29397, -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[] = { - { 20634, -1 }, /* TagSampleBufferSGIX */ + { 20620, -1 }, /* TagSampleBufferSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGI_color_table) static const struct gl_function_remap GL_SGI_color_table_functions[] = { - { 7673, _gloffset_ColorTableParameteriv }, - { 8385, _gloffset_ColorTable }, - { 15245, _gloffset_GetColorTable }, - { 15355, _gloffset_CopyColorTable }, - { 19347, _gloffset_ColorTableParameterfv }, - { 22882, _gloffset_GetColorTableParameterfv }, - { 24980, _gloffset_GetColorTableParameteriv }, + { 7643, _gloffset_ColorTableParameteriv }, + { 8355, _gloffset_ColorTable }, + { 15231, _gloffset_GetColorTable }, + { 15341, _gloffset_CopyColorTable }, + { 19333, _gloffset_ColorTableParameterfv }, + { 22885, _gloffset_GetColorTableParameterfv }, + { 24983, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif #if defined(need_GL_SUNX_constant_data) static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { - { 31167, -1 }, /* FinishTextureSUNX */ + { 31283, -1 }, /* FinishTextureSUNX */ { -1, -1 } }; #endif #if defined(need_GL_SUN_global_alpha) static const struct gl_function_remap GL_SUN_global_alpha_functions[] = { - { 3408, -1 }, /* GlobalAlphaFactorubSUN */ - { 4818, -1 }, /* GlobalAlphaFactoriSUN */ - { 6610, -1 }, /* GlobalAlphaFactordSUN */ - { 9719, -1 }, /* GlobalAlphaFactoruiSUN */ - { 10144, -1 }, /* GlobalAlphaFactorbSUN */ - { 13239, -1 }, /* GlobalAlphaFactorfSUN */ - { 13403, -1 }, /* GlobalAlphaFactorusSUN */ - { 22569, -1 }, /* GlobalAlphaFactorsSUN */ + { 3447, -1 }, /* GlobalAlphaFactorubSUN */ + { 4805, -1 }, /* GlobalAlphaFactoriSUN */ + { 6597, -1 }, /* GlobalAlphaFactordSUN */ + { 9689, -1 }, /* GlobalAlphaFactoruiSUN */ + { 10140, -1 }, /* GlobalAlphaFactorbSUN */ + { 13263, -1 }, /* GlobalAlphaFactorfSUN */ + { 13427, -1 }, /* GlobalAlphaFactorusSUN */ + { 22572, -1 }, /* GlobalAlphaFactorsSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_mesh_array) static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { - { 29033, -1 }, /* DrawMeshArraysSUN */ + { 29188, -1 }, /* DrawMeshArraysSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_triangle_list) static const struct gl_function_remap GL_SUN_triangle_list_functions[] = { - { 4493, -1 }, /* ReplacementCodeubSUN */ - { 6369, -1 }, /* ReplacementCodeubvSUN */ - { 19068, -1 }, /* ReplacementCodeusvSUN */ - { 19256, -1 }, /* ReplacementCodePointerSUN */ - { 21444, -1 }, /* ReplacementCodeuiSUN */ - { 22257, -1 }, /* ReplacementCodeusSUN */ - { 29699, -1 }, /* ReplacementCodeuivSUN */ + { 4480, -1 }, /* ReplacementCodeubSUN */ + { 6356, -1 }, /* ReplacementCodeubvSUN */ + { 19054, -1 }, /* ReplacementCodeusvSUN */ + { 19242, -1 }, /* ReplacementCodePointerSUN */ + { 21430, -1 }, /* ReplacementCodeuiSUN */ + { 22260, -1 }, /* ReplacementCodeusSUN */ + { 29854, -1 }, /* ReplacementCodeuivSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_vertex) static const struct gl_function_remap GL_SUN_vertex_functions[] = { - { 1115, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */ - { 1313, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */ - { 1539, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */ - { 1869, -1 }, /* ReplacementCodeuiVertex3fvSUN */ - { 2003, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */ - { 2561, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */ - { 2874, -1 }, /* Color4ubVertex3fvSUN */ - { 4652, -1 }, /* Color4ubVertex3fSUN */ - { 4775, -1 }, /* TexCoord2fVertex3fSUN */ - { 5119, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */ - { 5570, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */ - { 6264, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ - { 7061, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ - { 7420, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ - { 8132, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ - { 8936, -1 }, /* Color3fVertex3fSUN */ - { 10080, -1 }, /* Color3fVertex3fvSUN */ - { 10518, -1 }, /* Color4fNormal3fVertex3fvSUN */ - { 11358, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ - { 12787, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ - { 14398, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ - { 14891, -1 }, /* TexCoord2fColor3fVertex3fSUN */ - { 15943, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ - { 16358, -1 }, /* Color4ubVertex2fvSUN */ - { 16645, -1 }, /* Normal3fVertex3fSUN */ - { 17718, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ - { 18079, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ - { 18897, -1 }, /* TexCoord2fVertex3fvSUN */ - { 19673, -1 }, /* Color4ubVertex2fSUN */ - { 19911, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ - { 21893, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ - { 22325, -1 }, /* Normal3fVertex3fvSUN */ - { 22791, -1 }, /* Color4fNormal3fVertex3fSUN */ - { 23771, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ - { 25840, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ - { 27196, -1 }, /* TexCoord4fVertex4fSUN */ - { 27622, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ - { 28009, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ - { 28136, -1 }, /* TexCoord4fVertex4fvSUN */ - { 28870, -1 }, /* ReplacementCodeuiVertex3fSUN */ + { 1154, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */ + { 1352, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */ + { 1578, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */ + { 1908, -1 }, /* ReplacementCodeuiVertex3fvSUN */ + { 2042, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */ + { 2600, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */ + { 2913, -1 }, /* Color4ubVertex3fvSUN */ + { 4639, -1 }, /* Color4ubVertex3fSUN */ + { 4762, -1 }, /* TexCoord2fVertex3fSUN */ + { 5106, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */ + { 5599, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */ + { 6251, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ + { 7031, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ + { 7390, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ + { 8102, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ + { 8906, -1 }, /* Color3fVertex3fSUN */ + { 10076, -1 }, /* Color3fVertex3fvSUN */ + { 10514, -1 }, /* Color4fNormal3fVertex3fvSUN */ + { 11343, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ + { 12811, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ + { 14351, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ + { 14877, -1 }, /* TexCoord2fColor3fVertex3fSUN */ + { 15929, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ + { 16344, -1 }, /* Color4ubVertex2fvSUN */ + { 16631, -1 }, /* Normal3fVertex3fSUN */ + { 17704, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ + { 18065, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ + { 18883, -1 }, /* TexCoord2fVertex3fvSUN */ + { 19659, -1 }, /* Color4ubVertex2fSUN */ + { 19897, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ + { 21896, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ + { 22328, -1 }, /* Normal3fVertex3fvSUN */ + { 22794, -1 }, /* Color4fNormal3fVertex3fSUN */ + { 23774, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ + { 25876, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ + { 27299, -1 }, /* TexCoord4fVertex4fSUN */ + { 27725, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ + { 28164, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ + { 28291, -1 }, /* TexCoord4fVertex4fvSUN */ + { 29025, -1 }, /* ReplacementCodeuiVertex3fSUN */ { -1, -1 } }; #endif @@ -6408,40 +6440,40 @@ static const struct gl_function_remap GL_SUN_vertex_functions[] = { #if defined(need_GL_VERSION_1_3) /* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_VERSION_1_3_functions[] = { - { 425, _gloffset_MultiTexCoord3sARB }, - { 657, _gloffset_ActiveTextureARB }, - { 4247, _gloffset_MultiTexCoord1fvARB }, - { 6155, _gloffset_MultiTexCoord3dARB }, - { 6200, _gloffset_MultiTexCoord2iARB }, - { 6324, _gloffset_MultiTexCoord2svARB }, - { 8341, _gloffset_MultiTexCoord2fARB }, - { 10354, _gloffset_MultiTexCoord3fvARB }, - { 10967, _gloffset_MultiTexCoord4sARB }, - { 11648, _gloffset_MultiTexCoord2dvARB }, - { 12063, _gloffset_MultiTexCoord1svARB }, - { 12435, _gloffset_MultiTexCoord3svARB }, - { 12496, _gloffset_MultiTexCoord4iARB }, - { 13266, _gloffset_MultiTexCoord3iARB }, - { 14136, _gloffset_MultiTexCoord1dARB }, - { 14353, _gloffset_MultiTexCoord3dvARB }, - { 15599, _gloffset_MultiTexCoord3ivARB }, - { 15644, _gloffset_MultiTexCoord2sARB }, - { 17045, _gloffset_MultiTexCoord4ivARB }, - { 18997, _gloffset_ClientActiveTextureARB }, - { 21297, _gloffset_MultiTexCoord2dARB }, - { 21717, _gloffset_MultiTexCoord4dvARB }, - { 22073, _gloffset_MultiTexCoord4fvARB }, - { 23023, _gloffset_MultiTexCoord3fARB }, - { 25531, _gloffset_MultiTexCoord4dARB }, - { 25797, _gloffset_MultiTexCoord1sARB }, - { 26001, _gloffset_MultiTexCoord1dvARB }, - { 26942, _gloffset_MultiTexCoord1ivARB }, - { 27035, _gloffset_MultiTexCoord2ivARB }, - { 27374, _gloffset_MultiTexCoord1iARB }, - { 28738, _gloffset_MultiTexCoord4svARB }, - { 29312, _gloffset_MultiTexCoord1fARB }, - { 29575, _gloffset_MultiTexCoord4fARB }, - { 32039, _gloffset_MultiTexCoord2fvARB }, + { 464, _gloffset_MultiTexCoord3sARB }, + { 696, _gloffset_ActiveTextureARB }, + { 4234, _gloffset_MultiTexCoord1fvARB }, + { 6142, _gloffset_MultiTexCoord3dARB }, + { 6187, _gloffset_MultiTexCoord2iARB }, + { 6311, _gloffset_MultiTexCoord2svARB }, + { 8311, _gloffset_MultiTexCoord2fARB }, + { 10350, _gloffset_MultiTexCoord3fvARB }, + { 10952, _gloffset_MultiTexCoord4sARB }, + { 11633, _gloffset_MultiTexCoord2dvARB }, + { 12048, _gloffset_MultiTexCoord1svARB }, + { 12459, _gloffset_MultiTexCoord3svARB }, + { 12520, _gloffset_MultiTexCoord4iARB }, + { 13290, _gloffset_MultiTexCoord3iARB }, + { 14089, _gloffset_MultiTexCoord1dARB }, + { 14306, _gloffset_MultiTexCoord3dvARB }, + { 15585, _gloffset_MultiTexCoord3ivARB }, + { 15630, _gloffset_MultiTexCoord2sARB }, + { 17031, _gloffset_MultiTexCoord4ivARB }, + { 18983, _gloffset_ClientActiveTextureARB }, + { 21283, _gloffset_MultiTexCoord2dARB }, + { 21720, _gloffset_MultiTexCoord4dvARB }, + { 22076, _gloffset_MultiTexCoord4fvARB }, + { 23026, _gloffset_MultiTexCoord3fARB }, + { 25567, _gloffset_MultiTexCoord4dARB }, + { 25833, _gloffset_MultiTexCoord1sARB }, + { 26037, _gloffset_MultiTexCoord1dvARB }, + { 27045, _gloffset_MultiTexCoord1ivARB }, + { 27138, _gloffset_MultiTexCoord2ivARB }, + { 27477, _gloffset_MultiTexCoord1iARB }, + { 28893, _gloffset_MultiTexCoord4svARB }, + { 29467, _gloffset_MultiTexCoord1fARB }, + { 29730, _gloffset_MultiTexCoord4fARB }, + { 32155, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; #endif diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 3d1a8f8..23c662b 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1481,7 +1481,7 @@ _mesa_add_color_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLboolean frontLeft, GLboolean backLeft, GLboolean frontRight, GLboolean backRight) { - GLuint b; + gl_buffer_index b; if (rgbBits > 16 || alphaBits > 16) { _mesa_problem(ctx, @@ -1545,7 +1545,7 @@ _mesa_add_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLboolean frontLeft, GLboolean backLeft, GLboolean frontRight, GLboolean backRight) { - GLuint b; + gl_buffer_index b; /* for window system framebuffers only! */ assert(fb->Name == 0); @@ -1883,10 +1883,11 @@ _mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, /** * Attach a renderbuffer to a framebuffer. + * \param bufferName one of the BUFFER_x tokens */ void _mesa_add_renderbuffer(struct gl_framebuffer *fb, - GLuint bufferName, struct gl_renderbuffer *rb) + gl_buffer_index bufferName, struct gl_renderbuffer *rb) { assert(fb); assert(rb); @@ -1916,9 +1917,11 @@ _mesa_add_renderbuffer(struct gl_framebuffer *fb, /** * Remove the named renderbuffer from the given framebuffer. + * \param bufferName one of the BUFFER_x tokens */ void -_mesa_remove_renderbuffer(struct gl_framebuffer *fb, GLuint bufferName) +_mesa_remove_renderbuffer(struct gl_framebuffer *fb, + gl_buffer_index bufferName) { struct gl_renderbuffer *rb; diff --git a/src/mesa/main/renderbuffer.h b/src/mesa/main/renderbuffer.h index 62e812f..4702a8e 100644 --- a/src/mesa/main/renderbuffer.h +++ b/src/mesa/main/renderbuffer.h @@ -27,6 +27,7 @@ #define RENDERBUFFER_H #include "glheader.h" +#include "mtypes.h" struct gl_context; struct gl_framebuffer; @@ -95,10 +96,11 @@ _mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, extern void _mesa_add_renderbuffer(struct gl_framebuffer *fb, - GLuint bufferName, struct gl_renderbuffer *rb); + gl_buffer_index bufferName, struct gl_renderbuffer *rb); extern void -_mesa_remove_renderbuffer(struct gl_framebuffer *fb, GLuint bufferName); +_mesa_remove_renderbuffer(struct gl_framebuffer *fb, + gl_buffer_index bufferName); extern void _mesa_reference_renderbuffer(struct gl_renderbuffer **ptr, diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c index 4cf0bc2..df66599 100644 --- a/src/mesa/main/scissor.c +++ b/src/mesa/main/scissor.c @@ -25,6 +25,7 @@ #include "main/glheader.h" #include "main/context.h" +#include "main/mtypes.h" #include "main/scissor.h" diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 96df58d..2ffd8be 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -41,6 +41,8 @@ #include "main/dispatch.h" #include "main/enums.h" #include "main/hash.h" +#include "main/mfeatures.h" +#include "main/mtypes.h" #include "main/shaderapi.h" #include "main/shaderobj.h" #include "program/program.h" @@ -48,6 +50,7 @@ #include "program/prog_uniform.h" #include "talloc.h" #include <stdbool.h> +#include "../glsl/glsl_parser_extras.h" /** Define this to enable shader substitution (see below) */ #define SHADER_SUBST 0 @@ -1637,8 +1640,7 @@ _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, void GLAPIENTRY _mesa_ReleaseShaderCompiler(void) { - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); + _mesa_destroy_shader_compiler_caches(); } @@ -1881,6 +1883,9 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec) SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation); SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation); + /* GL_ARB_ES2_compatibility */ + SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler); + #endif /* FEATURE_GL */ } diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index 216bbce..647fd31 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -32,6 +32,8 @@ #include "main/glheader.h" #include "main/context.h" #include "main/hash.h" +#include "main/mfeatures.h" +#include "main/mtypes.h" #include "main/shaderobj.h" #include "program/program.h" #include "program/prog_parameter.h" diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 3abee01..ce9fc4d 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -30,6 +30,7 @@ #include "imports.h" +#include "mfeatures.h" #include "mtypes.h" #include "hash.h" #if FEATURE_ATI_fragment_shader diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index 2c8bcbe..e1a5c6c 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -59,8 +59,10 @@ #include "imports.h" #include "context.h" #include "macros.h" +#include "mfeatures.h" #include "get.h" #include "dispatch.h" +#include "mtypes.h" #if FEATURE_ARB_sync #include "syncobj.h" diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index e3d2a78..7a0b522 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -34,6 +34,8 @@ #include "imports.h" #include "colormac.h" #include "formats.h" +#include "mfeatures.h" +#include "mtypes.h" #include "texcompress.h" diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 8385642..19b08bb 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -25,8 +25,11 @@ #ifndef TEXCOMPRESS_H #define TEXCOMPRESS_H -#include "mtypes.h" #include "formats.h" +#include "glheader.h" +#include "mfeatures.h" + +struct gl_context; #if _HAVE_FULL_GL diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 33f46d4..bb7fb56 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -34,6 +34,7 @@ #include "colormac.h" #include "image.h" #include "macros.h" +#include "mfeatures.h" #include "mipmap.h" #include "texcompress.h" #include "texcompress_fxt1.h" diff --git a/src/mesa/main/texcompress_fxt1.h b/src/mesa/main/texcompress_fxt1.h index 38048b2..b991f4c 100644 --- a/src/mesa/main/texcompress_fxt1.h +++ b/src/mesa/main/texcompress_fxt1.h @@ -26,6 +26,7 @@ #define TEXCOMPRESS_FXT1_H #include "glheader.h" +#include "mfeatures.h" #include "texstore.h" struct gl_texture_image; diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 0e893a5..25257ec 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -39,6 +39,8 @@ #include "dlopen.h" #include "image.h" #include "macros.h" +#include "mfeatures.h" +#include "mtypes.h" #include "texcompress.h" #include "texcompress_s3tc.h" #include "texstore.h" diff --git a/src/mesa/main/texcompress_s3tc.h b/src/mesa/main/texcompress_s3tc.h index d0a5b18..74a0343 100644 --- a/src/mesa/main/texcompress_s3tc.h +++ b/src/mesa/main/texcompress_s3tc.h @@ -25,9 +25,13 @@ #ifndef TEXCOMPRESS_S3TC_H #define TEXCOMPRESS_S3TC_H -#include "main/mtypes.h" +#include "compiler.h" +#include "glheader.h" +#include "mfeatures.h" #include "texstore.h" +struct gl_context; +struct gl_texture_image; #if FEATURE_texture_s3tc diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index 508dbf4..194bcbe 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -34,6 +34,7 @@ #include "main/context.h" #include "main/enums.h" #include "main/macros.h" +#include "main/mtypes.h" #include "main/texenv.h" #include "main/texstate.h" diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index a8bffe4..c1380f2 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -28,6 +28,7 @@ #include "glheader.h" #include "imports.h" +#include "mtypes.h" #include "program/program.h" #include "program/prog_parameter.h" #include "program/prog_cache.h" @@ -1466,7 +1467,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key, p.last_tex_stage = 0; release_temps(ctx, &p); - if (key->enabled_units) { + if (key->enabled_units && key->num_draw_buffers) { GLboolean needbumpstage = GL_FALSE; /* Zeroth pass - bump map textures first */ @@ -1559,7 +1560,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key, _mesa_copy_instructions(p.program->Base.Instructions, instBuffer, p.program->Base.NumInstructions); - if (p.program->FogOption) { + if (key->num_draw_buffers && p.program->FogOption) { _mesa_append_fog_code(ctx, p.program); p.program->FogOption = GL_NONE; } diff --git a/src/mesa/main/texenvprogram.h b/src/mesa/main/texenvprogram.h index abfb916..22e30a5 100644 --- a/src/mesa/main/texenvprogram.h +++ b/src/mesa/main/texenvprogram.h @@ -27,7 +27,7 @@ #define TEXENVPROGRAM_H -#include "mtypes.h" +struct gl_context; extern struct gl_fragment_program * _mesa_get_fixed_func_fragment_program(struct gl_context *ctx); diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 372ef26..1135120 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -237,6 +237,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = store_texel_argb1555_rev }, { + MESA_FORMAT_AL44, + fetch_texel_1d_f_al44, + fetch_texel_2d_f_al44, + fetch_texel_3d_f_al44, + store_texel_al44 + }, + { MESA_FORMAT_AL88, fetch_texel_1d_f_al88, fetch_texel_2d_f_al88, @@ -279,6 +286,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = store_texel_a8 }, { + MESA_FORMAT_A16, + fetch_texel_1d_f_a16, + fetch_texel_2d_f_a16, + fetch_texel_3d_f_a16, + store_texel_a16 + }, + { MESA_FORMAT_L8, fetch_texel_1d_f_l8, fetch_texel_2d_f_l8, @@ -286,6 +300,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = store_texel_l8 }, { + MESA_FORMAT_L16, + fetch_texel_1d_f_l16, + fetch_texel_2d_f_l16, + fetch_texel_3d_f_l16, + store_texel_l16 + }, + { MESA_FORMAT_I8, fetch_texel_1d_f_i8, fetch_texel_2d_f_i8, @@ -293,6 +314,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = store_texel_i8 }, { + MESA_FORMAT_I16, + fetch_texel_1d_f_i16, + fetch_texel_2d_f_i16, + fetch_texel_3d_f_i16, + store_texel_i16 + }, + { MESA_FORMAT_CI8, fetch_texel_1d_f_ci8, fetch_texel_2d_f_ci8, @@ -356,6 +384,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = store_texel_rg1616_rev, }, { + MESA_FORMAT_ARGB2101010, + fetch_texel_1d_f_argb2101010, + fetch_texel_2d_f_argb2101010, + fetch_texel_3d_f_argb2101010, + store_texel_argb2101010 + }, + { MESA_FORMAT_Z24_S8, fetch_texel_1d_f_z24_s8, fetch_texel_2d_f_z24_s8, @@ -724,7 +759,7 @@ texfetch_funcs[MESA_FORMAT_COUNT] = }; -static FetchTexelFuncF +FetchTexelFuncF _mesa_get_texel_fetch_func(gl_format format, GLuint dims) { #ifdef DEBUG diff --git a/src/mesa/main/texfetch.h b/src/mesa/main/texfetch.h index ef13bf2..e78079a 100644 --- a/src/mesa/main/texfetch.h +++ b/src/mesa/main/texfetch.h @@ -34,6 +34,9 @@ extern StoreTexelFunc _mesa_get_texel_store_func(gl_format format); +extern FetchTexelFuncF +_mesa_get_texel_fetch_func(gl_format format, GLuint dims); + extern void _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims); diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 2f583ed..36dede5 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -135,7 +135,7 @@ static void store_texel_rgba_f32(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel) { const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4); dst[0] = depth[RCOMP]; dst[1] = depth[GCOMP]; dst[2] = depth[BCOMP]; @@ -163,9 +163,12 @@ static void FETCH(f_rgba_f16)( const struct gl_texture_image *texImage, static void store_texel_rgba_f16(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel) { - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); + const GLfloat *src = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4); + dst[0] = _mesa_float_to_half(src[RCOMP]); + dst[1] = _mesa_float_to_half(src[GCOMP]); + dst[2] = _mesa_float_to_half(src[BCOMP]); + dst[3] = _mesa_float_to_half(src[ACOMP]); } #endif @@ -188,9 +191,11 @@ static void FETCH(f_rgb_f32)( const struct gl_texture_image *texImage, static void store_texel_rgb_f32(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel) { - const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = *depth; + const GLfloat *src = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3); + dst[0] = src[RCOMP]; + dst[1] = src[GCOMP]; + dst[2] = src[BCOMP]; } #endif @@ -214,9 +219,11 @@ static void FETCH(f_rgb_f16)( const struct gl_texture_image *texImage, static void store_texel_rgb_f16(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel) { - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); + const GLfloat *src = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3); + dst[0] = _mesa_float_to_half(src[RCOMP]); + dst[1] = _mesa_float_to_half(src[GCOMP]); + dst[2] = _mesa_float_to_half(src[BCOMP]); } #endif @@ -810,6 +817,31 @@ static void store_texel_argb1555_rev(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_ARGB2101010 ***************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb2101010 texture, return 4 GLchans */ +static void FETCH(f_argb2101010)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + const GLuint s = *src; + texel[RCOMP] = ((s >> 20) & 0x3ff) * (1.0F / 1023.0F); + texel[GCOMP] = ((s >> 10) & 0x3ff) * (1.0F / 1023.0F); + texel[BCOMP] = ((s >> 0) & 0x3ff) * (1.0F / 1023.0F); + texel[ACOMP] = ((s >> 30) & 0x03) * (1.0F / 3.0F); +} + +#if DIM == 3 +static void store_texel_argb2101010(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_2101010_UB(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + /* MESA_FORMAT_RG88 **********************************************************/ /* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */ @@ -858,6 +890,30 @@ static void store_texel_rg88_rev(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_AL44 **********************************************************/ + +/* Fetch texel from 1D, 2D or 3D al44 texture, return 4 GLchans */ +static void FETCH(f_al44)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte s = *TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = (s & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); +} + +#if DIM == 3 +static void store_texel_al44(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = PACK_COLOR_44(rgba[ACOMP], rgba[RCOMP]); +} +#endif + + /* MESA_FORMAT_AL88 **********************************************************/ /* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ @@ -1099,6 +1155,30 @@ static void store_texel_a8(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_A16 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ +static void FETCH(f_a16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = USHORT_TO_FLOAT( src[0] ); +} + +#if DIM == 3 +static void store_texel_a16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *rgba = (const GLushort *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = rgba[ACOMP]; +} +#endif + + /* MESA_FORMAT_L8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ @@ -1123,6 +1203,30 @@ static void store_texel_l8(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_L16 ***********************************************************/ + +/* Fetch texel from 1D, 2D or 3D l16 texture, return 4 GLchans */ +static void FETCH(f_l16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = USHORT_TO_FLOAT( src[0] ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_l16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *rgba = (const GLushort *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + /* MESA_FORMAT_I8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ @@ -1147,6 +1251,30 @@ static void store_texel_i8(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_I16 ***********************************************************/ + +/* Fetch texel from 1D, 2D or 3D i16 texture, return 4 GLchans */ +static void FETCH(f_i16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = USHORT_TO_FLOAT( src[0] ); +} + +#if DIM == 3 +static void store_texel_i16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *rgba = (const GLushort *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + /* MESA_FORMAT_CI8 ***********************************************************/ /* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 894c013..146b2b3 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -34,9 +34,15 @@ #include "context.h" +#include "mfeatures.h" +#include "mtypes.h" #include "texcompress.h" #include "texformat.h" +#define RETURN_IF_SUPPORTED(f) do { \ + if (ctx->TextureFormatSupported[f]) \ + return f; \ +} while (0) /** * Choose an appropriate texture format given the format, type and @@ -64,75 +70,132 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, /* shallow RGBA formats */ case 4: case GL_RGBA: + if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); + } + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; + case GL_RGBA8: - return MESA_FORMAT_RGBA8888; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; case GL_RGB5_A1: - return MESA_FORMAT_ARGB1555; + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); + break; case GL_RGBA2: - return MESA_FORMAT_ARGB4444_REV; /* just to test another format*/ + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_REV); /* just to test another format*/ + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + break; case GL_RGBA4: - return MESA_FORMAT_ARGB4444; + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + break; /* deep RGBA formats */ case GL_RGB10_A2: + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; case GL_RGBA12: case GL_RGBA16: - return MESA_FORMAT_RGBA_16; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; /* shallow RGB formats */ case 3: case GL_RGB: case GL_RGB8: - return MESA_FORMAT_RGB888; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; case GL_R3_G3_B2: - return MESA_FORMAT_RGB332; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; case GL_RGB4: - return MESA_FORMAT_RGB565_REV; /* just to test another format */ + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); /* just to test another format */ + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + break; case GL_RGB5: - return MESA_FORMAT_RGB565; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + break; /* deep RGB formats */ case GL_RGB10: case GL_RGB12: case GL_RGB16: - return MESA_FORMAT_RGBA_16; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; /* Alpha formats */ case GL_ALPHA: case GL_ALPHA4: + case GL_ALPHA8: + RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + break; + case GL_ALPHA12: case GL_ALPHA16: - case GL_ALPHA8: - return MESA_FORMAT_A8; + RETURN_IF_SUPPORTED(MESA_FORMAT_A16); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + break; /* Luminance formats */ case 1: case GL_LUMINANCE: case GL_LUMINANCE4: + case GL_LUMINANCE8: + RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + break; + case GL_LUMINANCE12: case GL_LUMINANCE16: - case GL_LUMINANCE8: - return MESA_FORMAT_L8; + RETURN_IF_SUPPORTED(MESA_FORMAT_L16); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + break; /* Luminance/Alpha formats */ + case GL_LUMINANCE4_ALPHA4: + RETURN_IF_SUPPORTED(MESA_FORMAT_AL44); + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; + case 2: case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: case GL_LUMINANCE6_ALPHA2: case GL_LUMINANCE8_ALPHA8: - return MESA_FORMAT_AL88; + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - return MESA_FORMAT_AL1616; + RETURN_IF_SUPPORTED(MESA_FORMAT_AL1616); + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; case GL_INTENSITY: case GL_INTENSITY4: + case GL_INTENSITY8: + RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + break; + case GL_INTENSITY12: case GL_INTENSITY16: - case GL_INTENSITY8: - return MESA_FORMAT_I8; + RETURN_IF_SUPPORTED(MESA_FORMAT_I16); + RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + break; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: @@ -141,7 +204,8 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: case GL_COLOR_INDEX8_EXT: - return MESA_FORMAT_CI8; + RETURN_IF_SUPPORTED(MESA_FORMAT_CI8); + break; default: ; /* fallthrough */ @@ -152,9 +216,12 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - return MESA_FORMAT_Z32; + RETURN_IF_SUPPORTED(MESA_FORMAT_Z32); + RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + break; case GL_DEPTH_COMPONENT16: - return MESA_FORMAT_Z16; + RETURN_IF_SUPPORTED(MESA_FORMAT_Z16); + RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); default: ; /* fallthrough */ } @@ -162,27 +229,36 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, switch (internalFormat) { case GL_COMPRESSED_ALPHA_ARB: - return MESA_FORMAT_A8; + RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + break; case GL_COMPRESSED_LUMINANCE_ARB: - return MESA_FORMAT_L8; + RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + break; case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - return MESA_FORMAT_AL88; + RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + break; case GL_COMPRESSED_INTENSITY_ARB: - return MESA_FORMAT_I8; + RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + break; case GL_COMPRESSED_RGB_ARB: if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) - return MESA_FORMAT_RGB_DXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1); if (ctx->Extensions.TDFX_texture_compression_FXT1) - return MESA_FORMAT_RGB_FXT1; - return MESA_FORMAT_RGB888; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; case GL_COMPRESSED_RGBA_ARB: if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) - return MESA_FORMAT_RGBA_DXT3; /* Not rgba_dxt1, see spec */ + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */ if (ctx->Extensions.TDFX_texture_compression_FXT1) - return MESA_FORMAT_RGBA_FXT1; - return MESA_FORMAT_RGBA8888; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); + break; default: ; /* fallthrough */ } @@ -190,9 +266,9 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, if (ctx->Extensions.MESA_ycbcr_texture) { if (internalFormat == GL_YCBCR_MESA) { if (type == GL_UNSIGNED_SHORT_8_8_MESA) - return MESA_FORMAT_YCBCR; + RETURN_IF_SUPPORTED(MESA_FORMAT_YCBCR); else - return MESA_FORMAT_YCBCR_REV; + RETURN_IF_SUPPORTED(MESA_FORMAT_YCBCR_REV); } } @@ -200,9 +276,11 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: - return MESA_FORMAT_RGB_FXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1); + break; case GL_COMPRESSED_RGBA_FXT1_3DFX: - return MESA_FORMAT_RGBA_FXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1); + break; default: ; /* fallthrough */ } @@ -213,13 +291,17 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, if (ctx->Extensions.EXT_texture_compression_s3tc) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return MESA_FORMAT_RGB_DXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1); + break; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return MESA_FORMAT_RGBA_DXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT1); + break; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return MESA_FORMAT_RGBA_DXT3; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); + break; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return MESA_FORMAT_RGBA_DXT5; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT5); + break; default: ; /* fallthrough */ } @@ -229,10 +311,12 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, switch (internalFormat) { case GL_RGB_S3TC: case GL_RGB4_S3TC: - return MESA_FORMAT_RGB_DXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1); + break; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - return MESA_FORMAT_RGBA_DXT3; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); + break; default: ; /* fallthrough */ } @@ -242,29 +326,41 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, if (ctx->Extensions.ARB_texture_float) { switch (internalFormat) { case GL_ALPHA16F_ARB: - return MESA_FORMAT_ALPHA_FLOAT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16); + break; case GL_ALPHA32F_ARB: - return MESA_FORMAT_ALPHA_FLOAT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32); + break; case GL_LUMINANCE16F_ARB: - return MESA_FORMAT_LUMINANCE_FLOAT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16); + break; case GL_LUMINANCE32F_ARB: - return MESA_FORMAT_LUMINANCE_FLOAT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32); + break; case GL_LUMINANCE_ALPHA16F_ARB: - return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16); + break; case GL_LUMINANCE_ALPHA32F_ARB: - return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32); + break; case GL_INTENSITY16F_ARB: - return MESA_FORMAT_INTENSITY_FLOAT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16); + break; case GL_INTENSITY32F_ARB: - return MESA_FORMAT_INTENSITY_FLOAT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32); + break; case GL_RGB16F_ARB: - return MESA_FORMAT_RGB_FLOAT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); + break; case GL_RGB32F_ARB: - return MESA_FORMAT_RGB_FLOAT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); + break; case GL_RGBA16F_ARB: - return MESA_FORMAT_RGBA_FLOAT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); + break; case GL_RGBA32F_ARB: - return MESA_FORMAT_RGBA_FLOAT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); + break; default: ; /* fallthrough */ } @@ -274,7 +370,9 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, switch (internalFormat) { case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return MESA_FORMAT_Z24_S8; + RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_S8); + RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + break; default: ; /* fallthrough */ } @@ -284,7 +382,8 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, switch (internalFormat) { case GL_DUDV_ATI: case GL_DU8DV8_ATI: - return MESA_FORMAT_DUDV8; + RETURN_IF_SUPPORTED(MESA_FORMAT_DUDV8); + break; default: ; /* fallthrough */ } @@ -294,7 +393,9 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, switch (internalFormat) { case GL_RGBA_SNORM: case GL_RGBA8_SNORM: - return MESA_FORMAT_SIGNED_RGBA8888; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + break; default: ; /* fallthrough */ } @@ -304,24 +405,32 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, switch (internalFormat) { case GL_RED_SNORM: case GL_R8_SNORM: - return MESA_FORMAT_SIGNED_R8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R8); + break; case GL_RG_SNORM: case GL_RG8_SNORM: - return MESA_FORMAT_SIGNED_RG88; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG88); + break; case GL_RGB_SNORM: case GL_RGB8_SNORM: - return MESA_FORMAT_SIGNED_RGBX8888; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888); + break; case GL_RGBA_SNORM: case GL_RGBA8_SNORM: - return MESA_FORMAT_SIGNED_RGBA8888; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); + break; case GL_R16_SNORM: - return MESA_FORMAT_SIGNED_R_16; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R_16); + break; case GL_RG16_SNORM: - return MESA_FORMAT_SIGNED_RG_16; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG_16); + break; case GL_RGB16_SNORM: - return MESA_FORMAT_SIGNED_RGB_16; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16); + break; case GL_RGBA16_SNORM: - return MESA_FORMAT_SIGNED_RGBA_16; + RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); + break; default: ; /* fall-through */ } @@ -332,48 +441,68 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, switch (internalFormat) { case GL_SRGB_EXT: case GL_SRGB8_EXT: - return MESA_FORMAT_SRGB8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: - return MESA_FORMAT_SRGBA8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; case GL_SLUMINANCE_EXT: case GL_SLUMINANCE8_EXT: - return MESA_FORMAT_SL8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: - return MESA_FORMAT_SLA8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; case GL_COMPRESSED_SLUMINANCE_EXT: - return MESA_FORMAT_SL8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return MESA_FORMAT_SLA8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; case GL_COMPRESSED_SRGB_EXT: #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) - return MESA_FORMAT_SRGB_DXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); #endif - return MESA_FORMAT_SRGB8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; case GL_COMPRESSED_SRGB_ALPHA_EXT: #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) - return MESA_FORMAT_SRGBA_DXT3; /* Not srgba_dxt1, see spec */ + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, see spec */ #endif - return MESA_FORMAT_SRGBA8; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + break; #if FEATURE_texture_s3tc case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return MESA_FORMAT_SRGB_DXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return MESA_FORMAT_SRGBA_DXT1; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT1); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return MESA_FORMAT_SRGBA_DXT3; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return MESA_FORMAT_SRGBA_DXT5; + RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT5); + RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; #endif default: @@ -390,42 +519,48 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, case GL_INTENSITY32UI_EXT: case GL_LUMINANCE32UI_EXT: case GL_LUMINANCE_ALPHA32UI_EXT: - return MESA_FORMAT_RGBA_UINT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); + break; case GL_RGBA16UI_EXT: case GL_RGB16UI_EXT: case GL_ALPHA16UI_EXT: case GL_INTENSITY16UI_EXT: case GL_LUMINANCE16UI_EXT: case GL_LUMINANCE_ALPHA16UI_EXT: - return MESA_FORMAT_RGBA_UINT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); + break; case GL_RGBA8UI_EXT: case GL_RGB8UI_EXT: case GL_ALPHA8UI_EXT: case GL_INTENSITY8UI_EXT: case GL_LUMINANCE8UI_EXT: case GL_LUMINANCE_ALPHA8UI_EXT: - return MESA_FORMAT_RGBA_UINT8; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); + break; case GL_RGBA32I_EXT: case GL_RGB32I_EXT: case GL_ALPHA32I_EXT: case GL_INTENSITY32I_EXT: case GL_LUMINANCE32I_EXT: case GL_LUMINANCE_ALPHA32I_EXT: - return MESA_FORMAT_RGBA_INT32; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); + break; case GL_RGBA16I_EXT: case GL_RGB16I_EXT: case GL_ALPHA16I_EXT: case GL_INTENSITY16I_EXT: case GL_LUMINANCE16I_EXT: case GL_LUMINANCE_ALPHA16I_EXT: - return MESA_FORMAT_RGBA_INT16; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); + break; case GL_RGBA8I_EXT: case GL_RGB8I_EXT: case GL_ALPHA8I_EXT: case GL_INTENSITY8I_EXT: case GL_LUMINANCE8I_EXT: case GL_LUMINANCE_ALPHA8I_EXT: - return MESA_FORMAT_RGBA_INT8; + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); + break; } } @@ -434,18 +569,22 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, case GL_R8: case GL_RED: case GL_COMPRESSED_RED: - return MESA_FORMAT_R8; + RETURN_IF_SUPPORTED(MESA_FORMAT_R8); + break; case GL_R16: - return MESA_FORMAT_R16; + RETURN_IF_SUPPORTED(MESA_FORMAT_R16); + break; case GL_RG: case GL_RG8: case GL_COMPRESSED_RG: - return MESA_FORMAT_RG88; + RETURN_IF_SUPPORTED(MESA_FORMAT_RG88); + break; case GL_RG16: - return MESA_FORMAT_RG1616; + RETURN_IF_SUPPORTED(MESA_FORMAT_RG1616); + break; default: ; /* fallthrough */ diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 8bd1507..3cf0921 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -27,9 +27,9 @@ #define TEXFORMAT_H -#include "mtypes.h" #include "formats.h" +struct gl_context; extern gl_format _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 108ea4c..0ace0b9 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -34,6 +34,7 @@ #include "main/context.h" #include "main/enums.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/texgen.h" #include "main/texstate.h" #include "math/m_matrix.h" diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h index 9ed8023..336ffce 100644 --- a/src/mesa/main/texgen.h +++ b/src/mesa/main/texgen.h @@ -29,6 +29,7 @@ #include "compiler.h" #include "glheader.h" +#include "mfeatures.h" struct _glapi_table; diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 879ac52..da61079 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -35,6 +35,8 @@ #include "context.h" #include "formats.h" #include "image.h" +#include "mfeatures.h" +#include "mtypes.h" #include "pack.h" #include "texgetimage.h" #include "teximage.h" @@ -120,10 +122,15 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions, const GLint height = texImage->Height; const GLint depth = texImage->Depth; GLint img, row, col; + GLfloat *depthRow = (GLfloat *) malloc(width * sizeof(GLfloat)); + + if (!depthRow) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage"); + return; + } for (img = 0; img < depth; img++) { for (row = 0; row < height; row++) { - GLfloat depthRow[MAX_WIDTH]; void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, width, height, format, type, img, row, 0); @@ -135,6 +142,8 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions, _mesa_pack_depth_span(ctx, width, dest, type, depthRow, &ctx->Pack); } } + + free(depthRow); } @@ -244,6 +253,12 @@ get_tex_srgb(struct gl_context *ctx, GLuint dimensions, const GLint depth = texImage->Depth; const GLbitfield transferOps = 0x0; GLint img, row; + GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * width * sizeof(GLfloat)); + + if (!rgba) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage"); + return; + } for (img = 0; img < depth; img++) { for (row = 0; row < height; row++) { @@ -251,7 +266,6 @@ get_tex_srgb(struct gl_context *ctx, GLuint dimensions, width, height, format, type, img, row, 0); - GLfloat rgba[MAX_WIDTH][4]; GLint col; /* convert row to RGBA format */ @@ -279,6 +293,8 @@ get_tex_srgb(struct gl_context *ctx, GLuint dimensions, &ctx->Pack, transferOps); } } + + free(rgba); } @@ -314,13 +330,18 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions, */ GLbitfield transferOps = 0x0; GLint img, row; + GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * width * sizeof(GLfloat)); + + if (!rgba) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage"); + return; + } for (img = 0; img < depth; img++) { for (row = 0; row < height; row++) { void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, width, height, format, type, img, row, 0); - GLfloat rgba[MAX_WIDTH][4]; GLint col; GLenum dataType = _mesa_get_format_datatype(texImage->TexFormat); @@ -364,6 +385,8 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions, &ctx->Pack, transferOps); } } + + free(rgba); } @@ -411,11 +434,21 @@ get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type, GLvoid *pixel type == GL_UNSIGNED_BYTE) { memCopy = GL_TRUE; } + else if (texImage->TexFormat == MESA_FORMAT_L16 && + format == GL_LUMINANCE && + type == GL_UNSIGNED_SHORT) { + memCopy = GL_TRUE; + } else if (texImage->TexFormat == MESA_FORMAT_A8 && format == GL_ALPHA && type == GL_UNSIGNED_BYTE) { memCopy = GL_TRUE; } + else if (texImage->TexFormat == MESA_FORMAT_A16 && + format == GL_ALPHA && + type == GL_UNSIGNED_SHORT) { + memCopy = GL_TRUE; + } } if (memCopy) { diff --git a/src/mesa/main/texgetimage.h b/src/mesa/main/texgetimage.h index 81a3bbb..ef420dd 100644 --- a/src/mesa/main/texgetimage.h +++ b/src/mesa/main/texgetimage.h @@ -27,7 +27,11 @@ #ifndef TEXGETIMAGE_H #define TEXGETIMAGE_H -#include "mtypes.h" +#include "glheader.h" + +struct gl_context; +struct gl_texture_image; +struct gl_texture_object; extern void _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level, diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 060f34b..47d5093 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -40,6 +40,7 @@ #include "image.h" #include "imports.h" #include "macros.h" +#include "mfeatures.h" #include "state.h" #include "texcompress.h" #include "texfetch.h" @@ -340,11 +341,11 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) return GL_RGBA; case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: - case GL_COMPRESSED_SLUMINANCE_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: return GL_LUMINANCE_ALPHA; case GL_SLUMINANCE_EXT: case GL_SLUMINANCE8_EXT: + case GL_COMPRESSED_SLUMINANCE_EXT: return GL_LUMINANCE; default: ; /* fallthrough */ @@ -636,6 +637,47 @@ _mesa_is_proxy_texture(GLenum target) /** + * Return the proxy target which corresponds to the given texture target + */ +static GLenum +get_proxy_target(GLenum target) +{ + switch (target) { + case GL_TEXTURE_1D: + case GL_PROXY_TEXTURE_1D: + return GL_PROXY_TEXTURE_1D; + case GL_TEXTURE_2D: + case GL_PROXY_TEXTURE_2D: + return GL_PROXY_TEXTURE_2D; + case GL_TEXTURE_3D: + case GL_PROXY_TEXTURE_3D: + return GL_PROXY_TEXTURE_3D; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP_ARB: + case GL_PROXY_TEXTURE_CUBE_MAP_ARB: + return GL_PROXY_TEXTURE_CUBE_MAP_ARB; + case GL_TEXTURE_RECTANGLE_NV: + case GL_PROXY_TEXTURE_RECTANGLE_NV: + return GL_PROXY_TEXTURE_RECTANGLE_NV; + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + return GL_PROXY_TEXTURE_1D_ARRAY_EXT; + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + return GL_PROXY_TEXTURE_2D_ARRAY_EXT; + default: + _mesa_problem(NULL, "unexpected target in get_proxy_target()"); + return 0; + } +} + + +/** * Get the texture object that corresponds to the target of the given * texture unit. * @@ -890,8 +932,8 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target) /** * Return number of dimensions per mipmap level for the given texture target. */ -static GLint -get_texture_dimensions(GLenum target) +GLint +_mesa_get_texture_dimensions(GLenum target) { switch (target) { case GL_TEXTURE_1D: @@ -1116,7 +1158,7 @@ _mesa_init_teximage_fields(struct gl_context *ctx, GLenum target, img->TexFormat = format; - dims = get_texture_dimensions(target); + dims = _mesa_get_texture_dimensions(target); _mesa_set_fetch_functions(img, dims); } @@ -1178,94 +1220,110 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, switch (target) { case GL_PROXY_TEXTURE_1D: maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width >0 && !_mesa_is_pow_two(width - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or level */ + if (width < 2 * border || width > 2 + maxSize) + return GL_FALSE; + if (level >= ctx->Const.MaxTextureLevels) return GL_FALSE; + if (!ctx->Extensions.ARB_texture_non_power_of_two) { + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; } return GL_TRUE; + case GL_PROXY_TEXTURE_2D: maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or height or level */ + if (width < 2 * border || width > 2 + maxSize) + return GL_FALSE; + if (height < 2 * border || height > 2 + maxSize) + return GL_FALSE; + if (level >= ctx->Const.MaxTextureLevels) return GL_FALSE; + if (!ctx->Extensions.ARB_texture_non_power_of_two) { + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; + if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) + return GL_FALSE; } return GL_TRUE; + case GL_PROXY_TEXTURE_3D: maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - depth < 2 * border || depth > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - depth > 0 && !_mesa_is_pow_two(depth - 2 * border)) || - level >= ctx->Const.Max3DTextureLevels) { - /* bad width or height or depth or level */ + if (width < 2 * border || width > 2 + maxSize) + return GL_FALSE; + if (height < 2 * border || height > 2 + maxSize) + return GL_FALSE; + if (depth < 2 * border || depth > 2 + maxSize) + return GL_FALSE; + if (level >= ctx->Const.Max3DTextureLevels) return GL_FALSE; + if (!ctx->Extensions.ARB_texture_non_power_of_two) { + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; + if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) + return GL_FALSE; + if (depth > 0 && !_mesa_is_pow_two(depth - 2 * border)) + return GL_FALSE; } return GL_TRUE; + case GL_PROXY_TEXTURE_RECTANGLE_NV: - if (width < 0 || width > ctx->Const.MaxTextureRectSize || - height < 0 || height > ctx->Const.MaxTextureRectSize || - level != 0) { - /* bad width or height or level */ + maxSize = ctx->Const.MaxTextureRectSize; + if (width < 0 || width > maxSize) + return GL_FALSE; + if (height < 0 || height > maxSize) + return GL_FALSE; + if (level != 0) return GL_FALSE; - } return GL_TRUE; + case GL_PROXY_TEXTURE_CUBE_MAP_ARB: maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - level >= ctx->Const.MaxCubeTextureLevels) { - /* bad width or height */ + if (width < 2 * border || width > 2 + maxSize) + return GL_FALSE; + if (height < 2 * border || height > 2 + maxSize) + return GL_FALSE; + if (level >= ctx->Const.MaxCubeTextureLevels) return GL_FALSE; + if (!ctx->Extensions.ARB_texture_non_power_of_two) { + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; + if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) + return GL_FALSE; } return GL_TRUE; + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or level */ + if (width < 2 * border || width > 2 + maxSize) return GL_FALSE; - } - - if (height < 1 || height > ctx->Const.MaxArrayTextureLayers) { + if (height < 1 || height > ctx->Const.MaxArrayTextureLayers) return GL_FALSE; + if (level >= ctx->Const.MaxTextureLevels) + return GL_FALSE; + if (!ctx->Extensions.ARB_texture_non_power_of_two) { + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; } return GL_TRUE; + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or height or level */ + if (width < 2 * border || width > 2 + maxSize) return GL_FALSE; - } - if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers) { + if (height < 2 * border || height > 2 + maxSize) return GL_FALSE; + if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers) + return GL_FALSE; + if (level >= ctx->Const.MaxTextureLevels) + return GL_FALSE; + if (!ctx->Extensions.ARB_texture_non_power_of_two) { + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; + if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) + return GL_FALSE; } return GL_TRUE; + default: _mesa_problem(ctx, "Invalid target in _mesa_test_proxy_teximage"); return GL_FALSE; @@ -1274,15 +1332,37 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, /** - * Helper function to determine whether a target supports compressed textures + * Check if the memory used by the texture would exceed the driver's limit. + * This lets us support a max 3D texture size of 8K (for example) but + * prevents allocating a full 8K x 8K x 8K texture. + * XXX this could be rolled into the proxy texture size test (above) but + * we don't have the actual texture internal format at that point. */ static GLboolean -target_can_be_compressed(struct gl_context *ctx, GLenum target) +legal_texture_size(struct gl_context *ctx, gl_format format, + GLint width, GLint height, GLint depth) { + uint64_t bytes = _mesa_format_image_size64(format, width, height, depth); + uint64_t mbytes = bytes / (1024 * 1024); /* convert to MB */ + return mbytes <= (uint64_t) ctx->Const.MaxTextureMbytes; +} + + + +/** + * Helper function to determine whether a target and specific compression + * format are supported. + */ +static GLboolean +target_can_be_compressed(const struct gl_context *ctx, GLenum target, + GLenum intFormat) +{ + (void) intFormat; /* not used yet */ + switch (target) { case GL_TEXTURE_2D: case GL_PROXY_TEXTURE_2D: - return GL_TRUE; + return GL_TRUE; /* true for any compressed format so far */ case GL_PROXY_TEXTURE_CUBE_MAP: case GL_TEXTURE_CUBE_MAP_POSITIVE_X: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: @@ -1301,6 +1381,109 @@ target_can_be_compressed(struct gl_context *ctx, GLenum target) /** + * Check if the given texture target value is legal for a + * glTexImage1/2/3D call. + */ +static GLboolean +legal_teximage_target(struct gl_context *ctx, GLuint dims, GLenum target) +{ + switch (dims) { + case 1: + switch (target) { + case GL_TEXTURE_1D: + case GL_PROXY_TEXTURE_1D: + return GL_TRUE; + default: + return GL_FALSE; + } + case 2: + switch (target) { + case GL_TEXTURE_2D: + case GL_PROXY_TEXTURE_2D: + return GL_TRUE; + case GL_PROXY_TEXTURE_CUBE_MAP: + 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: + return ctx->Extensions.ARB_texture_cube_map; + case GL_TEXTURE_RECTANGLE_NV: + case GL_PROXY_TEXTURE_RECTANGLE_NV: + return ctx->Extensions.NV_texture_rectangle; + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array; + default: + return GL_FALSE; + } + case 3: + switch (target) { + case GL_TEXTURE_3D: + case GL_PROXY_TEXTURE_3D: + return GL_TRUE; + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array; + default: + return GL_FALSE; + } + default: + _mesa_problem(ctx, "invalid dims=%u in legal_teximage_target()", dims); + return GL_FALSE; + } +} + + +/** + * Check if the given texture target value is legal for a + * glTexSubImage, glCopyTexSubImage or glCopyTexImage call. + * The difference compared to legal_teximage_target() above is that + * proxy targets are not supported. + */ +static GLboolean +legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) +{ + switch (dims) { + case 1: + return target == GL_TEXTURE_1D; + case 2: + switch (target) { + case GL_TEXTURE_2D: + return GL_TRUE; + 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: + return ctx->Extensions.ARB_texture_cube_map; + case GL_TEXTURE_RECTANGLE_NV: + return ctx->Extensions.NV_texture_rectangle; + case GL_TEXTURE_1D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array; + default: + return GL_FALSE; + } + case 3: + switch (target) { + case GL_TEXTURE_3D: + return GL_TRUE; + case GL_TEXTURE_2D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array; + default: + return GL_FALSE; + } + default: + _mesa_problem(ctx, "invalid dims=%u in legal_texsubimage_target()", + dims); + return GL_FALSE; + } +} + + +/** * Test the glTexImage[123]D() parameters for errors. * * \param ctx GL context. @@ -1329,10 +1512,10 @@ texture_error_check( struct gl_context *ctx, GLint width, GLint height, GLint depth, GLint border ) { - const GLboolean isProxy = _mesa_is_proxy_texture(target); + const GLenum proxyTarget = get_proxy_target(target); + const GLboolean isProxy = target == proxyTarget; GLboolean sizeOK = GL_TRUE; GLboolean colorFormat, indexFormat; - GLenum proxy_target; /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */ if (level < 0 || level >= MAX_TEXTURE_LEVELS) { @@ -1362,71 +1545,16 @@ texture_error_check( struct gl_context *ctx, return GL_TRUE; } - /* Check target and call ctx->Driver.TestProxyTexImage() to check the - * level, width, height and depth. - */ - if (dimensions == 1) { - if (target == GL_PROXY_TEXTURE_1D || target == GL_TEXTURE_1D) { - proxy_target = GL_PROXY_TEXTURE_1D; - height = 1; - depth = 1; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - depth = 1; - if (target == GL_PROXY_TEXTURE_2D || target == GL_TEXTURE_2D) { - proxy_target = GL_PROXY_TEXTURE_2D; - } - else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB || - (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); - return GL_TRUE; - } - proxy_target = GL_PROXY_TEXTURE_CUBE_MAP_ARB; - sizeOK = (width == height); - } - else if (target == GL_PROXY_TEXTURE_RECTANGLE_NV || - target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); - return GL_TRUE; - } - proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV; - } - else if (target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || - target == GL_TEXTURE_1D_ARRAY_EXT) { - proxy_target = GL_PROXY_TEXTURE_1D_ARRAY_EXT; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); - return GL_TRUE; - } - } - else if (dimensions == 3) { - if (target == GL_PROXY_TEXTURE_3D || target == GL_TEXTURE_3D) { - proxy_target = GL_PROXY_TEXTURE_3D; - } - else if (target == GL_PROXY_TEXTURE_2D_ARRAY_EXT || - target == GL_TEXTURE_2D_ARRAY_EXT) { - proxy_target = GL_PROXY_TEXTURE_2D_ARRAY_EXT; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" ); - return GL_TRUE; - } - } - else { - _mesa_problem( ctx, "bad dims in texture_error_check" ); - return GL_TRUE; + /* Do this simple check before calling the TestProxyTexImage() function */ + if (proxyTarget == GL_PROXY_TEXTURE_CUBE_MAP_ARB) { + sizeOK = (width == height); } - sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxy_target, level, + /* + * Use the proxy texture driver hook to see if the size/level/etc are + * legal. + */ + sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level, internalFormat, format, type, width, height, depth, border); @@ -1531,9 +1659,10 @@ texture_error_check( struct gl_context *ctx, /* additional checks for compressed textures */ if (_mesa_is_compressed_format(ctx, internalFormat)) { - if (!target_can_be_compressed(ctx, target) && !isProxy) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexImage%dD(target)", dimensions); + if (!target_can_be_compressed(ctx, target, internalFormat)) { + if (!isProxy) + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexImage%dD(target)", dimensions); return GL_TRUE; } if (border != 0) { @@ -1591,61 +1720,13 @@ subtexture_error_check( struct gl_context *ctx, GLuint dimensions, GLint width, GLint height, GLint depth, GLenum format, GLenum type ) { - /* Check target */ - if (dimensions == 1) { - if (target != GL_TEXTURE_1D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_1D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target != GL_TEXTURE_2D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 3) { - if (target == GL_TEXTURE_2D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage3D(target)" ); - return GL_TRUE; - } - } - else if (target != GL_TEXTURE_3D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage3D(target)" ); - return GL_TRUE; - } - } - else { - _mesa_problem( ctx, "invalid dims in texture_error_check" ); - return GL_TRUE; - } - /* Basic level check */ if (level < 0 || level >= MAX_TEXTURE_LEVELS) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage2D(level=%d)", level); return GL_TRUE; } + /* Check for negative sizes */ if (width < 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(width=%d)", dimensions, width); @@ -1732,13 +1813,6 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions, if (_mesa_is_format_compressed(destTex->TexFormat)) { GLuint bw, bh; - if (!target_can_be_compressed(ctx, target)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexSubImage%dD(target=%s)", dimensions, - _mesa_lookup_enum_by_nr(target)); - return GL_TRUE; - } - /* do tests which depend on compression block size */ _mesa_get_format_block_size(destTex->TexFormat, &bw, &bh); @@ -1789,10 +1863,18 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border ) { - GLenum type; + const GLenum proxyTarget = get_proxy_target(target); + const GLenum type = GL_FLOAT; GLboolean sizeOK; GLint format; + /* check target */ + if (!legal_texsubimage_target(ctx, dimensions, target)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)", + dimensions, _mesa_lookup_enum_by_nr(target)); + return GL_TRUE; + } + /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */ if (level < 0 || level >= MAX_TEXTURE_LEVELS) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1830,75 +1912,14 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, return GL_TRUE; } - /* NOTE: the format and type aren't really significant for - * TestProxyTexImage(). Only the internalformat really matters. - */ - type = GL_FLOAT; + /* Do size, level checking */ + sizeOK = (proxyTarget == GL_PROXY_TEXTURE_CUBE_MAP_ARB) + ? (width == height) : 1; - /* Check target and call ctx->Driver.TestProxyTexImage() to check the - * level, width, height and depth. - */ - if (dimensions == 1) { - if (target == GL_TEXTURE_1D) { - sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_1D, - level, internalFormat, - format, type, - width, 1, 1, border); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - if (target == GL_TEXTURE_2D) { - sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_2D, - level, internalFormat, - format, type, - width, height, 1, border); - } - else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); - return GL_TRUE; - } - sizeOK = (width == height) && - ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_CUBE_MAP_ARB, - level, internalFormat, format, type, - width, height, 1, border); - } - else if (target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); - return GL_TRUE; - } - sizeOK = ctx->Driver.TestProxyTexImage(ctx, - GL_PROXY_TEXTURE_RECTANGLE_NV, - level, internalFormat, - format, type, - width, height, 1, border); - } - else if (target == GL_TEXTURE_1D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)"); - return GL_TRUE; - } - sizeOK = ctx->Driver.TestProxyTexImage(ctx, - GL_PROXY_TEXTURE_1D_ARRAY_EXT, - level, internalFormat, - format, type, - width, height, 1, border); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); - return GL_TRUE; - } - } - else { - _mesa_problem(ctx, "invalid dimensions in copytexture_error_check"); - return GL_TRUE; - } + sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level, + internalFormat, format, + type, width, height, + 1, border); if (!sizeOK) { if (dimensions == 1) { @@ -1914,7 +1935,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, } if (_mesa_is_compressed_format(ctx, internalFormat)) { - if (!target_can_be_compressed(ctx, target)) { + if (!target_can_be_compressed(ctx, target, internalFormat)) { _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%dD(target)", dimensions); return GL_TRUE; @@ -1973,45 +1994,11 @@ copytexsubimage_error_check1( struct gl_context *ctx, GLuint dimensions, } } - /* Check target */ - if (dimensions == 1) { - if (target != GL_TEXTURE_1D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_1D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target != GL_TEXTURE_2D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 3) { - if (((target != GL_TEXTURE_2D_ARRAY_EXT) || - (!ctx->Extensions.MESA_texture_array)) - && (target != GL_TEXTURE_3D)) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage3D(target)" ); - return GL_TRUE; - } + /* check target (proxies not allowed) */ + if (!legal_texsubimage_target(ctx, dimensions, target)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexSubImage%uD(target=%s)", + dimensions, _mesa_lookup_enum_by_nr(target)); + return GL_TRUE; } /* Check level */ @@ -2100,11 +2087,6 @@ copytexsubimage_error_check2( struct gl_context *ctx, GLuint dimensions, } if (_mesa_is_format_compressed(teximage->TexFormat)) { - if (!target_can_be_compressed(ctx, target)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glCopyTexSubImage%dD(target)", dimensions); - return GL_TRUE; - } /* offset must be multiple of 4 */ if ((xoffset & 3) || (yoffset & 3)) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -2337,89 +2319,48 @@ _mesa_choose_texture_format(struct gl_context *ctx, } - -/* - * Called from the API. Note that width includes the border. +/** + * Common code to implement all the glTexImage1D/2D/3D functions. */ -void GLAPIENTRY -_mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, - GLsizei width, GLint border, GLenum format, - GLenum type, const GLvoid *pixels ) +static void +teximage(struct gl_context *ctx, GLuint dims, + GLenum target, GLint level, GLint internalFormat, + GLsizei width, GLsizei height, GLsizei depth, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels) { - GET_CURRENT_CONTEXT(ctx); + GLboolean error; + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexImage1D %s %d %s %d %d %s %s %p\n", + _mesa_debug(ctx, "glTexImage%uD %s %d %s %d %d %d %d %s %s %p\n", + dims, _mesa_lookup_enum_by_nr(target), level, - _mesa_lookup_enum_by_nr(internalFormat), width, border, + _mesa_lookup_enum_by_nr(internalFormat), + width, height, depth, border, _mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type), pixels); - internalFormat = override_internal_format(internalFormat, width, 1); - - if (target == GL_TEXTURE_1D) { - /* non-proxy target */ - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - const GLuint face = _mesa_tex_target_to_face(target); - - if (texture_error_check(ctx, 1, target, level, internalFormat, - format, type, width, 1, 1, border)) { - return; /* error was recorded */ - } - - if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - texObj = _mesa_get_current_tex_object(ctx, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); - } - else { - gl_format texFormat; - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, format, - type); - - _mesa_init_teximage_fields(ctx, target, texImage, - width, 1, 1, - border, internalFormat, - texFormat); + internalFormat = override_internal_format(internalFormat, width, height); - /* Give the texture to the driver. <pixels> may be null. */ - ASSERT(ctx->Driver.TexImage1D); - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); + /* target error checking */ + if (!legal_teximage_target(ctx, dims, target)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage%uD(target=%s)", + dims, _mesa_lookup_enum_by_nr(target)); + return; + } - check_gen_mipmap(ctx, target, texObj, level); + /* general error checking */ + error = texture_error_check(ctx, dims, target, level, internalFormat, + format, type, width, height, depth, border); - update_fbo_texture(ctx, texObj, face, level); + if (_mesa_is_proxy_texture(target)) { + /* Proxy texture: just clear or set state depending on error checking */ + struct gl_texture_image *texImage = + _mesa_get_proxy_tex_image(ctx, target, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_1D) { - /* Proxy texture: check for errors and update proxy state */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texture_error_check(ctx, 1, target, level, internalFormat, - format, type, width, 1, 1, border)) { + if (error) { /* when error, clear all proxy texture image parameters */ if (texImage) clear_teximage_fields(texImage); @@ -2428,54 +2369,28 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, /* no error, set the tex image parameters */ struct gl_texture_object *texObj = _mesa_get_current_tex_object(ctx, target); - gl_format texFormat = _mesa_choose_texture_format(ctx, texObj, target, - level, + gl_format texFormat = _mesa_choose_texture_format(ctx, texObj, + target, level, internalFormat, format, type); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat, texFormat); + + if (legal_texture_size(ctx, texFormat, width, height, depth)) { + _mesa_init_teximage_fields(ctx, target, texImage, width, height, + depth, border, internalFormat, + texFormat); + } + else if (texImage) { + clear_teximage_fields(texImage); + } } } else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" ); - return; - } -} - - -void GLAPIENTRY -_mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexImage2D %s %d %s %d %d %d %s %s %p\n", - _mesa_lookup_enum_by_nr(target), level, - _mesa_lookup_enum_by_nr(internalFormat), width, height, - border, _mesa_lookup_enum_by_nr(format), - _mesa_lookup_enum_by_nr(type), pixels); - - internalFormat = override_internal_format(internalFormat, width, height); - - if (target == GL_TEXTURE_2D || - (ctx->Extensions.ARB_texture_cube_map && - target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) || - (ctx->Extensions.NV_texture_rectangle && - target == GL_TEXTURE_RECTANGLE_NV) || - (ctx->Extensions.MESA_texture_array && - target == GL_TEXTURE_1D_ARRAY_EXT)) { /* non-proxy target */ + const GLuint face = _mesa_tex_target_to_face(target); struct gl_texture_object *texObj; struct gl_texture_image *texImage; - const GLuint face = _mesa_tex_target_to_face(target); - if (texture_error_check(ctx, 2, target, level, internalFormat, - format, type, width, height, 1, border)) { + if (error) { return; /* error was recorded */ } @@ -2483,11 +2398,13 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, _mesa_update_state(ctx); texObj = _mesa_get_current_tex_object(ctx, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims); } else { gl_format texFormat; @@ -2497,63 +2414,81 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, } ASSERT(texImage->Data == NULL); - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, internalFormat, format, type); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat, texFormat); - - /* Give the texture to the driver. <pixels> may be null. */ - ASSERT(ctx->Driver.TexImage2D); - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, format, type, - pixels, &ctx->Unpack, texObj, texImage); + if (legal_texture_size(ctx, texFormat, width, height, depth)) { + _mesa_init_teximage_fields(ctx, target, texImage, + width, height, depth, + border, internalFormat, texFormat); + + /* Give the texture to the driver. <pixels> may be null. */ + ASSERT(ctx->Driver.TexImage3D); + switch (dims) { + case 1: + ctx->Driver.TexImage1D(ctx, target, level, internalFormat, + width, border, format, + type, pixels, &ctx->Unpack, texObj, + texImage); + break; + case 2: + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, format, + type, pixels, &ctx->Unpack, texObj, + texImage); + break; + case 3: + ctx->Driver.TexImage3D(ctx, target, level, internalFormat, + width, height, depth, border, format, + type, pixels, &ctx->Unpack, texObj, + texImage); + break; + default: + _mesa_problem(ctx, "invalid dims=%u in teximage()", dims); + } - check_gen_mipmap(ctx, target, texObj, level); + check_gen_mipmap(ctx, target, texObj, level); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + else { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims); + } } } _mesa_unlock_texture(ctx, texObj); } - else if (target == GL_PROXY_TEXTURE_2D || - (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB && - ctx->Extensions.ARB_texture_cube_map) || - (target == GL_PROXY_TEXTURE_RECTANGLE_NV && - ctx->Extensions.NV_texture_rectangle) || - (ctx->Extensions.MESA_texture_array && - target == GL_PROXY_TEXTURE_1D_ARRAY_EXT)) { - /* Proxy texture: check for errors and update proxy state */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texture_error_check(ctx, 2, target, level, internalFormat, - format, type, width, height, 1, border)) { - /* when error, clear all proxy texture image parameters */ - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* no error, set the tex image parameters */ - struct gl_texture_object *texObj = - _mesa_get_current_tex_object(ctx, target); - gl_format texFormat = _mesa_choose_texture_format(ctx, texObj, - target, level, - internalFormat, - format, type); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat, texFormat); - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage2D(target)" ); - return; - } +} + + +/* + * Called from the API. Note that width includes the border. + */ +void GLAPIENTRY +_mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, + GLsizei width, GLint border, GLenum format, + GLenum type, const GLvoid *pixels ) +{ + GET_CURRENT_CONTEXT(ctx); + teximage(ctx, 1, target, level, internalFormat, width, 1, 1, + border, format, type, pixels); +} + + +void GLAPIENTRY +_mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, + GLsizei width, GLsizei height, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ) +{ + GET_CURRENT_CONTEXT(ctx); + teximage(ctx, 2, target, level, internalFormat, width, height, 1, + border, format, type, pixels); } @@ -2568,100 +2503,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, const GLvoid *pixels ) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexImage3D %s %d %s %d %d %d %d %s %s %p\n", - _mesa_lookup_enum_by_nr(target), level, - _mesa_lookup_enum_by_nr(internalFormat), width, height, - depth, border, _mesa_lookup_enum_by_nr(format), - _mesa_lookup_enum_by_nr(type), pixels); - - internalFormat = override_internal_format(internalFormat, width, height); - - if (target == GL_TEXTURE_3D || - (ctx->Extensions.MESA_texture_array && - target == GL_TEXTURE_2D_ARRAY_EXT)) { - /* non-proxy target */ - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - const GLuint face = _mesa_tex_target_to_face(target); - - if (texture_error_check(ctx, 3, target, level, (GLint) internalFormat, - format, type, width, height, depth, border)) { - return; /* error was recorded */ - } - - if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - texObj = _mesa_get_current_tex_object(ctx, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); - } - else { - gl_format texFormat; - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, format, - type); - _mesa_init_teximage_fields(ctx, target, texImage, - width, height, depth, - border, internalFormat, texFormat); - - /* Give the texture to the driver. <pixels> may be null. */ - ASSERT(ctx->Driver.TexImage3D); - ctx->Driver.TexImage3D(ctx, target, level, internalFormat, - width, height, depth, border, format, type, - pixels, &ctx->Unpack, texObj, texImage); - - check_gen_mipmap(ctx, target, texObj, level); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_3D || - (ctx->Extensions.MESA_texture_array && - target == GL_PROXY_TEXTURE_2D_ARRAY_EXT)) { - /* Proxy texture: check for errors and update proxy state */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texture_error_check(ctx, 3, target, level, internalFormat, - format, type, width, height, depth, border)) { - /* when error, clear all proxy texture image parameters */ - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* no error, set the tex image parameters */ - struct gl_texture_object *texObj = - _mesa_get_current_tex_object(ctx, target); - gl_format texFormat = _mesa_choose_texture_format(ctx, texObj, - target, level, - internalFormat, - format, type); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, - depth, border, internalFormat, texFormat); - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" ); - return; - } + teximage(ctx, 3, target, level, internalFormat, width, height, depth, + border, format, type, pixels); } @@ -2724,51 +2567,92 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) #endif -void GLAPIENTRY -_mesa_TexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels ) + +/** + * Implement all the glTexSubImage1/2/3D() functions. + */ +static void +texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, const GLvoid *pixels ) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; - GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexSubImage1D %s %d %d %d %s %s %p\n", + _mesa_debug(ctx, "glTexSubImage%uD %s %d %d %d %d %d %d %d %s %s %p\n", + dims, _mesa_lookup_enum_by_nr(target), level, - xoffset, width, _mesa_lookup_enum_by_nr(format), + xoffset, yoffset, zoffset, width, height, depth, + _mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type), pixels); + /* check target (proxies not allowed) */ + if (!legal_texsubimage_target(ctx, dims, target)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)", + dims, _mesa_lookup_enum_by_nr(target)); + return; + } + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0, - width, 1, 1, format, type)) { + if (subtexture_error_check(ctx, dims, target, level, xoffset, yoffset, zoffset, + width, height, depth, format, type)) { return; /* error was detected */ } - texObj = _mesa_get_current_tex_object(ctx, target); - assert(texObj); _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (subtexture_error_check2(ctx, 1, target, level, xoffset, 0, 0, - width, 1, 1, format, type, texImage)) { + if (subtexture_error_check2(ctx, dims, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, texImage)) { /* error was recorded */ } - else if (width > 0) { - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + else if (width > 0 && height > 0 && height > 0) { + /* If we have a border, offset=-1 is legal. Bias by border width. */ + switch (dims) { + case 3: + zoffset += texImage->Border; + /* fall-through */ + case 2: + yoffset += texImage->Border; + /* fall-through */ + case 1: + xoffset += texImage->Border; + } - ASSERT(ctx->Driver.TexSubImage1D); - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - format, type, pixels, &ctx->Unpack, - texObj, texImage); + switch (dims) { + case 1: + ctx->Driver.TexSubImage1D(ctx, target, level, + xoffset, width, + format, type, pixels, + &ctx->Unpack, texObj, texImage ); + break; + case 2: + ctx->Driver.TexSubImage2D(ctx, target, level, + xoffset, yoffset, width, height, + format, type, pixels, + &ctx->Unpack, texObj, texImage ); + break; + case 3: + ctx->Driver.TexSubImage3D(ctx, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels, + &ctx->Unpack, texObj, texImage ); + break; + default: + _mesa_problem(ctx, "unexpected dims in subteximage()"); + } check_gen_mipmap(ctx, target, texObj, level); @@ -2780,58 +2664,31 @@ _mesa_TexSubImage1D( GLenum target, GLint level, void GLAPIENTRY +_mesa_TexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLsizei width, + GLenum format, GLenum type, + const GLvoid *pixels ) +{ + GET_CURRENT_CONTEXT(ctx); + texsubimage(ctx, 1, target, level, + xoffset, 0, 0, + width, 1, 1, + format, type, pixels); +} + + +void GLAPIENTRY _mesa_TexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexSubImage2D %s %d %d %d %d %d %s %s %p\n", - _mesa_lookup_enum_by_nr(target), level, - xoffset, yoffset, width, height, - _mesa_lookup_enum_by_nr(format), - _mesa_lookup_enum_by_nr(type), pixels); - - if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, - width, height, 1, format, type)) { - return; /* error was detected */ - } - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (subtexture_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, - width, height, 1, format, type, texImage)) { - /* error was recorded */ - } - else if (width > 0 && height >= 0) { - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage2D); - ctx->Driver.TexSubImage2D(ctx, target, level, xoffset, yoffset, - width, height, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - check_gen_mipmap(ctx, target, texObj, level); - - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); + texsubimage(ctx, 2, target, level, + xoffset, yoffset, 0, + width, height, 1, + format, type, pixels); } @@ -2843,84 +2700,41 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GLenum format, GLenum type, const GLvoid *pixels ) { - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexSubImage3D %s %d %d %d %d %d %d %d %s %s %p\n", - _mesa_lookup_enum_by_nr(target), level, - xoffset, yoffset, zoffset, width, height, depth, - _mesa_lookup_enum_by_nr(format), - _mesa_lookup_enum_by_nr(type), pixels); - - if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset, - width, height, depth, format, type)) { - return; /* error was detected */ - } - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (subtexture_error_check2(ctx, 3, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, texImage)) { - /* error was recorded */ - } - else if (width > 0 && height > 0 && height > 0) { - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage3D); - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); - - check_gen_mipmap(ctx, target, texObj, level); - - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); + texsubimage(ctx, 3, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels); } -void GLAPIENTRY -_mesa_CopyTexImage1D( GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLint border ) +/** + * Implement the glCopyTexImage1/2D() functions. + */ +static void +copyteximage(struct gl_context *ctx, GLuint dims, + GLenum target, GLint level, GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint face = _mesa_tex_target_to_face(target); - GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCopyTexImage1D %s %d %s %d %d %d %d\n", + _mesa_debug(ctx, "glCopyTexImage%uD %s %d %s %d %d %d %d %d\n", + dims, _mesa_lookup_enum_by_nr(target), level, _mesa_lookup_enum_by_nr(internalFormat), - x, y, width, border); + x, y, width, height, border); if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); - if (copytexture_error_check(ctx, 1, target, level, internalFormat, - width, 1, border)) + if (copytexture_error_check(ctx, dims, target, level, internalFormat, + width, height, border)) return; texObj = _mesa_get_current_tex_object(ctx, target); @@ -2928,8 +2742,9 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); } else { gl_format texFormat; @@ -2944,20 +2759,29 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, internalFormat, GL_NONE, GL_NONE); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat, texFormat); + if (legal_texture_size(ctx, texFormat, width, height, 1)) { + _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, + border, internalFormat, texFormat); - ASSERT(ctx->Driver.CopyTexImage1D); - ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat, - x, y, width, border); + ASSERT(ctx->Driver.CopyTexImage2D); + if (dims == 1) + ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat, + x, y, width, border); + else + ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat, + x, y, width, height, border); - check_gen_mipmap(ctx, target, texObj, level); + check_gen_mipmap(ctx, target, texObj, level); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + else { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); + } } } _mesa_unlock_texture(ctx, texObj); @@ -2966,92 +2790,52 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, void GLAPIENTRY -_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border ) +_mesa_CopyTexImage1D( GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, + GLsizei width, GLint border ) { - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - const GLuint face = _mesa_tex_target_to_face(target); GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCopyTexImage2D %s %d %s %d %d %d %d %d\n", - _mesa_lookup_enum_by_nr(target), level, - _mesa_lookup_enum_by_nr(internalFormat), - x, y, width, height, border); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - - if (copytexture_error_check(ctx, 2, target, level, internalFormat, - width, height, border)) - return; - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - } - else { - gl_format texFormat; - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, GL_NONE, - GL_NONE); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat, texFormat); - - ASSERT(ctx->Driver.CopyTexImage2D); - ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat, - x, y, width, height, border); + copyteximage(ctx, 1, target, level, internalFormat, x, y, width, 1, border); +} - check_gen_mipmap(ctx, target, texObj, level); - update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); +void GLAPIENTRY +_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border ) +{ + GET_CURRENT_CONTEXT(ctx); + copyteximage(ctx, 2, target, level, internalFormat, + x, y, width, height, border); } -void GLAPIENTRY -_mesa_CopyTexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) + +/** + * Implementation for glCopyTexSubImage1/2/3D() functions. + */ +static void +copytexsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, GLsizei width, GLsizei height) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; - GLint yoffset = 0; - GLsizei height = 1; - GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCopyTexSubImage1D %s %d %d %d %d %d\n", + _mesa_debug(ctx, "glCopyTexSubImage%uD %s %d %d %d %d %d %d %d %d\n", + dims, _mesa_lookup_enum_by_nr(target), - level, xoffset, x, y, width); + level, xoffset, yoffset, zoffset, x, y, width, height); if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); - if (copytexsubimage_error_check1(ctx, 1, target, level)) + if (copytexsubimage_error_check1(ctx, dims, target, level)) return; texObj = _mesa_get_current_tex_object(ctx, target); @@ -3060,19 +2844,43 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (copytexsubimage_error_check2(ctx, 1, target, level, - xoffset, 0, 0, width, 1, texImage)) { - /* error was recorded */ + if (copytexsubimage_error_check2(ctx, dims, target, level, xoffset, yoffset, + zoffset, width, height, texImage)) { + /* error was recored */ } else { - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + /* If we have a border, offset=-1 is legal. Bias by border width. */ + switch (dims) { + case 3: + zoffset += texImage->Border; + /* fall-through */ + case 2: + yoffset += texImage->Border; + /* fall-through */ + case 1: + xoffset += texImage->Border; + } if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage1D); - ctx->Driver.CopyTexSubImage1D(ctx, target, level, - xoffset, x, y, width); + switch (dims) { + case 1: + ctx->Driver.CopyTexSubImage1D(ctx, target, level, + xoffset, x, y, width); + break; + case 2: + ctx->Driver.CopyTexSubImage2D(ctx, target, level, + xoffset, yoffset, + x, y, width, height); + break; + case 3: + ctx->Driver.CopyTexSubImage3D(ctx, target, level, + xoffset, yoffset, zoffset, + x, y, width, height); + break; + default: + _mesa_problem(ctx, "bad dims in copytexsubimage()"); + } check_gen_mipmap(ctx, target, texObj, level); @@ -3084,57 +2892,24 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, } +void GLAPIENTRY +_mesa_CopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, GLsizei width ) +{ + GET_CURRENT_CONTEXT(ctx); + copytexsubimage(ctx, 1, target, level, xoffset, 0, 0, x, y, width, 1); +} + + void GLAPIENTRY _mesa_CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCopyTexSubImage2D %s %d %d %d %d %d %d %d\n", - _mesa_lookup_enum_by_nr(target), - level, xoffset, yoffset, x, y, width, height); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - - if (copytexsubimage_error_check1(ctx, 2, target, level)) - return; - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (copytexsubimage_error_check2(ctx, 2, target, level, - xoffset, yoffset, 0, - width, height, texImage)) { - /* error was recorded */ - } - else { - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage2D); - ctx->Driver.CopyTexSubImage2D(ctx, target, level, xoffset, yoffset, - x, y, width, height); - - check_gen_mipmap(ctx, target, texObj, level); - - ctx->NewState |= _NEW_TEXTURE; - } - } - } - _mesa_unlock_texture(ctx, texObj); + copytexsubimage(ctx, 2, target, level, xoffset, yoffset, 0, x, y, + width, height); } @@ -3144,52 +2919,9 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCopyTexSubImage3D %s %d %d %d %d %d %d %d %d\n", - _mesa_lookup_enum_by_nr(target), - level, xoffset, yoffset, zoffset, x, y, width, height); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - - if (copytexsubimage_error_check1(ctx, 3, target, level)) - return; - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, - zoffset, width, height, texImage)) { - /* error was recored */ - } - else { - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; - - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage3D); - ctx->Driver.CopyTexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, - x, y, width, height); - - check_gen_mipmap(ctx, target, texObj, level); - - ctx->NewState |= _NEW_TEXTURE; - } - } - } - _mesa_unlock_texture(ctx, texObj); + copytexsubimage(ctx, 3, target, level, xoffset, yoffset, zoffset, + x, y, width, height); } @@ -3234,45 +2966,18 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize) { - GLint expectedSize, maxLevels = 0, maxTextureSize; + const GLenum proxyTarget = get_proxy_target(target); + const GLint maxLevels = _mesa_max_texture_levels(ctx, target); + GLint expectedSize; - if (dimensions == 1) { - /* 1D compressed textures not allowed */ - return GL_INVALID_ENUM; - } - else if (dimensions == 2) { - if (target == GL_PROXY_TEXTURE_2D) { - maxLevels = ctx->Const.MaxTextureLevels; - } - else if (target == GL_TEXTURE_2D) { - maxLevels = ctx->Const.MaxTextureLevels; - } - else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) - return GL_INVALID_ENUM; /*target*/ - maxLevels = ctx->Const.MaxCubeTextureLevels; - } - else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) - return GL_INVALID_ENUM; /*target*/ - maxLevels = ctx->Const.MaxCubeTextureLevels; - } - else { - return GL_INVALID_ENUM; /*target*/ - } - } - else if (dimensions == 3) { - /* 3D compressed textures not allowed */ - return GL_INVALID_ENUM; - } - else { - assert(0); + /* check level */ + if (level < 0 || level >= maxLevels) + return GL_INVALID_VALUE; + + if (!target_can_be_compressed(ctx, target, internalFormat)) { return GL_INVALID_ENUM; } - maxTextureSize = 1 << (maxLevels - 1); - /* This will detect any invalid internalFormat value */ if (!_mesa_is_compressed_format(ctx, internalFormat)) return GL_INVALID_ENUM; @@ -3281,47 +2986,51 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions, if (_mesa_base_tex_format(ctx, internalFormat) < 0) return GL_INVALID_ENUM; + /* No compressed formats support borders at this time */ if (border != 0) return GL_INVALID_VALUE; - /* - * XXX We should probably use the proxy texture error check function here. - */ - if (width < 1 || width > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(width))) - return GL_INVALID_VALUE; - - if ((height < 1 || height > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(height))) - && dimensions > 1) - return GL_INVALID_VALUE; - - if ((depth < 1 || depth > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(depth))) - && dimensions > 2) - return GL_INVALID_VALUE; - /* For cube map, width must equal height */ if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB && width != height) return GL_INVALID_VALUE; - if (level < 0 || level >= maxLevels) - return GL_INVALID_VALUE; + /* check image size against compression block size */ + { + gl_format texFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + GLuint bw, bh; - expectedSize = compressed_tex_size(width, height, depth, internalFormat); - if (expectedSize != imageSize) - return GL_INVALID_VALUE; + _mesa_get_format_block_size(texFormat, &bw, &bh); + if ((width > bw && width % bw > 0) || + (height > bh && height % bh > 0)) { + /* + * Per GL_ARB_texture_compression: GL_INVALID_OPERATION is + * generated [...] if any parameter combinations are not + * supported by the specific compressed internal format. + */ + return GL_INVALID_OPERATION; + } + } -#if FEATURE_EXT_texture_sRGB - if ((internalFormat == GL_COMPRESSED_SRGB_S3TC_DXT1_EXT || - internalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT || - internalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT || - internalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) - && border != 0) { + /* check image sizes */ + if (!ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level, + internalFormat, GL_NONE, GL_NONE, + width, height, depth, border)) { + /* See error comment above */ return GL_INVALID_OPERATION; } -#endif + + /* check image size in bytes */ + expectedSize = compressed_tex_size(width, height, depth, internalFormat); + if (expectedSize != imageSize) { + /* Per GL_ARB_texture_compression: GL_INVALID_VALUE is generated [...] + * if <imageSize> is not consistent with the format, dimensions, and + * contents of the specified image. + */ + return GL_INVALID_VALUE; + } return GL_NO_ERROR; } @@ -3463,159 +3172,101 @@ compressed_subtexture_error_check2(struct gl_context *ctx, GLuint dims, } - -void GLAPIENTRY -_mesa_CompressedTexImage1DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLint border, GLsizei imageSize, - const GLvoid *data) +/** + * Implementation of the glCompressedTexImage1/2/3D() functions. + */ +static void +compressedteximage(struct gl_context *ctx, GLuint dims, + GLenum target, GLint level, + GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLint border, + GLsizei imageSize, const GLvoid *data) { - GET_CURRENT_CONTEXT(ctx); + GLenum error; + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCompressedTexImage1DARB %s %d %s %d %d %d %p\n", + _mesa_debug(ctx, + "glCompressedTexImage%uDARB %s %d %s %d %d %d %d %d %p\n", + dims, _mesa_lookup_enum_by_nr(target), level, _mesa_lookup_enum_by_nr(internalFormat), - width, border, imageSize, data); - - if (target == GL_TEXTURE_1D) { - /* non-proxy target */ - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error = compressed_texture_error_check(ctx, 1, target, level, - internalFormat, width, 1, 1, border, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexImage1D"); - return; - } - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D"); - } - else { - gl_format texFormat; - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, GL_NONE, - GL_NONE); + width, height, depth, border, imageSize, data); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat, texFormat); + /* check target */ + if (!legal_teximage_target(ctx, dims, target)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage%uD(target=%s)", + dims, _mesa_lookup_enum_by_nr(target)); + return; + } - ASSERT(ctx->Driver.CompressedTexImage1D); - ctx->Driver.CompressedTexImage1D(ctx, target, level, - internalFormat, width, border, - imageSize, data, - texObj, texImage); + error = compressed_texture_error_check(ctx, dims, target, level, + internalFormat, width, height, depth, + border, imageSize); - check_gen_mipmap(ctx, target, texObj, level); +#if FEATURE_ES + /* XXX this is kind of a hack */ + if (error) { + _mesa_error(ctx, error, "glTexImage2D"); + return; + } - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } + if (dims == 2) { + switch (internalFormat) { + case GL_PALETTE4_RGB8_OES: + case GL_PALETTE4_RGBA8_OES: + case GL_PALETTE4_R5_G6_B5_OES: + case GL_PALETTE4_RGBA4_OES: + case GL_PALETTE4_RGB5_A1_OES: + case GL_PALETTE8_RGB8_OES: + case GL_PALETTE8_RGBA8_OES: + case GL_PALETTE8_R5_G6_B5_OES: + case GL_PALETTE8_RGBA4_OES: + case GL_PALETTE8_RGB5_A1_OES: + _mesa_cpal_compressed_teximage2d(target, level, internalFormat, + width, height, imageSize, data); + return; } - _mesa_unlock_texture(ctx, texObj); } - else if (target == GL_PROXY_TEXTURE_1D) { - /* Proxy texture: check for errors and update proxy state */ - GLenum error = compressed_texture_error_check(ctx, 1, target, level, - internalFormat, width, 1, 1, border, imageSize); +#endif + + if (_mesa_is_proxy_texture(target)) { + /* Proxy texture: just check for errors and update proxy state */ + struct gl_texture_image *texImage; + if (!error) { - ASSERT(ctx->Driver.TestProxyTexImage); - error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, - internalFormat, GL_NONE, GL_NONE, - width, 1, 1, border); - } - if (error) { - /* if error, clear all proxy texture image parameters */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texImage) - clear_teximage_fields(texImage); + struct gl_texture_object *texObj = + _mesa_get_current_tex_object(ctx, target); + gl_format texFormat = + _mesa_choose_texture_format(ctx, texObj, target, level, + internalFormat, GL_NONE, GL_NONE); + if (!legal_texture_size(ctx, texFormat, width, height, depth)) { + error = GL_OUT_OF_MEMORY; + } } - else { - /* store the teximage parameters */ - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - gl_format texFormat; - - texObj = _mesa_get_current_tex_object(ctx, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, GL_NONE, - GL_NONE); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat, texFormat); - } - _mesa_unlock_texture(ctx, texObj); + texImage = _mesa_get_proxy_tex_image(ctx, target, level); + if (texImage) { + if (error) { + /* if error, clear all proxy texture image parameters */ + clear_teximage_fields(texImage); + } + else { + /* no error: store the teximage parameters */ + _mesa_init_teximage_fields(ctx, target, texImage, width, height, + depth, border, internalFormat, + MESA_FORMAT_NONE); + } } } else { - _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage1D(target)"); - return; - } -} - -void GLAPIENTRY -_mesa_CompressedTexImage2DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLsizei height, GLint border, GLsizei imageSize, - const GLvoid *data) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCompressedTexImage2DARB %s %d %s %d %d %d %d %p\n", - _mesa_lookup_enum_by_nr(target), level, - _mesa_lookup_enum_by_nr(internalFormat), - width, height, border, imageSize, data); - -#if FEATURE_ES - switch (internalFormat) { - case GL_PALETTE4_RGB8_OES: - case GL_PALETTE4_RGBA8_OES: - case GL_PALETTE4_R5_G6_B5_OES: - case GL_PALETTE4_RGBA4_OES: - case GL_PALETTE4_RGB5_A1_OES: - case GL_PALETTE8_RGB8_OES: - case GL_PALETTE8_RGBA8_OES: - case GL_PALETTE8_R5_G6_B5_OES: - case GL_PALETTE8_RGBA4_OES: - case GL_PALETTE8_RGB5_A1_OES: - _mesa_cpal_compressed_teximage2d(target, level, internalFormat, - width, height, imageSize, data); - return; - } -#endif - - if (target == GL_TEXTURE_2D || - (ctx->Extensions.ARB_texture_cube_map && - target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { /* non-proxy target */ struct gl_texture_object *texObj; struct gl_texture_image *texImage; - GLenum error = compressed_texture_error_check(ctx, 2, target, level, - internalFormat, width, height, 1, border, imageSize); if (error) { - _mesa_error(ctx, error, "glCompressedTexImage2D"); + _mesa_error(ctx, error, "glCompressedTexImage%uD", dims); return; } @@ -3625,7 +3276,8 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, { texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "glCompressedTexImage%uD", dims); } else { gl_format texFormat; @@ -3639,67 +3291,78 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, internalFormat, GL_NONE, GL_NONE); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat, texFormat); - - ASSERT(ctx->Driver.CompressedTexImage2D); - ctx->Driver.CompressedTexImage2D(ctx, target, level, - internalFormat, width, height, - border, imageSize, data, - texObj, texImage); + if (legal_texture_size(ctx, texFormat, width, height, depth)) { + _mesa_init_teximage_fields(ctx, target, texImage, + width, height, depth, + border, internalFormat, texFormat); + + switch (dims) { + case 1: + ASSERT(ctx->Driver.CompressedTexImage1D); + ctx->Driver.CompressedTexImage1D(ctx, target, level, + internalFormat, + width, + border, imageSize, data, + texObj, texImage); + break; + case 2: + ASSERT(ctx->Driver.CompressedTexImage2D); + ctx->Driver.CompressedTexImage2D(ctx, target, level, + internalFormat, + width, height, + border, imageSize, data, + texObj, texImage); + break; + case 3: + ASSERT(ctx->Driver.CompressedTexImage3D); + ctx->Driver.CompressedTexImage3D(ctx, target, level, + internalFormat, + width, height, depth, + border, imageSize, data, + texObj, texImage); + break; + default: + _mesa_problem(ctx, "bad dims in compressedteximage"); + } - check_gen_mipmap(ctx, target, texObj, level); + check_gen_mipmap(ctx, target, texObj, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + else { + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "glCompressedTexImage%uD", dims); + } } } _mesa_unlock_texture(ctx, texObj); } - else if (target == GL_PROXY_TEXTURE_2D || - (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB && - ctx->Extensions.ARB_texture_cube_map)) { - /* Proxy texture: check for errors and update proxy state */ - GLenum error = compressed_texture_error_check(ctx, 2, target, level, - internalFormat, width, height, 1, border, imageSize); - if (!error) { - ASSERT(ctx->Driver.TestProxyTexImage); - error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, - internalFormat, GL_NONE, GL_NONE, - width, height, 1, border); - } - if (error) { - /* if error, clear all proxy texture image parameters */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* store the teximage parameters */ - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - gl_format texFormat; +} - texObj = _mesa_get_current_tex_object(ctx, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, GL_NONE, - GL_NONE); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat, texFormat); - } - _mesa_unlock_texture(ctx, texObj); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage2D(target)"); - return; - } +void GLAPIENTRY +_mesa_CompressedTexImage1DARB(GLenum target, GLint level, + GLenum internalFormat, GLsizei width, + GLint border, GLsizei imageSize, + const GLvoid *data) +{ + GET_CURRENT_CONTEXT(ctx); + compressedteximage(ctx, 1, target, level, internalFormat, + width, 1, 1, border, imageSize, data); +} + + +void GLAPIENTRY +_mesa_CompressedTexImage2DARB(GLenum target, GLint level, + GLenum internalFormat, GLsizei width, + GLsizei height, GLint border, GLsizei imageSize, + const GLvoid *data) +{ + GET_CURRENT_CONTEXT(ctx); + compressedteximage(ctx, 2, target, level, internalFormat, + width, height, 1, border, imageSize, data); } @@ -3710,107 +3373,8 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, GLsizei imageSize, const GLvoid *data) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glCompressedTexImage3DARB %s %d %s %d %d %d %d %d %p\n", - _mesa_lookup_enum_by_nr(target), level, - _mesa_lookup_enum_by_nr(internalFormat), - width, height, depth, border, imageSize, data); - - if (target == GL_TEXTURE_3D) { - /* non-proxy target */ - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error = compressed_texture_error_check(ctx, 3, target, level, - internalFormat, width, height, depth, border, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexImage3D"); - return; - } - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D"); - } - else { - gl_format texFormat; - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, GL_NONE, - GL_NONE); - - _mesa_init_teximage_fields(ctx, target, texImage, - width, height, depth, - border, internalFormat, texFormat); - - ASSERT(ctx->Driver.CompressedTexImage3D); - ctx->Driver.CompressedTexImage3D(ctx, target, level, - internalFormat, - width, height, depth, - border, imageSize, data, - texObj, texImage); - - check_gen_mipmap(ctx, target, texObj, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_3D) { - /* Proxy texture: check for errors and update proxy state */ - GLenum error = compressed_texture_error_check(ctx, 3, target, level, - internalFormat, width, height, depth, border, imageSize); - if (!error) { - ASSERT(ctx->Driver.TestProxyTexImage); - error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, - internalFormat, GL_NONE, GL_NONE, - width, height, depth, border); - } - if (error) { - /* if error, clear all proxy texture image parameters */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* store the teximage parameters */ - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - gl_format texFormat; - - texObj = _mesa_get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, GL_NONE, - GL_NONE); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, - depth, border, internalFormat, - texFormat); - } - _mesa_unlock_texture(ctx, texObj); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage3D(target)"); - return; - } + compressedteximage(ctx, 3, target, level, internalFormat, + width, height, depth, border, imageSize, data); } diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 5bb9d49..bb5509e 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -126,6 +126,8 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, extern GLuint _mesa_tex_target_to_face(GLenum target); +extern GLint +_mesa_get_texture_dimensions(GLenum target); /** * Lock a texture for updating. See also _mesa_lock_context_textures(). diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 72dbf10..f61e023 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -372,15 +372,12 @@ _mesa_reference_texobj(struct gl_texture_object **ptr, /** - * Report why a texture object is incomplete. - * - * \param t texture object. - * \param why string describing why it's incomplete. - * - * \note For debug purposes only. + * Mark a texture object as incomplete. + * \param t texture object + * \param fmt... string describing why it's incomplete (for debugging). */ static void -incomplete(const struct gl_texture_object *t, const char *fmt, ...) +incomplete(struct gl_texture_object *t, const char *fmt, ...) { #if 0 va_list args; @@ -392,6 +389,7 @@ incomplete(const struct gl_texture_object *t, const char *fmt, ...) printf("Texture Obj %d incomplete because: %s\n", t->Name, s); #endif + t->_Complete = GL_FALSE; } @@ -421,14 +419,12 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, */ if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { incomplete(t, "base level = %d is invalid", baseLevel); - t->_Complete = GL_FALSE; return; } /* Always need the base level image */ if (!t->Image[0][baseLevel]) { incomplete(t, "Image[baseLevel=%d] == NULL", baseLevel); - t->_Complete = GL_FALSE; return; } @@ -437,7 +433,6 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, t->Image[0][baseLevel]->Height == 0 || t->Image[0][baseLevel]->Depth == 0) { incomplete(t, "texture width = 0"); - t->_Complete = GL_FALSE; return; } @@ -475,6 +470,12 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, ASSERT(maxLevels > 0); + if (t->MaxLevel < t->BaseLevel) { + incomplete(t, "MAX_LEVEL (%d) < BASE_LEVEL (%d)", + t->MaxLevel, t->BaseLevel); + return; + } + t->_MaxLevel = baseLevel + maxLog2; t->_MaxLevel = MIN2(t->_MaxLevel, t->MaxLevel); t->_MaxLevel = MIN2(t->_MaxLevel, maxLevels - 1); @@ -491,7 +492,6 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, if (t->Image[face][baseLevel] == NULL || t->Image[face][baseLevel]->Width2 != w || t->Image[face][baseLevel]->Height2 != h) { - t->_Complete = GL_FALSE; incomplete(t, "Cube face missing or mismatched size"); return; } @@ -508,7 +508,6 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, GLint maxLevel = t->_MaxLevel; if (minLevel > maxLevel) { - t->_Complete = GL_FALSE; incomplete(t, "minLevel > maxLevel"); return; } @@ -517,12 +516,10 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, for (i = minLevel; i <= maxLevel; i++) { if (t->Image[0][i]) { if (t->Image[0][i]->TexFormat != t->Image[0][baseLevel]->TexFormat) { - t->_Complete = GL_FALSE; incomplete(t, "Format[i] != Format[baseLevel]"); return; } if (t->Image[0][i]->Border != t->Image[0][baseLevel]->Border) { - t->_Complete = GL_FALSE; incomplete(t, "Border[i] != Border[baseLevel]"); return; } @@ -540,12 +537,10 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, } if (i >= minLevel && i <= maxLevel) { if (!t->Image[0][i]) { - t->_Complete = GL_FALSE; incomplete(t, "1D Image[0][i] == NULL"); return; } if (t->Image[0][i]->Width2 != width ) { - t->_Complete = GL_FALSE; incomplete(t, "1D Image[0][i] bad width"); return; } @@ -569,17 +564,14 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, } if (i >= minLevel && i <= maxLevel) { if (!t->Image[0][i]) { - t->_Complete = GL_FALSE; incomplete(t, "2D Image[0][i] == NULL"); return; } if (t->Image[0][i]->Width2 != width) { - t->_Complete = GL_FALSE; incomplete(t, "2D Image[0][i] bad width"); return; } if (t->Image[0][i]->Height2 != height) { - t->_Complete = GL_FALSE; incomplete(t, "2D Image[0][i] bad height"); return; } @@ -607,26 +599,21 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, if (i >= minLevel && i <= maxLevel) { if (!t->Image[0][i]) { incomplete(t, "3D Image[0][i] == NULL"); - t->_Complete = GL_FALSE; return; } if (t->Image[0][i]->_BaseFormat == GL_DEPTH_COMPONENT) { - t->_Complete = GL_FALSE; incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex"); return; } if (t->Image[0][i]->Width2 != width) { - t->_Complete = GL_FALSE; incomplete(t, "3D Image[0][i] bad width"); return; } if (t->Image[0][i]->Height2 != height) { - t->_Complete = GL_FALSE; incomplete(t, "3D Image[0][i] bad height"); return; } if (t->Image[0][i]->Depth2 != depth) { - t->_Complete = GL_FALSE; incomplete(t, "3D Image[0][i] bad depth"); return; } @@ -652,20 +639,17 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, for (face = 0; face < 6; face++) { /* check that we have images defined */ if (!t->Image[face][i]) { - t->_Complete = GL_FALSE; incomplete(t, "CubeMap Image[n][i] == NULL"); return; } /* Don't support GL_DEPTH_COMPONENT for cube maps */ if (t->Image[face][i]->_BaseFormat == GL_DEPTH_COMPONENT) { - t->_Complete = GL_FALSE; incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex"); return; } /* check that all six images have same size */ if (t->Image[face][i]->Width2 != width || t->Image[face][i]->Height2 != height) { - t->_Complete = GL_FALSE; incomplete(t, "CubeMap Image[n][i] bad size"); return; } @@ -688,6 +672,44 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, /** + * Check if the given cube map texture is "cube complete" as defined in + * the OpenGL specification. + */ +GLboolean +_mesa_cube_complete(const struct gl_texture_object *texObj) +{ + const GLint baseLevel = texObj->BaseLevel; + const struct gl_texture_image *img0, *img; + GLuint face; + + if (texObj->Target != GL_TEXTURE_CUBE_MAP) + return GL_FALSE; + + if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) + return GL_FALSE; + + /* check first face */ + img0 = texObj->Image[0][baseLevel]; + if (!img0 || + img0->Width < 1 || + img0->Width != img0->Height) + return GL_FALSE; + + /* check remaining faces vs. first face */ + for (face = 1; face < 6; face++) { + img = texObj->Image[face][baseLevel]; + if (!img || + img->Width != img0->Width || + img->Height != img0->Height || + img->TexFormat != img0->TexFormat) + return GL_FALSE; + } + + return GL_TRUE; +} + + +/** * Mark a texture object dirty. It forces the object to be incomplete * and optionally forces the context to re-validate its state. * diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h index 821b35c..2461b06 100644 --- a/src/mesa/main/texobj.h +++ b/src/mesa/main/texobj.h @@ -32,8 +32,9 @@ #define TEXTOBJ_H -#include "mtypes.h" +#include "glheader.h" +struct gl_context; /** * \name Internal functions @@ -68,6 +69,9 @@ extern void _mesa_test_texobj_completeness( const struct gl_context *ctx, struct gl_texture_object *obj ); +extern GLboolean +_mesa_cube_complete(const struct gl_texture_object *texObj); + extern void _mesa_dirty_texobj(struct gl_context *ctx, struct gl_texture_object *texObj, GLboolean invalidate_state); diff --git a/src/mesa/main/texpal.c b/src/mesa/main/texpal.c index a25e7aa..b2112f9 100644 --- a/src/mesa/main/texpal.c +++ b/src/mesa/main/texpal.c @@ -18,6 +18,7 @@ #include "glheader.h" #include "compiler.h" /* for ASSERT */ #include "context.h" +#include "mfeatures.h" #include "mtypes.h" #include "imports.h" #include "pixelstore.h" diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index d5c83de..d2b8b5c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -35,6 +35,8 @@ #include "main/context.h" #include "main/formats.h" #include "main/macros.h" +#include "main/mfeatures.h" +#include "main/mtypes.h" #include "main/texcompress.h" #include "main/texparam.h" #include "main/teximage.h" diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 8961b92..8cec24c 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -3,6 +3,7 @@ #include "colormac.h" #include "macros.h" #include "texfetch.h" +#include "teximage.h" #include "texrender.h" #include "renderbuffer.h" @@ -20,6 +21,7 @@ struct texture_renderbuffer struct gl_renderbuffer Base; /**< Base class object */ struct gl_texture_image *TexImage; StoreTexelFunc Store; + FetchTexelFuncF Fetchf; GLint Yoffset; /**< Layer for 1D array textures. */ GLint Zoffset; /**< Layer for 2D array textures, or slice * for 3D textures @@ -48,7 +50,7 @@ texture_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { GLfloat rgba[4]; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, rgba); + trb->Fetchf(trb->TexImage, x + i, y, z, rgba); UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba); } } @@ -56,7 +58,7 @@ texture_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count GLushort *zValues = (GLushort *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); + trb->Fetchf(trb->TexImage, x + i, y, z, &flt); zValues[i] = (GLushort) (flt * 0xffff); } } @@ -67,7 +69,7 @@ texture_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count */ for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); + trb->Fetchf(trb->TexImage, x + i, y, z, &flt); #if 0 /* this should work, but doesn't (overflow due to low precision) */ zValues[i] = (GLuint) (flt * scale); @@ -81,7 +83,7 @@ texture_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); + trb->Fetchf(trb->TexImage, x + i, y, z, &flt); zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; } } @@ -89,7 +91,7 @@ texture_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); + trb->Fetchf(trb->TexImage, x + i, y, z, &flt); zValues[i] = (GLuint) (flt * 0xffffff); } } @@ -112,7 +114,7 @@ texture_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { GLfloat rgba[4]; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba); UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba); } @@ -121,7 +123,7 @@ texture_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co GLushort *zValues = (GLushort *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); zValues[i] = (GLushort) (flt * 0xffff); } @@ -130,7 +132,7 @@ texture_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); #if 0 zValues[i] = (GLuint) (flt * 0xffffffff); @@ -143,7 +145,7 @@ texture_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; } @@ -152,7 +154,7 @@ texture_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); zValues[i] = (GLuint) (flt * 0xffffff); } @@ -517,8 +519,6 @@ wrap_texture(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) _mesa_reference_renderbuffer(&att->Renderbuffer, &(trb->Base)); } - - /** * Update the renderbuffer wrapper for rendering to a texture. * For example, update the width, height of the RB based on the texture size, @@ -542,6 +542,8 @@ update_wrapper(struct gl_context *ctx, const struct gl_renderbuffer_attachment * trb->Store = store_nop; } + trb->Fetchf = trb->TexImage->FetchTexelf; + if (att->Texture->Target == GL_TEXTURE_1D_ARRAY_EXT) { trb->Yoffset = att->Zoffset; trb->Zoffset = 0; @@ -582,6 +584,22 @@ update_wrapper(struct gl_context *ctx, const struct gl_renderbuffer_attachment * trb->Base.DataType = GL_UNSIGNED_INT; trb->Base._BaseFormat = GL_DEPTH_COMPONENT; break; + /* SRGB formats pre EXT_framebuffer_sRGB don't do sRGB translations on FBO readback */ + case MESA_FORMAT_SRGB8: + trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_RGB888, _mesa_get_texture_dimensions(att->Texture->Target)); + trb->Base.DataType = CHAN_TYPE; + trb->Base._BaseFormat = GL_RGBA; + break; + case MESA_FORMAT_SRGBA8: + trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_RGBA8888, _mesa_get_texture_dimensions(att->Texture->Target)); + trb->Base.DataType = CHAN_TYPE; + trb->Base._BaseFormat = GL_RGBA; + break; + case MESA_FORMAT_SARGB8: + trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_ARGB8888, _mesa_get_texture_dimensions(att->Texture->Target)); + trb->Base.DataType = CHAN_TYPE; + trb->Base._BaseFormat = GL_RGBA; + break; default: trb->Base.DataType = CHAN_TYPE; trb->Base._BaseFormat = GL_RGBA; diff --git a/src/mesa/main/texrender.h b/src/mesa/main/texrender.h index 5e68fb0..cacd091 100644 --- a/src/mesa/main/texrender.h +++ b/src/mesa/main/texrender.h @@ -1,7 +1,9 @@ #ifndef TEXRENDER_H #define TEXRENDER_H -#include "mtypes.h" +struct gl_context; +struct gl_framebuffer; +struct gl_renderbuffer_attachment; extern void _mesa_render_texture(struct gl_context *ctx, diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 89677c5..7dd4a1f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -58,6 +58,8 @@ #include "image.h" #include "macros.h" #include "mipmap.h" +#include "mfeatures.h" +#include "mtypes.h" #include "pack.h" #include "imports.h" #include "pack.h" @@ -2038,6 +2040,132 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) } +static GLboolean +_mesa_texstore_argb2101010(TEXSTORE_PARAMS) +{ + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_ARGB2101010); + ASSERT(texelBytes == 4); + + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == MESA_FORMAT_ARGB2101010 && + srcFormat == GL_BGRA && + srcType == GL_UNSIGNED_INT_2_10_10_10_REV && + baseInternalFormat == GL_RGBA) { + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else { + /* general path */ + const GLfloat *tempImage = make_temp_float_image(ctx, dims, + baseInternalFormat, + baseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking, + ctx->_ImageTransferState); + const GLfloat *src = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * texelBytes + + dstYoffset * dstRowStride + + dstXoffset * texelBytes; + if (baseInternalFormat == GL_RGBA) { + for (row = 0; row < srcHeight; row++) { + GLuint *dstUI = (GLuint *) dstRow; + for (col = 0; col < srcWidth; col++) { + GLushort a,r,g,b; + + UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]); + UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]); + dstUI[col] = PACK_COLOR_2101010_US(a, r, g, b); + src += 4; + } + dstRow += dstRowStride; + } + } else if (baseInternalFormat == GL_RGB) { + for (row = 0; row < srcHeight; row++) { + GLuint *dstUI = (GLuint *) dstRow; + for (col = 0; col < srcWidth; col++) { + GLushort r,g,b; + + UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]); + dstUI[col] = PACK_COLOR_2101010_US(0xffff, r, g, b); + src += 4; + } + dstRow += dstRowStride; + } + } else { + ASSERT(0); + } + } + free((void *) tempImage); + } + return GL_TRUE; +} + + +/** + * Do texstore for 2-channel, 4-bit/channel, unsigned normalized formats. + */ +static GLboolean +_mesa_texstore_unorm44(TEXSTORE_PARAMS) +{ + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_AL44); + ASSERT(texelBytes == 1); + + { + /* general path */ + const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, + baseInternalFormat, + baseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLchan *src = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * texelBytes + + dstYoffset * dstRowStride + + dstXoffset * texelBytes; + for (row = 0; row < srcHeight; row++) { + GLubyte *dstUS = (GLubyte *) dstRow; + for (col = 0; col < srcWidth; col++) { + /* src[0] is luminance, src[1] is alpha */ + dstUS[col] = PACK_COLOR_44( CHAN_TO_UBYTE(src[1]), + CHAN_TO_UBYTE(src[0]) ); + src += 2; + } + dstRow += dstRowStride; + } + } + free((void *) tempImage); + } + return GL_TRUE; +} + + /** * Do texstore for 2-channel, 8-bit/channel, unsigned normalized formats. */ @@ -2237,21 +2365,23 @@ _mesa_texstore_unorm1616(TEXSTORE_PARAMS) } +/* Texstore for R16, A16, L16, I16. */ static GLboolean -_mesa_texstore_r16(TEXSTORE_PARAMS) +_mesa_texstore_unorm16(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_R16); + ASSERT(dstFormat == MESA_FORMAT_R16 || + dstFormat == MESA_FORMAT_A16 || + dstFormat == MESA_FORMAT_L16 || + dstFormat == MESA_FORMAT_I16); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_R16 && - baseInternalFormat == GL_RED && - srcFormat == GL_RED && + baseInternalFormat == srcFormat && srcType == GL_UNSIGNED_SHORT && littleEndian) { /* simple memcpy path */ @@ -3921,23 +4051,28 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 }, { MESA_FORMAT_ARGB1555, _mesa_texstore_argb1555 }, { MESA_FORMAT_ARGB1555_REV, _mesa_texstore_argb1555 }, + { MESA_FORMAT_AL44, _mesa_texstore_unorm44 }, { MESA_FORMAT_AL88, _mesa_texstore_unorm88 }, { MESA_FORMAT_AL88_REV, _mesa_texstore_unorm88 }, { MESA_FORMAT_AL1616, _mesa_texstore_unorm1616 }, { MESA_FORMAT_AL1616_REV, _mesa_texstore_unorm1616 }, { MESA_FORMAT_RGB332, _mesa_texstore_rgb332 }, { MESA_FORMAT_A8, _mesa_texstore_a8 }, + { MESA_FORMAT_A16, _mesa_texstore_unorm16 }, { MESA_FORMAT_L8, _mesa_texstore_a8 }, + { MESA_FORMAT_L16, _mesa_texstore_unorm16 }, { MESA_FORMAT_I8, _mesa_texstore_a8 }, + { MESA_FORMAT_I16, _mesa_texstore_unorm16 }, { MESA_FORMAT_CI8, _mesa_texstore_ci8 }, { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr }, { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr }, { MESA_FORMAT_R8, _mesa_texstore_a8 }, { MESA_FORMAT_RG88, _mesa_texstore_unorm88 }, { MESA_FORMAT_RG88_REV, _mesa_texstore_unorm88 }, - { MESA_FORMAT_R16, _mesa_texstore_r16 }, + { MESA_FORMAT_R16, _mesa_texstore_unorm16 }, { MESA_FORMAT_RG1616, _mesa_texstore_unorm1616 }, { MESA_FORMAT_RG1616_REV, _mesa_texstore_unorm1616 }, + { MESA_FORMAT_ARGB2101010, _mesa_texstore_argb2101010 }, { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, { MESA_FORMAT_Z16, _mesa_texstore_z16 }, diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index d297b5e..fbd70d5 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -34,6 +34,8 @@ #include "bufferobj.h" #include "context.h" #include "hash.h" +#include "mfeatures.h" +#include "mtypes.h" #include "transformfeedback.h" #include "shaderapi.h" #include "shaderobj.h" diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h index 752cd4e..b0d5b70 100644 --- a/src/mesa/main/transformfeedback.h +++ b/src/mesa/main/transformfeedback.h @@ -25,8 +25,13 @@ #ifndef TRANSFORM_FEEDBACK_H #define TRANSFORM_FEEDBACK_H -#include "main/mtypes.h" +#include "compiler.h" +#include "glheader.h" +#include "mfeatures.h" +struct _glapi_table; +struct dd_function_table; +struct gl_context; extern void _mesa_init_transform_feedback(struct gl_context *ctx); diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index d61856d..aee2e6b 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -39,6 +39,8 @@ #include "main/glheader.h" #include "main/context.h" #include "main/dispatch.h" +#include "main/mfeatures.h" +#include "main/mtypes.h" #include "main/shaderapi.h" #include "main/shaderobj.h" #include "main/uniforms.h" @@ -511,7 +513,7 @@ get_uniform_rows_cols(const struct gl_program_parameter *p, *cols = p->Size; } else { - *rows = p->Size / 4 + 1; + *rows = (p->Size + 3) / 4; if (p->Size % 4 == 0) *cols = 4; else diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 340c3fe..bcde65a 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -33,6 +33,7 @@ #include "hash.h" #include "image.h" #include "macros.h" +#include "mfeatures.h" #include "mtypes.h" #include "varray.h" #include "arrayobj.h" @@ -127,8 +128,8 @@ update_array(struct gl_context *ctx, GLsizei elementSize; GLenum format = GL_RGBA; - if (ctx->API != API_OPENGLES) { - /* fixed point arrays / data is only allowed with OpenGL ES 1.x */ + if (ctx->API != API_OPENGLES && ctx->API != API_OPENGLES2) { + /* fixed point arrays / data is only allowed with OpenGL ES 1.x/2.0 */ legalTypesMask &= ~FIXED_BIT; } @@ -297,7 +298,8 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { GLbitfield legalTypes = (SHORT_BIT | INT_BIT | - HALF_BIT | FLOAT_BIT | DOUBLE_BIT); + HALF_BIT | FLOAT_BIT | DOUBLE_BIT | + FIXED_BIT); GET_CURRENT_CONTEXT(ctx); const GLuint unit = ctx->Array.ActiveTexture; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index fb96478..af93241 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -28,7 +28,11 @@ #define VARRAY_H -#include "mtypes.h" +#include "glheader.h" +#include "mfeatures.h" + +struct gl_client_array; +struct gl_context; #if _HAVE_FULL_GL diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 69a28da..a10b86e 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -22,7 +22,8 @@ */ -#include "context.h" +#include "imports.h" +#include "mtypes.h" #include "version.h" diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 1b53508..2e63358 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.10 + * Version: 7.11 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -33,9 +33,9 @@ struct gl_context; /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 10 +#define MESA_MINOR 11 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.10-devel" +#define MESA_VERSION_STRING "7.11-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c index 4747022..a58697a 100644 --- a/src/mesa/main/viewport.c +++ b/src/mesa/main/viewport.c @@ -31,6 +31,7 @@ #include "context.h" #include "macros.h" +#include "mtypes.h" #include "viewport.h" @@ -145,7 +146,11 @@ _mesa_DepthRange(GLclampd nearval, GLclampd farval) } } - +void GLAPIENTRY +_mesa_DepthRangef(GLclampf nearval, GLclampf farval) +{ + _mesa_DepthRange(nearval, farval); +} /** * Initialize the context viewport attribute group. diff --git a/src/mesa/main/viewport.h b/src/mesa/main/viewport.h index ccfa375..db4507b 100644 --- a/src/mesa/main/viewport.h +++ b/src/mesa/main/viewport.h @@ -28,7 +28,8 @@ #define VIEWPORT_H #include "glheader.h" -#include "mtypes.h" + +struct gl_context; extern void GLAPIENTRY _mesa_Viewport(GLint x, GLint y, GLsizei width, GLsizei height); @@ -42,6 +43,9 @@ _mesa_set_viewport(struct gl_context *ctx, GLint x, GLint y, extern void GLAPIENTRY _mesa_DepthRange(GLclampd nearval, GLclampd farval); +extern void GLAPIENTRY +_mesa_DepthRangef(GLclampf nearval, GLclampf farval); + extern void _mesa_init_viewport(struct gl_context *ctx); diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 8a72641..692ce08 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -30,6 +30,7 @@ #include "api_arrayelt.h" #include "context.h" #include "imports.h" +#include "mfeatures.h" #include "mtypes.h" #include "vtxfmt.h" #include "eval.h" diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h index 147385c..8bbc549 100644 --- a/src/mesa/main/vtxfmt.h +++ b/src/mesa/main/vtxfmt.h @@ -34,6 +34,7 @@ #define _VTXFMT_H_ #include "compiler.h" +#include "mfeatures.h" #include "mtypes.h" #if FEATURE_beginend diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index e97afaf..bbad6ef 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -208,6 +208,24 @@ ALIGN16(static GLfloat, d[TEST_COUNT][4]); ALIGN16(static GLfloat, r[TEST_COUNT][4]); +/** + * Check if X, Y or Z component of the coordinate is close to W, in terms + * of the clip test. + */ +static GLboolean +xyz_close_to_w(const GLfloat c[4]) +{ + float k = 0.0001; + return (fabs(c[0] - c[3]) < k || + fabs(c[1] - c[3]) < k || + fabs(c[2] - c[3]) < k || + fabs(-c[0] - c[3]) < k || + fabs(-c[1] - c[3]) < k || + fabs(-c[2] - c[3]) < k); +} + + + static int test_cliptest_function( clip_func func, int np, int psize, long *cycles ) { @@ -281,9 +299,18 @@ static int test_cliptest_function( clip_func func, int np, } for ( i = 0 ; i < TEST_COUNT ; i++ ) { if ( dm[i] != rm[i] ) { + GLfloat *c = source->start; + STRIDE_F(c, source->stride * i); + if (psize == 4 && xyz_close_to_w(c)) { + /* The coordinate is very close to the clip plane. The clipmask + * may vary depending on code path, but that's OK. + */ + continue; + } printf( "\n-----------------------------\n" ); - printf( "(i = %i)\n", i ); - printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] ); + printf( "mask[%d] = 0x%02x ref mask[%d] = 0x%02x\n", i, dm[i], i,rm[i] ); + printf(" coord = %f, %f, %f, %f\n", + c[0], c[1], c[2], c[3]); return 0; } } diff --git a/src/mesa/program/arbprogparse.h b/src/mesa/program/arbprogparse.h index 08e25a1..4c0c300 100644 --- a/src/mesa/program/arbprogparse.h +++ b/src/mesa/program/arbprogparse.h @@ -26,7 +26,11 @@ #ifndef ARBPROGPARSE_H #define ARBPROGPARSE_H -#include "main/mtypes.h" +#include "main/glheader.h" + +struct gl_context; +struct gl_fragment_program; +struct gl_vertex_program; extern void _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target, diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index a5b17bb..786fdfb 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -295,6 +295,8 @@ public: bool process_move_condition(ir_rvalue *ir); + void copy_propagate(void); + void *mem_ctx; }; @@ -1574,7 +1576,13 @@ ir_to_mesa_visitor::visit(ir_dereference_record *ir) break; offset += type_size(struct_type->fields.structure[i].type); } - this->result.swizzle = swizzle_for_size(ir->type->vector_elements); + + /* If the type is smaller than a vec4, replicate the last channel out. */ + if (ir->type->is_scalar() || ir->type->is_vector()) + this->result.swizzle = swizzle_for_size(ir->type->vector_elements); + else + this->result.swizzle = SWIZZLE_NOOP; + this->result.index += offset; } @@ -2171,9 +2179,14 @@ ir_to_mesa_visitor::visit(ir_discard *ir) { struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog; - assert(ir->condition == NULL); /* FINISHME */ + if (ir->condition) { + ir->condition->accept(this); + this->result.negate = ~this->result.negate; + ir_to_mesa_emit_op1(ir, OPCODE_KIL, ir_to_mesa_undef_dst, this->result); + } else { + ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV); + } - ir_to_mesa_emit_op0(ir, OPCODE_KIL_NV); fp->UsesKill = GL_TRUE; } @@ -2610,6 +2623,133 @@ set_uniform_initializers(struct gl_context *ctx, talloc_free(mem_ctx); } +/* + * On a basic block basis, tracks available PROGRAM_TEMPORARY register + * channels for copy propagation and updates following instructions to + * use the original versions. + * + * The ir_to_mesa_visitor lazily produces code assuming that this pass + * will occur. As an example, a TXP production before this pass: + * + * 0: MOV TEMP[1], INPUT[4].xyyy; + * 1: MOV TEMP[1].w, INPUT[4].wwww; + * 2: TXP TEMP[2], TEMP[1], texture[0], 2D; + * + * and after: + * + * 0: MOV TEMP[1], INPUT[4].xyyy; + * 1: MOV TEMP[1].w, INPUT[4].wwww; + * 2: TXP TEMP[2], INPUT[4].xyyw, texture[0], 2D; + * + * which allows for dead code elimination on TEMP[1]'s writes. + */ +void +ir_to_mesa_visitor::copy_propagate(void) +{ + ir_to_mesa_instruction **acp = talloc_zero_array(mem_ctx, + ir_to_mesa_instruction *, + this->next_temp * 4); + + foreach_iter(exec_list_iterator, iter, this->instructions) { + ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get(); + + /* First, do any copy propagation possible into the src regs. */ + for (int r = 0; r < 3; r++) { + ir_to_mesa_instruction *first = NULL; + bool good = true; + int acp_base = inst->src_reg[r].index * 4; + + if (inst->src_reg[r].file != PROGRAM_TEMPORARY || + inst->src_reg[r].reladdr) + continue; + + /* See if we can find entries in the ACP consisting of MOVs + * from the same src register for all the swizzled channels + * of this src register reference. + */ + for (int i = 0; i < 4; i++) { + int src_chan = GET_SWZ(inst->src_reg[r].swizzle, i); + ir_to_mesa_instruction *copy_chan = acp[acp_base + src_chan]; + + if (!copy_chan) { + good = false; + break; + } + + if (!first) { + first = copy_chan; + } else { + if (first->src_reg[0].file != copy_chan->src_reg[0].file || + first->src_reg[0].index != copy_chan->src_reg[0].index) { + good = false; + break; + } + } + } + + if (good) { + /* We've now validated that we can copy-propagate to + * replace this src register reference. Do it. + */ + inst->src_reg[r].file = first->src_reg[0].file; + inst->src_reg[r].index = first->src_reg[0].index; + + int swizzle = 0; + for (int i = 0; i < 4; i++) { + int src_chan = GET_SWZ(inst->src_reg[r].swizzle, i); + ir_to_mesa_instruction *copy_inst = acp[acp_base + src_chan]; + swizzle |= (GET_SWZ(copy_inst->src_reg[0].swizzle, src_chan) << + (3 * i)); + } + inst->src_reg[r].swizzle = swizzle; + } + } + + switch (inst->op) { + case OPCODE_BGNLOOP: + case OPCODE_ENDLOOP: + case OPCODE_ELSE: + case OPCODE_ENDIF: + /* End of a basic block, clear the ACP entirely. */ + memset(acp, 0, sizeof(*acp) * this->next_temp * 4); + break; + + default: + /* Continuing the block, clear any written channels from + * the ACP. + */ + if (inst->dst_reg.file == PROGRAM_TEMPORARY) { + if (inst->dst_reg.reladdr) { + memset(acp, 0, sizeof(*acp) * this->next_temp * 4); + } else { + for (int i = 0; i < 4; i++) { + if (inst->dst_reg.writemask & (1 << i)) { + acp[4 * inst->dst_reg.index + i] = NULL; + } + } + } + } + break; + } + + /* If this is a copy, add it to the ACP. */ + if (inst->op == OPCODE_MOV && + inst->dst_reg.file == PROGRAM_TEMPORARY && + !inst->dst_reg.reladdr && + !inst->saturate && + !inst->src_reg[0].reladdr && + !inst->src_reg[0].negate) { + for (int i = 0; i < 4; i++) { + if (inst->dst_reg.writemask & (1 << i)) { + acp[4 * inst->dst_reg.index + i] = inst; + } + } + } + } + + talloc_free(acp); +} + /** * Convert a shader's GLSL IR into a Mesa gl_program. @@ -2709,6 +2849,8 @@ get_mesa_program(struct gl_context *ctx, mesa_instruction_annotation = talloc_array(v.mem_ctx, ir_instruction *, num_instructions); + v.copy_propagate(); + /* Convert ir_mesa_instructions into prog_instructions. */ mesa_inst = mesa_instructions; @@ -2849,8 +2991,9 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) /* Lowering */ do_mat_op_to_vec(ir); - lower_instructions(ir, MOD_TO_FRACT | DIV_TO_MUL_RCP | EXP_TO_EXP2 - | LOG_TO_LOG2); + lower_instructions(ir, (MOD_TO_FRACT | DIV_TO_MUL_RCP | EXP_TO_EXP2 + | LOG_TO_LOG2 + | ((options->EmitNoPow) ? POW_TO_EXP2 : 0))); progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress; @@ -2858,8 +3001,10 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) progress = lower_quadop_vector(ir, true) || progress; - if (options->EmitNoIfs) - progress = do_if_to_cond_assign(ir) || progress; + if (options->EmitNoIfs) { + progress = lower_discard(ir) || progress; + progress = lower_if_to_cond_assign(ir) || progress; + } if (options->EmitNoNoise) progress = lower_noise(ir) || progress; diff --git a/src/mesa/program/ir_to_mesa.h b/src/mesa/program/ir_to_mesa.h index 7197615..7410e14 100644 --- a/src/mesa/program/ir_to_mesa.h +++ b/src/mesa/program/ir_to_mesa.h @@ -25,8 +25,11 @@ extern "C" { #endif -#include "main/config.h" -#include "main/mtypes.h" +#include "main/glheader.h" + +struct gl_context; +struct gl_shader; +struct gl_shader_program; void _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *sh); void _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog); diff --git a/src/mesa/program/nvfragparse.h b/src/mesa/program/nvfragparse.h index 3e85dd2..088e752 100644 --- a/src/mesa/program/nvfragparse.h +++ b/src/mesa/program/nvfragparse.h @@ -30,7 +30,10 @@ #ifndef NVFRAGPARSE_H #define NVFRAGPARSE_H -#include "main/mtypes.h" +#include "main/glheader.h" + +struct gl_context; +struct gl_fragment_program; extern void _mesa_parse_nv_fragment_program(struct gl_context *ctx, GLenum target, diff --git a/src/mesa/program/nvvertparse.h b/src/mesa/program/nvvertparse.h index e98e867..7318e14 100644 --- a/src/mesa/program/nvvertparse.h +++ b/src/mesa/program/nvvertparse.h @@ -29,7 +29,10 @@ #ifndef NVVERTPARSE_H #define NVVERTPARSE_H -#include "main/mtypes.h" +#include "main/glheader.h" + +struct gl_context; +struct gl_vertex_program; extern void _mesa_parse_nv_vertex_program(struct gl_context *ctx, GLenum target, diff --git a/src/mesa/program/prog_cache.h b/src/mesa/program/prog_cache.h index 4907ae3..0167334 100644 --- a/src/mesa/program/prog_cache.h +++ b/src/mesa/program/prog_cache.h @@ -30,8 +30,9 @@ #define PROG_CACHE_H -#include "main/mtypes.h" +#include "main/glheader.h" +struct gl_context; /** Opaque type */ struct gl_program_cache; diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index c20347f..e7553c6 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -1674,6 +1674,18 @@ _mesa_execute_program(struct gl_context * ctx, fetch_texel(ctx, machine, inst, texcoord, lodBias, color); + if (DEBUG_PROG) { + printf("TXB (%g, %g, %g, %g) = texture[%d][%g %g %g %g]" + " bias %g\n", + color[0], color[1], color[2], color[3], + inst->TexSrcUnit, + texcoord[0], + texcoord[1], + texcoord[2], + texcoord[3], + lodBias); + } + store_vector4(inst, machine, color); } break; diff --git a/src/mesa/program/prog_instruction.h b/src/mesa/program/prog_instruction.h index ca90de7..a383828 100644 --- a/src/mesa/program/prog_instruction.h +++ b/src/mesa/program/prog_instruction.h @@ -247,7 +247,7 @@ typedef enum prog_opcode { * Number of bits for the src/dst register Index field. * This limits the size of temp/uniform register files. */ -#define INST_INDEX_BITS 10 +#define INST_INDEX_BITS 11 /** diff --git a/src/mesa/program/prog_optimize.h b/src/mesa/program/prog_optimize.h index 00f1080..463f5fc 100644 --- a/src/mesa/program/prog_optimize.h +++ b/src/mesa/program/prog_optimize.h @@ -27,9 +27,10 @@ #include "main/config.h" -#include "main/mtypes.h" +#include "main/glheader.h" +struct gl_context; struct gl_program; struct prog_instruction; diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index baac29f..c310acb 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -572,6 +572,24 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], value[3] = 0.0F; return; + case STATE_FB_WPOS_Y_TRANSFORM: + /* A driver may negate this conditional by using ZW swizzle + * instead of XY (based on e.g. some other state). */ + if (ctx->DrawBuffer->Name != 0) { + /* Identity (XY) followed by flipping Y upside down (ZW). */ + value[0] = 1.0F; + value[1] = 0.0F; + value[2] = -1.0F; + value[3] = (GLfloat) (ctx->DrawBuffer->Height - 1); + } else { + /* Flipping Y upside down (XY) followed by identity (ZW). */ + value[0] = -1.0F; + value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1); + value[2] = 1.0F; + value[3] = 0.0F; + } + return; + case STATE_ROT_MATRIX_0: { const int unit = (int) state[2]; @@ -695,6 +713,7 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) return _NEW_PIXEL; case STATE_FB_SIZE: + case STATE_FB_WPOS_Y_TRANSFORM: return _NEW_BUFFERS; default: @@ -900,6 +919,9 @@ append_token(char *dst, gl_state_index k) case STATE_FB_SIZE: append(dst, "FbSize"); break; + case STATE_FB_WPOS_Y_TRANSFORM: + append(dst, "FbWposYTransform"); + break; case STATE_ROT_MATRIX_0: append(dst, "rotMatrixRow0"); break; @@ -1046,7 +1068,9 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) * Loop over all the parameters in a parameter list. If the parameter * is a GL state reference, look up the current value of that state * variable and put it into the parameter's Value[4] array. - * This would be called at glBegin time when using a fragment program. + * Other parameter types never change or are explicitly set by the user + * with glUniform() or glProgramParameter(), etc. + * This would be called at glBegin time. */ void _mesa_load_state_parameters(struct gl_context *ctx, @@ -1057,12 +1081,10 @@ _mesa_load_state_parameters(struct gl_context *ctx, if (!paramList) return; - /*assert(ctx->Driver.NeedFlush == 0);*/ - for (i = 0; i < paramList->NumParameters; i++) { if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) { _mesa_fetch_state(ctx, - (gl_state_index *) paramList->Parameters[i].StateIndexes, + paramList->Parameters[i].StateIndexes, paramList->ParameterValues[i]); } } diff --git a/src/mesa/program/prog_statevars.h b/src/mesa/program/prog_statevars.h index 6e5be53..f2407af 100644 --- a/src/mesa/program/prog_statevars.h +++ b/src/mesa/program/prog_statevars.h @@ -25,8 +25,10 @@ #ifndef PROG_STATEVARS_H #define PROG_STATEVARS_H -#include "main/mtypes.h" +#include "main/glheader.h" +struct gl_context; +struct gl_program_parameter_list; /** * Number of STATE_* values we need to address any GL state. @@ -117,6 +119,7 @@ typedef enum gl_state_index_ { STATE_PT_BIAS, /**< Pixel transfer RGBA bias */ STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */ STATE_FB_SIZE, /**< (width-1, height-1, 0, 0) */ + STATE_FB_WPOS_Y_TRANSFORM, /**< (1, 0, -1, height-1) if a FBO is bound, (-1, height-1, 1, 0) otherwise */ STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */ STATE_ROT_MATRIX_1, /**< ATI_envmap_bumpmap, rot matrix row 1 */ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c index 9ffa49b..52254e9 100644 --- a/src/mesa/program/program.c +++ b/src/mesa/program/program.c @@ -32,6 +32,7 @@ #include "main/glheader.h" #include "main/context.h" #include "main/hash.h" +#include "main/mfeatures.h" #include "program.h" #include "prog_cache.h" #include "prog_parameter.h" diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c index 09e7cb4..004f1f8 100644 --- a/src/mesa/program/symbol_table.c +++ b/src/mesa/program/symbol_table.c @@ -336,12 +336,12 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table, check_symbol_table(table); if (hdr == NULL) { - hdr = calloc(1, sizeof(*hdr)); - hdr->name = strdup(name); + hdr = calloc(1, sizeof(*hdr)); + hdr->name = strdup(name); - hash_table_insert(table->ht, hdr, hdr->name); - hdr->next = table->hdr; - table->hdr = hdr; + hash_table_insert(table->ht, hdr, hdr->name); + hdr->next = table->hdr; + table->hdr = hdr; } check_symbol_table(table); @@ -376,6 +376,81 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table, } +int +_mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table, + int name_space, const char *name, + void *declaration) +{ + struct symbol_header *hdr; + struct symbol *sym; + struct symbol *curr; + struct scope_level *top_scope; + + check_symbol_table(table); + + hdr = find_symbol(table, name); + + check_symbol_table(table); + + if (hdr == NULL) { + hdr = calloc(1, sizeof(*hdr)); + hdr->name = strdup(name); + + hash_table_insert(table->ht, hdr, hdr->name); + hdr->next = table->hdr; + table->hdr = hdr; + } + + check_symbol_table(table); + + /* If the symbol already exists in this namespace at this scope, it cannot + * be added to the table. + */ + for (sym = hdr->symbols + ; (sym != NULL) && (sym->name_space != name_space) + ; sym = sym->next_with_same_name) { + /* empty */ + } + + if (sym && sym->depth == 0) + return -1; + + /* Find the top-level scope */ + for (top_scope = table->current_scope + ; top_scope->next != NULL + ; top_scope = top_scope->next) { + /* empty */ + } + + sym = calloc(1, sizeof(*sym)); + sym->next_with_same_scope = top_scope->symbols; + sym->hdr = hdr; + sym->name_space = name_space; + sym->data = declaration; + + assert(sym->hdr == hdr); + + /* Since next_with_same_name is ordered by scope, we need to append the + * new symbol to the _end_ of the list. + */ + if (hdr->symbols == NULL) { + hdr->symbols = sym; + } else { + for (curr = hdr->symbols + ; curr->next_with_same_name != NULL + ; curr = curr->next_with_same_name) { + /* empty */ + } + curr->next_with_same_name = sym; + } + top_scope->symbols = sym; + + check_symbol_table(table); + return 0; +} + + + struct _mesa_symbol_table * _mesa_symbol_table_ctor(void) { diff --git a/src/mesa/program/symbol_table.h b/src/mesa/program/symbol_table.h index 1d570fc..f9d9164 100644 --- a/src/mesa/program/symbol_table.h +++ b/src/mesa/program/symbol_table.h @@ -33,6 +33,10 @@ extern void _mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table); extern int _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *symtab, int name_space, const char *name, void *declaration); +extern int _mesa_symbol_table_add_global_symbol( + struct _mesa_symbol_table *symtab, int name_space, const char *name, + void *declaration); + extern int _mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table, int name_space, const char *name); diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index e29ab46..bf160fe 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -147,7 +147,11 @@ void st_validate_state( struct st_context *st ) /*printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/ +#ifdef NDEBUG + if (0) { +#else if (1) { +#endif /* Debug version which enforces various sanity checks on the * state flags which are generated and checked to help ensure * state atoms are ordered correctly in the list. diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 8d1dc79..05667a7 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -56,7 +56,6 @@ void st_upload_constants( struct st_context *st, unsigned shader_type) { struct pipe_context *pipe = st->pipe; - struct pipe_resource **cbuf = &st->state.constants[shader_type]; assert(shader_type == PIPE_SHADER_VERTEX || shader_type == PIPE_SHADER_FRAGMENT || @@ -64,17 +63,24 @@ void st_upload_constants( struct st_context *st, /* update constants */ if (params && params->NumParameters) { + struct pipe_resource *cbuf; const uint paramBytes = params->NumParameters * sizeof(GLfloat) * 4; + /* Update the constants which come from fixed-function state, such as + * transformation matrices, fog factors, etc. The rest of the values in + * the parameters list are explicitly set by the user with glUniform, + * glProgramParameter(), etc. + */ _mesa_load_state_parameters(st->ctx, params); /* We always need to get a new buffer, to keep the drivers simple and * avoid gratuitous rendering synchronization. + * Let's use a user buffer to avoid an unnecessary copy. */ - pipe_resource_reference(cbuf, NULL ); - *cbuf = pipe_buffer_create(pipe->screen, - PIPE_BIND_CONSTANT_BUFFER, - paramBytes ); + cbuf = pipe_user_buffer_create(pipe->screen, + params->ParameterValues, + paramBytes, + PIPE_BIND_CONSTANT_BUFFER); if (ST_DEBUG & DEBUG_CONSTANTS) { debug_printf("%s(shader=%d, numParams=%d, stateFlags=0x%x)\n", @@ -83,17 +89,15 @@ void st_upload_constants( struct st_context *st, _mesa_print_parameter_list(params); } - /* load Mesa constants into the constant buffer */ - pipe_buffer_write(st->pipe, *cbuf, - 0, paramBytes, - params->ParameterValues); + st->pipe->set_constant_buffer(st->pipe, shader_type, 0, cbuf); + pipe_resource_reference(&cbuf, NULL); - st->pipe->set_constant_buffer(st->pipe, shader_type, 0, *cbuf); + st->state.constants[shader_type].ptr = params->ParameterValues; + st->state.constants[shader_type].size = paramBytes; } - else if (*cbuf) { - st->constants.tracked_state[shader_type].dirty.mesa = 0x0; - - pipe_resource_reference(cbuf, NULL); + else if (st->state.constants[shader_type].ptr) { + st->state.constants[shader_type].ptr = NULL; + st->state.constants[shader_type].size = 0; st->pipe->set_constant_buffer(st->pipe, shader_type, 0, NULL); } } diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 036bc60..2843b7b 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -51,7 +51,7 @@ static void update_renderbuffer_surface(struct st_context *st, struct st_renderbuffer *strb) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_context *pipe = st->pipe; struct pipe_resource *resource = strb->rtt->pt; int rtt_width = strb->Base.Width; int rtt_height = strb->Base.Height; @@ -65,15 +65,19 @@ update_renderbuffer_surface(struct st_context *st, for (level = 0; level <= resource->last_level; level++) { if (u_minify(resource->width0, level) == rtt_width && u_minify(resource->height0, level) == rtt_height) { + struct pipe_surface surf_tmpl; + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + surf_tmpl.format = resource->format; + surf_tmpl.usage = PIPE_BIND_RENDER_TARGET; + surf_tmpl.u.tex.level = level; + surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice; + surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice; pipe_surface_reference(&strb->surface, NULL); - strb->surface = screen->get_tex_surface(screen, - resource, - strb->rtt_face, - level, - strb->rtt_slice, - PIPE_BIND_RENDER_TARGET); + strb->surface = pipe->create_surface(pipe, + resource, + &surf_tmpl); #if 0 printf("-- alloc new surface %d x %d into tex %p\n", strb->surface->width, strb->surface->height, diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 6be0337..378b30e 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -122,8 +122,8 @@ load_color_map_texture(struct gl_context *ctx, struct pipe_resource *pt) uint i, j; transfer = pipe_get_transfer(st_context(ctx)->pipe, - pt, 0, 0, 0, PIPE_TRANSFER_WRITE, - 0, 0, texSize, texSize); + pt, 0, 0, PIPE_TRANSFER_WRITE, + 0, 0, texSize, texSize); dest = (uint *) pipe_transfer_map(pipe, transfer); /* Pack four 1D maps into a 2D texture: diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index f147d76..b67068d 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -121,6 +121,18 @@ static void xlate_border_color(const GLfloat *colorIn, GLenum baseFormat, GLfloat *colorOut) { switch (baseFormat) { + case GL_RED: + colorOut[0] = colorIn[0]; + colorOut[1] = 0.0F; + colorOut[2] = 0.0F; + colorOut[3] = 1.0F; + break; + case GL_RG: + colorOut[0] = colorIn[0]; + colorOut[1] = colorIn[1]; + colorOut[2] = 0.0F; + colorOut[3] = 1.0F; + break; case GL_RGB: colorOut[0] = colorIn[0]; colorOut[1] = colorIn[1]; diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 05442ef..c311d04 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -50,99 +50,6 @@ #include "st_program.h" - -/** - * Translate fragment program if needed. - */ -static void -translate_fp(struct st_context *st, - struct st_fragment_program *stfp) -{ - if (!stfp->tgsi.tokens) { - assert(stfp->Base.Base.NumInstructions > 0); - - st_translate_fragment_program(st, stfp); - } -} - -/* - * Translate geometry program if needed. - */ -static void -translate_gp(struct st_context *st, - struct st_geometry_program *stgp) -{ - if (!stgp->tgsi.tokens) { - assert(stgp->Base.Base.NumInstructions > 1); - - st_translate_geometry_program(st, stgp); - } -} - -/** - * Find a translated vertex program that corresponds to stvp and - * has outputs matched to stfp's inputs. - * This performs vertex and fragment translation (to TGSI) when needed. - */ -static struct st_vp_varient * -find_translated_vp(struct st_context *st, - struct st_vertex_program *stvp ) -{ - struct st_vp_varient *vpv; - struct st_vp_varient_key key; - - /* Nothing in our key yet. This will change: - */ - memset(&key, 0, sizeof key); - - /* When this is true, we will add an extra input to the vertex - * shader translation (for edgeflags), an extra output with - * edgeflag semantics, and extend the vertex shader to pass through - * the input to the output. We'll need to use similar logic to set - * up the extra vertex_element input for edgeflags. - * _NEW_POLYGON, ST_NEW_EDGEFLAGS_DATA - */ - key.passthrough_edgeflags = (st->vertdata_edgeflags && ( - st->ctx->Polygon.FrontMode != GL_FILL || - st->ctx->Polygon.BackMode != GL_FILL)); - - - /* Do we need to throw away old translations after a change in the - * GL program string? - */ - if (stvp->serialNo != stvp->lastSerialNo) { - /* These may have changed if the program string changed. - */ - st_prepare_vertex_program( st, stvp ); - - /* We are now up-to-date: - */ - stvp->lastSerialNo = stvp->serialNo; - } - - /* See if we've got a translated vertex program whose outputs match - * the fragment program's inputs. - */ - for (vpv = stvp->varients; vpv; vpv = vpv->next) { - if (memcmp(&vpv->key, &key, sizeof key) == 0) { - break; - } - } - - /* No? Perform new translation here. */ - if (!vpv) { - vpv = st_translate_vertex_program(st, stvp, &key); - if (!vpv) - return NULL; - - vpv->next = stvp->varients; - stvp->varients = vpv; - } - - return vpv; -} - - /** * Return pointer to a pass-through fragment shader. * This shader is used when a texture is missing/incomplete. @@ -167,12 +74,16 @@ static void update_fp( struct st_context *st ) { struct st_fragment_program *stfp; + struct st_fp_variant_key key; assert(st->ctx->FragmentProgram._Current); stfp = st_fragment_program(st->ctx->FragmentProgram._Current); assert(stfp->Base.Base.Target == GL_FRAGMENT_PROGRAM_ARB); - translate_fp(st, stfp); + memset(&key, 0, sizeof(key)); + key.st = st; + + st->fp_variant = st_get_fp_variant(st, stfp, &key); st_reference_fragprog(st, &st->fp, stfp); @@ -182,7 +93,8 @@ update_fp( struct st_context *st ) cso_set_fragment_shader_handle(st->cso_context, fs); } else { - cso_set_fragment_shader_handle(st->cso_context, stfp->driver_shader); + cso_set_fragment_shader_handle(st->cso_context, + st->fp_variant->driver_shader); } } @@ -206,6 +118,7 @@ static void update_vp( struct st_context *st ) { struct st_vertex_program *stvp; + struct st_vp_variant_key key; /* find active shader and params -- Should be covered by * ST_NEW_VERTEX_PROGRAM @@ -214,12 +127,26 @@ update_vp( struct st_context *st ) stvp = st_vertex_program(st->ctx->VertexProgram._Current); assert(stvp->Base.Base.Target == GL_VERTEX_PROGRAM_ARB); - st->vp_varient = find_translated_vp(st, stvp); + memset(&key, 0, sizeof key); + key.st = st; /* variants are per-context */ + + /* When this is true, we will add an extra input to the vertex + * shader translation (for edgeflags), an extra output with + * edgeflag semantics, and extend the vertex shader to pass through + * the input to the output. We'll need to use similar logic to set + * up the extra vertex_element input for edgeflags. + * _NEW_POLYGON, ST_NEW_EDGEFLAGS_DATA + */ + key.passthrough_edgeflags = (st->vertdata_edgeflags && ( + st->ctx->Polygon.FrontMode != GL_FILL || + st->ctx->Polygon.BackMode != GL_FILL)); + + st->vp_variant = st_get_vp_variant(st, stvp, &key); st_reference_vertprog(st, &st->vp, stvp); cso_set_vertex_shader_handle(st->cso_context, - st->vp_varient->driver_shader); + st->vp_variant->driver_shader); st->vertex_result_to_slot = stvp->result_to_output; } @@ -231,14 +158,16 @@ const struct st_tracked_state st_update_vp = { _NEW_POLYGON, /* mesa */ ST_NEW_VERTEX_PROGRAM | ST_NEW_EDGEFLAGS_DATA /* st */ }, - update_vp /* update */ + update_vp /* update */ }; + + static void update_gp( struct st_context *st ) { - struct st_geometry_program *stgp; + struct st_gp_variant_key key; if (!st->ctx->GeometryProgram._Current) { cso_set_geometry_shader_handle(st->cso_context, NULL); @@ -248,18 +177,22 @@ update_gp( struct st_context *st ) stgp = st_geometry_program(st->ctx->GeometryProgram._Current); assert(stgp->Base.Base.Target == MESA_GEOMETRY_PROGRAM); - translate_gp(st, stgp); + memset(&key, 0, sizeof(key)); + key.st = st; + + st->gp_variant = st_get_gp_variant(st, stgp, &key); st_reference_geomprog(st, &st->gp, stgp); - cso_set_geometry_shader_handle(st->cso_context, stgp->driver_shader); + cso_set_geometry_shader_handle(st->cso_context, + st->gp_variant->driver_shader); } const struct st_tracked_state st_update_gp = { - "st_update_gp", /* name */ - { /* dirty */ - 0, /* mesa */ - ST_NEW_GEOMETRY_PROGRAM /* st */ + "st_update_gp", /* name */ + { /* dirty */ + 0, /* mesa */ + ST_NEW_GEOMETRY_PROGRAM /* st */ }, - update_gp /* update */ + update_gp /* update */ }; diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 6c5caf4..35921f4 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -33,6 +33,7 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "st_debug.h" #include "st_context.h" @@ -138,10 +139,10 @@ accum_accum(struct st_context *st, GLfloat value, debug_printf("%s: fallback processing\n", __FUNCTION__); color_trans = pipe_get_transfer(st->pipe, - color_strb->texture, - 0, 0, 0, - PIPE_TRANSFER_READ, xpos, ypos, - width, height); + color_strb->texture, + 0, 0, + PIPE_TRANSFER_READ, xpos, ypos, + width, height); buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); @@ -187,9 +188,9 @@ accum_load(struct st_context *st, GLfloat value, debug_printf("%s: fallback processing\n", __FUNCTION__); color_trans = pipe_get_transfer(st->pipe, color_strb->texture, - 0, 0, 0, - PIPE_TRANSFER_READ, xpos, ypos, - width, height); + 0, 0, + PIPE_TRANSFER_READ, xpos, ypos, + width, height); buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); @@ -241,12 +242,12 @@ accum_return(struct gl_context *ctx, GLfloat value, usage = PIPE_TRANSFER_READ_WRITE; else usage = PIPE_TRANSFER_WRITE; - + color_trans = pipe_get_transfer(st_context(ctx)->pipe, - color_strb->texture, 0, 0, 0, - usage, - xpos, ypos, - width, height); + color_strb->texture, 0, 0, + usage, + xpos, ypos, + width, height); if (usage & PIPE_TRANSFER_READ) pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf); diff --git a/src/mesa/state_tracker/st_cb_accum.h b/src/mesa/state_tracker/st_cb_accum.h index b8c9c35..050a214 100644 --- a/src/mesa/state_tracker/st_cb_accum.h +++ b/src/mesa/state_tracker/st_cb_accum.h @@ -30,7 +30,11 @@ #define ST_CB_ACCUM_H -#include "main/mtypes.h" +#include "main/mfeatures.h" + +struct dd_function_table; +struct gl_context; +struct gl_renderbuffer; #if FEATURE_accum diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 3c0ee6c..e23fe86 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -34,6 +34,7 @@ #include "main/image.h" #include "main/bufferobj.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "program/program.h" #include "program/prog_print.h" @@ -185,48 +186,47 @@ find_free_bit(uint bitfield) /** * Combine basic bitmap fragment program with the user-defined program. + * \param st current context + * \param fpIn the incoming fragment program + * \param fpOut the new fragment program which does fragment culling + * \param bitmap_sampler sampler number for the bitmap texture */ -static struct st_fragment_program * -combined_bitmap_fragment_program(struct gl_context *ctx) +void +st_make_bitmap_fragment_program(struct st_context *st, + struct gl_fragment_program *fpIn, + struct gl_fragment_program **fpOut, + GLuint *bitmap_sampler) { - struct st_context *st = st_context(ctx); - struct st_fragment_program *stfp = st->fp; - - if (!stfp->bitmap_program) { - /* - * Generate new program which is the user-defined program prefixed - * with the bitmap sampler/kill instructions. - */ - struct st_fragment_program *bitmap_prog; - uint sampler; - - sampler = find_free_bit(st->fp->Base.Base.SamplersUsed); - bitmap_prog = make_bitmap_fragment_program(ctx, sampler); + struct st_fragment_program *bitmap_prog; + struct gl_program *newProg; + uint sampler; - stfp->bitmap_program = (struct st_fragment_program *) - _mesa_combine_programs(ctx, - &bitmap_prog->Base.Base, &stfp->Base.Base); - stfp->bitmap_program->bitmap_sampler = sampler; + /* + * Generate new program which is the user-defined program prefixed + * with the bitmap sampler/kill instructions. + */ + sampler = find_free_bit(fpIn->Base.SamplersUsed); + bitmap_prog = make_bitmap_fragment_program(st->ctx, sampler); - /* done with this after combining */ - st_reference_fragprog(st, &bitmap_prog, NULL); + newProg = _mesa_combine_programs(st->ctx, + &bitmap_prog->Base.Base, + &fpIn->Base); + /* done with this after combining */ + st_reference_fragprog(st, &bitmap_prog, NULL); #if 0 - { - struct gl_program *p = &stfp->bitmap_program->Base.Base; - printf("Combined bitmap program:\n"); - _mesa_print_program(p); - printf("InputsRead: 0x%x\n", p->InputsRead); - printf("OutputsWritten: 0x%x\n", p->OutputsWritten); - _mesa_print_parameter_list(p->Parameters); - } -#endif - - /* translate to TGSI tokens */ - st_translate_fragment_program(st, stfp->bitmap_program); + { + printf("Combined bitmap program:\n"); + _mesa_print_program(newProg); + printf("InputsRead: 0x%x\n", newProg->InputsRead); + printf("OutputsWritten: 0x%x\n", newProg->OutputsWritten); + _mesa_print_parameter_list(newProg->Parameters); } +#endif - return stfp->bitmap_program; + /* return results */ + *fpOut = (struct gl_fragment_program *) newProg; + *bitmap_sampler = sampler; } @@ -283,9 +283,9 @@ make_bitmap_texture(struct gl_context *ctx, GLsizei width, GLsizei height, return NULL; } - transfer = pipe_get_transfer(st->pipe, pt, 0, 0, 0, - PIPE_TRANSFER_WRITE, - 0, 0, width, height); + transfer = pipe_get_transfer(st->pipe, pt, 0, 0, + PIPE_TRANSFER_WRITE, + 0, 0, width, height); dest = pipe_transfer_map(pipe, transfer); @@ -349,7 +349,8 @@ setup_bitmap_vertex_data(struct st_context *st, bool normalized, if (!st->bitmap.vbuf) { st->bitmap.vbuf = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER, - max_slots * sizeof(st->bitmap.vertices)); + max_slots * + sizeof(st->bitmap.vertices)); } /* Positions are in clip coords since we need to do clipping in case @@ -389,10 +390,11 @@ setup_bitmap_vertex_data(struct st_context *st, bool normalized, /* put vertex data into vbuf */ pipe_buffer_write_nooverlap(st->pipe, - st->bitmap.vbuf, - st->bitmap.vbuf_slot * sizeof st->bitmap.vertices, - sizeof st->bitmap.vertices, - st->bitmap.vertices); + st->bitmap.vbuf, + st->bitmap.vbuf_slot + * sizeof(st->bitmap.vertices), + sizeof st->bitmap.vertices, + st->bitmap.vertices); return st->bitmap.vbuf_slot++ * sizeof st->bitmap.vertices; } @@ -411,11 +413,16 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct cso_context *cso = st->cso_context; - struct st_fragment_program *stfp; + struct st_fp_variant *fpv; + struct st_fp_variant_key key; GLuint maxSize; GLuint offset; - stfp = combined_bitmap_fragment_program(ctx); + memset(&key, 0, sizeof(key)); + key.st = st; + key.bitmap = GL_TRUE; + + fpv = st_get_fp_variant(st, st->fp, &key); /* As an optimization, Mesa's fragment programs will sometimes get the * primary color from a statevar/constant rather than a varying variable. @@ -428,7 +435,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, GLfloat colorSave[4]; COPY_4V(colorSave, ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); COPY_4V(ctx->Current.Attrib[VERT_ATTRIB_COLOR0], color); - st_upload_constants(st, stfp->Base.Base.Parameters, PIPE_SHADER_FRAGMENT); + st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT); COPY_4V(ctx->Current.Attrib[VERT_ATTRIB_COLOR0], colorSave); } @@ -437,7 +444,8 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, /* XXX if the bitmap is larger than the max texture size, break * it up into chunks. */ - maxSize = 1 << (pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1); + maxSize = 1 << (pipe->screen->get_param(pipe->screen, + PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1); assert(width <= (GLsizei)maxSize); assert(height <= (GLsizei)maxSize); @@ -454,7 +462,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, cso_set_rasterizer(cso, &st->bitmap.rasterizer); /* fragment shader state: TEX lookup program */ - cso_set_fragment_shader_handle(cso, stfp->driver_shader); + cso_set_fragment_shader_handle(cso, fpv->driver_shader); /* vertex shader state: position + texcoord pass-through */ cso_set_vertex_shader_handle(cso, st->bitmap.vs); @@ -462,21 +470,22 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, /* user samplers, plus our bitmap sampler */ { struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS]; - uint num = MAX2(stfp->bitmap_sampler + 1, st->state.num_samplers); + uint num = MAX2(fpv->bitmap_sampler + 1, st->state.num_samplers); uint i; for (i = 0; i < st->state.num_samplers; i++) { samplers[i] = &st->state.samplers[i]; } - samplers[stfp->bitmap_sampler] = &st->bitmap.samplers[sv->texture->target != PIPE_TEXTURE_RECT]; + samplers[fpv->bitmap_sampler] = + &st->bitmap.samplers[sv->texture->target != PIPE_TEXTURE_RECT]; cso_set_samplers(cso, num, (const struct pipe_sampler_state **) samplers); } /* user textures, plus the bitmap texture */ { struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; - uint num = MAX2(stfp->bitmap_sampler + 1, st->state.num_textures); + uint num = MAX2(fpv->bitmap_sampler + 1, st->state.num_textures); memcpy(sampler_views, st->state.sampler_views, sizeof(sampler_views)); - sampler_views[stfp->bitmap_sampler] = sv; + sampler_views[fpv->bitmap_sampler] = sv; cso_set_fragment_sampler_views(cso, num, sampler_views); } @@ -504,7 +513,9 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, z = z * 2.0 - 1.0; /* draw textured quad */ - offset = setup_bitmap_vertex_data(st, sv->texture->target != PIPE_TEXTURE_RECT, x, y, width, height, z, color); + offset = setup_bitmap_vertex_data(st, + sv->texture->target != PIPE_TEXTURE_RECT, + x, y, width, height, z, color); util_draw_vertex_buffer(pipe, st->bitmap.vbuf, offset, PIPE_PRIM_TRIANGLE_FAN, @@ -573,6 +584,9 @@ print_cache(const struct bitmap_cache *cache) } +/** + * Create gallium pipe_transfer object for the bitmap cache. + */ static void create_cache_trans(struct st_context *st) { @@ -585,10 +599,10 @@ create_cache_trans(struct st_context *st) /* Map the texture transfer. * Subsequent glBitmap calls will write into the texture image. */ - cache->trans = pipe_get_transfer(st->pipe, cache->texture, 0, 0, 0, - PIPE_TRANSFER_WRITE, 0, 0, - BITMAP_CACHE_WIDTH, - BITMAP_CACHE_HEIGHT); + cache->trans = pipe_get_transfer(st->pipe, cache->texture, 0, 0, + PIPE_TRANSFER_WRITE, 0, 0, + BITMAP_CACHE_WIDTH, + BITMAP_CACHE_HEIGHT); cache->buffer = pipe_transfer_map(pipe, cache->trans); /* init image to all 0xff */ @@ -651,7 +665,9 @@ st_flush_bitmap_cache(struct st_context *st) } } -/* Flush bitmap cache and release vertex buffer. + +/** + * Flush bitmap cache and release vertex buffer. */ void st_flush_bitmap( struct st_context *st ) @@ -737,7 +753,8 @@ accum_bitmap(struct st_context *st, * Called via ctx->Driver.Bitmap() */ static void -st_Bitmap(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, +st_Bitmap(struct gl_context *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap ) { struct st_context *st = st_context(ctx); @@ -764,7 +781,8 @@ st_Bitmap(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei heigh pt = make_bitmap_texture(ctx, width, height, unpack, bitmap); if (pt) { - struct pipe_sampler_view *sv = st_create_texture_sampler_view(st->pipe, pt); + struct pipe_sampler_view *sv = + st_create_texture_sampler_view(st->pipe, pt); assert(pt->target == PIPE_TEXTURE_2D || pt->target == PIPE_TEXTURE_RECT); @@ -814,15 +832,18 @@ st_init_bitmap(struct st_context *st) st->bitmap.rasterizer.gl_rasterization_rules = 1; /* find a usable texture format */ - if (screen->is_format_supported(screen, PIPE_FORMAT_I8_UNORM, PIPE_TEXTURE_2D, 0, + if (screen->is_format_supported(screen, PIPE_FORMAT_I8_UNORM, + PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, 0)) { st->bitmap.tex_format = PIPE_FORMAT_I8_UNORM; } - else if (screen->is_format_supported(screen, PIPE_FORMAT_A8_UNORM, PIPE_TEXTURE_2D, 0, + else if (screen->is_format_supported(screen, PIPE_FORMAT_A8_UNORM, + PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, 0)) { st->bitmap.tex_format = PIPE_FORMAT_A8_UNORM; } - else if (screen->is_format_supported(screen, PIPE_FORMAT_L8_UNORM, PIPE_TEXTURE_2D, 0, + else if (screen->is_format_supported(screen, PIPE_FORMAT_L8_UNORM, + PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, 0)) { st->bitmap.tex_format = PIPE_FORMAT_L8_UNORM; } @@ -845,8 +866,6 @@ st_destroy_bitmap(struct st_context *st) struct pipe_context *pipe = st->pipe; struct bitmap_cache *cache = st->bitmap.cache; - - if (st->bitmap.vs) { cso_delete_vertex_shader(st->cso_context, st->bitmap.vs); st->bitmap.vs = NULL; diff --git a/src/mesa/state_tracker/st_cb_bitmap.h b/src/mesa/state_tracker/st_cb_bitmap.h index d04b2b6..ed14158 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.h +++ b/src/mesa/state_tracker/st_cb_bitmap.h @@ -31,9 +31,12 @@ #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; struct st_context; +struct gl_fragment_program; +struct st_fragment_program; #if FEATURE_drawpix @@ -47,6 +50,12 @@ extern void st_destroy_bitmap(struct st_context *st); extern void +st_make_bitmap_fragment_program(struct st_context *st, + struct gl_fragment_program *fpIn, + struct gl_fragment_program **fpOut, + GLuint *bitmap_sampler); + +extern void st_flush_bitmap_cache(struct st_context *st); /* Flush bitmap cache and release vertex buffer. Needed at end of diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index af41835..6d02a7d 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -33,6 +33,7 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "st_context.h" #include "st_texture.h" @@ -40,7 +41,6 @@ #include "st_cb_fbo.h" #include "util/u_blit.h" -#include "util/u_inlines.h" void @@ -115,17 +115,14 @@ st_BlitFramebuffer(struct gl_context *ctx, st_texture_object(srcAtt->Texture); struct st_renderbuffer *dstRb = st_renderbuffer(drawFB->_ColorDrawBuffers[0]); - struct pipe_subresource srcSub; struct pipe_surface *dstSurf = dstRb->surface; if (!srcObj->pt) return; - srcSub.face = srcAtt->CubeMapFace; - srcSub.level = srcAtt->TextureLevel; - - util_blit_pixels(st->blit, srcObj->pt, srcSub, - srcX0, srcY0, srcX1, srcY1, srcAtt->Zoffset, + util_blit_pixels(st->blit, srcObj->pt, srcAtt->TextureLevel, + srcX0, srcY0, srcX1, srcY1, + srcAtt->Zoffset + srcAtt->CubeMapFace, dstSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } @@ -136,14 +133,11 @@ st_BlitFramebuffer(struct gl_context *ctx, st_renderbuffer(drawFB->_ColorDrawBuffers[0]); struct pipe_surface *srcSurf = srcRb->surface; struct pipe_surface *dstSurf = dstRb->surface; - struct pipe_subresource srcSub; - - srcSub.face = srcSurf->face; - srcSub.level = srcSurf->level; util_blit_pixels(st->blit, - srcRb->texture, srcSub, srcX0, srcY0, srcX1, srcY1, - srcSurf->zslice, + srcRb->texture, srcSurf->u.tex.level, + srcX0, srcY0, srcX1, srcY1, + srcSurf->u.tex.first_layer, dstSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } @@ -176,11 +170,11 @@ st_BlitFramebuffer(struct gl_context *ctx, /* Blitting depth and stencil values between combined * depth/stencil buffers. This is the ideal case for such buffers. */ - util_blit_pixels(st->blit, srcDepthRb->texture, - u_subresource(srcDepthRb->surface->face, - srcDepthRb->surface->level), + util_blit_pixels(st->blit, + srcDepthRb->texture, + srcDepthRb->surface->u.tex.level, srcX0, srcY0, srcX1, srcY1, - srcDepthRb->surface->zslice, + srcDepthRb->surface->u.tex.first_layer, dstDepthSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } @@ -189,10 +183,9 @@ st_BlitFramebuffer(struct gl_context *ctx, if (mask & GL_DEPTH_BUFFER_BIT) { util_blit_pixels(st->blit, srcDepthRb->texture, - u_subresource(srcDepthRb->surface->face, - srcDepthRb->surface->level), + srcDepthRb->surface->u.tex.level, srcX0, srcY0, srcX1, srcY1, - srcDepthRb->surface->zslice, + srcDepthRb->surface->u.tex.first_layer, dstDepthSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } diff --git a/src/mesa/state_tracker/st_cb_blit.h b/src/mesa/state_tracker/st_cb_blit.h index c230652..c6d9a36 100644 --- a/src/mesa/state_tracker/st_cb_blit.h +++ b/src/mesa/state_tracker/st_cb_blit.h @@ -30,6 +30,7 @@ #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; struct st_context; diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 27540c3..d4d9af4 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -211,6 +211,13 @@ st_bufferobj_data(struct gl_context *ctx, /** + * Dummy data whose's pointer is used for zero size buffers or ranges. + */ +static long st_bufferobj_zero_length = 0; + + + +/** * Called via glMapBufferARB(). */ static void * @@ -233,10 +240,16 @@ st_bufferobj_map(struct gl_context *ctx, GLenum target, GLenum access, break; } - obj->Pointer = pipe_buffer_map(st_context(ctx)->pipe, - st_obj->buffer, - flags, - &st_obj->transfer); + /* 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; @@ -247,13 +260,6 @@ st_bufferobj_map(struct gl_context *ctx, GLenum target, GLenum access, /** - * Dummy data whose's pointer is used for zero length ranges. - */ -static long -st_bufferobj_zero_length_range = 0; - - -/** * Called via glMapBufferRange(). */ static void * @@ -273,6 +279,12 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target, if (access & GL_MAP_FLUSH_EXPLICIT_BIT) flags |= PIPE_TRANSFER_FLUSH_EXPLICIT; + + if (access & GL_MAP_INVALIDATE_RANGE_BIT) + flags |= PIPE_TRANSFER_DISCARD; + + if (access & GL_MAP_INVALIDATE_BUFFER_BIT) + flags |= PIPE_TRANSFER_DISCARD; if (access & GL_MAP_UNSYNCHRONIZED_BIT) flags |= PIPE_TRANSFER_UNSYNCHRONIZED; @@ -293,7 +305,7 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target, * length range from the pipe driver. */ if (!length) { - obj->Pointer = &st_bufferobj_zero_length_range; + obj->Pointer = &st_bufferobj_zero_length; } else { obj->Pointer = pipe_buffer_map_range(pipe, @@ -348,7 +360,7 @@ st_bufferobj_unmap(struct gl_context *ctx, GLenum target, struct gl_buffer_objec struct st_buffer_object *st_obj = st_buffer_object(obj); if (obj->Length) - pipe_buffer_unmap(pipe, st_obj->buffer, st_obj->transfer); + pipe_buffer_unmap(pipe, st_obj->transfer); st_obj->transfer = NULL; obj->Pointer = NULL; @@ -397,8 +409,8 @@ st_copy_buffer_subdata(struct gl_context *ctx, if (srcPtr && dstPtr) memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); - pipe_buffer_unmap(pipe, srcObj->buffer, src_transfer); - pipe_buffer_unmap(pipe, dstObj->buffer, dst_transfer); + pipe_buffer_unmap(pipe, src_transfer); + pipe_buffer_unmap(pipe, dst_transfer); } diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index bd1dd78..6571bf2 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -470,13 +470,9 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) if (mask & (1 << b)) { struct gl_renderbuffer *rb = ctx->DrawBuffer->Attachment[b].Renderbuffer; - struct st_renderbuffer *strb; + struct st_renderbuffer *strb = st_renderbuffer(rb); - assert(rb); - - strb = st_renderbuffer(rb); - - if (!strb->surface) + if (!strb || !strb->surface) continue; if (check_clear_color_with_quad( ctx, rb )) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index d80c068..d128ff9 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -34,6 +34,8 @@ #include "main/image.h" #include "main/bufferobj.h" #include "main/macros.h" +#include "main/mfeatures.h" +#include "main/mtypes.h" #include "main/pack.h" #include "main/texformat.h" #include "main/texstore.h" @@ -94,88 +96,61 @@ is_passthrough_program(const struct gl_fragment_program *prog) /** * Make fragment shader for glDraw/CopyPixels. This shader is made * by combining the pixel transfer shader with the user-defined shader. - * \return pointer to Gallium driver fragment shader + * \param fpIn the current/incoming fragment program + * \param fpOut returns the combined fragment program */ -static void * -combined_drawpix_fragment_program(struct gl_context *ctx) +void +st_make_drawpix_fragment_program(struct st_context *st, + struct gl_fragment_program *fpIn, + struct gl_fragment_program **fpOut) { - struct st_context *st = st_context(ctx); - struct st_fragment_program *stfp; + struct gl_program *newProg; - if (st->pixel_xfer.program->serialNo == st->pixel_xfer.xfer_prog_sn - && st->fp->serialNo == st->pixel_xfer.user_prog_sn) { - /* the pixel tranfer program has not changed and the user-defined - * program has not changed, so re-use the combined program. - */ - stfp = st->pixel_xfer.combined_prog; + if (is_passthrough_program(fpIn)) { + newProg = (struct gl_program *) _mesa_clone_fragment_program(st->ctx, + &st->pixel_xfer.program->Base); } else { - /* Concatenate the pixel transfer program with the current user- - * defined program. - */ - if (is_passthrough_program(&st->fp->Base)) { - stfp = (struct st_fragment_program *) - _mesa_clone_fragment_program(ctx, &st->pixel_xfer.program->Base); - } - else { #if 0 - printf("Base program:\n"); - _mesa_print_program(&st->fp->Base.Base); - printf("DrawPix program:\n"); - _mesa_print_program(&st->pixel_xfer.program->Base.Base); + /* debug */ + printf("Base program:\n"); + _mesa_print_program(&fpIn->Base); + printf("DrawPix program:\n"); + _mesa_print_program(&st->pixel_xfer.program->Base.Base); #endif - stfp = (struct st_fragment_program *) - _mesa_combine_programs(ctx, - &st->pixel_xfer.program->Base.Base, - &st->fp->Base.Base); - } + newProg = _mesa_combine_programs(st->ctx, + &st->pixel_xfer.program->Base.Base, + &fpIn->Base); + } #if 0 - { - struct gl_program *p = &stfp->Base.Base; - printf("Combined DrawPixels program:\n"); - _mesa_print_program(p); - printf("InputsRead: 0x%x\n", p->InputsRead); - printf("OutputsWritten: 0x%x\n", p->OutputsWritten); - _mesa_print_parameter_list(p->Parameters); - } + /* debug */ + printf("Combined DrawPixels program:\n"); + _mesa_print_program(newProg); + printf("InputsRead: 0x%x\n", newProg->InputsRead); + printf("OutputsWritten: 0x%x\n", newProg->OutputsWritten); + _mesa_print_parameter_list(newProg->Parameters); #endif - /* translate to TGSI tokens */ - st_translate_fragment_program(st, stfp); - - /* save new program, update serial numbers */ - st->pixel_xfer.xfer_prog_sn = st->pixel_xfer.program->serialNo; - st->pixel_xfer.user_prog_sn = st->fp->serialNo; - st->pixel_xfer.combined_prog_sn = stfp->serialNo; - /* can't reference new program directly, already have a reference on it */ - st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL); - st->pixel_xfer.combined_prog = stfp; - } - - /* Ideally we'd have updated the pipe constants during the normal - * st/atom mechanism. But we can't since this is specific to glDrawPixels. - */ - st_upload_constants(st, stfp->Base.Base.Parameters, PIPE_SHADER_FRAGMENT); - - return stfp->driver_shader; + *fpOut = (struct gl_fragment_program *) newProg; } /** - * Create fragment shader that does a TEX() instruction to get a Z and/or + * Create fragment program that does a TEX() instruction to get a Z and/or * stencil value value, then writes to FRAG_RESULT_DEPTH/FRAG_RESULT_STENCIL. * Used for glDrawPixels(GL_DEPTH_COMPONENT / GL_STENCIL_INDEX). * Pass fragment color through as-is. - * \return pointer to the Gallium driver fragment shader + * \return pointer to the gl_fragment program */ -static void * -make_fragment_shader_z_stencil(struct st_context *st, GLboolean write_depth, - GLboolean write_stencil) +struct gl_fragment_program * +st_make_drawpix_z_stencil_program(struct st_context *st, + GLboolean write_depth, + GLboolean write_stencil) { struct gl_context *ctx = st->ctx; struct gl_program *p; - struct st_fragment_program *stp; + struct gl_fragment_program *fp; GLuint ic = 0; const GLuint shaderIndex = write_depth * 2 + write_stencil; @@ -183,7 +158,7 @@ make_fragment_shader_z_stencil(struct st_context *st, GLboolean write_depth, if (st->drawpix.shaders[shaderIndex]) { /* already have the proper shader */ - return st->drawpix.shaders[shaderIndex]->driver_shader; + return st->drawpix.shaders[shaderIndex]; } /* @@ -245,18 +220,15 @@ make_fragment_shader_z_stencil(struct st_context *st, GLboolean write_depth, if (write_stencil) p->SamplersUsed |= 1 << 1; - stp = st_fragment_program((struct gl_fragment_program *) p); + fp = (struct gl_fragment_program *) p; /* save the new shader */ - st->drawpix.shaders[shaderIndex] = stp; + st->drawpix.shaders[shaderIndex] = fp; - st_translate_fragment_program(st, stp); - - return stp->driver_shader; + return fp; } - /** * Create a simple vertex shader that just passes through the * vertex position and texcoord (and optionally, color). @@ -427,9 +399,9 @@ make_texture(struct st_context *st, /* we'll do pixel transfer in a fragment shader */ ctx->_ImageTransferState = 0x0; - transfer = pipe_get_transfer(st->pipe, pt, 0, 0, 0, - PIPE_TRANSFER_WRITE, 0, 0, - width, height); + transfer = pipe_get_transfer(st->pipe, pt, 0, 0, + PIPE_TRANSFER_WRITE, 0, 0, + width, height); /* map texture transfer */ dest = pipe_transfer_map(pipe, transfer); @@ -763,9 +735,9 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, else usage = PIPE_TRANSFER_WRITE; - pt = pipe_get_transfer(st_context(ctx)->pipe, strb->texture, 0, 0, 0, - usage, x, y, - width, height); + pt = pipe_get_transfer(st_context(ctx)->pipe, strb->texture, 0, 0, + usage, x, y, + width, height); stmap = pipe_transfer_map(pipe, pt); @@ -873,6 +845,61 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, /** + * Get fragment program variant for a glDrawPixels or glCopyPixels + * command for RGBA data. + */ +static struct st_fp_variant * +get_color_fp_variant(struct st_context *st) +{ + struct gl_context *ctx = st->ctx; + struct st_fp_variant_key key; + struct st_fp_variant *fpv; + + memset(&key, 0, sizeof(key)); + + key.st = st; + key.drawpixels = 1; + key.scaleAndBias = (ctx->Pixel.RedBias != 0.0 || + ctx->Pixel.RedScale != 1.0 || + ctx->Pixel.GreenBias != 0.0 || + ctx->Pixel.GreenScale != 1.0 || + ctx->Pixel.BlueBias != 0.0 || + ctx->Pixel.BlueScale != 1.0 || + ctx->Pixel.AlphaBias != 0.0 || + ctx->Pixel.AlphaScale != 1.0); + key.pixelMaps = ctx->Pixel.MapColorFlag; + + fpv = st_get_fp_variant(st, st->fp, &key); + + return fpv; +} + + +/** + * Get fragment program variant for a glDrawPixels or glCopyPixels + * command for depth/stencil data. + */ +static struct st_fp_variant * +get_depth_stencil_fp_variant(struct st_context *st, GLboolean write_depth, + GLboolean write_stencil) +{ + struct st_fp_variant_key key; + struct st_fp_variant *fpv; + + memset(&key, 0, sizeof(key)); + + key.st = st; + key.drawpixels = 1; + key.drawpixels_z = write_depth; + key.drawpixels_stencil = write_stencil; + + fpv = st_get_fp_variant(st, st->fp, &key); + + return fpv; +} + + +/** * Called via ctx->Driver.DrawPixels() */ static void @@ -889,6 +916,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, struct pipe_sampler_view *sv[2]; int num_sampler_view = 1; enum pipe_format stencil_format = PIPE_FORMAT_NONE; + struct st_fp_variant *fpv; if (format == GL_DEPTH_STENCIL) write_stencil = write_depth = GL_TRUE; @@ -921,14 +949,25 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, st_validate_state(st); + /* + * Get vertex/fragment shaders + */ if (write_depth || write_stencil) { - driver_fp = make_fragment_shader_z_stencil(st, write_depth, write_stencil); + fpv = get_depth_stencil_fp_variant(st, write_depth, write_stencil); + + driver_fp = fpv->driver_shader; + driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); + color = ctx->Current.RasterColor; } else { - driver_fp = combined_drawpix_fragment_program(ctx); + fpv = get_color_fp_variant(st); + + driver_fp = fpv->driver_shader; + driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); + color = NULL; if (st->pixel_xfer.pixelmap_enabled) { sv[1] = st->pixel_xfer.pixelmap_sampler_view; @@ -936,6 +975,9 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, } } + /* update fragment program constants */ + st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT); + /* draw with textured quad */ { struct pipe_resource *pt @@ -1025,15 +1067,15 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, usage = PIPE_TRANSFER_READ_WRITE; else usage = PIPE_TRANSFER_WRITE; - + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { dsty = rbDraw->Base.Height - dsty - height; } ptDraw = pipe_get_transfer(st_context(ctx)->pipe, - rbDraw->texture, 0, 0, 0, - usage, dstx, dsty, - width, height); + rbDraw->texture, 0, 0, + usage, dstx, dsty, + width, height); assert(util_format_get_blockwidth(ptDraw->resource->format) == 1); assert(util_format_get_blockheight(ptDraw->resource->format) == 1); @@ -1116,6 +1158,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, GLint readX, readY, readW, readH; GLuint sample_count; struct gl_pixelstore_attrib pack = ctx->DefaultPacking; + struct st_fp_variant *fpv; st_validate_state(st); @@ -1125,11 +1168,18 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, return; } + /* + * Get vertex/fragment shaders + */ if (type == GL_COLOR) { rbRead = st_get_color_read_renderbuffer(ctx); color = NULL; - driver_fp = combined_drawpix_fragment_program(ctx); + + fpv = get_color_fp_variant(st); + driver_fp = fpv->driver_shader; + driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); + if (st->pixel_xfer.pixelmap_enabled) { sv[1] = st->pixel_xfer.pixelmap_sampler_view; num_sampler_view++; @@ -1139,10 +1189,17 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, assert(type == GL_DEPTH); rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - driver_fp = make_fragment_shader_z_stencil(st, GL_TRUE, GL_FALSE); + + fpv = get_depth_stencil_fp_variant(st, GL_TRUE, GL_FALSE); + driver_fp = fpv->driver_shader; + driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); } + /* update fragment program constants */ + st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT); + + if (rbRead->Base.Wrapped) rbRead = st_renderbuffer(rbRead->Base.Wrapped); @@ -1209,27 +1266,24 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* Make temporary texture which is a copy of the src region. */ if (srcFormat == texFormat) { - struct pipe_subresource srcsub, dstsub; - srcsub.face = 0; - srcsub.level = 0; - dstsub.face = 0; - dstsub.level = 0; - /* copy source framebuffer surface into mipmap/texture */ + struct pipe_box src_box; + u_box_2d(readX, readY, readW, readH, &src_box); + /* copy source framebuffer surface into mipmap/texture */ pipe->resource_copy_region(pipe, pt, /* dest tex */ - dstsub, + 0, pack.SkipPixels, pack.SkipRows, 0, /* dest pos */ rbRead->texture, /* src tex */ - srcsub, - readX, readY, 0, readW, readH); /* src region */ + 0, + &src_box); } else { /* CPU-based fallback/conversion */ struct pipe_transfer *ptRead = - pipe_get_transfer(st->pipe, rbRead->texture, 0, 0, 0, - PIPE_TRANSFER_READ, - readX, readY, readW, readH); + pipe_get_transfer(st->pipe, rbRead->texture, 0, 0, + PIPE_TRANSFER_READ, + readX, readY, readW, readH); struct pipe_transfer *ptTex; enum pipe_transfer_usage transfer_usage; @@ -1241,8 +1295,8 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, else transfer_usage = PIPE_TRANSFER_WRITE; - ptTex = pipe_get_transfer(st->pipe, pt, 0, 0, 0, transfer_usage, - 0, 0, width, height); + ptTex = pipe_get_transfer(st->pipe, pt, 0, 0, transfer_usage, + 0, 0, width, height); /* copy image from ptRead surface to ptTex surface */ if (type == GL_COLOR) { @@ -1297,7 +1351,7 @@ st_destroy_drawpix(struct st_context *st) for (i = 0; i < Elements(st->drawpix.shaders); i++) { if (st->drawpix.shaders[i]) - st_reference_fragprog(st, &st->drawpix.shaders[i], NULL); + _mesa_reference_fragprog(st->ctx, &st->drawpix.shaders[i], NULL); } st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL); diff --git a/src/mesa/state_tracker/st_cb_drawpixels.h b/src/mesa/state_tracker/st_cb_drawpixels.h index 575f169..44d7f5e 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.h +++ b/src/mesa/state_tracker/st_cb_drawpixels.h @@ -31,6 +31,7 @@ #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; struct st_context; @@ -42,6 +43,16 @@ extern void st_init_drawpixels_functions(struct dd_function_table *functions); extern void st_destroy_drawpix(struct st_context *st); +extern void +st_make_drawpix_fragment_program(struct st_context *st, + struct gl_fragment_program *fpIn, + struct gl_fragment_program **fpOut); + +extern struct gl_fragment_program * +st_make_drawpix_z_stencil_program(struct st_context *st, + GLboolean write_depth, + GLboolean write_stencil); + #else static INLINE void diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index 6cad7d3..b540a79 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.c +++ b/src/mesa/state_tracker/st_cb_drawtex.c @@ -15,6 +15,7 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "program/program.h" #include "program/prog_print.h" @@ -220,7 +221,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, } } - pipe_buffer_unmap(pipe, vbuffer, vbuffer_transfer); + pipe_buffer_unmap(pipe, vbuffer_transfer); #undef SET_ATTRIB } diff --git a/src/mesa/state_tracker/st_cb_drawtex.h b/src/mesa/state_tracker/st_cb_drawtex.h index d21262f..455da04 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.h +++ b/src/mesa/state_tracker/st_cb_drawtex.h @@ -11,6 +11,7 @@ #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; struct st_context; diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index c4b84de..dfde821 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -26,6 +26,7 @@ * Chia-I Wu <olv@lunarg.com> */ +#include "main/mfeatures.h" #include "main/texobj.h" #include "main/texfetch.h" #include "main/teximage.h" diff --git a/src/mesa/state_tracker/st_cb_eglimage.h b/src/mesa/state_tracker/st_cb_eglimage.h index b6e44d5..48567ed 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.h +++ b/src/mesa/state_tracker/st_cb_eglimage.h @@ -30,6 +30,7 @@ #define ST_CB_EGLIMAGE_H #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 9425f07..0c7641f 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -38,6 +38,7 @@ #include "main/fbobject.h" #include "main/framebuffer.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/renderbuffer.h" #include "pipe/p_context.h" @@ -52,6 +53,7 @@ #include "util/u_format.h" #include "util/u_inlines.h" +#include "util/u_surface.h" /** @@ -60,19 +62,23 @@ * during window resize. */ static GLboolean -st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb, +st_renderbuffer_alloc_storage(struct gl_context * ctx, + struct gl_renderbuffer *rb, GLenum internalFormat, GLuint width, GLuint height) { struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = st->pipe->screen; struct st_renderbuffer *strb = st_renderbuffer(rb); enum pipe_format format; + struct pipe_surface surf_tmpl; if (strb->format != PIPE_FORMAT_NONE) format = strb->format; else - format = st_choose_renderbuffer_format(screen, internalFormat, rb->NumSamples); + format = st_choose_renderbuffer_format(screen, internalFormat, + rb->NumSamples); /* init renderbuffer fields */ strb->Base.Width = width; @@ -113,6 +119,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *r template.width0 = width; template.height0 = height; template.depth0 = 1; + template.array_size = 1; template.last_level = 0; template.nr_samples = rb->NumSamples; if (util_format_is_depth_or_stencil(format)) { @@ -120,7 +127,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *r } else { template.bind = (PIPE_BIND_DISPLAY_TARGET | - PIPE_BIND_RENDER_TARGET); + PIPE_BIND_RENDER_TARGET); } strb->texture = screen->resource_create(screen, &template); @@ -128,10 +135,11 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *r if (!strb->texture) return FALSE; - strb->surface = screen->get_tex_surface(screen, - strb->texture, - 0, 0, 0, - template.bind); + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + u_surface_default_template(&surf_tmpl, strb->texture, template.bind); + strb->surface = pipe->create_surface(pipe, + strb->texture, + &surf_tmpl); if (strb->surface) { assert(strb->surface->texture); assert(strb->surface->format); @@ -327,12 +335,12 @@ st_render_texture(struct gl_context *ctx, { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; struct st_renderbuffer *strb; struct gl_renderbuffer *rb; struct pipe_resource *pt = st_get_texobj_resource(att->Texture); struct st_texture_object *stObj; const struct gl_texture_image *texImage; + struct pipe_surface surf_tmpl; /* When would this fail? Perhaps assert? */ if (!pt) @@ -381,12 +389,15 @@ st_render_texture(struct gl_context *ctx, assert(strb->rtt_level <= strb->texture->last_level); /* new surface for rendering into the texture */ - strb->surface = screen->get_tex_surface(screen, - strb->texture, - strb->rtt_face, - strb->rtt_level, - strb->rtt_slice, - PIPE_BIND_RENDER_TARGET); + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + surf_tmpl.format = strb->texture->format; + surf_tmpl.usage = PIPE_BIND_RENDER_TARGET; + surf_tmpl.u.tex.level = strb->rtt_level; + surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice; + surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice; + strb->surface = pipe->create_surface(pipe, + strb->texture, + &surf_tmpl); strb->format = pt->format; diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 5c01856..9b85a39 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -40,6 +40,7 @@ #include "main/imports.h" #include "main/context.h" #include "main/feedback.h" +#include "main/mfeatures.h" #include "vbo/vbo.h" diff --git a/src/mesa/state_tracker/st_cb_feedback.h b/src/mesa/state_tracker/st_cb_feedback.h index f2342f5..02e34e4 100644 --- a/src/mesa/state_tracker/st_cb_feedback.h +++ b/src/mesa/state_tracker/st_cb_feedback.h @@ -31,6 +31,7 @@ #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 4d83fcc..3269497 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -46,16 +46,13 @@ #include "st_cb_program.h" -static GLuint SerialNo = 1; - /** * Called via ctx->Driver.BindProgram() to bind an ARB vertex or * fragment program. */ -static void st_bind_program( struct gl_context *ctx, - GLenum target, - struct gl_program *prog ) +static void +st_bind_program(struct gl_context *ctx, GLenum target, struct gl_program *prog) { struct st_context *st = st_context(ctx); @@ -77,7 +74,8 @@ static void st_bind_program( struct gl_context *ctx, * Called via ctx->Driver.UseProgram() to bind a linked GLSL program * (vertex shader + fragment shader). */ -static void st_use_program( struct gl_context *ctx, struct gl_shader_program *shProg) +static void +st_use_program(struct gl_context *ctx, struct gl_shader_program *shProg) { struct st_context *st = st_context(ctx); @@ -87,48 +85,28 @@ static void st_use_program( struct gl_context *ctx, struct gl_shader_program *sh } - /** * Called via ctx->Driver.NewProgram() to allocate a new vertex or * fragment program. */ -static struct gl_program *st_new_program( struct gl_context *ctx, - GLenum target, - GLuint id ) +static struct gl_program * +st_new_program(struct gl_context *ctx, GLenum target, GLuint id) { switch (target) { case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *prog = ST_CALLOC_STRUCT(st_vertex_program); - - prog->serialNo = SerialNo++; - - return _mesa_init_vertex_program( ctx, - &prog->Base, - target, - id ); + return _mesa_init_vertex_program(ctx, &prog->Base, target, id); } case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: { struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program); - - prog->serialNo = SerialNo++; - - return _mesa_init_fragment_program( ctx, - &prog->Base, - target, - id ); + return _mesa_init_fragment_program(ctx, &prog->Base, target, id); } case MESA_GEOMETRY_PROGRAM: { struct st_geometry_program *prog = ST_CALLOC_STRUCT(st_geometry_program); - - prog->serialNo = SerialNo++; - - return _mesa_init_geometry_program( ctx, - &prog->Base, - target, - id ); + return _mesa_init_geometry_program(ctx, &prog->Base, target, id); } default: @@ -138,7 +116,10 @@ static struct gl_program *st_new_program( struct gl_context *ctx, } -void +/** + * Called via ctx->Driver.DeleteProgram() + */ +static void st_delete_program(struct gl_context *ctx, struct gl_program *prog) { struct st_context *st = st_context(ctx); @@ -147,17 +128,15 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *stvp = (struct st_vertex_program *) prog; - st_vp_release_varients( st, stvp ); + st_release_vp_variants( st, stvp ); } break; case MESA_GEOMETRY_PROGRAM: { - struct st_geometry_program *stgp = (struct st_geometry_program *) prog; + struct st_geometry_program *stgp = + (struct st_geometry_program *) prog; - if (stgp->driver_shader) { - cso_delete_geometry_shader(st->cso_context, stgp->driver_shader); - stgp->driver_shader = NULL; - } + st_release_gp_variants(st, stgp); if (stgp->tgsi.tokens) { st_free_tokens((void *) stgp->tgsi.tokens); @@ -167,23 +146,15 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) break; case GL_FRAGMENT_PROGRAM_ARB: { - struct st_fragment_program *stfp = (struct st_fragment_program *) prog; + struct st_fragment_program *stfp = + (struct st_fragment_program *) prog; - if (stfp->driver_shader) { - cso_delete_fragment_shader(st->cso_context, stfp->driver_shader); - stfp->driver_shader = NULL; - } + st_release_fp_variants(st, stfp); if (stfp->tgsi.tokens) { st_free_tokens(stfp->tgsi.tokens); stfp->tgsi.tokens = NULL; } - - if (stfp->bitmap_program) { - struct gl_program *prg = &stfp->bitmap_program->Base.Base; - _mesa_reference_program(ctx, &prg, NULL); - stfp->bitmap_program = NULL; - } } break; default: @@ -195,15 +166,25 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) } -static GLboolean st_is_program_native( struct gl_context *ctx, - GLenum target, - struct gl_program *prog ) +/** + * Called via ctx->Driver.IsProgramNative() + */ +static GLboolean +st_is_program_native(struct gl_context *ctx, + GLenum target, + struct gl_program *prog) { return GL_TRUE; } -static GLboolean st_program_string_notify( struct gl_context *ctx, +/** + * Called via ctx->Driver.ProgramStringNotify() + * Called when the program's text/code is changed. We have to free + * all shader variants and corresponding gallium shaders when this happens. + */ +static GLboolean +st_program_string_notify( struct gl_context *ctx, GLenum target, struct gl_program *prog ) { @@ -212,12 +193,7 @@ static GLboolean st_program_string_notify( struct gl_context *ctx, if (target == GL_FRAGMENT_PROGRAM_ARB) { struct st_fragment_program *stfp = (struct st_fragment_program *) prog; - stfp->serialNo++; - - if (stfp->driver_shader) { - cso_delete_fragment_shader(st->cso_context, stfp->driver_shader); - stfp->driver_shader = NULL; - } + st_release_fp_variants(st, stfp); if (stfp->tgsi.tokens) { st_free_tokens(stfp->tgsi.tokens); @@ -230,12 +206,7 @@ static GLboolean st_program_string_notify( struct gl_context *ctx, else if (target == MESA_GEOMETRY_PROGRAM) { struct st_geometry_program *stgp = (struct st_geometry_program *) prog; - stgp->serialNo++; - - if (stgp->driver_shader) { - cso_delete_geometry_shader(st->cso_context, stgp->driver_shader); - stgp->driver_shader = NULL; - } + st_release_gp_variants(st, stgp); if (stgp->tgsi.tokens) { st_free_tokens((void *) stgp->tgsi.tokens); @@ -248,9 +219,7 @@ static GLboolean st_program_string_notify( struct gl_context *ctx, else if (target == GL_VERTEX_PROGRAM_ARB) { struct st_vertex_program *stvp = (struct st_vertex_program *) prog; - stvp->serialNo++; - - st_vp_release_varients( st, stvp ); + st_release_vp_variants( st, stvp ); if (st->vp == stvp) st->dirty.st |= ST_NEW_VERTEX_PROGRAM; @@ -261,8 +230,11 @@ static GLboolean st_program_string_notify( struct gl_context *ctx, } - -void st_init_program_functions(struct dd_function_table *functions) +/** + * Plug in the program and shader-related device driver functions. + */ +void +st_init_program_functions(struct dd_function_table *functions) { functions->BindProgram = st_bind_program; functions->UseProgram = st_use_program; diff --git a/src/mesa/state_tracker/st_cb_program.h b/src/mesa/state_tracker/st_cb_program.h index 004afb6..091a443 100644 --- a/src/mesa/state_tracker/st_cb_program.h +++ b/src/mesa/state_tracker/st_cb_program.h @@ -29,15 +29,10 @@ #define ST_CB_PROGRAM_H -#include "main/mtypes.h" - struct dd_function_table; extern void st_init_program_functions(struct dd_function_table *functions); -extern void -st_delete_program(struct gl_context *ctx, struct gl_program *prog); - #endif diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index aa31b37..d0ac253 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -35,6 +35,7 @@ #include "main/imports.h" #include "main/context.h" +#include "main/mfeatures.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" @@ -84,6 +85,8 @@ st_BeginQuery(struct gl_context *ctx, struct gl_query_object *q) /* convert GL query type to Gallium query type */ switch (q->Target) { + case GL_ANY_SAMPLES_PASSED: + /* fall-through */ case GL_SAMPLES_PASSED_ARB: type = PIPE_QUERY_OCCLUSION_COUNTER; break; diff --git a/src/mesa/state_tracker/st_cb_queryobj.h b/src/mesa/state_tracker/st_cb_queryobj.h index 017471b..03f0be8 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.h +++ b/src/mesa/state_tracker/st_cb_queryobj.h @@ -29,6 +29,7 @@ #define ST_CB_QUERYOBJ_H +#include "main/mfeatures.h" #include "main/mtypes.h" /** diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 15a4f60..32d465c 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -38,6 +38,7 @@ #include "main/imports.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/feedback.h" #include "st_context.h" diff --git a/src/mesa/state_tracker/st_cb_rasterpos.h b/src/mesa/state_tracker/st_cb_rasterpos.h index 2dc109b..b61411b 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.h +++ b/src/mesa/state_tracker/st_cb_rasterpos.h @@ -30,6 +30,7 @@ #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index bcd46ac..0507be7 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -80,7 +80,7 @@ st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, /* Create a read transfer from the renderbuffer's texture */ pt = pipe_get_transfer(pipe, strb->texture, - 0, 0, 0, /* face, level, zslice */ + 0, 0, PIPE_TRANSFER_READ, x, y, width, height); @@ -236,7 +236,7 @@ st_fast_readpixels(struct gl_context *ctx, struct st_renderbuffer *strb, } trans = pipe_get_transfer(pipe, strb->texture, - 0, 0, 0, /* face, level, zslice */ + 0, 0, PIPE_TRANSFER_READ, x, y, width, height); if (!trans) { @@ -328,7 +328,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - GLfloat temp[MAX_WIDTH][4]; + GLfloat (*temp)[4]; const GLbitfield transferOps = ctx->_ImageTransferState; GLsizei i, j; GLint yStep, dfStride; @@ -381,6 +381,13 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h return; } + /* allocate temp pixel row buffer */ + temp = (GLfloat (*)[4]) malloc(4 * width * sizeof(GLfloat)); + if (!temp) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); + return; + } + if (format == GL_RGBA && type == GL_FLOAT) { /* write tile(row) directly into user's buffer */ df = (GLfloat *) _mesa_image_address2d(&clippedPacking, dest, width, @@ -400,7 +407,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h /* Create a read transfer from the renderbuffer's texture */ trans = pipe_get_transfer(pipe, strb->texture, - 0, 0, 0, /* face, level, zslice */ + 0, 0, PIPE_TRANSFER_READ, x, y, width, height); @@ -533,6 +540,8 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h } } + free(temp); + pipe->transfer_destroy(pipe, trans); _mesa_unmap_pbo_dest(ctx, &clippedPacking); diff --git a/src/mesa/state_tracker/st_cb_readpixels.h b/src/mesa/state_tracker/st_cb_readpixels.h index 83c9b65..9622ae6 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.h +++ b/src/mesa/state_tracker/st_cb_readpixels.h @@ -29,9 +29,11 @@ #ifndef ST_CB_READPIXELS_H #define ST_CB_READPIXELS_H -#include "main/mtypes.h" +#include "main/glheader.h" struct dd_function_table; +struct gl_context; +struct gl_pixelstore_attrib; extern struct st_renderbuffer * st_get_color_read_renderbuffer(struct gl_context *ctx); diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 15e69e1..09a10ba 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -63,7 +63,7 @@ #include "util/u_surface.h" #include "util/u_sampler.h" #include "util/u_math.h" - +#include "util/u_box.h" #define DBG if (0) printf @@ -431,7 +431,7 @@ compress_with_blit(struct gl_context * ctx, struct pipe_resource *src_tex; struct pipe_sampler_view view_templ; struct pipe_sampler_view *src_view; - struct pipe_surface *dst_surface; + struct pipe_surface *dst_surface, surf_tmpl; struct pipe_transfer *tex_xfer; void *map; @@ -441,9 +441,13 @@ compress_with_blit(struct gl_context * ctx, } /* get destination surface (in the compressed texture) */ - dst_surface = screen->get_tex_surface(screen, stImage->pt, - stImage->face, stImage->level, 0, - 0 /* flags */); + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + surf_tmpl.format = 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; + surf_tmpl.u.tex.last_layer = stImage->face; + dst_surface = pipe->create_surface(pipe, stImage->pt, &surf_tmpl); if (!dst_surface) { /* can't render into this format (or other problem) */ return GL_FALSE; @@ -464,6 +468,7 @@ compress_with_blit(struct gl_context * ctx, templ.width0 = width; templ.height0 = height; templ.depth0 = 1; + templ.array_size = 1; templ.last_level = 0; templ.usage = PIPE_USAGE_DEFAULT; templ.bind = PIPE_BIND_SAMPLER_VIEW; @@ -475,9 +480,9 @@ compress_with_blit(struct gl_context * ctx, /* Put user's tex data into the temporary texture */ tex_xfer = pipe_get_transfer(st_context(ctx)->pipe, src_tex, - 0, 0, 0, /* face, level are zero */ - PIPE_TRANSFER_WRITE, - 0, 0, width, height); /* x, y, w, h */ + 0, 0, /* layer, level are zero */ + PIPE_TRANSFER_WRITE, + 0, 0, width, height); /* x, y, w, h */ map = pipe_transfer_map(pipe, tex_xfer); _mesa_texstore(ctx, 2, GL_RGBA, mesa_format, @@ -857,7 +862,6 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level, { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; struct st_texture_image *stImage = st_texture_image(texImage); struct st_texture_object *stObj = st_texture_object(texObj); struct pipe_sampler_view *src_view = @@ -871,7 +875,7 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level, PIPE_BIND_TRANSFER_READ); /* create temp / dest surface */ - if (!util_create_rgba_surface(screen, width, height, bind, + if (!util_create_rgba_surface(pipe, width, height, bind, &dst_texture, &dst_surface)) { _mesa_problem(ctx, "util_create_rgba_surface() failed " "in decompress_with_blit()"); @@ -891,9 +895,9 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level, /* map the dst_surface so we can read from it */ tex_xfer = pipe_get_transfer(st_context(ctx)->pipe, - dst_texture, 0, 0, 0, - PIPE_TRANSFER_READ, - 0, 0, width, height); + dst_texture, 0, 0, + PIPE_TRANSFER_READ, + 0, 0, width, height); pixels = _mesa_map_pbo_dest(ctx, &ctx->Pack, pixels); @@ -1310,7 +1314,7 @@ fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level, struct pipe_transfer *src_trans; GLvoid *texDest; enum pipe_transfer_usage transfer_usage; - + if (ST_DEBUG & DEBUG_FALLBACK) debug_printf("%s: fallback processing\n", __FUNCTION__); @@ -1321,11 +1325,11 @@ fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level, } src_trans = pipe_get_transfer(st_context(ctx)->pipe, - strb->texture, - 0, 0, 0, - PIPE_TRANSFER_READ, - srcX, srcY, - width, height); + strb->texture, + 0, 0, + PIPE_TRANSFER_READ, + srcX, srcY, + width, height); if ((baseFormat == GL_DEPTH_COMPONENT || baseFormat == GL_DEPTH_STENCIL) && @@ -1334,7 +1338,8 @@ fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level, else transfer_usage = PIPE_TRANSFER_WRITE; - texDest = st_texture_image_map(st, stImage, 0, transfer_usage, + /* XXX this used to ignore destZ param */ + texDest = st_texture_image_map(st, stImage, destZ, transfer_usage, destX, destY, width, height); if (baseFormat == GL_DEPTH_COMPONENT || @@ -1523,6 +1528,9 @@ st_copy_texsubimage(struct gl_context *ctx, if (texBaseFormat == GL_DEPTH_COMPONENT || texBaseFormat == GL_DEPTH_STENCIL) { strb = st_renderbuffer(fb->_DepthBuffer); + if (strb->Base.Wrapped) { + strb = st_renderbuffer(strb->Base.Wrapped); + } } else { /* texBaseFormat == GL_RGB, GL_RGBA, GL_ALPHA, etc */ @@ -1592,27 +1600,23 @@ st_copy_texsubimage(struct gl_context *ctx, if (matching_base_formats && src_format == dest_format && - !do_flip) + !do_flip) { /* use surface_copy() / blit */ - struct pipe_subresource subdst, subsrc; - subdst.face = stImage->face; - subdst.level = stImage->level; - subsrc.face = strb->surface->face; - subsrc.level = strb->surface->level; + struct pipe_box src_box; + u_box_2d_zslice(srcX, srcY, strb->surface->u.tex.first_layer, + width, height, &src_box); /* for resource_copy_region(), y=0=top, always */ pipe->resource_copy_region(pipe, /* dest */ stImage->pt, - subdst, - destX, destY, destZ, + stImage->level, + destX, destY, destZ + stImage->face, /* src */ strb->texture, - subsrc, - srcX, srcY, strb->surface->zslice, - /* size */ - width, height); + strb->surface->u.tex.level, + &src_box); use_fallback = GL_FALSE; } else if (format_writemask && @@ -1628,12 +1632,16 @@ st_copy_texsubimage(struct gl_context *ctx, 0)) { /* draw textured quad to do the copy */ GLint srcY0, srcY1; - struct pipe_subresource subsrc; + struct pipe_surface surf_tmpl; + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + surf_tmpl.format = 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; - dest_surface = screen->get_tex_surface(screen, stImage->pt, - stImage->face, stImage->level, - destZ, - PIPE_BIND_RENDER_TARGET); + dest_surface = pipe->create_surface(pipe, stImage->pt, + &surf_tmpl); if (do_flip) { srcY1 = strb->Base.Height - srcY - height; @@ -1643,15 +1651,13 @@ st_copy_texsubimage(struct gl_context *ctx, srcY0 = srcY; srcY1 = srcY0 + height; } - subsrc.face = strb->surface->face; - subsrc.level = strb->surface->level; util_blit_pixels_writemask(st->blit, strb->texture, - subsrc, + strb->surface->u.tex.level, srcX, srcY0, srcX + width, srcY1, - strb->surface->zslice, + strb->surface->u.tex.first_layer, dest_surface, destX, destY, destX + width, destY + height, @@ -1853,7 +1859,7 @@ st_finalize_texture(struct gl_context *ctx, */ if (firstImage->pt && firstImage->pt != stObj->pt && - firstImage->pt->last_level >= stObj->lastLevel) { + (!stObj->pt || firstImage->pt->last_level >= stObj->pt->last_level)) { pipe_resource_reference(&stObj->pt, firstImage->pt); pipe_sampler_view_reference(&stObj->sampler_view, NULL); } diff --git a/src/mesa/state_tracker/st_cb_texture.h b/src/mesa/state_tracker/st_cb_texture.h index 6098705..f1502bd 100644 --- a/src/mesa/state_tracker/st_cb_texture.h +++ b/src/mesa/state_tracker/st_cb_texture.h @@ -31,9 +31,10 @@ #include "main/glheader.h" -#include "main/mtypes.h" struct dd_function_table; +struct gl_context; +struct gl_texture_object; struct pipe_context; struct st_context; diff --git a/src/mesa/state_tracker/st_cb_xformfb.c b/src/mesa/state_tracker/st_cb_xformfb.c index 838a0a4..e415b18 100644 --- a/src/mesa/state_tracker/st_cb_xformfb.c +++ b/src/mesa/state_tracker/st_cb_xformfb.c @@ -35,6 +35,7 @@ #include "main/imports.h" #include "main/context.h" +#include "main/mfeatures.h" #include "main/transformfeedback.h" #include "st_cb_xformfb.h" diff --git a/src/mesa/state_tracker/st_cb_xformfb.h b/src/mesa/state_tracker/st_cb_xformfb.h index 574cf48..1215ebe 100644 --- a/src/mesa/state_tracker/st_cb_xformfb.h +++ b/src/mesa/state_tracker/st_cb_xformfb.h @@ -30,6 +30,7 @@ #include "main/compiler.h" +#include "main/mfeatures.h" struct dd_function_table; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index d6628b1..c7f3949 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -207,12 +207,6 @@ static void st_destroy_context_priv( struct st_context *st ) pipe_sampler_view_reference(&st->state.sampler_views[i], NULL); } - for (i = 0; i < Elements(st->state.constants); i++) { - if (st->state.constants[i]) { - pipe_resource_reference(&st->state.constants[i], NULL); - } - } - if (st->default_texture) { st->ctx->Driver.DeleteTexture(st->ctx, st->default_texture); st->default_texture = NULL; @@ -244,14 +238,15 @@ void st_destroy_context( struct st_context *st ) pipe->set_index_buffer(pipe, NULL); for (i = 0; i < PIPE_SHADER_TYPES; i++) { - pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, NULL); - pipe_resource_reference(&st->state.constants[PIPE_SHADER_VERTEX], NULL); + pipe->set_constant_buffer(pipe, i, 0, NULL); } _mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache); _vbo_DestroyContext(st->ctx); + st_destroy_program_variants(st); + _mesa_free_context_data(ctx); st_destroy_context_priv(st); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index d342c0c..64a8f79 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -1,4 +1,3 @@ -//struct dd_function_table; /************************************************************************** * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. @@ -93,7 +92,10 @@ struct st_context struct pipe_sampler_state samplers[PIPE_MAX_SAMPLERS]; struct pipe_sampler_state *sampler_list[PIPE_MAX_SAMPLERS]; struct pipe_clip_state clip; - struct pipe_resource *constants[PIPE_SHADER_TYPES]; + struct { + void *ptr; + unsigned size; + } constants[PIPE_SHADER_TYPES]; struct pipe_framebuffer_state framebuffer; struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; struct pipe_scissor_state scissor; @@ -106,15 +108,6 @@ struct st_context GLuint poly_stipple[32]; /**< In OpenGL's bottom-to-top order */ } state; - struct { - struct st_tracked_state tracked_state[PIPE_SHADER_TYPES]; - } constants; - - /* XXX unused: */ - struct { - struct gl_fragment_program *fragment_program; - } cb; - char vendor[100]; char renderer[100]; @@ -130,7 +123,9 @@ struct st_context struct st_fragment_program *fp; /**< Currently bound fragment program */ struct st_geometry_program *gp; /**< Currently bound geometry program */ - struct st_vp_varient *vp_varient; + struct st_vp_variant *vp_variant; + struct st_fp_variant *fp_variant; + struct st_gp_variant *gp_variant; struct gl_texture_object *default_texture; @@ -160,7 +155,7 @@ struct st_context /** for glDraw/CopyPixels */ struct { - struct st_fragment_program *shaders[4]; + struct gl_fragment_program *shaders[4]; void *vert_shaders[2]; /**< ureg shaders */ } drawpix; diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index df32491..e1e373d 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -89,8 +89,8 @@ st_print_current(void) } #endif - if (st->vp->varients) - tgsi_dump( st->vp->varients[0].tgsi.tokens, 0 ); + if (st->vp->variants) + tgsi_dump( st->vp->variants[0].tgsi.tokens, 0 ); if (st->vp->Base.Base.Parameters) _mesa_print_parameter_list(st->vp->Base.Base.Parameters); diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 61a0e1b..db70daa 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -43,6 +43,7 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "program/prog_uniform.h" #include "vbo/vbo.h" @@ -241,7 +242,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, */ static GLboolean is_interleaved_arrays(const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLboolean *userSpace) { @@ -297,7 +298,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp, */ static void get_arrays_bounds(const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLuint max_index, const GLubyte **low, const GLubyte **high) @@ -343,7 +344,7 @@ get_arrays_bounds(const struct st_vertex_program *vp, static void setup_interleaved_attribs(struct gl_context *ctx, const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLuint max_index, GLboolean userSpace, @@ -409,7 +410,7 @@ setup_interleaved_attribs(struct gl_context *ctx, static void setup_non_interleaved_attribs(struct gl_context *ctx, const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLuint max_index, GLboolean *userSpace, @@ -617,7 +618,7 @@ st_draw_vbo(struct gl_context *ctx, struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; const struct st_vertex_program *vp; - const struct st_vp_varient *vpv; + const struct st_vp_variant *vpv; struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS]; GLuint attr; struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS]; @@ -650,7 +651,7 @@ st_draw_vbo(struct gl_context *ctx, /* must get these after state validation! */ vp = st->vp; - vpv = st->vp_varient; + vpv = st->vp_variant; #if 0 if (MESA_VERBOSE & VERBOSE_GLSL) { diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h index 2e4c468..5d3c278 100644 --- a/src/mesa/state_tracker/st_draw.h +++ b/src/mesa/state_tracker/st_draw.h @@ -36,10 +36,11 @@ #include "main/compiler.h" #include "main/glheader.h" -#include "main/mtypes.h" struct _mesa_index_buffer; struct _mesa_prim; +struct gl_client_array; +struct gl_context; struct st_context; void st_init_draw( struct st_context *st ); diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 7f392fc..4e76a05 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -28,6 +28,7 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "vbo/vbo.h" @@ -109,9 +110,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, struct pipe_index_buffer ibuffer; struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS]; struct pipe_transfer *ib_transfer = NULL; - struct pipe_transfer *cb_transfer; GLuint attr, i; - ubyte *mapped_constants; const void *mapped_indices = NULL; assert(draw); @@ -123,10 +122,10 @@ st_feedback_draw_vbo(struct gl_context *ctx, /* must get these after state validation! */ vp = st->vp; - vs = &st->vp_varient->tgsi; + vs = &st->vp_variant->tgsi; - if (!st->vp_varient->draw_shader) { - st->vp_varient->draw_shader = draw_create_vertex_shader(draw, vs); + if (!st->vp_variant->draw_shader) { + st->vp_variant->draw_shader = draw_create_vertex_shader(draw, vs); } /* @@ -139,7 +138,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, draw_set_viewport_state(draw, &st->state.viewport); draw_set_clip_state(draw, &st->state.clip); draw_set_rasterizer_state(draw, &st->state.rasterizer, NULL); - draw_bind_vertex_shader(draw, st->vp_varient->draw_shader); + draw_bind_vertex_shader(draw, st->vp_variant->draw_shader); set_feedback_vertex_format(ctx); /* loop over TGSI shader inputs to determine vertex buffer @@ -242,14 +241,10 @@ st_feedback_draw_vbo(struct gl_context *ctx, draw_set_mapped_index_buffer(draw, mapped_indices); } - /* map constant buffers */ - mapped_constants = pipe_buffer_map(pipe, - st->state.constants[PIPE_SHADER_VERTEX], - PIPE_TRANSFER_READ, - &cb_transfer); + /* set the constant buffer */ draw_set_mapped_constant_buffer(st->draw, PIPE_SHADER_VERTEX, 0, - mapped_constants, - st->state.constants[PIPE_SHADER_VERTEX]->width0); + st->state.constants[PIPE_SHADER_VERTEX].ptr, + st->state.constants[PIPE_SHADER_VERTEX].size); /* draw here */ @@ -258,17 +253,12 @@ st_feedback_draw_vbo(struct gl_context *ctx, } - /* unmap constant buffers */ - pipe_buffer_unmap(pipe, st->state.constants[PIPE_SHADER_VERTEX], - cb_transfer); - /* * unmap vertex/index buffers */ for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { if (draw->pt.vertex_buffer[i].buffer) { - pipe_buffer_unmap(pipe, draw->pt.vertex_buffer[i].buffer, - vb_transfer[i]); + pipe_buffer_unmap(pipe, vb_transfer[i]); pipe_resource_reference(&draw->pt.vertex_buffer[i].buffer, NULL); draw_set_mapped_vertex_buffer(draw, i, NULL); } @@ -279,7 +269,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, draw_set_index_buffer(draw, NULL); if (ib_transfer) - pipe_buffer_unmap(pipe, ibuffer.buffer, ib_transfer); + pipe_buffer_unmap(pipe, ib_transfer); pipe_resource_reference(&ibuffer.buffer, NULL); } } diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 37a0aa2..df4f5cf 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -29,6 +29,7 @@ #include "main/imports.h" #include "main/context.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" @@ -224,6 +225,7 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; ctx->Extensions.ARB_fragment_program = GL_TRUE; + ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multisample = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */ @@ -343,6 +345,7 @@ void st_init_extensions(struct st_context *st) if (screen->get_param(screen, PIPE_CAP_OCCLUSION_QUERY)) { ctx->Extensions.ARB_occlusion_query = GL_TRUE; + ctx->Extensions.ARB_occlusion_query2 = GL_TRUE; } if (screen->get_param(screen, PIPE_CAP_TIMER_QUERY)) { ctx->Extensions.EXT_timer_query = GL_TRUE; @@ -442,7 +445,9 @@ void st_init_extensions(struct st_context *st) #endif if (screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY, PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) { +#if 0 /* XXX re-enable when GLSL compiler again supports geometry shaders */ ctx->Extensions.ARB_geometry_shader4 = GL_TRUE; +#endif } if (screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART)) { diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 955d821..2e0a664 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -37,6 +37,7 @@ #include "main/texstore.h" #include "main/image.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" @@ -146,14 +147,28 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) return PIPE_FORMAT_B4G4R4A4_UNORM; case MESA_FORMAT_RGB565: return PIPE_FORMAT_B5G6R5_UNORM; + case MESA_FORMAT_RGB332: + return PIPE_FORMAT_B2G3R3_UNORM; + case MESA_FORMAT_ARGB2101010: + return PIPE_FORMAT_B10G10R10A2_UNORM; + case MESA_FORMAT_AL44: + return PIPE_FORMAT_L4A4_UNORM; case MESA_FORMAT_AL88: return PIPE_FORMAT_L8A8_UNORM; + case MESA_FORMAT_AL1616: + return PIPE_FORMAT_L16A16_UNORM; case MESA_FORMAT_A8: return PIPE_FORMAT_A8_UNORM; + case MESA_FORMAT_A16: + return PIPE_FORMAT_A16_UNORM; case MESA_FORMAT_L8: return PIPE_FORMAT_L8_UNORM; + case MESA_FORMAT_L16: + return PIPE_FORMAT_L16_UNORM; case MESA_FORMAT_I8: return PIPE_FORMAT_I8_UNORM; + case MESA_FORMAT_I16: + return PIPE_FORMAT_I16_UNORM; case MESA_FORMAT_Z16: return PIPE_FORMAT_Z16_UNORM; case MESA_FORMAT_Z32: @@ -261,14 +276,28 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_ARGB4444; case PIPE_FORMAT_B5G6R5_UNORM: return MESA_FORMAT_RGB565; + case PIPE_FORMAT_B2G3R3_UNORM: + return MESA_FORMAT_RGB332; + case PIPE_FORMAT_B10G10R10A2_UNORM: + return MESA_FORMAT_ARGB2101010; + case PIPE_FORMAT_L4A4_UNORM: + return MESA_FORMAT_AL44; case PIPE_FORMAT_L8A8_UNORM: return MESA_FORMAT_AL88; + case PIPE_FORMAT_L16A16_UNORM: + return MESA_FORMAT_AL1616; case PIPE_FORMAT_A8_UNORM: return MESA_FORMAT_A8; + case PIPE_FORMAT_A16_UNORM: + return MESA_FORMAT_A16; case PIPE_FORMAT_L8_UNORM: return MESA_FORMAT_L8; + case PIPE_FORMAT_L16_UNORM: + return MESA_FORMAT_L16; case PIPE_FORMAT_I8_UNORM: return MESA_FORMAT_I8; + case PIPE_FORMAT_I16_UNORM: + return MESA_FORMAT_I16; case PIPE_FORMAT_S8_USCALED: return MESA_FORMAT_S8; @@ -469,17 +498,27 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, unsigned geom_flags = 0; /* we don't care about POT vs. NPOT here, yet */ switch (internalFormat) { + case GL_RGB10: + case GL_RGB10_A2: + if (screen->is_format_supported( screen, PIPE_FORMAT_B10G10R10A2_UNORM, + target, sample_count, bindings, + geom_flags )) + return PIPE_FORMAT_B10G10R10A2_UNORM; + /* Pass through. */ case 4: case GL_RGBA: case GL_RGBA8: - case GL_RGB10_A2: return default_rgba_format( screen, target, sample_count, bindings, geom_flags ); case 3: case GL_RGB: + case GL_RGB8: return default_rgb_format( screen, target, sample_count, bindings, geom_flags ); + + case GL_RGB12: + case GL_RGB16: case GL_RGBA12: case GL_RGBA16: if (screen->is_format_supported( screen, PIPE_FORMAT_R16G16B16A16_UNORM, @@ -506,16 +545,14 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_rgba_format( screen, target, sample_count, bindings, geom_flags ); - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return default_rgb_format( screen, target, sample_count, bindings, - geom_flags ); - + case GL_R3_G3_B2: + if (screen->is_format_supported( screen, PIPE_FORMAT_B2G3R3_UNORM, + target, sample_count, bindings, + geom_flags )) + return PIPE_FORMAT_B2G3R3_UNORM; + /* Pass through. */ case GL_RGB5: case GL_RGB4: - case GL_R3_G3_B2: if (screen->is_format_supported( screen, PIPE_FORMAT_B5G6R5_UNORM, target, sample_count, bindings, geom_flags )) @@ -527,11 +564,15 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_rgba_format( screen, target, sample_count, bindings, geom_flags ); + case GL_ALPHA12: + case GL_ALPHA16: + if (screen->is_format_supported( screen, PIPE_FORMAT_A16_UNORM, target, + sample_count, bindings, geom_flags )) + return PIPE_FORMAT_A16_UNORM; + /* Pass through. */ case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: case GL_COMPRESSED_ALPHA: if (screen->is_format_supported( screen, PIPE_FORMAT_A8_UNORM, target, sample_count, bindings, geom_flags )) @@ -539,12 +580,16 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_rgba_format( screen, target, sample_count, bindings, geom_flags ); + case GL_LUMINANCE12: + case GL_LUMINANCE16: + if (screen->is_format_supported( screen, PIPE_FORMAT_L16_UNORM, target, + sample_count, bindings, geom_flags )) + return PIPE_FORMAT_L16_UNORM; + /* Pass through. */ case 1: case GL_LUMINANCE: case GL_LUMINANCE4: case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: if (screen->is_format_supported( screen, PIPE_FORMAT_L8_UNORM, target, sample_count, bindings, geom_flags )) @@ -552,14 +597,17 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_rgba_format( screen, target, sample_count, bindings, geom_flags ); + case GL_LUMINANCE12_ALPHA4: + case GL_LUMINANCE12_ALPHA12: + case GL_LUMINANCE16_ALPHA16: + if (screen->is_format_supported( screen, PIPE_FORMAT_L16A16_UNORM, target, + sample_count, bindings, geom_flags )) + return PIPE_FORMAT_L16A16_UNORM; + /* Pass through. */ 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: case GL_COMPRESSED_LUMINANCE_ALPHA: if (screen->is_format_supported( screen, PIPE_FORMAT_L8A8_UNORM, target, sample_count, bindings, geom_flags )) @@ -567,11 +615,25 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_rgba_format( screen, target, sample_count, bindings, geom_flags ); + case GL_LUMINANCE4_ALPHA4: + if (screen->is_format_supported( screen, PIPE_FORMAT_L4A4_UNORM, target, + sample_count, bindings, geom_flags )) + return PIPE_FORMAT_L4A4_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_L8A8_UNORM, target, + sample_count, bindings, geom_flags )) + return PIPE_FORMAT_L8A8_UNORM; + return default_rgba_format( screen, target, sample_count, bindings, + geom_flags ); + + case GL_INTENSITY12: + case GL_INTENSITY16: + if (screen->is_format_supported( screen, PIPE_FORMAT_I16_UNORM, target, + sample_count, bindings, geom_flags )) + return PIPE_FORMAT_I16_UNORM; + /* Pass through. */ case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: if (screen->is_format_supported( screen, PIPE_FORMAT_I8_UNORM, target, sample_count, bindings, geom_flags )) @@ -680,10 +742,10 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_DEPTH_COMPONENT: { static const enum pipe_format formats[] = { - PIPE_FORMAT_Z16_UNORM, PIPE_FORMAT_Z32_UNORM, PIPE_FORMAT_Z24_UNORM_S8_USCALED, - PIPE_FORMAT_S8_USCALED_Z24_UNORM + PIPE_FORMAT_S8_USCALED_Z24_UNORM, + PIPE_FORMAT_Z16_UNORM }; return find_supported_format(screen, formats, Elements(formats), target, sample_count, bindings, geom_flags); @@ -717,18 +779,30 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_SRGB_EXT: case GL_SRGB8_EXT: - case GL_COMPRESSED_SRGB_EXT: - case GL_COMPRESSED_SRGB_ALPHA_EXT: case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: return default_srgba_format( screen, target, sample_count, bindings, geom_flags ); + + case GL_COMPRESSED_SRGB_EXT: case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - return PIPE_FORMAT_DXT1_SRGB; + if (screen->is_format_supported(screen, PIPE_FORMAT_DXT1_SRGB, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_DXT1_SRGB; + return default_srgba_format( screen, target, sample_count, bindings, + geom_flags ); + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return PIPE_FORMAT_DXT1_SRGBA; + + case GL_COMPRESSED_SRGB_ALPHA_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - return PIPE_FORMAT_DXT3_SRGBA; + if (screen->is_format_supported(screen, PIPE_FORMAT_DXT3_SRGBA, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_DXT3_SRGBA; + return default_srgba_format( screen, target, sample_count, bindings, + geom_flags ); + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return PIPE_FORMAT_DXT5_SRGBA; @@ -955,8 +1029,13 @@ gl_format st_ChooseTextureFormat(struct gl_context *ctx, GLint internalFormat, GLenum format, GLenum type) { + boolean want_renderable = + internalFormat == 3 || internalFormat == 4 || + internalFormat == GL_RGB || internalFormat == GL_RGBA || + internalFormat == GL_RGB8 || internalFormat == GL_RGBA8; + return st_ChooseTextureFormat_renderable(ctx, internalFormat, - format, type, GL_TRUE); + format, type, want_renderable); } /** diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 43fa59b..fe195c1 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -31,11 +31,12 @@ #define ST_FORMAT_H #include "main/formats.h" -#include "main/mtypes.h" +#include "main/glheader.h" #include "pipe/p_defines.h" #include "pipe/p_format.h" +struct gl_context; struct pipe_screen; extern GLenum diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 1fc4f40..c5f6008 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -79,11 +79,15 @@ st_render_mipmap(struct st_context *st, const uint face = _mesa_tex_target_to_face(target); assert(psv->texture == stObj->pt); - assert(target != GL_TEXTURE_3D); /* not done yet */ +#if 0 + assert(target != GL_TEXTURE_3D); /* implemented but untested */ +#endif /* check if we can render in the texture's format */ - if (!screen->is_format_supported(screen, psv->format, psv->texture->target, 0, - PIPE_BIND_RENDER_TARGET, 0)) { + /* XXX should probably kill this and always use util_gen_mipmap + since this implements a sw fallback as well */ + if (!screen->is_format_supported(screen, psv->format, psv->texture->target, + 0, PIPE_BIND_RENDER_TARGET, 0)) { return FALSE; } @@ -161,12 +165,12 @@ fallback_generate_mipmap(struct gl_context *ctx, GLenum target, struct pipe_resource *pt = st_get_texobj_resource(texObj); const uint baseLevel = texObj->BaseLevel; const uint lastLevel = pt->last_level; - const uint face = _mesa_tex_target_to_face(target), zslice = 0; + const uint face = _mesa_tex_target_to_face(target); uint dstLevel; GLenum datatype; GLuint comps; GLboolean compressed; - + if (ST_DEBUG & DEBUG_FALLBACK) debug_printf("%s: fallback processing\n", __FUNCTION__); @@ -198,16 +202,15 @@ fallback_generate_mipmap(struct gl_context *ctx, GLenum target, ubyte *dstData; int srcStride, dstStride; - srcTrans = pipe_get_transfer(st_context(ctx)->pipe, pt, face, - srcLevel, zslice, - PIPE_TRANSFER_READ, 0, 0, - srcWidth, srcHeight); - + srcTrans = pipe_get_transfer(st_context(ctx)->pipe, pt, srcLevel, + face, + PIPE_TRANSFER_READ, 0, 0, + srcWidth, srcHeight); - dstTrans = pipe_get_transfer(st_context(ctx)->pipe, pt, face, - dstLevel, zslice, - PIPE_TRANSFER_WRITE, 0, 0, - dstWidth, dstHeight); + dstTrans = pipe_get_transfer(st_context(ctx)->pipe, pt, dstLevel, + face, + PIPE_TRANSFER_WRITE, 0, 0, + dstWidth, dstHeight); srcData = (ubyte *) pipe_transfer_map(pipe, srcTrans); dstData = (ubyte *) pipe_transfer_map(pipe, dstTrans); @@ -215,6 +218,8 @@ fallback_generate_mipmap(struct gl_context *ctx, GLenum target, srcStride = srcTrans->stride / util_format_get_blocksize(srcTrans->resource->format); dstStride = dstTrans->stride / util_format_get_blocksize(dstTrans->resource->format); + /* this cannot work correctly for 3d since it does + not respect layerStride. */ if (compressed) { const enum pipe_format format = pt->format; const uint bw = util_format_get_blockwidth(format); @@ -365,6 +370,12 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, pt = stObj->pt; } + else { + /* Make sure that the base texture image data is present in the + * texture buffer. + */ + st_finalize_texture(ctx, st->pipe, texObj); + } assert(pt->last_level >= lastLevel); @@ -372,6 +383,8 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, * use the software fallback. */ if (!st_render_mipmap(st, target, stObj, baseLevel, lastLevel)) { + /* since the util code actually also has a fallback, should + probably make it never fail and kill this */ fallback_generate_mipmap(ctx, target, texObj); } diff --git a/src/mesa/state_tracker/st_gen_mipmap.h b/src/mesa/state_tracker/st_gen_mipmap.h index 3ba091d..815c6a5 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.h +++ b/src/mesa/state_tracker/st_gen_mipmap.h @@ -30,8 +30,10 @@ #define ST_GEN_MIPMAP_H -#include "main/mtypes.h" +#include "main/glheader.h" +struct gl_context; +struct gl_texture_object; struct st_context; extern void diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 05733e8..179e5dc 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -34,9 +34,11 @@ #include "util/u_pointer.h" #include "util/u_inlines.h" #include "util/u_atomic.h" +#include "util/u_surface.h" #include "main/mtypes.h" #include "main/context.h" +#include "main/mfeatures.h" #include "main/texobj.h" #include "main/teximage.h" #include "main/texstate.h" @@ -142,7 +144,7 @@ buffer_index_to_attachment(gl_buffer_index index) static void st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_context *pipe = st->pipe; struct pipe_resource *textures[ST_ATTACHMENT_COUNT]; uint width, height; unsigned i; @@ -160,7 +162,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st) for (i = 0; i < stfb->num_statts; i++) { struct st_renderbuffer *strb; - struct pipe_surface *ps; + struct pipe_surface *ps, surf_tmpl; gl_buffer_index idx; if (!textures[i]) @@ -179,8 +181,10 @@ st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st) continue; } - ps = screen->get_tex_surface(screen, textures[i], 0, 0, 0, - PIPE_BIND_RENDER_TARGET); + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + u_surface_default_template(&surf_tmpl, textures[i], + PIPE_BIND_RENDER_TARGET); + ps = pipe->create_surface(pipe, textures[i], &surf_tmpl); if (ps) { pipe_surface_reference(&strb->surface, ps); pipe_resource_reference(&strb->texture, ps->texture); @@ -510,7 +514,8 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags, } static boolean -st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target, +st_context_teximage(struct st_context_iface *stctxi, + enum st_texture_type target, int level, enum pipe_format internal_format, struct pipe_resource *tex, boolean mipmap) { @@ -813,6 +818,7 @@ st_manager_flush_frontbuffer(struct st_context *st) /** * Return the surface of an EGLImage. + * FIXME: I think this should operate on resources, not surfaces */ struct pipe_surface * st_manager_get_egl_image_surface(struct st_context *st, @@ -821,7 +827,7 @@ st_manager_get_egl_image_surface(struct st_context *st, struct st_manager *smapi = (struct st_manager *) st->iface.st_context_private; struct st_egl_image stimg; - struct pipe_surface *ps; + struct pipe_surface *ps, surf_tmpl; if (!smapi || !smapi->get_egl_image) return NULL; @@ -830,8 +836,13 @@ st_manager_get_egl_image_surface(struct st_context *st, if (!smapi->get_egl_image(smapi, eglimg, &stimg)) return NULL; - ps = smapi->screen->get_tex_surface(smapi->screen, - stimg.texture, stimg.face, stimg.level, stimg.zslice, usage); + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + surf_tmpl.format = stimg.texture->format; + surf_tmpl.usage = usage; + surf_tmpl.u.tex.level = stimg.level; + surf_tmpl.u.tex.first_layer = stimg.layer; + surf_tmpl.u.tex.last_layer = stimg.layer; + ps = st->pipe->create_surface(st->pipe, stimg.texture, &surf_tmpl); pipe_resource_reference(&stimg.texture, NULL); return ps; @@ -856,7 +867,8 @@ st_manager_validate_framebuffers(struct st_context *st) * Add a color renderbuffer on demand. */ boolean -st_manager_add_color_renderbuffer(struct st_context *st, struct gl_framebuffer *fb, +st_manager_add_color_renderbuffer(struct st_context *st, + struct gl_framebuffer *fb, gl_buffer_index idx) { struct st_framebuffer *stfb = st_ws_framebuffer(fb); diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 96c8aeb..42f1c20 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -772,10 +772,13 @@ emit_adjusted_wpos( struct st_translate *t, /** * Emit the TGSI instructions for inverting the WPOS y coordinate. + * This code is unavoidable because it also depends on whether + * a FBO is bound (STATE_FB_WPOS_Y_TRANSFORM). */ static void -emit_inverted_wpos( struct st_translate *t, - const struct gl_program *program ) +emit_wpos_inversion( struct st_translate *t, + const struct gl_program *program, + boolean invert) { struct ureg_program *ureg = t->ureg; @@ -783,17 +786,17 @@ emit_inverted_wpos( struct st_translate *t, * Need to replace instances of INPUT[WPOS] with temp T * where T = INPUT[WPOS] by y is inverted. */ - static const gl_state_index winSizeState[STATE_LENGTH] - = { STATE_INTERNAL, STATE_FB_SIZE, 0, 0, 0 }; + static const gl_state_index wposTransformState[STATE_LENGTH] + = { STATE_INTERNAL, STATE_FB_WPOS_Y_TRANSFORM, 0, 0, 0 }; /* XXX: note we are modifying the incoming shader here! Need to * do this before emitting the constant decls below, or this * will be missed: */ - unsigned winHeightConst = _mesa_add_state_reference(program->Parameters, - winSizeState); + unsigned wposTransConst = _mesa_add_state_reference(program->Parameters, + wposTransformState); - struct ureg_src winsize = ureg_DECL_constant( ureg, winHeightConst ); + struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst ); struct ureg_dst wpos_temp; struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; @@ -806,12 +809,23 @@ emit_inverted_wpos( struct st_translate *t, ureg_MOV( ureg, wpos_temp, wpos_input ); } - /* SUB wpos_temp.y, winsize_const, wpos_input - */ - ureg_SUB( ureg, - ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ), - winsize, - wpos_input); + if (invert) { + /* MAD wpos_temp.y, wpos_input, wpostrans.xxxx, wpostrans.yyyy + */ + ureg_MAD( ureg, + ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ), + wpos_input, + ureg_scalar(wpostrans, 0), + ureg_scalar(wpostrans, 1)); + } else { + /* MAD wpos_temp.y, wpos_input, wpostrans.zzzz, wpostrans.wwww + */ + ureg_MAD( ureg, + ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ), + wpos_input, + ureg_scalar(wpostrans, 2), + ureg_scalar(wpostrans, 3)); + } /* Use wpos_temp as position input from here on: */ @@ -873,8 +887,7 @@ emit_wpos(struct st_context *st, /* we invert after adjustment so that we avoid the MOV to temporary, * and reuse the adjustment ADD instead */ - if (invert) - emit_inverted_wpos(t, program); + emit_wpos_inversion(t, program, invert); } diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index 9bfd496..0615e52 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -29,18 +29,20 @@ #ifndef ST_MESA_TO_TGSI_H #define ST_MESA_TO_TGSI_H -#include "main/mtypes.h" - -#include "pipe/p_compiler.h" - -struct ureg_program; - #if defined __cplusplus extern "C" { #endif -struct tgsi_token; +#include "main/glheader.h" + +#include "pipe/p_compiler.h" +#include "pipe/p_defines.h" + +struct gl_context; struct gl_program; +struct tgsi_token; +struct ureg_program; + enum pipe_error st_translate_mesa_program( diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 7679928..7b32b46 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -32,7 +32,10 @@ #include "main/imports.h" +#include "main/hash.h" +#include "main/mfeatures.h" #include "main/mtypes.h" +#include "program/prog_parameter.h" #include "program/prog_print.h" #include "program/programopt.h" @@ -44,6 +47,8 @@ #include "tgsi/tgsi_ureg.h" #include "st_debug.h" +#include "st_cb_bitmap.h" +#include "st_cb_drawpixels.h" #include "st_context.h" #include "st_program.h" #include "st_mesa_to_tgsi.h" @@ -52,34 +57,109 @@ /** + * Delete a vertex program variant. Note the caller must unlink + * the variant from the linked list. + */ +static void +delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv) +{ + if (vpv->driver_shader) + cso_delete_vertex_shader(st->cso_context, vpv->driver_shader); + +#if FEATURE_feedback || FEATURE_rastpos + if (vpv->draw_shader) + draw_delete_vertex_shader( st->draw, vpv->draw_shader ); +#endif + + if (vpv->tgsi.tokens) + st_free_tokens(vpv->tgsi.tokens); + + FREE( vpv ); +} + + + +/** * Clean out any old compilations: */ void -st_vp_release_varients( struct st_context *st, +st_release_vp_variants( struct st_context *st, struct st_vertex_program *stvp ) { - struct st_vp_varient *vpv; + struct st_vp_variant *vpv; - for (vpv = stvp->varients; vpv; ) { - struct st_vp_varient *next = vpv->next; + for (vpv = stvp->variants; vpv; ) { + struct st_vp_variant *next = vpv->next; + delete_vp_variant(st, vpv); + vpv = next; + } - if (vpv->driver_shader) - cso_delete_vertex_shader(st->cso_context, vpv->driver_shader); - -#if FEATURE_feedback || FEATURE_rastpos - if (vpv->draw_shader) - draw_delete_vertex_shader( st->draw, vpv->draw_shader ); -#endif + stvp->variants = NULL; +} + + + +/** + * Delete a fragment program variant. Note the caller must unlink + * the variant from the linked list. + */ +static void +delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv) +{ + if (fpv->driver_shader) + cso_delete_fragment_shader(st->cso_context, fpv->driver_shader); - if (vpv->tgsi.tokens) - st_free_tokens(vpv->tgsi.tokens); + FREE(fpv); +} + + +/** + * Free all variants of a fragment program. + */ +void +st_release_fp_variants(struct st_context *st, struct st_fragment_program *stfp) +{ + struct st_fp_variant *fpv; + + for (fpv = stfp->variants; fpv; ) { + struct st_fp_variant *next = fpv->next; + delete_fp_variant(st, fpv); + fpv = next; + } + + stfp->variants = NULL; +} + + +/** + * Delete a geometry program variant. Note the caller must unlink + * the variant from the linked list. + */ +static void +delete_gp_variant(struct st_context *st, struct st_gp_variant *gpv) +{ + if (gpv->driver_shader) + cso_delete_geometry_shader(st->cso_context, gpv->driver_shader); - FREE( vpv ); + FREE(gpv); +} - vpv = next; + +/** + * Free all variants of a geometry program. + */ +void +st_release_gp_variants(struct st_context *st, struct st_geometry_program *stgp) +{ + struct st_gp_variant *gpv; + + for (gpv = stgp->variants; gpv; ) { + struct st_gp_variant *next = gpv->next; + delete_gp_variant(st, gpv); + gpv = next; } - stvp->varients = NULL; + stgp->variants = NULL; } @@ -92,7 +172,7 @@ st_vp_release_varients( struct st_context *st, * \param tokensOut destination for TGSI tokens * \return pointer to cached pipe_shader object. */ -void +static void st_prepare_vertex_program(struct st_context *st, struct st_vertex_program *stvp) { @@ -196,17 +276,22 @@ st_prepare_vertex_program(struct st_context *st, } -struct st_vp_varient * +/** + * Translate a vertex program to create a new variant. + */ +static struct st_vp_variant * st_translate_vertex_program(struct st_context *st, struct st_vertex_program *stvp, - const struct st_vp_varient_key *key) + const struct st_vp_variant_key *key) { - struct st_vp_varient *vpv = CALLOC_STRUCT(st_vp_varient); + struct st_vp_variant *vpv = CALLOC_STRUCT(st_vp_variant); struct pipe_context *pipe = st->pipe; struct ureg_program *ureg; enum pipe_error error; unsigned num_outputs; + st_prepare_vertex_program( st, stvp ); + _mesa_remove_output_reads(&stvp->Base.Base, PROGRAM_OUTPUT); _mesa_remove_output_reads(&stvp->Base.Base, PROGRAM_VARYING); @@ -216,6 +301,8 @@ st_translate_vertex_program(struct st_context *st, return NULL; } + vpv->key = *key; + vpv->num_inputs = stvp->num_inputs; num_outputs = stvp->num_outputs; if (key->passthrough_edgeflags) { @@ -229,23 +316,22 @@ st_translate_vertex_program(struct st_context *st, debug_printf("\n"); } - error = - st_translate_mesa_program(st->ctx, - TGSI_PROCESSOR_VERTEX, - ureg, - &stvp->Base.Base, - /* inputs */ - vpv->num_inputs, - stvp->input_to_index, - NULL, /* input semantic name */ - NULL, /* input semantic index */ - NULL, - /* outputs */ - num_outputs, - stvp->result_to_output, - stvp->output_semantic_name, - stvp->output_semantic_index, - key->passthrough_edgeflags ); + error = st_translate_mesa_program(st->ctx, + TGSI_PROCESSOR_VERTEX, + ureg, + &stvp->Base.Base, + /* inputs */ + vpv->num_inputs, + stvp->input_to_index, + NULL, /* input semantic name */ + NULL, /* input semantic index */ + NULL, + /* outputs */ + num_outputs, + stvp->result_to_output, + stvp->output_semantic_name, + stvp->output_semantic_index, + key->passthrough_edgeflags ); if (error) goto fail; @@ -275,201 +361,317 @@ fail: } +/** + * Find/create a vertex program variant. + */ +struct st_vp_variant * +st_get_vp_variant(struct st_context *st, + struct st_vertex_program *stvp, + const struct st_vp_variant_key *key) +{ + struct st_vp_variant *vpv; + + /* Search for existing variant */ + for (vpv = stvp->variants; vpv; vpv = vpv->next) { + if (memcmp(&vpv->key, key, sizeof(*key)) == 0) { + break; + } + } + + if (!vpv) { + /* create now */ + vpv = st_translate_vertex_program(st, stvp, key); + if (vpv) { + /* insert into list */ + vpv->next = stvp->variants; + stvp->variants = vpv; + } + } + + return vpv; +} + /** - * Translate a Mesa fragment shader into a TGSI shader. - * \return pointer to cached pipe_shader object. + * Translate a Mesa fragment shader into a TGSI shader using extra info in + * the key. + * \return new fragment program variant */ -void +static struct st_fp_variant * st_translate_fragment_program(struct st_context *st, - struct st_fragment_program *stfp ) + struct st_fragment_program *stfp, + const struct st_fp_variant_key *key) { struct pipe_context *pipe = st->pipe; - GLuint outputMapping[FRAG_RESULT_MAX]; - GLuint inputMapping[FRAG_ATTRIB_MAX]; - GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */ - GLuint attr; - enum pipe_error error; - const GLbitfield inputsRead = stfp->Base.Base.InputsRead; - struct ureg_program *ureg; + struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant); - ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; - ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; - uint fs_num_inputs = 0; + if (!variant) + return NULL; - ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; - ubyte fs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; - uint fs_num_outputs = 0; + assert(!(key->bitmap && key->drawpixels)); - _mesa_remove_output_reads(&stfp->Base.Base, PROGRAM_OUTPUT); +#if FEATURE_drawpix + if (key->bitmap) { + /* glBitmap drawing */ + struct gl_fragment_program *fp; - /* - * Convert Mesa program inputs to TGSI input register semantics. - */ - for (attr = 0; attr < FRAG_ATTRIB_MAX; attr++) { - if (inputsRead & (1 << attr)) { - const GLuint slot = fs_num_inputs++; + st_make_bitmap_fragment_program(st, &stfp->Base, + &fp, &variant->bitmap_sampler); - inputMapping[attr] = slot; + variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); + stfp = st_fragment_program(fp); + } + else if (key->drawpixels) { + /* glDrawPixels drawing */ + struct gl_fragment_program *fp; - switch (attr) { - case FRAG_ATTRIB_WPOS: - input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; - input_semantic_index[slot] = 0; - interpMode[slot] = TGSI_INTERPOLATE_LINEAR; - break; - case FRAG_ATTRIB_COL0: - input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; - input_semantic_index[slot] = 0; - interpMode[slot] = TGSI_INTERPOLATE_LINEAR; - break; - case FRAG_ATTRIB_COL1: - input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; - input_semantic_index[slot] = 1; - interpMode[slot] = TGSI_INTERPOLATE_LINEAR; - break; - case FRAG_ATTRIB_FOGC: - input_semantic_name[slot] = TGSI_SEMANTIC_FOG; - input_semantic_index[slot] = 0; - interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; - break; - case FRAG_ATTRIB_FACE: - input_semantic_name[slot] = TGSI_SEMANTIC_FACE; - input_semantic_index[slot] = 0; - interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; - break; - /* In most cases, there is nothing special about these - * inputs, so adopt a convention to use the generic - * semantic name and the mesa FRAG_ATTRIB_ number as the - * index. - * - * All that is required is that the vertex shader labels - * its own outputs similarly, and that the vertex shader - * generates at least every output required by the - * fragment shader plus fixed-function hardware (such as - * BFC). - * - * There is no requirement that semantic indexes start at - * zero or be restricted to a particular range -- nobody - * should be building tables based on semantic index. - */ - case FRAG_ATTRIB_PNTC: - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - case FRAG_ATTRIB_VAR0: - default: - /* Actually, let's try and zero-base this just for - * readability of the generated TGSI. - */ - assert(attr >= FRAG_ATTRIB_TEX0); - input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); - input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - if (attr == FRAG_ATTRIB_PNTC) - interpMode[slot] = TGSI_INTERPOLATE_LINEAR; - else - interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; - break; - } + if (key->drawpixels_z || key->drawpixels_stencil) { + fp = st_make_drawpix_z_stencil_program(st, key->drawpixels_z, + key->drawpixels_stencil); } else { - inputMapping[attr] = -1; + /* RGBA */ + st_make_drawpix_fragment_program(st, &stfp->Base, &fp); + variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); } + stfp = st_fragment_program(fp); } +#endif - /* - * Semantics and mapping for outputs - */ - { - uint numColors = 0; - GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten; - - /* if z is written, emit that first */ - if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { - fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_POSITION; - fs_output_semantic_index[fs_num_outputs] = 0; - outputMapping[FRAG_RESULT_DEPTH] = fs_num_outputs; - fs_num_outputs++; - outputsWritten &= ~(1 << FRAG_RESULT_DEPTH); - } + if (!stfp->tgsi.tokens) { + /* need to translate Mesa instructions to TGSI now */ + GLuint outputMapping[FRAG_RESULT_MAX]; + GLuint inputMapping[FRAG_ATTRIB_MAX]; + GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */ + GLuint attr; + enum pipe_error error; + const GLbitfield inputsRead = stfp->Base.Base.InputsRead; + struct ureg_program *ureg; + GLboolean write_all = GL_FALSE; - if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) { - fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_STENCIL; - fs_output_semantic_index[fs_num_outputs] = 0; - outputMapping[FRAG_RESULT_STENCIL] = fs_num_outputs; - fs_num_outputs++; - outputsWritten &= ~(1 << FRAG_RESULT_STENCIL); - } + ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; + ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; + uint fs_num_inputs = 0; + + ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; + ubyte fs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; + uint fs_num_outputs = 0; + + + _mesa_remove_output_reads(&stfp->Base.Base, PROGRAM_OUTPUT); + + /* + * Convert Mesa program inputs to TGSI input register semantics. + */ + for (attr = 0; attr < FRAG_ATTRIB_MAX; attr++) { + if (inputsRead & (1 << attr)) { + const GLuint slot = fs_num_inputs++; + + inputMapping[attr] = slot; - /* handle remaning outputs (color) */ - for (attr = 0; attr < FRAG_RESULT_MAX; attr++) { - if (outputsWritten & BITFIELD64_BIT(attr)) { switch (attr) { - case FRAG_RESULT_DEPTH: - case FRAG_RESULT_STENCIL: - /* handled above */ - assert(0); + case FRAG_ATTRIB_WPOS: + input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; + input_semantic_index[slot] = 0; + interpMode[slot] = TGSI_INTERPOLATE_LINEAR; + break; + case FRAG_ATTRIB_COL0: + input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; + input_semantic_index[slot] = 0; + interpMode[slot] = TGSI_INTERPOLATE_LINEAR; + break; + case FRAG_ATTRIB_COL1: + input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; + input_semantic_index[slot] = 1; + interpMode[slot] = TGSI_INTERPOLATE_LINEAR; + break; + case FRAG_ATTRIB_FOGC: + input_semantic_name[slot] = TGSI_SEMANTIC_FOG; + input_semantic_index[slot] = 0; + interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; + case FRAG_ATTRIB_FACE: + input_semantic_name[slot] = TGSI_SEMANTIC_FACE; + input_semantic_index[slot] = 0; + interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; + break; + /* In most cases, there is nothing special about these + * inputs, so adopt a convention to use the generic + * semantic name and the mesa FRAG_ATTRIB_ number as the + * index. + * + * All that is required is that the vertex shader labels + * its own outputs similarly, and that the vertex shader + * generates at least every output required by the + * fragment shader plus fixed-function hardware (such as + * BFC). + * + * There is no requirement that semantic indexes start at + * zero or be restricted to a particular range -- nobody + * should be building tables based on semantic index. + */ + case FRAG_ATTRIB_PNTC: + case FRAG_ATTRIB_TEX0: + case FRAG_ATTRIB_TEX1: + case FRAG_ATTRIB_TEX2: + case FRAG_ATTRIB_TEX3: + case FRAG_ATTRIB_TEX4: + case FRAG_ATTRIB_TEX5: + case FRAG_ATTRIB_TEX6: + case FRAG_ATTRIB_TEX7: + case FRAG_ATTRIB_VAR0: default: - assert(attr == FRAG_RESULT_COLOR || - (FRAG_RESULT_DATA0 <= attr && attr < FRAG_RESULT_MAX)); - fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_COLOR; - fs_output_semantic_index[fs_num_outputs] = numColors; - outputMapping[attr] = fs_num_outputs; - numColors++; + /* Actually, let's try and zero-base this just for + * readability of the generated TGSI. + */ + assert(attr >= FRAG_ATTRIB_TEX0); + input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); + input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; + if (attr == FRAG_ATTRIB_PNTC) + interpMode[slot] = TGSI_INTERPOLATE_LINEAR; + else + interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; } + } + else { + inputMapping[attr] = -1; + } + } + + /* + * Semantics and mapping for outputs + */ + { + uint numColors = 0; + GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten; + + /* if z is written, emit that first */ + if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { + fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_POSITION; + fs_output_semantic_index[fs_num_outputs] = 0; + outputMapping[FRAG_RESULT_DEPTH] = fs_num_outputs; + fs_num_outputs++; + outputsWritten &= ~(1 << FRAG_RESULT_DEPTH); + } + if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) { + fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_STENCIL; + fs_output_semantic_index[fs_num_outputs] = 0; + outputMapping[FRAG_RESULT_STENCIL] = fs_num_outputs; fs_num_outputs++; + outputsWritten &= ~(1 << FRAG_RESULT_STENCIL); + } + + /* handle remaning outputs (color) */ + for (attr = 0; attr < FRAG_RESULT_MAX; attr++) { + if (outputsWritten & BITFIELD64_BIT(attr)) { + switch (attr) { + case FRAG_RESULT_DEPTH: + case FRAG_RESULT_STENCIL: + /* handled above */ + assert(0); + break; + case FRAG_RESULT_COLOR: + write_all = GL_TRUE; /* fallthrough */ + default: + assert(attr == FRAG_RESULT_COLOR || + (FRAG_RESULT_DATA0 <= attr && attr < FRAG_RESULT_MAX)); + fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_COLOR; + fs_output_semantic_index[fs_num_outputs] = numColors; + outputMapping[attr] = fs_num_outputs; + numColors++; + break; + } + + fs_num_outputs++; + } } } - } - ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT ); - if (ureg == NULL) - return; + ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT ); + if (ureg == NULL) + return NULL; - if (ST_DEBUG & DEBUG_MESA) { - _mesa_print_program(&stfp->Base.Base); - _mesa_print_program_parameters(st->ctx, &stfp->Base.Base); - debug_printf("\n"); + if (ST_DEBUG & DEBUG_MESA) { + _mesa_print_program(&stfp->Base.Base); + _mesa_print_program_parameters(st->ctx, &stfp->Base.Base); + debug_printf("\n"); + } + if (write_all == GL_TRUE) + ureg_property_fs_color0_writes_all_cbufs(ureg, 1); + + error = st_translate_mesa_program(st->ctx, + TGSI_PROCESSOR_FRAGMENT, + ureg, + &stfp->Base.Base, + /* inputs */ + fs_num_inputs, + inputMapping, + input_semantic_name, + input_semantic_index, + interpMode, + /* outputs */ + fs_num_outputs, + outputMapping, + fs_output_semantic_name, + fs_output_semantic_index, FALSE ); + + stfp->tgsi.tokens = ureg_get_tokens( ureg, NULL ); + ureg_destroy( ureg ); } - error = - st_translate_mesa_program(st->ctx, - TGSI_PROCESSOR_FRAGMENT, - ureg, - &stfp->Base.Base, - /* inputs */ - fs_num_inputs, - inputMapping, - input_semantic_name, - input_semantic_index, - interpMode, - /* outputs */ - fs_num_outputs, - outputMapping, - fs_output_semantic_name, - fs_output_semantic_index, FALSE ); - - stfp->tgsi.tokens = ureg_get_tokens( ureg, NULL ); - ureg_destroy( ureg ); - stfp->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi); + /* fill in variant */ + variant->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi); + variant->key = *key; if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); debug_printf("\n"); } + + return variant; } -void + +/** + * Translate fragment program if needed. + */ +struct st_fp_variant * +st_get_fp_variant(struct st_context *st, + struct st_fragment_program *stfp, + const struct st_fp_variant_key *key) +{ + struct st_fp_variant *fpv; + + /* Search for existing variant */ + for (fpv = stfp->variants; fpv; fpv = fpv->next) { + if (memcmp(&fpv->key, key, sizeof(*key)) == 0) { + break; + } + } + + if (!fpv) { + /* create new */ + fpv = st_translate_fragment_program(st, stfp, key); + if (fpv) { + /* insert into list */ + fpv->next = stfp->variants; + stfp->variants = fpv; + } + } + + return fpv; +} + + +/** + * Translate a geometry program to create a new variant. + */ +static struct st_gp_variant * st_translate_geometry_program(struct st_context *st, - struct st_geometry_program *stgp) + struct st_geometry_program *stgp, + const struct st_gp_variant_key *key) { GLuint inputMapping[GEOM_ATTRIB_MAX]; GLuint outputMapping[GEOM_RESULT_MAX]; @@ -492,12 +694,19 @@ st_translate_geometry_program(struct st_context *st, GLuint maxSlot = 0; struct ureg_program *ureg; + struct st_gp_variant *gpv; + + gpv = CALLOC_STRUCT(st_gp_variant); + if (!gpv) + return NULL; + _mesa_remove_output_reads(&stgp->Base.Base, PROGRAM_OUTPUT); _mesa_remove_output_reads(&stgp->Base.Base, PROGRAM_VARYING); ureg = ureg_create( TGSI_PROCESSOR_GEOMETRY ); if (ureg == NULL) { - return; + FREE(gpv); + return NULL; } /* which vertex output goes to the first geometry input */ @@ -527,7 +736,7 @@ st_translate_geometry_program(struct st_context *st, } else ++gs_builtin_inputs; -#if 1 +#if 0 debug_printf("input map at %d = %d\n", slot + gs_array_offset, stgp->input_map[slot + gs_array_offset]); #endif @@ -669,37 +878,35 @@ st_translate_geometry_program(struct st_context *st, st_free_tokens(stgp->tgsi.tokens); stgp->tgsi.tokens = NULL; } - if (stgp->driver_shader) { - cso_delete_geometry_shader(st->cso_context, stgp->driver_shader); - stgp->driver_shader = NULL; - } ureg_property_gs_input_prim(ureg, stgp->Base.InputType); ureg_property_gs_output_prim(ureg, stgp->Base.OutputType); ureg_property_gs_max_vertices(ureg, stgp->Base.VerticesOut); - error = st_translate_mesa_program(st->ctx, - TGSI_PROCESSOR_GEOMETRY, - ureg, - &stgp->Base.Base, - /* inputs */ - gs_num_inputs, - inputMapping, - stgp->input_semantic_name, - stgp->input_semantic_index, - NULL, - /* outputs */ - gs_num_outputs, - outputMapping, - gs_output_semantic_name, - gs_output_semantic_index, - FALSE); - + error = st_translate_mesa_program(st->ctx, + TGSI_PROCESSOR_GEOMETRY, + ureg, + &stgp->Base.Base, + /* inputs */ + gs_num_inputs, + inputMapping, + stgp->input_semantic_name, + stgp->input_semantic_index, + NULL, + /* outputs */ + gs_num_outputs, + outputMapping, + gs_output_semantic_name, + gs_output_semantic_index, + FALSE); stgp->num_inputs = gs_num_inputs; stgp->tgsi.tokens = ureg_get_tokens( ureg, NULL ); ureg_destroy( ureg ); - stgp->driver_shader = pipe->create_gs_state(pipe, &stgp->tgsi); + + /* fill in new variant */ + gpv->driver_shader = pipe->create_gs_state(pipe, &stgp->tgsi); + gpv->key = *key; if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stgp->Base.Base); @@ -710,8 +917,44 @@ st_translate_geometry_program(struct st_context *st, tgsi_dump(stgp->tgsi.tokens, 0); debug_printf("\n"); } + + return gpv; } + +/** + * Get/create geometry program variant. + */ +struct st_gp_variant * +st_get_gp_variant(struct st_context *st, + struct st_geometry_program *stgp, + const struct st_gp_variant_key *key) +{ + struct st_gp_variant *gpv; + + /* Search for existing variant */ + for (gpv = stgp->variants; gpv; gpv = gpv->next) { + if (memcmp(&gpv->key, key, sizeof(*key)) == 0) { + break; + } + } + + if (!gpv) { + /* create new */ + gpv = st_translate_geometry_program(st, stgp, key); + if (gpv) { + /* insert into list */ + gpv->next = stgp->variants; + stgp->variants = gpv; + } + } + + return gpv; +} + + + + /** * Debug- print current shader text */ @@ -757,3 +1000,155 @@ st_print_shaders(struct gl_context *ctx) } } } + + +/** + * Vert/Geom/Frag programs have per-context variants. Free all the + * variants attached to the given program which match the given context. + */ +static void +destroy_program_variants(struct st_context *st, struct gl_program *program) +{ + if (!program) + return; + + switch (program->Target) { + case GL_VERTEX_PROGRAM_ARB: + { + struct st_vertex_program *stvp = (struct st_vertex_program *) program; + struct st_vp_variant *vpv, **prevPtr = &stvp->variants; + + for (vpv = stvp->variants; vpv; ) { + struct st_vp_variant *next = vpv->next; + if (vpv->key.st == st) { + /* unlink from list */ + *prevPtr = next; + /* destroy this variant */ + delete_vp_variant(st, vpv); + } + else { + prevPtr = &vpv->next; + } + vpv = next; + } + } + break; + case GL_FRAGMENT_PROGRAM_ARB: + { + struct st_fragment_program *stfp = + (struct st_fragment_program *) program; + struct st_fp_variant *fpv, **prevPtr = &stfp->variants; + + for (fpv = stfp->variants; fpv; ) { + struct st_fp_variant *next = fpv->next; + if (fpv->key.st == st) { + /* unlink from list */ + *prevPtr = next; + /* destroy this variant */ + delete_fp_variant(st, fpv); + } + else { + prevPtr = &fpv->next; + } + fpv = next; + } + } + break; + case MESA_GEOMETRY_PROGRAM: + { + struct st_geometry_program *stgp = + (struct st_geometry_program *) program; + struct st_gp_variant *gpv, **prevPtr = &stgp->variants; + + for (gpv = stgp->variants; gpv; ) { + struct st_gp_variant *next = gpv->next; + if (gpv->key.st == st) { + /* unlink from list */ + *prevPtr = next; + /* destroy this variant */ + delete_gp_variant(st, gpv); + } + else { + prevPtr = &gpv->next; + } + gpv = next; + } + } + break; + default: + _mesa_problem(NULL, "Unexpected program target in " + "destroy_program_variants_cb()"); + } +} + + +/** + * Callback for _mesa_HashWalk. Free all the shader's program variants + * which match the given context. + */ +static void +destroy_shader_program_variants_cb(GLuint key, void *data, void *userData) +{ + struct st_context *st = (struct st_context *) userData; + struct gl_shader *shader = (struct gl_shader *) data; + + switch (shader->Type) { + case GL_SHADER_PROGRAM_MESA: + { + struct gl_shader_program *shProg = (struct gl_shader_program *) data; + GLuint i; + + for (i = 0; i < shProg->NumShaders; i++) { + destroy_program_variants(st, shProg->Shaders[i]->Program); + } + + destroy_program_variants(st, (struct gl_program *) + shProg->VertexProgram); + destroy_program_variants(st, (struct gl_program *) + shProg->FragmentProgram); + destroy_program_variants(st, (struct gl_program *) + shProg->GeometryProgram); + } + break; + case GL_VERTEX_SHADER: + case GL_FRAGMENT_SHADER: + case GL_GEOMETRY_SHADER: + { + destroy_program_variants(st, shader->Program); + } + break; + default: + assert(0); + } +} + + +/** + * Callback for _mesa_HashWalk. Free all the program variants which match + * the given context. + */ +static void +destroy_program_variants_cb(GLuint key, void *data, void *userData) +{ + struct st_context *st = (struct st_context *) userData; + struct gl_program *program = (struct gl_program *) data; + destroy_program_variants(st, program); +} + + +/** + * Walk over all shaders and programs to delete any variants which + * belong to the given context. + * This is called during context tear-down. + */ +void +st_destroy_program_variants(struct st_context *st) +{ + /* ARB vert/frag program */ + _mesa_HashWalk(st->ctx->Shared->Programs, + destroy_program_variants_cb, st); + + /* GLSL vert/frag/geom shaders */ + _mesa_HashWalk(st->ctx->Shared->ShaderObjects, + destroy_shader_program_variants_cb, st); +} diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 72dbc71..c4244df 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -40,26 +40,61 @@ #include "st_context.h" +/** Fragment program variant key */ +struct st_fp_variant_key +{ + struct st_context *st; /**< variants are per-context */ + + /** for glBitmap */ + GLuint bitmap:1; /**< glBitmap variant? */ + + /** for glDrawPixels */ + GLuint drawpixels:1; /**< glDrawPixels variant */ + GLuint scaleAndBias:1; /**< glDrawPixels w/ scale and/or bias? */ + GLuint pixelMaps:1; /**< glDrawPixels w/ pixel lookup map? */ + GLuint drawpixels_z:1; /**< glDrawPixels(GL_DEPTH) */ + GLuint drawpixels_stencil:1; /**< glDrawPixels(GL_STENCIL) */ +}; + + +/** + * Variant of a fragment program. + */ +struct st_fp_variant +{ + /** Parameters which generated this version of fragment program */ + struct st_fp_variant_key key; + + /** Driver's compiled shader */ + void *driver_shader; + + /** For glBitmap variants */ + struct gl_program_parameter_list *parameters; + uint bitmap_sampler; + + /** next in linked list */ + struct st_fp_variant *next; +}; + + /** * Derived from Mesa gl_fragment_program: */ struct st_fragment_program { struct gl_fragment_program Base; - GLuint serialNo; struct pipe_shader_state tgsi; - void *driver_shader; - /** Program prefixed with glBitmap prologue */ - struct st_fragment_program *bitmap_program; - uint bitmap_sampler; + struct st_fp_variant *variants; }; -struct st_vp_varient_key +/** Vertex program variant key */ +struct st_vp_variant_key { + struct st_context *st; /**< variants are per-context */ boolean passthrough_edgeflags; }; @@ -68,12 +103,12 @@ struct st_vp_varient_key * This represents a vertex program, especially translated to match * the inputs of a particular fragment shader. */ -struct st_vp_varient +struct st_vp_variant { /* Parameters which generated this translated version of a vertex * shader: */ - struct st_vp_varient_key key; + struct st_vp_variant_key key; /** * TGSI tokens (to later generate a 'draw' module shader for @@ -88,9 +123,9 @@ struct st_vp_varient struct draw_vertex_shader *draw_shader; /** Next in linked list */ - struct st_vp_varient *next; + struct st_vp_variant *next; - /** similar to that in st_vertex_program, but with information about edgeflags too */ + /** similar to that in st_vertex_program, but with edgeflags info too */ GLuint num_inputs; }; @@ -101,7 +136,6 @@ struct st_vp_varient struct st_vertex_program { struct gl_vertex_program Base; /**< The Mesa vertex program */ - GLuint serialNo, lastSerialNo; /** maps a Mesa VERT_ATTRIB_x to a packed TGSI input index */ GLuint input_to_index[VERT_ATTRIB_MAX]; @@ -115,18 +149,41 @@ struct st_vertex_program ubyte output_semantic_index[VERT_RESULT_MAX]; GLuint num_outputs; - /** List of translated varients of this vertex program. + /** List of translated variants of this vertex program. */ - struct st_vp_varient *varients; + struct st_vp_variant *variants; +}; + + + +/** Geometry program variant key */ +struct st_gp_variant_key +{ + struct st_context *st; /**< variants are per-context */ + /* no other fields yet */ +}; + + +/** + * Geometry program variant. + */ +struct st_gp_variant +{ + /* Parameters which generated this translated version of a vertex */ + struct st_gp_variant_key key; + + void *driver_shader; + + struct st_gp_variant *next; }; + /** * Derived from Mesa gl_geometry_program: */ struct st_geometry_program { struct gl_geometry_program Base; /**< The Mesa geometry program */ - GLuint serialNo; /** map GP input back to VP output */ GLuint input_map[PIPE_MAX_SHADER_INPUTS]; @@ -145,9 +202,12 @@ struct st_geometry_program ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; struct pipe_shader_state tgsi; - void *driver_shader; + + struct st_gp_variant *variants; }; + + static INLINE struct st_fragment_program * st_fragment_program( struct gl_fragment_program *fp ) { @@ -162,9 +222,9 @@ st_vertex_program( struct gl_vertex_program *vp ) } static INLINE struct st_geometry_program * -st_geometry_program( struct gl_geometry_program *vp ) +st_geometry_program( struct gl_geometry_program *gp ) { - return (struct st_geometry_program *)vp; + return (struct st_geometry_program *)gp; } static INLINE void @@ -198,32 +258,43 @@ st_reference_fragprog(struct st_context *st, } -extern void -st_translate_fragment_program(struct st_context *st, - struct st_fragment_program *fp); +extern struct st_vp_variant * +st_get_vp_variant(struct st_context *st, + struct st_vertex_program *stvp, + const struct st_vp_variant_key *key); + + +extern struct st_fp_variant * +st_get_fp_variant(struct st_context *st, + struct st_fragment_program *stfp, + const struct st_fp_variant_key *key); + + +extern struct st_gp_variant * +st_get_gp_variant(struct st_context *st, + struct st_geometry_program *stgp, + const struct st_gp_variant_key *key); + + extern void -st_translate_geometry_program(struct st_context *st, - struct st_geometry_program *stgp); +st_release_vp_variants( struct st_context *st, + struct st_vertex_program *stvp ); -/* Called after program string change, discard all previous - * compilation results. - */ extern void -st_prepare_vertex_program(struct st_context *st, - struct st_vertex_program *stvp); +st_release_fp_variants( struct st_context *st, + struct st_fragment_program *stfp ); -extern struct st_vp_varient * -st_translate_vertex_program(struct st_context *st, - struct st_vertex_program *stvp, - const struct st_vp_varient_key *key); +extern void +st_release_gp_variants(struct st_context *st, + struct st_geometry_program *stgp); -void -st_vp_release_varients( struct st_context *st, - struct st_vertex_program *stvp ); extern void st_print_shaders(struct gl_context *ctx); +extern void +st_destroy_program_variants(struct st_context *st); + #endif diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index c6cf2ba..155ea39 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -84,6 +84,7 @@ st_texture_create(struct st_context *st, pt.width0 = width0; pt.height0 = height0; pt.depth0 = depth0; + pt.array_size = (target == PIPE_TEXTURE_CUBE ? 6 : 1); pt.usage = PIPE_USAGE_DEFAULT; pt.bind = bind; pt.flags = 0; @@ -136,7 +137,7 @@ st_texture_match_image(const struct pipe_resource *pt, */ GLubyte * st_texture_image_map(struct st_context *st, struct st_texture_image *stImage, - GLuint zoffset, enum pipe_transfer_usage usage, + GLuint zoffset, enum pipe_transfer_usage usage, GLuint x, GLuint y, GLuint w, GLuint h) { struct pipe_context *pipe = st->pipe; @@ -144,9 +145,9 @@ 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->face, - stImage->level, zoffset, - usage, x, y, w, h); + stImage->transfer = pipe_get_transfer(st->pipe, pt, stImage->level, + stImage->face + zoffset, + usage, x, y, w, h); if (stImage->transfer) return pipe_transfer_map(pipe, stImage->transfer); @@ -219,10 +220,10 @@ st_texture_image_data(struct st_context *st, DBG("%s\n", __FUNCTION__); for (i = 0; i < depth; i++) { - dst_transfer = pipe_get_transfer(st->pipe, dst, face, level, i, - PIPE_TRANSFER_WRITE, 0, 0, - u_minify(dst->width0, level), - u_minify(dst->height0, level)); + dst_transfer = pipe_get_transfer(st->pipe, dst, level, face + i, + PIPE_TRANSFER_WRITE, 0, 0, + u_minify(dst->width0, level), + u_minify(dst->height0, level)); st_surface_data(pipe, dst_transfer, 0, 0, /* dstx, dsty */ @@ -230,7 +231,7 @@ st_texture_image_data(struct st_context *st, src_row_stride, 0, 0, /* source x, y */ u_minify(dst->width0, level), - u_minify(dst->height0, level)); /* width, height */ + u_minify(dst->height0, level)); /* width, height */ pipe->transfer_destroy(pipe, dst_transfer); @@ -245,14 +246,10 @@ st_texture_image_data(struct st_context *st, static void print_center_pixel(struct pipe_context *pipe, struct pipe_resource *src) { - struct pipe_subresource rect; struct pipe_transfer *xfer; struct pipe_box region; ubyte *map; - rect.face = 0; - rect.level = 0; - region.x = src->width0 / 2; region.y = src->height0 / 2; region.z = 0; @@ -260,7 +257,7 @@ print_center_pixel(struct pipe_context *pipe, struct pipe_resource *src) region.height = 1; region.depth = 1; - xfer = pipe->get_transfer(pipe, src, rect, PIPE_TRANSFER_READ, ®ion); + xfer = pipe->get_transfer(pipe, src, 0, PIPE_TRANSFER_READ, ®ion); map = pipe->transfer_map(pipe, xfer); printf("center pixel: %d %d %d %d\n", map[0], map[1], map[2], map[3]); @@ -282,22 +279,26 @@ st_texture_image_copy(struct pipe_context *pipe, struct pipe_resource *src, GLuint srcLevel, GLuint face) { - GLuint width = u_minify(dst->width0, dstLevel); - GLuint height = u_minify(dst->height0, dstLevel); - GLuint depth = u_minify(dst->depth0, dstLevel); - struct pipe_subresource dstsub, srcsub; + GLuint width = u_minify(dst->width0, dstLevel); + GLuint height = u_minify(dst->height0, dstLevel); + GLuint depth = u_minify(dst->depth0, dstLevel); + struct pipe_box src_box; GLuint i; assert(u_minify(src->width0, srcLevel) == width); assert(u_minify(src->height0, srcLevel) == height); assert(u_minify(src->depth0, srcLevel) == depth); - dstsub.face = face; - dstsub.level = dstLevel; - srcsub.face = face; - srcsub.level = srcLevel; + src_box.x = 0; + src_box.y = 0; + src_box.width = width; + src_box.height = height; + src_box.depth = 1; /* Loop over 3D image slices */ - for (i = 0; i < depth; i++) { + /* could (and probably should) use "true" 3d box here - + but drivers can't quite handle it yet */ + for (i = face; i < face + depth; i++) { + src_box.z = i; if (0) { print_center_pixel(pipe, src); @@ -305,12 +306,11 @@ st_texture_image_copy(struct pipe_context *pipe, pipe->resource_copy_region(pipe, dst, - dstsub, + dstLevel, 0, 0, i,/* destX, Y, Z */ src, - srcsub, - 0, 0, i,/* srcX, Y, Z */ - width, height); + srcLevel, + &src_box); } } diff --git a/src/mesa/swrast/s_aaline.h b/src/mesa/swrast/s_aaline.h index f7d92c5..74d5518 100644 --- a/src/mesa/swrast/s_aaline.h +++ b/src/mesa/swrast/s_aaline.h @@ -28,7 +28,7 @@ #define S_AALINE_H -#include "main/mtypes.h" +struct gl_context; extern void diff --git a/src/mesa/swrast/s_aatriangle.h b/src/mesa/swrast/s_aatriangle.h index 746e456..e40efb1 100644 --- a/src/mesa/swrast/s_aatriangle.h +++ b/src/mesa/swrast/s_aatriangle.h @@ -28,7 +28,7 @@ #define S_AATRIANGLE_H -#include "main/mtypes.h" +struct gl_context; extern void diff --git a/src/mesa/swrast/s_accum.h b/src/mesa/swrast/s_accum.h index 071644b..1ad7d32 100644 --- a/src/mesa/swrast/s_accum.h +++ b/src/mesa/swrast/s_accum.h @@ -27,7 +27,8 @@ #define S_ACCUM_H -#include "main/mtypes.h" +struct gl_context; +struct gl_renderbuffer; extern void diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h index 7cd6d80..fca209a 100644 --- a/src/mesa/swrast/s_alpha.h +++ b/src/mesa/swrast/s_alpha.h @@ -1,4 +1,3 @@ - /* * Mesa 3-D graphics library * Version: 4.1 @@ -28,9 +27,10 @@ #define S_ALPHA_H -#include "main/mtypes.h" +#include "main/glheader.h" #include "s_span.h" +struct gl_context; extern GLint _swrast_alpha_test( const struct gl_context *ctx, SWspan *span ); diff --git a/src/mesa/swrast/s_atifragshader.h b/src/mesa/swrast/s_atifragshader.h index 39a6e64..10aaaa5 100644 --- a/src/mesa/swrast/s_atifragshader.h +++ b/src/mesa/swrast/s_atifragshader.h @@ -27,9 +27,9 @@ #define S_ATIFRAGSHADER_H -#include "main/mtypes.h" #include "s_span.h" +struct gl_context; extern void _swrast_exec_fragment_shader( struct gl_context *ctx, SWspan *span ); diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 1a550c4..d61baba 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -819,7 +819,16 @@ static void blend_general(struct gl_context *ctx, GLuint n, const GLubyte mask[], void *src, const void *dst, GLenum chanType) { - GLfloat rgbaF[MAX_WIDTH][4], destF[MAX_WIDTH][4]; + GLfloat (*rgbaF)[4], (*destF)[4]; + + rgbaF = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat)); + destF = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat)); + if (!rgbaF || !destF) { + free(rgbaF); + free(destF); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "blending"); + return; + } if (chanType == GL_UNSIGNED_BYTE) { GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; @@ -883,6 +892,9 @@ blend_general(struct gl_context *ctx, GLuint n, const GLubyte mask[], blend_general_float(ctx, n, mask, (GLfloat (*)[4]) src, (GLfloat (*)[4]) dst, chanType); } + + free(rgbaF); + free(destF); } diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h index 8b06dd5..69cd89e 100644 --- a/src/mesa/swrast/s_blend.h +++ b/src/mesa/swrast/s_blend.h @@ -27,9 +27,12 @@ #define S_BLEND_H -#include "main/mtypes.h" +#include "main/glheader.h" #include "s_span.h" +struct gl_context; +struct gl_renderbuffer; + extern void _swrast_blend_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *span); diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h index e5dae7e..44820ac 100644 --- a/src/mesa/swrast/s_depth.h +++ b/src/mesa/swrast/s_depth.h @@ -27,9 +27,12 @@ #define S_DEPTH_H -#include "main/mtypes.h" +#include "main/glheader.h" #include "s_span.h" +struct gl_context; +struct gl_renderbuffer; + extern GLuint _swrast_depth_test_span( struct gl_context *ctx, SWspan *span); diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 4e9b530..4d06668 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -720,13 +720,16 @@ _swrast_DrawPixels( struct gl_context *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - pixels = _mesa_map_pbo_source(ctx, unpack, pixels); - if (!pixels) { - swrast_render_finish(ctx); - _mesa_set_vp_override(ctx, save_vp_override); - return; - } + pixels = _mesa_map_pbo_source(ctx, unpack, pixels); + if (!pixels) { + swrast_render_finish(ctx); + _mesa_set_vp_override(ctx, save_vp_override); + return; + } + /* + * By time we get here, all error checking should have been done. + */ switch (format) { case GL_STENCIL_INDEX: draw_stencil_pixels( ctx, x, y, width, height, type, unpack, pixels ); @@ -734,27 +737,12 @@ _swrast_DrawPixels( struct gl_context *ctx, case GL_DEPTH_COMPONENT: draw_depth_pixels( ctx, x, y, width, height, type, unpack, pixels ); break; - case GL_COLOR_INDEX: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_RGB: - case GL_BGR: - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels); - break; case GL_DEPTH_STENCIL_EXT: - draw_depth_stencil_pixels(ctx, x, y, width, height, - type, unpack, pixels); + draw_depth_stencil_pixels(ctx, x, y, width, height, type, unpack, pixels); break; default: - _mesa_problem(ctx, "unexpected format 0x%x in _swrast_DrawPixels", format); - /* don't return yet, clean-up */ + /* all other formats should be color formats */ + draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels); } swrast_render_finish(ctx); diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h index ebc3513..9f93b70 100644 --- a/src/mesa/swrast/s_fog.h +++ b/src/mesa/swrast/s_fog.h @@ -28,9 +28,10 @@ #define S_FOG_H -#include "main/mtypes.h" +#include "main/glheader.h" #include "s_span.h" +struct gl_context; extern GLfloat _swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z); diff --git a/src/mesa/swrast/s_fragprog.h b/src/mesa/swrast/s_fragprog.h index 689d3fc..62a6836 100644 --- a/src/mesa/swrast/s_fragprog.h +++ b/src/mesa/swrast/s_fragprog.h @@ -27,9 +27,10 @@ #define S_FRAGPROG_H -#include "main/mtypes.h" #include "s_span.h" +struct gl_context; + extern void _swrast_exec_fragment_program(struct gl_context *ctx, SWspan *span); diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h index 95c7fe3..0a3adfc 100644 --- a/src/mesa/swrast/s_logic.h +++ b/src/mesa/swrast/s_logic.h @@ -27,9 +27,11 @@ #define S_LOGIC_H -#include "main/mtypes.h" #include "s_span.h" +struct gl_context; +struct gl_renderbuffer; + extern void _swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *span); diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h index 3712c82..5124509 100644 --- a/src/mesa/swrast/s_masking.h +++ b/src/mesa/swrast/s_masking.h @@ -27,9 +27,12 @@ #define S_MASKING_H -#include "main/mtypes.h" +#include "main/glheader.h" #include "s_span.h" +struct gl_context; +struct gl_renderbuffer; + extern void _swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 5e6356c..9fe0752 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -476,49 +476,33 @@ _swrast_ReadPixels( struct gl_context *ctx, _swrast_validate_derived( ctx ); /* Do all needed clipping here, so that we can forget about it later */ - if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) { - /* The ReadPixels region is totally outside the window bounds */ - swrast_render_finish(ctx); - return; - } - - pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels); - if (!pixels) - return; - - switch (format) { - case GL_STENCIL_INDEX: - read_stencil_pixels(ctx, x, y, width, height, type, pixels, + if (_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) { + + pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels); + + if (pixels) { + switch (format) { + case GL_STENCIL_INDEX: + read_stencil_pixels(ctx, x, y, width, height, type, pixels, + &clippedPacking); + break; + case GL_DEPTH_COMPONENT: + read_depth_pixels(ctx, x, y, width, height, type, pixels, + &clippedPacking); + break; + case GL_DEPTH_STENCIL_EXT: + read_depth_stencil_pixels(ctx, x, y, width, height, type, pixels, + &clippedPacking); + break; + default: + /* all other formats should be color formats */ + read_rgba_pixels(ctx, x, y, width, height, format, type, pixels, &clippedPacking); - break; - case GL_DEPTH_COMPONENT: - read_depth_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_RGB: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_RGBA: - case GL_BGR: - case GL_BGRA: - case GL_ABGR_EXT: - read_rgba_pixels(ctx, x, y, width, height, - format, type, pixels, &clippedPacking); - break; - case GL_DEPTH_STENCIL_EXT: - read_depth_stencil_pixels(ctx, x, y, width, height, - type, pixels, &clippedPacking); - break; - default: - _mesa_problem(ctx, "unexpected format 0x%x in _swrast_ReadPixels", format); - /* don't return yet, clean-up */ + } + + _mesa_unmap_pbo_dest(ctx, &clippedPacking); + } } swrast_render_finish(ctx); - - _mesa_unmap_pbo_dest(ctx, &clippedPacking); } diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 18e275e..afafbe0 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -28,7 +28,12 @@ #define S_SPAN_H -#include "swrast.h" +#include "main/config.h" +#include "main/glheader.h" +#include "main/mtypes.h" + +struct gl_context; +struct gl_renderbuffer; /** diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 1836d07..99c4441 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -86,10 +86,28 @@ texture_combine( struct gl_context *ctx, GLuint unit, GLuint n, const GLfloat scaleA = (GLfloat) (1 << combine->ScaleShiftA); const GLuint numArgsRGB = combine->_NumArgsRGB; const GLuint numArgsA = combine->_NumArgsA; - GLfloat ccolor[MAX_COMBINER_TERMS][MAX_WIDTH][4]; /* temp color buffers */ - GLfloat rgba[MAX_WIDTH][4]; + 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]); @@ -163,7 +181,7 @@ texture_combine( struct gl_context *ctx, GLuint unit, GLuint n, const GLuint srcUnit = srcRGB - GL_TEXTURE0; ASSERT(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) - return; + goto end; argRGB[term] = get_texel_array(swrast, srcUnit); } } @@ -253,7 +271,7 @@ texture_combine( struct gl_context *ctx, GLuint unit, GLuint n, const GLuint srcUnit = srcA - GL_TEXTURE0; ASSERT(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) - return; + goto end; argA[term] = get_texel_array(swrast, srcUnit); } } @@ -411,7 +429,7 @@ texture_combine( struct gl_context *ctx, GLuint unit, GLuint n, rgba[i][BCOMP] = 0.0; rgba[i][ACOMP] = 1.0; } - return; /* no alpha processing */ + goto end; /* no alpha processing */ default: _mesa_problem(ctx, "invalid combine mode"); } @@ -519,6 +537,12 @@ texture_combine( struct gl_context *ctx, GLuint unit, GLuint n, 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); } @@ -559,9 +583,16 @@ void _swrast_texture_span( struct gl_context *ctx, SWspan *span ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLfloat primary_rgba[MAX_WIDTH][4]; + 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); /* @@ -706,4 +737,6 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span ) span->array->rgba ); } } + + free(primary_rgba); } diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h index 5f47ebe..11049d8 100644 --- a/src/mesa/swrast/s_texcombine.h +++ b/src/mesa/swrast/s_texcombine.h @@ -27,9 +27,10 @@ #define S_TEXCOMBINE_H -#include "main/mtypes.h" #include "s_span.h" +struct gl_context; + extern void _swrast_texture_span( struct gl_context *ctx, SWspan *span ); diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 539d878..ecc09e0 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -27,7 +27,6 @@ #include "main/context.h" #include "main/colormac.h" #include "main/imports.h" -#include "main/texformat.h" #include "s_context.h" #include "s_texfilter.h" diff --git a/src/mesa/swrast/s_texfilter.h b/src/mesa/swrast/s_texfilter.h index 34520f2..69f2d80 100644 --- a/src/mesa/swrast/s_texfilter.h +++ b/src/mesa/swrast/s_texfilter.h @@ -27,9 +27,11 @@ #define S_TEXFILTER_H -#include "main/mtypes.h" #include "s_context.h" +struct gl_context; +struct gl_texture_object; + extern texture_sample_func _swrast_choose_texture_sample_func( struct gl_context *ctx, diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 85513e1..066f182 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -34,7 +34,7 @@ #include "main/colormac.h" #include "main/imports.h" #include "main/macros.h" -#include "main/texformat.h" +#include "main/mtypes.h" #include "program/prog_instruction.h" #include "s_aatriangle.h" diff --git a/src/mesa/swrast_setup/ss_triangle.h b/src/mesa/swrast_setup/ss_triangle.h index 0511086..a027f48 100644 --- a/src/mesa/swrast_setup/ss_triangle.h +++ b/src/mesa/swrast_setup/ss_triangle.h @@ -29,7 +29,7 @@ #ifndef SS_TRIANGLE_H #define SS_TRIANGLE_H -#include "main/mtypes.h" +struct gl_context; void _swsetup_trifuncs_init( struct gl_context *ctx ); diff --git a/src/mesa/swrast_setup/ss_vb.h b/src/mesa/swrast_setup/ss_vb.h index b8322f3..05e665b 100644 --- a/src/mesa/swrast_setup/ss_vb.h +++ b/src/mesa/swrast_setup/ss_vb.h @@ -29,7 +29,7 @@ #ifndef SS_VB_H #define SS_VB_H -#include "main/mtypes.h" +struct gl_context; void _swsetup_vb_init( struct gl_context *ctx ); void _swsetup_choose_rastersetup_func( struct gl_context *ctx ); diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index a185368..f5d8f74 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -67,6 +67,8 @@ struct vp_stage_data { GLvector4f ndcCoords; /**< normalized device coords */ GLubyte *clipmask; /**< clip flags */ GLubyte ormask, andmask; /**< for clipping */ + + struct gl_program_machine machine; }; @@ -314,7 +316,7 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) struct vp_stage_data *store = VP_STAGE_DATA(stage); struct vertex_buffer *VB = &tnl->vb; struct gl_vertex_program *program = ctx->VertexProgram._Current; - struct gl_program_machine machine; + struct gl_program_machine *machine = &store->machine; GLuint outputs[VERT_RESULT_MAX], numOutputs; GLuint i, j; @@ -342,7 +344,7 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) for (i = 0; i < VB->Count; i++) { GLuint attr; - init_machine(ctx, &machine, tnl->CurInstance); + init_machine(ctx, machine, tnl->CurInstance); #if 0 printf("Input %d: %f, %f, %f, %f\n", i, @@ -375,23 +377,23 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) check_float(data[2]); check_float(data[3]); #endif - COPY_CLEAN_4V(machine.VertAttribs[attr], size, data); + COPY_CLEAN_4V(machine->VertAttribs[attr], size, data); } } /* execute the program */ - _mesa_execute_program(ctx, &program->Base, &machine); + _mesa_execute_program(ctx, &program->Base, machine); /* copy the output registers into the VB->attribs arrays */ for (j = 0; j < numOutputs; j++) { const GLuint attr = outputs[j]; #ifdef NAN_CHECK - check_float(machine.Outputs[attr][0]); - check_float(machine.Outputs[attr][1]); - check_float(machine.Outputs[attr][2]); - check_float(machine.Outputs[attr][3]); + check_float(machine->Outputs[attr][0]); + check_float(machine->Outputs[attr][1]); + check_float(machine->Outputs[attr][2]); + check_float(machine->Outputs[attr][3]); #endif - COPY_4V(store->results[attr].data[i], machine.Outputs[attr]); + COPY_4V(store->results[attr].data[i], machine->Outputs[attr]); } /* FOGC is a special case. Fragment shader expects (f,0,0,1) */ @@ -401,14 +403,14 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) store->results[VERT_RESULT_FOGC].data[i][3] = 1.0; } #ifdef NAN_CHECK - ASSERT(machine.Outputs[0][3] != 0.0F); + ASSERT(machine->Outputs[0][3] != 0.0F); #endif #if 0 printf("HPOS: %f %f %f %f\n", - machine.Outputs[0][0], - machine.Outputs[0][1], - machine.Outputs[0][2], - machine.Outputs[0][3]); + machine->Outputs[0][0], + machine->Outputs[0][1], + machine->Outputs[0][2], + machine->Outputs[0][3]); #endif } @@ -504,7 +506,7 @@ init_vp(struct gl_context *ctx, struct tnl_pipeline_stage *stage) const GLuint size = VB->Size; GLuint i; - stage->privatePtr = MALLOC(sizeof(*store)); + stage->privatePtr = CALLOC(sizeof(*store)); store = VP_STAGE_DATA(stage); if (!store) return GL_FALSE; diff --git a/src/mesa/tnl/t_vertex.h b/src/mesa/tnl/t_vertex.h index 252f2f7..83b0dbc 100644 --- a/src/mesa/tnl/t_vertex.h +++ b/src/mesa/tnl/t_vertex.h @@ -28,9 +28,12 @@ #ifndef _TNL_VERTEX_H #define _TNL_VERTEX_H -#include "main/mtypes.h" +#include "main/glheader.h" #include "t_context.h" +struct gl_context; +struct tnl_clipspace; + /* New mechanism to specify hardware vertices so that tnl can build * and manipulate them directly. */ diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 421ec88..70492a4 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -32,7 +32,7 @@ #include "main/glheader.h" #include "main/ffvertex_prog.h" -#include "main/dd.h" +#include "main/mtypes.h" #include "t_vp_build.h" diff --git a/src/mesa/tnl/t_vp_build.h b/src/mesa/tnl/t_vp_build.h index 1d10ff2..e9f6de5 100644 --- a/src/mesa/tnl/t_vp_build.h +++ b/src/mesa/tnl/t_vp_build.h @@ -27,7 +27,7 @@ #ifndef T_VP_BUILD_H #define T_VP_BUILD_H -#include "main/mtypes.h" +struct gl_context; #define TNL_FIXED_FUNCTION_STATE_FLAGS (_NEW_PROGRAM | \ _NEW_LIGHT | \ diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h index 702efdc..24a0c72 100644 --- a/src/mesa/tnl/tnl.h +++ b/src/mesa/tnl/tnl.h @@ -28,8 +28,11 @@ #ifndef _TNL_H #define _TNL_H -#include "main/mtypes.h" +#include "main/glheader.h" +struct gl_client_array; +struct gl_context; +struct gl_program; /* These are the public-access functions exported from tnl. (A few diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 7b8da8e..e221538 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -32,7 +32,10 @@ #ifndef _VBO_H #define _VBO_H -#include "main/mtypes.h" +#include "main/glheader.h" + +struct gl_client_array; +struct gl_context; struct _mesa_prim { GLuint mode:8; @@ -40,7 +43,8 @@ struct _mesa_prim { GLuint begin:1; GLuint end:1; GLuint weak:1; - GLuint pad:20; + GLuint no_current_update:1; + GLuint pad:19; GLuint start; GLuint count; @@ -128,42 +132,42 @@ void vbo_set_draw_func(struct gl_context *ctx, vbo_draw_func func); void GLAPIENTRY -_vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); +_es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); void GLAPIENTRY -_vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z); +_es_Normal3f(GLfloat x, GLfloat y, GLfloat z); void GLAPIENTRY -_vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +_es_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); void GLAPIENTRY -_vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params); +_es_Materialfv(GLenum face, GLenum pname, const GLfloat *params); void GLAPIENTRY -_vbo_Materialf(GLenum face, GLenum pname, GLfloat param); +_es_Materialf(GLenum face, GLenum pname, GLfloat param); void GLAPIENTRY -_vbo_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +_es_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); void GLAPIENTRY -_vbo_VertexAttrib1f(GLuint indx, GLfloat x); +_es_VertexAttrib1f(GLuint indx, GLfloat x); void GLAPIENTRY -_vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values); +_es_VertexAttrib1fv(GLuint indx, const GLfloat* values); void GLAPIENTRY -_vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y); +_es_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y); void GLAPIENTRY -_vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values); +_es_VertexAttrib2fv(GLuint indx, const GLfloat* values); void GLAPIENTRY -_vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z); +_es_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z); void GLAPIENTRY -_vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values); +_es_VertexAttrib3fv(GLuint indx, const GLfloat* values); void GLAPIENTRY -_vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values); +_es_VertexAttrib4fv(GLuint indx, const GLfloat* values); #endif diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 9992cc3..6656ed8 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -209,7 +209,6 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx ) void _vbo_InvalidateState( struct gl_context *ctx, GLuint new_state ) { - _ae_invalidate_state(ctx, new_state); vbo_exec_invalidate_state(ctx, new_state); } diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index 8d6f2a7..2ded6cc 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -51,6 +51,7 @@ #ifndef _VBO_CONTEXT_H #define _VBO_CONTEXT_H +#include "main/mfeatures.h" #include "vbo.h" #include "vbo_attrib.h" #include "vbo_exec.h" diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index 47e51f0..d56c91c 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -34,6 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __VBO_EXEC_H__ #define __VBO_EXEC_H__ +#include "main/mfeatures.h" #include "main/mtypes.h" #include "vbo.h" #include "vbo_attrib.h" diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 9b2d59f..03d6bb4 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -34,6 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/bufferobj.h" #include "main/context.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/vtxfmt.h" #include "main/dlist.h" #include "main/eval.h" @@ -369,8 +370,6 @@ static void vbo_exec_fixup_vertex( struct gl_context *ctx, } -#if FEATURE_beginend - /* */ #define ATTR( A, N, V0, V1, V2, V3 ) \ @@ -411,7 +410,7 @@ do { \ #include "vbo_attrib_tmp.h" - +#if FEATURE_beginend #if FEATURE_evaluators @@ -706,30 +705,6 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) #else /* FEATURE_beginend */ -#define ATTR( A, N, V0, V1, V2, V3 ) \ -do { \ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; \ - \ - /* FLUSH_UPDATE_CURRENT needs to be set manually */ \ - exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ - \ - if (exec->vtx.active_sz[A] != N) \ - vbo_exec_fixup_vertex(ctx, A, N); \ - \ - { \ - GLfloat *dest = exec->vtx.attrptr[A]; \ - if (N>0) dest[0] = V0; \ - if (N>1) dest[1] = V1; \ - if (N>2) dest[2] = V2; \ - if (N>3) dest[3] = V3; \ - } \ -} while (0) - -#define ERROR() _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ) -#define TAG(x) vbo_##x - -#include "vbo_attrib_tmp.h" - static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) { /* silence warnings */ @@ -998,35 +973,35 @@ static void reset_attrfv( struct vbo_exec_context *exec ) void GLAPIENTRY -_vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) +_es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) { vbo_Color4f(r, g, b, a); } void GLAPIENTRY -_vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z) +_es_Normal3f(GLfloat x, GLfloat y, GLfloat z) { vbo_Normal3f(x, y, z); } void GLAPIENTRY -_vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) +_es_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) { vbo_MultiTexCoord4f(target, s, t, r, q); } void GLAPIENTRY -_vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) +_es_Materialfv(GLenum face, GLenum pname, const GLfloat *params) { vbo_Materialfv(face, pname, params); } void GLAPIENTRY -_vbo_Materialf(GLenum face, GLenum pname, GLfloat param) +_es_Materialf(GLenum face, GLenum pname, GLfloat param) { GLfloat p[4]; p[0] = param; @@ -1035,57 +1010,71 @@ _vbo_Materialf(GLenum face, GLenum pname, GLfloat param) } +/** + * A special version of glVertexAttrib4f that does not treat index 0 as + * VBO_ATTRIB_POS. + */ +static void +VertexAttrib4f_nopos(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + GET_CURRENT_CONTEXT(ctx); + if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR(VBO_ATTRIB_GENERIC0 + index, 4, x, y, z, w); + else + ERROR(); +} + void GLAPIENTRY -_vbo_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +_es_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - vbo_VertexAttrib4fARB(index, x, y, z, w); + VertexAttrib4f_nopos(index, x, y, z, w); } void GLAPIENTRY -_vbo_VertexAttrib1f(GLuint indx, GLfloat x) +_es_VertexAttrib1f(GLuint indx, GLfloat x) { - vbo_VertexAttrib1fARB(indx, x); + VertexAttrib4f_nopos(indx, x, 0.0f, 0.0f, 1.0f); } void GLAPIENTRY -_vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values) +_es_VertexAttrib1fv(GLuint indx, const GLfloat* values) { - vbo_VertexAttrib1fvARB(indx, values); + VertexAttrib4f_nopos(indx, values[0], 0.0f, 0.0f, 1.0f); } void GLAPIENTRY -_vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) +_es_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) { - vbo_VertexAttrib2fARB(indx, x, y); + VertexAttrib4f_nopos(indx, x, y, 0.0f, 1.0f); } void GLAPIENTRY -_vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values) +_es_VertexAttrib2fv(GLuint indx, const GLfloat* values) { - vbo_VertexAttrib2fvARB(indx, values); + VertexAttrib4f_nopos(indx, values[0], values[1], 0.0f, 1.0f); } void GLAPIENTRY -_vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) +_es_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) { - vbo_VertexAttrib3fARB(indx, x, y, z); + VertexAttrib4f_nopos(indx, x, y, z, 1.0f); } void GLAPIENTRY -_vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values) +_es_VertexAttrib3fv(GLuint indx, const GLfloat* values) { - vbo_VertexAttrib3fvARB(indx, values); + VertexAttrib4f_nopos(indx, values[0], values[1], values[2], 1.0f); } void GLAPIENTRY -_vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values) +_es_VertexAttrib4fv(GLuint indx, const GLfloat* values) { - vbo_VertexAttrib4fvARB(indx, values); + VertexAttrib4f_nopos(indx, values[0], values[1], values[2], values[3]); } diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 94aa021..87f6431 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -29,6 +29,7 @@ #include "main/bufferobj.h" #include "main/compiler.h" #include "main/enums.h" +#include "main/mfeatures.h" #include "main/state.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c index 4e7bcdd..4343b34 100644 --- a/src/mesa/vbo/vbo_save.c +++ b/src/mesa/vbo/vbo_save.c @@ -29,6 +29,7 @@ #include "main/mtypes.h" #include "main/bufferobj.h" #include "main/imports.h" +#include "main/mfeatures.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h index f5a407c..cd827ce 100644 --- a/src/mesa/vbo/vbo_save.h +++ b/src/mesa/vbo/vbo_save.h @@ -34,6 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef VBO_SAVE_H #define VBO_SAVE_H +#include "main/mfeatures.h" #include "main/mtypes.h" #include "vbo.h" #include "vbo_attrib.h" @@ -96,7 +97,9 @@ struct vbo_save_vertex_list { */ #define VBO_SAVE_BUFFER_SIZE (8*1024) /* dwords */ #define VBO_SAVE_PRIM_SIZE 128 -#define VBO_SAVE_PRIM_WEAK 0x40 +#define VBO_SAVE_PRIM_MODE_MASK 0x3f +#define VBO_SAVE_PRIM_WEAK 0x40 +#define VBO_SAVE_PRIM_NO_CURRENT_UPDATE 0x80 #define VBO_SAVE_FALLBACK 0x10000000 diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 817d478..4ee78e9 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -74,6 +74,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/enums.h" #include "main/eval.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "main/api_noop.h" #include "main/api_validate.h" #include "main/api_arrayelt.h" @@ -294,26 +295,30 @@ static void _save_compile_vertex_list( struct gl_context *ctx ) node->vertex_store->refcount++; node->prim_store->refcount++; - - node->current_size = node->vertex_size - node->attrsz[0]; - node->current_data = NULL; - - if (node->current_size) { - /* If the malloc fails, we just pull the data out of the VBO - * later instead. - */ - node->current_data = MALLOC( node->current_size * sizeof(GLfloat) ); - if (node->current_data) { - const char *buffer = (const char *)save->vertex_store->buffer; - unsigned attr_offset = node->attrsz[0] * sizeof(GLfloat); - unsigned vertex_offset = 0; - - if (node->count) - vertex_offset = (node->count-1) * node->vertex_size * sizeof(GLfloat); - - memcpy( node->current_data, - buffer + node->buffer_offset + vertex_offset + attr_offset, - node->current_size * sizeof(GLfloat) ); + if (node->prim[0].no_current_update) { + node->current_size = 0; + node->current_data = NULL; + } else { + node->current_size = node->vertex_size - node->attrsz[0]; + node->current_data = NULL; + + if (node->current_size) { + /* If the malloc fails, we just pull the data out of the VBO + * later instead. + */ + node->current_data = MALLOC( node->current_size * sizeof(GLfloat) ); + if (node->current_data) { + const char *buffer = (const char *)save->vertex_store->buffer; + unsigned attr_offset = node->attrsz[0] * sizeof(GLfloat); + unsigned vertex_offset = 0; + + if (node->count) + vertex_offset = (node->count-1) * node->vertex_size * sizeof(GLfloat); + + memcpy( node->current_data, + buffer + node->buffer_offset + vertex_offset + attr_offset, + node->current_size * sizeof(GLfloat) ); + } } } @@ -397,6 +402,7 @@ static void _save_wrap_buffers( struct gl_context *ctx ) GLint i = save->prim_count - 1; GLenum mode; GLboolean weak; + GLboolean no_current_update; assert(i < (GLint) save->prim_max); assert(i >= 0); @@ -407,6 +413,7 @@ static void _save_wrap_buffers( struct gl_context *ctx ) save->prim[i].start); mode = save->prim[i].mode; weak = save->prim[i].weak; + no_current_update = save->prim[i].no_current_update; /* store the copied vertices, and allocate a new list. */ @@ -416,6 +423,7 @@ static void _save_wrap_buffers( struct gl_context *ctx ) */ save->prim[0].mode = mode; save->prim[0].weak = weak; + save->prim[0].no_current_update = no_current_update; save->prim[0].begin = 0; save->prim[0].end = 0; save->prim[0].pad = 0; @@ -770,10 +778,11 @@ GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode ) GLuint i = save->prim_count++; assert(i < save->prim_max); - save->prim[i].mode = mode & ~VBO_SAVE_PRIM_WEAK; + save->prim[i].mode = mode & VBO_SAVE_PRIM_MODE_MASK; save->prim[i].begin = 1; save->prim[i].end = 0; save->prim[i].weak = (mode & VBO_SAVE_PRIM_WEAK) ? 1 : 0; + save->prim[i].no_current_update = (mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0; save->prim[i].pad = 0; save->prim[i].start = save->vert_count; save->prim[i].count = 0; @@ -934,7 +943,7 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co _ae_map_vbos( ctx ); - vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK ); + vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK | VBO_SAVE_PRIM_NO_CURRENT_UPDATE); for (i = 0; i < count; i++) CALL_ArrayElement(GET_DISPATCH(), (start + i)); @@ -960,7 +969,7 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices); - vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK ); + vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK | VBO_SAVE_PRIM_NO_CURRENT_UPDATE ); switch (type) { case GL_UNSIGNED_BYTE: diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 533c150..d0454bf 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -30,6 +30,7 @@ #include "main/bufferobj.h" #include "main/context.h" #include "main/imports.h" +#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/macros.h" #include "main/light.h" diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c index b1cfa9c..51e598e 100644 --- a/src/mesa/vbo/vbo_save_loopback.c +++ b/src/mesa/vbo/vbo_save_loopback.c @@ -29,6 +29,7 @@ #include "main/glheader.h" #include "main/enums.h" #include "main/imports.h" +#include "main/mfeatures.h" #include "main/mtypes.h" #include "main/dispatch.h" #include "glapi/glapi.h" diff --git a/src/mesa/x86/mmx.h b/src/mesa/x86/mmx.h index d4bda07..74e9979 100644 --- a/src/mesa/x86/mmx.h +++ b/src/mesa/x86/mmx.h @@ -27,7 +27,9 @@ #define ASM_MMX_H #include "main/compiler.h" -#include "main/mtypes.h" +#include "main/glheader.h" + +struct gl_context; extern void _ASMAPI _mesa_mmx_blend_transparency( struct gl_context *ctx, GLuint n, const GLubyte mask[], |