From e22e3927b056806e9bbb089734132ad0bcb98df1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Sep 2010 18:41:30 -0600 Subject: gallium: rework handling of sprite_coord_enable state Implement the pipe_rasterizer_state::sprite_coord_enable field in the draw module (and softpipe) according to what's specified in the documentation. The draw module can now add any number of extra vertex attributes to a post-transformed vertex and generate texcoords for those attributes per sprite_coord_enable. Auto-generated texcoords for sprites only worked for one texcoord unit before. The frag shader gl_PointCoord input is now implemented like any other generic/texcoord attribute. The draw module now needs to be informed about fragment shaders since we need to look at the fragment shader's inputs to know which ones need auto-generated texcoords. Only softpipe has been updated so far. --- src/mesa/state_tracker/st_atom_rasterizer.c | 14 ++++++++++++++ src/mesa/state_tracker/st_program.c | 17 +++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index 2599bd5ca0..0fe333ae8a 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -60,6 +60,7 @@ static void update_raster_state( struct st_context *st ) GLcontext *ctx = st->ctx; struct pipe_rasterizer_state *raster = &st->state.rasterizer; const struct gl_vertex_program *vertProg = ctx->VertexProgram._Current; + const struct gl_fragment_program *fragProg = ctx->FragmentProgram._Current; uint i; memset(raster, 0, sizeof(*raster)); @@ -175,17 +176,30 @@ static void update_raster_state( struct st_context *st ) if (!ctx->Point.PointSprite && ctx->Point.SmoothFlag) raster->point_smooth = 1; + /* _NEW_POINT | _NEW_PROGRAM + */ if (ctx->Point.PointSprite) { + /* origin */ if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^ (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM)) raster->sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT; else raster->sprite_coord_mode = PIPE_SPRITE_COORD_LOWER_LEFT; + + /* Coord replacement flags. If bit 'k' is set that means + * that we need to replace GENERIC[k] attrib with an automatically + * computed texture coord. + */ for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { if (ctx->Point.CoordReplace[i]) { raster->sprite_coord_enable |= 1 << i; } } + if (fragProg->Base.InputsRead & FRAG_BIT_PNTC) { + raster->sprite_coord_enable |= + 1 << (FRAG_ATTRIB_PNTC - FRAG_ATTRIB_TEX0); + } + raster->point_quad_rasterization = 1; } diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 8c2d8b6154..18a7bbe0f9 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -338,17 +338,6 @@ st_translate_fragment_program(struct st_context *st, input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; break; - case FRAG_ATTRIB_PNTC: - /* This is a hack. We really need a new semantic label for - * point coord. The draw module needs to know which fragment - * shader input is the point coord attribute so that it can set - * up the right vertex attribute values. - */ - input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - input_semantic_index[slot] = 0; - interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; - 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 @@ -364,6 +353,7 @@ st_translate_fragment_program(struct st_context *st, * 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: @@ -380,7 +370,10 @@ st_translate_fragment_program(struct st_context *st, assert(attr >= FRAG_ATTRIB_TEX0); input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; + if (attr == FRAG_ATTRIB_PNTC) + interpMode[slot] = TGSI_INTERPOLATE_LINEAR; + else + interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; } } -- cgit v1.2.3 From 55228878420733e77a09c67d5175e90e4b2e7245 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 20 Sep 2010 08:19:08 -0600 Subject: mesa: don't call valid_texture_object() in non-debug builds This reverts commit c32bac57ed445e48856d74113364287ed6e5cdd4 and silences the warning differently. The _mesa_reference_texobj() function is called quite a bit and we don't want to call valid_texture_object() all the time in non- debug builds. --- src/mesa/main/texobj.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index c96226df59..1fedc87028 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -330,11 +330,8 @@ _mesa_reference_texobj(struct gl_texture_object **ptr, GLboolean deleteFlag = GL_FALSE; struct gl_texture_object *oldTex = *ptr; - { - GLboolean valid = valid_texture_object(oldTex); - ASSERT(valid); - (void) valid; - } + ASSERT(valid_texture_object(oldTex)); + (void) valid_texture_object; /* silence warning in release builds */ _glthread_LOCK_MUTEX(oldTex->Mutex); ASSERT(oldTex->RefCount > 0); -- cgit v1.2.3 From 168554904bc079650124fbd026d9b75834eabc92 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 17 Sep 2010 02:43:38 +0200 Subject: st/mesa: fix assertion failure in GetTexImage for cubemaps Can be reproduced with mesa/demos/src/tests/blitfb. NOTE: This is a candidate for the 7.9 branch. --- src/mesa/state_tracker/st_cb_texture.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 124cd32e13..cd5001475c 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -240,6 +240,12 @@ get_texture_dims(GLenum target) return 1; case GL_TEXTURE_2D: case GL_TEXTURE_CUBE_MAP_ARB: + 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_RECTANGLE_NV: case GL_TEXTURE_2D_ARRAY_EXT: return 2; -- cgit v1.2.3 From 99907303f6a1e9abe02977664ad8457c122213ce Mon Sep 17 00:00:00 2001 From: Timo Wiren Date: Mon, 20 Sep 2010 15:27:34 -0700 Subject: Fix typos in comments and debug output strings. Bug #30208. --- src/mesa/drivers/dri/common/vblank.c | 2 +- src/mesa/drivers/dri/common/xmlconfig.c | 8 ++++---- src/mesa/drivers/dri/intel/intel_context.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c index 49b22a2dc7..cb98dd0b3a 100644 --- a/src/mesa/drivers/dri/common/vblank.c +++ b/src/mesa/drivers/dri/common/vblank.c @@ -241,7 +241,7 @@ GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ) * the first time the \c drmWaitVBlank fails. If \c drmWaitVBlank is * successful, \c vbl_seq will be set the sequence value in the reply. * - * \param vbl Pointer to drmVBlank packet desribing how to wait. + * \param vbl Pointer to drmVBlank packet describing how to wait. * \param vbl_seq Location to store the current refresh counter. * \param fd File descriptor use to call into the DRM. * \return Zero on success or -1 on failure. diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index 738b1ae97f..bde6b23c7c 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -206,7 +206,7 @@ static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { * * Works similar to strtod. Leading space is NOT skipped. The input * number may have an optional sign. '.' is interpreted as decimal - * point and may occor at most once. Optionally the number may end in + * point and may occur at most once. Optionally the number may end in * [eE], where is an integer as recognized by * strToI. In that case the result is number * 10^exponent. After * returning tail points to the first character that is not part of @@ -728,7 +728,7 @@ static void parseDeviceAttr (struct OptConfData *data, const XML_Char **attr) { for (i = 0; attr[i]; i += 2) { if (!strcmp (attr[i], "driver")) driver = attr[i+1]; else if (!strcmp (attr[i], "screen")) screen = attr[i+1]; - else XML_WARNING("unkown device attribute: %s.", attr[i]); + else XML_WARNING("unknown device attribute: %s.", attr[i]); } if (driver && strcmp (driver, data->driverName)) data->ignoringDevice = data->inDevice; @@ -748,7 +748,7 @@ static void parseAppAttr (struct OptConfData *data, const XML_Char **attr) { for (i = 0; attr[i]; i += 2) { if (!strcmp (attr[i], "name")) name = attr[i+1]; else if (!strcmp (attr[i], "executable")) exec = attr[i+1]; - else XML_WARNING("unkown application attribute: %s.", attr[i]); + else XML_WARNING("unknown application attribute: %s.", attr[i]); } if (exec && strcmp (exec, data->execName)) data->ignoringApp = data->inApp; @@ -761,7 +761,7 @@ static void parseOptConfAttr (struct OptConfData *data, const XML_Char **attr) { for (i = 0; attr[i]; i += 2) { if (!strcmp (attr[i], "name")) name = attr[i+1]; else if (!strcmp (attr[i], "value")) value = attr[i+1]; - else XML_WARNING("unkown option attribute: %s.", attr[i]); + else XML_WARNING("unknown option attribute: %s.", attr[i]); } if (!name) XML_WARNING1 ("name attribute missing in option."); if (!value) XML_WARNING1 ("value attribute missing in option."); diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 08069d71dd..109c670c14 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -354,7 +354,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) case __DRI_BUFFER_ACCUM: default: fprintf(stderr, - "unhandled buffer attach event, attacment type %d\n", + "unhandled buffer attach event, attachment type %d\n", buffers[i].attachment); return; } -- cgit v1.2.3 From 72e5fd5c02cb745d95f11573e7119ad1ba4bc1a8 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 17 Sep 2010 15:03:14 +0200 Subject: dri/nv04: Use nvgl_wrap_mode(). --- src/mesa/drivers/dri/nouveau/nv04_state_tex.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c index 4ac8327b87..b720089fbf 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c @@ -55,24 +55,6 @@ get_tex_format(struct gl_texture_image *ti) } } -static inline unsigned -get_wrap_mode(unsigned wrap) -{ - switch (wrap) { - case GL_REPEAT: - return 0x1; - case GL_MIRRORED_REPEAT: - return 0x2; - case GL_CLAMP: - case GL_CLAMP_TO_EDGE: - return 0x3; - case GL_CLAMP_TO_BORDER: - return 0x4; - default: - assert(0); - } -} - void nv04_emit_tex_obj(GLcontext *ctx, int emit) { @@ -106,8 +88,8 @@ nv04_emit_tex_obj(GLcontext *ctx, int emit) t->LodBias, -16, 15) * 8; } - format |= get_wrap_mode(t->WrapT) << 28 | - get_wrap_mode(t->WrapS) << 24 | + format |= nvgl_wrap_mode(t->WrapT) << 28 | + nvgl_wrap_mode(t->WrapS) << 24 | ti->HeightLog2 << 20 | ti->WidthLog2 << 16 | lod_max << 12 | -- cgit v1.2.3 From 13c246bceafd356959daff3d9872ffb0549c531a Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 17 Sep 2010 15:25:03 +0200 Subject: dri/nouveau: Remove unnecessary assertion. --- src/mesa/drivers/dri/nouveau/nv04_surface.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c index 9e7dcf0a88..ce0103604c 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_surface.c +++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c @@ -214,11 +214,6 @@ nv04_surface_copy_swizzle(GLcontext *ctx, assert(_mesa_is_pow_two(dst->width) && _mesa_is_pow_two(dst->height)); - /* If area is too large to copy in one shot we must copy it in - * POT chunks to meet alignment requirements */ - assert(sub_w == w || _mesa_is_pow_two(w)); - assert(sub_h == h || _mesa_is_pow_two(h)); - nouveau_bo_marko(bctx, sifm, NV03_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, src->bo, bo_flags | NOUVEAU_BO_RD); nouveau_bo_marko(bctx, swzsurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, -- cgit v1.2.3 From 22c83ac47a50ed1fdab59476886a7e56910a653a Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 17 Sep 2010 16:35:49 +0200 Subject: dri/nouveau: Cleanup more references to old FBOs and VBOs. --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 7 +++---- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index eff1016c07..0fecdee66e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -262,7 +262,10 @@ update_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable *draw, nouveau_update_renderbuffers(dri_ctx, draw); _mesa_resize_framebuffer(ctx, fb, draw->w, draw->h); + /* Clean up references to the old framebuffer objects. */ context_dirty(ctx, FRAMEBUFFER); + context_bctx(ctx, FRAMEBUFFER); + FIRE_RING(context_chan(ctx)); } GLboolean @@ -283,10 +286,6 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw, update_framebuffer(dri_ctx, dri_read, &dri_ctx->dri2.read_stamp); - /* Clean up references to the old framebuffer objects. */ - context_bctx(ctx, FRAMEBUFFER); - FIRE_RING(context_chan(ctx)); - /* Pass it down to mesa. */ _mesa_make_current(ctx, dri_draw->driverPrivate, dri_read->driverPrivate); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index e5858f8268..e4415cbedb 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -143,6 +143,7 @@ vbo_deinit_arrays(GLcontext *ctx, const struct _mesa_index_buffer *ib, } render->attr_count = 0; + context_bctx(ctx, VERTEX); } /* Make some rendering decisions from the GL context. */ -- cgit v1.2.3 From 98add55fffc29e0c40859fd5e9cec47fa1e352f5 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 17 Sep 2010 20:56:48 +0200 Subject: dri/nv10-nv20: Fix texturing in some cases after a base level change. --- src/mesa/drivers/dri/nouveau/nouveau_texture.c | 17 ++++++++--------- src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 2 +- src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index d86f78b437..b2f6faf1e1 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -178,7 +178,7 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint internalFormat, } static GLboolean -teximage_fits(GLcontext *ctx, struct gl_texture_object *t, int level) +teximage_fits(struct gl_texture_object *t, int level) { struct nouveau_surface *s = &to_nouveau_texture(t)->surfaces[level]; struct gl_texture_image *ti = t->Image[0][level]; @@ -186,8 +186,7 @@ teximage_fits(GLcontext *ctx, struct gl_texture_object *t, int level) if (!ti || !to_nouveau_teximage(ti)->surface.bo) return GL_FALSE; - if (context_chipset(ctx) < 0x10 && - level == t->BaseLevel && (s->offset & 0x7f)) + if (level == t->BaseLevel && (s->offset & 0x7f)) return GL_FALSE; return t->Target == GL_TEXTURE_RECTANGLE || @@ -202,7 +201,7 @@ validate_teximage(GLcontext *ctx, struct gl_texture_object *t, { struct gl_texture_image *ti = t->Image[0][level]; - if (teximage_fits(ctx, t, level)) { + if (teximage_fits(t, level)) { struct nouveau_surface *ss = to_nouveau_texture(t)->surfaces; struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; @@ -290,8 +289,8 @@ nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t) struct nouveau_texture *nt = to_nouveau_texture(t); int i, last = get_last_level(t); - if (!teximage_fits(ctx, t, t->BaseLevel) || - !teximage_fits(ctx, t, last)) + if (!teximage_fits(t, t->BaseLevel) || + !teximage_fits(t, last)) return GL_FALSE; if (nt->dirty) { @@ -314,8 +313,8 @@ nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t) void nouveau_texture_reallocate(GLcontext *ctx, struct gl_texture_object *t) { - if (!teximage_fits(ctx, t, t->BaseLevel) || - !teximage_fits(ctx, t, get_last_level(t))) { + if (!teximage_fits(t, t->BaseLevel) || + !teximage_fits(t, get_last_level(t))) { texture_dirty(t); relayout_texture(ctx, t); nouveau_texture_validate(ctx, t); @@ -377,7 +376,7 @@ nouveau_teximage(GLcontext *ctx, GLint dims, GLenum target, GLint level, } if (level == t->BaseLevel) { - if (!teximage_fits(ctx, t, level)) + if (!teximage_fits(t, level)) relayout_texture(ctx, t); nouveau_texture_validate(ctx, t); } diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index 6dedb18c72..6961ccbb45 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -225,7 +225,7 @@ nv10_emit_tex_obj(GLcontext *ctx, int emit) bo_flags | NOUVEAU_BO_OR); nouveau_bo_markl(bctx, celsius, NV10TCL_TX_OFFSET(i), - s->bo, 0, bo_flags); + s->bo, s->offset, bo_flags); BEGIN_RING(chan, celsius, NV10TCL_TX_FILTER(i), 1); OUT_RING(chan, tx_filter); diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c index 2d45513bb4..ea6b9b96db 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c @@ -236,7 +236,7 @@ nv20_emit_tex_obj(GLcontext *ctx, int emit) bo_flags | NOUVEAU_BO_OR); nouveau_bo_markl(bctx, kelvin, NV20TCL_TX_OFFSET(i), - s->bo, 0, bo_flags); + s->bo, s->offset, bo_flags); BEGIN_RING(chan, kelvin, NV20TCL_TX_WRAP(i), 1); OUT_RING(chan, tx_wrap); -- cgit v1.2.3 From bf8f24c1c84ab39207301ae5d298850d72e11876 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 17 Sep 2010 20:58:43 +0200 Subject: dri/nouveau: Fix software mipmap generation on 1x1 textures. --- src/mesa/drivers/dri/nouveau/nouveau_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index b2f6faf1e1..14c7b5f64b 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -603,7 +603,7 @@ store_mipmap(GLcontext *ctx, GLenum target, int first, int last, .BufferObj = ctx->Shared->NullBufferObj, .Alignment = 1 }; - GLenum format = t->Image[0][first]->TexFormat; + GLenum format = t->Image[0][t->BaseLevel]->TexFormat; unsigned base_format, type, comps; int i; -- cgit v1.2.3 From 610aed81dbaee73bc2a1fb9a030d7ec0e49e73cb Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 16 Sep 2010 10:31:19 -0700 Subject: r300/compiler: Refactor the pair instruction data structures Use rc_pair_ prefix for all pair instruction structs Create a named struct for pair instruction args Replace structs radeon_pair_instruction_{rgb,alpha} with struct radeon_pair_sub_instruction. These two structs were nearly identical and were creating a lot of cut and paste code. These changes are the first step towards removing some of that code. --- .../drivers/dri/r300/compiler/r300_fragprog_emit.c | 2 +- .../drivers/dri/r300/compiler/r500_fragprog_emit.c | 2 +- .../dri/r300/compiler/radeon_pair_schedule.c | 8 ++-- .../dri/r300/compiler/radeon_program_pair.h | 47 +++++++--------------- 4 files changed, 21 insertions(+), 38 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c index 3b2b06fc2b..4f13e51bcc 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c @@ -74,7 +74,7 @@ static void use_temporary(struct r300_fragment_program_code *code, unsigned int code->pixsize = index; } -static unsigned int use_source(struct r300_fragment_program_code* code, struct radeon_pair_instruction_source src) +static unsigned int use_source(struct r300_fragment_program_code* code, struct rc_pair_instruction_source src) { if (src.File == RC_FILE_CONSTANT) { return src.Index | (1 << 5); diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index 54cff9169a..bad1684696 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -198,7 +198,7 @@ static void use_temporary(struct r500_fragment_program_code* code, unsigned int code->max_temp_idx = index; } -static unsigned int use_source(struct r500_fragment_program_code* code, struct radeon_pair_instruction_source src) +static unsigned int use_source(struct r500_fragment_program_code* code, struct rc_pair_instruction_source src) { if (src.File == RC_FILE_CONSTANT) { return src.Index | 0x100; 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 5269d65985..a33b2fde7b 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -301,9 +301,9 @@ static int destructive_merge_instructions( unsigned int arg; int free_source; unsigned int one_way = 0; - struct radeon_pair_instruction_source srcp = + struct rc_pair_instruction_source srcp = alpha->RGB.Src[srcp_src]; - struct radeon_pair_instruction_source temp; + struct rc_pair_instruction_source temp; /* 2nd arg of 1 means this is an rgb source. * 3rd arg of 0 means this is not an alpha source. */ free_source = rc_pair_alloc_source(rgb, 1, 0, @@ -366,9 +366,9 @@ static int destructive_merge_instructions( unsigned int arg; int free_source; unsigned int one_way = 0; - struct radeon_pair_instruction_source srcp = + struct rc_pair_instruction_source srcp = alpha->Alpha.Src[srcp_src]; - struct radeon_pair_instruction_source temp; + struct rc_pair_instruction_source temp; /* 2nd arg of 0 means this is not an rgb source. * 3rd arg of 1 means this is an alpha source. */ free_source = rc_pair_alloc_source(rgb, 0, 1, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h index e0061e454b..01cdb15424 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h @@ -55,52 +55,35 @@ struct radeon_compiler; */ #define RC_PAIR_PRESUB_SRC 3 -struct radeon_pair_instruction_source { +struct rc_pair_instruction_source { unsigned int Used:1; unsigned int File:3; unsigned int Index:RC_REGISTER_INDEX_BITS; }; -struct radeon_pair_instruction_rgb { - unsigned int Opcode:8; - unsigned int DestIndex:RC_REGISTER_INDEX_BITS; - unsigned int WriteMask:3; - unsigned int Target:2; - unsigned int OutputWriteMask:3; - unsigned int Saturate:1; - - struct radeon_pair_instruction_source Src[4]; - - struct { - unsigned int Source:2; - unsigned int Swizzle:9; - unsigned int Abs:1; - unsigned int Negate:1; - } Arg[3]; +struct rc_pair_instruction_arg { + unsigned int Source:2; + unsigned int Swizzle:9; + unsigned int Abs:1; + unsigned int Negate:1; }; -struct radeon_pair_instruction_alpha { +struct rc_pair_sub_instruction { unsigned int Opcode:8; unsigned int DestIndex:RC_REGISTER_INDEX_BITS; - unsigned int WriteMask:1; - unsigned int Target:2; - unsigned int OutputWriteMask:1; + unsigned int WriteMask:3; + unsigned int Target:2; + unsigned int OutputWriteMask:3; unsigned int DepthWriteMask:1; unsigned int Saturate:1; - struct radeon_pair_instruction_source Src[4]; - - struct { - unsigned int Source:2; - unsigned int Swizzle:3; - unsigned int Abs:1; - unsigned int Negate:1; - } Arg[3]; + struct rc_pair_instruction_source Src[4]; + struct rc_pair_instruction_arg Arg[3]; }; struct rc_pair_instruction { - struct radeon_pair_instruction_rgb RGB; - struct radeon_pair_instruction_alpha Alpha; + struct rc_pair_sub_instruction RGB; + struct rc_pair_sub_instruction Alpha; unsigned int WriteALUResult:2; unsigned int ALUResultCompare:3; @@ -108,7 +91,7 @@ struct rc_pair_instruction { }; typedef void (*rc_pair_foreach_src_fn) - (void *, struct radeon_pair_instruction_source *); + (void *, struct rc_pair_instruction_source *); typedef enum { RC_PAIR_SOURCE_NONE = 0, -- cgit v1.2.3 From 23c507f1358833585de330ed313dffafabbbd3cd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 21 Sep 2010 10:35:50 -0700 Subject: i965: Share the KIL_NV implementation between glsl and non-glsl. --- src/mesa/drivers/dri/i965/brw_wm.h | 1 + src/mesa/drivers/dri/i965/brw_wm_emit.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 17 +---------------- 3 files changed, 3 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 2639d4f26b..c28acad24b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -373,6 +373,7 @@ 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, diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index f3ad01b3fe..a4754ca8cf 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -1223,7 +1223,7 @@ static void emit_kil( struct brw_wm_compile *c, /* KIL_NV kills the pixels that are currently executing, not based on a test * of the arguments. */ -static void emit_kil_nv( struct brw_wm_compile *c ) +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); diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 7d6724dc1c..7c05e452dd 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -614,21 +614,6 @@ static void emit_arl(struct brw_wm_compile *c, brw_set_saturate(p, 0); } -/** - * For GLSL shaders, this KIL will be unconditional. - * It may be contained inside an IF/ENDIF structure of course. - */ -static void emit_kil(struct brw_wm_compile *c) -{ - struct brw_compile *p = &c->func; - struct brw_reg depth = 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, depth, c->emit_mask_reg, depth); - brw_pop_insn_state(p); -} - static INLINE struct brw_reg high_words( struct brw_reg reg ) { return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_W ), 1 ), @@ -898,7 +883,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]); break; case OPCODE_KIL_NV: - emit_kil(c); + emit_kil_nv(c); break; case OPCODE_IF: assert(if_depth < MAX_IF_DEPTH); -- cgit v1.2.3 From 4a0bc4716db7bbcbcd65c0f993704733f47d41f7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 21 Sep 2010 10:53:34 -0700 Subject: i965: Also enable CC statistics when doing OQs. This is required by the spec, so respect that. --- src/mesa/drivers/dri/i965/brw_cc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index cfce5d3140..8430ee0cfa 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -90,6 +90,7 @@ static void prepare_cc_unit(struct brw_context *brw) */ static void upload_cc_unit(struct brw_context *brw) { + struct intel_context *intel = &brw->intel; GLcontext *ctx = &brw->intel.ctx; struct brw_cc_unit_state cc; void *map; @@ -203,12 +204,12 @@ static void upload_cc_unit(struct brw_context *brw) cc.cc2.depth_write_enable = ctx->Depth.Mask; } + if (intel->stats_wm || (INTEL_DEBUG & DEBUG_STATS)) + cc.cc5.statistics_enable = 1; + /* CACHE_NEW_CC_VP */ cc.cc4.cc_viewport_state_offset = brw->cc.vp_bo->offset >> 5; /* reloc */ - if (INTEL_DEBUG & DEBUG_STATS) - cc.cc5.statistics_enable = 1; - map = brw_state_batch(brw, sizeof(cc), 64, &brw->cc.state_bo, &brw->cc.state_offset); memcpy(map, &cc, sizeof(cc)); -- cgit v1.2.3 From dd9a88f4ddf4e5fa384792f891a1cc3d8ff73946 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 21 Sep 2010 12:05:37 -0700 Subject: i965: Track the windowizer's dispatch for kill pixel, promoted, and OQ Looks like the problem was we weren't passing the depth to the render target as expected, so the chip would wedge. Fixes GPU hang in occlusion-query-discard. Bug #30097 --- src/mesa/drivers/dri/i965/brw_wm.c | 4 +++- src/mesa/drivers/dri/i965/brw_wm.h | 3 ++- src/mesa/drivers/dri/i965/brw_wm_iz.c | 22 ++++++++++++++++++---- 3 files changed, 23 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index d70be7bda2..17ff3e2b2b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -215,6 +215,7 @@ 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; GLcontext *ctx = &brw->intel.ctx; /* BRW_NEW_FRAGMENT_PROGRAM */ const struct brw_fragment_program *fp = @@ -279,7 +280,8 @@ static void brw_wm_populate_key( struct brw_context *brw, } } - brw_wm_lookup_iz(line_aa, + brw_wm_lookup_iz(intel, + line_aa, lookup, uses_depth, key); diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index c28acad24b..fed1372969 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -299,7 +299,8 @@ 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( GLuint line_aa, +void brw_wm_lookup_iz( struct intel_context *intel, + GLuint line_aa, GLuint lookup, GLboolean ps_uses_depth, struct brw_wm_prog_key *key ); diff --git a/src/mesa/drivers/dri/i965/brw_wm_iz.c b/src/mesa/drivers/dri/i965/brw_wm_iz.c index 8505ef1951..62e556698b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_iz.c +++ b/src/mesa/drivers/dri/i965/brw_wm_iz.c @@ -120,24 +120,38 @@ const struct { * \param line_aa AA_NEVER, AA_ALWAYS or AA_SOMETIMES * \param lookup bitmask of IZ_* flags */ -void brw_wm_lookup_iz( GLuint line_aa, +void brw_wm_lookup_iz( struct intel_context *intel, + GLuint line_aa, GLuint lookup, GLboolean ps_uses_depth, struct brw_wm_prog_key *key ) { GLuint reg = 2; + GLboolean kill_stats_promoted_workaround = GL_FALSE; assert (lookup < IZ_BIT_MAX); - + + /* Crazy workaround in the windowizer, which we need to track in + * our register allocation and render target writes. See the "If + * 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 && + (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; - if (wm_iz_table[lookup].sd_present || ps_uses_depth) { + if (wm_iz_table[lookup].sd_present || ps_uses_depth || + kill_stats_promoted_workaround) { key->source_depth_reg = reg; reg += 2; } - if (wm_iz_table[lookup].sd_to_rt) + if (wm_iz_table[lookup].sd_to_rt || kill_stats_promoted_workaround) key->source_depth_to_render_target = 1; if (wm_iz_table[lookup].ds_present || line_aa != AA_NEVER) { -- cgit v1.2.3 From e7087175f8a04f777403366fb34b58edd00f4d60 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 21 Sep 2010 18:13:02 -0600 Subject: mesa: don't advertise bogus GL_ARB_shading_language_120 extension Instead of using the invalid GL_ARB_shading_language_120 extension to determine the GLSL version, use a new ctx->Const.GLSLVersion field. Updated the intel and r600 drivers, but untested. See fd.o bug 29910 NOTE: This is a candidate for the 7.9 branch (but let's wait and see if there's any regressions). --- src/mesa/drivers/dri/i965/brw_context.c | 10 ++++++++ src/mesa/drivers/dri/intel/intel_extensions.c | 1 - src/mesa/drivers/dri/r600/r600_context.c | 3 ++- src/mesa/main/context.c | 15 ++++++++++++ src/mesa/main/extensions.c | 7 ------ src/mesa/main/getstring.c | 34 ++++++++++++++++++++------- src/mesa/main/mtypes.h | 3 ++- src/mesa/main/version.c | 2 +- src/mesa/state_tracker/st_extensions.c | 6 ++++- 9 files changed, 60 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index d08538ec20..49be289750 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -42,6 +42,12 @@ #include "tnl/t_pipeline.h" +static const struct dri_extension gl_21_extension[] = { + {"GL_VERSION_2_1", GL_VERSION_2_1_functions }, +}; + + + /*************************************** * Mesa's Driver Functions ***************************************/ @@ -88,6 +94,8 @@ GLboolean brwCreateContext( int api, TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; + ctx->Const.GLSLVersion = 120; + ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS; ctx->Const.MaxTextureImageUnits = BRW_MAX_TEX_UNIT; ctx->Const.MaxTextureCoordUnits = 8; /* Mesa limit */ @@ -152,6 +160,8 @@ GLboolean brwCreateContext( int api, MIN2(ctx->Const.FragmentProgram.MaxNativeParameters, ctx->Const.FragmentProgram.MaxEnvParams); + driInitExtensions(ctx, gl_21_extension, GL_TRUE); + 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/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index bf22a423fc..a066b5b559 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -89,7 +89,6 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_point_sprite", NULL }, { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, - { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, { "GL_ARB_sync", GL_ARB_sync_functions }, { "GL_ARB_texture_border_clamp", NULL }, { "GL_ARB_texture_cube_map", NULL }, diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 9c8fe2a24f..f4e6716350 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -166,7 +166,6 @@ static const struct dri_extension mm_extensions[] = { static const struct dri_extension gl_20_extension[] = { #ifdef R600_ENABLE_GLSL_TEST {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, - {"GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, #else {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, #endif /* R600_ENABLE_GLSL_TEST */ @@ -266,6 +265,8 @@ static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) r700->bShaderUseMemConstant = GL_FALSE; } + ctx->Const.GLSLVersion = 120; + ctx->Const.MaxTextureImageUnits = 16; /* 8 per clause on r6xx, 16 on r7xx * but I think mesa only supports 8 at the moment diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b1f800f4c2..3bddf2570e 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -597,6 +597,21 @@ _mesa_init_constants(GLcontext *ctx) ctx->Const.MaxVarying = MAX_VARYING; #endif + /* Shading language version */ + if (ctx->API == API_OPENGL) { +#if FEATURE_ARB_shading_language_120 + ctx->Const.GLSLVersion = 120; +#else + ctx->Const.GLSLVersion = 110; +#endif + } + else if (ctx->API == API_OPENGLES2) { + ctx->Const.GLSLVersion = 100; + } + else if (ctx->API == API_OPENGLES) { + ctx->Const.GLSLVersion = 0; /* GLSL not supported */ + } + /* GL_ARB_framebuffer_object */ ctx->Const.MaxSamples = 0; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 50b97f5113..080fa98dfc 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -77,7 +77,6 @@ static const struct { { OFF, "GL_ARB_seamless_cube_map", F(ARB_seamless_cube_map) }, { OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) }, { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, - { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) }, { OFF, "GL_ARB_shadow", F(ARB_shadow) }, { OFF, "GL_ARB_shadow_ambient", F(ARB_shadow_ambient) }, { OFF, "GL_ARB_sync", F(ARB_sync) }, @@ -268,9 +267,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif #if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; -#endif -#if FEATURE_ARB_shading_language_120 - ctx->Extensions.ARB_shading_language_120 = GL_TRUE; #endif ctx->Extensions.ARB_shadow = GL_TRUE; ctx->Extensions.ARB_shadow_ambient = GL_TRUE; @@ -513,9 +509,6 @@ _mesa_enable_2_1_extensions(GLcontext *ctx) #if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; #endif -#if FEATURE_ARB_shading_language_120 - ctx->Extensions.ARB_shading_language_120 = GL_TRUE; -#endif } diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 5e4fcd599c..3910047fb5 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -30,26 +30,42 @@ #include "enums.h" #include "extensions.h" + +/** + * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query. + */ static const GLubyte * shading_language_version(GLcontext *ctx) { switch (ctx->API) { -#if FEATURE_ARB_shading_language_100 case API_OPENGL: - if (ctx->Extensions.ARB_shading_language_120) - return (const GLubyte *) "1.20"; - else if (ctx->Extensions.ARB_shading_language_100) - return (const GLubyte *) "1.10"; - goto error; -#endif + if (!ctx->Extensions.ARB_shader_objects) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetString"); + return (const GLubyte *) 0; + } + + switch (ctx->Const.GLSLVersion) { + case 110: + return (const GLubyte *) "1.10"; + case 120: + return (const GLubyte *) "1.20"; + case 130: + return (const GLubyte *) "1.30"; + default: + _mesa_problem(ctx, + "Invalid GLSL version in shading_language_version()"); + return (const GLubyte *) 0; + } + break; case API_OPENGLES2: return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16"; case API_OPENGLES: + /* fall-through */ + default: - error: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); + _mesa_problem(ctx, "Unexpected API value in shading_language_version()"); return (const GLubyte *) 0; } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index fdf8100c8c..5494be8f42 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2608,6 +2608,8 @@ struct gl_constants GLuint MaxVarying; /**< Number of float[4] varying parameters */ + GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */ + /** Which texture units support GL_ATI_envmap_bumpmap as targets */ GLbitfield SupportedBumpUnits; @@ -2668,7 +2670,6 @@ struct gl_extensions GLboolean ARB_seamless_cube_map; GLboolean ARB_shader_objects; GLboolean ARB_shading_language_100; - GLboolean ARB_shading_language_120; GLboolean ARB_shadow; GLboolean ARB_shadow_ambient; GLboolean ARB_sync; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 9e1f5f2a4f..5997ca00fd 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -84,7 +84,7 @@ compute_version(GLcontext *ctx) (ctx->Extensions.EXT_stencil_two_side || ctx->Extensions.ATI_separate_stencil)); const GLboolean ver_2_1 = (ver_2_0 && - ctx->Extensions.ARB_shading_language_120 && + ctx->Const.GLSLVersion >= 120 && ctx->Extensions.EXT_pixel_buffer_object && ctx->Extensions.EXT_texture_sRGB); const GLboolean ver_3_0 = (ver_2_1 && diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 4c18c66cc4..017f6c5cf7 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -186,6 +186,11 @@ void st_init_limits(struct st_context *st) * attributes) supported by a driver. */ c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS) - 2; c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING); + + /* XXX we'll need a better query here someday */ + if (screen->get_param(screen, PIPE_CAP_GLSL)) { + c->GLSLVersion = 120; + } } @@ -285,7 +290,6 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.ARB_vertex_shader = GL_TRUE; ctx->Extensions.ARB_shader_objects = GL_TRUE; ctx->Extensions.ARB_shading_language_100 = GL_TRUE; - ctx->Extensions.ARB_shading_language_120 = GL_TRUE; } if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_REPEAT) > 0) { -- cgit v1.2.3 From b91dba49e0b08b18dbd6c477facdcc7b5472c8c7 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 22 Sep 2010 11:01:11 -0400 Subject: intel: Fix GL_ARB_shading_language_120 commit Fix commit e7087175f8a04f777403366fb34b58edd00f4d60. Move the reference to GL_VERSION_2_1_functions to intel_extensions.c where it's available, don't try to enable a non-existing extension and advertise 1.20 for all intel chipsets, not just GEN4 and up. --- src/mesa/drivers/dri/i965/brw_context.c | 11 ----------- src/mesa/drivers/dri/intel/intel_extensions.c | 3 +++ 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 49be289750..4b44e2adec 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -41,13 +41,6 @@ #include "intel_span.h" #include "tnl/t_pipeline.h" - -static const struct dri_extension gl_21_extension[] = { - {"GL_VERSION_2_1", GL_VERSION_2_1_functions }, -}; - - - /*************************************** * Mesa's Driver Functions ***************************************/ @@ -94,8 +87,6 @@ GLboolean brwCreateContext( int api, TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; - ctx->Const.GLSLVersion = 120; - ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS; ctx->Const.MaxTextureImageUnits = BRW_MAX_TEX_UNIT; ctx->Const.MaxTextureCoordUnits = 8; /* Mesa limit */ @@ -160,8 +151,6 @@ GLboolean brwCreateContext( int api, MIN2(ctx->Const.FragmentProgram.MaxNativeParameters, ctx->Const.FragmentProgram.MaxEnvParams); - driInitExtensions(ctx, gl_21_extension, GL_TRUE); - 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/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index a066b5b559..4b6229ffe6 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -212,6 +212,9 @@ intelInitExtensions(GLcontext *ctx) */ driInitExtensions(ctx, card_extensions, GL_FALSE); + _mesa_map_function_array(GL_VERSION_2_1_functions); + ctx->Const.GLSLVersion = 120; + if (intel->gen >= 5) driInitExtensions(ctx, ironlake_extensions, GL_FALSE); -- cgit v1.2.3 From 9ec0b2a45e18c045fd3dbcdf846fad7faf97494c Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 22 Sep 2010 15:07:15 -0400 Subject: dri2: Make createImageFromName() take a __DRIscreen instead of __DRIcontext We can't expect to have a context when this is called, and we don't need one so just require a __DRIscreen instead. Reported by Yu Dai --- include/GL/internal/dri_interface.h | 2 +- src/egl/drivers/dri2/egl_dri2.c | 6 ++---- src/gallium/state_trackers/dri/drm/dri2.c | 4 ++-- src/mesa/drivers/dri/intel/intel_screen.c | 6 +++--- 4 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index ff83ff145e..5351a2ba4a 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -805,7 +805,7 @@ typedef struct __DRIimageExtensionRec __DRIimageExtension; struct __DRIimageExtensionRec { __DRIextension base; - __DRIimage *(*createImageFromName)(__DRIcontext *context, + __DRIimage *(*createImageFromName)(__DRIscreen *screen, int width, int height, int format, int name, int pitch, void *loaderPrivate); diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 856029091a..083f796f43 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1509,7 +1509,6 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx, EGLClientBuffer buffer, const EGLint *attr_list) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx); struct dri2_egl_image *dri2_img; unsigned int attachments[1]; xcb_drawable_t drawable; @@ -1577,7 +1576,7 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx, stride = buffers[0].pitch / buffers[0].cpp; dri2_img->dri_image = - dri2_dpy->image->createImageFromName(dri2_ctx->dri_context, + dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen, buffers_reply->width, buffers_reply->height, format, @@ -1628,7 +1627,6 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx, EGLClientBuffer buffer, const EGLint *attr_list) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx); struct dri2_egl_image *dri2_img; EGLint width, height, format, name, stride, pitch, i, err; @@ -1697,7 +1695,7 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx, } dri2_img->dri_image = - dri2_dpy->image->createImageFromName(dri2_ctx->dri_context, + dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen, width, height, format, diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c index 596309bfbd..135f66c61d 100644 --- a/src/gallium/state_trackers/dri/drm/dri2.c +++ b/src/gallium/state_trackers/dri/drm/dri2.c @@ -305,11 +305,11 @@ dri2_lookup_egl_image(struct dri_context *ctx, void *handle) } static __DRIimage * -dri2_create_image_from_name(__DRIcontext *context, +dri2_create_image_from_name(__DRIscreen *_screen, int width, int height, int format, int name, int pitch, void *loaderPrivate) { - struct dri_screen *screen = dri_screen(context->driScreenPriv); + struct dri_screen *screen = dri_screen(_screen); __DRIimage *img; struct pipe_resource templ; struct winsys_handle whandle; diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 0a542a7303..6d66a25ca1 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -123,12 +123,12 @@ static const struct __DRI2flushExtensionRec intelFlushExtension = { }; static __DRIimage * -intel_create_image_from_name(__DRIcontext *context, +intel_create_image_from_name(__DRIscreen *screen, int width, int height, int format, int name, int pitch, void *loaderPrivate) { + struct intel_screen *intelScreen = screen->private; __DRIimage *image; - struct intel_context *intel = context->driverPrivate; int cpp; image = CALLOC(sizeof *image); @@ -159,7 +159,7 @@ intel_create_image_from_name(__DRIcontext *context, image->data = loaderPrivate; cpp = _mesa_get_format_bytes(image->format); - image->region = intel_region_alloc_for_handle(intel->intelScreen, + image->region = intel_region_alloc_for_handle(intelScreen, cpp, width, height, pitch, name, "image"); if (image->region == NULL) { -- cgit v1.2.3 From b39e6f33b60ef9bbaf81f320aaca6a440d8a6a8f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Sep 2010 11:47:03 -0700 Subject: glsl: Rework assignments with write_masks to have LHS chan count match RHS. It turns out that most people new to this IR are surprised when an assignment to (say) 3 components on the LHS takes 4 components on the RHS. It also makes for quite strange IR output: (assign (constant bool (1)) (x) (var_ref color) (swiz x (var_ref v) )) (assign (constant bool (1)) (y) (var_ref color) (swiz yy (var_ref v) )) (assign (constant bool (1)) (z) (var_ref color) (swiz zzz (var_ref v) )) But even worse, even we get it wrong, as shown by this line of our current step(float, vec4): (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) where we try to assign a float to the writemasked-out x channel and don't supply anything for the actual w channel we're writing. Drivers right now just get lucky since ir_to_mesa spams the float value across all the source channels of a vec4. Instead, the RHS will now have a number of components equal to the number of components actually being written. Hopefully this confuses everyone less, and it also makes codegen for a scalar target simpler. Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick --- src/glsl/ast_function.cpp | 43 +++++++++++---------- src/glsl/builtin_function.cpp | 74 ++++++++++++++++++------------------ src/glsl/builtins/ir/noise2 | 16 ++++---- src/glsl/builtins/ir/noise3 | 24 ++++++------ src/glsl/builtins/ir/noise4 | 34 ++++++++--------- src/glsl/ir.cpp | 29 +++++++++++++- src/glsl/ir.h | 8 ++++ src/glsl/ir_constant_propagation.cpp | 16 ++++++-- src/glsl/ir_mat_op_to_vec.cpp | 5 +-- src/glsl/ir_validate.cpp | 16 ++++---- src/mesa/program/ir_to_mesa.cpp | 28 +++++++++++++- 11 files changed, 181 insertions(+), 112 deletions(-) (limited to 'src/mesa') diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index 5d9d35b2d9..20448f5a97 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -504,8 +504,9 @@ emit_inline_vector_constructor(const glsl_type *type, instructions->push_tail(inst); } else { unsigned base_component = 0; + unsigned base_lhs_component = 0; ir_constant_data data; - unsigned constant_mask = 0; + unsigned constant_mask = 0, constant_components = 0; memset(&data, 0, sizeof(data)); @@ -515,8 +516,8 @@ emit_inline_vector_constructor(const glsl_type *type, /* Do not try to assign more components to the vector than it has! */ - if ((rhs_components + base_component) > lhs_components) { - rhs_components = lhs_components - base_component; + if ((rhs_components + base_lhs_component) > lhs_components) { + rhs_components = lhs_components - base_lhs_component; } const ir_constant *const c = param->as_constant(); @@ -543,18 +544,23 @@ emit_inline_vector_constructor(const glsl_type *type, /* Mask of fields to be written in the assignment. */ - constant_mask |= ((1U << rhs_components) - 1) << base_component; - } + constant_mask |= ((1U << rhs_components) - 1) << base_lhs_component; + constant_components++; - /* Advance the component index by the number of components that were - * just assigned. + base_component += rhs_components; + } + /* Advance the component index by the number of components + * that were just assigned. */ - base_component += rhs_components; + base_lhs_component += rhs_components; } if (constant_mask != 0) { ir_dereference *lhs = new(ctx) ir_dereference_variable(var); - ir_rvalue *rhs = new(ctx) ir_constant(var->type, &data); + const glsl_type *rhs_type = glsl_type::get_instance(var->type->base_type, + constant_components, + 1); + ir_rvalue *rhs = new(ctx) ir_constant(rhs_type, &data); ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL, constant_mask); @@ -574,12 +580,10 @@ emit_inline_vector_constructor(const glsl_type *type, const ir_constant *const c = param->as_constant(); if (c == NULL) { - /* Generate a swizzle that puts the first element of the source at - * the location of the first element of the destination. - */ + /* Generate a swizzle in case rhs_components != rhs->type->vector_elements. */ unsigned swiz[4] = { 0, 0, 0, 0 }; for (unsigned i = 0; i < rhs_components; i++) - swiz[i + base_component] = i; + swiz[i] = i; /* Mask of fields to be written in the assignment. */ @@ -587,7 +591,7 @@ emit_inline_vector_constructor(const glsl_type *type, << base_component; ir_dereference *lhs = new(ctx) ir_dereference_variable(var); - ir_rvalue *rhs = new(ctx) ir_swizzle(param, swiz, lhs_components); + ir_rvalue *rhs = new(ctx) ir_swizzle(param, swiz, rhs_components); ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL, write_mask); @@ -632,10 +636,10 @@ assign_to_matrix_column(ir_variable *var, unsigned column, unsigned row_base, */ unsigned swiz[4] = { src_base, src_base, src_base, src_base }; for (unsigned i = 0; i < count; i++) - swiz[i + row_base] = src_base + i; + swiz[i + row_base] = i; ir_rvalue *const rhs = - new(mem_ctx) ir_swizzle(src, swiz, column_ref->type->components()); + new(mem_ctx) ir_swizzle(src, swiz, count); /* Mask of fields to be written in the assignment. */ @@ -816,7 +820,7 @@ emit_inline_matrix_constructor(const glsl_type *type, var->type->matrix_columns); unsigned swiz[4] = { 0, 0, 0, 0 }; - for (unsigned i = 1; i < src_matrix->type->vector_elements; i++) + for (unsigned i = 1; i < last_row; i++) swiz[i] = i; const unsigned write_mask = (1U << last_row) - 1; @@ -837,14 +841,11 @@ emit_inline_matrix_constructor(const glsl_type *type, */ ir_rvalue *rhs; if (lhs->type->vector_elements != rhs_col->type->vector_elements) { - rhs = new(ctx) ir_swizzle(rhs_col, swiz, - lhs->type->vector_elements); + rhs = new(ctx) ir_swizzle(rhs_col, swiz, last_row); } else { rhs = rhs_col; } - assert(lhs->type == rhs->type); - ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL, write_mask); instructions->push_tail(inst); diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index c904f4629f..5f9bbec2f0 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -1889,8 +1889,8 @@ static const char *builtin_noise2 = "\n" " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n" " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" " (return (var_ref t))\n" " ))\n" "\n" @@ -1903,8 +1903,8 @@ static const char *builtin_noise2 = "\n" " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n" " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" " (return (var_ref t))\n" " ))\n" "\n" @@ -1919,8 +1919,8 @@ static const char *builtin_noise2 = "\n" " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n" " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" " (return (var_ref t))\n" " ))\n" "\n" @@ -1935,8 +1935,8 @@ static const char *builtin_noise2 = "\n" " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n" " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" " (return (var_ref t))\n" " ))\n" "))\n" @@ -1956,9 +1956,9 @@ static const char *builtin_noise3 = " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n" " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n" - " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" + " (assign (constant bool (1)) (z) (var_ref t) (var_ref c))\n" " (return (var_ref t))\n" " ))\n" "\n" @@ -1974,9 +1974,9 @@ static const char *builtin_noise3 = " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n" " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n" - " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" + " (assign (constant bool (1)) (z) (var_ref t) (var_ref c))\n" " (return (var_ref t))\n" " ))\n" "\n" @@ -1992,9 +1992,9 @@ static const char *builtin_noise3 = " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n" " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n" - " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" + " (assign (constant bool (1)) (z) (var_ref t) (var_ref c))\n" " (return (var_ref t))\n" " ))\n" "\n" @@ -2010,9 +2010,9 @@ static const char *builtin_noise3 = " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))\n" " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n" - " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n" - " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n" + " (assign (constant bool (1)) (x) (var_ref t) (var_ref a))\n" + " (assign (constant bool (1)) (y) (var_ref t) (var_ref b))\n" + " (assign (constant bool (1)) (z) (var_ref t) (var_ref c))\n" " (return (var_ref t))\n" " ))\n" "))\n" @@ -2037,10 +2037,10 @@ static const char *builtin_noise4 = " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n" " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n" - " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n" - " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n" - " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n" + " (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x))\n" + " (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y))\n" + " (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z))\n" + " (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w))\n" " (return (var_ref _r))\n" " ))\n" "\n" @@ -2061,10 +2061,10 @@ static const char *builtin_noise4 = " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n" " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n" - " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n" - " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n" - " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n" + " (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x))\n" + " (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y))\n" + " (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z))\n" + " (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w))\n" " (return (var_ref _r))\n" " ))\n" "\n" @@ -2085,10 +2085,10 @@ static const char *builtin_noise4 = " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n" " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n" - " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n" - " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n" - " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n" + " (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x))\n" + " (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y))\n" + " (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z))\n" + " (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w))\n" " (return (var_ref _r))\n" " ))\n" "\n" @@ -2102,17 +2102,17 @@ static const char *builtin_noise4 = " (declare () vec4 _r)\n" "\n" " (declare () float _p)\n" - " (assign (constant bool (1)) (xy) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) )\n" + " (assign (constant bool (1)) (x) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) )\n" "\n" " (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))\n" " (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0 313.0 29.0 277.0)))))\n" " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n" " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0 313.0 29.0 277.0)))))\n" "\n" - " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n" - " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n" - " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n" - " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n" + " (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x))\n" + " (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y))\n" + " (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z))\n" + " (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w))\n" " (return (var_ref _r))\n" " ))\n" "))\n" diff --git a/src/glsl/builtins/ir/noise2 b/src/glsl/builtins/ir/noise2 index 008f8b00f1..383fccfadf 100644 --- a/src/glsl/builtins/ir/noise2 +++ b/src/glsl/builtins/ir/noise2 @@ -8,8 +8,8 @@ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) (return (var_ref t)) )) @@ -22,8 +22,8 @@ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) (return (var_ref t)) )) @@ -38,8 +38,8 @@ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) (return (var_ref t)) )) @@ -54,8 +54,8 @@ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) (return (var_ref t)) )) )) diff --git a/src/glsl/builtins/ir/noise3 b/src/glsl/builtins/ir/noise3 index f191e145f9..ed7ad5190f 100644 --- a/src/glsl/builtins/ir/noise3 +++ b/src/glsl/builtins/ir/noise3 @@ -11,9 +11,9 @@ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) - (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) + (assign (constant bool (1)) (z) (var_ref t) (var_ref c)) (return (var_ref t)) )) @@ -29,9 +29,9 @@ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) - (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) + (assign (constant bool (1)) (z) (var_ref t) (var_ref c)) (return (var_ref t)) )) @@ -47,9 +47,9 @@ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) - (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) + (assign (constant bool (1)) (z) (var_ref t) (var_ref c)) (return (var_ref t)) )) @@ -65,9 +65,9 @@ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0))))) - (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) - (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) - (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (assign (constant bool (1)) (x) (var_ref t) (var_ref a)) + (assign (constant bool (1)) (y) (var_ref t) (var_ref b)) + (assign (constant bool (1)) (z) (var_ref t) (var_ref c)) (return (var_ref t)) )) )) diff --git a/src/glsl/builtins/ir/noise4 b/src/glsl/builtins/ir/noise4 index fb300fd148..77a2529a18 100644 --- a/src/glsl/builtins/ir/noise4 +++ b/src/glsl/builtins/ir/noise4 @@ -16,10 +16,10 @@ (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) - (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) - (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) - (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x)) + (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y)) + (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z)) + (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w)) (return (var_ref _r)) )) @@ -40,10 +40,10 @@ (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0))))) - (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) - (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) - (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) - (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x)) + (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y)) + (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z)) + (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w)) (return (var_ref _r)) )) @@ -64,10 +64,10 @@ (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0))))) - (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) - (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) - (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) - (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x)) + (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y)) + (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z)) + (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w)) (return (var_ref _r)) )) @@ -81,17 +81,17 @@ (declare () vec4 _r) (declare () float _p) - (assign (constant bool (1)) (xy) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) ) + (assign (constant bool (1)) (x) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) ) (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p))) (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0 313.0 29.0 277.0))))) (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0 313.0 29.0 277.0))))) - (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) - (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) - (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) - (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (assign (constant bool (1)) (x) (var_ref _r) (var_ref _x)) + (assign (constant bool (1)) (y) (var_ref _r) (var_ref _y)) + (assign (constant bool (1)) (z) (var_ref _r) (var_ref _z)) + (assign (constant bool (1)) (w) (var_ref _r) (var_ref _w)) (return (var_ref _r)) )) )) diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 7cc55d40b7..5e2109ecc6 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -55,6 +55,9 @@ update_rhs_swizzle(ir_swizzle_mask &m, unsigned from, unsigned to) void ir_assignment::set_lhs(ir_rvalue *lhs) { + void *mem_ctx = this; + bool swizzled = false; + while (lhs != NULL) { ir_swizzle *swiz = lhs->as_swizzle(); @@ -82,7 +85,21 @@ ir_assignment::set_lhs(ir_rvalue *lhs) this->write_mask = write_mask; lhs = swiz->val; - this->rhs = new(this) ir_swizzle(this->rhs, rhs_swiz); + this->rhs = new(mem_ctx) ir_swizzle(this->rhs, rhs_swiz); + swizzled = true; + } + + if (swizzled) { + /* Now, RHS channels line up with the LHS writemask. Collapse it + * to just the channels that will be written. + */ + ir_swizzle_mask rhs_swiz = { 0, 0, 0, 0, 0, 0 }; + int rhs_chan = 0; + for (int i = 0; i < 4; i++) { + if (write_mask & (1 << i)) + update_rhs_swizzle(rhs_swiz, i, rhs_chan++); + } + this->rhs = new(mem_ctx) ir_swizzle(this->rhs, rhs_swiz); } assert((lhs == NULL) || lhs->as_dereference()); @@ -122,6 +139,16 @@ ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs, this->rhs = rhs; this->lhs = lhs; this->write_mask = write_mask; + + if (lhs->type->is_scalar() || lhs->type->is_vector()) { + int lhs_components = 0; + for (int i = 0; i < 4; i++) { + if (write_mask & (1 << i)) + lhs_components++; + } + + assert(lhs_components == this->rhs->type->vector_elements); + } } ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 240e7cd49a..fa246b5e57 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -646,6 +646,14 @@ public: * For non-vector types in the LHS, this field will be zero. For vector * types, a bit will be set for each component that is written. Note that * for \c vec2 and \c vec3 types only the lower bits will ever be set. + * + * A partially-set write mask means that each enabled channel gets + * the value from a consecutive channel of the rhs. For example, + * to write just .xyw of gl_FrontColor with color: + * + * (assign (constant bool (1)) (xyw) + * (var_ref gl_FragColor) + * (swiz xyw (var_ref color))) */ unsigned write_mask:4; }; diff --git a/src/glsl/ir_constant_propagation.cpp b/src/glsl/ir_constant_propagation.cpp index f7a0599f42..390f295d6e 100644 --- a/src/glsl/ir_constant_propagation.cpp +++ b/src/glsl/ir_constant_propagation.cpp @@ -168,18 +168,26 @@ ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue) if (!found) return; + int rhs_channel = 0; + for (int j = 0; j < 4; j++) { + if (j == channel) + break; + if (found->write_mask & (1 << j)) + rhs_channel++; + } + switch (type->base_type) { case GLSL_TYPE_FLOAT: - data.f[i] = found->constant->value.f[channel]; + data.f[i] = found->constant->value.f[rhs_channel]; break; case GLSL_TYPE_INT: - data.i[i] = found->constant->value.i[channel]; + data.i[i] = found->constant->value.i[rhs_channel]; break; case GLSL_TYPE_UINT: - data.u[i] = found->constant->value.u[channel]; + data.u[i] = found->constant->value.u[rhs_channel]; break; case GLSL_TYPE_BOOL: - data.b[i] = found->constant->value.b[channel]; + data.b[i] = found->constant->value.b[rhs_channel]; break; default: assert(!"not reached"); diff --git a/src/glsl/ir_mat_op_to_vec.cpp b/src/glsl/ir_mat_op_to_vec.cpp index c32ca88b0f..244fe48928 100644 --- a/src/glsl/ir_mat_op_to_vec.cpp +++ b/src/glsl/ir_mat_op_to_vec.cpp @@ -310,14 +310,11 @@ ir_mat_op_to_vec_visitor::do_equal_mat_mat(ir_variable *result_var, new(this->mem_ctx) ir_expression(ir_binop_any_nequal, glsl_type::bool_type, op0, op1); - ir_rvalue *const swiz = - new(this->mem_ctx) ir_swizzle(cmp, i, i, i, i, columns); - ir_dereference *const lhs = new(this->mem_ctx) ir_dereference_variable(tmp_bvec); ir_assignment *const assign = - new(this->mem_ctx) ir_assignment(lhs, swiz, NULL, (1U << i)); + new(this->mem_ctx) ir_assignment(lhs, cmp, NULL, (1U << i)); this->base_ir->insert_before(assign); } diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 912d1c0d70..e35514aa6f 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -391,14 +391,16 @@ ir_validate::visit_enter(ir_assignment *ir) abort(); } - /* Mask of fields that do not exist in the destination. These should - * not be written by the assignment. - */ - const unsigned invalid_mask = ~((1U << lhs->type->components()) - 1); + int lhs_components = 0; + for (int i = 0; i < 4; i++) { + if (ir->write_mask & (1 << i)) + lhs_components++; + } - if ((invalid_mask & ir->write_mask) != 0) { - printf("Assignment write mask enables invalid components for " - "type %s:\n", lhs->type->name); + if (lhs_components != ir->rhs->type->vector_elements) { + printf("Assignment count of LHS write mask channels enabled not\n" + "matching RHS vector size (%d LHS, %d RHS).\n", + lhs_components, ir->rhs->type->vector_elements); ir->print(); abort(); } diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index f24dce79f6..de0cb1ac5b 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -1577,13 +1577,39 @@ ir_to_mesa_visitor::visit(ir_assignment *ir) assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector()); l.writemask = WRITEMASK_XYZW; } else if (ir->lhs->type->is_scalar()) { - /* FINISHME: This hack makes writing to gl_FragData, which lives in the + /* FINISHME: This hack makes writing to gl_FragDepth, which lives in the * FINISHME: W component of fragment shader output zero, work correctly. */ l.writemask = WRITEMASK_XYZW; } else { + int swizzles[4]; + int first_enabled_chan = 0; + int rhs_chan = 0; + assert(ir->lhs->type->is_vector()); l.writemask = ir->write_mask; + + for (int i = 0; i < 4; i++) { + if (l.writemask & (1 << i)) { + first_enabled_chan = GET_SWZ(r.swizzle, i); + break; + } + } + + /* Swizzle a small RHS vector into the channels being written. + * + * glsl ir treats write_mask as dictating how many channels are + * present on the RHS while Mesa IR treats write_mask as just + * showing which channels of the vec4 RHS get written. + */ + for (int i = 0; i < 4; i++) { + if (l.writemask & (1 << i)) + swizzles[i] = GET_SWZ(r.swizzle, rhs_chan++); + else + swizzles[i] = first_enabled_chan; + } + r.swizzle = MAKE_SWIZZLE4(swizzles[0], swizzles[1], + swizzles[2], swizzles[3]); } assert(l.file != PROGRAM_UNDEFINED); -- cgit v1.2.3 From eaa6bf59db68f97fa32c3395eb4aa6e589f34b26 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Sep 2010 13:07:57 -0700 Subject: ir_to_mesa: Only compare vector_elements present for any_nequal/all_equal Fixes: glsl-mat-from-int-ctor-03 --- src/mesa/program/ir_to_mesa.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index de0cb1ac5b..93b6c305f1 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -1096,6 +1096,12 @@ ir_to_mesa_visitor::visit(ir_expression *ir) assert(!ir->operands[operand]->type->is_matrix()); } + int vector_elements = ir->operands[0]->type->vector_elements; + if (ir->operands[1]) { + vector_elements = MAX2(vector_elements, + ir->operands[1]->type->vector_elements); + } + this->result.file = PROGRAM_UNDEFINED; /* Storage for our result. Ideally for an assignment we'd be using @@ -1204,7 +1210,12 @@ ir_to_mesa_visitor::visit(ir_expression *ir) ir_to_mesa_src_reg temp = get_temp(glsl_type::vec4_type); ir_to_mesa_emit_op2(ir, OPCODE_SNE, ir_to_mesa_dst_reg_from_src(temp), op[0], op[1]); - ir_to_mesa_emit_op2(ir, OPCODE_DP4, result_dst, temp, temp); + if (vector_elements == 4) + ir_to_mesa_emit_op2(ir, OPCODE_DP4, result_dst, temp, temp); + else if (vector_elements == 3) + ir_to_mesa_emit_op2(ir, OPCODE_DP3, result_dst, temp, temp); + else + ir_to_mesa_emit_op2(ir, OPCODE_DP2, result_dst, temp, temp); ir_to_mesa_emit_op2(ir, OPCODE_SEQ, result_dst, result_src, src_reg_for_float(0.0)); } else { @@ -1218,7 +1229,12 @@ ir_to_mesa_visitor::visit(ir_expression *ir) ir_to_mesa_src_reg temp = get_temp(glsl_type::vec4_type); ir_to_mesa_emit_op2(ir, OPCODE_SNE, ir_to_mesa_dst_reg_from_src(temp), op[0], op[1]); - ir_to_mesa_emit_op2(ir, OPCODE_DP4, result_dst, temp, temp); + if (vector_elements == 4) + ir_to_mesa_emit_op2(ir, OPCODE_DP4, result_dst, temp, temp); + else if (vector_elements == 3) + ir_to_mesa_emit_op2(ir, OPCODE_DP3, result_dst, temp, temp); + else + ir_to_mesa_emit_op2(ir, OPCODE_DP2, result_dst, temp, temp); ir_to_mesa_emit_op2(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0)); } else { -- cgit v1.2.3 From d74bab1fb67fe1334fd80eaf0d4e224fc6d96f22 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Sep 2010 14:14:30 -0700 Subject: i965: Fix the vector/expression splitting for the write_mask change. +113 piglits. --- src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 5 +---- src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'src/mesa') 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 478614090a..eba8a764e2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp @@ -128,10 +128,7 @@ ir_channel_expressions_visitor::assign(ir_assignment *ir, int elem, ir_rvalue *v */ assert(ir->write_mask == (1 << ir->lhs->type->components()) - 1); - /* Smear the float across all the channels for the masked write. */ - val_swiz = new(mem_ctx) ir_swizzle(val, 0, 0, 0, 0, - ir->lhs->type->components()); - assign = new(mem_ctx) ir_assignment(lhs, val_swiz, NULL, (1 << elem)); + assign = new(mem_ctx) ir_assignment(lhs, val, NULL, (1 << elem)); ir->insert_before(assign); } diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp index 00d5c20248..d4da86b3b0 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -281,9 +281,6 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) if (rhs) { new_rhs = new(mem_ctx) ir_dereference_variable(rhs->components[i]); - /* If we're writing into a writemask, smear it out to that channel. */ - if (!lhs) - new_rhs = new(mem_ctx) ir_swizzle(new_rhs, i, i, i, i, i + 1); } else { new_rhs = new(mem_ctx) ir_swizzle(ir->rhs->clone(mem_ctx, NULL), i, i, i, i, 1); -- cgit v1.2.3 From ac3d5beb0b20eb369b188aaf7b78f935969f3b62 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Sep 2010 14:40:40 -0700 Subject: i965: When splitting vector variable assignment, ignore unset channels. The new checks for sanity in ir_assignment creation got angry about this write_mask == 0. Fixes: glsl-fs-dot-vec2. glsl-fs-atan-2 glsl-fs-dot-vec2 --- src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp index d4da86b3b0..9b58916cf2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -271,12 +271,15 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) void *mem_ctx = lhs ? lhs->mem_ctx : rhs->mem_ctx; unsigned int writemask; + if (!(ir->write_mask & (1 << i))) + continue; + if (lhs) { new_lhs = new(mem_ctx) ir_dereference_variable(lhs->components[i]); - writemask = (ir->write_mask >> i) & 1; + writemask = 1; } else { new_lhs = ir->lhs->clone(mem_ctx, NULL); - writemask = ir->write_mask & (1 << i); + writemask = 1 << i; } if (rhs) { -- cgit v1.2.3 From bb70bd55596fa19f5775bac98bffb567f3ba1d9f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Sep 2010 14:52:38 -0700 Subject: i965: Update expression splitting for the vector-result change to compares. Fixes: glsl1-precision exp2 glsl1-precision log2 --- .../drivers/dri/i965/brw_fs_channel_expressions.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/mesa') 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 eba8a764e2..9fbf7b7c6b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp @@ -119,7 +119,6 @@ ir_channel_expressions_visitor::assign(ir_assignment *ir, int elem, ir_rvalue *v { ir_dereference *lhs = ir->lhs->clone(mem_ctx, NULL); ir_assignment *assign; - ir_swizzle *val_swiz; /* This assign-of-expression should have been generated by the * expression flattening visitor (since we never short circit to @@ -232,6 +231,12 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir) case ir_binop_bit_and: case ir_binop_bit_xor: case ir_binop_bit_or: + case ir_binop_less: + case ir_binop_greater: + case ir_binop_lequal: + case ir_binop_gequal: + case ir_binop_equal: + case ir_binop_nequal: for (i = 0; i < vector_elements; i++) { ir_rvalue *op0 = get_element(op_var[0], i); ir_rvalue *op1 = get_element(op_var[1], i); @@ -312,10 +317,6 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir) break; } - case ir_binop_less: - case ir_binop_greater: - case ir_binop_lequal: - case ir_binop_gequal: case ir_binop_logic_and: case ir_binop_logic_xor: case ir_binop_logic_or: @@ -323,8 +324,8 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir) printf("\n"); assert(!"not reached: expression operates on scalars only"); break; - case ir_binop_equal: - case ir_binop_nequal: { + case ir_binop_all_equal: + case ir_binop_any_nequal: { ir_expression *last = NULL; for (i = 0; i < vector_elements; i++) { ir_rvalue *op0 = get_element(op_var[0], i); @@ -332,7 +333,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir) ir_expression *temp; ir_expression_operation join; - if (expr->operation == ir_binop_equal) + if (expr->operation == ir_binop_all_equal) join = ir_binop_logic_and; else join = ir_binop_logic_or; -- cgit v1.2.3 From 03923ff95ed2c1ee54f0132e87e277b6cf07b7f5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Sep 2010 14:58:29 -0700 Subject: i965: Warning fix for vector result any_nequal/all_equal change. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index cf5c52119a..2b517375eb 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -750,7 +750,9 @@ fs_visitor::visit(ir_expression *ir) case ir_binop_dot: case ir_binop_cross: case ir_unop_any: - assert(!"not reached: should be handled by brw_channel_expressions"); + case ir_binop_all_equal: + case ir_binop_any_nequal: + assert(!"not reached: should be handled by brw_fs_channel_expressions"); break; case ir_unop_noise: -- cgit v1.2.3 From 17eace581d25a626a7d75d9d1205d012cbb14a6e Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 22 Sep 2010 22:01:17 -0400 Subject: dri: Pass the __DRIscreen and the __DRIscreen private back to image lookup We will typically have a current context when we need to lookup the image, but the lookup implementation don't need it so drop it. --- include/GL/internal/dri_interface.h | 2 +- src/egl/drivers/dri2/egl_dri2.c | 7 +++---- src/gallium/include/state_tracker/st_api.h | 1 - src/gallium/state_trackers/dri/common/dri_context.h | 3 --- src/gallium/state_trackers/dri/common/dri_screen.c | 8 +++----- src/gallium/state_trackers/dri/common/dri_screen.h | 3 +++ src/gallium/state_trackers/dri/drm/dri2.c | 10 +++++----- src/mesa/drivers/dri/common/dri_util.c | 1 + src/mesa/drivers/dri/common/dri_util.h | 1 + src/mesa/drivers/dri/intel/intel_fbo.c | 4 ++-- src/mesa/drivers/dri/intel/intel_tex_image.c | 4 ++-- 11 files changed, 21 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 5351a2ba4a..9ee039bd90 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -841,7 +841,7 @@ typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension; struct __DRIimageLookupExtensionRec { __DRIextension base; - __DRIimage *(*lookupEGLImage)(__DRIcontext *context, void *image, + __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image, void *loaderPrivate); }; diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 083f796f43..9c4ff560b1 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -370,10 +370,9 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate) } static __DRIimage * -dri2_lookup_egl_image(__DRIcontext *context, void *image, void *data) +dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data) { - struct dri2_egl_context *dri2_ctx = data; - _EGLDisplay *disp = dri2_ctx->base.Resource.Display; + _EGLDisplay *disp = data; struct dri2_egl_image *dri2_img; _EGLImage *img; @@ -728,7 +727,7 @@ dri2_create_screen(_EGLDisplay *disp) dri2_dpy = disp->DriverData; dri2_dpy->dri_screen = dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions, - &dri2_dpy->driver_configs, dri2_dpy); + &dri2_dpy->driver_configs, disp); if (dri2_dpy->dri_screen == NULL) { _eglLog(_EGL_WARNING, "DRI2: failed to create dri screen"); diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 8ea1554568..21e2165ed9 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -384,7 +384,6 @@ struct st_manager * This function is optional. */ boolean (*get_egl_image)(struct st_manager *smapi, - struct st_context_iface *stctx, void *egl_image, struct st_egl_image *out); diff --git a/src/gallium/state_trackers/dri/common/dri_context.h b/src/gallium/state_trackers/dri/common/dri_context.h index ffe9eba13c..beb59c6f68 100644 --- a/src/gallium/state_trackers/dri/common/dri_context.h +++ b/src/gallium/state_trackers/dri/common/dri_context.h @@ -61,9 +61,6 @@ struct dri_context /* gallium */ struct st_api *stapi; struct st_context_iface *st; - - /* hooks filled in by dri2 & drisw */ - __DRIimage * (*lookup_egl_image)(struct dri_context *ctx, void *handle); }; static INLINE struct dri_context * diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c index 475a96d196..7e4b11d83f 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.c +++ b/src/gallium/state_trackers/dri/common/dri_screen.c @@ -287,16 +287,14 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen, static boolean dri_get_egl_image(struct st_manager *smapi, - struct st_context_iface *stctxi, void *egl_image, struct st_egl_image *stimg) { - struct dri_context *ctx = - (struct dri_context *)stctxi->st_manager_private; + struct dri_screen *screen = (struct dri_screen *)smapi; __DRIimage *img = NULL; - if (ctx->lookup_egl_image) { - img = ctx->lookup_egl_image(ctx, egl_image); + if (screen->lookup_egl_image) { + img = screen->lookup_egl_image(screen, egl_image); } if (!img) diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h index 849f399b2f..d4eb8f454f 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.h +++ b/src/gallium/state_trackers/dri/common/dri_screen.h @@ -69,6 +69,9 @@ struct dri_screen boolean sd_depth_bits_last; boolean auto_fake_front; enum pipe_texture_target target; + + /* hooks filled in by dri2 & drisw */ + __DRIimage * (*lookup_egl_image)(struct dri_screen *ctx, void *handle); }; /** cast wrapper */ diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c index 135f66c61d..116afccb19 100644 --- a/src/gallium/state_trackers/dri/drm/dri2.c +++ b/src/gallium/state_trackers/dri/drm/dri2.c @@ -291,15 +291,16 @@ dri2_flush_frontbuffer(struct dri_drawable *drawable, } static __DRIimage * -dri2_lookup_egl_image(struct dri_context *ctx, void *handle) +dri2_lookup_egl_image(struct dri_screen *screen, void *handle) { - __DRIimageLookupExtension *loader = ctx->sPriv->dri2.image; + __DRIimageLookupExtension *loader = screen->sPriv->dri2.image; __DRIimage *img; if (!loader->lookupEGLImage) return NULL; - img = loader->lookupEGLImage(ctx->cPriv, handle, ctx->cPriv->loaderPrivate); + img = loader->lookupEGLImage(screen->sPriv, + handle, screen->sPriv->loaderPrivate); return img; } @@ -537,6 +538,7 @@ dri2_init_screen(__DRIscreen * sPriv) screen->auto_fake_front = dri_with_format(sPriv); screen->broken_invalidate = !sPriv->dri2.useInvalidate; + screen->lookup_egl_image = dri2_lookup_egl_image; return configs; fail: @@ -556,8 +558,6 @@ dri2_create_context(gl_api api, const __GLcontextModes * visual, ctx = cPriv->driverPrivate; - ctx->lookup_egl_image = dri2_lookup_egl_image; - return TRUE; } diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index f07c3da4bb..d46f622d57 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -880,6 +880,7 @@ dri2CreateNewScreen(int scrn, int fd, } psp->DriverAPI = driDriverAPI; + psp->loaderPrivate = data; driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions, __dri2NConfigOptions); diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 5096d22cad..785beacd81 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -539,6 +539,7 @@ struct __DRIscreenRec { driOptionCache optionInfo; driOptionCache optionCache; unsigned int api_mask; + void *loaderPrivate; }; extern void diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 2693b5fa72..363a5c0242 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -202,8 +202,8 @@ intel_image_target_renderbuffer_storage(GLcontext *ctx, __DRIimage *image; screen = intel->intelScreen->driScrnPriv; - image = screen->dri2.image->lookupEGLImage(intel->driContext, image_handle, - intel->driContext->loaderPrivate); + image = screen->dri2.image->lookupEGLImage(screen, image_handle, + screen->loaderPrivate); if (image == NULL) return; diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 7d33df3599..b1ed7ee5e7 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -805,8 +805,8 @@ intel_image_target_texture_2d(GLcontext *ctx, GLenum target, __DRIimage *image; screen = intel->intelScreen->driScrnPriv; - image = screen->dri2.image->lookupEGLImage(intel->driContext, image_handle, - intel->driContext->loaderPrivate); + image = screen->dri2.image->lookupEGLImage(screen, image_handle, + screen->loaderPrivate); if (image == NULL) return; -- cgit v1.2.3 From ada1d91c15e05b55829d61d04879faeea98474e9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 23 Sep 2010 16:12:23 +1000 Subject: egl: fix build since 17eace581d25a626a7d75d9d1205d012cbb14a6e looks like mesa st didn't get updated. --- src/mesa/state_tracker/st_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 450b0453cf..66e32b4c9e 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -794,7 +794,7 @@ st_manager_get_egl_image_surface(struct st_context *st, return NULL; memset(&stimg, 0, sizeof(stimg)); - if (!smapi->get_egl_image(smapi, &st->iface, eglimg, &stimg)) + if (!smapi->get_egl_image(smapi, eglimg, &stimg)) return NULL; ps = smapi->screen->get_tex_surface(smapi->screen, -- cgit v1.2.3 From 907a6734fcd427a6ac6fe5fcfbeac5d6054d82ae Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Sep 2010 15:53:55 -0700 Subject: mesa: Remove the non-required ARB_imaging extension. Many of the EXT_ extensions in the subset have significant code overhead with no users. It is not a required part of GL -- though text describing the extension is part of the core spec since 1.2, it is always conditional on the ARB_imaging extension. --- src/mesa/main/blend.c | 6 ++---- src/mesa/main/extensions.c | 5 +---- src/mesa/main/get.c | 4 ++-- src/mesa/main/histogram.c | 20 ++++++++++---------- src/mesa/main/mtypes.h | 1 - src/mesa/state_tracker/st_cb_texture.c | 1 - 6 files changed, 15 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index d022770f24..736a94c052 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -215,8 +215,7 @@ _mesa_validate_blend_equation( GLcontext *ctx, break; case GL_MIN: case GL_MAX: - if (!ctx->Extensions.EXT_blend_minmax && - !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_blend_minmax) { return GL_FALSE; } break; @@ -229,8 +228,7 @@ _mesa_validate_blend_equation( GLcontext *ctx, break; case GL_FUNC_SUBTRACT: case GL_FUNC_REVERSE_SUBTRACT: - if (!ctx->Extensions.EXT_blend_subtract && - !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_blend_subtract) { return GL_FALSE; } break; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 080fa98dfc..b6500b9c4e 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -62,7 +62,6 @@ static const struct { /* { 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_imaging", F(ARB_imaging) }, { 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) }, @@ -255,7 +254,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_half_float_vertex = GL_TRUE; - ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; #if FEATURE_queryobj @@ -392,12 +390,11 @@ _mesa_enable_sw_extensions(GLcontext *ctx) /** - * Enable GL_ARB_imaging and all the EXT extensions that are subsets of it. + * Enable common EXT extensions in the ARB_imaging subset. */ void _mesa_enable_imaging_extensions(GLcontext *ctx) { - ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.EXT_blend_color = GL_TRUE; ctx->Extensions.EXT_blend_logic_op = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 2062134a39..a840663f6a 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -938,12 +938,12 @@ static const struct value_desc values[] = { CONTEXT_FLOAT(Pixel.PostConvolutionBias[3]), extra_EXT_convolution }, - /* GL_EXT_histogram / GL_ARB_imaging */ + /* GL_EXT_histogram */ { GL_HISTOGRAM, CONTEXT_BOOL(Pixel.HistogramEnabled), extra_EXT_histogram }, { GL_MINMAX, CONTEXT_BOOL(Pixel.MinMaxEnabled), extra_EXT_histogram }, - /* GL_SGI_color_table / GL_ARB_imaging */ + /* GL_SGI_color_table */ { GL_COLOR_TABLE_SGI, CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]), extra_SGI_color_table }, diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index 4e482bcd54..db3cbfc5a9 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -629,7 +629,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax"); return; } @@ -692,7 +692,7 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram"); return; } @@ -752,7 +752,7 @@ _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv"); return; } @@ -799,7 +799,7 @@ _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv"); return; } @@ -846,7 +846,7 @@ _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv"); return; } @@ -872,7 +872,7 @@ _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv"); return; } @@ -900,7 +900,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram"); return; } @@ -981,7 +981,7 @@ _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax"); return; } @@ -1010,7 +1010,7 @@ _mesa_ResetHistogram(GLenum target) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram"); return; } @@ -1035,7 +1035,7 @@ _mesa_ResetMinmax(GLenum target) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { + if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax"); return; } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5494be8f42..0bb8734e4b 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2658,7 +2658,6 @@ struct gl_extensions GLboolean ARB_geometry_shader4; GLboolean ARB_half_float_pixel; GLboolean ARB_half_float_vertex; - GLboolean ARB_imaging; GLboolean ARB_instanced_arrays; GLboolean ARB_map_buffer_range; GLboolean ARB_multisample; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index cd5001475c..0a4f8508ec 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -548,7 +548,6 @@ st_TexImage(GLcontext * ctx, /* The Mesa/Gallium state tracker does not implement the imaging extensions * such as convolution. */ - assert(!ctx->Extensions.ARB_imaging); assert(!ctx->Extensions.EXT_convolution); /* switch to "normal" */ -- cgit v1.2.3 From 7126e38d9037da66fd531c4cb02b3843b68b84ff Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Sep 2010 16:10:22 -0700 Subject: mesa: Remove EXT_histogram. This has always been optional, and not useful. --- src/mesa/main/attrib.c | 4 - src/mesa/main/context.c | 2 - src/mesa/main/enable.c | 21 - src/mesa/main/extensions.c | 3 - src/mesa/main/get.c | 6 - src/mesa/main/histogram.c | 971 +------------------------------------------- src/mesa/main/histogram.h | 2 - src/mesa/main/image.c | 74 ---- src/mesa/main/mfeatures.h | 1 - src/mesa/main/mtypes.h | 42 +- src/mesa/main/pixel.c | 8 - src/mesa/swrast/s_copypix.c | 40 +- src/mesa/swrast/s_drawpix.c | 35 +- 13 files changed, 43 insertions(+), 1166 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 753949be50..9a8917fc89 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -78,7 +78,6 @@ struct gl_enable_attrib GLboolean DepthTest; GLboolean Dither; GLboolean Fog; - GLboolean Histogram; GLboolean Light[MAX_LIGHTS]; GLboolean Lighting; GLboolean LineSmooth; @@ -107,7 +106,6 @@ struct gl_enable_attrib GLboolean Map2Vertex4; GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ - GLboolean MinMax; GLboolean Normalize; GLboolean PixelTexture; GLboolean PointSmooth; @@ -279,8 +277,6 @@ _mesa_PushAttrib(GLbitfield mask) attr->Lighting = ctx->Light.Enabled; attr->LineSmooth = ctx->Line.SmoothFlag; attr->LineStipple = ctx->Line.StippleFlag; - attr->Histogram = ctx->Pixel.HistogramEnabled; - attr->MinMax = ctx->Pixel.MinMaxEnabled; attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled; attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled; attr->Map1Color4 = ctx->Eval.Map1Color4; diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 3bddf2570e..6f2ffe107d 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -98,7 +98,6 @@ #include "feedback.h" #include "fog.h" #include "framebuffer.h" -#include "histogram.h" #include "hint.h" #include "hash.h" #include "light.h" @@ -738,7 +737,6 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_fbobjects( ctx ); _mesa_init_feedback( ctx ); _mesa_init_fog( ctx ); - _mesa_init_histogram( ctx ); _mesa_init_hint( ctx ); _mesa_init_line( ctx ); _mesa_init_lighting( ctx ); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index db30123c0f..b0eb294df4 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -363,13 +363,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_FOG); ctx->Fog.Enabled = state; break; - case GL_HISTOGRAM: - CHECK_EXTENSION(EXT_histogram, cap); - if (ctx->Pixel.HistogramEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.HistogramEnabled = state; - break; case GL_LIGHT0: case GL_LIGHT1: case GL_LIGHT2: @@ -534,12 +527,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_EVAL); ctx->Eval.Map2Vertex4 = state; break; - case GL_MINMAX: - if (ctx->Pixel.MinMaxEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.MinMaxEnabled = state; - break; case GL_NORMALIZE: if (ctx->Transform.Normalize == state) return; @@ -1356,14 +1343,6 @@ _mesa_IsEnabled( GLenum cap ) return (ctx->Array.ArrayObj->PointSize.Enabled != 0); #endif - /* GL_EXT_histogram */ - case GL_HISTOGRAM: - CHECK_EXTENSION(EXT_histogram); - return ctx->Pixel.HistogramEnabled; - case GL_MINMAX: - CHECK_EXTENSION(EXT_histogram); - return ctx->Pixel.MinMaxEnabled; - /* GL_SGI_color_table */ case GL_COLOR_TABLE_SGI: CHECK_EXTENSION(SGI_color_table); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index b6500b9c4e..33599136b4 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -128,7 +128,6 @@ static const struct { { 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_histogram", F(EXT_histogram) }, { 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) }, @@ -319,7 +318,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_ARB_framebuffer_object ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; #endif - ctx->Extensions.EXT_histogram = GL_TRUE; /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; ctx->Extensions.EXT_paletted_texture = GL_TRUE; @@ -400,7 +398,6 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_convolution = GL_TRUE; - ctx->Extensions.EXT_histogram = GL_TRUE; ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGI_color_table = GL_TRUE; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index a840663f6a..f04f42022d 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -277,7 +277,6 @@ EXTRA_EXT(NV_texture_rectangle); EXTRA_EXT(EXT_stencil_two_side); EXTRA_EXT(NV_light_max_exponent); EXTRA_EXT(EXT_convolution); -EXTRA_EXT(EXT_histogram); EXTRA_EXT(SGI_color_table); EXTRA_EXT(SGI_texture_color_table); EXTRA_EXT(EXT_depth_bounds_test); @@ -938,11 +937,6 @@ static const struct value_desc values[] = { CONTEXT_FLOAT(Pixel.PostConvolutionBias[3]), extra_EXT_convolution }, - /* GL_EXT_histogram */ - { GL_HISTOGRAM, CONTEXT_BOOL(Pixel.HistogramEnabled), - extra_EXT_histogram }, - { GL_MINMAX, CONTEXT_BOOL(Pixel.MinMaxEnabled), extra_EXT_histogram }, - /* GL_SGI_color_table */ { GL_COLOR_TABLE_SGI, CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]), diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index db3cbfc5a9..a14d93e519 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -35,585 +35,6 @@ #if FEATURE_histogram - -/* - * XXX the packed pixel formats haven't been tested. - */ -static void -pack_histogram( GLcontext *ctx, - GLuint n, CONST GLuint rgba[][4], - GLenum format, GLenum type, GLvoid *destination, - const struct gl_pixelstore_attrib *packing ) -{ - const GLint comps = _mesa_components_in_format(format); - GLuint luminance[MAX_WIDTH]; - - if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) { - GLuint i; - for (i = 0; i < n; i++) { - luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; - } - } - -#define PACK_MACRO(TYPE) \ - { \ - GLuint i; \ - switch (format) { \ - case GL_RED: \ - for (i=0;iSwapBytes) { - _mesa_swap2(dst, n * comps); - } - } - break; - case GL_SHORT: - { - GLshort *dst = (GLshort *) destination; - PACK_MACRO(GLshort); - if (packing->SwapBytes) { - _mesa_swap2((GLushort *) dst, n * comps); - } - } - break; - case GL_UNSIGNED_INT: - { - GLuint *dst = (GLuint *) destination; - PACK_MACRO(GLuint); - if (packing->SwapBytes) { - _mesa_swap4(dst, n * comps); - } - } - break; - case GL_INT: - { - GLint *dst = (GLint *) destination; - PACK_MACRO(GLint); - if (packing->SwapBytes) { - _mesa_swap4((GLuint *) dst, n * comps); - } - } - break; - case GL_FLOAT: - { - GLfloat *dst = (GLfloat *) destination; - PACK_MACRO(GLfloat); - if (packing->SwapBytes) { - _mesa_swap4((GLuint *) dst, n * comps); - } - } - break; - case GL_HALF_FLOAT_ARB: - { - /* temporarily store as GLuints */ - GLuint temp[4*HISTOGRAM_TABLE_SIZE]; - GLuint *dst = temp; - GLhalfARB *half = (GLhalfARB *) destination; - GLuint i; - /* get GLuint values */ - PACK_MACRO(GLuint); - /* convert to GLhalf */ - for (i = 0; i < n * comps; i++) { - half[i] = _mesa_float_to_half((GLfloat) temp[i]); - } - if (packing->SwapBytes) { - _mesa_swap2((GLushort *) half, n * comps); - } - } - break; - case GL_UNSIGNED_BYTE_3_3_2: - if (format == GL_RGB) { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x7) << 5) - | ((rgba[i][GCOMP] & 0x7) << 2) - | ((rgba[i][BCOMP] & 0x3) ); - } - } - else { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x7) << 5) - | ((rgba[i][GCOMP] & 0x7) << 2) - | ((rgba[i][RCOMP] & 0x3) ); - } - } - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - if (format == GL_RGB) { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x3) << 6) - | ((rgba[i][GCOMP] & 0x7) << 3) - | ((rgba[i][BCOMP] & 0x7) ); - } - } - else { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x3) << 6) - | ((rgba[i][GCOMP] & 0x7) << 3) - | ((rgba[i][RCOMP] & 0x7) ); - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5: - if (format == GL_RGB) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][BCOMP] & 0x1f) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][RCOMP] & 0x1f) ); - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - if (format == GL_RGB) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][RCOMP] & 0x1f) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][BCOMP] & 0x1f) ); - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xf) << 12) - | ((rgba[i][GCOMP] & 0xf) << 8) - | ((rgba[i][BCOMP] & 0xf) << 4) - | ((rgba[i][ACOMP] & 0xf) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0xf) << 12) - | ((rgba[i][GCOMP] & 0xf) << 8) - | ((rgba[i][RCOMP] & 0xf) << 4) - | ((rgba[i][ACOMP] & 0xf) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xf) << 12) - | ((rgba[i][BCOMP] & 0xf) << 8) - | ((rgba[i][GCOMP] & 0xf) << 4) - | ((rgba[i][RCOMP] & 0xf) ); - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xf) << 12) - | ((rgba[i][BCOMP] & 0xf) << 8) - | ((rgba[i][GCOMP] & 0xf) << 4) - | ((rgba[i][RCOMP] & 0xf) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xf) << 12) - | ((rgba[i][RCOMP] & 0xf) << 8) - | ((rgba[i][GCOMP] & 0xf) << 4) - | ((rgba[i][BCOMP] & 0xf) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xf) << 12) - | ((rgba[i][GCOMP] & 0xf) << 8) - | ((rgba[i][BCOMP] & 0xf) << 4) - | ((rgba[i][ACOMP] & 0xf) ); - } - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x1f) << 6) - | ((rgba[i][BCOMP] & 0x1f) << 1) - | ((rgba[i][ACOMP] & 0x1) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x1f) << 6) - | ((rgba[i][RCOMP] & 0x1f) << 1) - | ((rgba[i][ACOMP] & 0x1) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x1f) << 11) - | ((rgba[i][BCOMP] & 0x1f) << 6) - | ((rgba[i][GCOMP] & 0x1f) << 1) - | ((rgba[i][RCOMP] & 0x1) ); - } - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x1f) << 11) - | ((rgba[i][BCOMP] & 0x1f) << 6) - | ((rgba[i][GCOMP] & 0x1f) << 1) - | ((rgba[i][RCOMP] & 0x1) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x1f) << 11) - | ((rgba[i][RCOMP] & 0x1f) << 6) - | ((rgba[i][GCOMP] & 0x1f) << 1) - | ((rgba[i][BCOMP] & 0x1) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x1f) << 6) - | ((rgba[i][BCOMP] & 0x1f) << 1) - | ((rgba[i][ACOMP] & 0x1) ); - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xff) << 24) - | ((rgba[i][GCOMP] & 0xff) << 16) - | ((rgba[i][BCOMP] & 0xff) << 8) - | ((rgba[i][ACOMP] & 0xff) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0xff) << 24) - | ((rgba[i][GCOMP] & 0xff) << 16) - | ((rgba[i][RCOMP] & 0xff) << 8) - | ((rgba[i][ACOMP] & 0xff) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xff) << 24) - | ((rgba[i][BCOMP] & 0xff) << 16) - | ((rgba[i][GCOMP] & 0xff) << 8) - | ((rgba[i][RCOMP] & 0xff) ); - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xff) << 24) - | ((rgba[i][BCOMP] & 0xff) << 16) - | ((rgba[i][GCOMP] & 0xff) << 8) - | ((rgba[i][RCOMP] & 0xff) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xff) << 24) - | ((rgba[i][RCOMP] & 0xff) << 16) - | ((rgba[i][GCOMP] & 0xff) << 8) - | ((rgba[i][BCOMP] & 0xff) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xff) << 24) - | ((rgba[i][GCOMP] & 0xff) << 16) - | ((rgba[i][BCOMP] & 0xff) << 8) - | ((rgba[i][ACOMP] & 0xff) ); - } - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x3ff) << 22) - | ((rgba[i][GCOMP] & 0x3ff) << 12) - | ((rgba[i][BCOMP] & 0x3ff) << 2) - | ((rgba[i][ACOMP] & 0x3) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x3ff) << 22) - | ((rgba[i][GCOMP] & 0x3ff) << 12) - | ((rgba[i][RCOMP] & 0x3ff) << 2) - | ((rgba[i][ACOMP] & 0x3) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x3ff) << 22) - | ((rgba[i][BCOMP] & 0x3ff) << 12) - | ((rgba[i][GCOMP] & 0x3ff) << 2) - | ((rgba[i][RCOMP] & 0x3) ); - } - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x3ff) << 22) - | ((rgba[i][BCOMP] & 0x3ff) << 12) - | ((rgba[i][GCOMP] & 0x3ff) << 2) - | ((rgba[i][RCOMP] & 0x3) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x3ff) << 22) - | ((rgba[i][RCOMP] & 0x3ff) << 12) - | ((rgba[i][GCOMP] & 0x3ff) << 2) - | ((rgba[i][BCOMP] & 0x3) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x3ff) << 22) - | ((rgba[i][GCOMP] & 0x3ff) << 12) - | ((rgba[i][BCOMP] & 0x3ff) << 2) - | ((rgba[i][ACOMP] & 0x3) ); - } - } - break; - default: - _mesa_problem(ctx, "Bad type in pack_histogram"); - } - -#undef PACK_MACRO -} - - -/* - * Given an internalFormat token passed to glHistogram or glMinMax, - * return the corresponding base format. - * Return -1 if invalid token. - */ -static GLint -base_histogram_format( GLenum format ) -{ - switch (format) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return GL_ALPHA; - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return GL_LUMINANCE; - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return GL_LUMINANCE_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: - return GL_RGBA; - default: - return -1; /* error */ - } -} - - - /********************************************************************** * API functions */ @@ -627,62 +48,8 @@ static void GLAPIENTRY _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax"); - return; - } - - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinmax(target)"); - return; - } - - if (format != GL_RED && - format != GL_GREEN && - format != GL_BLUE && - format != GL_ALPHA && - format != GL_RGB && - format != GL_BGR && - format != GL_RGBA && - format != GL_BGRA && - format != GL_ABGR_EXT && - format != GL_LUMINANCE && - format != GL_LUMINANCE_ALPHA) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinMax(format)"); - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax(format or type)"); - return; - } - - values = _mesa_map_validate_pbo_dest(ctx, 1, &ctx->Pack, 2, 1, 1, - format, type, values, "glGetMinmax"); - if (!values) - return; - - { - GLfloat minmax[2][4]; - minmax[0][RCOMP] = CLAMP(ctx->MinMax.Min[RCOMP], 0.0F, 1.0F); - minmax[0][GCOMP] = CLAMP(ctx->MinMax.Min[GCOMP], 0.0F, 1.0F); - minmax[0][BCOMP] = CLAMP(ctx->MinMax.Min[BCOMP], 0.0F, 1.0F); - minmax[0][ACOMP] = CLAMP(ctx->MinMax.Min[ACOMP], 0.0F, 1.0F); - minmax[1][RCOMP] = CLAMP(ctx->MinMax.Max[RCOMP], 0.0F, 1.0F); - minmax[1][GCOMP] = CLAMP(ctx->MinMax.Max[GCOMP], 0.0F, 1.0F); - minmax[1][BCOMP] = CLAMP(ctx->MinMax.Max[BCOMP], 0.0F, 1.0F); - minmax[1][ACOMP] = CLAMP(ctx->MinMax.Max[ACOMP], 0.0F, 1.0F); - _mesa_pack_rgba_span_float(ctx, 2, minmax, - format, type, values, &ctx->Pack, 0x0); - } - - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); - - if (reset) { - _mesa_ResetMinmax(GL_MINMAX); - } + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax"); } @@ -690,59 +57,8 @@ static void GLAPIENTRY _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram"); - return; - } - - if (target != GL_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogram(target)"); - return; - } - - if (format != GL_RED && - format != GL_GREEN && - format != GL_BLUE && - format != GL_ALPHA && - format != GL_RGB && - format != GL_BGR && - format != GL_RGBA && - format != GL_BGRA && - format != GL_ABGR_EXT && - format != GL_LUMINANCE && - format != GL_LUMINANCE_ALPHA) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogram(format)"); - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram(format or type)"); - return; - } - values = _mesa_map_validate_pbo_dest(ctx, 1, &ctx->Pack, - ctx->Histogram.Width, 1, 1, - format, type, values, - "glGetHistogram"); - if (!values) - return; - - pack_histogram(ctx, ctx->Histogram.Width, - (CONST GLuint (*)[4]) ctx->Histogram.Count, - format, type, values, &ctx->Pack); - - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); - - if (reset) { - GLuint i; - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } - } + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram"); } @@ -750,46 +66,8 @@ static void GLAPIENTRY _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv"); - return; - } - if (target != GL_HISTOGRAM && target != GL_PROXY_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameterfv(target)"); - return; - } - - switch (pname) { - case GL_HISTOGRAM_WIDTH: - *params = (GLfloat) ctx->Histogram.Width; - break; - case GL_HISTOGRAM_FORMAT: - *params = (GLfloat) ctx->Histogram.Format; - break; - case GL_HISTOGRAM_RED_SIZE: - *params = (GLfloat) ctx->Histogram.RedSize; - break; - case GL_HISTOGRAM_GREEN_SIZE: - *params = (GLfloat) ctx->Histogram.GreenSize; - break; - case GL_HISTOGRAM_BLUE_SIZE: - *params = (GLfloat) ctx->Histogram.BlueSize; - break; - case GL_HISTOGRAM_ALPHA_SIZE: - *params = (GLfloat) ctx->Histogram.AlphaSize; - break; - case GL_HISTOGRAM_LUMINANCE_SIZE: - *params = (GLfloat) ctx->Histogram.LuminanceSize; - break; - case GL_HISTOGRAM_SINK: - *params = (GLfloat) ctx->Histogram.Sink; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameterfv(pname)"); - } + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv"); } @@ -797,46 +75,8 @@ static void GLAPIENTRY _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv"); - return; - } - if (target != GL_HISTOGRAM && target != GL_PROXY_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameteriv(target)"); - return; - } - - switch (pname) { - case GL_HISTOGRAM_WIDTH: - *params = (GLint) ctx->Histogram.Width; - break; - case GL_HISTOGRAM_FORMAT: - *params = (GLint) ctx->Histogram.Format; - break; - case GL_HISTOGRAM_RED_SIZE: - *params = (GLint) ctx->Histogram.RedSize; - break; - case GL_HISTOGRAM_GREEN_SIZE: - *params = (GLint) ctx->Histogram.GreenSize; - break; - case GL_HISTOGRAM_BLUE_SIZE: - *params = (GLint) ctx->Histogram.BlueSize; - break; - case GL_HISTOGRAM_ALPHA_SIZE: - *params = (GLint) ctx->Histogram.AlphaSize; - break; - case GL_HISTOGRAM_LUMINANCE_SIZE: - *params = (GLint) ctx->Histogram.LuminanceSize; - break; - case GL_HISTOGRAM_SINK: - *params = (GLint) ctx->Histogram.Sink; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameteriv(pname)"); - } + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv"); } @@ -844,25 +84,8 @@ static void GLAPIENTRY _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv"); - return; - } - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinmaxParameterfv(target)"); - return; - } - if (pname == GL_MINMAX_FORMAT) { - *params = (GLfloat) ctx->MinMax.Format; - } - else if (pname == GL_MINMAX_SINK) { - *params = (GLfloat) ctx->MinMax.Sink; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinMaxParameterfv(pname)"); - } } @@ -870,108 +93,17 @@ static void GLAPIENTRY _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv"); - return; - } - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinmaxParameteriv(target)"); - return; - } - if (pname == GL_MINMAX_FORMAT) { - *params = (GLint) ctx->MinMax.Format; - } - else if (pname == GL_MINMAX_SINK) { - *params = (GLint) ctx->MinMax.Sink; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinMaxParameteriv(pname)"); - } + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv"); } static void GLAPIENTRY _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) { - GLuint i; - GLboolean error = GL_FALSE; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram"); - return; - } - if (target != GL_HISTOGRAM && target != GL_PROXY_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHistogram(target)"); - return; - } - - if (width < 0 || width > HISTOGRAM_TABLE_SIZE) { - if (target == GL_PROXY_HISTOGRAM) { - error = GL_TRUE; - } - else { - if (width < 0) - _mesa_error(ctx, GL_INVALID_VALUE, "glHistogram(width)"); - else - _mesa_error(ctx, GL_TABLE_TOO_LARGE, "glHistogram(width)"); - return; - } - } - - if (width != 0 && !_mesa_is_pow_two(width)) { - if (target == GL_PROXY_HISTOGRAM) { - error = GL_TRUE; - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, "glHistogram(width)"); - return; - } - } - - if (base_histogram_format(internalFormat) < 0) { - if (target == GL_PROXY_HISTOGRAM) { - error = GL_TRUE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glHistogram(internalFormat)"); - return; - } - } - - FLUSH_VERTICES(ctx, _NEW_PIXEL); - - /* reset histograms */ - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } - - if (error) { - ctx->Histogram.Width = 0; - ctx->Histogram.Format = 0; - ctx->Histogram.RedSize = 0; - ctx->Histogram.GreenSize = 0; - ctx->Histogram.BlueSize = 0; - ctx->Histogram.AlphaSize = 0; - ctx->Histogram.LuminanceSize = 0; - } - else { - ctx->Histogram.Width = width; - ctx->Histogram.Format = internalFormat; - ctx->Histogram.Sink = sink; - ctx->Histogram.RedSize = 8 * sizeof(GLuint); - ctx->Histogram.GreenSize = 8 * sizeof(GLuint); - ctx->Histogram.BlueSize = 8 * sizeof(GLuint); - ctx->Histogram.AlphaSize = 8 * sizeof(GLuint); - ctx->Histogram.LuminanceSize = 8 * sizeof(GLuint); - } + _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram"); } @@ -979,53 +111,17 @@ static void GLAPIENTRY _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax"); - return; - } - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glMinMax(target)"); - return; - } - - if (base_histogram_format(internalFormat) < 0) { - _mesa_error(ctx, GL_INVALID_ENUM, "glMinMax(internalFormat)"); - return; - } - - if (ctx->MinMax.Sink == sink) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->MinMax.Sink = sink; + _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax"); } static void GLAPIENTRY _mesa_ResetHistogram(GLenum target) { - GLuint i; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram"); - return; - } - - if (target != GL_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glResetHistogram(target)"); - return; - } - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } + _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram"); } @@ -1033,22 +129,8 @@ static void GLAPIENTRY _mesa_ResetMinmax(GLenum target) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.EXT_histogram) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax"); - return; - } - - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glResetMinMax(target)"); - return; - } - - ctx->MinMax.Min[RCOMP] = 1000; ctx->MinMax.Max[RCOMP] = -1000; - ctx->MinMax.Min[GCOMP] = 1000; ctx->MinMax.Max[GCOMP] = -1000; - ctx->MinMax.Min[BCOMP] = 1000; ctx->MinMax.Max[BCOMP] = -1000; - ctx->MinMax.Min[ACOMP] = 1000; ctx->MinMax.Max[ACOMP] = -1000; + _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax"); } @@ -1067,39 +149,4 @@ _mesa_init_histogram_dispatch(struct _glapi_table *disp) SET_ResetMinmax(disp, _mesa_ResetMinmax); } - #endif /* FEATURE_histogram */ - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -void _mesa_init_histogram( GLcontext * ctx ) -{ - int i; - - /* Histogram group */ - ctx->Histogram.Width = 0; - ctx->Histogram.Format = GL_RGBA; - ctx->Histogram.Sink = GL_FALSE; - ctx->Histogram.RedSize = 0; - ctx->Histogram.GreenSize = 0; - ctx->Histogram.BlueSize = 0; - ctx->Histogram.AlphaSize = 0; - ctx->Histogram.LuminanceSize = 0; - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } - - /* Min/Max group */ - ctx->MinMax.Format = GL_RGBA; - ctx->MinMax.Sink = GL_FALSE; - ctx->MinMax.Min[RCOMP] = 1000; ctx->MinMax.Max[RCOMP] = -1000; - ctx->MinMax.Min[GCOMP] = 1000; ctx->MinMax.Max[GCOMP] = -1000; - ctx->MinMax.Min[BCOMP] = 1000; ctx->MinMax.Max[BCOMP] = -1000; - ctx->MinMax.Min[ACOMP] = 1000; ctx->MinMax.Max[ACOMP] = -1000; -} diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index dbae1bbd06..240087141b 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -52,6 +52,4 @@ _mesa_init_histogram_dispatch(struct _glapi_table *disp) #endif /* FEATURE_histogram */ -extern void _mesa_init_histogram( GLcontext * ctx ); - #endif /* HISTOGRAM_H */ diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 86aa6d0d70..453611d00b 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1876,69 +1876,6 @@ _mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n, } } - - -/* - * Update the min/max values from an array of fragment colors. - */ -static void -update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - /* update mins */ - if (rgba[i][RCOMP] < ctx->MinMax.Min[RCOMP]) - ctx->MinMax.Min[RCOMP] = rgba[i][RCOMP]; - if (rgba[i][GCOMP] < ctx->MinMax.Min[GCOMP]) - ctx->MinMax.Min[GCOMP] = rgba[i][GCOMP]; - if (rgba[i][BCOMP] < ctx->MinMax.Min[BCOMP]) - ctx->MinMax.Min[BCOMP] = rgba[i][BCOMP]; - if (rgba[i][ACOMP] < ctx->MinMax.Min[ACOMP]) - ctx->MinMax.Min[ACOMP] = rgba[i][ACOMP]; - - /* update maxs */ - if (rgba[i][RCOMP] > ctx->MinMax.Max[RCOMP]) - ctx->MinMax.Max[RCOMP] = rgba[i][RCOMP]; - if (rgba[i][GCOMP] > ctx->MinMax.Max[GCOMP]) - ctx->MinMax.Max[GCOMP] = rgba[i][GCOMP]; - if (rgba[i][BCOMP] > ctx->MinMax.Max[BCOMP]) - ctx->MinMax.Max[BCOMP] = rgba[i][BCOMP]; - if (rgba[i][ACOMP] > ctx->MinMax.Max[ACOMP]) - ctx->MinMax.Max[ACOMP] = rgba[i][ACOMP]; - } -} - - -/* - * Update the histogram values from an array of fragment colors. - */ -static void -update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) -{ - const GLint max = ctx->Histogram.Width - 1; - GLfloat w = (GLfloat) max; - GLuint i; - - if (ctx->Histogram.Width == 0) - return; - - for (i = 0; i < n; i++) { - GLint ri = IROUND(rgba[i][RCOMP] * w); - GLint gi = IROUND(rgba[i][GCOMP] * w); - GLint bi = IROUND(rgba[i][BCOMP] * w); - GLint ai = IROUND(rgba[i][ACOMP] * w); - ri = CLAMP(ri, 0, max); - gi = CLAMP(gi, 0, max); - bi = CLAMP(bi, 0, max); - ai = CLAMP(ai, 0, max); - ctx->Histogram.Count[ri][RCOMP]++; - ctx->Histogram.Count[gi][GCOMP]++; - ctx->Histogram.Count[bi][BCOMP]++; - ctx->Histogram.Count[ai][ACOMP]++; - } -} - - /** * Apply various pixel transfer operations to an array of RGBA pixels * as indicated by the transferOps bitmask @@ -1992,14 +1929,6 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, if (transferOps & IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT) { _mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX], n, rgba); } - /* update histogram count */ - if (transferOps & IMAGE_HISTOGRAM_BIT) { - update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba); - } - /* update min/max values */ - if (transferOps & IMAGE_MIN_MAX_BIT) { - update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba); - } /* clamping to [0,1] */ if (transferOps & IMAGE_CLAMP_BIT) { GLuint i; @@ -2132,9 +2061,6 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], if (transferOps) { _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba); - if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) { - return; - } } if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 92311ef7f0..9b9b6d0420 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -100,7 +100,6 @@ #define FEATURE_drawpix FEATURE_GL #define FEATURE_evaluators FEATURE_GL #define FEATURE_feedback FEATURE_GL -#define FEATURE_histogram FEATURE_GL #define FEATURE_pixel_transfer FEATURE_GL #define FEATURE_queryobj FEATURE_GL #define FEATURE_rastpos FEATURE_GL diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 0bb8734e4b..d918482353 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -811,34 +811,6 @@ struct gl_hint_attrib }; -/** - * Histogram attributes. - */ -struct gl_histogram_attrib -{ - GLuint Width; /**< number of table entries */ - GLint Format; /**< GL_ALPHA, GL_RGB, etc */ - GLuint Count[HISTOGRAM_TABLE_SIZE][4]; /**< the histogram */ - GLboolean Sink; /**< terminate image transfer? */ - GLubyte RedSize; /**< Bits per counter */ - GLubyte GreenSize; - GLubyte BlueSize; - GLubyte AlphaSize; - GLubyte LuminanceSize; -}; - - -/** - * Color Min/max state. - */ -struct gl_minmax_attrib -{ - GLenum Format; - GLboolean Sink; - GLfloat Min[4], Max[4]; /**< RGBA */ -}; - - /** * Image convolution state. */ @@ -1013,11 +985,6 @@ struct gl_pixel_attrib GLfloat PostColorMatrixScale[4]; /**< RGBA */ GLfloat PostColorMatrixBias[4]; /**< RGBA */ - /* Histogram & minmax (GL_EXT_histogram) */ - /* Note: histogram and minmax data are not part of this attrib group */ - GLboolean HistogramEnabled; - GLboolean MinMaxEnabled; - /*--- End Pixel Transfer State ---*/ /** glPixelZoom */ @@ -2717,7 +2684,6 @@ struct gl_extensions GLboolean EXT_framebuffer_object; GLboolean EXT_framebuffer_sRGB; GLboolean EXT_gpu_program_parameters; - GLboolean EXT_histogram; GLboolean EXT_multi_draw_arrays; GLboolean EXT_paletted_texture; GLboolean EXT_packed_depth_stencil; @@ -2831,8 +2797,6 @@ struct gl_matrix_stack #define IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT 0x40 #define IMAGE_COLOR_MATRIX_BIT 0x80 #define IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT 0x100 -#define IMAGE_HISTOGRAM_BIT 0x200 -#define IMAGE_MIN_MAX_BIT 0x400 #define IMAGE_CLAMP_BIT 0x800 @@ -2846,9 +2810,7 @@ struct gl_matrix_stack #define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \ IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT | \ IMAGE_COLOR_MATRIX_BIT | \ - IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT |\ - IMAGE_HISTOGRAM_BIT | \ - IMAGE_MIN_MAX_BIT) + IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT) /*@}*/ @@ -3206,8 +3168,6 @@ struct __GLcontextRec /** \name Other assorted state (not pushed/popped on attribute stack) */ /*@{*/ struct gl_pixelmaps PixelMaps; - struct gl_histogram_attrib Histogram; - struct gl_minmax_attrib MinMax; struct gl_convolution_attrib Convolution1D; struct gl_convolution_attrib Convolution2D; struct gl_convolution_attrib Separable2D; diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 675e933ca6..980c40550c 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -738,12 +738,6 @@ update_image_transfer_state(GLcontext *ctx) if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]) mask |= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT; - if (ctx->Pixel.HistogramEnabled) - mask |= IMAGE_HISTOGRAM_BIT; - - if (ctx->Pixel.MinMaxEnabled) - mask |= IMAGE_MIN_MAX_BIT; - ctx->_ImageTransferState = mask; } @@ -829,8 +823,6 @@ _mesa_init_pixel( GLcontext *ctx ) init_pixelmap(&ctx->PixelMaps.GtoG); init_pixelmap(&ctx->PixelMaps.BtoB); init_pixelmap(&ctx->PixelMaps.AtoA); - ctx->Pixel.HistogramEnabled = GL_FALSE; - ctx->Pixel.MinMaxEnabled = GL_FALSE; ASSIGN_4V(ctx->Pixel.PostColorMatrixScale, 1.0, 1.0, 1.0, 1.0); ASSIGN_4V(ctx->Pixel.PostColorMatrixBias, 0.0, 0.0, 0.0, 0.0); for (i = 0; i < COLORTABLE_MAX; i++) { diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index f4f0c8a330..a9b4cb8081 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -103,8 +103,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; const GLbitfield transferOps = ctx->_ImageTransferState; - const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) - || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink); GLfloat *dest, *tmpImage, *convImage; SWspan span; @@ -160,30 +158,28 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, width, rgba); } - if (!sink) { - /* write the new image */ - for (row = 0; row < height; row++) { - const GLfloat *src = convImage + row * width * 4; - GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; + /* write the new image */ + for (row = 0; row < height; row++) { + const GLfloat *src = convImage + row * width * 4; + GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; - /* copy convolved colors into span array */ - memcpy(rgba, src, width * 4 * sizeof(GLfloat)); + /* copy convolved colors into span array */ + memcpy(rgba, src, width * 4 * sizeof(GLfloat)); - /* write span */ - span.x = destx; - span.y = desty + row; - span.end = width; - span.array->ChanType = GL_FLOAT; - if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); - } + /* write span */ + span.x = destx; + span.y = desty + row; + span.end = width; + span.array->ChanType = GL_FLOAT; + if (zoom) { + _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba); + } + else { + _swrast_write_rgba_span(ctx, &span); } - /* restore this */ - span.array->ChanType = CHAN_TYPE; } + /* restore this */ + span.array->ChanType = CHAN_TYPE; free(convImage); } diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 3cec3a7a2b..9bc0e9043b 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -551,8 +551,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, * General solution */ { - const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) - || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink); const GLbitfield interpMask = span.interpMask; const GLbitfield arrayMask = span.arrayMask; const GLint srcStride @@ -575,24 +573,21 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, _mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba, format, type, source, unpack, transferOps); - /* draw the span */ - if (!sink) { - /* Set these for each row since the _swrast_write_* functions - * may change them while clipping/rendering. - */ - span.array->ChanType = GL_FLOAT; - span.x = x + skipPixels; - span.y = y + row; - span.end = spanWidth; - span.arrayMask = arrayMask; - span.interpMask = interpMask; - if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); - } - } + /* Set these for each row since the _swrast_write_* functions + * may change them while clipping/rendering. + */ + span.array->ChanType = GL_FLOAT; + span.x = x + skipPixels; + span.y = y + row; + span.end = spanWidth; + span.arrayMask = arrayMask; + span.interpMask = interpMask; + if (zoom) { + _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba); + } + else { + _swrast_write_rgba_span(ctx, &span); + } source += srcStride; } /* for row */ -- cgit v1.2.3 From 6c227e57e69158e4da40c69322db0eac4c31086c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Sep 2010 16:25:17 -0700 Subject: mesa: Remove SGI_color_table. Another optional ARB_imaging subset extension. --- src/mesa/main/attrib.c | 13 --- src/mesa/main/colortab.c | 204 +-------------------------------------------- src/mesa/main/colortab.h | 7 -- src/mesa/main/context.c | 2 - src/mesa/main/enable.c | 34 +------- src/mesa/main/extensions.c | 3 - src/mesa/main/get.c | 12 --- src/mesa/main/image.c | 12 --- src/mesa/main/mtypes.h | 19 +---- src/mesa/main/pixel.c | 14 ---- 10 files changed, 4 insertions(+), 316 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 9a8917fc89..73c2375f9d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -69,7 +69,6 @@ struct gl_enable_attrib GLboolean Blend; GLbitfield ClipPlanes; GLboolean ColorMaterial; - GLboolean ColorTable[COLORTABLE_MAX]; GLboolean Convolution1D; GLboolean Convolution2D; GLboolean Separable2D; @@ -260,9 +259,6 @@ _mesa_PushAttrib(GLbitfield mask) attr->Blend = ctx->Color.BlendEnabled; attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled; attr->ColorMaterial = ctx->Light.ColorMaterialEnabled; - for (i = 0; i < COLORTABLE_MAX; i++) { - attr->ColorTable[i] = ctx->Pixel.ColorTableEnabled[i]; - } attr->Convolution1D = ctx->Pixel.Convolution1DEnabled; attr->Convolution2D = ctx->Pixel.Convolution2DEnabled; attr->Separable2D = ctx->Pixel.Separable2DEnabled; @@ -515,15 +511,6 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL); - TEST_AND_UPDATE(ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION], - enable->ColorTable[COLORTABLE_PRECONVOLUTION], - GL_COLOR_TABLE); - TEST_AND_UPDATE(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION], - enable->ColorTable[COLORTABLE_POSTCONVOLUTION], - GL_POST_CONVOLUTION_COLOR_TABLE); - TEST_AND_UPDATE(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX], - enable->ColorTable[COLORTABLE_POSTCOLORMATRIX], - GL_POST_COLOR_MATRIX_COLOR_TABLE); TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE); TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp, GL_DEPTH_CLAMP); diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 52d5badf39..5c2697d40a 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -297,15 +297,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - break; - case GL_PROXY_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_PRECONVOLUTION]; - proxy = GL_TRUE; - break; case GL_TEXTURE_COLOR_TABLE_SGI: if (!ctx->Extensions.SGI_texture_color_table) { _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); @@ -323,24 +314,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, table = &(texUnit->ProxyColorTable); proxy = GL_TRUE; break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCONVOLUTION]; - proxy = GL_TRUE; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]; - break; - case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCOLORMATRIX]; - proxy = GL_TRUE; - break; default: /* try texture targets */ { @@ -459,11 +432,6 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - break; case GL_TEXTURE_COLOR_TABLE_SGI: if (!ctx->Extensions.SGI_texture_color_table) { _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); @@ -473,16 +441,6 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, scale = ctx->Pixel.TextureColorTableScale; bias = ctx->Pixel.TextureColorTableBias; break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]; - break; default: /* try texture targets */ texObj = _mesa_select_tex_object(ctx, texUnit, target); @@ -590,9 +548,6 @@ _mesa_GetColorTable( GLenum target, GLenum format, case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - break; case GL_TEXTURE_COLOR_TABLE_SGI: if (!ctx->Extensions.SGI_texture_color_table) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); @@ -600,12 +555,6 @@ _mesa_GetColorTable( GLenum target, GLenum format, } table = &(texUnit->ColorTable); break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - break; default: /* try texture targets */ { @@ -714,22 +663,10 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); switch (target) { - case GL_COLOR_TABLE_SGI: - scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - break; case GL_TEXTURE_COLOR_TABLE_SGI: scale = ctx->Pixel.TextureColorTableScale; bias = ctx->Pixel.TextureColorTableBias; break; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]; - break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameter(target)"); return; @@ -755,10 +692,7 @@ static void GLAPIENTRY _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { GLfloat fparams[4]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI) { + if (pname == GL_TEXTURE_COLOR_TABLE_SGI) { /* four values */ fparams[0] = (GLfloat) params[0]; fparams[1] = (GLfloat) params[1]; @@ -786,20 +720,6 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]); - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]); - return; - } - break; - case GL_PROXY_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_PRECONVOLUTION]; - break; case GL_TEXTURE_COLOR_TABLE_SGI: if (!ctx->Extensions.SGI_texture_color_table) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); @@ -822,34 +742,6 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) } table = &(texUnit->ProxyColorTable); break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]); - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]); - return; - } - break; - case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]); - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]); - return; - } - break; - case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCOLORMATRIX]; - break; default: /* try texture targets */ { @@ -913,28 +805,6 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - GLfloat *scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - params[0] = (GLint) scale[0]; - params[1] = (GLint) scale[1]; - params[2] = (GLint) scale[2]; - params[3] = (GLint) scale[3]; - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - GLfloat *bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - params[0] = (GLint) bias[0]; - params[1] = (GLint) bias[1]; - params[2] = (GLint) bias[2]; - params[3] = (GLint) bias[3]; - return; - } - break; - case GL_PROXY_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_PRECONVOLUTION]; - break; case GL_TEXTURE_COLOR_TABLE_SGI: if (!ctx->Extensions.SGI_texture_color_table) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); @@ -963,50 +833,6 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) } table = &(texUnit->ProxyColorTable); break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - GLfloat *scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - params[0] = (GLint) scale[0]; - params[1] = (GLint) scale[1]; - params[2] = (GLint) scale[2]; - params[3] = (GLint) scale[3]; - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - GLfloat *bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - params[0] = (GLint) bias[0]; - params[1] = (GLint) bias[1]; - params[2] = (GLint) bias[2]; - params[3] = (GLint) bias[3]; - return; - } - break; - case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - GLfloat *scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - params[0] = (GLint) scale[0]; - params[0] = (GLint) scale[1]; - params[0] = (GLint) scale[2]; - params[0] = (GLint) scale[3]; - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - GLfloat *bias = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - params[0] = (GLint) bias[0]; - params[1] = (GLint) bias[1]; - params[2] = (GLint) bias[2]; - params[3] = (GLint) bias[3]; - return; - } - break; - case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCOLORMATRIX]; - break; default: /* Try texture targets */ { @@ -1103,31 +929,3 @@ _mesa_free_colortable_data( struct gl_color_table *p ) p->TableUB = NULL; } } - - -/* - * Initialize all colortables for a context. - */ -void -_mesa_init_colortables( GLcontext * ctx ) -{ - GLuint i; - for (i = 0; i < COLORTABLE_MAX; i++) { - _mesa_init_colortable(&ctx->ColorTable[i]); - _mesa_init_colortable(&ctx->ProxyColorTable[i]); - } -} - - -/* - * Free all colortable data for a context - */ -void -_mesa_free_colortables_data( GLcontext *ctx ) -{ - GLuint i; - for (i = 0; i < COLORTABLE_MAX; i++) { - _mesa_free_colortable_data(&ctx->ColorTable[i]); - _mesa_free_colortable_data(&ctx->ProxyColorTable[i]); - } -} diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index 303c9fb302..ea3ec870fd 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -78,11 +78,4 @@ _mesa_init_colortable( struct gl_color_table *table ); extern void _mesa_free_colortable_data( struct gl_color_table *table ); -extern void -_mesa_init_colortables( GLcontext *ctx ); - -extern void -_mesa_free_colortables_data( GLcontext *ctx ); - - #endif /* COLORTAB_H */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 6f2ffe107d..774553ccce 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -728,7 +728,6 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_attrib( ctx ); _mesa_init_buffer_objects( ctx ); _mesa_init_color( ctx ); - _mesa_init_colortables( ctx ); _mesa_init_current( ctx ); _mesa_init_depth( ctx ); _mesa_init_debug( ctx ); @@ -1105,7 +1104,6 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); - _mesa_free_colortables_data( ctx ); _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); _mesa_free_queryobj_data(ctx); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index b0eb294df4..2c8c000f9f 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -703,28 +703,7 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) client_state( ctx, cap, state ); return; - /* GL_SGI_color_table */ - case GL_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table, cap); - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION] == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION] = state; - break; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table, cap); - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION] == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION] = state; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table, cap); - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX] == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX] = state; - break; + /* GL_SGI_texture_color_table */ case GL_TEXTURE_COLOR_TABLE_SGI: CHECK_EXTENSION(SGI_texture_color_table, cap); if (ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled == state) @@ -1343,17 +1322,6 @@ _mesa_IsEnabled( GLenum cap ) return (ctx->Array.ArrayObj->PointSize.Enabled != 0); #endif - /* GL_SGI_color_table */ - case GL_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table); - return ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table); - return ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table); - return ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]; - /* GL_SGI_texture_color_table */ case GL_TEXTURE_COLOR_TABLE_SGI: CHECK_EXTENSION(SGI_texture_color_table); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 33599136b4..3e4801030d 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -207,7 +207,6 @@ static const struct { { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) }, { ON, "GL_OES_read_format", F(OES_read_format) }, { OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) }, - { OFF, "GL_SGI_color_table", F(SGI_color_table) }, { OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) }, { OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, @@ -368,7 +367,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.NV_fragment_program_option = GL_TRUE; #endif ctx->Extensions.SGI_color_matrix = GL_TRUE; - ctx->Extensions.SGI_color_table = GL_TRUE; ctx->Extensions.SGI_texture_color_table = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; @@ -399,7 +397,6 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_convolution = GL_TRUE; ctx->Extensions.SGI_color_matrix = GL_TRUE; - ctx->Extensions.SGI_color_table = GL_TRUE; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index f04f42022d..bb2ce759d3 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -277,7 +277,6 @@ EXTRA_EXT(NV_texture_rectangle); EXTRA_EXT(EXT_stencil_two_side); EXTRA_EXT(NV_light_max_exponent); EXTRA_EXT(EXT_convolution); -EXTRA_EXT(SGI_color_table); EXTRA_EXT(SGI_texture_color_table); EXTRA_EXT(EXT_depth_bounds_test); EXTRA_EXT(ARB_depth_clamp); @@ -937,17 +936,6 @@ static const struct value_desc values[] = { CONTEXT_FLOAT(Pixel.PostConvolutionBias[3]), extra_EXT_convolution }, - /* GL_SGI_color_table */ - { GL_COLOR_TABLE_SGI, - CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]), - extra_SGI_color_table }, - { GL_POST_CONVOLUTION_COLOR_TABLE_SGI, - CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]), - extra_SGI_color_table }, - { GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI, - CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]), - extra_SGI_color_table }, - /* GL_SGI_texture_color_table */ { GL_TEXTURE_COLOR_TABLE_SGI, LOC_TEXUNIT, TYPE_BOOLEAN, offsetof(struct gl_texture_unit, ColorTableEnabled), diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 453611d00b..7918ef7926 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1896,10 +1896,6 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, if (transferOps & IMAGE_MAP_COLOR_BIT) { _mesa_map_rgba( ctx, n, rgba ); } - /* GL_COLOR_TABLE lookup */ - if (transferOps & IMAGE_COLOR_TABLE_BIT) { - _mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_PRECONVOLUTION], n, rgba); - } /* convolution */ if (transferOps & IMAGE_CONVOLUTION_BIT) { /* this has to be done in the calling code */ @@ -1917,18 +1913,10 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, ctx->Pixel.PostConvolutionBias[BCOMP], ctx->Pixel.PostConvolutionBias[ACOMP]); } - /* GL_POST_CONVOLUTION_COLOR_TABLE lookup */ - if (transferOps & IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT) { - _mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_POSTCONVOLUTION], n, rgba); - } /* color matrix transform */ if (transferOps & IMAGE_COLOR_MATRIX_BIT) { _mesa_transform_rgba(ctx, n, rgba); } - /* GL_POST_COLOR_MATRIX_COLOR_TABLE lookup */ - if (transferOps & IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT) { - _mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX], n, rgba); - } /* clamping to [0,1] */ if (transferOps & IMAGE_CLAMP_BIT) { GLuint i; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d918482353..9718732608 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -964,11 +964,6 @@ struct gl_pixel_attrib GLboolean MapColorFlag; GLboolean MapStencilFlag; - /* There are multiple color table stages: */ - GLboolean ColorTableEnabled[COLORTABLE_MAX]; - GLfloat ColorTableScale[COLORTABLE_MAX][4]; /**< RGBA */ - GLfloat ColorTableBias[COLORTABLE_MAX][4]; /**< RGBA */ - /* Convolution (GL_EXT_convolution) */ GLboolean Convolution1DEnabled; GLboolean Convolution2DEnabled; @@ -2754,7 +2749,6 @@ struct gl_extensions GLboolean NV_vertex_program1_1; GLboolean OES_read_format; GLboolean SGI_color_matrix; - GLboolean SGI_color_table; GLboolean SGI_texture_color_table; GLboolean SGIS_generate_mipmap; GLboolean SGIS_texture_edge_clamp; @@ -2791,26 +2785,20 @@ struct gl_matrix_stack #define IMAGE_SCALE_BIAS_BIT 0x1 #define IMAGE_SHIFT_OFFSET_BIT 0x2 #define IMAGE_MAP_COLOR_BIT 0x4 -#define IMAGE_COLOR_TABLE_BIT 0x8 #define IMAGE_CONVOLUTION_BIT 0x10 #define IMAGE_POST_CONVOLUTION_SCALE_BIAS 0x20 -#define IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT 0x40 #define IMAGE_COLOR_MATRIX_BIT 0x80 -#define IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT 0x100 #define IMAGE_CLAMP_BIT 0x800 /** Pixel Transfer ops up to convolution */ #define IMAGE_PRE_CONVOLUTION_BITS (IMAGE_SCALE_BIAS_BIT | \ IMAGE_SHIFT_OFFSET_BIT | \ - IMAGE_MAP_COLOR_BIT | \ - IMAGE_COLOR_TABLE_BIT) + IMAGE_MAP_COLOR_BIT) /** Pixel transfer ops after convolution */ #define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \ - IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT | \ - IMAGE_COLOR_MATRIX_BIT | \ - IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT) + IMAGE_COLOR_MATRIX_BIT) /*@}*/ @@ -3176,9 +3164,6 @@ struct __GLcontextRec struct gl_feedback Feedback; /**< Feedback */ struct gl_selection Select; /**< Selection */ - struct gl_color_table ColorTable[COLORTABLE_MAX]; - struct gl_color_table ProxyColorTable[COLORTABLE_MAX]; - struct gl_program_state Program; /**< general program state */ struct gl_vertex_program_state VertexProgram; struct gl_fragment_program_state FragmentProgram; diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 980c40550c..834a41108c 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -702,9 +702,6 @@ update_image_transfer_state(GLcontext *ctx) if (ctx->Pixel.MapColorFlag) mask |= IMAGE_MAP_COLOR_BIT; - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]) - mask |= IMAGE_COLOR_TABLE_BIT; - if (ctx->Pixel.Convolution1DEnabled || ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { @@ -721,9 +718,6 @@ update_image_transfer_state(GLcontext *ctx) } } - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]) - mask |= IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT; - if (ctx->ColorMatrixStack.Top->type != MATRIX_IDENTITY || ctx->Pixel.PostColorMatrixScale[0] != 1.0F || ctx->Pixel.PostColorMatrixBias[0] != 0.0F || @@ -735,9 +729,6 @@ update_image_transfer_state(GLcontext *ctx) ctx->Pixel.PostColorMatrixBias[3] != 0.0F) mask |= IMAGE_COLOR_MATRIX_BIT; - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]) - mask |= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT; - ctx->_ImageTransferState = mask; } @@ -825,11 +816,6 @@ _mesa_init_pixel( GLcontext *ctx ) init_pixelmap(&ctx->PixelMaps.AtoA); ASSIGN_4V(ctx->Pixel.PostColorMatrixScale, 1.0, 1.0, 1.0, 1.0); ASSIGN_4V(ctx->Pixel.PostColorMatrixBias, 0.0, 0.0, 0.0, 0.0); - for (i = 0; i < COLORTABLE_MAX; i++) { - ASSIGN_4V(ctx->Pixel.ColorTableScale[i], 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.ColorTableBias[i], 0.0, 0.0, 0.0, 0.0); - ctx->Pixel.ColorTableEnabled[i] = GL_FALSE; - } ctx->Pixel.Convolution1DEnabled = GL_FALSE; ctx->Pixel.Convolution2DEnabled = GL_FALSE; ctx->Pixel.Separable2DEnabled = GL_FALSE; -- cgit v1.2.3 From 73578ba9c4938db3a23198c3a2ddf843cfc4f700 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Sep 2010 16:58:48 -0700 Subject: mesa: Remove SGI_color_matrix. Another optional ARB_imaging subset extension. --- src/mesa/drivers/dri/i965/brw_state_upload.c | 1 - src/mesa/main/context.c | 2 - src/mesa/main/debug.c | 3 +- src/mesa/main/dlist.c | 2 - src/mesa/main/extensions.c | 3 - src/mesa/main/get.c | 25 ----- src/mesa/main/image.c | 34 ------- src/mesa/main/image.h | 5 - src/mesa/main/matrix.c | 6 -- src/mesa/main/mtypes.h | 25 +---- src/mesa/main/pixel.c | 66 ------------- src/mesa/main/querymatrix.c | 4 - src/mesa/program/prog_statevars.c | 29 ------ src/mesa/program/prog_statevars.h | 3 - src/mesa/state_tracker/st_atom_pixeltransfer.c | 130 +------------------------ src/mesa/state_tracker/st_extensions.c | 1 - 16 files changed, 5 insertions(+), 334 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index a0c130557e..e4f36a7ec3 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -231,7 +231,6 @@ static struct dirty_bit_map mesa_bits[] = { DEFINE_BIT(_NEW_MODELVIEW), DEFINE_BIT(_NEW_PROJECTION), DEFINE_BIT(_NEW_TEXTURE_MATRIX), - DEFINE_BIT(_NEW_COLOR_MATRIX), DEFINE_BIT(_NEW_ACCUM), DEFINE_BIT(_NEW_COLOR), DEFINE_BIT(_NEW_DEPTH), diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 774553ccce..87285683f8 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -341,7 +341,6 @@ static void dummy_enum_func(void) { gl_buffer_index bi = BUFFER_FRONT_LEFT; - gl_colortable_index ci = COLORTABLE_PRECONVOLUTION; gl_face_index fi = FACE_POS_X; gl_frag_attrib fa = FRAG_ATTRIB_WPOS; gl_frag_result fr = FRAG_RESULT_DEPTH; @@ -352,7 +351,6 @@ dummy_enum_func(void) gl_geom_result gr = GEOM_RESULT_POS; (void) bi; - (void) ci; (void) fi; (void) fa; (void) fr; diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 526145aecc..4205c7a4b7 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -85,13 +85,12 @@ void _mesa_print_state( const char *msg, GLuint state ) { _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", msg, state, (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "", (state & _NEW_PROJECTION) ? "ctx->Projection, " : "", (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "", - (state & _NEW_COLOR_MATRIX) ? "ctx->ColorMatrix, " : "", (state & _NEW_ACCUM) ? "ctx->Accum, " : "", (state & _NEW_COLOR) ? "ctx->Color, " : "", (state & _NEW_DEPTH) ? "ctx->Depth, " : "", diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index d847d4d5d3..3a730f0e40 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1552,7 +1552,6 @@ save_ColorTableParameterfv(GLenum target, GLenum pname, n[3].f = params[0]; if (pname == GL_COLOR_TABLE_SGI || pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI || pname == GL_TEXTURE_COLOR_TABLE_SGI) { n[4].f = params[1]; n[5].f = params[2]; @@ -1581,7 +1580,6 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) n[3].i = params[0]; if (pname == GL_COLOR_TABLE_SGI || pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI || pname == GL_TEXTURE_COLOR_TABLE_SGI) { n[4].i = params[1]; n[5].i = params[2]; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 3e4801030d..3f86973e3e 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -206,7 +206,6 @@ static const struct { { 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_color_matrix", F(SGI_color_matrix) }, { OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) }, { OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, @@ -366,7 +365,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program ctx->Extensions.NV_fragment_program_option = GL_TRUE; #endif - ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGI_texture_color_table = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; @@ -396,7 +394,6 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_convolution = GL_TRUE; - ctx->Extensions.SGI_color_matrix = GL_TRUE; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index bb2ce759d3..33ea81b83a 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -874,36 +874,12 @@ static const struct value_desc values[] = { extra_EXT_compiled_vertex_array }, /* GL_ARB_transpose_matrix */ - { GL_TRANSPOSE_COLOR_MATRIX_ARB, CONTEXT_MATRIX_T(ColorMatrixStack.Top), NO_EXTRA }, { GL_TRANSPOSE_MODELVIEW_MATRIX_ARB, CONTEXT_MATRIX_T(ModelviewMatrixStack), NO_EXTRA }, { GL_TRANSPOSE_PROJECTION_MATRIX_ARB, CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA }, { GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA }, - /* GL_SGI_color_matrix (also in 1.2 imaging) */ - { GL_COLOR_MATRIX_SGI, CONTEXT_MATRIX(ColorMatrixStack.Top), NO_EXTRA }, - { GL_COLOR_MATRIX_STACK_DEPTH_SGI, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, ColorMatrixStack.Depth), NO_EXTRA }, - { GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI, - CONST(MAX_COLOR_STACK_DEPTH), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_RED_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[0]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[1]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[2]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[3]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_RED_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[0]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[1]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[2]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[3]), NO_EXTRA }, - /* GL_EXT_convolution (also in 1.2 imaging) */ { GL_CONVOLUTION_1D_EXT, CONTEXT_BOOL(Pixel.Convolution1DEnabled), extra_EXT_convolution }, @@ -1449,7 +1425,6 @@ find_custom_value(GLcontext *ctx, const struct value_desc *d, union value *v) case GL_MODELVIEW_STACK_DEPTH: case GL_PROJECTION_STACK_DEPTH: - case GL_COLOR_MATRIX_STACK_DEPTH_SGI: v->value_int = *(GLint *) ((char *) ctx + d->offset) + 1; break; diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 7918ef7926..788584ae85 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1525,36 +1525,6 @@ _mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] ) } } - -/* - * Apply the color matrix and post color matrix scaling and biasing. - */ -void -_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]) -{ - const GLfloat rs = ctx->Pixel.PostColorMatrixScale[0]; - const GLfloat rb = ctx->Pixel.PostColorMatrixBias[0]; - const GLfloat gs = ctx->Pixel.PostColorMatrixScale[1]; - const GLfloat gb = ctx->Pixel.PostColorMatrixBias[1]; - const GLfloat bs = ctx->Pixel.PostColorMatrixScale[2]; - const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2]; - const GLfloat as = ctx->Pixel.PostColorMatrixScale[3]; - const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3]; - const GLfloat *m = ctx->ColorMatrixStack.Top->m; - GLuint i; - for (i = 0; i < n; i++) { - const GLfloat r = rgba[i][RCOMP]; - const GLfloat g = rgba[i][GCOMP]; - const GLfloat b = rgba[i][BCOMP]; - const GLfloat a = rgba[i][ACOMP]; - rgba[i][RCOMP] = (m[0] * r + m[4] * g + m[ 8] * b + m[12] * a) * rs + rb; - rgba[i][GCOMP] = (m[1] * r + m[5] * g + m[ 9] * b + m[13] * a) * gs + gb; - rgba[i][BCOMP] = (m[2] * r + m[6] * g + m[10] * b + m[14] * a) * bs + bb; - rgba[i][ACOMP] = (m[3] * r + m[7] * g + m[11] * b + m[15] * a) * as + ab; - } -} - - /** * Apply a color table lookup to an array of floating point RGBA colors. */ @@ -1913,10 +1883,6 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, ctx->Pixel.PostConvolutionBias[BCOMP], ctx->Pixel.PostConvolutionBias[ACOMP]); } - /* color matrix transform */ - if (transferOps & IMAGE_COLOR_MATRIX_BIT) { - _mesa_transform_rgba(ctx, n, rgba); - } /* clamping to [0,1] */ if (transferOps & IMAGE_CLAMP_BIT) { GLuint i; diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 8b180d6bfe..672dbf2823 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -163,11 +163,6 @@ _mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], extern void _mesa_map_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - -extern void -_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - - extern void _mesa_lookup_rgba_float(const struct gl_color_table *table, GLuint n, GLfloat rgba[][4]); diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 4b8c00b5b6..8ed718cd38 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -177,9 +177,6 @@ _mesa_MatrixMode( GLenum mode ) ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack)); ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit]; break; - case GL_COLOR: - ctx->CurrentStack = &ctx->ColorMatrixStack; - break; case GL_MATRIX0_NV: case GL_MATRIX1_NV: case GL_MATRIX2_NV: @@ -724,8 +721,6 @@ void _mesa_init_matrix( GLcontext * ctx ) _NEW_MODELVIEW); init_matrix_stack(&ctx->ProjectionMatrixStack, MAX_PROJECTION_STACK_DEPTH, _NEW_PROJECTION); - init_matrix_stack(&ctx->ColorMatrixStack, MAX_COLOR_STACK_DEPTH, - _NEW_COLOR_MATRIX); for (i = 0; i < Elements(ctx->TextureMatrixStack); i++) init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH, _NEW_TEXTURE_MATRIX); @@ -753,7 +748,6 @@ void _mesa_free_matrix_data( GLcontext *ctx ) free_matrix_stack(&ctx->ModelviewMatrixStack); free_matrix_stack(&ctx->ProjectionMatrixStack); - free_matrix_stack(&ctx->ColorMatrixStack); for (i = 0; i < Elements(ctx->TextureMatrixStack); i++) free_matrix_stack(&ctx->TextureMatrixStack[i]); for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 9718732608..c982f55e82 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -454,16 +454,6 @@ typedef enum BUFFER_BIT_COLOR7) -/** The pixel transfer path has three color tables: */ -typedef enum -{ - COLORTABLE_PRECONVOLUTION, - COLORTABLE_POSTCONVOLUTION, - COLORTABLE_POSTCOLORMATRIX, - COLORTABLE_MAX -} gl_colortable_index; - - /** * Data structure for color tables */ @@ -975,11 +965,6 @@ struct gl_pixel_attrib GLfloat PostConvolutionScale[4]; /**< RGBA */ GLfloat PostConvolutionBias[4]; /**< RGBA */ - /* Color matrix (GL_SGI_color_matrix) */ - /* Note: the color matrix is not part of this attrib group */ - GLfloat PostColorMatrixScale[4]; /**< RGBA */ - GLfloat PostColorMatrixBias[4]; /**< RGBA */ - /*--- End Pixel Transfer State ---*/ /** glPixelZoom */ @@ -2748,7 +2733,6 @@ struct gl_extensions GLboolean NV_vertex_program; GLboolean NV_vertex_program1_1; GLboolean OES_read_format; - GLboolean SGI_color_matrix; GLboolean SGI_texture_color_table; GLboolean SGIS_generate_mipmap; GLboolean SGIS_texture_edge_clamp; @@ -2787,7 +2771,6 @@ struct gl_matrix_stack #define IMAGE_MAP_COLOR_BIT 0x4 #define IMAGE_CONVOLUTION_BIT 0x10 #define IMAGE_POST_CONVOLUTION_SCALE_BIAS 0x20 -#define IMAGE_COLOR_MATRIX_BIT 0x80 #define IMAGE_CLAMP_BIT 0x800 @@ -2797,8 +2780,7 @@ struct gl_matrix_stack IMAGE_MAP_COLOR_BIT) /** Pixel transfer ops after convolution */ -#define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \ - IMAGE_COLOR_MATRIX_BIT) +#define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS) /*@}*/ @@ -2811,7 +2793,6 @@ struct gl_matrix_stack #define _NEW_MODELVIEW 0x1 /**< __GLcontextRec::ModelView */ #define _NEW_PROJECTION 0x2 /**< __GLcontextRec::Projection */ #define _NEW_TEXTURE_MATRIX 0x4 /**< __GLcontextRec::TextureMatrix */ -#define _NEW_COLOR_MATRIX 0x8 /**< __GLcontextRec::ColorMatrix */ #define _NEW_ACCUM 0x10 /**< __GLcontextRec::Accum */ #define _NEW_COLOR 0x20 /**< __GLcontextRec::Color */ #define _NEW_DEPTH 0x40 /**< __GLcontextRec::Depth */ @@ -2934,8 +2915,7 @@ struct gl_matrix_stack #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ _NEW_TEXTURE) -#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL | \ - _NEW_COLOR_MATRIX) +#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL) /*@}*/ @@ -3083,7 +3063,6 @@ struct __GLcontextRec /*@{*/ struct gl_matrix_stack ModelviewMatrixStack; struct gl_matrix_stack ProjectionMatrixStack; - struct gl_matrix_stack ColorMatrixStack; struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS]; struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES]; struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */ diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 834a41108c..5e900b4eed 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -566,54 +566,6 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param ) FLUSH_VERTICES(ctx, _NEW_PIXEL); ctx->Pixel.DepthBias = param; break; - case GL_POST_COLOR_MATRIX_RED_SCALE: - if (ctx->Pixel.PostColorMatrixScale[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[0] = param; - break; - case GL_POST_COLOR_MATRIX_RED_BIAS: - if (ctx->Pixel.PostColorMatrixBias[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[0] = param; - break; - case GL_POST_COLOR_MATRIX_GREEN_SCALE: - if (ctx->Pixel.PostColorMatrixScale[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[1] = param; - break; - case GL_POST_COLOR_MATRIX_GREEN_BIAS: - if (ctx->Pixel.PostColorMatrixBias[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[1] = param; - break; - case GL_POST_COLOR_MATRIX_BLUE_SCALE: - if (ctx->Pixel.PostColorMatrixScale[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[2] = param; - break; - case GL_POST_COLOR_MATRIX_BLUE_BIAS: - if (ctx->Pixel.PostColorMatrixBias[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[2] = param; - break; - case GL_POST_COLOR_MATRIX_ALPHA_SCALE: - if (ctx->Pixel.PostColorMatrixScale[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[3] = param; - break; - case GL_POST_COLOR_MATRIX_ALPHA_BIAS: - if (ctx->Pixel.PostColorMatrixBias[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[3] = param; - break; case GL_POST_CONVOLUTION_RED_SCALE: if (ctx->Pixel.PostConvolutionScale[0] == param) return; @@ -718,17 +670,6 @@ update_image_transfer_state(GLcontext *ctx) } } - if (ctx->ColorMatrixStack.Top->type != MATRIX_IDENTITY || - ctx->Pixel.PostColorMatrixScale[0] != 1.0F || - ctx->Pixel.PostColorMatrixBias[0] != 0.0F || - ctx->Pixel.PostColorMatrixScale[1] != 1.0F || - ctx->Pixel.PostColorMatrixBias[1] != 0.0F || - ctx->Pixel.PostColorMatrixScale[2] != 1.0F || - ctx->Pixel.PostColorMatrixBias[2] != 0.0F || - ctx->Pixel.PostColorMatrixScale[3] != 1.0F || - ctx->Pixel.PostColorMatrixBias[3] != 0.0F) - mask |= IMAGE_COLOR_MATRIX_BIT; - ctx->_ImageTransferState = mask; } @@ -738,11 +679,6 @@ update_image_transfer_state(GLcontext *ctx) */ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) { - if (new_state & _NEW_COLOR_MATRIX) - _math_matrix_analyse( ctx->ColorMatrixStack.Top ); - - /* References ColorMatrix.type (derived above). - */ if (new_state & _MESA_NEW_TRANSFER_STATE) update_image_transfer_state(ctx); } @@ -814,8 +750,6 @@ _mesa_init_pixel( GLcontext *ctx ) init_pixelmap(&ctx->PixelMaps.GtoG); init_pixelmap(&ctx->PixelMaps.BtoB); init_pixelmap(&ctx->PixelMaps.AtoA); - ASSIGN_4V(ctx->Pixel.PostColorMatrixScale, 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.PostColorMatrixBias, 0.0, 0.0, 0.0, 0.0); ctx->Pixel.Convolution1DEnabled = GL_FALSE; ctx->Pixel.Convolution2DEnabled = GL_FALSE; ctx->Pixel.Separable2DEnabled = GL_FALSE; diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c index 36236eb9a7..944ad435f7 100644 --- a/src/mesa/main/querymatrix.c +++ b/src/mesa/main/querymatrix.c @@ -117,10 +117,6 @@ GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[ {GL_MODELVIEW, GL_MODELVIEW_MATRIX}, {GL_PROJECTION, GL_PROJECTION_MATRIX}, {GL_TEXTURE, GL_TEXTURE_MATRIX}, -#if 0 - /* this doesn't exist in GLES */ - {GL_COLOR, GL_COLOR_MATRIX}, -#endif }; /* Call Mesa to get the current matrix in floating-point form. First, diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index 2687f8ae2c..c6fb42b9a6 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -273,7 +273,6 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], case STATE_MVP_MATRIX: case STATE_TEXTURE_MATRIX: case STATE_PROGRAM_MATRIX: - case STATE_COLOR_MATRIX: { /* state[0] = modelview, projection, texture, etc. */ /* state[1] = which texture matrix or program matrix */ @@ -309,9 +308,6 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], ASSERT(index < Elements(ctx->ProgramMatrixStack)); matrix = ctx->ProgramMatrixStack[index].Top; } - else if (mat == STATE_COLOR_MATRIX) { - matrix = ctx->ColorMatrixStack.Top; - } else { _mesa_problem(ctx, "Bad matrix name in _mesa_fetch_state()"); return; @@ -555,14 +551,6 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[3] = ctx->Pixel.AlphaBias; return; - case STATE_PCM_SCALE: - COPY_4V(value, ctx->Pixel.PostColorMatrixScale); - return; - - case STATE_PCM_BIAS: - COPY_4V(value, ctx->Pixel.PostColorMatrixBias); - return; - case STATE_SHADOW_AMBIENT: { const int unit = (int) state[2]; @@ -667,8 +655,6 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) return _NEW_TEXTURE_MATRIX; case STATE_PROGRAM_MATRIX: return _NEW_TRACK_MATRIX; - case STATE_COLOR_MATRIX: - return _NEW_COLOR_MATRIX; case STATE_DEPTH_RANGE: return _NEW_VIEWPORT; @@ -706,8 +692,6 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) case STATE_PT_SCALE: case STATE_PT_BIAS: - case STATE_PCM_SCALE: - case STATE_PCM_BIAS: return _NEW_PIXEL; case STATE_FB_SIZE: @@ -792,9 +776,6 @@ append_token(char *dst, gl_state_index k) case STATE_PROGRAM_MATRIX: append(dst, "matrix.program"); break; - case STATE_COLOR_MATRIX: - append(dst, "matrix.color"); - break; case STATE_MATRIX_INVERSE: append(dst, ".inverse"); break; @@ -913,12 +894,6 @@ append_token(char *dst, gl_state_index k) case STATE_PT_BIAS: append(dst, "PTbias"); break; - case STATE_PCM_SCALE: - append(dst, "PCMscale"); - break; - case STATE_PCM_BIAS: - append(dst, "PCMbias"); - break; case STATE_SHADOW_AMBIENT: append(dst, "CompareFailValue"); break; @@ -1010,7 +985,6 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) case STATE_MVP_MATRIX: case STATE_TEXTURE_MATRIX: case STATE_PROGRAM_MATRIX: - case STATE_COLOR_MATRIX: { /* state[0] = modelview, projection, texture, etc. */ /* state[1] = which texture matrix or program matrix */ @@ -1147,9 +1121,6 @@ _mesa_load_tracked_matrices(GLcontext *ctx) Elements(ctx->TextureMatrixStack) - 1); mat = ctx->TextureMatrixStack[unit].Top; } - else if (ctx->VertexProgram.TrackMatrix[i] == GL_COLOR) { - mat = ctx->ColorMatrixStack.Top; - } else if (ctx->VertexProgram.TrackMatrix[i]==GL_MODELVIEW_PROJECTION_NV) { /* XXX verify the combined matrix is up to date */ mat = &ctx->_ModelProjectMatrix; diff --git a/src/mesa/program/prog_statevars.h b/src/mesa/program/prog_statevars.h index 1753471ffb..cfce226fb4 100644 --- a/src/mesa/program/prog_statevars.h +++ b/src/mesa/program/prog_statevars.h @@ -67,7 +67,6 @@ typedef enum gl_state_index_ { STATE_MVP_MATRIX, STATE_TEXTURE_MATRIX, STATE_PROGRAM_MATRIX, - STATE_COLOR_MATRIX, STATE_MATRIX_INVERSE, STATE_MATRIX_TRANSPOSE, STATE_MATRIX_INVTRANS, @@ -116,8 +115,6 @@ typedef enum gl_state_index_ { STATE_LIGHT_HALF_VECTOR, /* object vs eye space */ STATE_PT_SCALE, /**< Pixel transfer RGBA scale */ STATE_PT_BIAS, /**< Pixel transfer RGBA bias */ - STATE_PCM_SCALE, /**< Post color matrix RGBA scale */ - STATE_PCM_BIAS, /**< Post color matrix 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_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */ diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 8a8d17599e..081b6b3e23 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -27,7 +27,7 @@ /* * Generate fragment programs to implement pixel transfer ops, such as - * scale/bias, colormatrix, colortable, convolution... + * scale/bias, colortable, convolution... * * Authors: * Brian Paul @@ -55,8 +55,6 @@ struct state_key { GLuint scaleAndBias:1; - GLuint colorMatrix:1; - GLuint colorMatrixPostScaleBias:1; GLuint pixelMaps:1; #if 0 @@ -70,27 +68,9 @@ struct state_key #endif }; - -static GLboolean -is_identity(const GLfloat m[16]) -{ - GLuint i; - for (i = 0; i < 16; i++) { - const int row = i % 4, col = i / 4; - const float val = (GLfloat)(row == col); - if (m[i] != val) - return GL_FALSE; - } - return GL_TRUE; -} - - static void make_state_key(GLcontext *ctx, struct state_key *key) { - static const GLfloat zero[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; - static const GLfloat one[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; - memset(key, 0, sizeof(*key)); if (ctx->Pixel.RedBias != 0.0 || ctx->Pixel.RedScale != 1.0 || @@ -100,15 +80,6 @@ make_state_key(GLcontext *ctx, struct state_key *key) key->scaleAndBias = 1; } - if (!is_identity(ctx->ColorMatrixStack.Top->m)) { - key->colorMatrix = 1; - } - - if (!TEST_EQ_4V(ctx->Pixel.PostColorMatrixScale, one) || - !TEST_EQ_4V(ctx->Pixel.PostColorMatrixBias, zero)) { - key->colorMatrixPostScaleBias = 1; - } - key->pixelMaps = ctx->Pixel.MapColorFlag; } @@ -306,103 +277,6 @@ get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key) fp->Base.SamplersUsed |= (1 << 1); /* sampler 1 is used */ } - if (key->colorMatrix) { - static const gl_state_index row0_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 0, 0, 0 }; - static const gl_state_index row1_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 1, 1, 0 }; - static const gl_state_index row2_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 2, 2, 0 }; - static const gl_state_index row3_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 3, 3, 0 }; - - GLint row0_p = _mesa_add_state_reference(params, row0_state); - GLint row1_p = _mesa_add_state_reference(params, row1_state); - GLint row2_p = _mesa_add_state_reference(params, row2_state); - GLint row3_p = _mesa_add_state_reference(params, row3_state); - const GLuint temp = 1; - - /* DP4 temp.x, colorTemp, matrow0; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_X; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row0_p; - ic++; - - /* DP4 temp.y, colorTemp, matrow1; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_Y; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row1_p; - ic++; - - /* DP4 temp.z, colorTemp, matrow2; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_Z; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row2_p; - ic++; - - /* DP4 temp.w, colorTemp, matrow3; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_W; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row3_p; - ic++; - - /* MOV colorTemp, temp; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_MOV; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = colorTemp; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = temp; - ic++; - } - - if (key->colorMatrixPostScaleBias) { - static const gl_state_index scale_state[STATE_LENGTH] = - { STATE_INTERNAL, STATE_PT_SCALE, 0, 0, 0 }; - static const gl_state_index bias_state[STATE_LENGTH] = - { STATE_INTERNAL, STATE_PT_BIAS, 0, 0, 0 }; - GLint scale_param, bias_param; - - scale_param = _mesa_add_state_reference(params, scale_state); - bias_param = _mesa_add_state_reference(params, bias_state); - - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_MAD; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = colorTemp; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = scale_param; - inst[ic].SrcReg[2].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[2].Index = bias_param; - ic++; - } - /* Modify last instruction's dst reg to write to result.color */ { struct prog_instruction *last = &inst[ic - 1]; @@ -473,7 +347,7 @@ update_pixel_transfer(struct st_context *st) const struct st_tracked_state st_update_pixel_transfer = { "st_update_pixel_transfer", /* name */ { /* dirty */ - _NEW_PIXEL | _NEW_COLOR_MATRIX, /* mesa */ + _NEW_PIXEL, /* mesa */ 0, /* st */ }, update_pixel_transfer /* update */ diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 017f6c5cf7..225f75e3af 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -271,7 +271,6 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.OES_draw_texture = GL_TRUE; #endif - ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; /* -- cgit v1.2.3 From a62efdf82c20747feb11dfd7756f0579aa914b57 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Sep 2010 19:37:15 -0700 Subject: mesa: Remove EXT_convolution. More optional code. --- src/mesa/drivers/common/driverfuncs.c | 2 - src/mesa/drivers/common/meta.c | 82 -- src/mesa/drivers/dri/intel/intel_extensions.c | 2 - src/mesa/drivers/dri/intel/intel_tex_image.c | 20 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 16 +- src/mesa/drivers/dri/savage/savagetex.c | 3 - src/mesa/drivers/dri/unichrome/via_tex.c | 22 +- src/mesa/main/attrib.c | 12 - src/mesa/main/context.c | 2 - src/mesa/main/convolve.c | 1307 +------------------------ src/mesa/main/convolve.h | 70 -- src/mesa/main/dd.h | 9 - src/mesa/main/enable.c | 34 - src/mesa/main/extensions.c | 3 - src/mesa/main/get.c | 33 - src/mesa/main/image.c | 21 +- src/mesa/main/mtypes.h | 46 +- src/mesa/main/pixel.c | 82 -- src/mesa/main/texcompress_fxt1.c | 3 - src/mesa/main/texcompress_s3tc.c | 5 - src/mesa/main/teximage.c | 62 -- src/mesa/main/texstore.c | 210 +--- src/mesa/state_tracker/st_cb_readpixels.c | 3 - src/mesa/state_tracker/st_cb_texture.c | 5 - src/mesa/swrast/s_copypix.c | 103 -- src/mesa/swrast/s_drawpix.c | 57 -- src/mesa/swrast/s_readpix.c | 59 +- 27 files changed, 63 insertions(+), 2210 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index f92cdc5a77..aee73b53bb 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -122,8 +122,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) /* imaging */ driver->CopyColorTable = _mesa_meta_CopyColorTable; driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable; - driver->CopyConvolutionFilter1D = _mesa_meta_CopyConvolutionFilter1D; - driver->CopyConvolutionFilter2D = _mesa_meta_CopyConvolutionFilter2D; /* Vertex/fragment programs */ driver->BindProgram = NULL; diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 87d116ad9f..16ca42f7b5 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -40,7 +40,6 @@ #include "main/bufferobj.h" #include "main/buffers.h" #include "main/colortab.h" -#include "main/convolve.h" #include "main/depth.h" #include "main/enable.h" #include "main/fbobject.h" @@ -128,9 +127,6 @@ struct save_state GLfloat AlphaBias, AlphaScale; GLfloat DepthBias, DepthScale; GLboolean MapColorFlag; - GLboolean Convolution1DEnabled; - GLboolean Convolution2DEnabled; - GLboolean Separable2DEnabled; /** META_RASTERIZATION */ GLenum FrontPolygonMode, BackPolygonMode; @@ -389,9 +385,6 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) save->AlphaScale = ctx->Pixel.AlphaScale; save->AlphaBias = ctx->Pixel.AlphaBias; save->MapColorFlag = ctx->Pixel.MapColorFlag; - save->Convolution1DEnabled = ctx->Pixel.Convolution1DEnabled; - save->Convolution2DEnabled = ctx->Pixel.Convolution2DEnabled; - save->Separable2DEnabled = ctx->Pixel.Separable2DEnabled; ctx->Pixel.RedScale = 1.0F; ctx->Pixel.RedBias = 0.0F; ctx->Pixel.GreenScale = 1.0F; @@ -401,9 +394,6 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) ctx->Pixel.AlphaScale = 1.0F; ctx->Pixel.AlphaBias = 0.0F; ctx->Pixel.MapColorFlag = GL_FALSE; - ctx->Pixel.Convolution1DEnabled = GL_FALSE; - ctx->Pixel.Convolution2DEnabled = GL_FALSE; - ctx->Pixel.Separable2DEnabled = GL_FALSE; /* XXX more state */ ctx->NewState |=_NEW_PIXEL; } @@ -638,9 +628,6 @@ _mesa_meta_end(GLcontext *ctx) ctx->Pixel.AlphaScale = save->AlphaScale; ctx->Pixel.AlphaBias = save->AlphaBias; ctx->Pixel.MapColorFlag = save->MapColorFlag; - ctx->Pixel.Convolution1DEnabled = save->Convolution1DEnabled; - ctx->Pixel.Convolution2DEnabled = save->Convolution2DEnabled; - ctx->Pixel.Separable2DEnabled = save->Separable2DEnabled; /* XXX more state */ ctx->NewState |=_NEW_PIXEL; } @@ -2579,14 +2566,6 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, format, type, &ctx->Pack, buf); _mesa_meta_end(ctx); - /* - * Prepare for new texture image size/data - */ - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, - &postConvWidth, &postConvHeight); - } - if (texImage->Data) { ctx->Driver.FreeTexImageData(ctx, texImage); } @@ -2804,64 +2783,3 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, free(buf); } - - -void -_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width) -{ - GLfloat *buf; - - buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat)); - if (!buf) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); - return; - } - - /* - * Read image from framebuffer (disable pixel transfer ops) - */ - _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); - _mesa_update_state(ctx); - ctx->Driver.ReadPixels(ctx, x, y, width, 1, - GL_RGBA, GL_FLOAT, &ctx->Pack, buf); - - _mesa_ConvolutionFilter1D(target, internalFormat, width, - GL_RGBA, GL_FLOAT, buf); - - _mesa_meta_end(ctx); - - free(buf); -} - - -void -_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, GLint x, GLint y, - GLsizei width, GLsizei height) -{ - GLfloat *buf; - - buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - if (!buf) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); - return; - } - - /* - * Read image from framebuffer (disable pixel transfer ops) - */ - _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); - _mesa_update_state(ctx); - - ctx->Driver.ReadPixels(ctx, x, y, width, height, - GL_RGBA, GL_FLOAT, &ctx->Pack, buf); - - _mesa_ConvolutionFilter2D(target, internalFormat, width, height, - GL_RGBA, GL_FLOAT, buf); - - _mesa_meta_end(ctx); - - free(buf); -} diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 4b6229ffe6..2edd6d21b4 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -208,8 +208,6 @@ intelInitExtensions(GLcontext *ctx) { struct intel_context *intel = intel_context(ctx); - /* Disable imaging extension until convolution is working in teximage paths. - */ driInitExtensions(ctx, card_extensions, GL_FALSE); _mesa_map_function_array(GL_VERSION_2_1_functions); diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index b1ed7ee5e7..f8cb50797e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -4,7 +4,6 @@ #include "main/mtypes.h" #include "main/enums.h" #include "main/bufferobj.h" -#include "main/convolve.h" #include "main/context.h" #include "main/formats.h" #include "main/texcompress.h" @@ -320,8 +319,6 @@ intelTexImage(GLcontext * ctx, struct intel_context *intel = intel_context(ctx); struct intel_texture_object *intelObj = intel_texture_object(texObj); struct intel_texture_image *intelImage = intel_texture_image(texImage); - GLint postConvWidth = width; - GLint postConvHeight = height; GLint texelBytes, sizeInBytes; GLuint dstRowStride = 0, srcRowStride = texImage->RowStride; @@ -331,11 +328,6 @@ intelTexImage(GLcontext * ctx, intelImage->face = target_to_face(target); intelImage->level = level; - if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { - _mesa_adjust_image_for_convolution(ctx, dims, &postConvWidth, - &postConvHeight); - } - if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; } @@ -343,13 +335,13 @@ intelTexImage(GLcontext * ctx, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ - if (postConvWidth * texelBytes < 32) { - postConvWidth = 32 / texelBytes; - texImage->RowStride = postConvWidth; + if (width * texelBytes < 32) { + width = 32 / texelBytes; + texImage->RowStride = width; } if (!intelImage->mt) { - assert(texImage->RowStride == postConvWidth); + assert(texImage->RowStride == width); } } @@ -502,8 +494,8 @@ intelTexImage(GLcontext * ctx, assert(dims != 3); } else { - dstRowStride = postConvWidth * texelBytes; - sizeInBytes = depth * dstRowStride * postConvHeight; + dstRowStride = width * texelBytes; + sizeInBytes = depth * dstRowStride * height; } texImage->Data = _mesa_alloc_texmemory(sizeInBytes); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 8c6a50d2f0..bf30e0cab8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -32,7 +32,6 @@ #include "main/glheader.h" #include "main/imports.h" #include "main/context.h" -#include "main/convolve.h" #include "main/enums.h" #include "main/mipmap.h" #include "main/texcompress.h" @@ -773,8 +772,6 @@ static void radeon_teximage( radeonContextPtr rmesa = RADEON_CONTEXT(ctx); radeonTexObj* t = radeon_tex_obj(texObj); radeon_texture_image* image = get_radeon_texture_image(texImage); - GLint postConvWidth = width; - GLint postConvHeight = height; GLuint face = _mesa_tex_target_to_face(target); radeon_print(RADEON_TEXTURE, RADEON_NORMAL, @@ -795,20 +792,15 @@ static void radeon_teximage( t->validated = GL_FALSE; - if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { - _mesa_adjust_image_for_convolution(ctx, dims, &postConvWidth, - &postConvHeight); - } - if (!_mesa_is_format_compressed(texImage->TexFormat)) { GLuint texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ - if (postConvWidth * texelBytes < 32) { - postConvWidth = 32 / texelBytes; - texImage->RowStride = postConvWidth; + if (width * texelBytes < 32) { + width = 32 / texelBytes; + texImage->RowStride = width; } if (!image->mt) { - assert(texImage->RowStride == postConvWidth); + assert(texImage->RowStride == width); } } diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 1523af4065..89090da5c6 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -28,7 +28,6 @@ #include "main/macros.h" #include "main/texstore.h" #include "main/texobj.h" -#include "main/convolve.h" #include "main/colormac.h" #include "main/simple_list.h" #include "main/enums.h" @@ -586,7 +585,6 @@ _savage_texstore_a1114444(TEXSTORE_PARAMS) if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLuint texelBytes = _mesa_get_format_bytes(dstFormat); GLubyte *dstRow = (GLubyte *) dstAddr @@ -626,7 +624,6 @@ _savage_texstore_a1118888(TEXSTORE_PARAMS) if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLuint texelBytes = _mesa_get_format_bytes(dstFormat); GLubyte *dstRow = (GLubyte *) dstAddr diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index a64f093326..01cb3ebbc8 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -32,7 +32,6 @@ #include "main/enums.h" #include "main/formats.h" #include "main/colortab.h" -#include "main/convolve.h" #include "main/context.h" #include "main/mipmap.h" #include "main/mm.h" @@ -664,8 +663,6 @@ static void viaTexImage(GLcontext *ctx, struct gl_texture_image *texImage) { struct via_context *vmesa = VIA_CONTEXT(ctx); - GLint postConvWidth = width; - GLint postConvHeight = height; GLint texelBytes, sizeInBytes; struct via_texture_object *viaObj = (struct via_texture_object *)texObj; struct via_texture_image *viaImage = (struct via_texture_image *)texImage; @@ -676,11 +673,6 @@ static void viaTexImage(GLcontext *ctx, via_release_pending_textures(vmesa); } - if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { - _mesa_adjust_image_for_convolution(ctx, dims, &postConvWidth, - &postConvHeight); - } - /* choose the texture format */ texImage->TexFormat = viaChooseTexFormat(ctx, internalFormat, format, type); @@ -690,13 +682,13 @@ static void viaTexImage(GLcontext *ctx, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ - if (postConvWidth * texelBytes < 32) { - postConvWidth = 32 / texelBytes; - texImage->RowStride = postConvWidth; + if (width * texelBytes < 32) { + width = 32 / texelBytes; + texImage->RowStride = width; } - assert(texImage->RowStride == postConvWidth); - viaImage->pitchLog2 = logbase2(postConvWidth * texelBytes); + assert(texImage->RowStride == width); + viaImage->pitchLog2 = logbase2(width * texelBytes); /* allocate memory */ if (_mesa_is_format_compressed(texImage->TexFormat)) @@ -705,7 +697,7 @@ static void viaTexImage(GLcontext *ctx, texImage->Height, texImage->Depth); else - sizeInBytes = postConvWidth * postConvHeight * texelBytes; + sizeInBytes = width * height * texelBytes; /* Attempt to allocate texture memory directly, otherwise use main @@ -786,7 +778,7 @@ static void viaTexImage(GLcontext *ctx, dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width); } else { - dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat); + dstRowStride = width * _mesa_get_format_bytes(texImage->TexFormat); } success = _mesa_texstore(ctx, dims, texImage->_BaseFormat, diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 73c2375f9d..0299525f46 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -69,9 +69,6 @@ struct gl_enable_attrib GLboolean Blend; GLbitfield ClipPlanes; GLboolean ColorMaterial; - GLboolean Convolution1D; - GLboolean Convolution2D; - GLboolean Separable2D; GLboolean CullFace; GLboolean DepthClamp; GLboolean DepthTest; @@ -259,9 +256,6 @@ _mesa_PushAttrib(GLbitfield mask) attr->Blend = ctx->Color.BlendEnabled; attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled; attr->ColorMaterial = ctx->Light.ColorMaterialEnabled; - attr->Convolution1D = ctx->Pixel.Convolution1DEnabled; - attr->Convolution2D = ctx->Pixel.Convolution2DEnabled; - attr->Separable2D = ctx->Pixel.Separable2DEnabled; attr->CullFace = ctx->Polygon.CullFlag; attr->DepthClamp = ctx->Transform.DepthClamp; attr->DepthTest = ctx->Depth.Test; @@ -516,12 +510,6 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) GL_DEPTH_CLAMP); TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST); TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER); - TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, - GL_CONVOLUTION_1D); - TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D, - GL_CONVOLUTION_2D); - TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D, - GL_SEPARABLE_2D); TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG); TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING); TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 87285683f8..7d6bfaa62d 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -557,8 +557,6 @@ _mesa_init_constants(GLcontext *ctx) ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH; ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY; ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE; - ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH; - ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT; ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES; ctx->Const.MaxLights = MAX_LIGHTS; ctx->Const.MaxShininess = 128.0; diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index f63bddc44d..301569e5f6 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -45,218 +45,20 @@ #if FEATURE_convolve - -/* - * Given an internalFormat token passed to glConvolutionFilter - * or glSeparableFilter, return the corresponding base format. - * Return -1 if invalid token. - */ -static GLint -base_filter_format( GLenum format ) -{ - switch (format) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return GL_ALPHA; - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return GL_LUMINANCE; - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return GL_LUMINANCE_ALPHA; - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return GL_INTENSITY; - 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 4: - 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: - return GL_RGBA; - default: - return -1; /* error */ - } -} - - -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) { - GLint baseFormat; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_CONVOLUTION_1D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D(internalFormat)"); - return; - } - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glConvolutionFilter1D(width)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter1D(format or type)"); - return; - } - - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D(format or type)"); - return; - } - - ctx->Convolution1D.Format = format; - ctx->Convolution1D.InternalFormat = internalFormat; - ctx->Convolution1D.Width = width; - ctx->Convolution1D.Height = 1; - - image = _mesa_map_validate_pbo_source(ctx, - 1, &ctx->Unpack, width, 1, 1, - format, type, image, - "glConvolutionFilter1D"); - if (!image) - return; - - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, - ctx->Convolution1D.Filter, - format, type, image, &ctx->Unpack, - 0); /* transferOps */ - - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); - - _mesa_scale_and_bias_rgba(width, - (GLfloat (*)[4]) ctx->Convolution1D.Filter, - ctx->Pixel.ConvolutionFilterScale[0][0], - ctx->Pixel.ConvolutionFilterScale[0][1], - ctx->Pixel.ConvolutionFilterScale[0][2], - ctx->Pixel.ConvolutionFilterScale[0][3], - ctx->Pixel.ConvolutionFilterBias[0][0], - ctx->Pixel.ConvolutionFilterBias[0][1], - ctx->Pixel.ConvolutionFilterBias[0][2], - ctx->Pixel.ConvolutionFilterBias[0][3]); - - ctx->NewState |= _NEW_PIXEL; + _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D"); } - -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) { - GLint baseFormat; - GLint i; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_CONVOLUTION_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glConvolutionFilter2D(width)"); - return; - } - if (height < 0 || height > MAX_CONVOLUTION_HEIGHT) { - _mesa_error(ctx, GL_INVALID_VALUE, "glConvolutionFilter2D(height)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter2D(format or type)"); - return; - } - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D(format or type)"); - return; - } - - /* this should have been caught earlier */ - assert(_mesa_components_in_format(format)); - - ctx->Convolution2D.Format = format; - ctx->Convolution2D.InternalFormat = internalFormat; - ctx->Convolution2D.Width = width; - ctx->Convolution2D.Height = height; - - image = _mesa_map_validate_pbo_source(ctx, - 2, &ctx->Unpack, width, height, 1, - format, type, image, - "glConvolutionFilter2D"); - if (!image) - return; - - /* Unpack filter image. We always store filters in RGBA format. */ - for (i = 0; i < height; i++) { - const GLvoid *src = _mesa_image_address2d(&ctx->Unpack, image, width, - height, format, type, i, 0); - GLfloat *dst = ctx->Convolution2D.Filter + i * width * 4; - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, dst, - format, type, src, &ctx->Unpack, - 0); /* transferOps */ - } - - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); - _mesa_scale_and_bias_rgba(width * height, - (GLfloat (*)[4]) ctx->Convolution2D.Filter, - ctx->Pixel.ConvolutionFilterScale[1][0], - ctx->Pixel.ConvolutionFilterScale[1][1], - ctx->Pixel.ConvolutionFilterScale[1][2], - ctx->Pixel.ConvolutionFilterScale[1][3], - ctx->Pixel.ConvolutionFilterBias[1][0], - ctx->Pixel.ConvolutionFilterBias[1][1], - ctx->Pixel.ConvolutionFilterBias[1][2], - ctx->Pixel.ConvolutionFilterBias[1][3]); - - ctx->NewState |= _NEW_PIXEL; + _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D"); } @@ -264,42 +66,8 @@ static void GLAPIENTRY _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) { GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_MODE: - if (param == (GLfloat) GL_REDUCE || - param == (GLfloat) GL_CONSTANT_BORDER || - param == (GLfloat) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) param; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf(params)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf(pname)"); - return; - } - ctx->NewState |= _NEW_PIXEL; + _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf"); } @@ -307,51 +75,8 @@ static void GLAPIENTRY _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - COPY_4V(ctx->Pixel.ConvolutionBorderColor[c], params); - break; - case GL_CONVOLUTION_BORDER_MODE: - if (params[0] == (GLfloat) GL_REDUCE || - params[0] == (GLfloat) GL_CONSTANT_BORDER || - params[0] == (GLfloat) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(params)"); - return; - } - break; - case GL_CONVOLUTION_FILTER_SCALE: - COPY_4V(ctx->Pixel.ConvolutionFilterScale[c], params); - break; - case GL_CONVOLUTION_FILTER_BIAS: - COPY_4V(ctx->Pixel.ConvolutionFilterBias[c], params); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(pname)"); - return; - } - ctx->NewState |= _NEW_PIXEL; + _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv"); } @@ -359,42 +84,8 @@ static void GLAPIENTRY _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_MODE: - if (param == (GLint) GL_REDUCE || - param == (GLint) GL_CONSTANT_BORDER || - param == (GLint) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) param; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri(params)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri(pname)"); - return; - } - - ctx->NewState |= _NEW_PIXEL; + _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri"); } @@ -402,132 +93,26 @@ static void GLAPIENTRY _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - ctx->Pixel.ConvolutionBorderColor[c][0] = INT_TO_FLOAT(params[0]); - ctx->Pixel.ConvolutionBorderColor[c][1] = INT_TO_FLOAT(params[1]); - ctx->Pixel.ConvolutionBorderColor[c][2] = INT_TO_FLOAT(params[2]); - ctx->Pixel.ConvolutionBorderColor[c][3] = INT_TO_FLOAT(params[3]); - break; - case GL_CONVOLUTION_BORDER_MODE: - if (params[0] == (GLint) GL_REDUCE || - params[0] == (GLint) GL_CONSTANT_BORDER || - params[0] == (GLint) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(params)"); - return; - } - break; - case GL_CONVOLUTION_FILTER_SCALE: - /* COPY_4V(ctx->Pixel.ConvolutionFilterScale[c], params); */ - /* need cast to prevent compiler warnings */ - ctx->Pixel.ConvolutionFilterScale[c][0] = (GLfloat) params[0]; - ctx->Pixel.ConvolutionFilterScale[c][1] = (GLfloat) params[1]; - ctx->Pixel.ConvolutionFilterScale[c][2] = (GLfloat) params[2]; - ctx->Pixel.ConvolutionFilterScale[c][3] = (GLfloat) params[3]; - break; - case GL_CONVOLUTION_FILTER_BIAS: - /* COPY_4V(ctx->Pixel.ConvolutionFilterBias[c], params); */ - /* need cast to prevent compiler warnings */ - ctx->Pixel.ConvolutionFilterBias[c][0] = (GLfloat) params[0]; - ctx->Pixel.ConvolutionFilterBias[c][1] = (GLfloat) params[1]; - ctx->Pixel.ConvolutionFilterBias[c][2] = (GLfloat) params[2]; - ctx->Pixel.ConvolutionFilterBias[c][3] = (GLfloat) params[3]; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(pname)"); - return; - } - ctx->NewState |= _NEW_PIXEL; + _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv"); } static void GLAPIENTRY _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) { - GLint baseFormat; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (target != GL_CONVOLUTION_1D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter1D(width)"); - return; - } - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - return; /* no readbuffer - OK */ - } - - ctx->Driver.CopyConvolutionFilter1D( ctx, target, - internalFormat, x, y, width); + _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D"); } static void GLAPIENTRY _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { - GLint baseFormat; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_CONVOLUTION_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D(target)"); - return; - } - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter2D(width)"); - return; - } - if (height < 0 || height > MAX_CONVOLUTION_HEIGHT) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter2D(height)"); - return; - } - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - return; /* no readbuffer - OK */ - } - - ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, - width, height ); + _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D"); } @@ -535,58 +120,9 @@ static void GLAPIENTRY _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) { - struct gl_convolution_attrib *filter; - GLuint row; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)"); - return; - } - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionFilter(format or type)"); - return; - } - - switch (target) { - case GL_CONVOLUTION_1D: - filter = &(ctx->Convolution1D); - break; - case GL_CONVOLUTION_2D: - filter = &(ctx->Convolution2D); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionFilter(target)"); - return; - } - - image = _mesa_map_validate_pbo_dest(ctx, 2, &ctx->Pack, - filter->Width, filter->Height, 1, - format, type, image, - "glGetConvolutionFilter"); - if (!image) - return; - - for (row = 0; row < filter->Height; row++) { - GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width, - filter->Height, format, type, - row, 0); - GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4); - _mesa_pack_rgba_span_float(ctx, filter->Width, src, - format, type, dst, &ctx->Pack, 0x0); - } - - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter"); } @@ -594,60 +130,8 @@ static void GLAPIENTRY _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - const struct gl_convolution_attrib *conv; - GLuint c; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - conv = &ctx->Convolution1D; - break; - case GL_CONVOLUTION_2D: - c = 1; - conv = &ctx->Convolution2D; - break; - case GL_SEPARABLE_2D: - c = 2; - conv = &ctx->Separable2D; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv(target)"); - return; - } - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - COPY_4V(params, ctx->Pixel.ConvolutionBorderColor[c]); - break; - case GL_CONVOLUTION_BORDER_MODE: - *params = (GLfloat) ctx->Pixel.ConvolutionBorderMode[c]; - break; - case GL_CONVOLUTION_FILTER_SCALE: - COPY_4V(params, ctx->Pixel.ConvolutionFilterScale[c]); - break; - case GL_CONVOLUTION_FILTER_BIAS: - COPY_4V(params, ctx->Pixel.ConvolutionFilterBias[c]); - break; - case GL_CONVOLUTION_FORMAT: - *params = (GLfloat) conv->Format; - break; - case GL_CONVOLUTION_WIDTH: - *params = (GLfloat) conv->Width; - break; - case GL_CONVOLUTION_HEIGHT: - *params = (GLfloat) conv->Height; - break; - case GL_MAX_CONVOLUTION_WIDTH: - *params = (GLfloat) ctx->Const.MaxConvolutionWidth; - break; - case GL_MAX_CONVOLUTION_HEIGHT: - *params = (GLfloat) ctx->Const.MaxConvolutionHeight; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv(pname)"); - return; - } + _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv"); } @@ -655,69 +139,8 @@ static void GLAPIENTRY _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); - const struct gl_convolution_attrib *conv; - GLuint c; - ASSERT_OUTSIDE_BEGIN_END(ctx); - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - conv = &ctx->Convolution1D; - break; - case GL_CONVOLUTION_2D: - c = 1; - conv = &ctx->Convolution2D; - break; - case GL_SEPARABLE_2D: - c = 2; - conv = &ctx->Separable2D; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - params[0] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][0]); - params[1] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][1]); - params[2] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][2]); - params[3] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][3]); - break; - case GL_CONVOLUTION_BORDER_MODE: - *params = (GLint) ctx->Pixel.ConvolutionBorderMode[c]; - break; - case GL_CONVOLUTION_FILTER_SCALE: - params[0] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][0]; - params[1] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][1]; - params[2] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][2]; - params[3] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][3]; - break; - case GL_CONVOLUTION_FILTER_BIAS: - params[0] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][0]; - params[1] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][1]; - params[2] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][2]; - params[3] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][3]; - break; - case GL_CONVOLUTION_FORMAT: - *params = (GLint) conv->Format; - break; - case GL_CONVOLUTION_WIDTH: - *params = (GLint) conv->Width; - break; - case GL_CONVOLUTION_HEIGHT: - *params = (GLint) conv->Height; - break; - case GL_MAX_CONVOLUTION_WIDTH: - *params = (GLint) ctx->Const.MaxConvolutionWidth; - break; - case GL_MAX_CONVOLUTION_HEIGHT: - *params = (GLint) ctx->Const.MaxConvolutionHeight; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv(pname)"); - return; - } + _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv"); } @@ -725,720 +148,20 @@ static void GLAPIENTRY _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) { - const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; - struct gl_convolution_attrib *filter; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (target != GL_SEPARABLE_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter(target)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetConvolutionFilter(format or type)"); - return; - } - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionFilter(format or type)"); - return; - } - - filter = &ctx->Separable2D; - - /* Get row filter */ - row = _mesa_map_validate_pbo_dest(ctx, 1, &ctx->Pack, - filter->Width, 1, 1, - format, type, row, - "glGetConvolutionFilter"); - if (row) { - GLvoid *dst = _mesa_image_address1d(&ctx->Pack, row, filter->Width, - format, type, 0); - _mesa_pack_rgba_span_float(ctx, filter->Width, - (GLfloat (*)[4]) filter->Filter, - format, type, dst, &ctx->Pack, 0x0); - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); - } - - /* get column filter */ - column = _mesa_map_validate_pbo_dest(ctx, 1, &ctx->Pack, - filter->Height, 1, 1, - format, type, column, - "glGetConvolutionFilter"); - if (column) { - GLvoid *dst = _mesa_image_address1d(&ctx->Pack, column, filter->Height, - format, type, 0); - GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart); - _mesa_pack_rgba_span_float(ctx, filter->Height, src, - format, type, dst, &ctx->Pack, 0x0); - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); - } - - (void) span; /* unused at this time */ + _mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter"); } static void GLAPIENTRY _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) { - const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; - GLint baseFormat; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_SEPARABLE_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSeparableFilter2D(width)"); - return; - } - if (height < 0 || height > MAX_CONVOLUTION_HEIGHT) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSeparableFilter2D(height)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSeparableFilter2D(format or type)"); - return; - } - - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D(format or type)"); - return; - } - - ctx->Separable2D.Format = format; - ctx->Separable2D.InternalFormat = internalFormat; - ctx->Separable2D.Width = width; - ctx->Separable2D.Height = height; - - /* unpack row filter */ - row = _mesa_map_validate_pbo_source(ctx, 1, &ctx->Unpack, - width, 1, 1, - format, type, row, - "glSeparableFilter2D"); - if (row) { - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, - ctx->Separable2D.Filter, - format, type, row, &ctx->Unpack, - 0x0); /* transferOps */ - _mesa_scale_and_bias_rgba(width, - (GLfloat (*)[4]) ctx->Separable2D.Filter, - ctx->Pixel.ConvolutionFilterScale[2][0], - ctx->Pixel.ConvolutionFilterScale[2][1], - ctx->Pixel.ConvolutionFilterScale[2][2], - ctx->Pixel.ConvolutionFilterScale[2][3], - ctx->Pixel.ConvolutionFilterBias[2][0], - ctx->Pixel.ConvolutionFilterBias[2][1], - ctx->Pixel.ConvolutionFilterBias[2][2], - ctx->Pixel.ConvolutionFilterBias[2][3]); - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); - } - - /* unpack column filter */ - column = _mesa_map_validate_pbo_source(ctx, 1, &ctx->Unpack, - height, 1, 1, - format, type, column, - "glSeparableFilter2D"); - if (column) { - _mesa_unpack_color_span_float(ctx, height, GL_RGBA, - &ctx->Separable2D.Filter[colStart], - format, type, column, &ctx->Unpack, - 0); /* transferOps */ - - _mesa_scale_and_bias_rgba(height, - (GLfloat (*)[4]) (ctx->Separable2D.Filter + colStart), - ctx->Pixel.ConvolutionFilterScale[2][0], - ctx->Pixel.ConvolutionFilterScale[2][1], - ctx->Pixel.ConvolutionFilterScale[2][2], - ctx->Pixel.ConvolutionFilterScale[2][3], - ctx->Pixel.ConvolutionFilterBias[2][0], - ctx->Pixel.ConvolutionFilterBias[2][1], - ctx->Pixel.ConvolutionFilterBias[2][2], - ctx->Pixel.ConvolutionFilterBias[2][3]); - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); - } - - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } - - ctx->NewState |= _NEW_PIXEL; -} - - -/**********************************************************************/ -/*** image convolution functions ***/ -/**********************************************************************/ - -static void -convolve_1d_reduce(GLint srcWidth, const GLfloat src[][4], - GLint filterWidth, const GLfloat filter[][4], - GLfloat dest[][4]) -{ - GLint dstWidth; - GLint i, n; - - if (filterWidth >= 1) - dstWidth = srcWidth - (filterWidth - 1); - else - dstWidth = srcWidth; - - if (dstWidth <= 0) - return; /* null result */ - - for (i = 0; i < dstWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (n = 0; n < filterWidth; n++) { - sumR += src[i + n][RCOMP] * filter[n][RCOMP]; - sumG += src[i + n][GCOMP] * filter[n][GCOMP]; - sumB += src[i + n][BCOMP] * filter[n][BCOMP]; - sumA += src[i + n][ACOMP] * filter[n][ACOMP]; - } - dest[i][RCOMP] = sumR; - dest[i][GCOMP] = sumG; - dest[i][BCOMP] = sumB; - dest[i][ACOMP] = sumA; - } -} - - -static void -convolve_1d_constant(GLint srcWidth, const GLfloat src[][4], - GLint filterWidth, const GLfloat filter[][4], - GLfloat dest[][4], - const GLfloat borderColor[4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - GLint i, n; - - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (n = 0; n < filterWidth; n++) { - if (i + n < halfFilterWidth || i + n - halfFilterWidth >= srcWidth) { - sumR += borderColor[RCOMP] * filter[n][RCOMP]; - sumG += borderColor[GCOMP] * filter[n][GCOMP]; - sumB += borderColor[BCOMP] * filter[n][BCOMP]; - sumA += borderColor[ACOMP] * filter[n][ACOMP]; - } - else { - sumR += src[i + n - halfFilterWidth][RCOMP] * filter[n][RCOMP]; - sumG += src[i + n - halfFilterWidth][GCOMP] * filter[n][GCOMP]; - sumB += src[i + n - halfFilterWidth][BCOMP] * filter[n][BCOMP]; - sumA += src[i + n - halfFilterWidth][ACOMP] * filter[n][ACOMP]; - } - } - dest[i][RCOMP] = sumR; - dest[i][GCOMP] = sumG; - dest[i][BCOMP] = sumB; - dest[i][ACOMP] = sumA; - } -} - - -static void -convolve_1d_replicate(GLint srcWidth, const GLfloat src[][4], - GLint filterWidth, const GLfloat filter[][4], - GLfloat dest[][4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - GLint i, n; - - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (n = 0; n < filterWidth; n++) { - if (i + n < halfFilterWidth) { - sumR += src[0][RCOMP] * filter[n][RCOMP]; - sumG += src[0][GCOMP] * filter[n][GCOMP]; - sumB += src[0][BCOMP] * filter[n][BCOMP]; - sumA += src[0][ACOMP] * filter[n][ACOMP]; - } - else if (i + n - halfFilterWidth >= srcWidth) { - sumR += src[srcWidth - 1][RCOMP] * filter[n][RCOMP]; - sumG += src[srcWidth - 1][GCOMP] * filter[n][GCOMP]; - sumB += src[srcWidth - 1][BCOMP] * filter[n][BCOMP]; - sumA += src[srcWidth - 1][ACOMP] * filter[n][ACOMP]; - } - else { - sumR += src[i + n - halfFilterWidth][RCOMP] * filter[n][RCOMP]; - sumG += src[i + n - halfFilterWidth][GCOMP] * filter[n][GCOMP]; - sumB += src[i + n - halfFilterWidth][BCOMP] * filter[n][BCOMP]; - sumA += src[i + n - halfFilterWidth][ACOMP] * filter[n][ACOMP]; - } - } - dest[i][RCOMP] = sumR; - dest[i][GCOMP] = sumG; - dest[i][BCOMP] = sumB; - dest[i][ACOMP] = sumA; - } -} - - -static void -convolve_2d_reduce(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat filter[][4], - GLfloat dest[][4]) -{ - GLint dstWidth, dstHeight; - GLint i, j, n, m; - - if (filterWidth >= 1) - dstWidth = srcWidth - (filterWidth - 1); - else - dstWidth = srcWidth; - - if (filterHeight >= 1) - dstHeight = srcHeight - (filterHeight - 1); - else - dstHeight = srcHeight; - - if (dstWidth <= 0 || dstHeight <= 0) - return; - - for (j = 0; j < dstHeight; j++) { - for (i = 0; i < dstWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint k = (j + m) * srcWidth + i + n; - const GLint f = m * filterWidth + n; - sumR += src[k][RCOMP] * filter[f][RCOMP]; - sumG += src[k][GCOMP] * filter[f][GCOMP]; - sumB += src[k][BCOMP] * filter[f][BCOMP]; - sumA += src[k][ACOMP] * filter[f][ACOMP]; - } - } - dest[j * dstWidth + i][RCOMP] = sumR; - dest[j * dstWidth + i][GCOMP] = sumG; - dest[j * dstWidth + i][BCOMP] = sumB; - dest[j * dstWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_2d_constant(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat filter[][4], - GLfloat dest[][4], - const GLfloat borderColor[4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint f = m * filterWidth + n; - const GLint is = i + n - halfFilterWidth; - const GLint js = j + m - halfFilterHeight; - if (is < 0 || is >= srcWidth || - js < 0 || js >= srcHeight) { - sumR += borderColor[RCOMP] * filter[f][RCOMP]; - sumG += borderColor[GCOMP] * filter[f][GCOMP]; - sumB += borderColor[BCOMP] * filter[f][BCOMP]; - sumA += borderColor[ACOMP] * filter[f][ACOMP]; - } - else { - const GLint k = js * srcWidth + is; - sumR += src[k][RCOMP] * filter[f][RCOMP]; - sumG += src[k][GCOMP] * filter[f][GCOMP]; - sumB += src[k][BCOMP] * filter[f][BCOMP]; - sumA += src[k][ACOMP] * filter[f][ACOMP]; - } - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_2d_replicate(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat filter[][4], - GLfloat dest[][4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint f = m * filterWidth + n; - GLint is = i + n - halfFilterWidth; - GLint js = j + m - halfFilterHeight; - GLint k; - if (is < 0) - is = 0; - else if (is >= srcWidth) - is = srcWidth - 1; - if (js < 0) - js = 0; - else if (js >= srcHeight) - js = srcHeight - 1; - k = js * srcWidth + is; - sumR += src[k][RCOMP] * filter[f][RCOMP]; - sumG += src[k][GCOMP] * filter[f][GCOMP]; - sumB += src[k][BCOMP] * filter[f][BCOMP]; - sumA += src[k][ACOMP] * filter[f][ACOMP]; - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_sep_reduce(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat rowFilt[][4], - const GLfloat colFilt[][4], - GLfloat dest[][4]) -{ - GLint dstWidth, dstHeight; - GLint i, j, n, m; - - if (filterWidth >= 1) - dstWidth = srcWidth - (filterWidth - 1); - else - dstWidth = srcWidth; - - if (filterHeight >= 1) - dstHeight = srcHeight - (filterHeight - 1); - else - dstHeight = srcHeight; - if (dstWidth <= 0 || dstHeight <= 0) - return; - - for (j = 0; j < dstHeight; j++) { - for (i = 0; i < dstWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - GLint k = (j + m) * srcWidth + i + n; - sumR += src[k][RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += src[k][GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += src[k][BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += src[k][ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - } - dest[j * dstWidth + i][RCOMP] = sumR; - dest[j * dstWidth + i][GCOMP] = sumG; - dest[j * dstWidth + i][BCOMP] = sumB; - dest[j * dstWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_sep_constant(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat rowFilt[][4], - const GLfloat colFilt[][4], - GLfloat dest[][4], - const GLfloat borderColor[4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint is = i + n - halfFilterWidth; - const GLint js = j + m - halfFilterHeight; - if (is < 0 || is >= srcWidth || - js < 0 || js >= srcHeight) { - sumR += borderColor[RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += borderColor[GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += borderColor[BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += borderColor[ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - else { - GLint k = js * srcWidth + is; - sumR += src[k][RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += src[k][GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += src[k][BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += src[k][ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_sep_replicate(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat rowFilt[][4], - const GLfloat colFilt[][4], - GLfloat dest[][4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - GLint is = i + n - halfFilterWidth; - GLint js = j + m - halfFilterHeight; - GLint k; - if (is < 0) - is = 0; - else if (is >= srcWidth) - is = srcWidth - 1; - if (js < 0) - js = 0; - else if (js >= srcHeight) - js = srcHeight - 1; - k = js * srcWidth + is; - sumR += src[k][RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += src[k][GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += src[k][BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += src[k][ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - - -void -_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage) -{ - switch (ctx->Pixel.ConvolutionBorderMode[0]) { - case GL_REDUCE: - convolve_1d_reduce(*width, (const GLfloat (*)[4]) srcImage, - ctx->Convolution1D.Width, - (const GLfloat (*)[4]) ctx->Convolution1D.Filter, - (GLfloat (*)[4]) dstImage); - *width = *width - (MAX2(ctx->Convolution1D.Width, 1) - 1); - break; - case GL_CONSTANT_BORDER: - convolve_1d_constant(*width, (const GLfloat (*)[4]) srcImage, - ctx->Convolution1D.Width, - (const GLfloat (*)[4]) ctx->Convolution1D.Filter, - (GLfloat (*)[4]) dstImage, - ctx->Pixel.ConvolutionBorderColor[0]); - break; - case GL_REPLICATE_BORDER: - convolve_1d_replicate(*width, (const GLfloat (*)[4]) srcImage, - ctx->Convolution1D.Width, - (const GLfloat (*)[4]) ctx->Convolution1D.Filter, - (GLfloat (*)[4]) dstImage); - break; - default: - ; - } -} - - -void -_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage) -{ - switch (ctx->Pixel.ConvolutionBorderMode[1]) { - case GL_REDUCE: - convolve_2d_reduce(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Convolution2D.Width, - ctx->Convolution2D.Height, - (const GLfloat (*)[4]) ctx->Convolution2D.Filter, - (GLfloat (*)[4]) dstImage); - *width = *width - (MAX2(ctx->Convolution2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Convolution2D.Height, 1) - 1); - break; - case GL_CONSTANT_BORDER: - convolve_2d_constant(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Convolution2D.Width, - ctx->Convolution2D.Height, - (const GLfloat (*)[4]) ctx->Convolution2D.Filter, - (GLfloat (*)[4]) dstImage, - ctx->Pixel.ConvolutionBorderColor[1]); - break; - case GL_REPLICATE_BORDER: - convolve_2d_replicate(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Convolution2D.Width, - ctx->Convolution2D.Height, - (const GLfloat (*)[4])ctx->Convolution2D.Filter, - (GLfloat (*)[4]) dstImage); - break; - default: - ; - } -} - - -void -_mesa_convolve_sep_image(const GLcontext *ctx, - GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage) -{ - const GLfloat *rowFilter = ctx->Separable2D.Filter; - const GLfloat *colFilter = rowFilter + 4 * MAX_CONVOLUTION_WIDTH; - - switch (ctx->Pixel.ConvolutionBorderMode[2]) { - case GL_REDUCE: - convolve_sep_reduce(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Separable2D.Width, - ctx->Separable2D.Height, - (const GLfloat (*)[4]) rowFilter, - (const GLfloat (*)[4]) colFilter, - (GLfloat (*)[4]) dstImage); - *width = *width - (MAX2(ctx->Separable2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); - break; - case GL_CONSTANT_BORDER: - convolve_sep_constant(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Separable2D.Width, - ctx->Separable2D.Height, - (const GLfloat (*)[4]) rowFilter, - (const GLfloat (*)[4]) colFilter, - (GLfloat (*)[4]) dstImage, - ctx->Pixel.ConvolutionBorderColor[2]); - break; - case GL_REPLICATE_BORDER: - convolve_sep_replicate(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Separable2D.Width, - ctx->Separable2D.Height, - (const GLfloat (*)[4]) rowFilter, - (const GLfloat (*)[4]) colFilter, - (GLfloat (*)[4]) dstImage); - break; - default: - ; - } + _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D"); } - - -/* - * This function computes an image's size after convolution. - * If the convolution border mode is GL_REDUCE, the post-convolution - * image will be smaller than the original. - */ -void -_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height) -{ - if (ctx->Pixel.Convolution1DEnabled - && dimensions == 1 - && ctx->Pixel.ConvolutionBorderMode[0] == GL_REDUCE) { - *width = *width - (MAX2(ctx->Convolution1D.Width, 1) - 1); - } - else if (ctx->Pixel.Convolution2DEnabled - && dimensions > 1 - && ctx->Pixel.ConvolutionBorderMode[1] == GL_REDUCE) { - *width = *width - (MAX2(ctx->Convolution2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Convolution2D.Height, 1) - 1); - } - else if (ctx->Pixel.Separable2DEnabled - && dimensions > 1 - && ctx->Pixel.ConvolutionBorderMode[2] == GL_REDUCE) { - *width = *width - (MAX2(ctx->Separable2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); - } -} - - void _mesa_init_convolve_dispatch(struct _glapi_table *disp) { diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h index 80caf942fb..0277917433 100644 --- a/src/mesa/main/convolve.h +++ b/src/mesa/main/convolve.h @@ -33,32 +33,6 @@ #if FEATURE_convolve -extern void GLAPIENTRY -_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, - GLenum format, GLenum type, const GLvoid *image); - -extern void GLAPIENTRY -_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, - GLsizei height, GLenum format, GLenum type, - const GLvoid *image); - -extern void -_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage); - -extern void -_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - -extern void -_mesa_convolve_sep_image(const GLcontext *ctx, - GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - -extern void -_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height); - extern void _mesa_init_convolve_dispatch(struct _glapi_table *disp); @@ -66,50 +40,6 @@ _mesa_init_convolve_dispatch(struct _glapi_table *disp); #include "main/compiler.h" -static INLINE void GLAPIENTRY -_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, - GLenum format, GLenum type, const GLvoid *image) -{ - ASSERT_NO_FEATURE(); -} - -static INLINE void GLAPIENTRY -_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, - GLsizei height, GLenum format, GLenum type, - const GLvoid *image) -{ - ASSERT_NO_FEATURE(); -} - -static INLINE void -_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage) -{ - ASSERT_NO_FEATURE(); -} - -static INLINE void -_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage) -{ - ASSERT_NO_FEATURE(); -} - - -static INLINE void -_mesa_convolve_sep_image(const GLcontext *ctx, - GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage) -{ - ASSERT_NO_FEATURE(); -} - -static INLINE void -_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height) -{ -} - static INLINE void _mesa_init_convolve_dispatch(struct _glapi_table *disp) { diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 8a20a66363..46d26cf901 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -558,15 +558,6 @@ struct dd_function_table { void (*CopyColorSubTable)( GLcontext *ctx, GLenum target, GLsizei start, GLint x, GLint y, GLsizei width ); - - void (*CopyConvolutionFilter1D)( GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width ); - - void (*CopyConvolutionFilter2D)( GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLsizei height ); /*@}*/ diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 2c8c000f9f..15ce2d1225 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -712,29 +712,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled = state; break; - /* GL_EXT_convolution */ - case GL_CONVOLUTION_1D: - CHECK_EXTENSION(EXT_convolution, cap); - if (ctx->Pixel.Convolution1DEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.Convolution1DEnabled = state; - break; - case GL_CONVOLUTION_2D: - CHECK_EXTENSION(EXT_convolution, cap); - if (ctx->Pixel.Convolution2DEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.Convolution2DEnabled = state; - break; - case GL_SEPARABLE_2D: - CHECK_EXTENSION(EXT_convolution, cap); - if (ctx->Pixel.Separable2DEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.Separable2DEnabled = state; - break; - /* GL_ARB_texture_cube_map */ case GL_TEXTURE_CUBE_MAP_ARB: CHECK_EXTENSION(ARB_texture_cube_map, cap); @@ -1327,17 +1304,6 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION(SGI_texture_color_table); return ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled; - /* GL_EXT_convolution */ - case GL_CONVOLUTION_1D: - CHECK_EXTENSION(EXT_convolution); - return ctx->Pixel.Convolution1DEnabled; - case GL_CONVOLUTION_2D: - CHECK_EXTENSION(EXT_convolution); - return ctx->Pixel.Convolution2DEnabled; - case GL_SEPARABLE_2D: - CHECK_EXTENSION(EXT_convolution); - return ctx->Pixel.Separable2DEnabled; - /* GL_ARB_texture_cube_map */ case GL_TEXTURE_CUBE_MAP_ARB: CHECK_EXTENSION(ARB_texture_cube_map); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 3f86973e3e..c5febc77cf 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -116,7 +116,6 @@ static const struct { { OFF, "GL_EXT_clip_volume_hint", F(EXT_clip_volume_hint) }, { OFF, "GL_EXT_cull_vertex", F(EXT_cull_vertex) }, { ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) }, - { OFF, "GL_EXT_convolution", F(EXT_convolution) }, { 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) }, @@ -303,7 +302,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_logic_op = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_convolution = GL_TRUE; ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; @@ -393,7 +391,6 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_logic_op = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_convolution = GL_TRUE; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 33ea81b83a..cb456fb64d 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -276,7 +276,6 @@ EXTRA_EXT(NV_fragment_program); EXTRA_EXT(NV_texture_rectangle); EXTRA_EXT(EXT_stencil_two_side); EXTRA_EXT(NV_light_max_exponent); -EXTRA_EXT(EXT_convolution); EXTRA_EXT(SGI_texture_color_table); EXTRA_EXT(EXT_depth_bounds_test); EXTRA_EXT(ARB_depth_clamp); @@ -880,38 +879,6 @@ static const struct value_desc values[] = { CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA }, { GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA }, - /* GL_EXT_convolution (also in 1.2 imaging) */ - { GL_CONVOLUTION_1D_EXT, CONTEXT_BOOL(Pixel.Convolution1DEnabled), - extra_EXT_convolution }, - { GL_CONVOLUTION_2D_EXT, CONTEXT_BOOL(Pixel.Convolution2DEnabled), - extra_EXT_convolution }, - { GL_SEPARABLE_2D_EXT, CONTEXT_BOOL(Pixel.Separable2DEnabled), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_RED_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[0]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_GREEN_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[1]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_BLUE_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[2]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_ALPHA_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[3]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_RED_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[0]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_GREEN_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[1]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_BLUE_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[2]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_ALPHA_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[3]), - extra_EXT_convolution }, - /* GL_SGI_texture_color_table */ { GL_TEXTURE_COLOR_TABLE_SGI, LOC_TEXUNIT, TYPE_BOOLEAN, offsetof(struct gl_texture_unit, ColorTableEnabled), diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 788584ae85..029d2fef8a 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1866,23 +1866,7 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, if (transferOps & IMAGE_MAP_COLOR_BIT) { _mesa_map_rgba( ctx, n, rgba ); } - /* convolution */ - if (transferOps & IMAGE_CONVOLUTION_BIT) { - /* this has to be done in the calling code */ - _mesa_problem(ctx, "IMAGE_CONVOLUTION_BIT set in _mesa_apply_transfer_ops"); - } - /* GL_POST_CONVOLUTION_RED/GREEN/BLUE/ALPHA_SCALE/BIAS */ - if (transferOps & IMAGE_POST_CONVOLUTION_SCALE_BIAS) { - _mesa_scale_and_bias_rgba(n, rgba, - ctx->Pixel.PostConvolutionScale[RCOMP], - ctx->Pixel.PostConvolutionScale[GCOMP], - ctx->Pixel.PostConvolutionScale[BCOMP], - ctx->Pixel.PostConvolutionScale[ACOMP], - ctx->Pixel.PostConvolutionBias[RCOMP], - ctx->Pixel.PostConvolutionBias[GCOMP], - ctx->Pixel.PostConvolutionBias[BCOMP], - ctx->Pixel.PostConvolutionBias[ACOMP]); - } + /* clamping to [0,1] */ if (transferOps & IMAGE_CLAMP_BIT) { GLuint i; @@ -1988,8 +1972,7 @@ _mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n, /** * Used to pack an array [][4] of RGBA float colors as specified - * by the dstFormat, dstType and dstPacking. Used by glReadPixels, - * glGetConvolutionFilter(), etc. + * by the dstFormat, dstType and dstPacking. Used by glReadPixels. * Note: the rgba values will be modified by this function when any pixel * transfer ops are enabled. */ diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index c982f55e82..d7c5d28c2c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -800,20 +800,6 @@ struct gl_hint_attrib GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */ }; - -/** - * Image convolution state. - */ -struct gl_convolution_attrib -{ - GLenum Format; - GLenum InternalFormat; - GLuint Width; - GLuint Height; - GLfloat Filter[MAX_CONVOLUTION_WIDTH * MAX_CONVOLUTION_HEIGHT * 4]; -}; - - /** * Light state flags. */ @@ -954,17 +940,6 @@ struct gl_pixel_attrib GLboolean MapColorFlag; GLboolean MapStencilFlag; - /* Convolution (GL_EXT_convolution) */ - GLboolean Convolution1DEnabled; - GLboolean Convolution2DEnabled; - GLboolean Separable2DEnabled; - GLfloat ConvolutionBorderColor[3][4]; /**< RGBA */ - GLenum ConvolutionBorderMode[3]; - GLfloat ConvolutionFilterScale[3][4]; /**< RGBA */ - GLfloat ConvolutionFilterBias[3][4]; /**< RGBA */ - GLfloat PostConvolutionScale[4]; /**< RGBA */ - GLfloat PostConvolutionBias[4]; /**< RGBA */ - /*--- End Pixel Transfer State ---*/ /** glPixelZoom */ @@ -2528,8 +2503,6 @@ struct gl_constants GLfloat LineWidthGranularity; GLuint MaxColorTableSize; - GLuint MaxConvolutionWidth; - GLuint MaxConvolutionHeight; GLuint MaxClipPlanes; GLuint MaxLights; @@ -2652,7 +2625,6 @@ struct gl_extensions GLboolean EXT_blend_subtract; GLboolean EXT_clip_volume_hint; GLboolean EXT_cull_vertex; - GLboolean EXT_convolution; GLboolean EXT_compiled_vertex_array; GLboolean EXT_copy_texture; GLboolean EXT_depth_bounds_test; @@ -2769,20 +2741,13 @@ struct gl_matrix_stack #define IMAGE_SCALE_BIAS_BIT 0x1 #define IMAGE_SHIFT_OFFSET_BIT 0x2 #define IMAGE_MAP_COLOR_BIT 0x4 -#define IMAGE_CONVOLUTION_BIT 0x10 -#define IMAGE_POST_CONVOLUTION_SCALE_BIAS 0x20 #define IMAGE_CLAMP_BIT 0x800 -/** Pixel Transfer ops up to convolution */ -#define IMAGE_PRE_CONVOLUTION_BITS (IMAGE_SCALE_BIAS_BIT | \ - IMAGE_SHIFT_OFFSET_BIT | \ - IMAGE_MAP_COLOR_BIT) - -/** Pixel transfer ops after convolution */ -#define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS) -/*@}*/ - +/** Pixel Transfer ops */ +#define IMAGE_BITS (IMAGE_SCALE_BIAS_BIT | \ + IMAGE_SHIFT_OFFSET_BIT | \ + IMAGE_MAP_COLOR_BIT) /** * \name Bits to indicate what state has changed. @@ -3135,9 +3100,6 @@ struct __GLcontextRec /** \name Other assorted state (not pushed/popped on attribute stack) */ /*@{*/ struct gl_pixelmaps PixelMaps; - struct gl_convolution_attrib Convolution1D; - struct gl_convolution_attrib Convolution2D; - struct gl_convolution_attrib Separable2D; struct gl_evaluators EvalMap; /**< All evaluators */ struct gl_feedback Feedback; /**< Feedback */ diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 5e900b4eed..1d378e4d9f 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -566,54 +566,6 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param ) FLUSH_VERTICES(ctx, _NEW_PIXEL); ctx->Pixel.DepthBias = param; break; - case GL_POST_CONVOLUTION_RED_SCALE: - if (ctx->Pixel.PostConvolutionScale[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[0] = param; - break; - case GL_POST_CONVOLUTION_RED_BIAS: - if (ctx->Pixel.PostConvolutionBias[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[0] = param; - break; - case GL_POST_CONVOLUTION_GREEN_SCALE: - if (ctx->Pixel.PostConvolutionScale[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[1] = param; - break; - case GL_POST_CONVOLUTION_GREEN_BIAS: - if (ctx->Pixel.PostConvolutionBias[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[1] = param; - break; - case GL_POST_CONVOLUTION_BLUE_SCALE: - if (ctx->Pixel.PostConvolutionScale[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[2] = param; - break; - case GL_POST_CONVOLUTION_BLUE_BIAS: - if (ctx->Pixel.PostConvolutionBias[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[2] = param; - break; - case GL_POST_CONVOLUTION_ALPHA_SCALE: - if (ctx->Pixel.PostConvolutionScale[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[3] = param; - break; - case GL_POST_CONVOLUTION_ALPHA_BIAS: - if (ctx->Pixel.PostConvolutionBias[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[3] = param; - break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glPixelTransfer(pname)" ); return; @@ -654,22 +606,6 @@ update_image_transfer_state(GLcontext *ctx) if (ctx->Pixel.MapColorFlag) mask |= IMAGE_MAP_COLOR_BIT; - if (ctx->Pixel.Convolution1DEnabled || - ctx->Pixel.Convolution2DEnabled || - ctx->Pixel.Separable2DEnabled) { - mask |= IMAGE_CONVOLUTION_BIT; - if (ctx->Pixel.PostConvolutionScale[0] != 1.0F || - ctx->Pixel.PostConvolutionScale[1] != 1.0F || - ctx->Pixel.PostConvolutionScale[2] != 1.0F || - ctx->Pixel.PostConvolutionScale[3] != 1.0F || - ctx->Pixel.PostConvolutionBias[0] != 0.0F || - ctx->Pixel.PostConvolutionBias[1] != 0.0F || - ctx->Pixel.PostConvolutionBias[2] != 0.0F || - ctx->Pixel.PostConvolutionBias[3] != 0.0F) { - mask |= IMAGE_POST_CONVOLUTION_SCALE_BIAS; - } - } - ctx->_ImageTransferState = mask; } @@ -721,8 +657,6 @@ init_pixelmap(struct gl_pixelmap *map) void _mesa_init_pixel( GLcontext *ctx ) { - int i; - /* Pixel group */ ctx->Pixel.RedBias = 0.0; ctx->Pixel.RedScale = 1.0; @@ -750,22 +684,6 @@ _mesa_init_pixel( GLcontext *ctx ) init_pixelmap(&ctx->PixelMaps.GtoG); init_pixelmap(&ctx->PixelMaps.BtoB); init_pixelmap(&ctx->PixelMaps.AtoA); - ctx->Pixel.Convolution1DEnabled = GL_FALSE; - ctx->Pixel.Convolution2DEnabled = GL_FALSE; - ctx->Pixel.Separable2DEnabled = GL_FALSE; - for (i = 0; i < 3; i++) { - ASSIGN_4V(ctx->Pixel.ConvolutionBorderColor[i], 0.0, 0.0, 0.0, 0.0); - ctx->Pixel.ConvolutionBorderMode[i] = GL_REDUCE; - ASSIGN_4V(ctx->Pixel.ConvolutionFilterScale[i], 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.ConvolutionFilterBias[i], 0.0, 0.0, 0.0, 0.0); - } - for (i = 0; i < MAX_CONVOLUTION_WIDTH * MAX_CONVOLUTION_WIDTH * 4; i++) { - ctx->Convolution1D.Filter[i] = 0.0; - ctx->Convolution2D.Filter[i] = 0.0; - ctx->Separable2D.Filter[i] = 0.0; - } - ASSIGN_4V(ctx->Pixel.PostConvolutionScale, 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.PostConvolutionBias, 0.0, 0.0, 0.0, 0.0); /* GL_SGI_texture_color_table */ ASSIGN_4V(ctx->Pixel.TextureColorTableScale, 1.0, 1.0, 1.0, 1.0); ASSIGN_4V(ctx->Pixel.TextureColorTableBias, 0.0, 0.0, 0.0, 0.0); diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index c8b45bd3a5..3d8996c2fd 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -32,7 +32,6 @@ #include "glheader.h" #include "imports.h" #include "colormac.h" -#include "convolve.h" #include "image.h" #include "macros.h" #include "mipmap.h" @@ -86,7 +85,6 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) srcPacking); if (!tempImage) return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); pixels = tempImage; srcRowStride = 3 * srcWidth; srcFormat = GL_RGB; @@ -143,7 +141,6 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) srcPacking); if (!tempImage) return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); pixels = tempImage; srcRowStride = 4 * srcWidth; srcFormat = GL_RGBA; diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 8e05980262..551203f012 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -36,7 +36,6 @@ #include "glheader.h" #include "imports.h" #include "colormac.h" -#include "convolve.h" #include "dlopen.h" #include "image.h" #include "macros.h" @@ -187,7 +186,6 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) srcPacking); if (!tempImage) return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); pixels = tempImage; srcRowStride = 3 * srcWidth; srcFormat = GL_RGB; @@ -250,7 +248,6 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) srcPacking); if (!tempImage) return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); pixels = tempImage; srcRowStride = 4 * srcWidth; srcFormat = GL_RGBA; @@ -312,7 +309,6 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) srcPacking); if (!tempImage) return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); pixels = tempImage; srcRowStride = 4 * srcWidth; } @@ -373,7 +369,6 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) srcPacking); if (!tempImage) return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); pixels = tempImage; srcRowStride = 4 * srcWidth; } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index ca1bd6096e..614f0014da 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -33,7 +33,6 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" -#include "convolve.h" #include "enums.h" #include "fbobject.h" #include "framebuffer.h" @@ -2243,12 +2242,6 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, internalFormat = override_internal_format(internalFormat, width, 1); -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - if (target == GL_TEXTURE_1D) { /* non-proxy target */ struct gl_texture_object *texObj; @@ -2354,13 +2347,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, internalFormat = override_internal_format(internalFormat, width, height); -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, - &postConvHeight); - } -#endif - if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && @@ -2649,13 +2635,6 @@ _mesa_TexSubImage1D( GLenum target, GLint level, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); -#if FEATURE_convolve - /* XXX should test internal format */ - if (_mesa_is_color_format(format)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, 1, format, type)) { return; /* error was detected */ @@ -2715,14 +2694,6 @@ _mesa_TexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); -#if FEATURE_convolve - /* XXX should test internal format */ - if (_mesa_is_color_format(format)) { - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, - &postConvHeight); - } -#endif - if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight, 1, format, type)) { return; /* error was detected */ @@ -2843,12 +2814,6 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - if (copytexture_error_check(ctx, 1, target, level, internalFormat, postConvWidth, 1, border)) return; @@ -2918,13 +2883,6 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, - &postConvHeight); - } -#endif - if (copytexture_error_check(ctx, 2, target, level, internalFormat, postConvWidth, postConvHeight, border)) return; @@ -3004,12 +2962,6 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); -#if FEATURE_convolve - if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - if (copytexsubimage_error_check2(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, texImage)) { @@ -3064,13 +3016,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); -#if FEATURE_convolve - if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, - &postConvWidth, &postConvHeight); - } -#endif - if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight, @@ -3127,13 +3072,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); -#if FEATURE_convolve - if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, - &postConvWidth, &postConvHeight); - } -#endif - if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight, texImage)) { diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 2989fdb72e..a1574e6cd8 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -45,7 +45,7 @@ * Texture image processing is actually kind of complicated. We have to do: * Format/type conversions * pixel unpacking - * pixel transfer (scale, bais, lookup, convolution!, etc) + * pixel transfer (scale, bais, lookup, etc) * * These functions can handle most everything, including processing full * images and sub-images. @@ -55,7 +55,6 @@ #include "glheader.h" #include "bufferobj.h" #include "colormac.h" -#include "convolve.h" #include "image.h" #include "macros.h" #include "mipmap.h" @@ -310,6 +309,11 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, { GLuint transferOps = ctx->_ImageTransferState; GLfloat *tempImage; + const GLint components = _mesa_components_in_format(logicalBaseFormat); + const GLint srcStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); + GLfloat *dst; + GLint img, row; ASSERT(dims >= 1 && dims <= 3); @@ -331,126 +335,24 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, textureBaseFormat == GL_COLOR_INDEX || textureBaseFormat == GL_DEPTH_COMPONENT); - /* conventional color image */ - - if ((dims == 1 && ctx->Pixel.Convolution1DEnabled) || - (dims >= 2 && ctx->Pixel.Convolution2DEnabled) || - (dims >= 2 && ctx->Pixel.Separable2DEnabled)) { - /* need image convolution */ - const GLuint preConvTransferOps - = (transferOps & IMAGE_PRE_CONVOLUTION_BITS) | IMAGE_CLAMP_BIT; - const GLuint postConvTransferOps - = (transferOps & IMAGE_POST_CONVOLUTION_BITS) | IMAGE_CLAMP_BIT; - GLint img, row; - GLint convWidth = srcWidth, convHeight = srcHeight; - GLfloat *convImage; - - /* pre-convolution image buffer (3D) */ - tempImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth - * 4 * sizeof(GLfloat)); - if (!tempImage) - return NULL; - - /* post-convolution image buffer (2D) */ - convImage = (GLfloat *) malloc(srcWidth * srcHeight - * 4 * sizeof(GLfloat)); - if (!convImage) { - free(tempImage); - return NULL; - } - - /* loop over 3D image slices */ - for (img = 0; img < srcDepth; img++) { - GLfloat *dst = tempImage + img * (srcWidth * srcHeight * 4); - - /* unpack and do transfer ops up to convolution */ - for (row = 0; row < srcHeight; row++) { - const GLvoid *src = _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, - srcFormat, srcType, img, row, 0); - _mesa_unpack_color_span_float(ctx, srcWidth, GL_RGBA, dst, - srcFormat, srcType, src, - srcPacking, - preConvTransferOps); - dst += srcWidth * 4; - } - - /* size after optional convolution */ - convWidth = srcWidth; - convHeight = srcHeight; - -#if FEATURE_convolve - /* do convolution */ - { - GLfloat *src = tempImage + img * (srcWidth * srcHeight * 4); - if (dims == 1) { - ASSERT(ctx->Pixel.Convolution1DEnabled); - _mesa_convolve_1d_image(ctx, &convWidth, src, convImage); - } - else { - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &convWidth, &convHeight, - src, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &convWidth, &convHeight, - src, convImage); - } - } - } -#endif - /* do post-convolution transfer and pack into tempImage */ - { - const GLint logComponents - = _mesa_components_in_format(logicalBaseFormat); - const GLfloat *src = convImage; - GLfloat *dst = tempImage + img * (convWidth * convHeight * 4); - for (row = 0; row < convHeight; row++) { - _mesa_pack_rgba_span_float(ctx, convWidth, - (GLfloat (*)[4]) src, - logicalBaseFormat, GL_FLOAT, - dst, &ctx->DefaultPacking, - postConvTransferOps); - src += convWidth * 4; - dst += convWidth * logComponents; - } - } - } /* loop over 3D image slices */ - - free(convImage); - - /* might need these below */ - srcWidth = convWidth; - srcHeight = convHeight; - } - else { - /* no convolution */ - const GLint components = _mesa_components_in_format(logicalBaseFormat); - const GLint srcStride = - _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); - GLfloat *dst; - GLint img, row; - - tempImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth - * components * sizeof(GLfloat)); - if (!tempImage) - return NULL; + tempImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth + * components * sizeof(GLfloat)); + if (!tempImage) + return NULL; - dst = tempImage; - for (img = 0; img < srcDepth; img++) { - const GLubyte *src - = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); - for (row = 0; row < srcHeight; row++) { - _mesa_unpack_color_span_float(ctx, srcWidth, logicalBaseFormat, - dst, srcFormat, srcType, src, - srcPacking, transferOps); - dst += srcWidth * components; - src += srcStride; - } + dst = tempImage; + for (img = 0; img < srcDepth; img++) { + const GLubyte *src + = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, + srcWidth, srcHeight, + srcFormat, srcType, + img, 0, 0); + for (row = 0; row < srcHeight; row++) { + _mesa_unpack_color_span_float(ctx, srcWidth, logicalBaseFormat, + dst, srcFormat, srcType, src, + srcPacking, transferOps); + dst += srcWidth * components; + src += srcStride; } } @@ -536,7 +438,6 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, { GLuint transferOps = ctx->_ImageTransferState; const GLint components = _mesa_components_in_format(logicalBaseFormat); - GLboolean freeSrcImage = GL_FALSE; GLint img, row; GLchan *tempImage, *dst; @@ -556,37 +457,10 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, textureBaseFormat == GL_ALPHA || textureBaseFormat == GL_INTENSITY); -#if FEATURE_convolve - if ((dims == 1 && ctx->Pixel.Convolution1DEnabled) || - (dims >= 2 && ctx->Pixel.Convolution2DEnabled) || - (dims >= 2 && ctx->Pixel.Separable2DEnabled)) { - /* get convolved image */ - GLfloat *convImage = make_temp_float_image(ctx, dims, - logicalBaseFormat, - logicalBaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, - srcAddr, srcPacking); - if (!convImage) - return NULL; - /* the convolved image is our new source image */ - srcAddr = convImage; - srcFormat = logicalBaseFormat; - srcType = GL_FLOAT; - srcPacking = &ctx->DefaultPacking; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - transferOps = 0; - freeSrcImage = GL_TRUE; - } -#endif - /* unpack and transfer the source image */ tempImage = (GLchan *) malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLchan)); if (!tempImage) { - if (freeSrcImage) { - free((void *) srcAddr); - } return NULL; } @@ -608,11 +482,6 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, } } - /* If we made a temporary image for convolution, free it here */ - if (freeSrcImage) { - free((void *) srcAddr); - } - if (logicalBaseFormat != textureBaseFormat) { /* one more conversion step */ GLint texComponents = _mesa_components_in_format(textureBaseFormat); @@ -1238,7 +1107,6 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -1365,7 +1233,6 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -1567,7 +1434,6 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -1697,7 +1563,6 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -1824,7 +1689,6 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -1882,7 +1746,6 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -1951,7 +1814,6 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2010,7 +1872,6 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2115,7 +1976,6 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2186,7 +2046,6 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2257,7 +2116,6 @@ _mesa_texstore_rgba_16(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2327,8 +2185,6 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS) if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - /* Note: tempImage is always float[4] / RGBA. We convert to 1, 2, * 3 or 4 components/pixel here. */ @@ -2390,7 +2246,6 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2479,7 +2334,6 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2710,7 +2564,6 @@ _mesa_texstore_signed_r8(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2755,7 +2608,6 @@ _mesa_texstore_signed_rg88(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2800,7 +2652,6 @@ _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -2912,7 +2763,6 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) GLint img, row, col; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -3186,7 +3036,6 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); bytesPerRow = srcWidth * components * sizeof(GLfloat); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr @@ -3254,7 +3103,6 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -3318,7 +3166,6 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -3382,7 +3229,6 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -3446,7 +3292,6 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -3510,7 +3355,6 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -3574,7 +3418,6 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -3638,7 +3481,6 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS) GLint img, row; if (!tempImage) return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] * texelBytes @@ -4057,9 +3899,6 @@ texture_row_stride(const struct gl_texture_image *texImage) * This is the software fallback for Driver.TexImage1D() * and Driver.CopyTexImage1D(). * \sa _mesa_store_teximage2d() - * Note that the width may not be the actual texture width since it may - * be changed by convolution w/ GL_REDUCE. The texImage->Width field will - * have the actual texture size. */ void _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, @@ -4114,9 +3953,6 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, * * This function is oriented toward storing images in main memory, rather * than VRAM. Device driver's can easily plug in their own replacement. - * - * Note: width and height may be pre-convolved dimensions, but - * texImage->Width and texImage->Height will be post-convolved dimensions. */ void _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 6ab03ec939..d9e9a527f6 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -338,9 +338,6 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, assert(ctx->ReadBuffer->Width > 0); - /* XXX convolution not done yet */ - assert((transferOps & IMAGE_CONVOLUTION_BIT) == 0); - st_validate_state(st); /* Do all needed clipping here, so that we can forget about it later */ diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 0a4f8508ec..526417df3b 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -545,11 +545,6 @@ st_TexImage(GLcontext * ctx, DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__, _mesa_lookup_enum_by_nr(target), level, width, height, depth, border); - /* The Mesa/Gallium state tracker does not implement the imaging extensions - * such as convolution. - */ - assert(!ctx->Extensions.EXT_convolution); - /* switch to "normal" */ if (stObj->surface_based) { _mesa_clear_texture_object(ctx, texObj); diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index a9b4cb8081..c35494e385 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -27,7 +27,6 @@ #include "main/context.h" #include "main/colormac.h" #include "main/condrender.h" -#include "main/convolve.h" #include "main/image.h" #include "main/macros.h" #include "main/imports.h" @@ -93,98 +92,6 @@ regions_overlap(GLint srcx, GLint srcy, } -/** - * RGBA copypixels with convolution. - */ -static void -copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, - GLint width, GLint height, GLint destx, GLint desty) -{ - GLint row; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLbitfield transferOps = ctx->_ImageTransferState; - GLfloat *dest, *tmpImage, *convImage; - SWspan span; - - INIT_SPAN(span, GL_BITMAP); - _swrast_span_default_attribs(ctx, &span); - span.arrayMask = SPAN_RGBA; - span.arrayAttribs = FRAG_BIT_COL0; - - /* allocate space for GLfloat image */ - tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - if (!tmpImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - return; - } - convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - if (!convImage) { - free(tmpImage); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - return; - } - - /* read source image as float/RGBA */ - dest = tmpImage; - for (row = 0; row < height; row++) { - _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, srcy + row, GL_FLOAT, dest); - dest += 4 * width; - } - - /* do the image transfer ops which preceed convolution */ - for (row = 0; row < height; row++) { - GLfloat (*rgba)[4] = (GLfloat (*)[4]) (tmpImage + row * width * 4); - _mesa_apply_rgba_transfer_ops(ctx, - transferOps & IMAGE_PRE_CONVOLUTION_BITS, - width, rgba); - } - - /* do convolution */ - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); - } - free(tmpImage); - - /* do remaining post-convolution image transfer ops */ - for (row = 0; row < height; row++) { - GLfloat (*rgba)[4] = (GLfloat (*)[4]) (convImage + row * width * 4); - _mesa_apply_rgba_transfer_ops(ctx, - transferOps & IMAGE_POST_CONVOLUTION_BITS, - width, rgba); - } - - /* write the new image */ - for (row = 0; row < height; row++) { - const GLfloat *src = convImage + row * width * 4; - GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; - - /* copy convolved colors into span array */ - memcpy(rgba, src, width * 4 * sizeof(GLfloat)); - - /* write span */ - span.x = destx; - span.y = desty + row; - span.end = width; - span.array->ChanType = GL_FLOAT; - if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); - } - } - /* restore this */ - span.array->ChanType = CHAN_TYPE; - - free(convImage); -} - - /** * RGBA copypixels */ @@ -204,16 +111,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, return; } - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { - copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty); - return; - } - else if (ctx->Pixel.Convolution1DEnabled) { - /* make sure we don't apply 1D convolution */ - transferOps &= ~(IMAGE_CONVOLUTION_BIT | - IMAGE_POST_CONVOLUTION_SCALE_BIAS); - } - if (ctx->DrawBuffer == ctx->ReadBuffer) { overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 9bc0e9043b..7778820c5c 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -27,7 +27,6 @@ #include "main/bufferobj.h" #include "main/condrender.h" #include "main/context.h" -#include "main/convolve.h" #include "main/image.h" #include "main/macros.h" #include "main/imports.h" @@ -484,62 +483,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, span.arrayMask = SPAN_RGBA; span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */ - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { - /* Convolution has to be handled specially. We'll create an - * intermediate image, applying all pixel transfer operations - * up to convolution. Then we'll convolve the image. Then - * we'll proceed with the rest of the transfer operations and - * rasterize the image. - */ - GLint row; - GLfloat *dest, *tmpImage; - - tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - if (!tmpImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - return; - } - convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - if (!convImage) { - free(tmpImage); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - return; - } - - /* Unpack the image and apply transfer ops up to convolution */ - dest = tmpImage; - for (row = 0; row < height; row++) { - const GLvoid *source = _mesa_image_address2d(unpack, - pixels, width, height, format, type, row, 0); - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, (GLfloat *) dest, - format, type, source, unpack, - transferOps & IMAGE_PRE_CONVOLUTION_BITS); - dest += width * 4; - } - - /* do convolution */ - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); - } - free(tmpImage); - - /* continue transfer ops and draw the convolved image */ - unpack = &ctx->DefaultPacking; - pixels = convImage; - format = GL_RGBA; - type = GL_FLOAT; - transferOps &= IMAGE_POST_CONVOLUTION_BITS; - } - else if (ctx->Pixel.Convolution1DEnabled) { - /* we only want to apply 1D convolution to glTexImage1D */ - transferOps &= ~(IMAGE_CONVOLUTION_BIT | - IMAGE_POST_CONVOLUTION_SCALE_BIAS); - } - if (ctx->DrawBuffer->_NumColorDrawBuffers > 0 && ctx->DrawBuffer->_ColorDrawBuffers[0]->DataType != GL_FLOAT && ctx->Color.ClampFragmentColor != GL_FALSE) { diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 1de481248b..b0a3d36420 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -26,7 +26,6 @@ #include "main/glheader.h" #include "main/bufferobj.h" #include "main/colormac.h" -#include "main/convolve.h" #include "main/feedback.h" #include "main/formats.h" #include "main/image.h" @@ -326,57 +325,7 @@ read_rgba_pixels( GLcontext *ctx, /* width should never be > MAX_WIDTH since we did clipping earlier */ ASSERT(width <= MAX_WIDTH); - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { - GLfloat *dest, *src, *tmpImage, *convImage; - GLint row; - - tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - if (!tmpImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); - return; - } - convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - if (!convImage) { - free(tmpImage); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); - return; - } - - /* read full RGBA, FLOAT image */ - dest = tmpImage; - for (row = 0; row < height; row++, y++) { - _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest); - _mesa_apply_rgba_transfer_ops(ctx, - transferOps & IMAGE_PRE_CONVOLUTION_BITS, - width, (GLfloat (*)[4]) dest); - dest += width * 4; - } - - /* do convolution */ - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); - } - free(tmpImage); - - /* finish transfer ops and pack the resulting image */ - src = convImage; - for (row = 0; row < height; row++) { - GLvoid *dest; - dest = _mesa_image_address2d(packing, pixels, width, height, - format, type, row, 0); - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src, - format, type, dest, packing, - transferOps & IMAGE_POST_CONVOLUTION_BITS); - src += width * 4; - } - free(convImage); - } - else { - /* no convolution */ + do { const GLint dstStride = _mesa_image_row_stride(packing, width, format, type); GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0]; @@ -385,10 +334,6 @@ read_rgba_pixels( GLcontext *ctx, = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height, format, type, 0, 0); - /* make sure we don't apply 1D convolution */ - transferOps &= ~(IMAGE_CONVOLUTION_BIT | - IMAGE_POST_CONVOLUTION_SCALE_BIAS); - for (row = 0; row < height; row++, y++) { /* Get float rgba pixels */ @@ -407,7 +352,7 @@ read_rgba_pixels( GLcontext *ctx, dst += dstStride; } - } + } while (0); } -- cgit v1.2.3 From d26211e499afb06359d903419315070f022c8efe Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 14:57:25 -0700 Subject: intel: Remove disabled stencil drawpixels acceleration. We still retain the fallback override for GL_STENCIL_INDEX, because the metaops version fails at oglconform. --- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 210 -------------------------- 1 file changed, 210 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index a40b232fff..b5576a9c91 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -49,203 +49,6 @@ #include "intel_pixel.h" #include "intel_fbo.h" - -/** XXX compare perf of this vs. _mesa_meta_DrawPixels(STENCIL) */ -static GLboolean -intel_stencil_drawpixels(GLcontext * ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, - GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) -{ - struct intel_context *intel = intel_context(ctx); - GLuint texname, rb_name, fb_name, old_fb_name; - GLfloat vertices[4][2]; - struct intel_renderbuffer *irb; - struct intel_renderbuffer *depth_irb; - struct gl_pixelstore_attrib old_unpack; - GLstencil *stencil_pixels; - int row, y1, y2; - GLint old_active_texture; - GLboolean rendering_to_fbo = ctx->DrawBuffer->Name != 0; - - if (format != GL_STENCIL_INDEX) - return GL_FALSE; - - /* If there's nothing to write, we're done. */ - if (ctx->Stencil.WriteMask[0] == 0) - return GL_TRUE; - - /* Can't do a per-bit writemask while treating stencil as rgba data. */ - if ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: " - "stencil mask enabled\n"); - return GL_FALSE; - } - - /* We don't support stencil testing/ops here */ - if (ctx->Stencil._Enabled) - return GL_FALSE; - - /* We use FBOs for our wrapping of the depthbuffer into a color - * destination. - */ - if (!ctx->Extensions.EXT_framebuffer_object) - return GL_FALSE; - - /* We're going to mess with texturing with no regard to existing texture - * state, so if there is some set up we have to bail. - */ - if (ctx->Texture._EnabledUnits != 0) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: " - "texturing enabled\n"); - return GL_FALSE; - } - - /* Can't do textured DrawPixels with a fragment program, unless we were - * to generate a new program that sampled our texture and put the results - * in the fragment color before the user's program started. - */ - if (ctx->FragmentProgram.Enabled) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: " - "fragment program enabled\n"); - return GL_FALSE; - } - - /* Check that we can load in a texture this big. */ - if (width > (1 << (ctx->Const.MaxTextureLevels - 1)) || - height > (1 << (ctx->Const.MaxTextureLevels - 1))) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: " - "bitmap too large (%dx%d)\n", - width, height); - return GL_FALSE; - } - - if (!ctx->Extensions.ARB_texture_non_power_of_two && - (!is_power_of_two(width) || !is_power_of_two(height))) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, - "glDrawPixels(GL_STENCIL_INDEX) fallback: NPOT texture\n"); - return GL_FALSE; - } - - _mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | - GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); - old_fb_name = ctx->DrawBuffer->Name; - old_active_texture = ctx->Texture.CurrentUnit; - - _mesa_Disable(GL_POLYGON_STIPPLE); - _mesa_Disable(GL_DEPTH_TEST); - _mesa_Disable(GL_STENCIL_TEST); - - /* Unpack the supplied stencil values into a ubyte buffer. */ - assert(sizeof(GLstencil) == sizeof(GLubyte)); - stencil_pixels = malloc(width * height * sizeof(GLstencil)); - for (row = 0; row < height; row++) { - GLvoid *source = _mesa_image_address2d(unpack, pixels, - width, height, - GL_COLOR_INDEX, type, - row, 0); - _mesa_unpack_stencil_span(ctx, width, GL_UNSIGNED_BYTE, - stencil_pixels + - row * width * sizeof(GLstencil), - type, source, unpack, ctx->_ImageTransferState); - } - - /* Take the current depth/stencil renderbuffer, and make a new one wrapping - * it which will be treated as GL_RGBA8 so we can render to it as a color - * buffer. - */ - depth_irb = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_DEPTH); - irb = intel_create_renderbuffer(MESA_FORMAT_ARGB8888); - irb->Base.Width = depth_irb->Base.Width; - irb->Base.Height = depth_irb->Base.Height; - intel_renderbuffer_set_region(intel, irb, depth_irb->region); - - /* Create a name for our renderbuffer, which lets us use other mesa - * rb functions for convenience. - */ - _mesa_GenRenderbuffersEXT(1, &rb_name); - irb->Base.RefCount++; - _mesa_HashInsert(ctx->Shared->RenderBuffers, rb_name, &irb->Base); - - /* Bind the new renderbuffer to the color attachment point. */ - _mesa_GenFramebuffersEXT(1, &fb_name); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb_name); - _mesa_FramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, - GL_COLOR_ATTACHMENT0_EXT, - GL_RENDERBUFFER_EXT, - rb_name); - /* Choose to render to the color attachment. */ - _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); - - _mesa_DepthMask(GL_FALSE); - _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); - - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); - _mesa_Enable(GL_TEXTURE_2D); - _mesa_GenTextures(1, &texname); - _mesa_BindTexture(GL_TEXTURE_2D, texname); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - _mesa_TexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - old_unpack = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY, width, height, 0, - GL_RED, GL_UNSIGNED_BYTE, stencil_pixels); - ctx->Unpack = old_unpack; - free(stencil_pixels); - - meta_set_passthrough_transform(&intel->meta); - - /* Since we're rendering to the framebuffer as if it was an FBO, - * if it's the window system we have to flip the coordinates. - */ - if (rendering_to_fbo) { - y1 = y; - y2 = y + height * ctx->Pixel.ZoomY; - } else { - y1 = irb->Base.Height - (y + height * ctx->Pixel.ZoomY); - y2 = irb->Base.Height - y; - } - vertices[0][0] = x; - vertices[0][1] = y1; - vertices[1][0] = x + width * ctx->Pixel.ZoomX; - vertices[1][1] = y1; - vertices[2][0] = x + width * ctx->Pixel.ZoomX; - vertices[2][1] = y2; - vertices[3][0] = x; - vertices[3][1] = y2; - - _mesa_VertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &vertices); - _mesa_Enable(GL_VERTEX_ARRAY); - meta_set_default_texrect(&intel->meta); - - _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - - meta_restore_texcoords(&intel->meta); - meta_restore_transform(&intel->meta); - - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, old_fb_name); - - _mesa_PopClientAttrib(); - _mesa_PopAttrib(); - - _mesa_DeleteTextures(1, &texname); - _mesa_DeleteFramebuffersEXT(1, &fb_name); - _mesa_DeleteRenderbuffersEXT(1, &rb_name); - - return GL_TRUE; -} - void intelDrawPixels(GLcontext * ctx, GLint x, GLint y, @@ -255,24 +58,11 @@ intelDrawPixels(GLcontext * ctx, const struct gl_pixelstore_attrib *unpack, const GLvoid * pixels) { -#if 0 - /* XXX this function doesn't seem to work reliably even when all - * the pre-requisite conditions are met. - * Note that this function is never hit with conform. - * Fall back to swrast because even the _mesa_meta_DrawPixels() approach - * isn't working because of an apparent stencil bug. - */ - if (intel_stencil_drawpixels(ctx, x, y, width, height, format, type, - unpack, pixels)) - return; -#else - (void) intel_stencil_drawpixels; /* silence warning */ if (format == GL_STENCIL_INDEX) { _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels); return; } -#endif _mesa_meta_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels); -- cgit v1.2.3 From 2337f364b193c6379ecd5744743b26a5e75e73ae Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 15:47:53 -0700 Subject: intel: Remove unnecessary minimum pitch alignment to 32 bytes. This broke with the cleanup I did in convolution removal. It's unnecessary anyway since region_alloc_tiled adjusts pitches for us (64 byte alignment) --- src/mesa/drivers/dri/intel/intel_tex_image.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index f8cb50797e..4732efd7d7 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -333,12 +333,6 @@ intelTexImage(GLcontext * ctx, } else { texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - - /* Minimum pitch of 32 bytes */ - if (width * texelBytes < 32) { - width = 32 / texelBytes; - texImage->RowStride = width; - } if (!intelImage->mt) { assert(texImage->RowStride == width); -- cgit v1.2.3 From fae18559461e62af623be77787ecba4c7013a8b4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 15:12:21 -0700 Subject: intel: Replace my intel_texture_bitmap code with _mesa_meta_Bitmap. The meta code is more general than mine, and appears to pass the same sets of tests (piglit + some oglconform). --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 181 +----------------------- 1 file changed, 1 insertion(+), 180 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 02c0ffce31..3ea1d48d7c 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -309,178 +309,6 @@ out: return GL_TRUE; } -static GLboolean -intel_texture_bitmap(GLcontext * ctx, - GLint dst_x, GLint dst_y, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - struct intel_context *intel = intel_context(ctx); - static const char *fp = - "!!ARBfp1.0\n" - "TEMP val;\n" - "PARAM color=program.local[0];\n" - "TEX val, fragment.texcoord[0], texture[0], 2D;\n" - "ADD val, val.wwww, {-.5, -.5, -.5, -.5};\n" - "KIL val;\n" - "MOV result.color, color;\n" - "END\n"; - GLuint texname; - GLfloat vertices[4][4]; - GLint old_active_texture; - GLubyte *a8_bitmap; - GLfloat dst_z; - - /* We need a fragment program for the KIL effect */ - if (!ctx->Extensions.ARB_fragment_program || - !ctx->Extensions.ARB_vertex_program) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, - "glBitmap fallback: No fragment/vertex program support\n"); - return GL_FALSE; - } - - /* We're going to mess with texturing with no regard to existing texture - * state, so if there is some set up we have to bail. - */ - if (ctx->Texture._EnabledUnits != 0) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glBitmap fallback: texturing enabled\n"); - return GL_FALSE; - } - - /* Can't do textured DrawPixels with a fragment program, unless we were - * to generate a new program that sampled our texture and put the results - * in the fragment color before the user's program started. - */ - if (ctx->FragmentProgram.Enabled) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glBitmap fallback: fragment program enabled\n"); - return GL_FALSE; - } - - if (ctx->VertexProgram.Enabled) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glBitmap fallback: vertex program enabled\n"); - return GL_FALSE; - } - - if (!ctx->Extensions.ARB_texture_non_power_of_two && - (!is_power_of_two(width) || !is_power_of_two(height))) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, - "glBitmap() fallback: NPOT texture\n"); - return GL_FALSE; - } - - if (ctx->Fog.Enabled) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glBitmap() fallback: fog\n"); - return GL_FALSE; - } - - /* Check that we can load in a texture this big. */ - if (width > (1 << (ctx->Const.MaxTextureLevels - 1)) || - height > (1 << (ctx->Const.MaxTextureLevels - 1))) { - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "glBitmap fallback: bitmap too large (%dx%d)\n", - width, height); - return GL_FALSE; - } - - if (_mesa_is_bufferobj(unpack->BufferObj)) { - bitmap = map_pbo(ctx, width, height, unpack, bitmap); - if (bitmap == NULL) - return GL_TRUE; /* even though this is an error, we're done */ - } - - /* Convert the A1 bitmap to an A8 format suitable for glTexImage */ - a8_bitmap = calloc(1, width * height); - _mesa_expand_bitmap(width, height, unpack, bitmap, a8_bitmap, width, 0xff); - - if (_mesa_is_bufferobj(unpack->BufferObj)) { - /* done with PBO so unmap it now */ - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - unpack->BufferObj); - } - - /* Save GL state before we start setting up our drawing */ - _mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_POLYGON_BIT | - GL_TEXTURE_BIT | GL_VIEWPORT_BIT); - _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | - GL_CLIENT_PIXEL_STORE_BIT); - old_active_texture = ctx->Texture.CurrentUnit; - - _mesa_Disable(GL_POLYGON_STIPPLE); - _mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - /* Upload our bitmap data to an alpha texture */ - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); - _mesa_Enable(GL_TEXTURE_2D); - _mesa_GenTextures(1, &texname); - _mesa_BindTexture(GL_TEXTURE_2D, texname); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - _mesa_PixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - _mesa_PixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); - _mesa_PixelStorei(GL_UNPACK_ROW_LENGTH, 0); - _mesa_PixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - _mesa_PixelStorei(GL_UNPACK_SKIP_ROWS, 0); - _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, 1); - _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, - GL_ALPHA, GL_UNSIGNED_BYTE, a8_bitmap); - free(a8_bitmap); - - meta_set_fragment_program(&intel->meta, &intel->meta.bitmap_fp, fp); - _mesa_ProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, - ctx->Current.RasterColor); - meta_set_passthrough_vertex_program(&intel->meta); - meta_set_passthrough_transform(&intel->meta); - - /* convert rasterpos Z from [0,1] to NDC coord in [-1,1] */ - dst_z = -1.0 + 2.0 * ctx->Current.RasterPos[2]; - - /* RasterPos[2] already takes into account the DepthRange mapping. */ - _mesa_DepthRange(0.0, 1.0); - - vertices[0][0] = dst_x; - vertices[0][1] = dst_y; - vertices[0][2] = dst_z; - vertices[0][3] = 1.0; - vertices[1][0] = dst_x + width; - vertices[1][1] = dst_y; - vertices[1][2] = dst_z; - vertices[1][3] = 1.0; - vertices[2][0] = dst_x + width; - vertices[2][1] = dst_y + height; - vertices[2][2] = dst_z; - vertices[2][3] = 1.0; - vertices[3][0] = dst_x; - vertices[3][1] = dst_y + height; - vertices[3][2] = dst_z; - vertices[3][3] = 1.0; - - _mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices); - _mesa_Enable(GL_VERTEX_ARRAY); - meta_set_default_texrect(&intel->meta); - _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - - meta_restore_texcoords(&intel->meta); - meta_restore_transform(&intel->meta); - meta_restore_fragment_program(&intel->meta); - meta_restore_vertex_program(&intel->meta); - - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); - _mesa_PopClientAttrib(); - _mesa_PopAttrib(); - - _mesa_DeleteTextures(1, &texname); - - return GL_TRUE; -} - /* There are a large number of possible ways to implement bitmap on * this hardware, most of them have some sort of drawback. Here are a * few that spring to mind: @@ -512,12 +340,5 @@ intelBitmap(GLcontext * ctx, unpack, pixels)) return; - if (intel_texture_bitmap(ctx, x, y, width, height, - unpack, pixels)) - return; - - if (INTEL_DEBUG & DEBUG_PIXEL) - printf("%s: fallback to swrast\n", __FUNCTION__); - - _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels); + _mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels); } -- cgit v1.2.3 From 1c0646a826cb19d3c3eaa84591930590db6e8af8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 16:13:50 -0700 Subject: radeon: Remove copied minimum pitch alignment code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is already covered by radeon_mipmap_tree.c, and my convolution cleanups broke in the presence of this code. Thanks to Marek Olšák for tracking down the relevant miptree code for me. --- src/mesa/drivers/dri/radeon/radeon_texture.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index bf30e0cab8..d1ebd83550 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -792,18 +792,6 @@ static void radeon_teximage( t->validated = GL_FALSE; - if (!_mesa_is_format_compressed(texImage->TexFormat)) { - GLuint texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - /* Minimum pitch of 32 bytes */ - if (width * texelBytes < 32) { - width = 32 / texelBytes; - texImage->RowStride = width; - } - if (!image->mt) { - assert(texImage->RowStride == width); - } - } - /* Mesa core only clears texImage->Data but not image->mt */ radeonFreeTexImageData(ctx, texImage); -- cgit v1.2.3 From f9e6f401e1c3b0a9caeb09f4c14eaea48dd91d06 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 16:19:18 -0700 Subject: unichrome: Mostly revert my convolution removal changes. For this driver, the minimum pitch alignment stuff does appear to be necessary, so leave the separate munged width/height variable in place. --- src/mesa/drivers/dri/unichrome/via_tex.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 01cb3ebbc8..9ae9466c97 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -663,6 +663,8 @@ static void viaTexImage(GLcontext *ctx, struct gl_texture_image *texImage) { struct via_context *vmesa = VIA_CONTEXT(ctx); + GLint postConvWidth = width; + GLint postConvHeight = height; GLint texelBytes, sizeInBytes; struct via_texture_object *viaObj = (struct via_texture_object *)texObj; struct via_texture_image *viaImage = (struct via_texture_image *)texImage; @@ -682,13 +684,13 @@ static void viaTexImage(GLcontext *ctx, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ - if (width * texelBytes < 32) { - width = 32 / texelBytes; - texImage->RowStride = width; + if (postConvWidth * texelBytes < 32) { + postConvWidth = 32 / texelBytes; + texImage->RowStride = postConvWidth; } - assert(texImage->RowStride == width); - viaImage->pitchLog2 = logbase2(width * texelBytes); + assert(texImage->RowStride == postConvWidth); + viaImage->pitchLog2 = logbase2(postConvWidth * texelBytes); /* allocate memory */ if (_mesa_is_format_compressed(texImage->TexFormat)) @@ -697,7 +699,7 @@ static void viaTexImage(GLcontext *ctx, texImage->Height, texImage->Depth); else - sizeInBytes = width * height * texelBytes; + sizeInBytes = postConvWidth * postConvHeight * texelBytes; /* Attempt to allocate texture memory directly, otherwise use main @@ -778,7 +780,7 @@ static void viaTexImage(GLcontext *ctx, dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width); } else { - dstRowStride = width * _mesa_get_format_bytes(texImage->TexFormat); + dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat); } success = _mesa_texstore(ctx, dims, texImage->_BaseFormat, -- cgit v1.2.3 From 64ff468d6ff7645e4c0247a5135d71f380690873 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 16:30:58 -0700 Subject: intel: Remove dead intelIsTextureResident(). It always returned 1 (GL_TRUE), which is the same thing that happens when the driver hook isn't present. --- src/mesa/drivers/dri/intel/intel_tex.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 8bb6ae99fb..4537f58911 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -9,23 +9,6 @@ #define FILE_DEBUG_FLAG DEBUG_TEXTURE -static GLboolean -intelIsTextureResident(GLcontext * ctx, struct gl_texture_object *texObj) -{ -#if 0 - struct intel_context *intel = intel_context(ctx); - struct intel_texture_object *intelObj = intel_texture_object(texObj); - - return - intelObj->mt && - intelObj->mt->region && - intel_is_region_resident(intel, intelObj->mt->region); -#endif - return 1; -} - - - static struct gl_texture_image * intelNewTextureImage(GLcontext * ctx) { @@ -217,7 +200,6 @@ intelInitTextureFuncs(struct dd_function_table *functions) functions->DeleteTexture = intelDeleteTextureObject; functions->FreeTexImageData = intelFreeTextureImageData; functions->UpdateTexturePalette = 0; - functions->IsTextureResident = intelIsTextureResident; #if DO_DEBUG && !defined(__ia64__) if (INTEL_DEBUG & DEBUG_BUFMGR) -- cgit v1.2.3 From f46523e0bcdfe447b4a9a35fe1561490fa32c3f0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 16:34:10 -0700 Subject: i915: Remove a dead if (0) block. --- src/mesa/drivers/dri/i915/i915_context.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 450e66e0d3..bf6762d666 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -108,9 +108,6 @@ i915CreateContext(int api, if (!i915) return GL_FALSE; - if (0) - printf("\ntexmem-0-3 branch\n\n"); - i915InitVtbl(i915); i915InitDriverFunctions(&functions); -- cgit v1.2.3 From 9f7c8053e06663ba1f7b105f987052d9412d8fad Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 24 Sep 2010 07:54:46 -0600 Subject: mesa: fix assertions to handle srgb formats http://bugs.freedesktop.org/show_bug.cgi?id=30333 NOTE: This is a candidate for the 7.9 branch. --- src/mesa/main/texcompress_s3tc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 551203f012..534a4247cf 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -166,7 +166,8 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1); + ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 || + dstFormat == MESA_FORMAT_SRGB_DXT1); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -228,7 +229,8 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 || + dstFormat == MESA_FORMAT_SRGBA_DXT1); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -289,7 +291,8 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 || + dstFormat == MESA_FORMAT_SRGBA_DXT3); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -349,7 +352,8 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 || + dstFormat == MESA_FORMAT_SRGBA_DXT5); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); -- cgit v1.2.3 From 10dcc989ab9f143f0bd6d103fd2b336429644467 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 24 Sep 2010 08:24:41 -0600 Subject: st/mesa: add missing MESA_FORMAT_S8 case in st_mesa_format_to_pipe_format() NOTE: this is a candidate for the 7.9 branch. --- src/mesa/state_tracker/st_format.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 1ed79524b2..95064605d7 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -166,6 +166,8 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) return PIPE_FORMAT_X8Z24_UNORM; case MESA_FORMAT_X8_Z24: return PIPE_FORMAT_Z24X8_UNORM; + case MESA_FORMAT_S8: + return PIPE_FORMAT_S8_USCALED; case MESA_FORMAT_YCBCR: return PIPE_FORMAT_UYVY; #if FEATURE_texture_s3tc -- cgit v1.2.3 From f5c810c42f9dfcb660303ea898975b64f060b238 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 24 Sep 2010 08:26:32 -0600 Subject: st/mesa: use the wrapped renderbuffer in CopyPixels() Fixes assertion failures when copying stencil pixels. NOTE: this is a candidate for the 7.9 branch. --- src/mesa/state_tracker/st_cb_drawpixels.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 1147b1950e..fb1fec1aef 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -832,7 +832,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty) { - struct st_renderbuffer *rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer); + struct st_renderbuffer *rbDraw; struct pipe_context *pipe = st_context(ctx)->pipe; enum pipe_transfer_usage usage; struct pipe_transfer *ptDraw; @@ -846,6 +846,13 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, return; } + /* Get the dest renderbuffer. If there's a wrapper, use the + * underlying renderbuffer. + */ + rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer); + if (rbDraw->Base.Wrapped) + rbDraw = st_renderbuffer(rbDraw->Base.Wrapped); + /* this will do stencil pixel transfer ops */ st_read_stencil_pixels(ctx, srcx, srcy, width, height, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, @@ -968,6 +975,9 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); } + if (rbRead->Base.Wrapped) + rbRead = st_renderbuffer(rbRead->Base.Wrapped); + sample_count = rbRead->texture->nr_samples; /* I believe this would be legal, presumably would need to do a resolve for color, and for depth/stencil spec says to just use one of the -- cgit v1.2.3 From 15861e0074bdc0185662ef6a6f4358230a187243 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 24 Sep 2010 13:20:58 -0400 Subject: r600c: fix mipmap stride on evergreen taken from Dave's r600g fix --- src/mesa/drivers/dri/radeon/radeon_common_context.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index b0340cee21..85e4988c53 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -245,9 +245,16 @@ GLboolean radeonInitContext(radeonContextPtr radeon, DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16; if (IS_R600_CLASS(radeon->radeonScreen)) { - radeon->texture_row_align = 256; - radeon->texture_rect_row_align = 256; - radeon->texture_compressed_row_align = 256; + int chip_family = radeon->radeonScreen->chip_family; + if (chip_family >= CHIP_FAMILY_CEDAR) { + radeon->texture_row_align = 512; + radeon->texture_rect_row_align = 512; + radeon->texture_compressed_row_align = 512; + } else { + radeon->texture_row_align = 256; + radeon->texture_rect_row_align = 256; + radeon->texture_compressed_row_align = 256; + } } else if (IS_R200_CLASS(radeon->radeonScreen) || IS_R100_CLASS(radeon->radeonScreen)) { radeon->texture_row_align = 32; -- cgit v1.2.3 From e7c8832c7f4cbf0add350fbb6fe7c955b4665363 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 23 Sep 2010 17:01:39 -0700 Subject: intel: Dead comment removal. --- src/mesa/drivers/dri/intel/intel_screen.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 6d66a25ca1..d200dc1f4a 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -465,7 +465,6 @@ intel_init_bufmgr(struct intel_screen *intelScreen) intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL; intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ); - /* Otherwise, use the classic buffer manager. */ if (intelScreen->bufmgr == NULL) { fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n", __func__, __LINE__); -- cgit v1.2.3 From 836803df794be7a2ae3be0fc047e882d49ab22bb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 24 Sep 2010 11:20:16 -0700 Subject: intel: Corresponding FinishRenderTexture debug to BeginRenderTexture. --- src/mesa/drivers/dri/intel/intel_fbo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 363a5c0242..4ad85eb7c1 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -598,6 +598,10 @@ intel_finish_render_texture(GLcontext * ctx, struct gl_texture_image *image = tex_obj->Image[att->CubeMapFace][att->TextureLevel]; struct intel_texture_image *intel_image = intel_texture_image(image); + struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); + + DBG("Finish render texture tid %lx tex=%u refcount=%d\n", + _glthread_GetID(), att->Texture->Name, irb->Base.RefCount); /* Flag that this image may now be validated into the object's miptree. */ intel_image->used_as_render_target = GL_FALSE; -- cgit v1.2.3 From 1946b81e700fbb266294b8c1cb0d29ced84bf647 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 24 Sep 2010 16:11:40 -0700 Subject: i965: Add support for rendering to SARGB8 FBOs. Tested with fbo-generatemipmap-formats GL_EXT_texture_srgb. The test still fails on SLA8, though. --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 3 +++ src/mesa/drivers/dri/intel/intel_fbo.c | 5 +++++ src/mesa/drivers/dri/intel/intel_span.c | 1 + 3 files changed, 9 insertions(+) (limited to 'src/mesa') 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 17b016b569..05f1aa1813 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -429,6 +429,9 @@ brw_update_renderbuffer_surface(struct brw_context *brw, 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; diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 4ad85eb7c1..64c94b9b55 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -433,6 +433,10 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, 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"); @@ -659,6 +663,7 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) 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: diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index fb840c1020..c8d55c92a0 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -366,6 +366,7 @@ intel_set_span_functions(struct intel_context *intel, intel_InitPointers_xRGB8888(rb); break; case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_SARGB8: intel_InitPointers_ARGB8888(rb); break; case MESA_FORMAT_Z16: -- cgit v1.2.3 From 934fde4f5a63ff7c3c29c21e9e67cce3c2564788 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 24 Sep 2010 16:22:08 -0700 Subject: intel: Fix segfault on INTEL_DEBUG=fbo with unsupported framebuffers. --- src/mesa/drivers/dri/intel/intel_fbo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 64c94b9b55..984585027c 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -602,10 +602,9 @@ intel_finish_render_texture(GLcontext * ctx, struct gl_texture_image *image = tex_obj->Image[att->CubeMapFace][att->TextureLevel]; struct intel_texture_image *intel_image = intel_texture_image(image); - struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); - DBG("Finish render texture tid %lx tex=%u refcount=%d\n", - _glthread_GetID(), att->Texture->Name, irb->Base.RefCount); + DBG("Finish render texture tid %lx tex=%u\n", + _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; -- cgit v1.2.3 From 2e3d22b0746dad2cc64873f336367ca4949d0123 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 24 Sep 2010 18:00:42 -0700 Subject: intel: Add fallback debug to glGenerateMipmap. --- src/mesa/drivers/dri/intel/intel_tex.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 4537f58911..49b7d5ef6b 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -157,6 +157,10 @@ intelGenerateMipmap(GLcontext *ctx, GLenum target, /* sw path: need to map texture images */ struct intel_context *intel = intel_context(ctx); struct intel_texture_object *intelObj = intel_texture_object(texObj); + + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s - fallback to swrast\n", __FUNCTION__); + intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); _mesa_generate_mipmap(ctx, target, texObj); intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); -- cgit v1.2.3 From 86ad797be4b9b2768f1c28bb5ac3ae6f9a41794a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 24 Sep 2010 18:19:08 -0700 Subject: intel: More reverting of the sw fallback for depth texture border color. The rest was done with 9aec1288eeae8e87adc9a99f377be536892941b2 --- src/mesa/drivers/dri/intel/intel_tex_image.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 4732efd7d7..03aba58e10 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -73,10 +73,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, DBG("%s\n", __FUNCTION__); - if (intelImage->base.Border || - ((intelImage->base._BaseFormat == GL_DEPTH_COMPONENT) && - ((intelObj->base.WrapS == GL_CLAMP_TO_BORDER) || - (intelObj->base.WrapT == GL_CLAMP_TO_BORDER)))) + if (intelImage->base.Border) return; if (intelImage->level > intelObj->base.BaseLevel && -- cgit v1.2.3 From b917691bc015ec4a148a67bf3a1cdca0248400a7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 24 Sep 2010 18:25:42 -0700 Subject: intel: Improve some of the miptree debugging. --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index d316d34d69..9c4e5c5ee8 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -333,7 +333,6 @@ intel_miptree_image_map(struct intel_context * intel, GLuint * row_stride, GLuint * image_offsets) { GLuint x, y; - DBG("%s \n", __FUNCTION__); if (row_stride) *row_stride = mt->region->pitch * mt->cpp; @@ -348,6 +347,8 @@ intel_miptree_image_map(struct intel_context * intel, image_offsets[i] = x + y * mt->region->pitch; } + DBG("%s \n", __FUNCTION__); + return intel_region_map(intel, mt->region); } else { assert(mt->level[level].depth == 1); @@ -355,6 +356,9 @@ intel_miptree_image_map(struct intel_context * intel, &x, &y); image_offsets[0] = 0; + DBG("%s: (%d,%d) -> (%d, %d)/%d\n", + __FUNCTION__, face, level, x, y, mt->region->pitch * mt->cpp); + return intel_region_map(intel, mt->region) + (x + y * mt->region->pitch) * mt->cpp; } @@ -385,7 +389,6 @@ intel_miptree_image_data(struct intel_context *intel, const GLuint depth = dst->level[level].depth; GLuint i; - DBG("%s: %d/%d\n", __FUNCTION__, face, level); for (i = 0; i < depth; i++) { GLuint dst_x, dst_y, height; @@ -395,6 +398,12 @@ intel_miptree_image_data(struct intel_context *intel, if(dst->compressed) height = (height + 3) / 4; + DBG("%s: %d/%d %p/%d -> (%d, %d)/%d (%d, %d)\n", + __FUNCTION__, face, level, + src, src_row_pitch * dst->cpp, + dst_x, dst_y, dst->region->pitch * dst->cpp, + dst->level[level].width, height); + intel_region_data(intel, dst->region, 0, dst_x, dst_y, src, -- cgit v1.2.3 From 1acadebd6270d3604b026842b8a21360968618a0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 24 Sep 2010 18:40:24 -0700 Subject: mesa: Fix type typo in glGenerateMipmap handling of GL_UNSIGNED_INT data. Fixes ARB_depth_texture/fbo-generatemipmap-formats. --- src/mesa/main/mipmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 678d17a2a3..f15c3b665b 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -415,7 +415,7 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, GLuint i, j, k; const GLuint *rowA = (const GLuint *) srcRowA; const GLuint *rowB = (const GLuint *) srcRowB; - GLfloat *dst = (GLfloat *) dstRow; + GLuint *dst = (GLfloat *) dstRow; for (i = j = 0, k = k0; i < (GLuint) dstWidth; i++, j += colStride, k += colStride) { dst[i] = (GLfloat)(rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4); -- cgit v1.2.3 From ef1e1261df02203da4c7ebf708b0edf1b9cd16c2 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 24 Sep 2010 22:20:43 -0700 Subject: intel: Fix implicit declaration of function '_mesa_meta_Bitmap' warning. Fix this GCC warning. intel_pixel_bitmap.c: In function 'intelBitmap': intel_pixel_bitmap.c:343: warning: implicit declaration of function '_mesa_meta_Bitmap' --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 3ea1d48d7c..6b62da2084 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -47,6 +47,7 @@ #include "main/viewport.h" #include "main/context.h" #include "swrast/swrast.h" +#include "drivers/common/meta.h" #include "intel_screen.h" #include "intel_context.h" -- cgit v1.2.3 From c510f8eeb425db281154cbfb915977226fa2e3ab Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 24 Sep 2010 22:46:14 -0700 Subject: mesa: Remove unnecessary headers. --- src/mesa/main/context.c | 1 - src/mesa/main/convolve.c | 3 --- src/mesa/main/histogram.c | 2 -- 3 files changed, 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 7d6bfaa62d..00132514d7 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -86,7 +86,6 @@ #include "blend.h" #include "buffers.h" #include "bufferobj.h" -#include "colortab.h" #include "context.h" #include "cpuinfo.h" #include "debug.h" diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 301569e5f6..0231bcf6d3 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -35,11 +35,8 @@ #include "bufferobj.h" #include "colormac.h" #include "convolve.h" -#include "context.h" -#include "image.h" #include "macros.h" #include "mtypes.h" -#include "state.h" #include "main/dispatch.h" diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index a14d93e519..b98e3219c5 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -26,8 +26,6 @@ #include "glheader.h" #include "bufferobj.h" #include "colormac.h" -#include "context.h" -#include "image.h" #include "histogram.h" #include "macros.h" #include "main/dispatch.h" -- cgit v1.2.3 From f07ac801b9b5507b46a8e4d8884b822a24573213 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 24 Sep 2010 22:53:40 -0700 Subject: unichrome: Remove unnecessary header. --- src/mesa/drivers/dri/unichrome/via_tex.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 9ae9466c97..e55129c6da 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -31,7 +31,6 @@ #include "main/mtypes.h" #include "main/enums.h" #include "main/formats.h" -#include "main/colortab.h" #include "main/context.h" #include "main/mipmap.h" #include "main/mm.h" -- cgit v1.2.3 From 365da88a7127e43eb9327552dda4921d1e8f885e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 24 Sep 2010 22:55:04 -0700 Subject: intel: Remove unnecessary headers. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 10 ---------- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 11 ----------- 2 files changed, 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 6b62da2084..bd7707eeeb 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -26,7 +26,6 @@ **************************************************************************/ #include "main/glheader.h" -#include "main/arbprogram.h" #include "main/enums.h" #include "main/image.h" #include "main/colormac.h" @@ -34,17 +33,8 @@ #include "main/macros.h" #include "main/bufferobj.h" #include "main/polygon.h" -#include "main/pixelstore.h" -#include "main/polygon.h" #include "main/state.h" -#include "main/teximage.h" #include "main/texobj.h" -#include "main/texstate.h" -#include "main/texparam.h" -#include "main/varray.h" -#include "main/attrib.h" -#include "main/enable.h" -#include "main/viewport.h" #include "main/context.h" #include "swrast/swrast.h" #include "drivers/common/meta.h" diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index b5576a9c91..470c4b9326 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -30,24 +30,13 @@ #include "main/image.h" #include "main/mtypes.h" #include "main/teximage.h" -#include "main/texenv.h" #include "main/texobj.h" #include "main/texstate.h" -#include "main/texparam.h" -#include "main/varray.h" -#include "main/attrib.h" -#include "main/enable.h" -#include "main/buffers.h" -#include "main/fbobject.h" -#include "main/depth.h" -#include "main/hash.h" -#include "main/blend.h" #include "swrast/swrast.h" #include "drivers/common/meta.h" #include "intel_context.h" #include "intel_pixel.h" -#include "intel_fbo.h" void intelDrawPixels(GLcontext * ctx, -- cgit v1.2.3 From 865cf775030beac3147547537a1a5372485127de Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 25 Sep 2010 18:51:24 +1000 Subject: mesa/mipmap: fix warning since 1acadebd6270d3604b026842b8a21360968618a0 1acadebd6270d3604b026842b8a21360968618a0 fixed the pointer but not the cast. --- src/mesa/main/mipmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index f15c3b665b..3d1a4c49c4 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -415,7 +415,7 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, GLuint i, j, k; const GLuint *rowA = (const GLuint *) srcRowA; const GLuint *rowB = (const GLuint *) srcRowB; - GLuint *dst = (GLfloat *) dstRow; + GLuint *dst = (GLuint *) dstRow; for (i = j = 0, k = k0; i < (GLuint) dstWidth; i++, j += colStride, k += colStride) { dst[i] = (GLfloat)(rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4); -- cgit v1.2.3 From f3e6a0faa9090cfcfcafe06e1481ed5a18838ca0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 25 Sep 2010 12:33:28 -0700 Subject: intel: Remove unnecessary header. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index bd7707eeeb..c62e16f587 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -32,7 +32,6 @@ #include "main/mtypes.h" #include "main/macros.h" #include "main/bufferobj.h" -#include "main/polygon.h" #include "main/state.h" #include "main/texobj.h" #include "main/context.h" -- cgit v1.2.3 From 5ba62cd4139e95c752453a1591eb3e47b6b18238 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 25 Sep 2010 13:10:26 -0600 Subject: swrast: update comments for REMAINDER() macro --- src/mesa/swrast/s_texfilter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 3fc554c5a2..1aa2bcaf74 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -135,8 +135,11 @@ lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c, /** - * If A is a signed integer, A % B doesn't give the right value for A < 0 - * (in terms of texture repeat). Just casting to unsigned fixes that. + * Used for GL_REPEAT wrap mode. Using A % B doesn't produce the + * right results for A<0. Casting to A to be unsigned only works if B + * is a power of two. Adding a bias to A (which is a multiple of B) + * avoids the problems with A < 0 (for reasonable A) without using a + * conditional. */ #define REMAINDER(A, B) (((A) + (B) * 1024) % (B)) -- cgit v1.2.3 From 522e994a22e8b46c8a41f2920af88c5ebad43cd8 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 24 Sep 2010 22:14:43 -0700 Subject: r300/compiler: Fix two mistakes in the presubtract optimization pass. 1. We can't turn an instruction into a presubtract operation if it writes to one of the registers it reads from. 2. If we turn an instruction into a presubtract operation, we can't remove that intruction unless all readers can use the presubtract operation. This fixes fdo bug 30337. This is a candidate for the 7.9 branch. --- .../drivers/dri/r300/compiler/radeon_optimize.c | 45 +++++++++++++++------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c index c15a9b1c45..e2889302e6 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c @@ -475,8 +475,8 @@ static void constant_folding(struct radeon_compiler * c, struct rc_instruction * } /** - * This function returns a writemask that indicates wich components are - * read by src and also written by dst. + * If src and dst use the same register, this function returns a writemask that + * indicates wich components are read by src. Otherwise zero is returned. */ static unsigned int src_reads_dst_mask(struct rc_src_register src, struct rc_dst_register dst) @@ -563,10 +563,18 @@ static int presub_helper( * s->Inst->U.I.DstReg, because if it does we must not * remove s->Inst. */ for(i = 0; i < info->NumSrcRegs; i++) { - if(s->Inst->U.I.DstReg.WriteMask != - src_reads_dst_mask(inst->U.I.SrcReg[i], - s->Inst->U.I.DstReg)) { - continue; + unsigned int mask = src_reads_dst_mask( + inst->U.I.SrcReg[i], s->Inst->U.I.DstReg); + /* XXX We could be more aggressive here using + * presubtract. It is okay if SrcReg[i] only reads + * from some of the mask components. */ + if(s->Inst->U.I.DstReg.WriteMask != mask) { + if (s->Inst->U.I.DstReg.WriteMask & mask) { + can_remove = 0; + break; + } else { + continue; + } } if (cant_sub || !can_use_presub) { can_remove = 0; @@ -626,6 +634,21 @@ static void presub_replace_add(struct peephole_state *s, inst->U.I.SrcReg[src_index].Index = presub_opcode; } +static int is_presub_candidate(struct rc_instruction * inst) +{ + const struct rc_opcode_info * info = rc_get_opcode_info(inst->U.I.Opcode); + unsigned int i; + + if (inst->U.I.PreSub.Opcode != RC_PRESUB_NONE || inst->U.I.SaturateMode) + return 0; + + for(i = 0; i < info->NumSrcRegs; i++) { + if (src_reads_dst_mask(inst->U.I.SrcReg[i], inst->U.I.DstReg)) + return 0; + } + return 1; +} + static int peephole_add_presub_add( struct radeon_compiler * c, struct rc_instruction * inst_add) @@ -635,10 +658,7 @@ static int peephole_add_presub_add( unsigned int i; struct peephole_state s; - if (inst_add->U.I.PreSub.Opcode != RC_PRESUB_NONE) - return 0; - - if (inst_add->U.I.SaturateMode) + if (!is_presub_candidate(inst_add)) return 0; if (inst_add->U.I.SrcReg[0].Swizzle != inst_add->U.I.SrcReg[1].Swizzle) @@ -705,10 +725,7 @@ static int peephole_add_presub_inv( unsigned int i, swz, mask; struct peephole_state s; - if (inst_add->U.I.PreSub.Opcode != RC_PRESUB_NONE) - return 0; - - if (inst_add->U.I.SaturateMode) + if (!is_presub_candidate(inst_add)) return 0; mask = inst_add->U.I.DstReg.WriteMask; -- cgit v1.2.3 From 4da5f1b7c52fb02a3b2baa846931c2dd5ee1b92e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Sep 2010 14:29:12 -0700 Subject: mesa: Force GL_ARB_copy_buffer to always be enabled As per discussions at XDS. --- src/mesa/drivers/dri/common/utils.c | 2 ++ src/mesa/drivers/dri/intel/intel_extensions.c | 2 -- src/mesa/main/bufferobj.c | 10 ++-------- src/mesa/main/extensions.c | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 0dd879abc9..0685d2f0e6 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -140,6 +140,7 @@ driGetRendererString( char * buffer, const char * hardware_name, +#define need_GL_ARB_copy_buffer #define need_GL_ARB_draw_buffers #define need_GL_ARB_multisample #define need_GL_ARB_texture_compression @@ -164,6 +165,7 @@ driGetRendererString( char * buffer, const char * hardware_name, #include "main/remap_helper.h" static const struct dri_extension all_mesa_extensions[] = { + { "GL_ARB_copy_buffer", GL_ARB_copy_buffer_functions }, { "GL_ARB_draw_buffers", GL_ARB_draw_buffers_functions }, { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 2edd6d21b4..112f71d3b8 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -31,7 +31,6 @@ #include "utils.h" -#define need_GL_ARB_copy_buffer #define need_GL_ARB_draw_elements_base_vertex #define need_GL_ARB_framebuffer_object #define need_GL_ARB_map_buffer_range @@ -79,7 +78,6 @@ * i965_dri. */ static const struct dri_extension card_extensions[] = { - { "GL_ARB_copy_buffer", GL_ARB_copy_buffer_functions }, { "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, { "GL_ARB_half_float_pixel", NULL }, { "GL_ARB_map_buffer_range", GL_ARB_map_buffer_range_functions }, diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 4797f29b4d..61d46b936b 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -74,15 +74,9 @@ get_buffer_target(GLcontext *ctx, GLenum target) case GL_PIXEL_UNPACK_BUFFER_EXT: return &ctx->Unpack.BufferObj; case GL_COPY_READ_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - return &ctx->CopyReadBuffer; - } - break; + return &ctx->CopyReadBuffer; case GL_COPY_WRITE_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - return &ctx->CopyWriteBuffer; - } - break; + return &ctx->CopyWriteBuffer; #if FEATURE_EXT_transform_feedback case GL_TRANSFORM_FEEDBACK_BUFFER: if (ctx->Extensions.EXT_transform_feedback) { diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index c5febc77cf..fe7eade3eb 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -45,7 +45,7 @@ static const struct { int flag_offset; } default_extensions[] = { { OFF, "GL_ARB_blend_func_extended", F(ARB_blend_func_extended) }, - { OFF, "GL_ARB_copy_buffer", F(ARB_copy_buffer) }, + { 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) }, @@ -229,7 +229,7 @@ static const struct { void _mesa_enable_sw_extensions(GLcontext *ctx) { - ctx->Extensions.ARB_copy_buffer = GL_TRUE; + /*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/ ctx->Extensions.ARB_depth_clamp = GL_TRUE; ctx->Extensions.ARB_depth_texture = GL_TRUE; /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ -- cgit v1.2.3 From 7f11d471e6bafae2282ec82ba4a19d30c440d28f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Sep 2010 14:55:52 -0700 Subject: mesa: Force GL_SGIS_generate_mipmap to always be enabled As per discussions at XDS. --- src/mesa/drivers/dri/i810/i810context.c | 1 - src/mesa/drivers/dri/intel/intel_extensions.c | 1 - src/mesa/drivers/dri/mach64/mach64_context.c | 1 - src/mesa/drivers/dri/mga/mga_xmesa.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 - src/mesa/drivers/dri/r128/r128_context.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/r300/r300_context.c | 1 - src/mesa/drivers/dri/r600/r600_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_context.c | 1 - src/mesa/drivers/dri/tdfx/tdfx_context.c | 2 -- src/mesa/main/extensions.c | 6 +++--- src/mesa/main/hint.c | 4 ---- src/mesa/main/texparam.c | 28 ++++++-------------------- 14 files changed, 9 insertions(+), 41 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index 49f3ee88a6..8f52c20c2d 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -127,7 +127,6 @@ static const struct dri_extension card_extensions[] = { "GL_EXT_texture_rectangle", NULL }, { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 112f71d3b8..a946ee447a 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -130,7 +130,6 @@ static const struct dri_extension card_extensions[] = { { "GL_NV_blend_square", NULL }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_vertex_program1_1", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, #if FEATURE_OES_EGL_image { "GL_OES_EGL_image", GL_OES_EGL_image_functions }, #endif diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 72a44d9642..a20a1c9655 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -79,7 +79,6 @@ static const struct dri_extension card_extensions[] = { "GL_ARB_multitexture", NULL }, { "GL_EXT_texture_edge_clamp", NULL }, { "GL_MESA_ycbcr_texture", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 3a31dfb44a..069947e252 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -394,7 +394,6 @@ static const struct dri_extension card_extensions[] = { "GL_EXT_stencil_wrap", NULL }, { "GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions }, { "GL_MESA_ycbcr_texture", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 0fecdee66e..fbe4edea58 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -62,7 +62,6 @@ static const struct dri_extension nouveau_extensions[] = { { "GL_EXT_texture_lod_bias", NULL }, { "GL_NV_blend_square", NULL }, { "GL_NV_texture_env_combine4", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 7860708383..b917e0e0dc 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -81,7 +81,6 @@ static const struct dri_extension card_extensions[] = { "GL_EXT_stencil_wrap", NULL }, { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 5896296021..3b85e84d90 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -137,7 +137,6 @@ static const struct dri_extension card_extensions[] = { "GL_ATI_texture_mirror_once", NULL }, { "GL_MESA_pack_invert", NULL }, { "GL_NV_blend_square", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 3d2f8928fa..ef495aabb9 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -134,7 +134,6 @@ static const struct dri_extension card_extensions[] = { {"GL_MESAX_texture_float", NULL}, {"GL_NV_blend_square", NULL}, {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, - {"GL_SGIS_generate_mipmap", NULL}, {NULL, NULL} /* *INDENT-ON* */ }; diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index f4e6716350..cd34e6208d 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -146,7 +146,6 @@ static const struct dri_extension card_extensions[] = { {"GL_MESAX_texture_float", NULL}, {"GL_NV_blend_square", NULL}, {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, - {"GL_SGIS_generate_mipmap", NULL}, {"GL_ARB_pixel_buffer_object", NULL}, {"GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, {NULL, NULL} diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index ee65d7ff3d..0b92c51466 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -101,7 +101,6 @@ static const struct dri_extension card_extensions[] = { "GL_ATI_texture_mirror_once", NULL }, { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index c30fcf3a6f..6f1e8bfc49 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -136,8 +136,6 @@ static void tdfxDDInitExtensions( GLcontext *ctx ) if ( TDFX_IS_NAPALM( fxMesa ) ) { driInitExtensions( ctx, napalm_extensions, GL_FALSE ); - } else { - _mesa_enable_extension( ctx, "GL_SGIS_generate_mipmap" ); } } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index fe7eade3eb..0ca068c2db 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -206,7 +206,7 @@ static const struct { { 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) }, - { OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, + { 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) }, @@ -364,7 +364,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.NV_fragment_program_option = GL_TRUE; #endif ctx->Extensions.SGI_texture_color_table = GL_TRUE; - ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; + /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/ ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; @@ -437,7 +437,7 @@ _mesa_enable_1_4_extensions(GLcontext *ctx) ctx->Extensions.EXT_secondary_color = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; ctx->Extensions.EXT_texture_lod_bias = GL_TRUE; - ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; + /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/ } diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index e2d4129a38..8902ae3776 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -97,10 +97,6 @@ _mesa_Hint( GLenum target, GLenum mode ) /* GL_SGIS_generate_mipmap */ case GL_GENERATE_MIPMAP_HINT_SGIS: - if (!ctx->Extensions.SGIS_generate_mipmap) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); - return; - } if (ctx->Hint.GenerateMipmap == mode) return; FLUSH_VERTICES(ctx, _NEW_HINT); diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 745a0aeec9..187049c070 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -291,17 +291,10 @@ set_tex_parameteri(GLcontext *ctx, return GL_TRUE; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - if (texObj->GenerateMipmap != params[0]) { - flush(ctx, texObj); - texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; - return GL_TRUE; - } - return GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); + if (texObj->GenerateMipmap != params[0]) { + flush(ctx, texObj); + texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; + return GL_TRUE; } return GL_FALSE; @@ -1126,11 +1119,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) error = GL_TRUE; break; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - *params = (GLfloat) obj->GenerateMipmap; - } - else - error = GL_TRUE; + *params = (GLfloat) obj->GenerateMipmap; break; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow) { @@ -1291,12 +1280,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) } break; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - *params = (GLint) obj->GenerateMipmap; - } - else { - error = GL_TRUE; - } + *params = (GLint) obj->GenerateMipmap; break; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow) { -- cgit v1.2.3 From 4b1f98241f9601c2b163bb41e45aa567f9cd61dd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sat, 18 Sep 2010 16:21:00 +0200 Subject: Remove GL_MESA_packed_depth_stencil This extension was never enabled in any driver. --- src/glx/compsize.c | 8 -------- src/mesa/drivers/dri/mga/mgapixel.c | 12 +++--------- src/mesa/main/extensions.c | 1 - src/mesa/main/mtypes.h | 1 - 4 files changed, 3 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/glx/compsize.c b/src/glx/compsize.c index 5ba6dc919e..ccb3a0e924 100644 --- a/src/glx/compsize.c +++ b/src/glx/compsize.c @@ -52,15 +52,11 @@ __glElementsPerGroup(GLenum format, GLenum type) case GL_UNSIGNED_SHORT_1_5_5_5_REV: case GL_UNSIGNED_SHORT_8_8_APPLE: case GL_UNSIGNED_SHORT_8_8_REV_APPLE: - case GL_UNSIGNED_SHORT_15_1_MESA: - case GL_UNSIGNED_SHORT_1_15_REV_MESA: case GL_UNSIGNED_INT_8_8_8_8: case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: case GL_UNSIGNED_INT_24_8_NV: - case GL_UNSIGNED_INT_24_8_MESA: - case GL_UNSIGNED_INT_8_24_REV_MESA: return 1; default: break; @@ -114,8 +110,6 @@ __glBytesPerElement(GLenum type) case GL_UNSIGNED_SHORT_1_5_5_5_REV: case GL_UNSIGNED_SHORT_8_8_APPLE: case GL_UNSIGNED_SHORT_8_8_REV_APPLE: - case GL_UNSIGNED_SHORT_15_1_MESA: - case GL_UNSIGNED_SHORT_1_15_REV_MESA: return 2; case GL_UNSIGNED_BYTE: case GL_BYTE: @@ -130,8 +124,6 @@ __glBytesPerElement(GLenum type) case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: case GL_UNSIGNED_INT_24_8_NV: - case GL_UNSIGNED_INT_24_8_MESA: - case GL_UNSIGNED_INT_8_24_REV_MESA: return 4; default: return 0; diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c index 664f7c77c2..9cbdbe02c9 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.c +++ b/src/mesa/drivers/dri/mga/mgapixel.c @@ -55,7 +55,6 @@ (((unsigned long)p) - (unsigned long)mmesa->mgaScreen->buffers.map) -#if defined(MESA_packed_depth_stencil) static GLboolean check_depth_stencil_24_8( const GLcontext *ctx, GLenum type, const struct gl_pixelstore_attrib *packing, @@ -64,7 +63,7 @@ check_depth_stencil_24_8( const GLcontext *ctx, GLenum type, { mgaContextPtr mmesa = MGA_CONTEXT(ctx); - return ( type == GL_UNSIGNED_INT_24_8_MESA && + return ( type == GL_UNSIGNED_INT_24_8 && ctx->Visual->DepthBits == 24 && ctx->Visual->StencilBits == 8 && mmesa->mgaScreen->cpp == 4 && @@ -78,7 +77,6 @@ check_depth_stencil_24_8( const GLcontext *ctx, GLenum type, pitch % 32 == 0 && pitch < 4096 ); } -#endif static GLboolean @@ -252,13 +250,11 @@ mgaTryReadPixels( GLcontext *ctx, return GL_FALSE; switch (format) { -#if defined(MESA_packed_depth_stencil) - case GL_DEPTH_STENCIL_MESA: + case GL_DEPTH_STENCIL: ok = check_depth_stencil_24_8(ctx, type, pack, pixels, size, pitch); planemask = ~0; source = mmesa->mgaScreen->depthOffset; break; -#endif case GL_DEPTH_COMPONENT: ok = check_depth(ctx, type, pack, pixels, size, pitch); @@ -494,8 +490,7 @@ mgaTryDrawPixels( GLcontext *ctx, switch (format) { -#if defined(MESA_packed_depth_stencil) - case GL_DEPTH_STENCIL_MESA: + case GL_DEPTH_STENCIL: dest = mmesa->mgaScreen->depthOffset; planemask = ~0; if (!check_depth_stencil_24_8(ctx, type, unpack, pixels, size, pitch) || @@ -503,7 +498,6 @@ mgaTryDrawPixels( GLcontext *ctx, !check_stencil_per_fragment_ops(ctx)) return GL_FALSE; break; -#endif case GL_DEPTH_COMPONENT: dest = mmesa->mgaScreen->depthOffset; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 0ca068c2db..966c687b9c 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -184,7 +184,6 @@ static const struct { { 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_packed_depth_stencil", F(MESA_packed_depth_stencil) }, { 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) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d7c5d28c2c..4cd968e40f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2687,7 +2687,6 @@ struct gl_extensions GLboolean IBM_rasterpos_clip; GLboolean IBM_multimode_draw_arrays; GLboolean MESA_pack_invert; - GLboolean MESA_packed_depth_stencil; GLboolean MESA_resize_buffers; GLboolean MESA_ycbcr_texture; GLboolean MESA_texture_array; -- cgit v1.2.3 From 02984e3536bf9a4f149916b45d727659c8dc9a7c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sat, 18 Sep 2010 16:41:44 +0200 Subject: Remove GL_EXT_cull_vertex This is only used in the i915 driver where it provides little benefit for very few applications that use it with fixed function TNL. --- src/mesa/drivers/dri/i915/intel_render.c | 1 - src/mesa/drivers/dri/intel/intel_extensions.c | 2 - src/mesa/drivers/windows/fx/fxopengl.def | 2 - src/mesa/main/api_exec.c | 2 - src/mesa/main/clip.c | 43 - src/mesa/main/clip.h | 7 - src/mesa/main/enable.c | 7 - src/mesa/main/extensions.c | 1 - src/mesa/main/mtypes.h | 2 - src/mesa/main/remap_helper.h | 3439 ++++++++++++------------- src/mesa/sources.mak | 1 - src/mesa/tnl/t_pipeline.h | 1 - src/mesa/tnl/t_vb_cull.c | 96 - 13 files changed, 1719 insertions(+), 1885 deletions(-) delete mode 100644 src/mesa/tnl/t_vb_cull.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c index add0adacb5..dc6bc9a71c 100644 --- a/src/mesa/drivers/dri/i915/intel_render.c +++ b/src/mesa/drivers/dri/i915/intel_render.c @@ -266,7 +266,6 @@ static const struct tnl_pipeline_stage _intel_render_stage = { const struct tnl_pipeline_stage *intel_pipeline[] = { &_tnl_vertex_transform_stage, - &_tnl_vertex_cull_stage, &_tnl_normal_transform_stage, &_tnl_lighting_stage, &_tnl_fog_coordinate_stage, diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index a946ee447a..d741f82767 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -46,7 +46,6 @@ #define need_GL_EXT_blend_equation_separate #define need_GL_EXT_blend_func_separate #define need_GL_EXT_blend_minmax -#define need_GL_EXT_cull_vertex #define need_GL_EXT_draw_buffers2 #define need_GL_EXT_fog_coord #define need_GL_EXT_framebuffer_blit @@ -106,7 +105,6 @@ static const struct dri_extension card_extensions[] = { { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, { "GL_EXT_blend_logic_op", NULL }, { "GL_EXT_blend_subtract", NULL }, - { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions }, { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions }, { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { "GL_EXT_framebuffer_multisample", GL_EXT_framebuffer_multisample_functions }, diff --git a/src/mesa/drivers/windows/fx/fxopengl.def b/src/mesa/drivers/windows/fx/fxopengl.def index d65b763d25..bc615e93ae 100644 --- a/src/mesa/drivers/windows/fx/fxopengl.def +++ b/src/mesa/drivers/windows/fx/fxopengl.def @@ -135,8 +135,6 @@ EXPORTS glCopyTexSubImage3D glCopyTexSubImage3DEXT glCullFace - glCullParameterdvEXT - glCullParameterfvEXT glDeleteBuffersARB glDeleteFencesNV glDeleteLists diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index c3c710f5ef..b87aa47d88 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -224,8 +224,6 @@ _mesa_create_exec_table(void) SET_ClearIndex(exec, _mesa_ClearIndex); SET_ClipPlane(exec, _mesa_ClipPlane); SET_ColorMaterial(exec, _mesa_ColorMaterial); - SET_CullParameterfvEXT(exec, _mesa_CullParameterfvEXT); - SET_CullParameterdvEXT(exec, _mesa_CullParameterdvEXT); SET_DepthFunc(exec, _mesa_DepthFunc); SET_DepthMask(exec, _mesa_DepthMask); SET_DepthRange(exec, _mesa_DepthRange); diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index 96c80e6ef8..be8ce4278c 100644 --- a/src/mesa/main/clip.c +++ b/src/mesa/main/clip.c @@ -114,46 +114,3 @@ _mesa_GetClipPlane( GLenum plane, GLdouble *equation ) equation[2] = (GLdouble) ctx->Transform.EyeUserPlane[p][2]; equation[3] = (GLdouble) ctx->Transform.EyeUserPlane[p][3]; } - -void GLAPIENTRY -_mesa_CullParameterfvEXT (GLenum cap, GLfloat *v) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (cap) { - case GL_CULL_VERTEX_EYE_POSITION_EXT: - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - COPY_4FV(ctx->Transform.CullEyePos, v); - - _mesa_transform_vector( ctx->Transform.CullObjPos, - ctx->Transform.CullEyePos, - ctx->ModelviewMatrixStack.Top->inv ); - break; - - case GL_CULL_VERTEX_OBJECT_POSITION_EXT: - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - COPY_4FV(ctx->Transform.CullObjPos, v); - - _mesa_transform_vector( ctx->Transform.CullEyePos, - ctx->Transform.CullObjPos, - ctx->ModelviewMatrixStack.Top->m ); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glCullParameterfvEXT" ); - } -} - -void GLAPIENTRY -_mesa_CullParameterdvEXT (GLenum cap, GLdouble *v) -{ - GLfloat f[4]; - - f[0] = (GLfloat)v[0]; - f[1] = (GLfloat)v[1]; - f[2] = (GLfloat)v[2]; - f[3] = (GLfloat)v[3]; - - _mesa_CullParameterfvEXT(cap, f); -} - diff --git a/src/mesa/main/clip.h b/src/mesa/main/clip.h index ac472d66e0..11431dcfce 100644 --- a/src/mesa/main/clip.h +++ b/src/mesa/main/clip.h @@ -39,11 +39,4 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *equation ); extern void GLAPIENTRY _mesa_GetClipPlane( GLenum plane, GLdouble *equation ); -extern void GLAPIENTRY -_mesa_CullParameterfvEXT (GLenum cap, GLfloat *v); - -extern void GLAPIENTRY -_mesa_CullParameterdvEXT (GLenum cap, GLdouble *v); - - #endif diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 15ce2d1225..b2be44830a 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -335,13 +335,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_POLYGON); ctx->Polygon.CullFlag = state; break; - case GL_CULL_VERTEX_EXT: - CHECK_EXTENSION(EXT_cull_vertex, cap); - if (ctx->Transform.CullVertexFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.CullVertexFlag = state; - break; case GL_DEPTH_TEST: if (ctx->Depth.Test == state) return; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 966c687b9c..9b723ef74b 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -114,7 +114,6 @@ static const struct { { 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) }, - { OFF, "GL_EXT_cull_vertex", F(EXT_cull_vertex) }, { 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) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4cd968e40f..0a69bcc4e3 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1405,7 +1405,6 @@ struct gl_transform_attrib GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ GLboolean DepthClamp; /**< GL_ARB_depth_clamp */ - GLboolean CullVertexFlag; /**< True if GL_CULL_VERTEX_EXT is enabled */ GLfloat CullEyePos[4]; GLfloat CullObjPos[4]; }; @@ -2624,7 +2623,6 @@ struct gl_extensions GLboolean EXT_blend_minmax; GLboolean EXT_blend_subtract; GLboolean EXT_clip_volume_hint; - GLboolean EXT_cull_vertex; GLboolean EXT_compiled_vertex_array; GLboolean EXT_copy_texture; GLboolean EXT_depth_bounds_test; diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index 631cc90158..fe3e0fd912 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -65,4122 +65,4122 @@ static const char _mesa_function_pool[] = "\0" "glLoadIdentity\0" "\0" - /* _mesa_function_pool[172]: SampleCoverageARB (will be remapped) */ + /* _mesa_function_pool[172]: GetCombinerOutputParameterfvNV (will be remapped) */ + "iiip\0" + "glGetCombinerOutputParameterfvNV\0" + "\0" + /* _mesa_function_pool[211]: SampleCoverageARB (will be remapped) */ "fi\0" "glSampleCoverage\0" "glSampleCoverageARB\0" "\0" - /* _mesa_function_pool[213]: ConvolutionFilter1D (offset 348) */ + /* _mesa_function_pool[252]: ConvolutionFilter1D (offset 348) */ "iiiiip\0" "glConvolutionFilter1D\0" "glConvolutionFilter1DEXT\0" "\0" - /* _mesa_function_pool[268]: BeginQueryARB (will be remapped) */ + /* _mesa_function_pool[307]: BeginQueryARB (will be remapped) */ "ii\0" "glBeginQuery\0" "glBeginQueryARB\0" "\0" - /* _mesa_function_pool[301]: RasterPos3dv (offset 71) */ + /* _mesa_function_pool[340]: RasterPos3dv (offset 71) */ "p\0" "glRasterPos3dv\0" "\0" - /* _mesa_function_pool[319]: PointParameteriNV (will be remapped) */ + /* _mesa_function_pool[358]: PointParameteriNV (will be remapped) */ "ii\0" "glPointParameteri\0" "glPointParameteriNV\0" "\0" - /* _mesa_function_pool[361]: GetProgramiv (will be remapped) */ + /* _mesa_function_pool[400]: GetProgramiv (will be remapped) */ "iip\0" "glGetProgramiv\0" "\0" - /* _mesa_function_pool[381]: MultiTexCoord3sARB (offset 398) */ + /* _mesa_function_pool[420]: MultiTexCoord3sARB (offset 398) */ "iiii\0" "glMultiTexCoord3s\0" "glMultiTexCoord3sARB\0" "\0" - /* _mesa_function_pool[426]: SecondaryColor3iEXT (will be remapped) */ + /* _mesa_function_pool[465]: SecondaryColor3iEXT (will be remapped) */ "iii\0" "glSecondaryColor3i\0" "glSecondaryColor3iEXT\0" "\0" - /* _mesa_function_pool[472]: WindowPos3fMESA (will be remapped) */ + /* _mesa_function_pool[511]: WindowPos3fMESA (will be remapped) */ "fff\0" "glWindowPos3f\0" "glWindowPos3fARB\0" "glWindowPos3fMESA\0" "\0" - /* _mesa_function_pool[526]: TexCoord1iv (offset 99) */ + /* _mesa_function_pool[565]: TexCoord1iv (offset 99) */ "p\0" "glTexCoord1iv\0" "\0" - /* _mesa_function_pool[543]: TexCoord4sv (offset 125) */ + /* _mesa_function_pool[582]: TexCoord4sv (offset 125) */ "p\0" "glTexCoord4sv\0" "\0" - /* _mesa_function_pool[560]: RasterPos4s (offset 84) */ + /* _mesa_function_pool[599]: RasterPos4s (offset 84) */ "iiii\0" "glRasterPos4s\0" "\0" - /* _mesa_function_pool[580]: PixelTexGenParameterfvSGIS (will be remapped) */ + /* _mesa_function_pool[619]: PixelTexGenParameterfvSGIS (will be remapped) */ "ip\0" "glPixelTexGenParameterfvSGIS\0" "\0" - /* _mesa_function_pool[613]: ActiveTextureARB (offset 374) */ + /* _mesa_function_pool[652]: ActiveTextureARB (offset 374) */ "i\0" "glActiveTexture\0" "glActiveTextureARB\0" "\0" - /* _mesa_function_pool[651]: BlitFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[690]: BlitFramebufferEXT (will be remapped) */ "iiiiiiiiii\0" "glBlitFramebuffer\0" "glBlitFramebufferEXT\0" "\0" - /* _mesa_function_pool[702]: TexCoord1f (offset 96) */ + /* _mesa_function_pool[741]: TexCoord1f (offset 96) */ "f\0" "glTexCoord1f\0" "\0" - /* _mesa_function_pool[718]: TexCoord1d (offset 94) */ + /* _mesa_function_pool[757]: TexCoord1d (offset 94) */ "d\0" "glTexCoord1d\0" "\0" - /* _mesa_function_pool[734]: VertexAttrib4ubvNV (will be remapped) */ + /* _mesa_function_pool[773]: VertexAttrib4ubvNV (will be remapped) */ "ip\0" "glVertexAttrib4ubvNV\0" "\0" - /* _mesa_function_pool[759]: TexCoord1i (offset 98) */ + /* _mesa_function_pool[798]: TexCoord1i (offset 98) */ "i\0" "glTexCoord1i\0" "\0" - /* _mesa_function_pool[775]: GetProgramNamedParameterdvNV (will be remapped) */ + /* _mesa_function_pool[814]: GetProgramNamedParameterdvNV (will be remapped) */ "iipp\0" "glGetProgramNamedParameterdvNV\0" "\0" - /* _mesa_function_pool[812]: Histogram (offset 367) */ + /* _mesa_function_pool[851]: Histogram (offset 367) */ "iiii\0" "glHistogram\0" "glHistogramEXT\0" "\0" - /* _mesa_function_pool[845]: TexCoord1s (offset 100) */ + /* _mesa_function_pool[884]: TexCoord1s (offset 100) */ "i\0" "glTexCoord1s\0" "\0" - /* _mesa_function_pool[861]: GetMapfv (offset 267) */ + /* _mesa_function_pool[900]: GetMapfv (offset 267) */ "iip\0" "glGetMapfv\0" "\0" - /* _mesa_function_pool[877]: EvalCoord1f (offset 230) */ + /* _mesa_function_pool[916]: EvalCoord1f (offset 230) */ "f\0" "glEvalCoord1f\0" "\0" - /* _mesa_function_pool[894]: TexImage4DSGIS (dynamic) */ + /* _mesa_function_pool[933]: TexImage4DSGIS (dynamic) */ "iiiiiiiiiip\0" "glTexImage4DSGIS\0" "\0" - /* _mesa_function_pool[924]: PolygonStipple (offset 175) */ + /* _mesa_function_pool[963]: PolygonStipple (offset 175) */ "p\0" "glPolygonStipple\0" "\0" - /* _mesa_function_pool[944]: WindowPos2dvMESA (will be remapped) */ + /* _mesa_function_pool[983]: WindowPos2dvMESA (will be remapped) */ "p\0" "glWindowPos2dv\0" "glWindowPos2dvARB\0" "glWindowPos2dvMESA\0" "\0" - /* _mesa_function_pool[999]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[1038]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[1043]: BlendEquationSeparateEXT (will be remapped) */ + /* _mesa_function_pool[1082]: BlendEquationSeparateEXT (will be remapped) */ "ii\0" "glBlendEquationSeparate\0" "glBlendEquationSeparateEXT\0" "glBlendEquationSeparateATI\0" "\0" - /* _mesa_function_pool[1125]: ListParameterfSGIX (dynamic) */ + /* _mesa_function_pool[1164]: ListParameterfSGIX (dynamic) */ "iif\0" "glListParameterfSGIX\0" "\0" - /* _mesa_function_pool[1151]: SecondaryColor3bEXT (will be remapped) */ + /* _mesa_function_pool[1190]: SecondaryColor3bEXT (will be remapped) */ "iii\0" "glSecondaryColor3b\0" "glSecondaryColor3bEXT\0" "\0" - /* _mesa_function_pool[1197]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */ + /* _mesa_function_pool[1236]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */ "pppp\0" "glTexCoord4fColor4fNormal3fVertex4fvSUN\0" "\0" - /* _mesa_function_pool[1243]: GetPixelMapfv (offset 271) */ + /* _mesa_function_pool[1282]: GetPixelMapfv (offset 271) */ "ip\0" "glGetPixelMapfv\0" "\0" - /* _mesa_function_pool[1263]: Color3uiv (offset 22) */ + /* _mesa_function_pool[1302]: Color3uiv (offset 22) */ "p\0" "glColor3uiv\0" "\0" - /* _mesa_function_pool[1278]: IsEnabled (offset 286) */ + /* _mesa_function_pool[1317]: IsEnabled (offset 286) */ "i\0" "glIsEnabled\0" "\0" - /* _mesa_function_pool[1293]: VertexAttrib4svNV (will be remapped) */ + /* _mesa_function_pool[1332]: VertexAttrib4svNV (will be remapped) */ "ip\0" "glVertexAttrib4svNV\0" "\0" - /* _mesa_function_pool[1317]: EvalCoord2fv (offset 235) */ + /* _mesa_function_pool[1356]: EvalCoord2fv (offset 235) */ "p\0" "glEvalCoord2fv\0" "\0" - /* _mesa_function_pool[1335]: GetBufferSubDataARB (will be remapped) */ + /* _mesa_function_pool[1374]: GetBufferSubDataARB (will be remapped) */ "iiip\0" "glGetBufferSubData\0" "glGetBufferSubDataARB\0" "\0" - /* _mesa_function_pool[1382]: BufferSubDataARB (will be remapped) */ + /* _mesa_function_pool[1421]: BufferSubDataARB (will be remapped) */ "iiip\0" "glBufferSubData\0" "glBufferSubDataARB\0" "\0" - /* _mesa_function_pool[1423]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[1462]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[1461]: AttachShader (will be remapped) */ + /* _mesa_function_pool[1500]: AttachShader (will be remapped) */ "ii\0" "glAttachShader\0" "\0" - /* _mesa_function_pool[1480]: VertexAttrib2fARB (will be remapped) */ + /* _mesa_function_pool[1519]: VertexAttrib2fARB (will be remapped) */ "iff\0" "glVertexAttrib2f\0" "glVertexAttrib2fARB\0" "\0" - /* _mesa_function_pool[1522]: GetDebugLogLengthMESA (dynamic) */ + /* _mesa_function_pool[1561]: GetDebugLogLengthMESA (dynamic) */ "iii\0" "glGetDebugLogLengthMESA\0" "\0" - /* _mesa_function_pool[1551]: GetMapiv (offset 268) */ + /* _mesa_function_pool[1590]: GetMapiv (offset 268) */ "iip\0" "glGetMapiv\0" "\0" - /* _mesa_function_pool[1567]: VertexAttrib3fARB (will be remapped) */ + /* _mesa_function_pool[1606]: VertexAttrib3fARB (will be remapped) */ "ifff\0" "glVertexAttrib3f\0" "glVertexAttrib3fARB\0" "\0" - /* _mesa_function_pool[1610]: Indexubv (offset 316) */ + /* _mesa_function_pool[1649]: Indexubv (offset 316) */ "p\0" "glIndexubv\0" "\0" - /* _mesa_function_pool[1624]: GetQueryivARB (will be remapped) */ + /* _mesa_function_pool[1663]: GetQueryivARB (will be remapped) */ "iip\0" "glGetQueryiv\0" "glGetQueryivARB\0" "\0" - /* _mesa_function_pool[1658]: TexImage3D (offset 371) */ + /* _mesa_function_pool[1697]: TexImage3D (offset 371) */ "iiiiiiiiip\0" "glTexImage3D\0" "glTexImage3DEXT\0" "\0" - /* _mesa_function_pool[1699]: ReplacementCodeuiVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[1738]: ReplacementCodeuiVertex3fvSUN (dynamic) */ "pp\0" "glReplacementCodeuiVertex3fvSUN\0" "\0" - /* _mesa_function_pool[1735]: EdgeFlagPointer (offset 312) */ + /* _mesa_function_pool[1774]: EdgeFlagPointer (offset 312) */ "ip\0" "glEdgeFlagPointer\0" "\0" - /* _mesa_function_pool[1757]: Color3ubv (offset 20) */ + /* _mesa_function_pool[1796]: Color3ubv (offset 20) */ "p\0" "glColor3ubv\0" "\0" - /* _mesa_function_pool[1772]: GetQueryObjectivARB (will be remapped) */ + /* _mesa_function_pool[1811]: GetQueryObjectivARB (will be remapped) */ "iip\0" "glGetQueryObjectiv\0" "glGetQueryObjectivARB\0" "\0" - /* _mesa_function_pool[1818]: Vertex3dv (offset 135) */ + /* _mesa_function_pool[1857]: Vertex3dv (offset 135) */ "p\0" "glVertex3dv\0" "\0" - /* _mesa_function_pool[1833]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[1872]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiTexCoord2fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[1880]: CompressedTexSubImage2DARB (will be remapped) */ + /* _mesa_function_pool[1919]: CompressedTexSubImage2DARB (will be remapped) */ "iiiiiiiip\0" "glCompressedTexSubImage2D\0" "glCompressedTexSubImage2DARB\0" "\0" - /* _mesa_function_pool[1946]: CombinerOutputNV (will be remapped) */ + /* _mesa_function_pool[1985]: CombinerOutputNV (will be remapped) */ "iiiiiiiiii\0" "glCombinerOutputNV\0" "\0" - /* _mesa_function_pool[1977]: VertexAttribs3fvNV (will be remapped) */ + /* _mesa_function_pool[2016]: VertexAttribs3fvNV (will be remapped) */ "iip\0" "glVertexAttribs3fvNV\0" "\0" - /* _mesa_function_pool[2003]: Uniform2fARB (will be remapped) */ + /* _mesa_function_pool[2042]: Uniform2fARB (will be remapped) */ "iff\0" "glUniform2f\0" "glUniform2fARB\0" "\0" - /* _mesa_function_pool[2035]: LightModeliv (offset 166) */ + /* _mesa_function_pool[2074]: LightModeliv (offset 166) */ "ip\0" "glLightModeliv\0" "\0" - /* _mesa_function_pool[2054]: VertexAttrib1svARB (will be remapped) */ + /* _mesa_function_pool[2093]: VertexAttrib1svARB (will be remapped) */ "ip\0" "glVertexAttrib1sv\0" "glVertexAttrib1svARB\0" "\0" - /* _mesa_function_pool[2097]: VertexAttribs1dvNV (will be remapped) */ + /* _mesa_function_pool[2136]: VertexAttribs1dvNV (will be remapped) */ "iip\0" "glVertexAttribs1dvNV\0" "\0" - /* _mesa_function_pool[2123]: Uniform2ivARB (will be remapped) */ + /* _mesa_function_pool[2162]: Uniform2ivARB (will be remapped) */ "iip\0" "glUniform2iv\0" "glUniform2ivARB\0" "\0" - /* _mesa_function_pool[2157]: GetImageTransformParameterfvHP (dynamic) */ + /* _mesa_function_pool[2196]: GetImageTransformParameterfvHP (dynamic) */ "iip\0" "glGetImageTransformParameterfvHP\0" "\0" - /* _mesa_function_pool[2195]: Normal3bv (offset 53) */ + /* _mesa_function_pool[2234]: Normal3bv (offset 53) */ "p\0" "glNormal3bv\0" "\0" - /* _mesa_function_pool[2210]: TexGeniv (offset 193) */ + /* _mesa_function_pool[2249]: TexGeniv (offset 193) */ "iip\0" "glTexGeniv\0" "\0" - /* _mesa_function_pool[2226]: WeightubvARB (dynamic) */ + /* _mesa_function_pool[2265]: WeightubvARB (dynamic) */ "ip\0" "glWeightubvARB\0" "\0" - /* _mesa_function_pool[2245]: VertexAttrib1fvNV (will be remapped) */ + /* _mesa_function_pool[2284]: VertexAttrib1fvNV (will be remapped) */ "ip\0" "glVertexAttrib1fvNV\0" "\0" - /* _mesa_function_pool[2269]: Vertex3iv (offset 139) */ + /* _mesa_function_pool[2308]: Vertex3iv (offset 139) */ "p\0" "glVertex3iv\0" "\0" - /* _mesa_function_pool[2284]: CopyConvolutionFilter1D (offset 354) */ + /* _mesa_function_pool[2323]: CopyConvolutionFilter1D (offset 354) */ "iiiii\0" "glCopyConvolutionFilter1D\0" "glCopyConvolutionFilter1DEXT\0" "\0" - /* _mesa_function_pool[2346]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[2385]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */ "iffffff\0" "glReplacementCodeuiNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[2394]: DeleteSync (will be remapped) */ + /* _mesa_function_pool[2433]: DeleteSync (will be remapped) */ "i\0" "glDeleteSync\0" "\0" - /* _mesa_function_pool[2410]: FragmentMaterialfvSGIX (dynamic) */ + /* _mesa_function_pool[2449]: FragmentMaterialfvSGIX (dynamic) */ "iip\0" "glFragmentMaterialfvSGIX\0" "\0" - /* _mesa_function_pool[2440]: BlendColor (offset 336) */ + /* _mesa_function_pool[2479]: BlendColor (offset 336) */ "ffff\0" "glBlendColor\0" "glBlendColorEXT\0" "\0" - /* _mesa_function_pool[2475]: UniformMatrix4fvARB (will be remapped) */ + /* _mesa_function_pool[2514]: UniformMatrix4fvARB (will be remapped) */ "iiip\0" "glUniformMatrix4fv\0" "glUniformMatrix4fvARB\0" "\0" - /* _mesa_function_pool[2522]: DeleteVertexArraysAPPLE (will be remapped) */ + /* _mesa_function_pool[2561]: DeleteVertexArraysAPPLE (will be remapped) */ "ip\0" "glDeleteVertexArrays\0" "glDeleteVertexArraysAPPLE\0" "\0" - /* _mesa_function_pool[2573]: ReadInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[2612]: ReadInstrumentsSGIX (dynamic) */ "i\0" "glReadInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[2598]: CallLists (offset 3) */ + /* _mesa_function_pool[2637]: CallLists (offset 3) */ "iip\0" "glCallLists\0" "\0" - /* _mesa_function_pool[2615]: UniformMatrix2x4fv (will be remapped) */ + /* _mesa_function_pool[2654]: UniformMatrix2x4fv (will be remapped) */ "iiip\0" "glUniformMatrix2x4fv\0" "\0" - /* _mesa_function_pool[2642]: Color4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[2681]: Color4ubVertex3fvSUN (dynamic) */ "pp\0" "glColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[2669]: Normal3iv (offset 59) */ + /* _mesa_function_pool[2708]: Normal3iv (offset 59) */ "p\0" "glNormal3iv\0" "\0" - /* _mesa_function_pool[2684]: PassThrough (offset 199) */ + /* _mesa_function_pool[2723]: PassThrough (offset 199) */ "f\0" "glPassThrough\0" "\0" - /* _mesa_function_pool[2701]: FramebufferTextureLayerEXT (will be remapped) */ + /* _mesa_function_pool[2740]: FramebufferTextureLayerEXT (will be remapped) */ "iiiii\0" "glFramebufferTextureLayer\0" "glFramebufferTextureLayerEXT\0" "\0" - /* _mesa_function_pool[2763]: GetListParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[2802]: GetListParameterfvSGIX (dynamic) */ "iip\0" "glGetListParameterfvSGIX\0" "\0" - /* _mesa_function_pool[2793]: Viewport (offset 305) */ + /* _mesa_function_pool[2832]: Viewport (offset 305) */ "iiii\0" "glViewport\0" "\0" - /* _mesa_function_pool[2810]: VertexAttrib4NusvARB (will be remapped) */ + /* _mesa_function_pool[2849]: VertexAttrib4NusvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nusv\0" "glVertexAttrib4NusvARB\0" "\0" - /* _mesa_function_pool[2857]: WindowPos4svMESA (will be remapped) */ + /* _mesa_function_pool[2896]: WindowPos4svMESA (will be remapped) */ "p\0" "glWindowPos4svMESA\0" "\0" - /* _mesa_function_pool[2879]: CreateProgramObjectARB (will be remapped) */ + /* _mesa_function_pool[2918]: CreateProgramObjectARB (will be remapped) */ "\0" "glCreateProgramObjectARB\0" "\0" - /* _mesa_function_pool[2906]: DeleteTransformFeedbacks (will be remapped) */ + /* _mesa_function_pool[2945]: DeleteTransformFeedbacks (will be remapped) */ "ip\0" "glDeleteTransformFeedbacks\0" "\0" - /* _mesa_function_pool[2937]: UniformMatrix4x3fv (will be remapped) */ + /* _mesa_function_pool[2976]: UniformMatrix4x3fv (will be remapped) */ "iiip\0" "glUniformMatrix4x3fv\0" "\0" - /* _mesa_function_pool[2964]: PrioritizeTextures (offset 331) */ + /* _mesa_function_pool[3003]: PrioritizeTextures (offset 331) */ "ipp\0" "glPrioritizeTextures\0" "glPrioritizeTexturesEXT\0" "\0" - /* _mesa_function_pool[3014]: AsyncMarkerSGIX (dynamic) */ + /* _mesa_function_pool[3053]: AsyncMarkerSGIX (dynamic) */ "i\0" "glAsyncMarkerSGIX\0" "\0" - /* _mesa_function_pool[3035]: GlobalAlphaFactorubSUN (dynamic) */ + /* _mesa_function_pool[3074]: GlobalAlphaFactorubSUN (dynamic) */ "i\0" "glGlobalAlphaFactorubSUN\0" "\0" - /* _mesa_function_pool[3063]: ClearDebugLogMESA (dynamic) */ + /* _mesa_function_pool[3102]: ClearDebugLogMESA (dynamic) */ "iii\0" "glClearDebugLogMESA\0" "\0" - /* _mesa_function_pool[3088]: ResetHistogram (offset 369) */ + /* _mesa_function_pool[3127]: ResetHistogram (offset 369) */ "i\0" "glResetHistogram\0" "glResetHistogramEXT\0" "\0" - /* _mesa_function_pool[3128]: GetProgramNamedParameterfvNV (will be remapped) */ + /* _mesa_function_pool[3167]: GetProgramNamedParameterfvNV (will be remapped) */ "iipp\0" "glGetProgramNamedParameterfvNV\0" "\0" - /* _mesa_function_pool[3165]: PointParameterfEXT (will be remapped) */ + /* _mesa_function_pool[3204]: PointParameterfEXT (will be remapped) */ "if\0" "glPointParameterf\0" "glPointParameterfARB\0" "glPointParameterfEXT\0" "glPointParameterfSGIS\0" "\0" - /* _mesa_function_pool[3251]: LoadIdentityDeformationMapSGIX (dynamic) */ + /* _mesa_function_pool[3290]: LoadIdentityDeformationMapSGIX (dynamic) */ "i\0" "glLoadIdentityDeformationMapSGIX\0" "\0" - /* _mesa_function_pool[3287]: GenFencesNV (will be remapped) */ + /* _mesa_function_pool[3326]: GenFencesNV (will be remapped) */ "ip\0" "glGenFencesNV\0" "\0" - /* _mesa_function_pool[3305]: ImageTransformParameterfHP (dynamic) */ + /* _mesa_function_pool[3344]: ImageTransformParameterfHP (dynamic) */ "iif\0" "glImageTransformParameterfHP\0" "\0" - /* _mesa_function_pool[3339]: MatrixIndexusvARB (dynamic) */ + /* _mesa_function_pool[3378]: MatrixIndexusvARB (dynamic) */ "ip\0" "glMatrixIndexusvARB\0" "\0" - /* _mesa_function_pool[3363]: DrawElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[3402]: DrawElementsBaseVertex (will be remapped) */ "iiipi\0" "glDrawElementsBaseVertex\0" "\0" - /* _mesa_function_pool[3395]: DisableVertexAttribArrayARB (will be remapped) */ + /* _mesa_function_pool[3434]: DisableVertexAttribArrayARB (will be remapped) */ "i\0" "glDisableVertexAttribArray\0" "glDisableVertexAttribArrayARB\0" "\0" - /* _mesa_function_pool[3455]: TexCoord2sv (offset 109) */ + /* _mesa_function_pool[3494]: TexCoord2sv (offset 109) */ "p\0" "glTexCoord2sv\0" "\0" - /* _mesa_function_pool[3472]: Vertex4dv (offset 143) */ + /* _mesa_function_pool[3511]: Vertex4dv (offset 143) */ "p\0" "glVertex4dv\0" "\0" - /* _mesa_function_pool[3487]: StencilMaskSeparate (will be remapped) */ + /* _mesa_function_pool[3526]: StencilMaskSeparate (will be remapped) */ "ii\0" "glStencilMaskSeparate\0" "\0" - /* _mesa_function_pool[3513]: ProgramLocalParameter4dARB (will be remapped) */ + /* _mesa_function_pool[3552]: ProgramLocalParameter4dARB (will be remapped) */ "iidddd\0" "glProgramLocalParameter4dARB\0" "\0" - /* _mesa_function_pool[3550]: CompressedTexImage3DARB (will be remapped) */ + /* _mesa_function_pool[3589]: CompressedTexImage3DARB (will be remapped) */ "iiiiiiiip\0" "glCompressedTexImage3D\0" "glCompressedTexImage3DARB\0" "\0" - /* _mesa_function_pool[3610]: Color3sv (offset 18) */ + /* _mesa_function_pool[3649]: Color3sv (offset 18) */ "p\0" "glColor3sv\0" "\0" - /* _mesa_function_pool[3624]: GetConvolutionParameteriv (offset 358) */ + /* _mesa_function_pool[3663]: GetConvolutionParameteriv (offset 358) */ "iip\0" "glGetConvolutionParameteriv\0" "glGetConvolutionParameterivEXT\0" "\0" - /* _mesa_function_pool[3688]: VertexAttrib1fARB (will be remapped) */ + /* _mesa_function_pool[3727]: VertexAttrib1fARB (will be remapped) */ "if\0" "glVertexAttrib1f\0" "glVertexAttrib1fARB\0" "\0" - /* _mesa_function_pool[3729]: Vertex2dv (offset 127) */ + /* _mesa_function_pool[3768]: Vertex2dv (offset 127) */ "p\0" "glVertex2dv\0" "\0" - /* _mesa_function_pool[3744]: TestFenceNV (will be remapped) */ + /* _mesa_function_pool[3783]: TestFenceNV (will be remapped) */ "i\0" "glTestFenceNV\0" "\0" - /* _mesa_function_pool[3761]: MultiTexCoord1fvARB (offset 379) */ + /* _mesa_function_pool[3800]: MultiTexCoord1fvARB (offset 379) */ "ip\0" "glMultiTexCoord1fv\0" "glMultiTexCoord1fvARB\0" "\0" - /* _mesa_function_pool[3806]: TexCoord3iv (offset 115) */ + /* _mesa_function_pool[3845]: TexCoord3iv (offset 115) */ "p\0" "glTexCoord3iv\0" "\0" - /* _mesa_function_pool[3823]: ColorFragmentOp2ATI (will be remapped) */ + /* _mesa_function_pool[3862]: ColorFragmentOp2ATI (will be remapped) */ "iiiiiiiiii\0" "glColorFragmentOp2ATI\0" "\0" - /* _mesa_function_pool[3857]: SecondaryColorPointerListIBM (dynamic) */ + /* _mesa_function_pool[3896]: SecondaryColorPointerListIBM (dynamic) */ "iiipi\0" "glSecondaryColorPointerListIBM\0" "\0" - /* _mesa_function_pool[3895]: GetPixelTexGenParameterivSGIS (will be remapped) */ + /* _mesa_function_pool[3934]: GetPixelTexGenParameterivSGIS (will be remapped) */ "ip\0" "glGetPixelTexGenParameterivSGIS\0" "\0" - /* _mesa_function_pool[3931]: Color3fv (offset 14) */ + /* _mesa_function_pool[3970]: Color3fv (offset 14) */ "p\0" "glColor3fv\0" "\0" - /* _mesa_function_pool[3945]: VertexAttrib4fNV (will be remapped) */ + /* _mesa_function_pool[3984]: VertexAttrib4fNV (will be remapped) */ "iffff\0" "glVertexAttrib4fNV\0" "\0" - /* _mesa_function_pool[3971]: ReplacementCodeubSUN (dynamic) */ + /* _mesa_function_pool[4010]: ReplacementCodeubSUN (dynamic) */ "i\0" "glReplacementCodeubSUN\0" "\0" - /* _mesa_function_pool[3997]: FinishAsyncSGIX (dynamic) */ + /* _mesa_function_pool[4036]: FinishAsyncSGIX (dynamic) */ "p\0" "glFinishAsyncSGIX\0" "\0" - /* _mesa_function_pool[4018]: GetDebugLogMESA (dynamic) */ + /* _mesa_function_pool[4057]: GetDebugLogMESA (dynamic) */ "iiiipp\0" "glGetDebugLogMESA\0" "\0" - /* _mesa_function_pool[4044]: FogCoorddEXT (will be remapped) */ + /* _mesa_function_pool[4083]: FogCoorddEXT (will be remapped) */ "d\0" "glFogCoordd\0" "glFogCoorddEXT\0" "\0" - /* _mesa_function_pool[4074]: BeginConditionalRenderNV (will be remapped) */ + /* _mesa_function_pool[4113]: BeginConditionalRenderNV (will be remapped) */ "ii\0" "glBeginConditionalRenderNV\0" "\0" - /* _mesa_function_pool[4105]: Color4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[4144]: Color4ubVertex3fSUN (dynamic) */ "iiiifff\0" "glColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[4136]: FogCoordfEXT (will be remapped) */ + /* _mesa_function_pool[4175]: FogCoordfEXT (will be remapped) */ "f\0" "glFogCoordf\0" "glFogCoordfEXT\0" "\0" - /* _mesa_function_pool[4166]: PointSize (offset 173) */ + /* _mesa_function_pool[4205]: PointSize (offset 173) */ "f\0" "glPointSize\0" "\0" - /* _mesa_function_pool[4181]: TexCoord2fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[4220]: TexCoord2fVertex3fSUN (dynamic) */ "fffff\0" "glTexCoord2fVertex3fSUN\0" "\0" - /* _mesa_function_pool[4212]: PopName (offset 200) */ + /* _mesa_function_pool[4251]: PopName (offset 200) */ "\0" "glPopName\0" "\0" - /* _mesa_function_pool[4224]: GlobalAlphaFactoriSUN (dynamic) */ + /* _mesa_function_pool[4263]: GlobalAlphaFactoriSUN (dynamic) */ "i\0" "glGlobalAlphaFactoriSUN\0" "\0" - /* _mesa_function_pool[4251]: VertexAttrib2dNV (will be remapped) */ + /* _mesa_function_pool[4290]: VertexAttrib2dNV (will be remapped) */ "idd\0" "glVertexAttrib2dNV\0" "\0" - /* _mesa_function_pool[4275]: GetProgramInfoLog (will be remapped) */ + /* _mesa_function_pool[4314]: GetProgramInfoLog (will be remapped) */ "iipp\0" "glGetProgramInfoLog\0" "\0" - /* _mesa_function_pool[4301]: VertexAttrib4NbvARB (will be remapped) */ + /* _mesa_function_pool[4340]: VertexAttrib4NbvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nbv\0" "glVertexAttrib4NbvARB\0" "\0" - /* _mesa_function_pool[4346]: GetActiveAttribARB (will be remapped) */ + /* _mesa_function_pool[4385]: GetActiveAttribARB (will be remapped) */ "iiipppp\0" "glGetActiveAttrib\0" "glGetActiveAttribARB\0" "\0" - /* _mesa_function_pool[4394]: Vertex4sv (offset 149) */ + /* _mesa_function_pool[4433]: Vertex4sv (offset 149) */ "p\0" "glVertex4sv\0" "\0" - /* _mesa_function_pool[4409]: VertexAttrib4ubNV (will be remapped) */ + /* _mesa_function_pool[4448]: VertexAttrib4ubNV (will be remapped) */ "iiiii\0" "glVertexAttrib4ubNV\0" "\0" - /* _mesa_function_pool[4436]: TextureRangeAPPLE (will be remapped) */ + /* _mesa_function_pool[4475]: TextureRangeAPPLE (will be remapped) */ "iip\0" "glTextureRangeAPPLE\0" "\0" - /* _mesa_function_pool[4461]: GetTexEnvfv (offset 276) */ + /* _mesa_function_pool[4500]: GetTexEnvfv (offset 276) */ "iip\0" "glGetTexEnvfv\0" "\0" - /* _mesa_function_pool[4480]: BindTransformFeedback (will be remapped) */ + /* _mesa_function_pool[4519]: BindTransformFeedback (will be remapped) */ "ii\0" "glBindTransformFeedback\0" "\0" - /* _mesa_function_pool[4508]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[4547]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ "ffffffffffff\0" "glTexCoord2fColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[4561]: Indexub (offset 315) */ + /* _mesa_function_pool[4600]: Indexub (offset 315) */ "i\0" "glIndexub\0" "\0" - /* _mesa_function_pool[4574]: TexEnvi (offset 186) */ + /* _mesa_function_pool[4613]: ColorMaskIndexedEXT (will be remapped) */ + "iiiii\0" + "glColorMaskIndexedEXT\0" + "\0" + /* _mesa_function_pool[4642]: TexEnvi (offset 186) */ "iii\0" "glTexEnvi\0" "\0" - /* _mesa_function_pool[4589]: GetClipPlane (offset 259) */ + /* _mesa_function_pool[4657]: GetClipPlane (offset 259) */ "ip\0" "glGetClipPlane\0" "\0" - /* _mesa_function_pool[4608]: CombinerParameterfvNV (will be remapped) */ + /* _mesa_function_pool[4676]: CombinerParameterfvNV (will be remapped) */ "ip\0" "glCombinerParameterfvNV\0" "\0" - /* _mesa_function_pool[4636]: VertexAttribs3dvNV (will be remapped) */ + /* _mesa_function_pool[4704]: VertexAttribs3dvNV (will be remapped) */ "iip\0" "glVertexAttribs3dvNV\0" "\0" - /* _mesa_function_pool[4662]: VertexAttribs4fvNV (will be remapped) */ + /* _mesa_function_pool[4730]: VertexAttribs4fvNV (will be remapped) */ "iip\0" "glVertexAttribs4fvNV\0" "\0" - /* _mesa_function_pool[4688]: VertexArrayRangeNV (will be remapped) */ + /* _mesa_function_pool[4756]: VertexArrayRangeNV (will be remapped) */ "ip\0" "glVertexArrayRangeNV\0" "\0" - /* _mesa_function_pool[4713]: FragmentLightiSGIX (dynamic) */ + /* _mesa_function_pool[4781]: FragmentLightiSGIX (dynamic) */ "iii\0" "glFragmentLightiSGIX\0" "\0" - /* _mesa_function_pool[4739]: PolygonOffsetEXT (will be remapped) */ + /* _mesa_function_pool[4807]: PolygonOffsetEXT (will be remapped) */ "ff\0" "glPolygonOffsetEXT\0" "\0" - /* _mesa_function_pool[4762]: PollAsyncSGIX (dynamic) */ + /* _mesa_function_pool[4830]: PollAsyncSGIX (dynamic) */ "p\0" "glPollAsyncSGIX\0" "\0" - /* _mesa_function_pool[4781]: DeleteFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[4849]: DeleteFragmentShaderATI (will be remapped) */ "i\0" "glDeleteFragmentShaderATI\0" "\0" - /* _mesa_function_pool[4810]: Scaled (offset 301) */ + /* _mesa_function_pool[4878]: Scaled (offset 301) */ "ddd\0" "glScaled\0" "\0" - /* _mesa_function_pool[4824]: ResumeTransformFeedback (will be remapped) */ + /* _mesa_function_pool[4892]: ResumeTransformFeedback (will be remapped) */ "\0" "glResumeTransformFeedback\0" "\0" - /* _mesa_function_pool[4852]: Scalef (offset 302) */ + /* _mesa_function_pool[4920]: Scalef (offset 302) */ "fff\0" "glScalef\0" "\0" - /* _mesa_function_pool[4866]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[4934]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[4904]: MultTransposeMatrixdARB (will be remapped) */ + /* _mesa_function_pool[4972]: MultTransposeMatrixdARB (will be remapped) */ "p\0" "glMultTransposeMatrixd\0" "glMultTransposeMatrixdARB\0" "\0" - /* _mesa_function_pool[4956]: ColorMaskIndexedEXT (will be remapped) */ - "iiiii\0" - "glColorMaskIndexedEXT\0" - "\0" - /* _mesa_function_pool[4985]: ObjectUnpurgeableAPPLE (will be remapped) */ + /* _mesa_function_pool[5024]: ObjectUnpurgeableAPPLE (will be remapped) */ "iii\0" "glObjectUnpurgeableAPPLE\0" "\0" - /* _mesa_function_pool[5015]: AlphaFunc (offset 240) */ + /* _mesa_function_pool[5054]: AlphaFunc (offset 240) */ "if\0" "glAlphaFunc\0" "\0" - /* _mesa_function_pool[5031]: WindowPos2svMESA (will be remapped) */ + /* _mesa_function_pool[5070]: WindowPos2svMESA (will be remapped) */ "p\0" "glWindowPos2sv\0" "glWindowPos2svARB\0" "glWindowPos2svMESA\0" "\0" - /* _mesa_function_pool[5086]: EdgeFlag (offset 41) */ + /* _mesa_function_pool[5125]: EdgeFlag (offset 41) */ "i\0" "glEdgeFlag\0" "\0" - /* _mesa_function_pool[5100]: TexCoord2iv (offset 107) */ + /* _mesa_function_pool[5139]: TexCoord2iv (offset 107) */ "p\0" "glTexCoord2iv\0" "\0" - /* _mesa_function_pool[5117]: CompressedTexImage1DARB (will be remapped) */ + /* _mesa_function_pool[5156]: CompressedTexImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexImage1D\0" "glCompressedTexImage1DARB\0" "\0" - /* _mesa_function_pool[5175]: Rotated (offset 299) */ + /* _mesa_function_pool[5214]: Rotated (offset 299) */ "dddd\0" "glRotated\0" "\0" - /* _mesa_function_pool[5191]: VertexAttrib2sNV (will be remapped) */ + /* _mesa_function_pool[5230]: VertexAttrib2sNV (will be remapped) */ "iii\0" "glVertexAttrib2sNV\0" "\0" - /* _mesa_function_pool[5215]: ReadPixels (offset 256) */ + /* _mesa_function_pool[5254]: ReadPixels (offset 256) */ "iiiiiip\0" "glReadPixels\0" "\0" - /* _mesa_function_pool[5237]: EdgeFlagv (offset 42) */ + /* _mesa_function_pool[5276]: EdgeFlagv (offset 42) */ "p\0" "glEdgeFlagv\0" "\0" - /* _mesa_function_pool[5252]: NormalPointerListIBM (dynamic) */ + /* _mesa_function_pool[5291]: NormalPointerListIBM (dynamic) */ "iipi\0" "glNormalPointerListIBM\0" "\0" - /* _mesa_function_pool[5281]: IndexPointerEXT (will be remapped) */ + /* _mesa_function_pool[5320]: IndexPointerEXT (will be remapped) */ "iiip\0" "glIndexPointerEXT\0" "\0" - /* _mesa_function_pool[5305]: Color4iv (offset 32) */ + /* _mesa_function_pool[5344]: Color4iv (offset 32) */ "p\0" "glColor4iv\0" "\0" - /* _mesa_function_pool[5319]: TexParameterf (offset 178) */ + /* _mesa_function_pool[5358]: TexParameterf (offset 178) */ "iif\0" "glTexParameterf\0" "\0" - /* _mesa_function_pool[5340]: TexParameteri (offset 180) */ + /* _mesa_function_pool[5379]: TexParameteri (offset 180) */ "iii\0" "glTexParameteri\0" "\0" - /* _mesa_function_pool[5361]: NormalPointerEXT (will be remapped) */ + /* _mesa_function_pool[5400]: NormalPointerEXT (will be remapped) */ "iiip\0" "glNormalPointerEXT\0" "\0" - /* _mesa_function_pool[5386]: MultiTexCoord3dARB (offset 392) */ + /* _mesa_function_pool[5425]: MultiTexCoord3dARB (offset 392) */ "iddd\0" "glMultiTexCoord3d\0" "glMultiTexCoord3dARB\0" "\0" - /* _mesa_function_pool[5431]: MultiTexCoord2iARB (offset 388) */ + /* _mesa_function_pool[5470]: MultiTexCoord2iARB (offset 388) */ "iii\0" "glMultiTexCoord2i\0" "glMultiTexCoord2iARB\0" "\0" - /* _mesa_function_pool[5475]: DrawPixels (offset 257) */ + /* _mesa_function_pool[5514]: DrawPixels (offset 257) */ "iiiip\0" "glDrawPixels\0" "\0" - /* _mesa_function_pool[5495]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[5534]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ "iffffffff\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[5555]: MultiTexCoord2svARB (offset 391) */ + /* _mesa_function_pool[5594]: MultiTexCoord2svARB (offset 391) */ "ip\0" "glMultiTexCoord2sv\0" "glMultiTexCoord2svARB\0" "\0" - /* _mesa_function_pool[5600]: ReplacementCodeubvSUN (dynamic) */ + /* _mesa_function_pool[5639]: ReplacementCodeubvSUN (dynamic) */ "p\0" "glReplacementCodeubvSUN\0" "\0" - /* _mesa_function_pool[5627]: Uniform3iARB (will be remapped) */ + /* _mesa_function_pool[5666]: Uniform3iARB (will be remapped) */ "iiii\0" "glUniform3i\0" "glUniform3iARB\0" "\0" - /* _mesa_function_pool[5660]: DrawTransformFeedback (will be remapped) */ + /* _mesa_function_pool[5699]: DrawTransformFeedback (will be remapped) */ "ii\0" "glDrawTransformFeedback\0" "\0" - /* _mesa_function_pool[5688]: GetFragmentMaterialfvSGIX (dynamic) */ + /* _mesa_function_pool[5727]: GetFragmentMaterialfvSGIX (dynamic) */ "iip\0" "glGetFragmentMaterialfvSGIX\0" "\0" - /* _mesa_function_pool[5721]: GetShaderInfoLog (will be remapped) */ + /* _mesa_function_pool[5760]: GetShaderInfoLog (will be remapped) */ "iipp\0" "glGetShaderInfoLog\0" "\0" - /* _mesa_function_pool[5746]: WeightivARB (dynamic) */ + /* _mesa_function_pool[5785]: WeightivARB (dynamic) */ "ip\0" "glWeightivARB\0" "\0" - /* _mesa_function_pool[5764]: PollInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[5803]: PollInstrumentsSGIX (dynamic) */ "p\0" "glPollInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[5789]: GlobalAlphaFactordSUN (dynamic) */ + /* _mesa_function_pool[5828]: GlobalAlphaFactordSUN (dynamic) */ "d\0" "glGlobalAlphaFactordSUN\0" "\0" - /* _mesa_function_pool[5816]: GetFinalCombinerInputParameterfvNV (will be remapped) */ + /* _mesa_function_pool[5855]: GetFinalCombinerInputParameterfvNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterfvNV\0" "\0" - /* _mesa_function_pool[5858]: GenerateMipmapEXT (will be remapped) */ + /* _mesa_function_pool[5897]: GenerateMipmapEXT (will be remapped) */ "i\0" "glGenerateMipmap\0" "glGenerateMipmapEXT\0" "\0" - /* _mesa_function_pool[5898]: GenLists (offset 5) */ + /* _mesa_function_pool[5937]: GenLists (offset 5) */ "i\0" "glGenLists\0" "\0" - /* _mesa_function_pool[5912]: SetFragmentShaderConstantATI (will be remapped) */ + /* _mesa_function_pool[5951]: SetFragmentShaderConstantATI (will be remapped) */ "ip\0" "glSetFragmentShaderConstantATI\0" "\0" - /* _mesa_function_pool[5947]: GetMapAttribParameterivNV (dynamic) */ + /* _mesa_function_pool[5986]: GetMapAttribParameterivNV (dynamic) */ "iiip\0" "glGetMapAttribParameterivNV\0" "\0" - /* _mesa_function_pool[5981]: CreateShaderObjectARB (will be remapped) */ + /* _mesa_function_pool[6020]: CreateShaderObjectARB (will be remapped) */ "i\0" "glCreateShaderObjectARB\0" "\0" - /* _mesa_function_pool[6008]: GetSharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[6047]: GetSharpenTexFuncSGIS (dynamic) */ "ip\0" "glGetSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[6036]: BufferDataARB (will be remapped) */ + /* _mesa_function_pool[6075]: BufferDataARB (will be remapped) */ "iipi\0" "glBufferData\0" "glBufferDataARB\0" "\0" - /* _mesa_function_pool[6071]: FlushVertexArrayRangeNV (will be remapped) */ + /* _mesa_function_pool[6110]: FlushVertexArrayRangeNV (will be remapped) */ "\0" "glFlushVertexArrayRangeNV\0" "\0" - /* _mesa_function_pool[6099]: MapGrid2d (offset 226) */ + /* _mesa_function_pool[6138]: MapGrid2d (offset 226) */ "iddidd\0" "glMapGrid2d\0" "\0" - /* _mesa_function_pool[6119]: MapGrid2f (offset 227) */ + /* _mesa_function_pool[6158]: MapGrid2f (offset 227) */ "iffiff\0" "glMapGrid2f\0" "\0" - /* _mesa_function_pool[6139]: SampleMapATI (will be remapped) */ + /* _mesa_function_pool[6178]: SampleMapATI (will be remapped) */ "iii\0" "glSampleMapATI\0" "\0" - /* _mesa_function_pool[6159]: VertexPointerEXT (will be remapped) */ + /* _mesa_function_pool[6198]: VertexPointerEXT (will be remapped) */ "iiiip\0" "glVertexPointerEXT\0" "\0" - /* _mesa_function_pool[6185]: GetTexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[6224]: GetTexFilterFuncSGIS (dynamic) */ "iip\0" "glGetTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[6213]: Scissor (offset 176) */ + /* _mesa_function_pool[6252]: Scissor (offset 176) */ "iiii\0" "glScissor\0" "\0" - /* _mesa_function_pool[6229]: Fogf (offset 153) */ + /* _mesa_function_pool[6268]: Fogf (offset 153) */ "if\0" "glFogf\0" "\0" - /* _mesa_function_pool[6240]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[6279]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[6285]: TexSubImage1D (offset 332) */ + /* _mesa_function_pool[6324]: TexSubImage1D (offset 332) */ "iiiiiip\0" "glTexSubImage1D\0" "glTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[6329]: VertexAttrib1sARB (will be remapped) */ + /* _mesa_function_pool[6368]: VertexAttrib1sARB (will be remapped) */ "ii\0" "glVertexAttrib1s\0" "glVertexAttrib1sARB\0" "\0" - /* _mesa_function_pool[6370]: FenceSync (will be remapped) */ + /* _mesa_function_pool[6409]: FenceSync (will be remapped) */ "ii\0" "glFenceSync\0" "\0" - /* _mesa_function_pool[6386]: Color4usv (offset 40) */ + /* _mesa_function_pool[6425]: Color4usv (offset 40) */ "p\0" "glColor4usv\0" "\0" - /* _mesa_function_pool[6401]: Fogi (offset 155) */ + /* _mesa_function_pool[6440]: Fogi (offset 155) */ "ii\0" "glFogi\0" "\0" - /* _mesa_function_pool[6412]: DepthRange (offset 288) */ + /* _mesa_function_pool[6451]: DepthRange (offset 288) */ "dd\0" "glDepthRange\0" "\0" - /* _mesa_function_pool[6429]: RasterPos3iv (offset 75) */ + /* _mesa_function_pool[6468]: RasterPos3iv (offset 75) */ "p\0" "glRasterPos3iv\0" "\0" - /* _mesa_function_pool[6447]: FinalCombinerInputNV (will be remapped) */ + /* _mesa_function_pool[6486]: FinalCombinerInputNV (will be remapped) */ "iiii\0" "glFinalCombinerInputNV\0" "\0" - /* _mesa_function_pool[6476]: TexCoord2i (offset 106) */ + /* _mesa_function_pool[6515]: TexCoord2i (offset 106) */ "ii\0" "glTexCoord2i\0" "\0" - /* _mesa_function_pool[6493]: PixelMapfv (offset 251) */ + /* _mesa_function_pool[6532]: PixelMapfv (offset 251) */ "iip\0" "glPixelMapfv\0" "\0" - /* _mesa_function_pool[6511]: Color4ui (offset 37) */ + /* _mesa_function_pool[6550]: Color4ui (offset 37) */ "iiii\0" "glColor4ui\0" "\0" - /* _mesa_function_pool[6528]: RasterPos3s (offset 76) */ + /* _mesa_function_pool[6567]: RasterPos3s (offset 76) */ "iii\0" "glRasterPos3s\0" "\0" - /* _mesa_function_pool[6547]: Color3usv (offset 24) */ + /* _mesa_function_pool[6586]: Color3usv (offset 24) */ "p\0" "glColor3usv\0" "\0" - /* _mesa_function_pool[6562]: FlushRasterSGIX (dynamic) */ + /* _mesa_function_pool[6601]: FlushRasterSGIX (dynamic) */ "\0" "glFlushRasterSGIX\0" "\0" - /* _mesa_function_pool[6582]: TexCoord2f (offset 104) */ + /* _mesa_function_pool[6621]: TexCoord2f (offset 104) */ "ff\0" "glTexCoord2f\0" "\0" - /* _mesa_function_pool[6599]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[6638]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ "ifffff\0" "glReplacementCodeuiTexCoord2fVertex3fSUN\0" "\0" - /* _mesa_function_pool[6648]: TexCoord2d (offset 102) */ + /* _mesa_function_pool[6687]: TexCoord2d (offset 102) */ "dd\0" "glTexCoord2d\0" "\0" - /* _mesa_function_pool[6665]: RasterPos3d (offset 70) */ + /* _mesa_function_pool[6704]: RasterPos3d (offset 70) */ "ddd\0" "glRasterPos3d\0" "\0" - /* _mesa_function_pool[6684]: RasterPos3f (offset 72) */ + /* _mesa_function_pool[6723]: RasterPos3f (offset 72) */ "fff\0" "glRasterPos3f\0" "\0" - /* _mesa_function_pool[6703]: Uniform1fARB (will be remapped) */ + /* _mesa_function_pool[6742]: Uniform1fARB (will be remapped) */ "if\0" "glUniform1f\0" "glUniform1fARB\0" "\0" - /* _mesa_function_pool[6734]: AreTexturesResident (offset 322) */ + /* _mesa_function_pool[6773]: AreTexturesResident (offset 322) */ "ipp\0" "glAreTexturesResident\0" "glAreTexturesResidentEXT\0" "\0" - /* _mesa_function_pool[6786]: TexCoord2s (offset 108) */ + /* _mesa_function_pool[6825]: TexCoord2s (offset 108) */ "ii\0" "glTexCoord2s\0" "\0" - /* _mesa_function_pool[6803]: StencilOpSeparate (will be remapped) */ + /* _mesa_function_pool[6842]: StencilOpSeparate (will be remapped) */ "iiii\0" "glStencilOpSeparate\0" "glStencilOpSeparateATI\0" "\0" - /* _mesa_function_pool[6852]: ColorTableParameteriv (offset 341) */ + /* _mesa_function_pool[6891]: ColorTableParameteriv (offset 341) */ "iip\0" "glColorTableParameteriv\0" "glColorTableParameterivSGI\0" "\0" - /* _mesa_function_pool[6908]: FogCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[6947]: FogCoordPointerListIBM (dynamic) */ "iipi\0" "glFogCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[6939]: WindowPos3dMESA (will be remapped) */ + /* _mesa_function_pool[6978]: WindowPos3dMESA (will be remapped) */ "ddd\0" "glWindowPos3d\0" "glWindowPos3dARB\0" "glWindowPos3dMESA\0" "\0" - /* _mesa_function_pool[6993]: Color4us (offset 39) */ + /* _mesa_function_pool[7032]: Color4us (offset 39) */ "iiii\0" "glColor4us\0" "\0" - /* _mesa_function_pool[7010]: PointParameterfvEXT (will be remapped) */ + /* _mesa_function_pool[7049]: PointParameterfvEXT (will be remapped) */ "ip\0" "glPointParameterfv\0" "glPointParameterfvARB\0" "glPointParameterfvEXT\0" "glPointParameterfvSGIS\0" "\0" - /* _mesa_function_pool[7100]: Color3bv (offset 10) */ + /* _mesa_function_pool[7139]: Color3bv (offset 10) */ "p\0" "glColor3bv\0" "\0" - /* _mesa_function_pool[7114]: WindowPos2fvMESA (will be remapped) */ + /* _mesa_function_pool[7153]: WindowPos2fvMESA (will be remapped) */ "p\0" "glWindowPos2fv\0" "glWindowPos2fvARB\0" "glWindowPos2fvMESA\0" "\0" - /* _mesa_function_pool[7169]: SecondaryColor3bvEXT (will be remapped) */ + /* _mesa_function_pool[7208]: SecondaryColor3bvEXT (will be remapped) */ "p\0" "glSecondaryColor3bv\0" "glSecondaryColor3bvEXT\0" "\0" - /* _mesa_function_pool[7215]: VertexPointerListIBM (dynamic) */ + /* _mesa_function_pool[7254]: VertexPointerListIBM (dynamic) */ "iiipi\0" "glVertexPointerListIBM\0" "\0" - /* _mesa_function_pool[7245]: GetProgramLocalParameterfvARB (will be remapped) */ + /* _mesa_function_pool[7284]: GetProgramLocalParameterfvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterfvARB\0" "\0" - /* _mesa_function_pool[7282]: FragmentMaterialfSGIX (dynamic) */ + /* _mesa_function_pool[7321]: FragmentMaterialfSGIX (dynamic) */ "iif\0" "glFragmentMaterialfSGIX\0" "\0" - /* _mesa_function_pool[7311]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[7350]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[7353]: RenderbufferStorageEXT (will be remapped) */ + /* _mesa_function_pool[7392]: RenderbufferStorageEXT (will be remapped) */ "iiii\0" "glRenderbufferStorage\0" "glRenderbufferStorageEXT\0" "\0" - /* _mesa_function_pool[7406]: IsFenceNV (will be remapped) */ + /* _mesa_function_pool[7445]: IsFenceNV (will be remapped) */ "i\0" "glIsFenceNV\0" "\0" - /* _mesa_function_pool[7421]: AttachObjectARB (will be remapped) */ + /* _mesa_function_pool[7460]: AttachObjectARB (will be remapped) */ "ii\0" "glAttachObjectARB\0" "\0" - /* _mesa_function_pool[7443]: GetFragmentLightivSGIX (dynamic) */ + /* _mesa_function_pool[7482]: GetFragmentLightivSGIX (dynamic) */ "iip\0" "glGetFragmentLightivSGIX\0" "\0" - /* _mesa_function_pool[7473]: UniformMatrix2fvARB (will be remapped) */ + /* _mesa_function_pool[7512]: UniformMatrix2fvARB (will be remapped) */ "iiip\0" "glUniformMatrix2fv\0" "glUniformMatrix2fvARB\0" "\0" - /* _mesa_function_pool[7520]: MultiTexCoord2fARB (offset 386) */ + /* _mesa_function_pool[7559]: MultiTexCoord2fARB (offset 386) */ "iff\0" "glMultiTexCoord2f\0" "glMultiTexCoord2fARB\0" "\0" - /* _mesa_function_pool[7564]: ColorTable (offset 339) */ + /* _mesa_function_pool[7603]: ColorTable (offset 339) */ "iiiiip\0" "glColorTable\0" "glColorTableSGI\0" "glColorTableEXT\0" "\0" - /* _mesa_function_pool[7617]: IndexPointer (offset 314) */ + /* _mesa_function_pool[7656]: IndexPointer (offset 314) */ "iip\0" "glIndexPointer\0" "\0" - /* _mesa_function_pool[7637]: Accum (offset 213) */ + /* _mesa_function_pool[7676]: Accum (offset 213) */ "if\0" "glAccum\0" "\0" - /* _mesa_function_pool[7649]: GetTexImage (offset 281) */ + /* _mesa_function_pool[7688]: GetTexImage (offset 281) */ "iiiip\0" "glGetTexImage\0" "\0" - /* _mesa_function_pool[7670]: MapControlPointsNV (dynamic) */ + /* _mesa_function_pool[7709]: MapControlPointsNV (dynamic) */ "iiiiiiiip\0" "glMapControlPointsNV\0" "\0" - /* _mesa_function_pool[7702]: ConvolutionFilter2D (offset 349) */ + /* _mesa_function_pool[7741]: ConvolutionFilter2D (offset 349) */ "iiiiiip\0" "glConvolutionFilter2D\0" "glConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[7758]: Finish (offset 216) */ + /* _mesa_function_pool[7797]: Finish (offset 216) */ "\0" "glFinish\0" "\0" - /* _mesa_function_pool[7769]: MapParameterfvNV (dynamic) */ + /* _mesa_function_pool[7808]: MapParameterfvNV (dynamic) */ "iip\0" "glMapParameterfvNV\0" "\0" - /* _mesa_function_pool[7793]: ClearStencil (offset 207) */ + /* _mesa_function_pool[7832]: ClearStencil (offset 207) */ "i\0" "glClearStencil\0" "\0" - /* _mesa_function_pool[7811]: VertexAttrib3dvARB (will be remapped) */ + /* _mesa_function_pool[7850]: VertexAttrib3dvARB (will be remapped) */ "ip\0" "glVertexAttrib3dv\0" "glVertexAttrib3dvARB\0" "\0" - /* _mesa_function_pool[7854]: HintPGI (dynamic) */ + /* _mesa_function_pool[7893]: HintPGI (dynamic) */ "ii\0" "glHintPGI\0" "\0" - /* _mesa_function_pool[7868]: ConvolutionParameteriv (offset 353) */ + /* _mesa_function_pool[7907]: ConvolutionParameteriv (offset 353) */ "iip\0" "glConvolutionParameteriv\0" "glConvolutionParameterivEXT\0" "\0" - /* _mesa_function_pool[7926]: Color4s (offset 33) */ + /* _mesa_function_pool[7965]: Color4s (offset 33) */ "iiii\0" "glColor4s\0" "\0" - /* _mesa_function_pool[7942]: InterleavedArrays (offset 317) */ + /* _mesa_function_pool[7981]: InterleavedArrays (offset 317) */ "iip\0" "glInterleavedArrays\0" "\0" - /* _mesa_function_pool[7967]: RasterPos2fv (offset 65) */ + /* _mesa_function_pool[8006]: RasterPos2fv (offset 65) */ "p\0" "glRasterPos2fv\0" "\0" - /* _mesa_function_pool[7985]: TexCoord1fv (offset 97) */ + /* _mesa_function_pool[8024]: TexCoord1fv (offset 97) */ "p\0" "glTexCoord1fv\0" "\0" - /* _mesa_function_pool[8002]: Vertex2d (offset 126) */ + /* _mesa_function_pool[8041]: Vertex2d (offset 126) */ "dd\0" "glVertex2d\0" "\0" - /* _mesa_function_pool[8017]: CullParameterdvEXT (will be remapped) */ + /* _mesa_function_pool[8056]: CullParameterdvEXT (dynamic) */ "ip\0" "glCullParameterdvEXT\0" "\0" - /* _mesa_function_pool[8042]: ProgramNamedParameter4fNV (will be remapped) */ + /* _mesa_function_pool[8081]: ProgramNamedParameter4fNV (will be remapped) */ "iipffff\0" "glProgramNamedParameter4fNV\0" "\0" - /* _mesa_function_pool[8079]: Color3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[8118]: Color3fVertex3fSUN (dynamic) */ "ffffff\0" "glColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[8108]: ProgramEnvParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[8147]: ProgramEnvParameter4fvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4fvARB\0" "glProgramParameter4fvNV\0" "\0" - /* _mesa_function_pool[8165]: Color4i (offset 31) */ + /* _mesa_function_pool[8204]: Color4i (offset 31) */ "iiii\0" "glColor4i\0" "\0" - /* _mesa_function_pool[8181]: Color4f (offset 29) */ + /* _mesa_function_pool[8220]: Color4f (offset 29) */ "ffff\0" "glColor4f\0" "\0" - /* _mesa_function_pool[8197]: RasterPos4fv (offset 81) */ + /* _mesa_function_pool[8236]: RasterPos4fv (offset 81) */ "p\0" "glRasterPos4fv\0" "\0" - /* _mesa_function_pool[8215]: Color4d (offset 27) */ + /* _mesa_function_pool[8254]: Color4d (offset 27) */ "dddd\0" "glColor4d\0" "\0" - /* _mesa_function_pool[8231]: ClearIndex (offset 205) */ + /* _mesa_function_pool[8270]: ClearIndex (offset 205) */ "f\0" "glClearIndex\0" "\0" - /* _mesa_function_pool[8247]: Color4b (offset 25) */ + /* _mesa_function_pool[8286]: Color4b (offset 25) */ "iiii\0" "glColor4b\0" "\0" - /* _mesa_function_pool[8263]: LoadMatrixd (offset 292) */ + /* _mesa_function_pool[8302]: LoadMatrixd (offset 292) */ "p\0" "glLoadMatrixd\0" "\0" - /* _mesa_function_pool[8280]: FragmentLightModeliSGIX (dynamic) */ + /* _mesa_function_pool[8319]: FragmentLightModeliSGIX (dynamic) */ "ii\0" "glFragmentLightModeliSGIX\0" "\0" - /* _mesa_function_pool[8310]: RasterPos2dv (offset 63) */ + /* _mesa_function_pool[8349]: RasterPos2dv (offset 63) */ "p\0" "glRasterPos2dv\0" "\0" - /* _mesa_function_pool[8328]: ConvolutionParameterfv (offset 351) */ + /* _mesa_function_pool[8367]: ConvolutionParameterfv (offset 351) */ "iip\0" "glConvolutionParameterfv\0" "glConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[8386]: TbufferMask3DFX (dynamic) */ + /* _mesa_function_pool[8425]: TbufferMask3DFX (dynamic) */ "i\0" "glTbufferMask3DFX\0" "\0" - /* _mesa_function_pool[8407]: GetTexGendv (offset 278) */ + /* _mesa_function_pool[8446]: GetTexGendv (offset 278) */ "iip\0" "glGetTexGendv\0" "\0" - /* _mesa_function_pool[8426]: GetVertexAttribfvNV (will be remapped) */ + /* _mesa_function_pool[8465]: GetVertexAttribfvNV (will be remapped) */ "iip\0" "glGetVertexAttribfvNV\0" "\0" - /* _mesa_function_pool[8453]: BeginTransformFeedbackEXT (will be remapped) */ + /* _mesa_function_pool[8492]: BeginTransformFeedbackEXT (will be remapped) */ "i\0" "glBeginTransformFeedbackEXT\0" "glBeginTransformFeedback\0" "\0" - /* _mesa_function_pool[8509]: LoadProgramNV (will be remapped) */ + /* _mesa_function_pool[8548]: LoadProgramNV (will be remapped) */ "iiip\0" "glLoadProgramNV\0" "\0" - /* _mesa_function_pool[8531]: WaitSync (will be remapped) */ + /* _mesa_function_pool[8570]: WaitSync (will be remapped) */ "iii\0" "glWaitSync\0" "\0" - /* _mesa_function_pool[8547]: EndList (offset 1) */ + /* _mesa_function_pool[8586]: EndList (offset 1) */ "\0" "glEndList\0" "\0" - /* _mesa_function_pool[8559]: VertexAttrib4fvNV (will be remapped) */ + /* _mesa_function_pool[8598]: VertexAttrib4fvNV (will be remapped) */ "ip\0" "glVertexAttrib4fvNV\0" "\0" - /* _mesa_function_pool[8583]: GetAttachedObjectsARB (will be remapped) */ + /* _mesa_function_pool[8622]: GetAttachedObjectsARB (will be remapped) */ "iipp\0" "glGetAttachedObjectsARB\0" "\0" - /* _mesa_function_pool[8613]: Uniform3fvARB (will be remapped) */ + /* _mesa_function_pool[8652]: Uniform3fvARB (will be remapped) */ "iip\0" "glUniform3fv\0" "glUniform3fvARB\0" "\0" - /* _mesa_function_pool[8647]: EvalCoord1fv (offset 231) */ + /* _mesa_function_pool[8686]: EvalCoord1fv (offset 231) */ "p\0" "glEvalCoord1fv\0" "\0" - /* _mesa_function_pool[8665]: DrawRangeElements (offset 338) */ + /* _mesa_function_pool[8704]: DrawRangeElements (offset 338) */ "iiiiip\0" "glDrawRangeElements\0" "glDrawRangeElementsEXT\0" "\0" - /* _mesa_function_pool[8716]: EvalMesh2 (offset 238) */ + /* _mesa_function_pool[8755]: EvalMesh2 (offset 238) */ "iiiii\0" "glEvalMesh2\0" "\0" - /* _mesa_function_pool[8735]: Vertex4fv (offset 145) */ + /* _mesa_function_pool[8774]: Vertex4fv (offset 145) */ "p\0" "glVertex4fv\0" "\0" - /* _mesa_function_pool[8750]: GenTransformFeedbacks (will be remapped) */ + /* _mesa_function_pool[8789]: GenTransformFeedbacks (will be remapped) */ "ip\0" "glGenTransformFeedbacks\0" "\0" - /* _mesa_function_pool[8778]: SpriteParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[8817]: SpriteParameterfvSGIX (dynamic) */ "ip\0" "glSpriteParameterfvSGIX\0" "\0" - /* _mesa_function_pool[8806]: CheckFramebufferStatusEXT (will be remapped) */ + /* _mesa_function_pool[8845]: CheckFramebufferStatusEXT (will be remapped) */ "i\0" "glCheckFramebufferStatus\0" "glCheckFramebufferStatusEXT\0" "\0" - /* _mesa_function_pool[8862]: GlobalAlphaFactoruiSUN (dynamic) */ + /* _mesa_function_pool[8901]: GlobalAlphaFactoruiSUN (dynamic) */ "i\0" "glGlobalAlphaFactoruiSUN\0" "\0" - /* _mesa_function_pool[8890]: GetHandleARB (will be remapped) */ + /* _mesa_function_pool[8929]: GetHandleARB (will be remapped) */ "i\0" "glGetHandleARB\0" "\0" - /* _mesa_function_pool[8908]: GetVertexAttribivARB (will be remapped) */ + /* _mesa_function_pool[8947]: GetVertexAttribivARB (will be remapped) */ "iip\0" "glGetVertexAttribiv\0" "glGetVertexAttribivARB\0" "\0" - /* _mesa_function_pool[8956]: GetCombinerInputParameterfvNV (will be remapped) */ + /* _mesa_function_pool[8995]: GetCombinerInputParameterfvNV (will be remapped) */ "iiiip\0" "glGetCombinerInputParameterfvNV\0" "\0" - /* _mesa_function_pool[8995]: CreateProgram (will be remapped) */ + /* _mesa_function_pool[9034]: CreateProgram (will be remapped) */ "\0" "glCreateProgram\0" "\0" - /* _mesa_function_pool[9013]: LoadTransposeMatrixdARB (will be remapped) */ + /* _mesa_function_pool[9052]: LoadTransposeMatrixdARB (will be remapped) */ "p\0" "glLoadTransposeMatrixd\0" "glLoadTransposeMatrixdARB\0" "\0" - /* _mesa_function_pool[9065]: GetMinmax (offset 364) */ + /* _mesa_function_pool[9104]: GetMinmax (offset 364) */ "iiiip\0" "glGetMinmax\0" "glGetMinmaxEXT\0" "\0" - /* _mesa_function_pool[9099]: StencilFuncSeparate (will be remapped) */ + /* _mesa_function_pool[9138]: StencilFuncSeparate (will be remapped) */ "iiii\0" "glStencilFuncSeparate\0" "\0" - /* _mesa_function_pool[9127]: SecondaryColor3sEXT (will be remapped) */ + /* _mesa_function_pool[9166]: SecondaryColor3sEXT (will be remapped) */ "iii\0" "glSecondaryColor3s\0" "glSecondaryColor3sEXT\0" "\0" - /* _mesa_function_pool[9173]: Color3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[9212]: Color3fVertex3fvSUN (dynamic) */ "pp\0" "glColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[9199]: Normal3fv (offset 57) */ + /* _mesa_function_pool[9238]: Normal3fv (offset 57) */ "p\0" "glNormal3fv\0" "\0" - /* _mesa_function_pool[9214]: GlobalAlphaFactorbSUN (dynamic) */ + /* _mesa_function_pool[9253]: GlobalAlphaFactorbSUN (dynamic) */ "i\0" "glGlobalAlphaFactorbSUN\0" "\0" - /* _mesa_function_pool[9241]: Color3us (offset 23) */ + /* _mesa_function_pool[9280]: Color3us (offset 23) */ "iii\0" "glColor3us\0" "\0" - /* _mesa_function_pool[9257]: ImageTransformParameterfvHP (dynamic) */ + /* _mesa_function_pool[9296]: ImageTransformParameterfvHP (dynamic) */ "iip\0" "glImageTransformParameterfvHP\0" "\0" - /* _mesa_function_pool[9292]: VertexAttrib4ivARB (will be remapped) */ + /* _mesa_function_pool[9331]: VertexAttrib4ivARB (will be remapped) */ "ip\0" "glVertexAttrib4iv\0" "glVertexAttrib4ivARB\0" "\0" - /* _mesa_function_pool[9335]: End (offset 43) */ + /* _mesa_function_pool[9374]: End (offset 43) */ "\0" "glEnd\0" "\0" - /* _mesa_function_pool[9343]: VertexAttrib3fNV (will be remapped) */ + /* _mesa_function_pool[9382]: VertexAttrib3fNV (will be remapped) */ "ifff\0" "glVertexAttrib3fNV\0" "\0" - /* _mesa_function_pool[9368]: VertexAttribs2dvNV (will be remapped) */ + /* _mesa_function_pool[9407]: VertexAttribs2dvNV (will be remapped) */ "iip\0" "glVertexAttribs2dvNV\0" "\0" - /* _mesa_function_pool[9394]: GetQueryObjectui64vEXT (will be remapped) */ + /* _mesa_function_pool[9433]: GetQueryObjectui64vEXT (will be remapped) */ "iip\0" "glGetQueryObjectui64vEXT\0" "\0" - /* _mesa_function_pool[9424]: MultiTexCoord3fvARB (offset 395) */ + /* _mesa_function_pool[9463]: MultiTexCoord3fvARB (offset 395) */ "ip\0" "glMultiTexCoord3fv\0" "glMultiTexCoord3fvARB\0" "\0" - /* _mesa_function_pool[9469]: SecondaryColor3dEXT (will be remapped) */ + /* _mesa_function_pool[9508]: SecondaryColor3dEXT (will be remapped) */ "ddd\0" "glSecondaryColor3d\0" "glSecondaryColor3dEXT\0" "\0" - /* _mesa_function_pool[9515]: Color3ub (offset 19) */ + /* _mesa_function_pool[9554]: Color3ub (offset 19) */ "iii\0" "glColor3ub\0" "\0" - /* _mesa_function_pool[9531]: GetProgramParameterfvNV (will be remapped) */ + /* _mesa_function_pool[9570]: GetProgramParameterfvNV (will be remapped) */ "iiip\0" "glGetProgramParameterfvNV\0" "\0" - /* _mesa_function_pool[9563]: TangentPointerEXT (dynamic) */ + /* _mesa_function_pool[9602]: TangentPointerEXT (dynamic) */ "iip\0" "glTangentPointerEXT\0" "\0" - /* _mesa_function_pool[9588]: Color4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[9627]: Color4fNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[9623]: GetInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[9662]: GetInstrumentsSGIX (dynamic) */ "\0" "glGetInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[9646]: Color3ui (offset 21) */ + /* _mesa_function_pool[9685]: Color3ui (offset 21) */ "iii\0" "glColor3ui\0" "\0" - /* _mesa_function_pool[9662]: EvalMapsNV (dynamic) */ + /* _mesa_function_pool[9701]: EvalMapsNV (dynamic) */ "ii\0" "glEvalMapsNV\0" "\0" - /* _mesa_function_pool[9679]: TexSubImage2D (offset 333) */ + /* _mesa_function_pool[9718]: TexSubImage2D (offset 333) */ "iiiiiiiip\0" "glTexSubImage2D\0" "glTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[9725]: FragmentLightivSGIX (dynamic) */ + /* _mesa_function_pool[9764]: FragmentLightivSGIX (dynamic) */ "iip\0" "glFragmentLightivSGIX\0" "\0" - /* _mesa_function_pool[9752]: GetTexParameterPointervAPPLE (will be remapped) */ + /* _mesa_function_pool[9791]: GetTexParameterPointervAPPLE (will be remapped) */ "iip\0" "glGetTexParameterPointervAPPLE\0" "\0" - /* _mesa_function_pool[9788]: TexGenfv (offset 191) */ + /* _mesa_function_pool[9827]: TexGenfv (offset 191) */ "iip\0" "glTexGenfv\0" "\0" - /* _mesa_function_pool[9804]: GetTransformFeedbackVaryingEXT (will be remapped) */ + /* _mesa_function_pool[9843]: GetTransformFeedbackVaryingEXT (will be remapped) */ "iiipppp\0" "glGetTransformFeedbackVaryingEXT\0" "glGetTransformFeedbackVarying\0" "\0" - /* _mesa_function_pool[9876]: VertexAttrib4bvARB (will be remapped) */ + /* _mesa_function_pool[9915]: VertexAttrib4bvARB (will be remapped) */ "ip\0" "glVertexAttrib4bv\0" "glVertexAttrib4bvARB\0" "\0" - /* _mesa_function_pool[9919]: AlphaFragmentOp2ATI (will be remapped) */ + /* _mesa_function_pool[9958]: AlphaFragmentOp2ATI (will be remapped) */ "iiiiiiiii\0" "glAlphaFragmentOp2ATI\0" "\0" - /* _mesa_function_pool[9952]: GetIntegerIndexedvEXT (will be remapped) */ + /* _mesa_function_pool[9991]: GetIntegerIndexedvEXT (will be remapped) */ "iip\0" "glGetIntegerIndexedvEXT\0" "\0" - /* _mesa_function_pool[9981]: MultiTexCoord4sARB (offset 406) */ + /* _mesa_function_pool[10020]: MultiTexCoord4sARB (offset 406) */ "iiiii\0" "glMultiTexCoord4s\0" "glMultiTexCoord4sARB\0" "\0" - /* _mesa_function_pool[10027]: GetFragmentMaterialivSGIX (dynamic) */ + /* _mesa_function_pool[10066]: GetFragmentMaterialivSGIX (dynamic) */ "iip\0" "glGetFragmentMaterialivSGIX\0" "\0" - /* _mesa_function_pool[10060]: WindowPos4dMESA (will be remapped) */ + /* _mesa_function_pool[10099]: WindowPos4dMESA (will be remapped) */ "dddd\0" "glWindowPos4dMESA\0" "\0" - /* _mesa_function_pool[10084]: WeightPointerARB (dynamic) */ + /* _mesa_function_pool[10123]: WeightPointerARB (dynamic) */ "iiip\0" "glWeightPointerARB\0" "\0" - /* _mesa_function_pool[10109]: WindowPos2dMESA (will be remapped) */ + /* _mesa_function_pool[10148]: WindowPos2dMESA (will be remapped) */ "dd\0" "glWindowPos2d\0" "glWindowPos2dARB\0" "glWindowPos2dMESA\0" "\0" - /* _mesa_function_pool[10162]: FramebufferTexture3DEXT (will be remapped) */ + /* _mesa_function_pool[10201]: FramebufferTexture3DEXT (will be remapped) */ "iiiiii\0" "glFramebufferTexture3D\0" "glFramebufferTexture3DEXT\0" "\0" - /* _mesa_function_pool[10219]: BlendEquation (offset 337) */ + /* _mesa_function_pool[10258]: BlendEquation (offset 337) */ "i\0" "glBlendEquation\0" "glBlendEquationEXT\0" "\0" - /* _mesa_function_pool[10257]: VertexAttrib3dNV (will be remapped) */ + /* _mesa_function_pool[10296]: VertexAttrib3dNV (will be remapped) */ "iddd\0" "glVertexAttrib3dNV\0" "\0" - /* _mesa_function_pool[10282]: VertexAttrib3dARB (will be remapped) */ + /* _mesa_function_pool[10321]: VertexAttrib3dARB (will be remapped) */ "iddd\0" "glVertexAttrib3d\0" "glVertexAttrib3dARB\0" "\0" - /* _mesa_function_pool[10325]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[10364]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "ppppp\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[10389]: VertexAttrib4fARB (will be remapped) */ + /* _mesa_function_pool[10428]: VertexAttrib4fARB (will be remapped) */ "iffff\0" "glVertexAttrib4f\0" "glVertexAttrib4fARB\0" "\0" - /* _mesa_function_pool[10433]: GetError (offset 261) */ + /* _mesa_function_pool[10472]: GetError (offset 261) */ "\0" "glGetError\0" "\0" - /* _mesa_function_pool[10446]: IndexFuncEXT (dynamic) */ + /* _mesa_function_pool[10485]: IndexFuncEXT (dynamic) */ "if\0" "glIndexFuncEXT\0" "\0" - /* _mesa_function_pool[10465]: TexCoord3dv (offset 111) */ + /* _mesa_function_pool[10504]: TexCoord3dv (offset 111) */ "p\0" "glTexCoord3dv\0" "\0" - /* _mesa_function_pool[10482]: Indexdv (offset 45) */ + /* _mesa_function_pool[10521]: Indexdv (offset 45) */ "p\0" "glIndexdv\0" "\0" - /* _mesa_function_pool[10495]: FramebufferTexture2DEXT (will be remapped) */ + /* _mesa_function_pool[10534]: FramebufferTexture2DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture2D\0" "glFramebufferTexture2DEXT\0" "\0" - /* _mesa_function_pool[10551]: Normal3s (offset 60) */ + /* _mesa_function_pool[10590]: Normal3s (offset 60) */ "iii\0" "glNormal3s\0" "\0" - /* _mesa_function_pool[10567]: GetObjectParameterivAPPLE (will be remapped) */ + /* _mesa_function_pool[10606]: GetObjectParameterivAPPLE (will be remapped) */ "iiip\0" "glGetObjectParameterivAPPLE\0" "\0" - /* _mesa_function_pool[10601]: PushName (offset 201) */ + /* _mesa_function_pool[10640]: PushName (offset 201) */ "i\0" "glPushName\0" "\0" - /* _mesa_function_pool[10615]: MultiTexCoord2dvARB (offset 385) */ + /* _mesa_function_pool[10654]: MultiTexCoord2dvARB (offset 385) */ "ip\0" "glMultiTexCoord2dv\0" "glMultiTexCoord2dvARB\0" "\0" - /* _mesa_function_pool[10660]: CullParameterfvEXT (will be remapped) */ + /* _mesa_function_pool[10699]: CullParameterfvEXT (dynamic) */ "ip\0" "glCullParameterfvEXT\0" "\0" - /* _mesa_function_pool[10685]: Normal3i (offset 58) */ + /* _mesa_function_pool[10724]: Normal3i (offset 58) */ "iii\0" "glNormal3i\0" "\0" - /* _mesa_function_pool[10701]: ProgramNamedParameter4fvNV (will be remapped) */ + /* _mesa_function_pool[10740]: ProgramNamedParameter4fvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4fvNV\0" "\0" - /* _mesa_function_pool[10736]: SecondaryColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[10775]: SecondaryColorPointerEXT (will be remapped) */ "iiip\0" "glSecondaryColorPointer\0" "glSecondaryColorPointerEXT\0" "\0" - /* _mesa_function_pool[10793]: VertexAttrib4fvARB (will be remapped) */ + /* _mesa_function_pool[10832]: VertexAttrib4fvARB (will be remapped) */ "ip\0" "glVertexAttrib4fv\0" "glVertexAttrib4fvARB\0" "\0" - /* _mesa_function_pool[10836]: ColorPointerListIBM (dynamic) */ + /* _mesa_function_pool[10875]: ColorPointerListIBM (dynamic) */ "iiipi\0" "glColorPointerListIBM\0" "\0" - /* _mesa_function_pool[10865]: GetActiveUniformARB (will be remapped) */ + /* _mesa_function_pool[10904]: GetActiveUniformARB (will be remapped) */ "iiipppp\0" "glGetActiveUniform\0" "glGetActiveUniformARB\0" "\0" - /* _mesa_function_pool[10915]: ImageTransformParameteriHP (dynamic) */ + /* _mesa_function_pool[10954]: ImageTransformParameteriHP (dynamic) */ "iii\0" "glImageTransformParameteriHP\0" "\0" - /* _mesa_function_pool[10949]: Normal3b (offset 52) */ + /* _mesa_function_pool[10988]: Normal3b (offset 52) */ "iii\0" "glNormal3b\0" "\0" - /* _mesa_function_pool[10965]: Normal3d (offset 54) */ + /* _mesa_function_pool[11004]: Normal3d (offset 54) */ "ddd\0" "glNormal3d\0" "\0" - /* _mesa_function_pool[10981]: Normal3f (offset 56) */ + /* _mesa_function_pool[11020]: Normal3f (offset 56) */ "fff\0" "glNormal3f\0" "\0" - /* _mesa_function_pool[10997]: MultiTexCoord1svARB (offset 383) */ + /* _mesa_function_pool[11036]: MultiTexCoord1svARB (offset 383) */ "ip\0" "glMultiTexCoord1sv\0" "glMultiTexCoord1svARB\0" "\0" - /* _mesa_function_pool[11042]: Indexi (offset 48) */ + /* _mesa_function_pool[11081]: Indexi (offset 48) */ "i\0" "glIndexi\0" "\0" - /* _mesa_function_pool[11054]: EGLImageTargetTexture2DOES (will be remapped) */ + /* _mesa_function_pool[11093]: EGLImageTargetTexture2DOES (will be remapped) */ "ip\0" "glEGLImageTargetTexture2DOES\0" "\0" - /* _mesa_function_pool[11087]: EndQueryARB (will be remapped) */ + /* _mesa_function_pool[11126]: EndQueryARB (will be remapped) */ "i\0" "glEndQuery\0" "glEndQueryARB\0" "\0" - /* _mesa_function_pool[11115]: DeleteFencesNV (will be remapped) */ + /* _mesa_function_pool[11154]: DeleteFencesNV (will be remapped) */ "ip\0" "glDeleteFencesNV\0" "\0" - /* _mesa_function_pool[11136]: BindBufferRangeEXT (will be remapped) */ + /* _mesa_function_pool[11175]: DeformationMap3dSGIX (dynamic) */ + "iddiiddiiddiip\0" + "glDeformationMap3dSGIX\0" + "\0" + /* _mesa_function_pool[11214]: BindBufferRangeEXT (will be remapped) */ "iiiii\0" "glBindBufferRangeEXT\0" "glBindBufferRange\0" "\0" - /* _mesa_function_pool[11182]: DepthMask (offset 211) */ + /* _mesa_function_pool[11260]: DepthMask (offset 211) */ "i\0" "glDepthMask\0" "\0" - /* _mesa_function_pool[11197]: IsShader (will be remapped) */ + /* _mesa_function_pool[11275]: IsShader (will be remapped) */ "i\0" "glIsShader\0" "\0" - /* _mesa_function_pool[11211]: Indexf (offset 46) */ + /* _mesa_function_pool[11289]: Indexf (offset 46) */ "f\0" "glIndexf\0" "\0" - /* _mesa_function_pool[11223]: GetImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[11301]: GetImageTransformParameterivHP (dynamic) */ "iip\0" "glGetImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[11261]: Indexd (offset 44) */ + /* _mesa_function_pool[11339]: Indexd (offset 44) */ "d\0" "glIndexd\0" "\0" - /* _mesa_function_pool[11273]: GetMaterialiv (offset 270) */ + /* _mesa_function_pool[11351]: GetMaterialiv (offset 270) */ "iip\0" "glGetMaterialiv\0" "\0" - /* _mesa_function_pool[11294]: StencilOp (offset 244) */ + /* _mesa_function_pool[11372]: StencilOp (offset 244) */ "iii\0" "glStencilOp\0" "\0" - /* _mesa_function_pool[11311]: WindowPos4ivMESA (will be remapped) */ + /* _mesa_function_pool[11389]: WindowPos4ivMESA (will be remapped) */ "p\0" "glWindowPos4ivMESA\0" "\0" - /* _mesa_function_pool[11333]: FramebufferTextureLayer (dynamic) */ + /* _mesa_function_pool[11411]: FramebufferTextureLayer (dynamic) */ "iiiii\0" "glFramebufferTextureLayerARB\0" "\0" - /* _mesa_function_pool[11369]: MultiTexCoord3svARB (offset 399) */ + /* _mesa_function_pool[11447]: MultiTexCoord3svARB (offset 399) */ "ip\0" "glMultiTexCoord3sv\0" "glMultiTexCoord3svARB\0" "\0" - /* _mesa_function_pool[11414]: TexEnvfv (offset 185) */ + /* _mesa_function_pool[11492]: TexEnvfv (offset 185) */ "iip\0" "glTexEnvfv\0" "\0" - /* _mesa_function_pool[11430]: MultiTexCoord4iARB (offset 404) */ + /* _mesa_function_pool[11508]: MultiTexCoord4iARB (offset 404) */ "iiiii\0" "glMultiTexCoord4i\0" "glMultiTexCoord4iARB\0" "\0" - /* _mesa_function_pool[11476]: Indexs (offset 50) */ + /* _mesa_function_pool[11554]: Indexs (offset 50) */ "i\0" "glIndexs\0" "\0" - /* _mesa_function_pool[11488]: Binormal3ivEXT (dynamic) */ + /* _mesa_function_pool[11566]: Binormal3ivEXT (dynamic) */ "p\0" "glBinormal3ivEXT\0" "\0" - /* _mesa_function_pool[11508]: ResizeBuffersMESA (will be remapped) */ + /* _mesa_function_pool[11586]: ResizeBuffersMESA (will be remapped) */ "\0" "glResizeBuffersMESA\0" "\0" - /* _mesa_function_pool[11530]: GetUniformivARB (will be remapped) */ + /* _mesa_function_pool[11608]: GetUniformivARB (will be remapped) */ "iip\0" "glGetUniformiv\0" "glGetUniformivARB\0" "\0" - /* _mesa_function_pool[11568]: PixelTexGenParameteriSGIS (will be remapped) */ + /* _mesa_function_pool[11646]: PixelTexGenParameteriSGIS (will be remapped) */ "ii\0" "glPixelTexGenParameteriSGIS\0" "\0" - /* _mesa_function_pool[11600]: VertexPointervINTEL (dynamic) */ + /* _mesa_function_pool[11678]: VertexPointervINTEL (dynamic) */ "iip\0" "glVertexPointervINTEL\0" "\0" - /* _mesa_function_pool[11627]: Vertex2i (offset 130) */ + /* _mesa_function_pool[11705]: Vertex2i (offset 130) */ "ii\0" "glVertex2i\0" "\0" - /* _mesa_function_pool[11642]: LoadMatrixf (offset 291) */ + /* _mesa_function_pool[11720]: LoadMatrixf (offset 291) */ "p\0" "glLoadMatrixf\0" "\0" - /* _mesa_function_pool[11659]: Vertex2f (offset 128) */ + /* _mesa_function_pool[11737]: Vertex2f (offset 128) */ "ff\0" "glVertex2f\0" "\0" - /* _mesa_function_pool[11674]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[11752]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[11727]: Color4bv (offset 26) */ + /* _mesa_function_pool[11805]: Color4bv (offset 26) */ "p\0" "glColor4bv\0" "\0" - /* _mesa_function_pool[11741]: VertexPointer (offset 321) */ + /* _mesa_function_pool[11819]: VertexPointer (offset 321) */ "iiip\0" "glVertexPointer\0" "\0" - /* _mesa_function_pool[11763]: SecondaryColor3uiEXT (will be remapped) */ + /* _mesa_function_pool[11841]: SecondaryColor3uiEXT (will be remapped) */ "iii\0" "glSecondaryColor3ui\0" "glSecondaryColor3uiEXT\0" "\0" - /* _mesa_function_pool[11811]: StartInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[11889]: StartInstrumentsSGIX (dynamic) */ "\0" "glStartInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[11836]: SecondaryColor3usvEXT (will be remapped) */ + /* _mesa_function_pool[11914]: SecondaryColor3usvEXT (will be remapped) */ "p\0" "glSecondaryColor3usv\0" "glSecondaryColor3usvEXT\0" "\0" - /* _mesa_function_pool[11884]: VertexAttrib2fvNV (will be remapped) */ + /* _mesa_function_pool[11962]: VertexAttrib2fvNV (will be remapped) */ "ip\0" "glVertexAttrib2fvNV\0" "\0" - /* _mesa_function_pool[11908]: ProgramLocalParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[11986]: ProgramLocalParameter4dvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4dvARB\0" "\0" - /* _mesa_function_pool[11943]: DeleteLists (offset 4) */ + /* _mesa_function_pool[12021]: DeleteLists (offset 4) */ "ii\0" "glDeleteLists\0" "\0" - /* _mesa_function_pool[11961]: LogicOp (offset 242) */ + /* _mesa_function_pool[12039]: LogicOp (offset 242) */ "i\0" "glLogicOp\0" "\0" - /* _mesa_function_pool[11974]: MatrixIndexuivARB (dynamic) */ + /* _mesa_function_pool[12052]: MatrixIndexuivARB (dynamic) */ "ip\0" "glMatrixIndexuivARB\0" "\0" - /* _mesa_function_pool[11998]: Vertex2s (offset 132) */ + /* _mesa_function_pool[12076]: Vertex2s (offset 132) */ "ii\0" "glVertex2s\0" "\0" - /* _mesa_function_pool[12013]: RenderbufferStorageMultisample (will be remapped) */ + /* _mesa_function_pool[12091]: RenderbufferStorageMultisample (will be remapped) */ "iiiii\0" "glRenderbufferStorageMultisample\0" "glRenderbufferStorageMultisampleEXT\0" "\0" - /* _mesa_function_pool[12089]: TexCoord4fv (offset 121) */ + /* _mesa_function_pool[12167]: TexCoord4fv (offset 121) */ "p\0" "glTexCoord4fv\0" "\0" - /* _mesa_function_pool[12106]: Tangent3sEXT (dynamic) */ + /* _mesa_function_pool[12184]: Tangent3sEXT (dynamic) */ "iii\0" "glTangent3sEXT\0" "\0" - /* _mesa_function_pool[12126]: GlobalAlphaFactorfSUN (dynamic) */ + /* _mesa_function_pool[12204]: GlobalAlphaFactorfSUN (dynamic) */ "f\0" "glGlobalAlphaFactorfSUN\0" "\0" - /* _mesa_function_pool[12153]: MultiTexCoord3iARB (offset 396) */ + /* _mesa_function_pool[12231]: MultiTexCoord3iARB (offset 396) */ "iiii\0" "glMultiTexCoord3i\0" "glMultiTexCoord3iARB\0" "\0" - /* _mesa_function_pool[12198]: IsProgram (will be remapped) */ + /* _mesa_function_pool[12276]: IsProgram (will be remapped) */ "i\0" "glIsProgram\0" "\0" - /* _mesa_function_pool[12213]: TexCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[12291]: TexCoordPointerListIBM (dynamic) */ "iiipi\0" "glTexCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[12245]: GlobalAlphaFactorusSUN (dynamic) */ + /* _mesa_function_pool[12323]: GlobalAlphaFactorusSUN (dynamic) */ "i\0" "glGlobalAlphaFactorusSUN\0" "\0" - /* _mesa_function_pool[12273]: VertexAttrib2dvNV (will be remapped) */ + /* _mesa_function_pool[12351]: VertexAttrib2dvNV (will be remapped) */ "ip\0" "glVertexAttrib2dvNV\0" "\0" - /* _mesa_function_pool[12297]: FramebufferRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[12375]: FramebufferRenderbufferEXT (will be remapped) */ "iiii\0" "glFramebufferRenderbuffer\0" "glFramebufferRenderbufferEXT\0" "\0" - /* _mesa_function_pool[12358]: VertexAttrib1dvNV (will be remapped) */ + /* _mesa_function_pool[12436]: VertexAttrib1dvNV (will be remapped) */ "ip\0" "glVertexAttrib1dvNV\0" "\0" - /* _mesa_function_pool[12382]: GenTextures (offset 328) */ + /* _mesa_function_pool[12460]: GenTextures (offset 328) */ "ip\0" "glGenTextures\0" "glGenTexturesEXT\0" "\0" - /* _mesa_function_pool[12417]: FramebufferTextureARB (will be remapped) */ + /* _mesa_function_pool[12495]: FramebufferTextureARB (will be remapped) */ "iiii\0" "glFramebufferTextureARB\0" "\0" - /* _mesa_function_pool[12447]: SetFenceNV (will be remapped) */ + /* _mesa_function_pool[12525]: SetFenceNV (will be remapped) */ "ii\0" "glSetFenceNV\0" "\0" - /* _mesa_function_pool[12464]: FramebufferTexture1DEXT (will be remapped) */ + /* _mesa_function_pool[12542]: FramebufferTexture1DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture1D\0" "glFramebufferTexture1DEXT\0" "\0" - /* _mesa_function_pool[12520]: GetCombinerOutputParameterivNV (will be remapped) */ + /* _mesa_function_pool[12598]: GetCombinerOutputParameterivNV (will be remapped) */ "iiip\0" "glGetCombinerOutputParameterivNV\0" "\0" - /* _mesa_function_pool[12559]: MultiModeDrawArraysIBM (will be remapped) */ - "pppii\0" - "glMultiModeDrawArraysIBM\0" - "\0" - /* _mesa_function_pool[12591]: PixelTexGenParameterivSGIS (will be remapped) */ + /* _mesa_function_pool[12637]: PixelTexGenParameterivSGIS (will be remapped) */ "ip\0" "glPixelTexGenParameterivSGIS\0" "\0" - /* _mesa_function_pool[12624]: TextureNormalEXT (dynamic) */ + /* _mesa_function_pool[12670]: TextureNormalEXT (dynamic) */ "i\0" "glTextureNormalEXT\0" "\0" - /* _mesa_function_pool[12646]: IndexPointerListIBM (dynamic) */ + /* _mesa_function_pool[12692]: IndexPointerListIBM (dynamic) */ "iipi\0" "glIndexPointerListIBM\0" "\0" - /* _mesa_function_pool[12674]: WeightfvARB (dynamic) */ + /* _mesa_function_pool[12720]: WeightfvARB (dynamic) */ "ip\0" "glWeightfvARB\0" "\0" - /* _mesa_function_pool[12692]: GetCombinerOutputParameterfvNV (will be remapped) */ - "iiip\0" - "glGetCombinerOutputParameterfvNV\0" - "\0" - /* _mesa_function_pool[12731]: RasterPos2sv (offset 69) */ + /* _mesa_function_pool[12738]: RasterPos2sv (offset 69) */ "p\0" "glRasterPos2sv\0" "\0" - /* _mesa_function_pool[12749]: Color4ubv (offset 36) */ + /* _mesa_function_pool[12756]: Color4ubv (offset 36) */ "p\0" "glColor4ubv\0" "\0" - /* _mesa_function_pool[12764]: DrawBuffer (offset 202) */ + /* _mesa_function_pool[12771]: DrawBuffer (offset 202) */ "i\0" "glDrawBuffer\0" "\0" - /* _mesa_function_pool[12780]: TexCoord2fv (offset 105) */ + /* _mesa_function_pool[12787]: TexCoord2fv (offset 105) */ "p\0" "glTexCoord2fv\0" "\0" - /* _mesa_function_pool[12797]: WindowPos4fMESA (will be remapped) */ + /* _mesa_function_pool[12804]: WindowPos4fMESA (will be remapped) */ "ffff\0" "glWindowPos4fMESA\0" "\0" - /* _mesa_function_pool[12821]: TexCoord1sv (offset 101) */ + /* _mesa_function_pool[12828]: TexCoord1sv (offset 101) */ "p\0" "glTexCoord1sv\0" "\0" - /* _mesa_function_pool[12838]: WindowPos3dvMESA (will be remapped) */ + /* _mesa_function_pool[12845]: WindowPos3dvMESA (will be remapped) */ "p\0" "glWindowPos3dv\0" "glWindowPos3dvARB\0" "glWindowPos3dvMESA\0" "\0" - /* _mesa_function_pool[12893]: DepthFunc (offset 245) */ + /* _mesa_function_pool[12900]: DepthFunc (offset 245) */ "i\0" "glDepthFunc\0" "\0" - /* _mesa_function_pool[12908]: PixelMapusv (offset 253) */ + /* _mesa_function_pool[12915]: PixelMapusv (offset 253) */ "iip\0" "glPixelMapusv\0" "\0" - /* _mesa_function_pool[12927]: GetQueryObjecti64vEXT (will be remapped) */ + /* _mesa_function_pool[12934]: GetQueryObjecti64vEXT (will be remapped) */ "iip\0" "glGetQueryObjecti64vEXT\0" "\0" - /* _mesa_function_pool[12956]: MultiTexCoord1dARB (offset 376) */ + /* _mesa_function_pool[12963]: MultiTexCoord1dARB (offset 376) */ "id\0" "glMultiTexCoord1d\0" "glMultiTexCoord1dARB\0" "\0" - /* _mesa_function_pool[12999]: PointParameterivNV (will be remapped) */ + /* _mesa_function_pool[13006]: PointParameterivNV (will be remapped) */ "ip\0" "glPointParameteriv\0" "glPointParameterivNV\0" "\0" - /* _mesa_function_pool[13043]: BlendFunc (offset 241) */ + /* _mesa_function_pool[13050]: BlendFunc (offset 241) */ "ii\0" "glBlendFunc\0" "\0" - /* _mesa_function_pool[13059]: EndTransformFeedbackEXT (will be remapped) */ + /* _mesa_function_pool[13066]: EndTransformFeedbackEXT (will be remapped) */ "\0" "glEndTransformFeedbackEXT\0" "glEndTransformFeedback\0" "\0" - /* _mesa_function_pool[13110]: Uniform2fvARB (will be remapped) */ + /* _mesa_function_pool[13117]: Uniform2fvARB (will be remapped) */ "iip\0" "glUniform2fv\0" "glUniform2fvARB\0" "\0" - /* _mesa_function_pool[13144]: BufferParameteriAPPLE (will be remapped) */ + /* _mesa_function_pool[13151]: BufferParameteriAPPLE (will be remapped) */ "iii\0" "glBufferParameteriAPPLE\0" "\0" - /* _mesa_function_pool[13173]: MultiTexCoord3dvARB (offset 393) */ + /* _mesa_function_pool[13180]: MultiTexCoord3dvARB (offset 393) */ "ip\0" "glMultiTexCoord3dv\0" "glMultiTexCoord3dvARB\0" "\0" - /* _mesa_function_pool[13218]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[13225]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[13274]: DeleteObjectARB (will be remapped) */ + /* _mesa_function_pool[13281]: DeleteObjectARB (will be remapped) */ "i\0" "glDeleteObjectARB\0" "\0" - /* _mesa_function_pool[13295]: MatrixIndexPointerARB (dynamic) */ + /* _mesa_function_pool[13302]: MatrixIndexPointerARB (dynamic) */ "iiip\0" "glMatrixIndexPointerARB\0" "\0" - /* _mesa_function_pool[13325]: ProgramNamedParameter4dvNV (will be remapped) */ + /* _mesa_function_pool[13332]: ProgramNamedParameter4dvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4dvNV\0" "\0" - /* _mesa_function_pool[13360]: Tangent3fvEXT (dynamic) */ + /* _mesa_function_pool[13367]: Tangent3fvEXT (dynamic) */ "p\0" "glTangent3fvEXT\0" "\0" - /* _mesa_function_pool[13379]: Flush (offset 217) */ + /* _mesa_function_pool[13386]: Flush (offset 217) */ "\0" "glFlush\0" "\0" - /* _mesa_function_pool[13389]: Color4uiv (offset 38) */ + /* _mesa_function_pool[13396]: Color4uiv (offset 38) */ "p\0" "glColor4uiv\0" "\0" - /* _mesa_function_pool[13404]: GenVertexArrays (will be remapped) */ + /* _mesa_function_pool[13411]: GenVertexArrays (will be remapped) */ "ip\0" "glGenVertexArrays\0" "\0" - /* _mesa_function_pool[13426]: RasterPos3sv (offset 77) */ + /* _mesa_function_pool[13433]: RasterPos3sv (offset 77) */ "p\0" "glRasterPos3sv\0" "\0" - /* _mesa_function_pool[13444]: BindFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[13451]: BindFramebufferEXT (will be remapped) */ "ii\0" "glBindFramebuffer\0" "glBindFramebufferEXT\0" "\0" - /* _mesa_function_pool[13487]: ReferencePlaneSGIX (dynamic) */ + /* _mesa_function_pool[13494]: ReferencePlaneSGIX (dynamic) */ "p\0" "glReferencePlaneSGIX\0" "\0" - /* _mesa_function_pool[13511]: PushAttrib (offset 219) */ + /* _mesa_function_pool[13518]: PushAttrib (offset 219) */ "i\0" "glPushAttrib\0" "\0" - /* _mesa_function_pool[13527]: RasterPos2i (offset 66) */ + /* _mesa_function_pool[13534]: RasterPos2i (offset 66) */ "ii\0" "glRasterPos2i\0" "\0" - /* _mesa_function_pool[13545]: ValidateProgramARB (will be remapped) */ + /* _mesa_function_pool[13552]: ValidateProgramARB (will be remapped) */ "i\0" "glValidateProgram\0" "glValidateProgramARB\0" "\0" - /* _mesa_function_pool[13587]: TexParameteriv (offset 181) */ + /* _mesa_function_pool[13594]: TexParameteriv (offset 181) */ "iip\0" "glTexParameteriv\0" "\0" - /* _mesa_function_pool[13609]: UnlockArraysEXT (will be remapped) */ + /* _mesa_function_pool[13616]: UnlockArraysEXT (will be remapped) */ "\0" "glUnlockArraysEXT\0" "\0" - /* _mesa_function_pool[13629]: TexCoord2fColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[13636]: TexCoord2fColor3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[13670]: WindowPos3fvMESA (will be remapped) */ + /* _mesa_function_pool[13677]: WindowPos3fvMESA (will be remapped) */ "p\0" "glWindowPos3fv\0" "glWindowPos3fvARB\0" "glWindowPos3fvMESA\0" "\0" - /* _mesa_function_pool[13725]: RasterPos2f (offset 64) */ + /* _mesa_function_pool[13732]: RasterPos2f (offset 64) */ "ff\0" "glRasterPos2f\0" "\0" - /* _mesa_function_pool[13743]: VertexAttrib1svNV (will be remapped) */ + /* _mesa_function_pool[13750]: VertexAttrib1svNV (will be remapped) */ "ip\0" "glVertexAttrib1svNV\0" "\0" - /* _mesa_function_pool[13767]: RasterPos2d (offset 62) */ + /* _mesa_function_pool[13774]: RasterPos2d (offset 62) */ "dd\0" "glRasterPos2d\0" "\0" - /* _mesa_function_pool[13785]: RasterPos3fv (offset 73) */ + /* _mesa_function_pool[13792]: RasterPos3fv (offset 73) */ "p\0" "glRasterPos3fv\0" "\0" - /* _mesa_function_pool[13803]: CopyTexSubImage3D (offset 373) */ + /* _mesa_function_pool[13810]: CopyTexSubImage3D (offset 373) */ "iiiiiiiii\0" "glCopyTexSubImage3D\0" "glCopyTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[13857]: VertexAttrib2dARB (will be remapped) */ + /* _mesa_function_pool[13864]: VertexAttrib2dARB (will be remapped) */ "idd\0" "glVertexAttrib2d\0" "glVertexAttrib2dARB\0" "\0" - /* _mesa_function_pool[13899]: Color4ub (offset 35) */ + /* _mesa_function_pool[13906]: Color4ub (offset 35) */ "iiii\0" "glColor4ub\0" "\0" - /* _mesa_function_pool[13916]: GetInteger64v (will be remapped) */ + /* _mesa_function_pool[13923]: GetInteger64v (will be remapped) */ "ip\0" "glGetInteger64v\0" "\0" - /* _mesa_function_pool[13936]: TextureColorMaskSGIS (dynamic) */ + /* _mesa_function_pool[13943]: TextureColorMaskSGIS (dynamic) */ "iiii\0" "glTextureColorMaskSGIS\0" "\0" - /* _mesa_function_pool[13965]: RasterPos2s (offset 68) */ + /* _mesa_function_pool[13972]: RasterPos2s (offset 68) */ "ii\0" "glRasterPos2s\0" "\0" - /* _mesa_function_pool[13983]: GetColorTable (offset 343) */ + /* _mesa_function_pool[13990]: GetColorTable (offset 343) */ "iiip\0" "glGetColorTable\0" "glGetColorTableSGI\0" "glGetColorTableEXT\0" "\0" - /* _mesa_function_pool[14043]: SelectBuffer (offset 195) */ + /* _mesa_function_pool[14050]: SelectBuffer (offset 195) */ "ip\0" "glSelectBuffer\0" "\0" - /* _mesa_function_pool[14062]: Indexiv (offset 49) */ + /* _mesa_function_pool[14069]: Indexiv (offset 49) */ "p\0" "glIndexiv\0" "\0" - /* _mesa_function_pool[14075]: TexCoord3i (offset 114) */ + /* _mesa_function_pool[14082]: TexCoord3i (offset 114) */ "iii\0" "glTexCoord3i\0" "\0" - /* _mesa_function_pool[14093]: CopyColorTable (offset 342) */ + /* _mesa_function_pool[14100]: CopyColorTable (offset 342) */ "iiiii\0" "glCopyColorTable\0" "glCopyColorTableSGI\0" "\0" - /* _mesa_function_pool[14137]: GetHistogramParameterfv (offset 362) */ + /* _mesa_function_pool[14144]: GetHistogramParameterfv (offset 362) */ "iip\0" "glGetHistogramParameterfv\0" "glGetHistogramParameterfvEXT\0" "\0" - /* _mesa_function_pool[14197]: Frustum (offset 289) */ + /* _mesa_function_pool[14204]: Frustum (offset 289) */ "dddddd\0" "glFrustum\0" "\0" - /* _mesa_function_pool[14215]: GetString (offset 275) */ + /* _mesa_function_pool[14222]: GetString (offset 275) */ "i\0" "glGetString\0" "\0" - /* _mesa_function_pool[14230]: ColorPointervINTEL (dynamic) */ + /* _mesa_function_pool[14237]: ColorPointervINTEL (dynamic) */ "iip\0" "glColorPointervINTEL\0" "\0" - /* _mesa_function_pool[14256]: TexEnvf (offset 184) */ + /* _mesa_function_pool[14263]: TexEnvf (offset 184) */ "iif\0" "glTexEnvf\0" "\0" - /* _mesa_function_pool[14271]: TexCoord3d (offset 110) */ + /* _mesa_function_pool[14278]: TexCoord3d (offset 110) */ "ddd\0" "glTexCoord3d\0" "\0" - /* _mesa_function_pool[14289]: AlphaFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[14296]: AlphaFragmentOp1ATI (will be remapped) */ "iiiiii\0" "glAlphaFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[14319]: TexCoord3f (offset 112) */ + /* _mesa_function_pool[14326]: TexCoord3f (offset 112) */ "fff\0" "glTexCoord3f\0" "\0" - /* _mesa_function_pool[14337]: MultiTexCoord3ivARB (offset 397) */ + /* _mesa_function_pool[14344]: MultiTexCoord3ivARB (offset 397) */ "ip\0" "glMultiTexCoord3iv\0" "glMultiTexCoord3ivARB\0" "\0" - /* _mesa_function_pool[14382]: MultiTexCoord2sARB (offset 390) */ + /* _mesa_function_pool[14389]: MultiTexCoord2sARB (offset 390) */ "iii\0" "glMultiTexCoord2s\0" "glMultiTexCoord2sARB\0" "\0" - /* _mesa_function_pool[14426]: VertexAttrib1dvARB (will be remapped) */ + /* _mesa_function_pool[14433]: VertexAttrib1dvARB (will be remapped) */ "ip\0" "glVertexAttrib1dv\0" "glVertexAttrib1dvARB\0" "\0" - /* _mesa_function_pool[14469]: DeleteTextures (offset 327) */ + /* _mesa_function_pool[14476]: DeleteTextures (offset 327) */ "ip\0" "glDeleteTextures\0" "glDeleteTexturesEXT\0" "\0" - /* _mesa_function_pool[14510]: TexCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[14517]: TexCoordPointerEXT (will be remapped) */ "iiiip\0" "glTexCoordPointerEXT\0" "\0" - /* _mesa_function_pool[14538]: TexSubImage4DSGIS (dynamic) */ + /* _mesa_function_pool[14545]: TexSubImage4DSGIS (dynamic) */ "iiiiiiiiiiiip\0" "glTexSubImage4DSGIS\0" "\0" - /* _mesa_function_pool[14573]: TexCoord3s (offset 116) */ + /* _mesa_function_pool[14580]: TexCoord3s (offset 116) */ "iii\0" "glTexCoord3s\0" "\0" - /* _mesa_function_pool[14591]: GetTexLevelParameteriv (offset 285) */ + /* _mesa_function_pool[14598]: GetTexLevelParameteriv (offset 285) */ "iiip\0" "glGetTexLevelParameteriv\0" "\0" - /* _mesa_function_pool[14622]: DrawArraysInstanced (will be remapped) */ + /* _mesa_function_pool[14629]: DrawArraysInstanced (will be remapped) */ "iiii\0" "glDrawArraysInstanced\0" "glDrawArraysInstancedARB\0" "glDrawArraysInstancedEXT\0" "\0" - /* _mesa_function_pool[14700]: CombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[14707]: CombinerStageParameterfvNV (dynamic) */ "iip\0" "glCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[14734]: StopInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[14741]: StopInstrumentsSGIX (dynamic) */ "i\0" "glStopInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[14759]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[14766]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ "fffffffffffffff\0" "glTexCoord4fColor4fNormal3fVertex4fSUN\0" "\0" - /* _mesa_function_pool[14815]: ClearAccum (offset 204) */ + /* _mesa_function_pool[14822]: ClearAccum (offset 204) */ "ffff\0" "glClearAccum\0" "\0" - /* _mesa_function_pool[14834]: DeformSGIX (dynamic) */ + /* _mesa_function_pool[14841]: DeformSGIX (dynamic) */ "i\0" "glDeformSGIX\0" "\0" - /* _mesa_function_pool[14850]: GetVertexAttribfvARB (will be remapped) */ + /* _mesa_function_pool[14857]: GetVertexAttribfvARB (will be remapped) */ "iip\0" "glGetVertexAttribfv\0" "glGetVertexAttribfvARB\0" "\0" - /* _mesa_function_pool[14898]: SecondaryColor3ivEXT (will be remapped) */ + /* _mesa_function_pool[14905]: SecondaryColor3ivEXT (will be remapped) */ "p\0" "glSecondaryColor3iv\0" "glSecondaryColor3ivEXT\0" "\0" - /* _mesa_function_pool[14944]: TexCoord4iv (offset 123) */ + /* _mesa_function_pool[14951]: TexCoord4iv (offset 123) */ "p\0" "glTexCoord4iv\0" "\0" - /* _mesa_function_pool[14961]: UniformMatrix4x2fv (will be remapped) */ + /* _mesa_function_pool[14968]: UniformMatrix4x2fv (will be remapped) */ "iiip\0" "glUniformMatrix4x2fv\0" "\0" - /* _mesa_function_pool[14988]: GetDetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[14995]: GetDetailTexFuncSGIS (dynamic) */ "ip\0" "glGetDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[15015]: GetCombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[15022]: GetCombinerStageParameterfvNV (dynamic) */ "iip\0" "glGetCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[15052]: PolygonOffset (offset 319) */ + /* _mesa_function_pool[15059]: PolygonOffset (offset 319) */ "ff\0" "glPolygonOffset\0" "\0" - /* _mesa_function_pool[15072]: BindVertexArray (will be remapped) */ + /* _mesa_function_pool[15079]: BindVertexArray (will be remapped) */ "i\0" "glBindVertexArray\0" "\0" - /* _mesa_function_pool[15093]: Color4ubVertex2fvSUN (dynamic) */ + /* _mesa_function_pool[15100]: Color4ubVertex2fvSUN (dynamic) */ "pp\0" "glColor4ubVertex2fvSUN\0" "\0" - /* _mesa_function_pool[15120]: Rectd (offset 86) */ + /* _mesa_function_pool[15127]: Rectd (offset 86) */ "dddd\0" "glRectd\0" "\0" - /* _mesa_function_pool[15134]: TexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[15141]: TexFilterFuncSGIS (dynamic) */ "iiip\0" "glTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[15160]: SampleMaskSGIS (will be remapped) */ + /* _mesa_function_pool[15167]: SampleMaskSGIS (will be remapped) */ "fi\0" "glSampleMaskSGIS\0" "glSampleMaskEXT\0" "\0" - /* _mesa_function_pool[15197]: GetAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[15204]: GetAttribLocationARB (will be remapped) */ "ip\0" "glGetAttribLocation\0" "glGetAttribLocationARB\0" "\0" - /* _mesa_function_pool[15244]: RasterPos3i (offset 74) */ + /* _mesa_function_pool[15251]: RasterPos3i (offset 74) */ "iii\0" "glRasterPos3i\0" "\0" - /* _mesa_function_pool[15263]: VertexAttrib4ubvARB (will be remapped) */ + /* _mesa_function_pool[15270]: VertexAttrib4ubvARB (will be remapped) */ "ip\0" "glVertexAttrib4ubv\0" "glVertexAttrib4ubvARB\0" "\0" - /* _mesa_function_pool[15308]: DetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[15315]: DetailTexFuncSGIS (dynamic) */ "iip\0" "glDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[15333]: Normal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[15340]: Normal3fVertex3fSUN (dynamic) */ "ffffff\0" "glNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[15363]: CopyTexImage2D (offset 324) */ + /* _mesa_function_pool[15370]: CopyTexImage2D (offset 324) */ "iiiiiiii\0" "glCopyTexImage2D\0" "glCopyTexImage2DEXT\0" "\0" - /* _mesa_function_pool[15410]: GetBufferPointervARB (will be remapped) */ + /* _mesa_function_pool[15417]: GetBufferPointervARB (will be remapped) */ "iip\0" "glGetBufferPointerv\0" "glGetBufferPointervARB\0" "\0" - /* _mesa_function_pool[15458]: ProgramEnvParameter4fARB (will be remapped) */ + /* _mesa_function_pool[15465]: ProgramEnvParameter4fARB (will be remapped) */ "iiffff\0" "glProgramEnvParameter4fARB\0" "glProgramParameter4fNV\0" "\0" - /* _mesa_function_pool[15516]: Uniform3ivARB (will be remapped) */ + /* _mesa_function_pool[15523]: Uniform3ivARB (will be remapped) */ "iip\0" "glUniform3iv\0" "glUniform3ivARB\0" "\0" - /* _mesa_function_pool[15550]: Lightfv (offset 160) */ + /* _mesa_function_pool[15557]: Lightfv (offset 160) */ "iip\0" "glLightfv\0" "\0" - /* _mesa_function_pool[15565]: ClearDepth (offset 208) */ + /* _mesa_function_pool[15572]: ClearDepth (offset 208) */ "d\0" "glClearDepth\0" "\0" - /* _mesa_function_pool[15581]: GetFenceivNV (will be remapped) */ + /* _mesa_function_pool[15588]: GetFenceivNV (will be remapped) */ "iip\0" "glGetFenceivNV\0" "\0" - /* _mesa_function_pool[15601]: WindowPos4dvMESA (will be remapped) */ + /* _mesa_function_pool[15608]: WindowPos4dvMESA (will be remapped) */ "p\0" "glWindowPos4dvMESA\0" "\0" - /* _mesa_function_pool[15623]: ColorSubTable (offset 346) */ + /* _mesa_function_pool[15630]: ColorSubTable (offset 346) */ "iiiiip\0" "glColorSubTable\0" "glColorSubTableEXT\0" "\0" - /* _mesa_function_pool[15666]: Color4fv (offset 30) */ + /* _mesa_function_pool[15673]: Color4fv (offset 30) */ "p\0" "glColor4fv\0" "\0" - /* _mesa_function_pool[15680]: MultiTexCoord4ivARB (offset 405) */ + /* _mesa_function_pool[15687]: MultiTexCoord4ivARB (offset 405) */ "ip\0" "glMultiTexCoord4iv\0" "glMultiTexCoord4ivARB\0" "\0" - /* _mesa_function_pool[15725]: DrawElementsInstanced (will be remapped) */ + /* _mesa_function_pool[15732]: DrawElementsInstanced (will be remapped) */ "iiipi\0" "glDrawElementsInstanced\0" "glDrawElementsInstancedARB\0" "glDrawElementsInstancedEXT\0" "\0" - /* _mesa_function_pool[15810]: ColorPointer (offset 308) */ + /* _mesa_function_pool[15817]: ColorPointer (offset 308) */ "iiip\0" "glColorPointer\0" "\0" - /* _mesa_function_pool[15831]: Rects (offset 92) */ + /* _mesa_function_pool[15838]: Rects (offset 92) */ "iiii\0" "glRects\0" "\0" - /* _mesa_function_pool[15845]: GetMapAttribParameterfvNV (dynamic) */ + /* _mesa_function_pool[15852]: GetMapAttribParameterfvNV (dynamic) */ "iiip\0" "glGetMapAttribParameterfvNV\0" "\0" - /* _mesa_function_pool[15879]: Lightiv (offset 162) */ + /* _mesa_function_pool[15886]: Lightiv (offset 162) */ "iip\0" "glLightiv\0" "\0" - /* _mesa_function_pool[15894]: VertexAttrib4sARB (will be remapped) */ + /* _mesa_function_pool[15901]: VertexAttrib4sARB (will be remapped) */ "iiiii\0" "glVertexAttrib4s\0" "glVertexAttrib4sARB\0" "\0" - /* _mesa_function_pool[15938]: GetQueryObjectuivARB (will be remapped) */ + /* _mesa_function_pool[15945]: GetQueryObjectuivARB (will be remapped) */ "iip\0" "glGetQueryObjectuiv\0" "glGetQueryObjectuivARB\0" "\0" - /* _mesa_function_pool[15986]: GetTexParameteriv (offset 283) */ + /* _mesa_function_pool[15993]: GetTexParameteriv (offset 283) */ "iip\0" "glGetTexParameteriv\0" "\0" - /* _mesa_function_pool[16011]: MapParameterivNV (dynamic) */ + /* _mesa_function_pool[16018]: MapParameterivNV (dynamic) */ "iip\0" "glMapParameterivNV\0" "\0" - /* _mesa_function_pool[16035]: GenRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[16042]: GenRenderbuffersEXT (will be remapped) */ "ip\0" "glGenRenderbuffers\0" "glGenRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[16080]: VertexAttrib2dvARB (will be remapped) */ + /* _mesa_function_pool[16087]: VertexAttrib2dvARB (will be remapped) */ "ip\0" "glVertexAttrib2dv\0" "glVertexAttrib2dvARB\0" "\0" - /* _mesa_function_pool[16123]: EdgeFlagPointerEXT (will be remapped) */ + /* _mesa_function_pool[16130]: EdgeFlagPointerEXT (will be remapped) */ "iip\0" "glEdgeFlagPointerEXT\0" "\0" - /* _mesa_function_pool[16149]: VertexAttribs2svNV (will be remapped) */ + /* _mesa_function_pool[16156]: VertexAttribs2svNV (will be remapped) */ "iip\0" "glVertexAttribs2svNV\0" "\0" - /* _mesa_function_pool[16175]: WeightbvARB (dynamic) */ + /* _mesa_function_pool[16182]: WeightbvARB (dynamic) */ "ip\0" "glWeightbvARB\0" "\0" - /* _mesa_function_pool[16193]: VertexAttrib2fvARB (will be remapped) */ + /* _mesa_function_pool[16200]: VertexAttrib2fvARB (will be remapped) */ "ip\0" "glVertexAttrib2fv\0" "glVertexAttrib2fvARB\0" "\0" - /* _mesa_function_pool[16236]: GetBufferParameterivARB (will be remapped) */ + /* _mesa_function_pool[16243]: GetBufferParameterivARB (will be remapped) */ "iip\0" "glGetBufferParameteriv\0" "glGetBufferParameterivARB\0" "\0" - /* _mesa_function_pool[16290]: Rectdv (offset 87) */ + /* _mesa_function_pool[16297]: Rectdv (offset 87) */ "pp\0" "glRectdv\0" "\0" - /* _mesa_function_pool[16303]: ListParameteriSGIX (dynamic) */ + /* _mesa_function_pool[16310]: ListParameteriSGIX (dynamic) */ "iii\0" "glListParameteriSGIX\0" "\0" - /* _mesa_function_pool[16329]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[16336]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffff\0" "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[16388]: InstrumentsBufferSGIX (dynamic) */ + /* _mesa_function_pool[16395]: InstrumentsBufferSGIX (dynamic) */ "ip\0" "glInstrumentsBufferSGIX\0" "\0" - /* _mesa_function_pool[16416]: VertexAttrib4NivARB (will be remapped) */ + /* _mesa_function_pool[16423]: VertexAttrib4NivARB (will be remapped) */ "ip\0" "glVertexAttrib4Niv\0" "glVertexAttrib4NivARB\0" "\0" - /* _mesa_function_pool[16461]: GetAttachedShaders (will be remapped) */ + /* _mesa_function_pool[16468]: GetAttachedShaders (will be remapped) */ "iipp\0" "glGetAttachedShaders\0" "\0" - /* _mesa_function_pool[16488]: GenVertexArraysAPPLE (will be remapped) */ + /* _mesa_function_pool[16495]: GenVertexArraysAPPLE (will be remapped) */ "ip\0" "glGenVertexArraysAPPLE\0" "\0" - /* _mesa_function_pool[16515]: Materialiv (offset 172) */ + /* _mesa_function_pool[16522]: Materialiv (offset 172) */ "iip\0" "glMaterialiv\0" "\0" - /* _mesa_function_pool[16533]: PushClientAttrib (offset 335) */ + /* _mesa_function_pool[16540]: PushClientAttrib (offset 335) */ "i\0" "glPushClientAttrib\0" "\0" - /* _mesa_function_pool[16555]: ProgramEnvParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[16562]: ProgramEnvParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramEnvParameters4fvEXT\0" "\0" - /* _mesa_function_pool[16590]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[16597]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[16636]: WindowPos2iMESA (will be remapped) */ + /* _mesa_function_pool[16643]: WindowPos2iMESA (will be remapped) */ "ii\0" "glWindowPos2i\0" "glWindowPos2iARB\0" "glWindowPos2iMESA\0" "\0" - /* _mesa_function_pool[16689]: SecondaryColor3fvEXT (will be remapped) */ + /* _mesa_function_pool[16696]: SecondaryColor3fvEXT (will be remapped) */ "p\0" "glSecondaryColor3fv\0" "glSecondaryColor3fvEXT\0" "\0" - /* _mesa_function_pool[16735]: PolygonMode (offset 174) */ + /* _mesa_function_pool[16742]: PolygonMode (offset 174) */ "ii\0" "glPolygonMode\0" "\0" - /* _mesa_function_pool[16753]: CompressedTexSubImage1DARB (will be remapped) */ + /* _mesa_function_pool[16760]: CompressedTexSubImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexSubImage1D\0" "glCompressedTexSubImage1DARB\0" "\0" - /* _mesa_function_pool[16817]: GetVertexAttribivNV (will be remapped) */ + /* _mesa_function_pool[16824]: GetVertexAttribivNV (will be remapped) */ "iip\0" "glGetVertexAttribivNV\0" "\0" - /* _mesa_function_pool[16844]: GetProgramStringARB (will be remapped) */ + /* _mesa_function_pool[16851]: GetProgramStringARB (will be remapped) */ "iip\0" "glGetProgramStringARB\0" "\0" - /* _mesa_function_pool[16871]: TexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[16878]: TexBumpParameterfvATI (will be remapped) */ "ip\0" "glTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[16899]: CompileShaderARB (will be remapped) */ + /* _mesa_function_pool[16906]: CompileShaderARB (will be remapped) */ "i\0" "glCompileShader\0" "glCompileShaderARB\0" "\0" - /* _mesa_function_pool[16937]: DeleteShader (will be remapped) */ + /* _mesa_function_pool[16944]: DeleteShader (will be remapped) */ "i\0" "glDeleteShader\0" "\0" - /* _mesa_function_pool[16955]: DisableClientState (offset 309) */ + /* _mesa_function_pool[16962]: DisableClientState (offset 309) */ "i\0" "glDisableClientState\0" "\0" - /* _mesa_function_pool[16979]: TexGeni (offset 192) */ + /* _mesa_function_pool[16986]: TexGeni (offset 192) */ "iii\0" "glTexGeni\0" "\0" - /* _mesa_function_pool[16994]: TexGenf (offset 190) */ + /* _mesa_function_pool[17001]: TexGenf (offset 190) */ "iif\0" "glTexGenf\0" "\0" - /* _mesa_function_pool[17009]: Uniform3fARB (will be remapped) */ + /* _mesa_function_pool[17016]: Uniform3fARB (will be remapped) */ "ifff\0" "glUniform3f\0" "glUniform3fARB\0" "\0" - /* _mesa_function_pool[17042]: TexGend (offset 188) */ + /* _mesa_function_pool[17049]: TexGend (offset 188) */ "iid\0" "glTexGend\0" "\0" - /* _mesa_function_pool[17057]: ListParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[17064]: ListParameterfvSGIX (dynamic) */ "iip\0" "glListParameterfvSGIX\0" "\0" - /* _mesa_function_pool[17084]: GetPolygonStipple (offset 274) */ + /* _mesa_function_pool[17091]: GetPolygonStipple (offset 274) */ "p\0" "glGetPolygonStipple\0" "\0" - /* _mesa_function_pool[17107]: Tangent3dvEXT (dynamic) */ + /* _mesa_function_pool[17114]: Tangent3dvEXT (dynamic) */ "p\0" "glTangent3dvEXT\0" "\0" - /* _mesa_function_pool[17126]: BindBufferOffsetEXT (will be remapped) */ + /* _mesa_function_pool[17133]: BindBufferOffsetEXT (will be remapped) */ "iiii\0" "glBindBufferOffsetEXT\0" "\0" - /* _mesa_function_pool[17154]: WindowPos3sMESA (will be remapped) */ + /* _mesa_function_pool[17161]: WindowPos3sMESA (will be remapped) */ "iii\0" "glWindowPos3s\0" "glWindowPos3sARB\0" "glWindowPos3sMESA\0" "\0" - /* _mesa_function_pool[17208]: VertexAttrib2svNV (will be remapped) */ + /* _mesa_function_pool[17215]: VertexAttrib2svNV (will be remapped) */ "ip\0" "glVertexAttrib2svNV\0" "\0" - /* _mesa_function_pool[17232]: DisableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[17239]: DisableIndexedEXT (will be remapped) */ "ii\0" "glDisableIndexedEXT\0" "\0" - /* _mesa_function_pool[17256]: BindBufferBaseEXT (will be remapped) */ + /* _mesa_function_pool[17263]: BindBufferBaseEXT (will be remapped) */ "iii\0" "glBindBufferBaseEXT\0" "glBindBufferBase\0" "\0" - /* _mesa_function_pool[17298]: TexCoord2fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[17305]: TexCoord2fVertex3fvSUN (dynamic) */ "pp\0" "glTexCoord2fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[17327]: WindowPos4sMESA (will be remapped) */ + /* _mesa_function_pool[17334]: WindowPos4sMESA (will be remapped) */ "iiii\0" "glWindowPos4sMESA\0" "\0" - /* _mesa_function_pool[17351]: VertexAttrib4NuivARB (will be remapped) */ + /* _mesa_function_pool[17358]: VertexAttrib4NuivARB (will be remapped) */ "ip\0" "glVertexAttrib4Nuiv\0" "glVertexAttrib4NuivARB\0" "\0" - /* _mesa_function_pool[17398]: ClientActiveTextureARB (offset 375) */ + /* _mesa_function_pool[17405]: ClientActiveTextureARB (offset 375) */ "i\0" "glClientActiveTexture\0" "glClientActiveTextureARB\0" "\0" - /* _mesa_function_pool[17448]: PixelTexGenSGIX (will be remapped) */ + /* _mesa_function_pool[17455]: PixelTexGenSGIX (will be remapped) */ "i\0" "glPixelTexGenSGIX\0" "\0" - /* _mesa_function_pool[17469]: ReplacementCodeusvSUN (dynamic) */ + /* _mesa_function_pool[17476]: ReplacementCodeusvSUN (dynamic) */ "p\0" "glReplacementCodeusvSUN\0" "\0" - /* _mesa_function_pool[17496]: Uniform4fARB (will be remapped) */ + /* _mesa_function_pool[17503]: Uniform4fARB (will be remapped) */ "iffff\0" "glUniform4f\0" "glUniform4fARB\0" "\0" - /* _mesa_function_pool[17530]: Color4sv (offset 34) */ + /* _mesa_function_pool[17537]: Color4sv (offset 34) */ "p\0" "glColor4sv\0" "\0" - /* _mesa_function_pool[17544]: FlushMappedBufferRange (will be remapped) */ + /* _mesa_function_pool[17551]: FlushMappedBufferRange (will be remapped) */ "iii\0" "glFlushMappedBufferRange\0" "\0" - /* _mesa_function_pool[17574]: IsProgramNV (will be remapped) */ + /* _mesa_function_pool[17581]: IsProgramNV (will be remapped) */ "i\0" "glIsProgramARB\0" "glIsProgramNV\0" "\0" - /* _mesa_function_pool[17606]: FlushMappedBufferRangeAPPLE (will be remapped) */ + /* _mesa_function_pool[17613]: FlushMappedBufferRangeAPPLE (will be remapped) */ "iii\0" "glFlushMappedBufferRangeAPPLE\0" "\0" - /* _mesa_function_pool[17641]: PixelZoom (offset 246) */ + /* _mesa_function_pool[17648]: PixelZoom (offset 246) */ "ff\0" "glPixelZoom\0" "\0" - /* _mesa_function_pool[17657]: ReplacementCodePointerSUN (dynamic) */ + /* _mesa_function_pool[17664]: ReplacementCodePointerSUN (dynamic) */ "iip\0" "glReplacementCodePointerSUN\0" "\0" - /* _mesa_function_pool[17690]: ProgramEnvParameter4dARB (will be remapped) */ + /* _mesa_function_pool[17697]: ProgramEnvParameter4dARB (will be remapped) */ "iidddd\0" "glProgramEnvParameter4dARB\0" "glProgramParameter4dNV\0" "\0" - /* _mesa_function_pool[17748]: ColorTableParameterfv (offset 340) */ + /* _mesa_function_pool[17755]: ColorTableParameterfv (offset 340) */ "iip\0" "glColorTableParameterfv\0" "glColorTableParameterfvSGI\0" "\0" - /* _mesa_function_pool[17804]: FragmentLightModelfSGIX (dynamic) */ + /* _mesa_function_pool[17811]: FragmentLightModelfSGIX (dynamic) */ "if\0" "glFragmentLightModelfSGIX\0" "\0" - /* _mesa_function_pool[17834]: Binormal3bvEXT (dynamic) */ + /* _mesa_function_pool[17841]: Binormal3bvEXT (dynamic) */ "p\0" "glBinormal3bvEXT\0" "\0" - /* _mesa_function_pool[17854]: PixelMapuiv (offset 252) */ + /* _mesa_function_pool[17861]: PixelMapuiv (offset 252) */ "iip\0" "glPixelMapuiv\0" "\0" - /* _mesa_function_pool[17873]: Color3dv (offset 12) */ + /* _mesa_function_pool[17880]: Color3dv (offset 12) */ "p\0" "glColor3dv\0" "\0" - /* _mesa_function_pool[17887]: IsTexture (offset 330) */ + /* _mesa_function_pool[17894]: IsTexture (offset 330) */ "i\0" "glIsTexture\0" "glIsTextureEXT\0" "\0" - /* _mesa_function_pool[17917]: VertexWeightfvEXT (dynamic) */ + /* _mesa_function_pool[17924]: VertexWeightfvEXT (dynamic) */ "p\0" "glVertexWeightfvEXT\0" "\0" - /* _mesa_function_pool[17940]: VertexAttrib1dARB (will be remapped) */ + /* _mesa_function_pool[17947]: VertexAttrib1dARB (will be remapped) */ "id\0" "glVertexAttrib1d\0" "glVertexAttrib1dARB\0" "\0" - /* _mesa_function_pool[17981]: ImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[17988]: ImageTransformParameterivHP (dynamic) */ "iip\0" "glImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[18016]: TexCoord4i (offset 122) */ + /* _mesa_function_pool[18023]: TexCoord4i (offset 122) */ "iiii\0" "glTexCoord4i\0" "\0" - /* _mesa_function_pool[18035]: DeleteQueriesARB (will be remapped) */ + /* _mesa_function_pool[18042]: DeleteQueriesARB (will be remapped) */ "ip\0" "glDeleteQueries\0" "glDeleteQueriesARB\0" "\0" - /* _mesa_function_pool[18074]: Color4ubVertex2fSUN (dynamic) */ + /* _mesa_function_pool[18081]: Color4ubVertex2fSUN (dynamic) */ "iiiiff\0" "glColor4ubVertex2fSUN\0" "\0" - /* _mesa_function_pool[18104]: FragmentColorMaterialSGIX (dynamic) */ + /* _mesa_function_pool[18111]: FragmentColorMaterialSGIX (dynamic) */ "ii\0" "glFragmentColorMaterialSGIX\0" "\0" - /* _mesa_function_pool[18136]: CurrentPaletteMatrixARB (dynamic) */ + /* _mesa_function_pool[18143]: CurrentPaletteMatrixARB (dynamic) */ "i\0" "glCurrentPaletteMatrixARB\0" "\0" - /* _mesa_function_pool[18165]: GetMapdv (offset 266) */ + /* _mesa_function_pool[18172]: GetMapdv (offset 266) */ "iip\0" "glGetMapdv\0" "\0" - /* _mesa_function_pool[18181]: ObjectPurgeableAPPLE (will be remapped) */ + /* _mesa_function_pool[18188]: ObjectPurgeableAPPLE (will be remapped) */ "iii\0" "glObjectPurgeableAPPLE\0" "\0" - /* _mesa_function_pool[18209]: SamplePatternSGIS (will be remapped) */ + /* _mesa_function_pool[18216]: SamplePatternSGIS (will be remapped) */ "i\0" "glSamplePatternSGIS\0" "glSamplePatternEXT\0" "\0" - /* _mesa_function_pool[18251]: PixelStoref (offset 249) */ + /* _mesa_function_pool[18258]: PixelStoref (offset 249) */ "if\0" "glPixelStoref\0" "\0" - /* _mesa_function_pool[18269]: IsQueryARB (will be remapped) */ + /* _mesa_function_pool[18276]: IsQueryARB (will be remapped) */ "i\0" "glIsQuery\0" "glIsQueryARB\0" "\0" - /* _mesa_function_pool[18295]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[18302]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ "iiiiifff\0" "glReplacementCodeuiColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[18344]: PixelStorei (offset 250) */ + /* _mesa_function_pool[18351]: PixelStorei (offset 250) */ "ii\0" "glPixelStorei\0" "\0" - /* _mesa_function_pool[18362]: VertexAttrib4usvARB (will be remapped) */ + /* _mesa_function_pool[18369]: VertexAttrib4usvARB (will be remapped) */ "ip\0" "glVertexAttrib4usv\0" "glVertexAttrib4usvARB\0" "\0" - /* _mesa_function_pool[18407]: LinkProgramARB (will be remapped) */ + /* _mesa_function_pool[18414]: LinkProgramARB (will be remapped) */ "i\0" "glLinkProgram\0" "glLinkProgramARB\0" "\0" - /* _mesa_function_pool[18441]: VertexAttrib2fNV (will be remapped) */ + /* _mesa_function_pool[18448]: VertexAttrib2fNV (will be remapped) */ "iff\0" "glVertexAttrib2fNV\0" "\0" - /* _mesa_function_pool[18465]: ShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[18472]: ShaderSourceARB (will be remapped) */ "iipp\0" "glShaderSource\0" "glShaderSourceARB\0" "\0" - /* _mesa_function_pool[18504]: FragmentMaterialiSGIX (dynamic) */ + /* _mesa_function_pool[18511]: FragmentMaterialiSGIX (dynamic) */ "iii\0" "glFragmentMaterialiSGIX\0" "\0" - /* _mesa_function_pool[18533]: EvalCoord2dv (offset 233) */ + /* _mesa_function_pool[18540]: EvalCoord2dv (offset 233) */ "p\0" "glEvalCoord2dv\0" "\0" - /* _mesa_function_pool[18551]: VertexAttrib3svARB (will be remapped) */ + /* _mesa_function_pool[18558]: VertexAttrib3svARB (will be remapped) */ "ip\0" "glVertexAttrib3sv\0" "glVertexAttrib3svARB\0" "\0" - /* _mesa_function_pool[18594]: ColorMaterial (offset 151) */ + /* _mesa_function_pool[18601]: ColorMaterial (offset 151) */ "ii\0" "glColorMaterial\0" "\0" - /* _mesa_function_pool[18614]: CompressedTexSubImage3DARB (will be remapped) */ + /* _mesa_function_pool[18621]: CompressedTexSubImage3DARB (will be remapped) */ "iiiiiiiiiip\0" "glCompressedTexSubImage3D\0" "glCompressedTexSubImage3DARB\0" "\0" - /* _mesa_function_pool[18682]: WindowPos2ivMESA (will be remapped) */ + /* _mesa_function_pool[18689]: WindowPos2ivMESA (will be remapped) */ "p\0" "glWindowPos2iv\0" "glWindowPos2ivARB\0" "glWindowPos2ivMESA\0" "\0" - /* _mesa_function_pool[18737]: IsFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[18744]: IsFramebufferEXT (will be remapped) */ "i\0" "glIsFramebuffer\0" "glIsFramebufferEXT\0" "\0" - /* _mesa_function_pool[18775]: Uniform4ivARB (will be remapped) */ + /* _mesa_function_pool[18782]: Uniform4ivARB (will be remapped) */ "iip\0" "glUniform4iv\0" "glUniform4ivARB\0" "\0" - /* _mesa_function_pool[18809]: GetVertexAttribdvARB (will be remapped) */ + /* _mesa_function_pool[18816]: GetVertexAttribdvARB (will be remapped) */ "iip\0" "glGetVertexAttribdv\0" "glGetVertexAttribdvARB\0" "\0" - /* _mesa_function_pool[18857]: TexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[18864]: TexBumpParameterivATI (will be remapped) */ "ip\0" "glTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[18885]: GetSeparableFilter (offset 359) */ + /* _mesa_function_pool[18892]: GetSeparableFilter (offset 359) */ "iiippp\0" "glGetSeparableFilter\0" "glGetSeparableFilterEXT\0" "\0" - /* _mesa_function_pool[18938]: Binormal3dEXT (dynamic) */ + /* _mesa_function_pool[18945]: Binormal3dEXT (dynamic) */ "ddd\0" "glBinormal3dEXT\0" "\0" - /* _mesa_function_pool[18959]: SpriteParameteriSGIX (dynamic) */ + /* _mesa_function_pool[18966]: SpriteParameteriSGIX (dynamic) */ "ii\0" "glSpriteParameteriSGIX\0" "\0" - /* _mesa_function_pool[18986]: RequestResidentProgramsNV (will be remapped) */ + /* _mesa_function_pool[18993]: RequestResidentProgramsNV (will be remapped) */ "ip\0" "glRequestResidentProgramsNV\0" "\0" - /* _mesa_function_pool[19018]: TagSampleBufferSGIX (dynamic) */ + /* _mesa_function_pool[19025]: TagSampleBufferSGIX (dynamic) */ "\0" "glTagSampleBufferSGIX\0" "\0" - /* _mesa_function_pool[19042]: TransformFeedbackVaryingsEXT (will be remapped) */ + /* _mesa_function_pool[19049]: TransformFeedbackVaryingsEXT (will be remapped) */ "iipi\0" "glTransformFeedbackVaryingsEXT\0" "glTransformFeedbackVaryings\0" "\0" - /* _mesa_function_pool[19107]: FeedbackBuffer (offset 194) */ + /* _mesa_function_pool[19114]: FeedbackBuffer (offset 194) */ "iip\0" "glFeedbackBuffer\0" "\0" - /* _mesa_function_pool[19129]: RasterPos2iv (offset 67) */ + /* _mesa_function_pool[19136]: RasterPos2iv (offset 67) */ "p\0" "glRasterPos2iv\0" "\0" - /* _mesa_function_pool[19147]: TexImage1D (offset 182) */ + /* _mesa_function_pool[19154]: TexImage1D (offset 182) */ "iiiiiiip\0" "glTexImage1D\0" "\0" - /* _mesa_function_pool[19170]: ListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[19177]: ListParameterivSGIX (dynamic) */ "iip\0" "glListParameterivSGIX\0" "\0" - /* _mesa_function_pool[19197]: MultiDrawElementsEXT (will be remapped) */ + /* _mesa_function_pool[19204]: MultiDrawElementsEXT (will be remapped) */ "ipipi\0" "glMultiDrawElements\0" "glMultiDrawElementsEXT\0" "\0" - /* _mesa_function_pool[19247]: Color3s (offset 17) */ + /* _mesa_function_pool[19254]: Color3s (offset 17) */ "iii\0" "glColor3s\0" "\0" - /* _mesa_function_pool[19262]: Uniform1ivARB (will be remapped) */ + /* _mesa_function_pool[19269]: Uniform1ivARB (will be remapped) */ "iip\0" "glUniform1iv\0" "glUniform1ivARB\0" "\0" - /* _mesa_function_pool[19296]: WindowPos2sMESA (will be remapped) */ + /* _mesa_function_pool[19303]: WindowPos2sMESA (will be remapped) */ "ii\0" "glWindowPos2s\0" "glWindowPos2sARB\0" "glWindowPos2sMESA\0" "\0" - /* _mesa_function_pool[19349]: WeightusvARB (dynamic) */ + /* _mesa_function_pool[19356]: WeightusvARB (dynamic) */ "ip\0" "glWeightusvARB\0" "\0" - /* _mesa_function_pool[19368]: TexCoordPointer (offset 320) */ + /* _mesa_function_pool[19375]: TexCoordPointer (offset 320) */ "iiip\0" "glTexCoordPointer\0" "\0" - /* _mesa_function_pool[19392]: FogCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[19399]: FogCoordPointerEXT (will be remapped) */ "iip\0" "glFogCoordPointer\0" "glFogCoordPointerEXT\0" "\0" - /* _mesa_function_pool[19436]: IndexMaterialEXT (dynamic) */ + /* _mesa_function_pool[19443]: IndexMaterialEXT (dynamic) */ "ii\0" "glIndexMaterialEXT\0" "\0" - /* _mesa_function_pool[19459]: Color3i (offset 15) */ + /* _mesa_function_pool[19466]: Color3i (offset 15) */ "iii\0" "glColor3i\0" "\0" - /* _mesa_function_pool[19474]: FrontFace (offset 157) */ + /* _mesa_function_pool[19481]: FrontFace (offset 157) */ "i\0" "glFrontFace\0" "\0" - /* _mesa_function_pool[19489]: EvalCoord2d (offset 232) */ + /* _mesa_function_pool[19496]: EvalCoord2d (offset 232) */ "dd\0" "glEvalCoord2d\0" "\0" - /* _mesa_function_pool[19507]: SecondaryColor3ubvEXT (will be remapped) */ + /* _mesa_function_pool[19514]: SecondaryColor3ubvEXT (will be remapped) */ "p\0" "glSecondaryColor3ubv\0" "glSecondaryColor3ubvEXT\0" "\0" - /* _mesa_function_pool[19555]: EvalCoord2f (offset 234) */ + /* _mesa_function_pool[19562]: EvalCoord2f (offset 234) */ "ff\0" "glEvalCoord2f\0" "\0" - /* _mesa_function_pool[19573]: VertexAttrib4dvARB (will be remapped) */ + /* _mesa_function_pool[19580]: VertexAttrib4dvARB (will be remapped) */ "ip\0" "glVertexAttrib4dv\0" "glVertexAttrib4dvARB\0" "\0" - /* _mesa_function_pool[19616]: BindAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[19623]: BindAttribLocationARB (will be remapped) */ "iip\0" "glBindAttribLocation\0" "glBindAttribLocationARB\0" "\0" - /* _mesa_function_pool[19666]: Color3b (offset 9) */ + /* _mesa_function_pool[19673]: Color3b (offset 9) */ "iii\0" "glColor3b\0" "\0" - /* _mesa_function_pool[19681]: MultiTexCoord2dARB (offset 384) */ + /* _mesa_function_pool[19688]: MultiTexCoord2dARB (offset 384) */ "idd\0" "glMultiTexCoord2d\0" "glMultiTexCoord2dARB\0" "\0" - /* _mesa_function_pool[19725]: ExecuteProgramNV (will be remapped) */ + /* _mesa_function_pool[19732]: ExecuteProgramNV (will be remapped) */ "iip\0" "glExecuteProgramNV\0" "\0" - /* _mesa_function_pool[19749]: Color3f (offset 13) */ + /* _mesa_function_pool[19756]: Color3f (offset 13) */ "fff\0" "glColor3f\0" "\0" - /* _mesa_function_pool[19764]: LightEnviSGIX (dynamic) */ + /* _mesa_function_pool[19771]: LightEnviSGIX (dynamic) */ "ii\0" "glLightEnviSGIX\0" "\0" - /* _mesa_function_pool[19784]: Color3d (offset 11) */ + /* _mesa_function_pool[19791]: Color3d (offset 11) */ "ddd\0" "glColor3d\0" "\0" - /* _mesa_function_pool[19799]: Normal3dv (offset 55) */ + /* _mesa_function_pool[19806]: Normal3dv (offset 55) */ "p\0" "glNormal3dv\0" "\0" - /* _mesa_function_pool[19814]: Lightf (offset 159) */ + /* _mesa_function_pool[19821]: Lightf (offset 159) */ "iif\0" "glLightf\0" "\0" - /* _mesa_function_pool[19828]: ReplacementCodeuiSUN (dynamic) */ + /* _mesa_function_pool[19835]: ReplacementCodeuiSUN (dynamic) */ "i\0" "glReplacementCodeuiSUN\0" "\0" - /* _mesa_function_pool[19854]: MatrixMode (offset 293) */ + /* _mesa_function_pool[19861]: MatrixMode (offset 293) */ "i\0" "glMatrixMode\0" "\0" - /* _mesa_function_pool[19870]: GetPixelMapusv (offset 273) */ + /* _mesa_function_pool[19877]: GetPixelMapusv (offset 273) */ "ip\0" "glGetPixelMapusv\0" "\0" - /* _mesa_function_pool[19891]: Lighti (offset 161) */ + /* _mesa_function_pool[19898]: Lighti (offset 161) */ "iii\0" "glLighti\0" "\0" - /* _mesa_function_pool[19905]: VertexAttribPointerNV (will be remapped) */ + /* _mesa_function_pool[19912]: VertexAttribPointerNV (will be remapped) */ "iiiip\0" "glVertexAttribPointerNV\0" "\0" - /* _mesa_function_pool[19936]: ProgramLocalParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[19943]: ProgramLocalParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramLocalParameters4fvEXT\0" "\0" - /* _mesa_function_pool[19973]: GetBooleanIndexedvEXT (will be remapped) */ + /* _mesa_function_pool[19980]: GetBooleanIndexedvEXT (will be remapped) */ "iip\0" "glGetBooleanIndexedvEXT\0" "\0" - /* _mesa_function_pool[20002]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ + /* _mesa_function_pool[20009]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ "iiip\0" "glGetFramebufferAttachmentParameteriv\0" "glGetFramebufferAttachmentParameterivEXT\0" "\0" - /* _mesa_function_pool[20087]: PixelTransformParameterfEXT (dynamic) */ + /* _mesa_function_pool[20094]: PixelTransformParameterfEXT (dynamic) */ "iif\0" "glPixelTransformParameterfEXT\0" "\0" - /* _mesa_function_pool[20122]: MultiTexCoord4dvARB (offset 401) */ + /* _mesa_function_pool[20129]: MultiTexCoord4dvARB (offset 401) */ "ip\0" "glMultiTexCoord4dv\0" "glMultiTexCoord4dvARB\0" "\0" - /* _mesa_function_pool[20167]: PixelTransformParameteriEXT (dynamic) */ + /* _mesa_function_pool[20174]: PixelTransformParameteriEXT (dynamic) */ "iii\0" "glPixelTransformParameteriEXT\0" "\0" - /* _mesa_function_pool[20202]: GetDoublev (offset 260) */ + /* _mesa_function_pool[20209]: GetDoublev (offset 260) */ "ip\0" "glGetDoublev\0" "\0" - /* _mesa_function_pool[20219]: MultMatrixd (offset 295) */ + /* _mesa_function_pool[20226]: MultMatrixd (offset 295) */ "p\0" "glMultMatrixd\0" "\0" - /* _mesa_function_pool[20236]: MultMatrixf (offset 294) */ + /* _mesa_function_pool[20243]: MultMatrixf (offset 294) */ "p\0" "glMultMatrixf\0" "\0" - /* _mesa_function_pool[20253]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[20260]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ "ffiiiifff\0" "glTexCoord2fColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[20296]: Uniform1iARB (will be remapped) */ + /* _mesa_function_pool[20303]: Uniform1iARB (will be remapped) */ "ii\0" "glUniform1i\0" "glUniform1iARB\0" "\0" - /* _mesa_function_pool[20327]: VertexAttribPointerARB (will be remapped) */ + /* _mesa_function_pool[20334]: VertexAttribPointerARB (will be remapped) */ "iiiiip\0" "glVertexAttribPointer\0" "glVertexAttribPointerARB\0" "\0" - /* _mesa_function_pool[20382]: VertexAttrib3sNV (will be remapped) */ + /* _mesa_function_pool[20389]: VertexAttrib3sNV (will be remapped) */ "iiii\0" "glVertexAttrib3sNV\0" "\0" - /* _mesa_function_pool[20407]: SharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[20414]: SharpenTexFuncSGIS (dynamic) */ "iip\0" "glSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[20433]: MultiTexCoord4fvARB (offset 403) */ + /* _mesa_function_pool[20440]: MultiTexCoord4fvARB (offset 403) */ "ip\0" "glMultiTexCoord4fv\0" "glMultiTexCoord4fvARB\0" "\0" - /* _mesa_function_pool[20478]: UniformMatrix2x3fv (will be remapped) */ + /* _mesa_function_pool[20485]: UniformMatrix2x3fv (will be remapped) */ "iiip\0" "glUniformMatrix2x3fv\0" "\0" - /* _mesa_function_pool[20505]: TrackMatrixNV (will be remapped) */ + /* _mesa_function_pool[20512]: TrackMatrixNV (will be remapped) */ "iiii\0" "glTrackMatrixNV\0" "\0" - /* _mesa_function_pool[20527]: CombinerParameteriNV (will be remapped) */ + /* _mesa_function_pool[20534]: CombinerParameteriNV (will be remapped) */ "ii\0" "glCombinerParameteriNV\0" "\0" - /* _mesa_function_pool[20554]: DeleteAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[20561]: DeleteAsyncMarkersSGIX (dynamic) */ "ii\0" "glDeleteAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[20583]: ReplacementCodeusSUN (dynamic) */ + /* _mesa_function_pool[20590]: ReplacementCodeusSUN (dynamic) */ "i\0" "glReplacementCodeusSUN\0" "\0" - /* _mesa_function_pool[20609]: IsAsyncMarkerSGIX (dynamic) */ + /* _mesa_function_pool[20616]: IsAsyncMarkerSGIX (dynamic) */ "i\0" "glIsAsyncMarkerSGIX\0" "\0" - /* _mesa_function_pool[20632]: FrameZoomSGIX (dynamic) */ + /* _mesa_function_pool[20639]: FrameZoomSGIX (dynamic) */ "i\0" "glFrameZoomSGIX\0" "\0" - /* _mesa_function_pool[20651]: Normal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[20658]: Normal3fVertex3fvSUN (dynamic) */ "pp\0" "glNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[20678]: RasterPos4sv (offset 85) */ + /* _mesa_function_pool[20685]: RasterPos4sv (offset 85) */ "p\0" "glRasterPos4sv\0" "\0" - /* _mesa_function_pool[20696]: VertexAttrib4NsvARB (will be remapped) */ + /* _mesa_function_pool[20703]: VertexAttrib4NsvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nsv\0" "glVertexAttrib4NsvARB\0" "\0" - /* _mesa_function_pool[20741]: VertexAttrib3fvARB (will be remapped) */ + /* _mesa_function_pool[20748]: VertexAttrib3fvARB (will be remapped) */ "ip\0" "glVertexAttrib3fv\0" "glVertexAttrib3fvARB\0" "\0" - /* _mesa_function_pool[20784]: ClearColor (offset 206) */ + /* _mesa_function_pool[20791]: ClearColor (offset 206) */ "ffff\0" "glClearColor\0" "\0" - /* _mesa_function_pool[20803]: GetSynciv (will be remapped) */ + /* _mesa_function_pool[20810]: GetSynciv (will be remapped) */ "iiipp\0" "glGetSynciv\0" "\0" - /* _mesa_function_pool[20822]: DeleteFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[20829]: DeleteFramebuffersEXT (will be remapped) */ "ip\0" "glDeleteFramebuffers\0" "glDeleteFramebuffersEXT\0" "\0" - /* _mesa_function_pool[20871]: GlobalAlphaFactorsSUN (dynamic) */ + /* _mesa_function_pool[20878]: GlobalAlphaFactorsSUN (dynamic) */ "i\0" "glGlobalAlphaFactorsSUN\0" "\0" - /* _mesa_function_pool[20898]: IsEnabledIndexedEXT (will be remapped) */ + /* _mesa_function_pool[20905]: IsEnabledIndexedEXT (will be remapped) */ "ii\0" "glIsEnabledIndexedEXT\0" "\0" - /* _mesa_function_pool[20924]: TexEnviv (offset 187) */ + /* _mesa_function_pool[20931]: TexEnviv (offset 187) */ "iip\0" "glTexEnviv\0" "\0" - /* _mesa_function_pool[20940]: TexSubImage3D (offset 372) */ + /* _mesa_function_pool[20947]: TexSubImage3D (offset 372) */ "iiiiiiiiiip\0" "glTexSubImage3D\0" "glTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[20988]: Tangent3fEXT (dynamic) */ + /* _mesa_function_pool[20995]: Tangent3fEXT (dynamic) */ "fff\0" "glTangent3fEXT\0" "\0" - /* _mesa_function_pool[21008]: SecondaryColor3uivEXT (will be remapped) */ + /* _mesa_function_pool[21015]: SecondaryColor3uivEXT (will be remapped) */ "p\0" "glSecondaryColor3uiv\0" "glSecondaryColor3uivEXT\0" "\0" - /* _mesa_function_pool[21056]: MatrixIndexubvARB (dynamic) */ + /* _mesa_function_pool[21063]: MatrixIndexubvARB (dynamic) */ "ip\0" "glMatrixIndexubvARB\0" "\0" - /* _mesa_function_pool[21080]: Color4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[21087]: Color4fNormal3fVertex3fSUN (dynamic) */ "ffffffffff\0" "glColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[21121]: PixelTexGenParameterfSGIS (will be remapped) */ + /* _mesa_function_pool[21128]: PixelTexGenParameterfSGIS (will be remapped) */ "if\0" "glPixelTexGenParameterfSGIS\0" "\0" - /* _mesa_function_pool[21153]: CreateShader (will be remapped) */ + /* _mesa_function_pool[21160]: CreateShader (will be remapped) */ "i\0" "glCreateShader\0" "\0" - /* _mesa_function_pool[21171]: GetColorTableParameterfv (offset 344) */ + /* _mesa_function_pool[21178]: GetColorTableParameterfv (offset 344) */ "iip\0" "glGetColorTableParameterfv\0" "glGetColorTableParameterfvSGI\0" "glGetColorTableParameterfvEXT\0" "\0" - /* _mesa_function_pool[21263]: FragmentLightModelfvSGIX (dynamic) */ + /* _mesa_function_pool[21270]: FragmentLightModelfvSGIX (dynamic) */ "ip\0" "glFragmentLightModelfvSGIX\0" "\0" - /* _mesa_function_pool[21294]: Bitmap (offset 8) */ + /* _mesa_function_pool[21301]: Bitmap (offset 8) */ "iiffffp\0" "glBitmap\0" "\0" - /* _mesa_function_pool[21312]: MultiTexCoord3fARB (offset 394) */ + /* _mesa_function_pool[21319]: MultiTexCoord3fARB (offset 394) */ "ifff\0" "glMultiTexCoord3f\0" "glMultiTexCoord3fARB\0" "\0" - /* _mesa_function_pool[21357]: GetTexLevelParameterfv (offset 284) */ + /* _mesa_function_pool[21364]: GetTexLevelParameterfv (offset 284) */ "iiip\0" "glGetTexLevelParameterfv\0" "\0" - /* _mesa_function_pool[21388]: GetPixelTexGenParameterfvSGIS (will be remapped) */ + /* _mesa_function_pool[21395]: GetPixelTexGenParameterfvSGIS (will be remapped) */ "ip\0" "glGetPixelTexGenParameterfvSGIS\0" "\0" - /* _mesa_function_pool[21424]: GenFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[21431]: GenFramebuffersEXT (will be remapped) */ "ip\0" "glGenFramebuffers\0" "glGenFramebuffersEXT\0" "\0" - /* _mesa_function_pool[21467]: GetProgramParameterdvNV (will be remapped) */ + /* _mesa_function_pool[21474]: GetProgramParameterdvNV (will be remapped) */ "iiip\0" "glGetProgramParameterdvNV\0" "\0" - /* _mesa_function_pool[21499]: Vertex2sv (offset 133) */ + /* _mesa_function_pool[21506]: Vertex2sv (offset 133) */ "p\0" "glVertex2sv\0" "\0" - /* _mesa_function_pool[21514]: GetIntegerv (offset 263) */ + /* _mesa_function_pool[21521]: GetIntegerv (offset 263) */ "ip\0" "glGetIntegerv\0" "\0" - /* _mesa_function_pool[21532]: IsVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[21539]: IsVertexArrayAPPLE (will be remapped) */ "i\0" "glIsVertexArray\0" "glIsVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[21572]: FragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[21579]: FragmentLightfvSGIX (dynamic) */ "iip\0" "glFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[21599]: DetachShader (will be remapped) */ + /* _mesa_function_pool[21606]: DetachShader (will be remapped) */ "ii\0" "glDetachShader\0" "\0" - /* _mesa_function_pool[21618]: VertexAttrib4NubARB (will be remapped) */ + /* _mesa_function_pool[21625]: VertexAttrib4NubARB (will be remapped) */ "iiiii\0" "glVertexAttrib4Nub\0" "glVertexAttrib4NubARB\0" "\0" - /* _mesa_function_pool[21666]: GetProgramEnvParameterfvARB (will be remapped) */ + /* _mesa_function_pool[21673]: GetProgramEnvParameterfvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterfvARB\0" "\0" - /* _mesa_function_pool[21701]: GetTrackMatrixivNV (will be remapped) */ + /* _mesa_function_pool[21708]: GetTrackMatrixivNV (will be remapped) */ "iiip\0" "glGetTrackMatrixivNV\0" "\0" - /* _mesa_function_pool[21728]: VertexAttrib3svNV (will be remapped) */ + /* _mesa_function_pool[21735]: VertexAttrib3svNV (will be remapped) */ "ip\0" "glVertexAttrib3svNV\0" "\0" - /* _mesa_function_pool[21752]: Uniform4fvARB (will be remapped) */ + /* _mesa_function_pool[21759]: Uniform4fvARB (will be remapped) */ "iip\0" "glUniform4fv\0" "glUniform4fvARB\0" "\0" - /* _mesa_function_pool[21786]: MultTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[21793]: MultTransposeMatrixfARB (will be remapped) */ "p\0" "glMultTransposeMatrixf\0" "glMultTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[21838]: GetTexEnviv (offset 277) */ + /* _mesa_function_pool[21845]: GetTexEnviv (offset 277) */ "iip\0" "glGetTexEnviv\0" "\0" - /* _mesa_function_pool[21857]: ColorFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[21864]: ColorFragmentOp1ATI (will be remapped) */ "iiiiiii\0" "glColorFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[21888]: GetUniformfvARB (will be remapped) */ + /* _mesa_function_pool[21895]: GetUniformfvARB (will be remapped) */ "iip\0" "glGetUniformfv\0" "glGetUniformfvARB\0" "\0" - /* _mesa_function_pool[21926]: EGLImageTargetRenderbufferStorageOES (will be remapped) */ + /* _mesa_function_pool[21933]: EGLImageTargetRenderbufferStorageOES (will be remapped) */ "ip\0" "glEGLImageTargetRenderbufferStorageOES\0" "\0" - /* _mesa_function_pool[21969]: PopClientAttrib (offset 334) */ + /* _mesa_function_pool[21976]: PopClientAttrib (offset 334) */ "\0" "glPopClientAttrib\0" "\0" - /* _mesa_function_pool[21989]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[21996]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffffff\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[22060]: DetachObjectARB (will be remapped) */ + /* _mesa_function_pool[22067]: DetachObjectARB (will be remapped) */ "ii\0" "glDetachObjectARB\0" "\0" - /* _mesa_function_pool[22082]: VertexBlendARB (dynamic) */ + /* _mesa_function_pool[22089]: VertexBlendARB (dynamic) */ "i\0" "glVertexBlendARB\0" "\0" - /* _mesa_function_pool[22102]: WindowPos3iMESA (will be remapped) */ + /* _mesa_function_pool[22109]: WindowPos3iMESA (will be remapped) */ "iii\0" "glWindowPos3i\0" "glWindowPos3iARB\0" "glWindowPos3iMESA\0" "\0" - /* _mesa_function_pool[22156]: SeparableFilter2D (offset 360) */ + /* _mesa_function_pool[22163]: SeparableFilter2D (offset 360) */ "iiiiiipp\0" "glSeparableFilter2D\0" "glSeparableFilter2DEXT\0" "\0" - /* _mesa_function_pool[22209]: ProgramParameteriARB (will be remapped) */ + /* _mesa_function_pool[22216]: ProgramParameteriARB (will be remapped) */ "iii\0" "glProgramParameteriARB\0" "\0" - /* _mesa_function_pool[22237]: Map1d (offset 220) */ + /* _mesa_function_pool[22244]: Map1d (offset 220) */ "iddiip\0" "glMap1d\0" "\0" - /* _mesa_function_pool[22253]: Map1f (offset 221) */ + /* _mesa_function_pool[22260]: Map1f (offset 221) */ "iffiip\0" "glMap1f\0" "\0" - /* _mesa_function_pool[22269]: CompressedTexImage2DARB (will be remapped) */ + /* _mesa_function_pool[22276]: CompressedTexImage2DARB (will be remapped) */ "iiiiiiip\0" "glCompressedTexImage2D\0" "glCompressedTexImage2DARB\0" "\0" - /* _mesa_function_pool[22328]: ArrayElement (offset 306) */ + /* _mesa_function_pool[22335]: ArrayElement (offset 306) */ "i\0" "glArrayElement\0" "glArrayElementEXT\0" "\0" - /* _mesa_function_pool[22364]: TexImage2D (offset 183) */ + /* _mesa_function_pool[22371]: TexImage2D (offset 183) */ "iiiiiiiip\0" "glTexImage2D\0" "\0" - /* _mesa_function_pool[22388]: DepthBoundsEXT (will be remapped) */ + /* _mesa_function_pool[22395]: DepthBoundsEXT (will be remapped) */ "dd\0" "glDepthBoundsEXT\0" "\0" - /* _mesa_function_pool[22409]: ProgramParameters4fvNV (will be remapped) */ + /* _mesa_function_pool[22416]: ProgramParameters4fvNV (will be remapped) */ "iiip\0" "glProgramParameters4fvNV\0" "\0" - /* _mesa_function_pool[22440]: DeformationMap3fSGIX (dynamic) */ + /* _mesa_function_pool[22447]: DeformationMap3fSGIX (dynamic) */ "iffiiffiiffiip\0" "glDeformationMap3fSGIX\0" "\0" - /* _mesa_function_pool[22479]: GetProgramivNV (will be remapped) */ + /* _mesa_function_pool[22486]: GetProgramivNV (will be remapped) */ "iip\0" "glGetProgramivNV\0" "\0" - /* _mesa_function_pool[22501]: GetMinmaxParameteriv (offset 366) */ + /* _mesa_function_pool[22508]: GetMinmaxParameteriv (offset 366) */ "iip\0" "glGetMinmaxParameteriv\0" "glGetMinmaxParameterivEXT\0" "\0" - /* _mesa_function_pool[22555]: PixelTransferf (offset 247) */ + /* _mesa_function_pool[22562]: PixelTransferf (offset 247) */ "if\0" "glPixelTransferf\0" "\0" - /* _mesa_function_pool[22576]: CopyTexImage1D (offset 323) */ + /* _mesa_function_pool[22583]: CopyTexImage1D (offset 323) */ "iiiiiii\0" "glCopyTexImage1D\0" "glCopyTexImage1DEXT\0" "\0" - /* _mesa_function_pool[22622]: PushMatrix (offset 298) */ + /* _mesa_function_pool[22629]: PushMatrix (offset 298) */ "\0" "glPushMatrix\0" "\0" - /* _mesa_function_pool[22637]: Fogiv (offset 156) */ + /* _mesa_function_pool[22644]: Fogiv (offset 156) */ "ip\0" "glFogiv\0" "\0" - /* _mesa_function_pool[22649]: TexCoord1dv (offset 95) */ + /* _mesa_function_pool[22656]: TexCoord1dv (offset 95) */ "p\0" "glTexCoord1dv\0" "\0" - /* _mesa_function_pool[22666]: AlphaFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[22673]: AlphaFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiii\0" "glAlphaFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[22702]: PixelTransferi (offset 248) */ + /* _mesa_function_pool[22709]: PixelTransferi (offset 248) */ "ii\0" "glPixelTransferi\0" "\0" - /* _mesa_function_pool[22723]: GetVertexAttribdvNV (will be remapped) */ + /* _mesa_function_pool[22730]: GetVertexAttribdvNV (will be remapped) */ "iip\0" "glGetVertexAttribdvNV\0" "\0" - /* _mesa_function_pool[22750]: VertexAttrib3fvNV (will be remapped) */ + /* _mesa_function_pool[22757]: VertexAttrib3fvNV (will be remapped) */ "ip\0" "glVertexAttrib3fvNV\0" "\0" - /* _mesa_function_pool[22774]: Rotatef (offset 300) */ + /* _mesa_function_pool[22781]: Rotatef (offset 300) */ "ffff\0" "glRotatef\0" "\0" - /* _mesa_function_pool[22790]: GetFinalCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[22797]: GetFinalCombinerInputParameterivNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[22832]: Vertex3i (offset 138) */ + /* _mesa_function_pool[22839]: Vertex3i (offset 138) */ "iii\0" "glVertex3i\0" "\0" - /* _mesa_function_pool[22848]: Vertex3f (offset 136) */ + /* _mesa_function_pool[22855]: Vertex3f (offset 136) */ "fff\0" "glVertex3f\0" "\0" - /* _mesa_function_pool[22864]: Clear (offset 203) */ + /* _mesa_function_pool[22871]: Clear (offset 203) */ "i\0" "glClear\0" "\0" - /* _mesa_function_pool[22875]: Vertex3d (offset 134) */ + /* _mesa_function_pool[22882]: Vertex3d (offset 134) */ "ddd\0" "glVertex3d\0" "\0" - /* _mesa_function_pool[22891]: GetMapParameterivNV (dynamic) */ + /* _mesa_function_pool[22898]: GetMapParameterivNV (dynamic) */ "iip\0" "glGetMapParameterivNV\0" "\0" - /* _mesa_function_pool[22918]: Uniform4iARB (will be remapped) */ + /* _mesa_function_pool[22925]: Uniform4iARB (will be remapped) */ "iiiii\0" "glUniform4i\0" "glUniform4iARB\0" "\0" - /* _mesa_function_pool[22952]: ReadBuffer (offset 254) */ + /* _mesa_function_pool[22959]: ReadBuffer (offset 254) */ "i\0" "glReadBuffer\0" "\0" - /* _mesa_function_pool[22968]: ConvolutionParameteri (offset 352) */ + /* _mesa_function_pool[22975]: ConvolutionParameteri (offset 352) */ "iii\0" "glConvolutionParameteri\0" "glConvolutionParameteriEXT\0" "\0" - /* _mesa_function_pool[23024]: Ortho (offset 296) */ + /* _mesa_function_pool[23031]: Ortho (offset 296) */ "dddddd\0" "glOrtho\0" "\0" - /* _mesa_function_pool[23040]: Binormal3sEXT (dynamic) */ + /* _mesa_function_pool[23047]: Binormal3sEXT (dynamic) */ "iii\0" "glBinormal3sEXT\0" "\0" - /* _mesa_function_pool[23061]: ListBase (offset 6) */ + /* _mesa_function_pool[23068]: ListBase (offset 6) */ "i\0" "glListBase\0" "\0" - /* _mesa_function_pool[23075]: Vertex3s (offset 140) */ + /* _mesa_function_pool[23082]: Vertex3s (offset 140) */ "iii\0" "glVertex3s\0" "\0" - /* _mesa_function_pool[23091]: ConvolutionParameterf (offset 350) */ + /* _mesa_function_pool[23098]: ConvolutionParameterf (offset 350) */ "iif\0" "glConvolutionParameterf\0" "glConvolutionParameterfEXT\0" "\0" - /* _mesa_function_pool[23147]: GetColorTableParameteriv (offset 345) */ + /* _mesa_function_pool[23154]: GetColorTableParameteriv (offset 345) */ "iip\0" "glGetColorTableParameteriv\0" "glGetColorTableParameterivSGI\0" "glGetColorTableParameterivEXT\0" "\0" - /* _mesa_function_pool[23239]: ProgramEnvParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[23246]: ProgramEnvParameter4dvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4dvARB\0" "glProgramParameter4dvNV\0" "\0" - /* _mesa_function_pool[23296]: ShadeModel (offset 177) */ + /* _mesa_function_pool[23303]: ShadeModel (offset 177) */ "i\0" "glShadeModel\0" "\0" - /* _mesa_function_pool[23312]: VertexAttribs2fvNV (will be remapped) */ + /* _mesa_function_pool[23319]: VertexAttribs2fvNV (will be remapped) */ "iip\0" "glVertexAttribs2fvNV\0" "\0" - /* _mesa_function_pool[23338]: Rectiv (offset 91) */ + /* _mesa_function_pool[23345]: Rectiv (offset 91) */ "pp\0" "glRectiv\0" "\0" - /* _mesa_function_pool[23351]: UseProgramObjectARB (will be remapped) */ + /* _mesa_function_pool[23358]: UseProgramObjectARB (will be remapped) */ "i\0" "glUseProgram\0" "glUseProgramObjectARB\0" "\0" - /* _mesa_function_pool[23389]: GetMapParameterfvNV (dynamic) */ + /* _mesa_function_pool[23396]: GetMapParameterfvNV (dynamic) */ "iip\0" "glGetMapParameterfvNV\0" "\0" - /* _mesa_function_pool[23416]: EndConditionalRenderNV (will be remapped) */ + /* _mesa_function_pool[23423]: EndConditionalRenderNV (will be remapped) */ "\0" "glEndConditionalRenderNV\0" "\0" - /* _mesa_function_pool[23443]: PassTexCoordATI (will be remapped) */ + /* _mesa_function_pool[23450]: PassTexCoordATI (will be remapped) */ "iii\0" "glPassTexCoordATI\0" "\0" - /* _mesa_function_pool[23466]: DeleteProgram (will be remapped) */ + /* _mesa_function_pool[23473]: DeleteProgram (will be remapped) */ "i\0" "glDeleteProgram\0" "\0" - /* _mesa_function_pool[23485]: Tangent3ivEXT (dynamic) */ + /* _mesa_function_pool[23492]: Tangent3ivEXT (dynamic) */ "p\0" "glTangent3ivEXT\0" "\0" - /* _mesa_function_pool[23504]: Tangent3dEXT (dynamic) */ + /* _mesa_function_pool[23511]: Tangent3dEXT (dynamic) */ "ddd\0" "glTangent3dEXT\0" "\0" - /* _mesa_function_pool[23524]: SecondaryColor3dvEXT (will be remapped) */ + /* _mesa_function_pool[23531]: SecondaryColor3dvEXT (will be remapped) */ "p\0" "glSecondaryColor3dv\0" "glSecondaryColor3dvEXT\0" "\0" - /* _mesa_function_pool[23570]: Vertex2fv (offset 129) */ + /* _mesa_function_pool[23577]: Vertex2fv (offset 129) */ "p\0" "glVertex2fv\0" "\0" - /* _mesa_function_pool[23585]: MultiDrawArraysEXT (will be remapped) */ + /* _mesa_function_pool[23592]: MultiDrawArraysEXT (will be remapped) */ "ippi\0" "glMultiDrawArrays\0" "glMultiDrawArraysEXT\0" "\0" - /* _mesa_function_pool[23630]: BindRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[23637]: BindRenderbufferEXT (will be remapped) */ "ii\0" "glBindRenderbuffer\0" "glBindRenderbufferEXT\0" "\0" - /* _mesa_function_pool[23675]: MultiTexCoord4dARB (offset 400) */ + /* _mesa_function_pool[23682]: MultiTexCoord4dARB (offset 400) */ "idddd\0" "glMultiTexCoord4d\0" "glMultiTexCoord4dARB\0" "\0" - /* _mesa_function_pool[23721]: FramebufferTextureFaceARB (will be remapped) */ + /* _mesa_function_pool[23728]: FramebufferTextureFaceARB (will be remapped) */ "iiiii\0" "glFramebufferTextureFaceARB\0" "\0" - /* _mesa_function_pool[23756]: Vertex3sv (offset 141) */ + /* _mesa_function_pool[23763]: Vertex3sv (offset 141) */ "p\0" "glVertex3sv\0" "\0" - /* _mesa_function_pool[23771]: SecondaryColor3usEXT (will be remapped) */ + /* _mesa_function_pool[23778]: SecondaryColor3usEXT (will be remapped) */ "iii\0" "glSecondaryColor3us\0" "glSecondaryColor3usEXT\0" "\0" - /* _mesa_function_pool[23819]: ProgramLocalParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[23826]: ProgramLocalParameter4fvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4fvARB\0" "\0" - /* _mesa_function_pool[23854]: DeleteProgramsNV (will be remapped) */ + /* _mesa_function_pool[23861]: DeleteProgramsNV (will be remapped) */ "ip\0" "glDeleteProgramsARB\0" "glDeleteProgramsNV\0" "\0" - /* _mesa_function_pool[23897]: EvalMesh1 (offset 236) */ + /* _mesa_function_pool[23904]: EvalMesh1 (offset 236) */ "iii\0" "glEvalMesh1\0" "\0" - /* _mesa_function_pool[23914]: PauseTransformFeedback (will be remapped) */ + /* _mesa_function_pool[23921]: PauseTransformFeedback (will be remapped) */ "\0" "glPauseTransformFeedback\0" "\0" - /* _mesa_function_pool[23941]: MultiTexCoord1sARB (offset 382) */ + /* _mesa_function_pool[23948]: MultiTexCoord1sARB (offset 382) */ "ii\0" "glMultiTexCoord1s\0" "glMultiTexCoord1sARB\0" "\0" - /* _mesa_function_pool[23984]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[23991]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ "iffffff\0" "glReplacementCodeuiColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[24031]: GetVertexAttribPointervNV (will be remapped) */ + /* _mesa_function_pool[24038]: GetVertexAttribPointervNV (will be remapped) */ "iip\0" "glGetVertexAttribPointerv\0" "glGetVertexAttribPointervARB\0" "glGetVertexAttribPointervNV\0" "\0" - /* _mesa_function_pool[24119]: VertexAttribs1fvNV (will be remapped) */ + /* _mesa_function_pool[24126]: VertexAttribs1fvNV (will be remapped) */ "iip\0" "glVertexAttribs1fvNV\0" "\0" - /* _mesa_function_pool[24145]: MultiTexCoord1dvARB (offset 377) */ + /* _mesa_function_pool[24152]: MultiTexCoord1dvARB (offset 377) */ "ip\0" "glMultiTexCoord1dv\0" "glMultiTexCoord1dvARB\0" "\0" - /* _mesa_function_pool[24190]: Uniform2iARB (will be remapped) */ + /* _mesa_function_pool[24197]: Uniform2iARB (will be remapped) */ "iii\0" "glUniform2i\0" "glUniform2iARB\0" "\0" - /* _mesa_function_pool[24222]: Vertex2iv (offset 131) */ + /* _mesa_function_pool[24229]: Vertex2iv (offset 131) */ "p\0" "glVertex2iv\0" "\0" - /* _mesa_function_pool[24237]: GetProgramStringNV (will be remapped) */ + /* _mesa_function_pool[24244]: GetProgramStringNV (will be remapped) */ "iip\0" "glGetProgramStringNV\0" "\0" - /* _mesa_function_pool[24263]: ColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[24270]: ColorPointerEXT (will be remapped) */ "iiiip\0" "glColorPointerEXT\0" "\0" - /* _mesa_function_pool[24288]: LineWidth (offset 168) */ + /* _mesa_function_pool[24295]: LineWidth (offset 168) */ "f\0" "glLineWidth\0" "\0" - /* _mesa_function_pool[24303]: MapBufferARB (will be remapped) */ + /* _mesa_function_pool[24310]: MapBufferARB (will be remapped) */ "ii\0" "glMapBuffer\0" "glMapBufferARB\0" "\0" - /* _mesa_function_pool[24334]: MultiDrawElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[24341]: MultiDrawElementsBaseVertex (will be remapped) */ "ipipip\0" "glMultiDrawElementsBaseVertex\0" "\0" - /* _mesa_function_pool[24372]: Binormal3svEXT (dynamic) */ + /* _mesa_function_pool[24379]: Binormal3svEXT (dynamic) */ "p\0" "glBinormal3svEXT\0" "\0" - /* _mesa_function_pool[24392]: ApplyTextureEXT (dynamic) */ + /* _mesa_function_pool[24399]: ApplyTextureEXT (dynamic) */ "i\0" "glApplyTextureEXT\0" "\0" - /* _mesa_function_pool[24413]: TexGendv (offset 189) */ + /* _mesa_function_pool[24420]: TexGendv (offset 189) */ "iip\0" "glTexGendv\0" "\0" - /* _mesa_function_pool[24429]: EnableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[24436]: EnableIndexedEXT (will be remapped) */ "ii\0" "glEnableIndexedEXT\0" "\0" - /* _mesa_function_pool[24452]: TextureMaterialEXT (dynamic) */ + /* _mesa_function_pool[24459]: TextureMaterialEXT (dynamic) */ "ii\0" "glTextureMaterialEXT\0" "\0" - /* _mesa_function_pool[24477]: TextureLightEXT (dynamic) */ + /* _mesa_function_pool[24484]: TextureLightEXT (dynamic) */ "i\0" "glTextureLightEXT\0" "\0" - /* _mesa_function_pool[24498]: ResetMinmax (offset 370) */ + /* _mesa_function_pool[24505]: ResetMinmax (offset 370) */ "i\0" "glResetMinmax\0" "glResetMinmaxEXT\0" "\0" - /* _mesa_function_pool[24532]: SpriteParameterfSGIX (dynamic) */ + /* _mesa_function_pool[24539]: SpriteParameterfSGIX (dynamic) */ "if\0" "glSpriteParameterfSGIX\0" "\0" - /* _mesa_function_pool[24559]: EnableClientState (offset 313) */ + /* _mesa_function_pool[24566]: EnableClientState (offset 313) */ "i\0" "glEnableClientState\0" "\0" - /* _mesa_function_pool[24582]: VertexAttrib4sNV (will be remapped) */ + /* _mesa_function_pool[24589]: VertexAttrib4sNV (will be remapped) */ "iiiii\0" "glVertexAttrib4sNV\0" "\0" - /* _mesa_function_pool[24608]: GetConvolutionParameterfv (offset 357) */ + /* _mesa_function_pool[24615]: GetConvolutionParameterfv (offset 357) */ "iip\0" "glGetConvolutionParameterfv\0" "glGetConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[24672]: VertexAttribs4dvNV (will be remapped) */ + /* _mesa_function_pool[24679]: VertexAttribs4dvNV (will be remapped) */ "iip\0" "glVertexAttribs4dvNV\0" "\0" - /* _mesa_function_pool[24698]: VertexAttrib4dARB (will be remapped) */ + /* _mesa_function_pool[24705]: MultiModeDrawArraysIBM (will be remapped) */ + "pppii\0" + "glMultiModeDrawArraysIBM\0" + "\0" + /* _mesa_function_pool[24737]: VertexAttrib4dARB (will be remapped) */ "idddd\0" "glVertexAttrib4d\0" "glVertexAttrib4dARB\0" "\0" - /* _mesa_function_pool[24742]: GetTexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[24781]: GetTexBumpParameterfvATI (will be remapped) */ "ip\0" "glGetTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[24773]: ProgramNamedParameter4dNV (will be remapped) */ + /* _mesa_function_pool[24812]: ProgramNamedParameter4dNV (will be remapped) */ "iipdddd\0" "glProgramNamedParameter4dNV\0" "\0" - /* _mesa_function_pool[24810]: GetMaterialfv (offset 269) */ + /* _mesa_function_pool[24849]: GetMaterialfv (offset 269) */ "iip\0" "glGetMaterialfv\0" "\0" - /* _mesa_function_pool[24831]: VertexWeightfEXT (dynamic) */ + /* _mesa_function_pool[24870]: VertexWeightfEXT (dynamic) */ "f\0" "glVertexWeightfEXT\0" "\0" - /* _mesa_function_pool[24853]: Binormal3fEXT (dynamic) */ + /* _mesa_function_pool[24892]: Binormal3fEXT (dynamic) */ "fff\0" "glBinormal3fEXT\0" "\0" - /* _mesa_function_pool[24874]: CallList (offset 2) */ + /* _mesa_function_pool[24913]: CallList (offset 2) */ "i\0" "glCallList\0" "\0" - /* _mesa_function_pool[24888]: Materialfv (offset 170) */ + /* _mesa_function_pool[24927]: Materialfv (offset 170) */ "iip\0" "glMaterialfv\0" "\0" - /* _mesa_function_pool[24906]: TexCoord3fv (offset 113) */ + /* _mesa_function_pool[24945]: TexCoord3fv (offset 113) */ "p\0" "glTexCoord3fv\0" "\0" - /* _mesa_function_pool[24923]: FogCoordfvEXT (will be remapped) */ + /* _mesa_function_pool[24962]: FogCoordfvEXT (will be remapped) */ "p\0" "glFogCoordfv\0" "glFogCoordfvEXT\0" "\0" - /* _mesa_function_pool[24955]: MultiTexCoord1ivARB (offset 381) */ + /* _mesa_function_pool[24994]: MultiTexCoord1ivARB (offset 381) */ "ip\0" "glMultiTexCoord1iv\0" "glMultiTexCoord1ivARB\0" "\0" - /* _mesa_function_pool[25000]: SecondaryColor3ubEXT (will be remapped) */ + /* _mesa_function_pool[25039]: SecondaryColor3ubEXT (will be remapped) */ "iii\0" "glSecondaryColor3ub\0" "glSecondaryColor3ubEXT\0" "\0" - /* _mesa_function_pool[25048]: MultiTexCoord2ivARB (offset 389) */ + /* _mesa_function_pool[25087]: MultiTexCoord2ivARB (offset 389) */ "ip\0" "glMultiTexCoord2iv\0" "glMultiTexCoord2ivARB\0" "\0" - /* _mesa_function_pool[25093]: FogFuncSGIS (dynamic) */ + /* _mesa_function_pool[25132]: FogFuncSGIS (dynamic) */ "ip\0" "glFogFuncSGIS\0" "\0" - /* _mesa_function_pool[25111]: CopyTexSubImage2D (offset 326) */ + /* _mesa_function_pool[25150]: CopyTexSubImage2D (offset 326) */ "iiiiiiii\0" "glCopyTexSubImage2D\0" "glCopyTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[25164]: GetObjectParameterivARB (will be remapped) */ + /* _mesa_function_pool[25203]: GetObjectParameterivARB (will be remapped) */ "iip\0" "glGetObjectParameterivARB\0" "\0" - /* _mesa_function_pool[25195]: Color3iv (offset 16) */ + /* _mesa_function_pool[25234]: Color3iv (offset 16) */ "p\0" "glColor3iv\0" "\0" - /* _mesa_function_pool[25209]: TexCoord4fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[25248]: TexCoord4fVertex4fSUN (dynamic) */ "ffffffff\0" "glTexCoord4fVertex4fSUN\0" "\0" - /* _mesa_function_pool[25243]: DrawElements (offset 311) */ + /* _mesa_function_pool[25282]: DrawElements (offset 311) */ "iiip\0" "glDrawElements\0" "\0" - /* _mesa_function_pool[25264]: BindVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[25303]: BindVertexArrayAPPLE (will be remapped) */ "i\0" "glBindVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[25290]: GetProgramLocalParameterdvARB (will be remapped) */ + /* _mesa_function_pool[25329]: GetProgramLocalParameterdvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterdvARB\0" "\0" - /* _mesa_function_pool[25327]: GetHistogramParameteriv (offset 363) */ + /* _mesa_function_pool[25366]: GetHistogramParameteriv (offset 363) */ "iip\0" "glGetHistogramParameteriv\0" "glGetHistogramParameterivEXT\0" "\0" - /* _mesa_function_pool[25387]: MultiTexCoord1iARB (offset 380) */ + /* _mesa_function_pool[25426]: MultiTexCoord1iARB (offset 380) */ "ii\0" "glMultiTexCoord1i\0" "glMultiTexCoord1iARB\0" "\0" - /* _mesa_function_pool[25430]: GetConvolutionFilter (offset 356) */ + /* _mesa_function_pool[25469]: GetConvolutionFilter (offset 356) */ "iiip\0" "glGetConvolutionFilter\0" "glGetConvolutionFilterEXT\0" "\0" - /* _mesa_function_pool[25485]: GetProgramivARB (will be remapped) */ + /* _mesa_function_pool[25524]: GetProgramivARB (will be remapped) */ "iip\0" "glGetProgramivARB\0" "\0" - /* _mesa_function_pool[25508]: BlendFuncSeparateEXT (will be remapped) */ + /* _mesa_function_pool[25547]: BlendFuncSeparateEXT (will be remapped) */ "iiii\0" "glBlendFuncSeparate\0" "glBlendFuncSeparateEXT\0" "glBlendFuncSeparateINGR\0" "\0" - /* _mesa_function_pool[25581]: MapBufferRange (will be remapped) */ + /* _mesa_function_pool[25620]: MapBufferRange (will be remapped) */ "iiii\0" "glMapBufferRange\0" "\0" - /* _mesa_function_pool[25604]: ProgramParameters4dvNV (will be remapped) */ + /* _mesa_function_pool[25643]: ProgramParameters4dvNV (will be remapped) */ "iiip\0" "glProgramParameters4dvNV\0" "\0" - /* _mesa_function_pool[25635]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[25674]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[25672]: EvalPoint2 (offset 239) */ + /* _mesa_function_pool[25711]: EvalPoint2 (offset 239) */ "ii\0" "glEvalPoint2\0" "\0" - /* _mesa_function_pool[25689]: EvalPoint1 (offset 237) */ + /* _mesa_function_pool[25728]: EvalPoint1 (offset 237) */ "i\0" "glEvalPoint1\0" "\0" - /* _mesa_function_pool[25705]: Binormal3dvEXT (dynamic) */ + /* _mesa_function_pool[25744]: Binormal3dvEXT (dynamic) */ "p\0" "glBinormal3dvEXT\0" "\0" - /* _mesa_function_pool[25725]: PopMatrix (offset 297) */ + /* _mesa_function_pool[25764]: PopMatrix (offset 297) */ "\0" "glPopMatrix\0" "\0" - /* _mesa_function_pool[25739]: FinishFenceNV (will be remapped) */ + /* _mesa_function_pool[25778]: FinishFenceNV (will be remapped) */ "i\0" "glFinishFenceNV\0" "\0" - /* _mesa_function_pool[25758]: GetFogFuncSGIS (dynamic) */ + /* _mesa_function_pool[25797]: GetFogFuncSGIS (dynamic) */ "p\0" "glGetFogFuncSGIS\0" "\0" - /* _mesa_function_pool[25778]: GetUniformLocationARB (will be remapped) */ + /* _mesa_function_pool[25817]: GetUniformLocationARB (will be remapped) */ "ip\0" "glGetUniformLocation\0" "glGetUniformLocationARB\0" "\0" - /* _mesa_function_pool[25827]: SecondaryColor3fEXT (will be remapped) */ + /* _mesa_function_pool[25866]: SecondaryColor3fEXT (will be remapped) */ "fff\0" "glSecondaryColor3f\0" "glSecondaryColor3fEXT\0" "\0" - /* _mesa_function_pool[25873]: GetTexGeniv (offset 280) */ + /* _mesa_function_pool[25912]: GetTexGeniv (offset 280) */ "iip\0" "glGetTexGeniv\0" "\0" - /* _mesa_function_pool[25892]: CombinerInputNV (will be remapped) */ + /* _mesa_function_pool[25931]: CombinerInputNV (will be remapped) */ "iiiiii\0" "glCombinerInputNV\0" "\0" - /* _mesa_function_pool[25918]: VertexAttrib3sARB (will be remapped) */ + /* _mesa_function_pool[25957]: VertexAttrib3sARB (will be remapped) */ "iiii\0" "glVertexAttrib3s\0" "glVertexAttrib3sARB\0" "\0" - /* _mesa_function_pool[25961]: IsTransformFeedback (will be remapped) */ + /* _mesa_function_pool[26000]: IsTransformFeedback (will be remapped) */ "i\0" "glIsTransformFeedback\0" "\0" - /* _mesa_function_pool[25986]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[26025]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[26031]: Map2d (offset 222) */ + /* _mesa_function_pool[26070]: Map2d (offset 222) */ "iddiiddiip\0" "glMap2d\0" "\0" - /* _mesa_function_pool[26051]: Map2f (offset 223) */ + /* _mesa_function_pool[26090]: Map2f (offset 223) */ "iffiiffiip\0" "glMap2f\0" "\0" - /* _mesa_function_pool[26071]: ProgramStringARB (will be remapped) */ + /* _mesa_function_pool[26110]: ProgramStringARB (will be remapped) */ "iiip\0" "glProgramStringARB\0" "\0" - /* _mesa_function_pool[26096]: Vertex4s (offset 148) */ + /* _mesa_function_pool[26135]: Vertex4s (offset 148) */ "iiii\0" "glVertex4s\0" "\0" - /* _mesa_function_pool[26113]: TexCoord4fVertex4fvSUN (dynamic) */ + /* _mesa_function_pool[26152]: TexCoord4fVertex4fvSUN (dynamic) */ "pp\0" "glTexCoord4fVertex4fvSUN\0" "\0" - /* _mesa_function_pool[26142]: FragmentLightModelivSGIX (dynamic) */ + /* _mesa_function_pool[26181]: FragmentLightModelivSGIX (dynamic) */ "ip\0" "glFragmentLightModelivSGIX\0" "\0" - /* _mesa_function_pool[26173]: VertexAttrib1fNV (will be remapped) */ + /* _mesa_function_pool[26212]: VertexAttrib1fNV (will be remapped) */ "if\0" "glVertexAttrib1fNV\0" "\0" - /* _mesa_function_pool[26196]: Vertex4f (offset 144) */ + /* _mesa_function_pool[26235]: Vertex4f (offset 144) */ "ffff\0" "glVertex4f\0" "\0" - /* _mesa_function_pool[26213]: EvalCoord1d (offset 228) */ + /* _mesa_function_pool[26252]: EvalCoord1d (offset 228) */ "d\0" "glEvalCoord1d\0" "\0" - /* _mesa_function_pool[26230]: Vertex4d (offset 142) */ + /* _mesa_function_pool[26269]: Vertex4d (offset 142) */ "dddd\0" "glVertex4d\0" "\0" - /* _mesa_function_pool[26247]: RasterPos4dv (offset 79) */ + /* _mesa_function_pool[26286]: RasterPos4dv (offset 79) */ "p\0" "glRasterPos4dv\0" "\0" - /* _mesa_function_pool[26265]: FragmentLightfSGIX (dynamic) */ + /* _mesa_function_pool[26304]: FragmentLightfSGIX (dynamic) */ "iif\0" "glFragmentLightfSGIX\0" "\0" - /* _mesa_function_pool[26291]: GetCompressedTexImageARB (will be remapped) */ + /* _mesa_function_pool[26330]: GetCompressedTexImageARB (will be remapped) */ "iip\0" "glGetCompressedTexImage\0" "glGetCompressedTexImageARB\0" "\0" - /* _mesa_function_pool[26347]: GetTexGenfv (offset 279) */ + /* _mesa_function_pool[26386]: GetTexGenfv (offset 279) */ "iip\0" "glGetTexGenfv\0" "\0" - /* _mesa_function_pool[26366]: Vertex4i (offset 146) */ + /* _mesa_function_pool[26405]: Vertex4i (offset 146) */ "iiii\0" "glVertex4i\0" "\0" - /* _mesa_function_pool[26383]: VertexWeightPointerEXT (dynamic) */ + /* _mesa_function_pool[26422]: VertexWeightPointerEXT (dynamic) */ "iiip\0" "glVertexWeightPointerEXT\0" "\0" - /* _mesa_function_pool[26414]: GetHistogram (offset 361) */ + /* _mesa_function_pool[26453]: GetHistogram (offset 361) */ "iiiip\0" "glGetHistogram\0" "glGetHistogramEXT\0" "\0" - /* _mesa_function_pool[26454]: ActiveStencilFaceEXT (will be remapped) */ + /* _mesa_function_pool[26493]: ActiveStencilFaceEXT (will be remapped) */ "i\0" "glActiveStencilFaceEXT\0" "\0" - /* _mesa_function_pool[26480]: StencilFuncSeparateATI (will be remapped) */ + /* _mesa_function_pool[26519]: StencilFuncSeparateATI (will be remapped) */ "iiii\0" "glStencilFuncSeparateATI\0" "\0" - /* _mesa_function_pool[26511]: Materialf (offset 169) */ + /* _mesa_function_pool[26550]: Materialf (offset 169) */ "iif\0" "glMaterialf\0" "\0" - /* _mesa_function_pool[26528]: GetShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[26567]: GetShaderSourceARB (will be remapped) */ "iipp\0" "glGetShaderSource\0" "glGetShaderSourceARB\0" "\0" - /* _mesa_function_pool[26573]: IglooInterfaceSGIX (dynamic) */ + /* _mesa_function_pool[26612]: IglooInterfaceSGIX (dynamic) */ "ip\0" "glIglooInterfaceSGIX\0" "\0" - /* _mesa_function_pool[26598]: Materiali (offset 171) */ + /* _mesa_function_pool[26637]: Materiali (offset 171) */ "iii\0" "glMateriali\0" "\0" - /* _mesa_function_pool[26615]: VertexAttrib4dNV (will be remapped) */ + /* _mesa_function_pool[26654]: VertexAttrib4dNV (will be remapped) */ "idddd\0" "glVertexAttrib4dNV\0" "\0" - /* _mesa_function_pool[26641]: MultiModeDrawElementsIBM (will be remapped) */ + /* _mesa_function_pool[26680]: MultiModeDrawElementsIBM (will be remapped) */ "ppipii\0" "glMultiModeDrawElementsIBM\0" "\0" - /* _mesa_function_pool[26676]: Indexsv (offset 51) */ + /* _mesa_function_pool[26715]: Indexsv (offset 51) */ "p\0" "glIndexsv\0" "\0" - /* _mesa_function_pool[26689]: MultiTexCoord4svARB (offset 407) */ + /* _mesa_function_pool[26728]: MultiTexCoord4svARB (offset 407) */ "ip\0" "glMultiTexCoord4sv\0" "glMultiTexCoord4svARB\0" "\0" - /* _mesa_function_pool[26734]: LightModelfv (offset 164) */ + /* _mesa_function_pool[26773]: LightModelfv (offset 164) */ "ip\0" "glLightModelfv\0" "\0" - /* _mesa_function_pool[26753]: TexCoord2dv (offset 103) */ + /* _mesa_function_pool[26792]: TexCoord2dv (offset 103) */ "p\0" "glTexCoord2dv\0" "\0" - /* _mesa_function_pool[26770]: GenQueriesARB (will be remapped) */ + /* _mesa_function_pool[26809]: GenQueriesARB (will be remapped) */ "ip\0" "glGenQueries\0" "glGenQueriesARB\0" "\0" - /* _mesa_function_pool[26803]: EvalCoord1dv (offset 229) */ + /* _mesa_function_pool[26842]: EvalCoord1dv (offset 229) */ "p\0" "glEvalCoord1dv\0" "\0" - /* _mesa_function_pool[26821]: ReplacementCodeuiVertex3fSUN (dynamic) */ + /* _mesa_function_pool[26860]: ReplacementCodeuiVertex3fSUN (dynamic) */ "ifff\0" "glReplacementCodeuiVertex3fSUN\0" "\0" - /* _mesa_function_pool[26858]: Translated (offset 303) */ + /* _mesa_function_pool[26897]: Translated (offset 303) */ "ddd\0" "glTranslated\0" "\0" - /* _mesa_function_pool[26876]: Translatef (offset 304) */ + /* _mesa_function_pool[26915]: Translatef (offset 304) */ "fff\0" "glTranslatef\0" "\0" - /* _mesa_function_pool[26894]: StencilMask (offset 209) */ + /* _mesa_function_pool[26933]: StencilMask (offset 209) */ "i\0" "glStencilMask\0" "\0" - /* _mesa_function_pool[26911]: Tangent3iEXT (dynamic) */ + /* _mesa_function_pool[26950]: Tangent3iEXT (dynamic) */ "iii\0" "glTangent3iEXT\0" "\0" - /* _mesa_function_pool[26931]: GetLightiv (offset 265) */ + /* _mesa_function_pool[26970]: GetLightiv (offset 265) */ "iip\0" "glGetLightiv\0" "\0" - /* _mesa_function_pool[26949]: DrawMeshArraysSUN (dynamic) */ + /* _mesa_function_pool[26988]: DrawMeshArraysSUN (dynamic) */ "iiii\0" "glDrawMeshArraysSUN\0" "\0" - /* _mesa_function_pool[26975]: IsList (offset 287) */ + /* _mesa_function_pool[27014]: IsList (offset 287) */ "i\0" "glIsList\0" "\0" - /* _mesa_function_pool[26987]: IsSync (will be remapped) */ + /* _mesa_function_pool[27026]: IsSync (will be remapped) */ "i\0" "glIsSync\0" "\0" - /* _mesa_function_pool[26999]: RenderMode (offset 196) */ + /* _mesa_function_pool[27038]: RenderMode (offset 196) */ "i\0" "glRenderMode\0" "\0" - /* _mesa_function_pool[27015]: GetMapControlPointsNV (dynamic) */ + /* _mesa_function_pool[27054]: GetMapControlPointsNV (dynamic) */ "iiiiiip\0" "glGetMapControlPointsNV\0" "\0" - /* _mesa_function_pool[27048]: DrawBuffersARB (will be remapped) */ + /* _mesa_function_pool[27087]: DrawBuffersARB (will be remapped) */ "ip\0" "glDrawBuffers\0" "glDrawBuffersARB\0" "glDrawBuffersATI\0" "\0" - /* _mesa_function_pool[27100]: ProgramLocalParameter4fARB (will be remapped) */ + /* _mesa_function_pool[27139]: ProgramLocalParameter4fARB (will be remapped) */ "iiffff\0" "glProgramLocalParameter4fARB\0" "\0" - /* _mesa_function_pool[27137]: SpriteParameterivSGIX (dynamic) */ + /* _mesa_function_pool[27176]: SpriteParameterivSGIX (dynamic) */ "ip\0" "glSpriteParameterivSGIX\0" "\0" - /* _mesa_function_pool[27165]: ProvokingVertexEXT (will be remapped) */ + /* _mesa_function_pool[27204]: ProvokingVertexEXT (will be remapped) */ "i\0" "glProvokingVertexEXT\0" "glProvokingVertex\0" "\0" - /* _mesa_function_pool[27207]: MultiTexCoord1fARB (offset 378) */ + /* _mesa_function_pool[27246]: MultiTexCoord1fARB (offset 378) */ "if\0" "glMultiTexCoord1f\0" "glMultiTexCoord1fARB\0" "\0" - /* _mesa_function_pool[27250]: LoadName (offset 198) */ + /* _mesa_function_pool[27289]: LoadName (offset 198) */ "i\0" "glLoadName\0" "\0" - /* _mesa_function_pool[27264]: VertexAttribs4ubvNV (will be remapped) */ + /* _mesa_function_pool[27303]: VertexAttribs4ubvNV (will be remapped) */ "iip\0" "glVertexAttribs4ubvNV\0" "\0" - /* _mesa_function_pool[27291]: WeightsvARB (dynamic) */ + /* _mesa_function_pool[27330]: WeightsvARB (dynamic) */ "ip\0" "glWeightsvARB\0" "\0" - /* _mesa_function_pool[27309]: Uniform1fvARB (will be remapped) */ + /* _mesa_function_pool[27348]: Uniform1fvARB (will be remapped) */ "iip\0" "glUniform1fv\0" "glUniform1fvARB\0" "\0" - /* _mesa_function_pool[27343]: CopyTexSubImage1D (offset 325) */ + /* _mesa_function_pool[27382]: CopyTexSubImage1D (offset 325) */ "iiiiii\0" "glCopyTexSubImage1D\0" "glCopyTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[27394]: CullFace (offset 152) */ + /* _mesa_function_pool[27433]: CullFace (offset 152) */ "i\0" "glCullFace\0" "\0" - /* _mesa_function_pool[27408]: BindTexture (offset 307) */ + /* _mesa_function_pool[27447]: BindTexture (offset 307) */ "ii\0" "glBindTexture\0" "glBindTextureEXT\0" "\0" - /* _mesa_function_pool[27443]: BeginFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[27482]: BeginFragmentShaderATI (will be remapped) */ "\0" "glBeginFragmentShaderATI\0" "\0" - /* _mesa_function_pool[27470]: MultiTexCoord4fARB (offset 402) */ + /* _mesa_function_pool[27509]: MultiTexCoord4fARB (offset 402) */ "iffff\0" "glMultiTexCoord4f\0" "glMultiTexCoord4fARB\0" "\0" - /* _mesa_function_pool[27516]: VertexAttribs3svNV (will be remapped) */ + /* _mesa_function_pool[27555]: VertexAttribs3svNV (will be remapped) */ "iip\0" "glVertexAttribs3svNV\0" "\0" - /* _mesa_function_pool[27542]: StencilFunc (offset 243) */ + /* _mesa_function_pool[27581]: StencilFunc (offset 243) */ "iii\0" "glStencilFunc\0" "\0" - /* _mesa_function_pool[27561]: CopyPixels (offset 255) */ + /* _mesa_function_pool[27600]: CopyPixels (offset 255) */ "iiiii\0" "glCopyPixels\0" "\0" - /* _mesa_function_pool[27581]: Rectsv (offset 93) */ + /* _mesa_function_pool[27620]: Rectsv (offset 93) */ "pp\0" "glRectsv\0" "\0" - /* _mesa_function_pool[27594]: ReplacementCodeuivSUN (dynamic) */ + /* _mesa_function_pool[27633]: ReplacementCodeuivSUN (dynamic) */ "p\0" "glReplacementCodeuivSUN\0" "\0" - /* _mesa_function_pool[27621]: EnableVertexAttribArrayARB (will be remapped) */ + /* _mesa_function_pool[27660]: EnableVertexAttribArrayARB (will be remapped) */ "i\0" "glEnableVertexAttribArray\0" "glEnableVertexAttribArrayARB\0" "\0" - /* _mesa_function_pool[27679]: NormalPointervINTEL (dynamic) */ + /* _mesa_function_pool[27718]: NormalPointervINTEL (dynamic) */ "ip\0" "glNormalPointervINTEL\0" "\0" - /* _mesa_function_pool[27705]: CopyConvolutionFilter2D (offset 355) */ + /* _mesa_function_pool[27744]: CopyConvolutionFilter2D (offset 355) */ "iiiiii\0" "glCopyConvolutionFilter2D\0" "glCopyConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[27768]: WindowPos3ivMESA (will be remapped) */ + /* _mesa_function_pool[27807]: WindowPos3ivMESA (will be remapped) */ "p\0" "glWindowPos3iv\0" "glWindowPos3ivARB\0" "glWindowPos3ivMESA\0" "\0" - /* _mesa_function_pool[27823]: CopyBufferSubData (will be remapped) */ + /* _mesa_function_pool[27862]: CopyBufferSubData (will be remapped) */ "iiiii\0" "glCopyBufferSubData\0" "\0" - /* _mesa_function_pool[27850]: NormalPointer (offset 318) */ + /* _mesa_function_pool[27889]: NormalPointer (offset 318) */ "iip\0" "glNormalPointer\0" "\0" - /* _mesa_function_pool[27871]: TexParameterfv (offset 179) */ + /* _mesa_function_pool[27910]: TexParameterfv (offset 179) */ "iip\0" "glTexParameterfv\0" "\0" - /* _mesa_function_pool[27893]: IsBufferARB (will be remapped) */ + /* _mesa_function_pool[27932]: IsBufferARB (will be remapped) */ "i\0" "glIsBuffer\0" "glIsBufferARB\0" "\0" - /* _mesa_function_pool[27921]: WindowPos4iMESA (will be remapped) */ + /* _mesa_function_pool[27960]: WindowPos4iMESA (will be remapped) */ "iiii\0" "glWindowPos4iMESA\0" "\0" - /* _mesa_function_pool[27945]: VertexAttrib4uivARB (will be remapped) */ + /* _mesa_function_pool[27984]: VertexAttrib4uivARB (will be remapped) */ "ip\0" "glVertexAttrib4uiv\0" "glVertexAttrib4uivARB\0" "\0" - /* _mesa_function_pool[27990]: Tangent3bvEXT (dynamic) */ + /* _mesa_function_pool[28029]: Tangent3bvEXT (dynamic) */ "p\0" "glTangent3bvEXT\0" "\0" - /* _mesa_function_pool[28009]: UniformMatrix3x4fv (will be remapped) */ + /* _mesa_function_pool[28048]: UniformMatrix3x4fv (will be remapped) */ "iiip\0" "glUniformMatrix3x4fv\0" "\0" - /* _mesa_function_pool[28036]: ClipPlane (offset 150) */ + /* _mesa_function_pool[28075]: ClipPlane (offset 150) */ "ip\0" "glClipPlane\0" "\0" - /* _mesa_function_pool[28052]: Recti (offset 90) */ + /* _mesa_function_pool[28091]: Recti (offset 90) */ "iiii\0" "glRecti\0" "\0" - /* _mesa_function_pool[28066]: DrawRangeElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[28105]: DrawRangeElementsBaseVertex (will be remapped) */ "iiiiipi\0" "glDrawRangeElementsBaseVertex\0" "\0" - /* _mesa_function_pool[28105]: TexCoordPointervINTEL (dynamic) */ + /* _mesa_function_pool[28144]: TexCoordPointervINTEL (dynamic) */ "iip\0" "glTexCoordPointervINTEL\0" "\0" - /* _mesa_function_pool[28134]: DeleteBuffersARB (will be remapped) */ + /* _mesa_function_pool[28173]: DeleteBuffersARB (will be remapped) */ "ip\0" "glDeleteBuffers\0" "glDeleteBuffersARB\0" "\0" - /* _mesa_function_pool[28173]: PixelTransformParameterfvEXT (dynamic) */ + /* _mesa_function_pool[28212]: PixelTransformParameterfvEXT (dynamic) */ "iip\0" "glPixelTransformParameterfvEXT\0" "\0" - /* _mesa_function_pool[28209]: WindowPos4fvMESA (will be remapped) */ + /* _mesa_function_pool[28248]: WindowPos4fvMESA (will be remapped) */ "p\0" "glWindowPos4fvMESA\0" "\0" - /* _mesa_function_pool[28231]: GetPixelMapuiv (offset 272) */ + /* _mesa_function_pool[28270]: GetPixelMapuiv (offset 272) */ "ip\0" "glGetPixelMapuiv\0" "\0" - /* _mesa_function_pool[28252]: Rectf (offset 88) */ + /* _mesa_function_pool[28291]: Rectf (offset 88) */ "ffff\0" "glRectf\0" "\0" - /* _mesa_function_pool[28266]: VertexAttrib1sNV (will be remapped) */ + /* _mesa_function_pool[28305]: VertexAttrib1sNV (will be remapped) */ "ii\0" "glVertexAttrib1sNV\0" "\0" - /* _mesa_function_pool[28289]: Indexfv (offset 47) */ + /* _mesa_function_pool[28328]: Indexfv (offset 47) */ "p\0" "glIndexfv\0" "\0" - /* _mesa_function_pool[28302]: SecondaryColor3svEXT (will be remapped) */ + /* _mesa_function_pool[28341]: SecondaryColor3svEXT (will be remapped) */ "p\0" "glSecondaryColor3sv\0" "glSecondaryColor3svEXT\0" "\0" - /* _mesa_function_pool[28348]: LoadTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[28387]: LoadTransposeMatrixfARB (will be remapped) */ "p\0" "glLoadTransposeMatrixf\0" "glLoadTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[28400]: GetPointerv (offset 329) */ + /* _mesa_function_pool[28439]: GetPointerv (offset 329) */ "ip\0" "glGetPointerv\0" "glGetPointervEXT\0" "\0" - /* _mesa_function_pool[28435]: Tangent3bEXT (dynamic) */ + /* _mesa_function_pool[28474]: Tangent3bEXT (dynamic) */ "iii\0" "glTangent3bEXT\0" "\0" - /* _mesa_function_pool[28455]: CombinerParameterfNV (will be remapped) */ + /* _mesa_function_pool[28494]: CombinerParameterfNV (will be remapped) */ "if\0" "glCombinerParameterfNV\0" "\0" - /* _mesa_function_pool[28482]: IndexMask (offset 212) */ + /* _mesa_function_pool[28521]: IndexMask (offset 212) */ "i\0" "glIndexMask\0" "\0" - /* _mesa_function_pool[28497]: BindProgramNV (will be remapped) */ + /* _mesa_function_pool[28536]: BindProgramNV (will be remapped) */ "ii\0" "glBindProgramARB\0" "glBindProgramNV\0" "\0" - /* _mesa_function_pool[28534]: VertexAttrib4svARB (will be remapped) */ + /* _mesa_function_pool[28573]: VertexAttrib4svARB (will be remapped) */ "ip\0" "glVertexAttrib4sv\0" "glVertexAttrib4svARB\0" "\0" - /* _mesa_function_pool[28577]: GetFloatv (offset 262) */ + /* _mesa_function_pool[28616]: GetFloatv (offset 262) */ "ip\0" "glGetFloatv\0" "\0" - /* _mesa_function_pool[28593]: CreateDebugObjectMESA (dynamic) */ + /* _mesa_function_pool[28632]: CreateDebugObjectMESA (dynamic) */ "\0" "glCreateDebugObjectMESA\0" "\0" - /* _mesa_function_pool[28619]: GetShaderiv (will be remapped) */ + /* _mesa_function_pool[28658]: GetShaderiv (will be remapped) */ "iip\0" "glGetShaderiv\0" "\0" - /* _mesa_function_pool[28638]: ClientWaitSync (will be remapped) */ + /* _mesa_function_pool[28677]: ClientWaitSync (will be remapped) */ "iii\0" "glClientWaitSync\0" "\0" - /* _mesa_function_pool[28660]: TexCoord4s (offset 124) */ + /* _mesa_function_pool[28699]: TexCoord4s (offset 124) */ "iiii\0" "glTexCoord4s\0" "\0" - /* _mesa_function_pool[28679]: TexCoord3sv (offset 117) */ + /* _mesa_function_pool[28718]: TexCoord3sv (offset 117) */ "p\0" "glTexCoord3sv\0" "\0" - /* _mesa_function_pool[28696]: BindFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[28735]: BindFragmentShaderATI (will be remapped) */ "i\0" "glBindFragmentShaderATI\0" "\0" - /* _mesa_function_pool[28723]: PopAttrib (offset 218) */ + /* _mesa_function_pool[28762]: PopAttrib (offset 218) */ "\0" "glPopAttrib\0" "\0" - /* _mesa_function_pool[28737]: Fogfv (offset 154) */ + /* _mesa_function_pool[28776]: Fogfv (offset 154) */ "ip\0" "glFogfv\0" "\0" - /* _mesa_function_pool[28749]: UnmapBufferARB (will be remapped) */ + /* _mesa_function_pool[28788]: UnmapBufferARB (will be remapped) */ "i\0" "glUnmapBuffer\0" "glUnmapBufferARB\0" "\0" - /* _mesa_function_pool[28783]: InitNames (offset 197) */ + /* _mesa_function_pool[28822]: InitNames (offset 197) */ "\0" "glInitNames\0" "\0" - /* _mesa_function_pool[28797]: Normal3sv (offset 61) */ + /* _mesa_function_pool[28836]: Normal3sv (offset 61) */ "p\0" "glNormal3sv\0" "\0" - /* _mesa_function_pool[28812]: Minmax (offset 368) */ + /* _mesa_function_pool[28851]: Minmax (offset 368) */ "iii\0" "glMinmax\0" "glMinmaxEXT\0" "\0" - /* _mesa_function_pool[28838]: TexCoord4d (offset 118) */ + /* _mesa_function_pool[28877]: TexCoord4d (offset 118) */ "dddd\0" "glTexCoord4d\0" "\0" - /* _mesa_function_pool[28857]: DeformationMap3dSGIX (dynamic) */ - "iddiiddiiddiip\0" - "glDeformationMap3dSGIX\0" - "\0" /* _mesa_function_pool[28896]: TexCoord4f (offset 120) */ "ffff\0" "glTexCoord4f\0" @@ -4468,534 +4468,532 @@ static const char _mesa_function_pool[] = /* these functions need to be remapped */ static const struct gl_function_pool_remap MESA_remap_table_functions[] = { - { 1461, AttachShader_remap_index }, - { 8995, CreateProgram_remap_index }, - { 21153, CreateShader_remap_index }, - { 23466, DeleteProgram_remap_index }, - { 16937, DeleteShader_remap_index }, - { 21599, DetachShader_remap_index }, - { 16461, GetAttachedShaders_remap_index }, - { 4275, GetProgramInfoLog_remap_index }, - { 361, GetProgramiv_remap_index }, - { 5721, GetShaderInfoLog_remap_index }, - { 28619, GetShaderiv_remap_index }, - { 12198, IsProgram_remap_index }, - { 11197, IsShader_remap_index }, - { 9099, StencilFuncSeparate_remap_index }, - { 3487, StencilMaskSeparate_remap_index }, - { 6803, StencilOpSeparate_remap_index }, - { 20478, UniformMatrix2x3fv_remap_index }, - { 2615, UniformMatrix2x4fv_remap_index }, + { 1500, AttachShader_remap_index }, + { 9034, CreateProgram_remap_index }, + { 21160, CreateShader_remap_index }, + { 23473, DeleteProgram_remap_index }, + { 16944, DeleteShader_remap_index }, + { 21606, DetachShader_remap_index }, + { 16468, GetAttachedShaders_remap_index }, + { 4314, GetProgramInfoLog_remap_index }, + { 400, GetProgramiv_remap_index }, + { 5760, GetShaderInfoLog_remap_index }, + { 28658, GetShaderiv_remap_index }, + { 12276, IsProgram_remap_index }, + { 11275, IsShader_remap_index }, + { 9138, StencilFuncSeparate_remap_index }, + { 3526, StencilMaskSeparate_remap_index }, + { 6842, StencilOpSeparate_remap_index }, + { 20485, UniformMatrix2x3fv_remap_index }, + { 2654, UniformMatrix2x4fv_remap_index }, { 30286, UniformMatrix3x2fv_remap_index }, - { 28009, UniformMatrix3x4fv_remap_index }, - { 14961, UniformMatrix4x2fv_remap_index }, - { 2937, UniformMatrix4x3fv_remap_index }, - { 14622, DrawArraysInstanced_remap_index }, - { 15725, DrawElementsInstanced_remap_index }, - { 9013, LoadTransposeMatrixdARB_remap_index }, - { 28348, LoadTransposeMatrixfARB_remap_index }, - { 4904, MultTransposeMatrixdARB_remap_index }, - { 21786, MultTransposeMatrixfARB_remap_index }, - { 172, SampleCoverageARB_remap_index }, - { 5117, CompressedTexImage1DARB_remap_index }, - { 22269, CompressedTexImage2DARB_remap_index }, - { 3550, CompressedTexImage3DARB_remap_index }, - { 16753, CompressedTexSubImage1DARB_remap_index }, - { 1880, CompressedTexSubImage2DARB_remap_index }, - { 18614, CompressedTexSubImage3DARB_remap_index }, - { 26291, GetCompressedTexImageARB_remap_index }, - { 3395, DisableVertexAttribArrayARB_remap_index }, - { 27621, EnableVertexAttribArrayARB_remap_index }, + { 28048, UniformMatrix3x4fv_remap_index }, + { 14968, UniformMatrix4x2fv_remap_index }, + { 2976, UniformMatrix4x3fv_remap_index }, + { 14629, DrawArraysInstanced_remap_index }, + { 15732, DrawElementsInstanced_remap_index }, + { 9052, LoadTransposeMatrixdARB_remap_index }, + { 28387, LoadTransposeMatrixfARB_remap_index }, + { 4972, MultTransposeMatrixdARB_remap_index }, + { 21793, MultTransposeMatrixfARB_remap_index }, + { 211, SampleCoverageARB_remap_index }, + { 5156, CompressedTexImage1DARB_remap_index }, + { 22276, CompressedTexImage2DARB_remap_index }, + { 3589, CompressedTexImage3DARB_remap_index }, + { 16760, CompressedTexSubImage1DARB_remap_index }, + { 1919, CompressedTexSubImage2DARB_remap_index }, + { 18621, CompressedTexSubImage3DARB_remap_index }, + { 26330, GetCompressedTexImageARB_remap_index }, + { 3434, DisableVertexAttribArrayARB_remap_index }, + { 27660, EnableVertexAttribArrayARB_remap_index }, { 29462, GetProgramEnvParameterdvARB_remap_index }, - { 21666, GetProgramEnvParameterfvARB_remap_index }, - { 25290, GetProgramLocalParameterdvARB_remap_index }, - { 7245, GetProgramLocalParameterfvARB_remap_index }, - { 16844, GetProgramStringARB_remap_index }, - { 25485, GetProgramivARB_remap_index }, - { 18809, GetVertexAttribdvARB_remap_index }, - { 14850, GetVertexAttribfvARB_remap_index }, - { 8908, GetVertexAttribivARB_remap_index }, - { 17690, ProgramEnvParameter4dARB_remap_index }, - { 23239, ProgramEnvParameter4dvARB_remap_index }, - { 15458, ProgramEnvParameter4fARB_remap_index }, - { 8108, ProgramEnvParameter4fvARB_remap_index }, - { 3513, ProgramLocalParameter4dARB_remap_index }, - { 11908, ProgramLocalParameter4dvARB_remap_index }, - { 27100, ProgramLocalParameter4fARB_remap_index }, - { 23819, ProgramLocalParameter4fvARB_remap_index }, - { 26071, ProgramStringARB_remap_index }, - { 17940, VertexAttrib1dARB_remap_index }, - { 14426, VertexAttrib1dvARB_remap_index }, - { 3688, VertexAttrib1fARB_remap_index }, + { 21673, GetProgramEnvParameterfvARB_remap_index }, + { 25329, GetProgramLocalParameterdvARB_remap_index }, + { 7284, GetProgramLocalParameterfvARB_remap_index }, + { 16851, GetProgramStringARB_remap_index }, + { 25524, GetProgramivARB_remap_index }, + { 18816, GetVertexAttribdvARB_remap_index }, + { 14857, GetVertexAttribfvARB_remap_index }, + { 8947, GetVertexAttribivARB_remap_index }, + { 17697, ProgramEnvParameter4dARB_remap_index }, + { 23246, ProgramEnvParameter4dvARB_remap_index }, + { 15465, ProgramEnvParameter4fARB_remap_index }, + { 8147, ProgramEnvParameter4fvARB_remap_index }, + { 3552, ProgramLocalParameter4dARB_remap_index }, + { 11986, ProgramLocalParameter4dvARB_remap_index }, + { 27139, ProgramLocalParameter4fARB_remap_index }, + { 23826, ProgramLocalParameter4fvARB_remap_index }, + { 26110, ProgramStringARB_remap_index }, + { 17947, VertexAttrib1dARB_remap_index }, + { 14433, VertexAttrib1dvARB_remap_index }, + { 3727, VertexAttrib1fARB_remap_index }, { 30367, VertexAttrib1fvARB_remap_index }, - { 6329, VertexAttrib1sARB_remap_index }, - { 2054, VertexAttrib1svARB_remap_index }, - { 13857, VertexAttrib2dARB_remap_index }, - { 16080, VertexAttrib2dvARB_remap_index }, - { 1480, VertexAttrib2fARB_remap_index }, - { 16193, VertexAttrib2fvARB_remap_index }, + { 6368, VertexAttrib1sARB_remap_index }, + { 2093, VertexAttrib1svARB_remap_index }, + { 13864, VertexAttrib2dARB_remap_index }, + { 16087, VertexAttrib2dvARB_remap_index }, + { 1519, VertexAttrib2fARB_remap_index }, + { 16200, VertexAttrib2fvARB_remap_index }, { 29993, VertexAttrib2sARB_remap_index }, { 29099, VertexAttrib2svARB_remap_index }, - { 10282, VertexAttrib3dARB_remap_index }, - { 7811, VertexAttrib3dvARB_remap_index }, - { 1567, VertexAttrib3fARB_remap_index }, - { 20741, VertexAttrib3fvARB_remap_index }, - { 25918, VertexAttrib3sARB_remap_index }, - { 18551, VertexAttrib3svARB_remap_index }, - { 4301, VertexAttrib4NbvARB_remap_index }, - { 16416, VertexAttrib4NivARB_remap_index }, - { 20696, VertexAttrib4NsvARB_remap_index }, - { 21618, VertexAttrib4NubARB_remap_index }, + { 10321, VertexAttrib3dARB_remap_index }, + { 7850, VertexAttrib3dvARB_remap_index }, + { 1606, VertexAttrib3fARB_remap_index }, + { 20748, VertexAttrib3fvARB_remap_index }, + { 25957, VertexAttrib3sARB_remap_index }, + { 18558, VertexAttrib3svARB_remap_index }, + { 4340, VertexAttrib4NbvARB_remap_index }, + { 16423, VertexAttrib4NivARB_remap_index }, + { 20703, VertexAttrib4NsvARB_remap_index }, + { 21625, VertexAttrib4NubARB_remap_index }, { 29345, VertexAttrib4NubvARB_remap_index }, - { 17351, VertexAttrib4NuivARB_remap_index }, - { 2810, VertexAttrib4NusvARB_remap_index }, - { 9876, VertexAttrib4bvARB_remap_index }, - { 24698, VertexAttrib4dARB_remap_index }, - { 19573, VertexAttrib4dvARB_remap_index }, - { 10389, VertexAttrib4fARB_remap_index }, - { 10793, VertexAttrib4fvARB_remap_index }, - { 9292, VertexAttrib4ivARB_remap_index }, - { 15894, VertexAttrib4sARB_remap_index }, - { 28534, VertexAttrib4svARB_remap_index }, - { 15263, VertexAttrib4ubvARB_remap_index }, - { 27945, VertexAttrib4uivARB_remap_index }, - { 18362, VertexAttrib4usvARB_remap_index }, - { 20327, VertexAttribPointerARB_remap_index }, + { 17358, VertexAttrib4NuivARB_remap_index }, + { 2849, VertexAttrib4NusvARB_remap_index }, + { 9915, VertexAttrib4bvARB_remap_index }, + { 24737, VertexAttrib4dARB_remap_index }, + { 19580, VertexAttrib4dvARB_remap_index }, + { 10428, VertexAttrib4fARB_remap_index }, + { 10832, VertexAttrib4fvARB_remap_index }, + { 9331, VertexAttrib4ivARB_remap_index }, + { 15901, VertexAttrib4sARB_remap_index }, + { 28573, VertexAttrib4svARB_remap_index }, + { 15270, VertexAttrib4ubvARB_remap_index }, + { 27984, VertexAttrib4uivARB_remap_index }, + { 18369, VertexAttrib4usvARB_remap_index }, + { 20334, VertexAttribPointerARB_remap_index }, { 30127, BindBufferARB_remap_index }, - { 6036, BufferDataARB_remap_index }, - { 1382, BufferSubDataARB_remap_index }, - { 28134, DeleteBuffersARB_remap_index }, + { 6075, BufferDataARB_remap_index }, + { 1421, BufferSubDataARB_remap_index }, + { 28173, DeleteBuffersARB_remap_index }, { 30410, GenBuffersARB_remap_index }, - { 16236, GetBufferParameterivARB_remap_index }, - { 15410, GetBufferPointervARB_remap_index }, - { 1335, GetBufferSubDataARB_remap_index }, - { 27893, IsBufferARB_remap_index }, - { 24303, MapBufferARB_remap_index }, - { 28749, UnmapBufferARB_remap_index }, - { 268, BeginQueryARB_remap_index }, - { 18035, DeleteQueriesARB_remap_index }, - { 11087, EndQueryARB_remap_index }, - { 26770, GenQueriesARB_remap_index }, - { 1772, GetQueryObjectivARB_remap_index }, - { 15938, GetQueryObjectuivARB_remap_index }, - { 1624, GetQueryivARB_remap_index }, - { 18269, IsQueryARB_remap_index }, - { 7421, AttachObjectARB_remap_index }, - { 16899, CompileShaderARB_remap_index }, - { 2879, CreateProgramObjectARB_remap_index }, - { 5981, CreateShaderObjectARB_remap_index }, - { 13274, DeleteObjectARB_remap_index }, - { 22060, DetachObjectARB_remap_index }, - { 10865, GetActiveUniformARB_remap_index }, - { 8583, GetAttachedObjectsARB_remap_index }, - { 8890, GetHandleARB_remap_index }, + { 16243, GetBufferParameterivARB_remap_index }, + { 15417, GetBufferPointervARB_remap_index }, + { 1374, GetBufferSubDataARB_remap_index }, + { 27932, IsBufferARB_remap_index }, + { 24310, MapBufferARB_remap_index }, + { 28788, UnmapBufferARB_remap_index }, + { 307, BeginQueryARB_remap_index }, + { 18042, DeleteQueriesARB_remap_index }, + { 11126, EndQueryARB_remap_index }, + { 26809, GenQueriesARB_remap_index }, + { 1811, GetQueryObjectivARB_remap_index }, + { 15945, GetQueryObjectuivARB_remap_index }, + { 1663, GetQueryivARB_remap_index }, + { 18276, IsQueryARB_remap_index }, + { 7460, AttachObjectARB_remap_index }, + { 16906, CompileShaderARB_remap_index }, + { 2918, CreateProgramObjectARB_remap_index }, + { 6020, CreateShaderObjectARB_remap_index }, + { 13281, DeleteObjectARB_remap_index }, + { 22067, DetachObjectARB_remap_index }, + { 10904, GetActiveUniformARB_remap_index }, + { 8622, GetAttachedObjectsARB_remap_index }, + { 8929, GetHandleARB_remap_index }, { 30160, GetInfoLogARB_remap_index }, { 29416, GetObjectParameterfvARB_remap_index }, - { 25164, GetObjectParameterivARB_remap_index }, - { 26528, GetShaderSourceARB_remap_index }, - { 25778, GetUniformLocationARB_remap_index }, - { 21888, GetUniformfvARB_remap_index }, - { 11530, GetUniformivARB_remap_index }, - { 18407, LinkProgramARB_remap_index }, - { 18465, ShaderSourceARB_remap_index }, - { 6703, Uniform1fARB_remap_index }, - { 27309, Uniform1fvARB_remap_index }, - { 20296, Uniform1iARB_remap_index }, - { 19262, Uniform1ivARB_remap_index }, - { 2003, Uniform2fARB_remap_index }, - { 13110, Uniform2fvARB_remap_index }, - { 24190, Uniform2iARB_remap_index }, - { 2123, Uniform2ivARB_remap_index }, - { 17009, Uniform3fARB_remap_index }, - { 8613, Uniform3fvARB_remap_index }, - { 5627, Uniform3iARB_remap_index }, - { 15516, Uniform3ivARB_remap_index }, - { 17496, Uniform4fARB_remap_index }, - { 21752, Uniform4fvARB_remap_index }, - { 22918, Uniform4iARB_remap_index }, - { 18775, Uniform4ivARB_remap_index }, - { 7473, UniformMatrix2fvARB_remap_index }, + { 25203, GetObjectParameterivARB_remap_index }, + { 26567, GetShaderSourceARB_remap_index }, + { 25817, GetUniformLocationARB_remap_index }, + { 21895, GetUniformfvARB_remap_index }, + { 11608, GetUniformivARB_remap_index }, + { 18414, LinkProgramARB_remap_index }, + { 18472, ShaderSourceARB_remap_index }, + { 6742, Uniform1fARB_remap_index }, + { 27348, Uniform1fvARB_remap_index }, + { 20303, Uniform1iARB_remap_index }, + { 19269, Uniform1ivARB_remap_index }, + { 2042, Uniform2fARB_remap_index }, + { 13117, Uniform2fvARB_remap_index }, + { 24197, Uniform2iARB_remap_index }, + { 2162, Uniform2ivARB_remap_index }, + { 17016, Uniform3fARB_remap_index }, + { 8652, Uniform3fvARB_remap_index }, + { 5666, Uniform3iARB_remap_index }, + { 15523, Uniform3ivARB_remap_index }, + { 17503, Uniform4fARB_remap_index }, + { 21759, Uniform4fvARB_remap_index }, + { 22925, Uniform4iARB_remap_index }, + { 18782, Uniform4ivARB_remap_index }, + { 7512, UniformMatrix2fvARB_remap_index }, { 17, UniformMatrix3fvARB_remap_index }, - { 2475, UniformMatrix4fvARB_remap_index }, - { 23351, UseProgramObjectARB_remap_index }, - { 13545, ValidateProgramARB_remap_index }, - { 19616, BindAttribLocationARB_remap_index }, - { 4346, GetActiveAttribARB_remap_index }, - { 15197, GetAttribLocationARB_remap_index }, - { 27048, DrawBuffersARB_remap_index }, - { 12013, RenderbufferStorageMultisample_remap_index }, - { 12417, FramebufferTextureARB_remap_index }, - { 23721, FramebufferTextureFaceARB_remap_index }, - { 22209, ProgramParameteriARB_remap_index }, - { 17544, FlushMappedBufferRange_remap_index }, - { 25581, MapBufferRange_remap_index }, - { 15072, BindVertexArray_remap_index }, - { 13404, GenVertexArrays_remap_index }, - { 27823, CopyBufferSubData_remap_index }, - { 28638, ClientWaitSync_remap_index }, - { 2394, DeleteSync_remap_index }, - { 6370, FenceSync_remap_index }, - { 13916, GetInteger64v_remap_index }, - { 20803, GetSynciv_remap_index }, - { 26987, IsSync_remap_index }, - { 8531, WaitSync_remap_index }, - { 3363, DrawElementsBaseVertex_remap_index }, - { 28066, DrawRangeElementsBaseVertex_remap_index }, - { 24334, MultiDrawElementsBaseVertex_remap_index }, - { 4480, BindTransformFeedback_remap_index }, - { 2906, DeleteTransformFeedbacks_remap_index }, - { 5660, DrawTransformFeedback_remap_index }, - { 8750, GenTransformFeedbacks_remap_index }, - { 25961, IsTransformFeedback_remap_index }, - { 23914, PauseTransformFeedback_remap_index }, - { 4824, ResumeTransformFeedback_remap_index }, - { 4739, PolygonOffsetEXT_remap_index }, - { 21388, GetPixelTexGenParameterfvSGIS_remap_index }, - { 3895, GetPixelTexGenParameterivSGIS_remap_index }, - { 21121, PixelTexGenParameterfSGIS_remap_index }, - { 580, PixelTexGenParameterfvSGIS_remap_index }, - { 11568, PixelTexGenParameteriSGIS_remap_index }, - { 12591, PixelTexGenParameterivSGIS_remap_index }, - { 15160, SampleMaskSGIS_remap_index }, - { 18209, SamplePatternSGIS_remap_index }, - { 24263, ColorPointerEXT_remap_index }, - { 16123, EdgeFlagPointerEXT_remap_index }, - { 5281, IndexPointerEXT_remap_index }, - { 5361, NormalPointerEXT_remap_index }, - { 14510, TexCoordPointerEXT_remap_index }, - { 6159, VertexPointerEXT_remap_index }, - { 3165, PointParameterfEXT_remap_index }, - { 7010, PointParameterfvEXT_remap_index }, + { 2514, UniformMatrix4fvARB_remap_index }, + { 23358, UseProgramObjectARB_remap_index }, + { 13552, ValidateProgramARB_remap_index }, + { 19623, BindAttribLocationARB_remap_index }, + { 4385, GetActiveAttribARB_remap_index }, + { 15204, GetAttribLocationARB_remap_index }, + { 27087, DrawBuffersARB_remap_index }, + { 12091, RenderbufferStorageMultisample_remap_index }, + { 12495, FramebufferTextureARB_remap_index }, + { 23728, FramebufferTextureFaceARB_remap_index }, + { 22216, ProgramParameteriARB_remap_index }, + { 17551, FlushMappedBufferRange_remap_index }, + { 25620, MapBufferRange_remap_index }, + { 15079, BindVertexArray_remap_index }, + { 13411, GenVertexArrays_remap_index }, + { 27862, CopyBufferSubData_remap_index }, + { 28677, ClientWaitSync_remap_index }, + { 2433, DeleteSync_remap_index }, + { 6409, FenceSync_remap_index }, + { 13923, GetInteger64v_remap_index }, + { 20810, GetSynciv_remap_index }, + { 27026, IsSync_remap_index }, + { 8570, WaitSync_remap_index }, + { 3402, DrawElementsBaseVertex_remap_index }, + { 28105, DrawRangeElementsBaseVertex_remap_index }, + { 24341, MultiDrawElementsBaseVertex_remap_index }, + { 4519, BindTransformFeedback_remap_index }, + { 2945, DeleteTransformFeedbacks_remap_index }, + { 5699, DrawTransformFeedback_remap_index }, + { 8789, GenTransformFeedbacks_remap_index }, + { 26000, IsTransformFeedback_remap_index }, + { 23921, PauseTransformFeedback_remap_index }, + { 4892, ResumeTransformFeedback_remap_index }, + { 4807, PolygonOffsetEXT_remap_index }, + { 21395, GetPixelTexGenParameterfvSGIS_remap_index }, + { 3934, GetPixelTexGenParameterivSGIS_remap_index }, + { 21128, PixelTexGenParameterfSGIS_remap_index }, + { 619, PixelTexGenParameterfvSGIS_remap_index }, + { 11646, PixelTexGenParameteriSGIS_remap_index }, + { 12637, PixelTexGenParameterivSGIS_remap_index }, + { 15167, SampleMaskSGIS_remap_index }, + { 18216, SamplePatternSGIS_remap_index }, + { 24270, ColorPointerEXT_remap_index }, + { 16130, EdgeFlagPointerEXT_remap_index }, + { 5320, IndexPointerEXT_remap_index }, + { 5400, NormalPointerEXT_remap_index }, + { 14517, TexCoordPointerEXT_remap_index }, + { 6198, VertexPointerEXT_remap_index }, + { 3204, PointParameterfEXT_remap_index }, + { 7049, PointParameterfvEXT_remap_index }, { 29514, LockArraysEXT_remap_index }, - { 13609, UnlockArraysEXT_remap_index }, - { 8017, CullParameterdvEXT_remap_index }, - { 10660, CullParameterfvEXT_remap_index }, - { 1151, SecondaryColor3bEXT_remap_index }, - { 7169, SecondaryColor3bvEXT_remap_index }, - { 9469, SecondaryColor3dEXT_remap_index }, - { 23524, SecondaryColor3dvEXT_remap_index }, - { 25827, SecondaryColor3fEXT_remap_index }, - { 16689, SecondaryColor3fvEXT_remap_index }, - { 426, SecondaryColor3iEXT_remap_index }, - { 14898, SecondaryColor3ivEXT_remap_index }, - { 9127, SecondaryColor3sEXT_remap_index }, - { 28302, SecondaryColor3svEXT_remap_index }, - { 25000, SecondaryColor3ubEXT_remap_index }, - { 19507, SecondaryColor3ubvEXT_remap_index }, - { 11763, SecondaryColor3uiEXT_remap_index }, - { 21008, SecondaryColor3uivEXT_remap_index }, - { 23771, SecondaryColor3usEXT_remap_index }, - { 11836, SecondaryColor3usvEXT_remap_index }, - { 10736, SecondaryColorPointerEXT_remap_index }, - { 23585, MultiDrawArraysEXT_remap_index }, - { 19197, MultiDrawElementsEXT_remap_index }, - { 19392, FogCoordPointerEXT_remap_index }, - { 4044, FogCoorddEXT_remap_index }, + { 13616, UnlockArraysEXT_remap_index }, + { 1190, SecondaryColor3bEXT_remap_index }, + { 7208, SecondaryColor3bvEXT_remap_index }, + { 9508, SecondaryColor3dEXT_remap_index }, + { 23531, SecondaryColor3dvEXT_remap_index }, + { 25866, SecondaryColor3fEXT_remap_index }, + { 16696, SecondaryColor3fvEXT_remap_index }, + { 465, SecondaryColor3iEXT_remap_index }, + { 14905, SecondaryColor3ivEXT_remap_index }, + { 9166, SecondaryColor3sEXT_remap_index }, + { 28341, SecondaryColor3svEXT_remap_index }, + { 25039, SecondaryColor3ubEXT_remap_index }, + { 19514, SecondaryColor3ubvEXT_remap_index }, + { 11841, SecondaryColor3uiEXT_remap_index }, + { 21015, SecondaryColor3uivEXT_remap_index }, + { 23778, SecondaryColor3usEXT_remap_index }, + { 11914, SecondaryColor3usvEXT_remap_index }, + { 10775, SecondaryColorPointerEXT_remap_index }, + { 23592, MultiDrawArraysEXT_remap_index }, + { 19204, MultiDrawElementsEXT_remap_index }, + { 19399, FogCoordPointerEXT_remap_index }, + { 4083, FogCoorddEXT_remap_index }, { 28915, FogCoorddvEXT_remap_index }, - { 4136, FogCoordfEXT_remap_index }, - { 24923, FogCoordfvEXT_remap_index }, - { 17448, PixelTexGenSGIX_remap_index }, - { 25508, BlendFuncSeparateEXT_remap_index }, - { 6071, FlushVertexArrayRangeNV_remap_index }, - { 4688, VertexArrayRangeNV_remap_index }, - { 25892, CombinerInputNV_remap_index }, - { 1946, CombinerOutputNV_remap_index }, - { 28455, CombinerParameterfNV_remap_index }, - { 4608, CombinerParameterfvNV_remap_index }, - { 20527, CombinerParameteriNV_remap_index }, + { 4175, FogCoordfEXT_remap_index }, + { 24962, FogCoordfvEXT_remap_index }, + { 17455, PixelTexGenSGIX_remap_index }, + { 25547, BlendFuncSeparateEXT_remap_index }, + { 6110, FlushVertexArrayRangeNV_remap_index }, + { 4756, VertexArrayRangeNV_remap_index }, + { 25931, CombinerInputNV_remap_index }, + { 1985, CombinerOutputNV_remap_index }, + { 28494, CombinerParameterfNV_remap_index }, + { 4676, CombinerParameterfvNV_remap_index }, + { 20534, CombinerParameteriNV_remap_index }, { 29885, CombinerParameterivNV_remap_index }, - { 6447, FinalCombinerInputNV_remap_index }, - { 8956, GetCombinerInputParameterfvNV_remap_index }, + { 6486, FinalCombinerInputNV_remap_index }, + { 8995, GetCombinerInputParameterfvNV_remap_index }, { 29722, GetCombinerInputParameterivNV_remap_index }, - { 12692, GetCombinerOutputParameterfvNV_remap_index }, - { 12520, GetCombinerOutputParameterivNV_remap_index }, - { 5816, GetFinalCombinerInputParameterfvNV_remap_index }, - { 22790, GetFinalCombinerInputParameterivNV_remap_index }, - { 11508, ResizeBuffersMESA_remap_index }, - { 10109, WindowPos2dMESA_remap_index }, - { 944, WindowPos2dvMESA_remap_index }, + { 172, GetCombinerOutputParameterfvNV_remap_index }, + { 12598, GetCombinerOutputParameterivNV_remap_index }, + { 5855, GetFinalCombinerInputParameterfvNV_remap_index }, + { 22797, GetFinalCombinerInputParameterivNV_remap_index }, + { 11586, ResizeBuffersMESA_remap_index }, + { 10148, WindowPos2dMESA_remap_index }, + { 983, WindowPos2dvMESA_remap_index }, { 30713, WindowPos2fMESA_remap_index }, - { 7114, WindowPos2fvMESA_remap_index }, - { 16636, WindowPos2iMESA_remap_index }, - { 18682, WindowPos2ivMESA_remap_index }, - { 19296, WindowPos2sMESA_remap_index }, - { 5031, WindowPos2svMESA_remap_index }, - { 6939, WindowPos3dMESA_remap_index }, - { 12838, WindowPos3dvMESA_remap_index }, - { 472, WindowPos3fMESA_remap_index }, - { 13670, WindowPos3fvMESA_remap_index }, - { 22102, WindowPos3iMESA_remap_index }, - { 27768, WindowPos3ivMESA_remap_index }, - { 17154, WindowPos3sMESA_remap_index }, + { 7153, WindowPos2fvMESA_remap_index }, + { 16643, WindowPos2iMESA_remap_index }, + { 18689, WindowPos2ivMESA_remap_index }, + { 19303, WindowPos2sMESA_remap_index }, + { 5070, WindowPos2svMESA_remap_index }, + { 6978, WindowPos3dMESA_remap_index }, + { 12845, WindowPos3dvMESA_remap_index }, + { 511, WindowPos3fMESA_remap_index }, + { 13677, WindowPos3fvMESA_remap_index }, + { 22109, WindowPos3iMESA_remap_index }, + { 27807, WindowPos3ivMESA_remap_index }, + { 17161, WindowPos3sMESA_remap_index }, { 29171, WindowPos3svMESA_remap_index }, - { 10060, WindowPos4dMESA_remap_index }, - { 15601, WindowPos4dvMESA_remap_index }, - { 12797, WindowPos4fMESA_remap_index }, - { 28209, WindowPos4fvMESA_remap_index }, - { 27921, WindowPos4iMESA_remap_index }, - { 11311, WindowPos4ivMESA_remap_index }, - { 17327, WindowPos4sMESA_remap_index }, - { 2857, WindowPos4svMESA_remap_index }, - { 12559, MultiModeDrawArraysIBM_remap_index }, - { 26641, MultiModeDrawElementsIBM_remap_index }, - { 11115, DeleteFencesNV_remap_index }, - { 25739, FinishFenceNV_remap_index }, - { 3287, GenFencesNV_remap_index }, - { 15581, GetFenceivNV_remap_index }, - { 7406, IsFenceNV_remap_index }, - { 12447, SetFenceNV_remap_index }, - { 3744, TestFenceNV_remap_index }, + { 10099, WindowPos4dMESA_remap_index }, + { 15608, WindowPos4dvMESA_remap_index }, + { 12804, WindowPos4fMESA_remap_index }, + { 28248, WindowPos4fvMESA_remap_index }, + { 27960, WindowPos4iMESA_remap_index }, + { 11389, WindowPos4ivMESA_remap_index }, + { 17334, WindowPos4sMESA_remap_index }, + { 2896, WindowPos4svMESA_remap_index }, + { 24705, MultiModeDrawArraysIBM_remap_index }, + { 26680, MultiModeDrawElementsIBM_remap_index }, + { 11154, DeleteFencesNV_remap_index }, + { 25778, FinishFenceNV_remap_index }, + { 3326, GenFencesNV_remap_index }, + { 15588, GetFenceivNV_remap_index }, + { 7445, IsFenceNV_remap_index }, + { 12525, SetFenceNV_remap_index }, + { 3783, TestFenceNV_remap_index }, { 29142, AreProgramsResidentNV_remap_index }, - { 28497, BindProgramNV_remap_index }, - { 23854, DeleteProgramsNV_remap_index }, - { 19725, ExecuteProgramNV_remap_index }, + { 28536, BindProgramNV_remap_index }, + { 23861, DeleteProgramsNV_remap_index }, + { 19732, ExecuteProgramNV_remap_index }, { 30606, GenProgramsNV_remap_index }, - { 21467, GetProgramParameterdvNV_remap_index }, - { 9531, GetProgramParameterfvNV_remap_index }, - { 24237, GetProgramStringNV_remap_index }, - { 22479, GetProgramivNV_remap_index }, - { 21701, GetTrackMatrixivNV_remap_index }, - { 24031, GetVertexAttribPointervNV_remap_index }, - { 22723, GetVertexAttribdvNV_remap_index }, - { 8426, GetVertexAttribfvNV_remap_index }, - { 16817, GetVertexAttribivNV_remap_index }, - { 17574, IsProgramNV_remap_index }, - { 8509, LoadProgramNV_remap_index }, - { 25604, ProgramParameters4dvNV_remap_index }, - { 22409, ProgramParameters4fvNV_remap_index }, - { 18986, RequestResidentProgramsNV_remap_index }, - { 20505, TrackMatrixNV_remap_index }, + { 21474, GetProgramParameterdvNV_remap_index }, + { 9570, GetProgramParameterfvNV_remap_index }, + { 24244, GetProgramStringNV_remap_index }, + { 22486, GetProgramivNV_remap_index }, + { 21708, GetTrackMatrixivNV_remap_index }, + { 24038, GetVertexAttribPointervNV_remap_index }, + { 22730, GetVertexAttribdvNV_remap_index }, + { 8465, GetVertexAttribfvNV_remap_index }, + { 16824, GetVertexAttribivNV_remap_index }, + { 17581, IsProgramNV_remap_index }, + { 8548, LoadProgramNV_remap_index }, + { 25643, ProgramParameters4dvNV_remap_index }, + { 22416, ProgramParameters4fvNV_remap_index }, + { 18993, RequestResidentProgramsNV_remap_index }, + { 20512, TrackMatrixNV_remap_index }, { 29699, VertexAttrib1dNV_remap_index }, - { 12358, VertexAttrib1dvNV_remap_index }, - { 26173, VertexAttrib1fNV_remap_index }, - { 2245, VertexAttrib1fvNV_remap_index }, - { 28266, VertexAttrib1sNV_remap_index }, - { 13743, VertexAttrib1svNV_remap_index }, - { 4251, VertexAttrib2dNV_remap_index }, - { 12273, VertexAttrib2dvNV_remap_index }, - { 18441, VertexAttrib2fNV_remap_index }, - { 11884, VertexAttrib2fvNV_remap_index }, - { 5191, VertexAttrib2sNV_remap_index }, - { 17208, VertexAttrib2svNV_remap_index }, - { 10257, VertexAttrib3dNV_remap_index }, + { 12436, VertexAttrib1dvNV_remap_index }, + { 26212, VertexAttrib1fNV_remap_index }, + { 2284, VertexAttrib1fvNV_remap_index }, + { 28305, VertexAttrib1sNV_remap_index }, + { 13750, VertexAttrib1svNV_remap_index }, + { 4290, VertexAttrib2dNV_remap_index }, + { 12351, VertexAttrib2dvNV_remap_index }, + { 18448, VertexAttrib2fNV_remap_index }, + { 11962, VertexAttrib2fvNV_remap_index }, + { 5230, VertexAttrib2sNV_remap_index }, + { 17215, VertexAttrib2svNV_remap_index }, + { 10296, VertexAttrib3dNV_remap_index }, { 29392, VertexAttrib3dvNV_remap_index }, - { 9343, VertexAttrib3fNV_remap_index }, - { 22750, VertexAttrib3fvNV_remap_index }, - { 20382, VertexAttrib3sNV_remap_index }, - { 21728, VertexAttrib3svNV_remap_index }, - { 26615, VertexAttrib4dNV_remap_index }, + { 9382, VertexAttrib3fNV_remap_index }, + { 22757, VertexAttrib3fvNV_remap_index }, + { 20389, VertexAttrib3sNV_remap_index }, + { 21735, VertexAttrib3svNV_remap_index }, + { 26654, VertexAttrib4dNV_remap_index }, { 30643, VertexAttrib4dvNV_remap_index }, - { 3945, VertexAttrib4fNV_remap_index }, - { 8559, VertexAttrib4fvNV_remap_index }, - { 24582, VertexAttrib4sNV_remap_index }, - { 1293, VertexAttrib4svNV_remap_index }, - { 4409, VertexAttrib4ubNV_remap_index }, - { 734, VertexAttrib4ubvNV_remap_index }, - { 19905, VertexAttribPointerNV_remap_index }, - { 2097, VertexAttribs1dvNV_remap_index }, - { 24119, VertexAttribs1fvNV_remap_index }, + { 3984, VertexAttrib4fNV_remap_index }, + { 8598, VertexAttrib4fvNV_remap_index }, + { 24589, VertexAttrib4sNV_remap_index }, + { 1332, VertexAttrib4svNV_remap_index }, + { 4448, VertexAttrib4ubNV_remap_index }, + { 773, VertexAttrib4ubvNV_remap_index }, + { 19912, VertexAttribPointerNV_remap_index }, + { 2136, VertexAttribs1dvNV_remap_index }, + { 24126, VertexAttribs1fvNV_remap_index }, { 30443, VertexAttribs1svNV_remap_index }, - { 9368, VertexAttribs2dvNV_remap_index }, - { 23312, VertexAttribs2fvNV_remap_index }, - { 16149, VertexAttribs2svNV_remap_index }, - { 4636, VertexAttribs3dvNV_remap_index }, - { 1977, VertexAttribs3fvNV_remap_index }, - { 27516, VertexAttribs3svNV_remap_index }, - { 24672, VertexAttribs4dvNV_remap_index }, - { 4662, VertexAttribs4fvNV_remap_index }, + { 9407, VertexAttribs2dvNV_remap_index }, + { 23319, VertexAttribs2fvNV_remap_index }, + { 16156, VertexAttribs2svNV_remap_index }, + { 4704, VertexAttribs3dvNV_remap_index }, + { 2016, VertexAttribs3fvNV_remap_index }, + { 27555, VertexAttribs3svNV_remap_index }, + { 24679, VertexAttribs4dvNV_remap_index }, + { 4730, VertexAttribs4fvNV_remap_index }, { 30230, VertexAttribs4svNV_remap_index }, - { 27264, VertexAttribs4ubvNV_remap_index }, - { 24742, GetTexBumpParameterfvATI_remap_index }, + { 27303, VertexAttribs4ubvNV_remap_index }, + { 24781, GetTexBumpParameterfvATI_remap_index }, { 30484, GetTexBumpParameterivATI_remap_index }, - { 16871, TexBumpParameterfvATI_remap_index }, - { 18857, TexBumpParameterivATI_remap_index }, - { 14289, AlphaFragmentOp1ATI_remap_index }, - { 9919, AlphaFragmentOp2ATI_remap_index }, - { 22666, AlphaFragmentOp3ATI_remap_index }, - { 27443, BeginFragmentShaderATI_remap_index }, - { 28696, BindFragmentShaderATI_remap_index }, - { 21857, ColorFragmentOp1ATI_remap_index }, - { 3823, ColorFragmentOp2ATI_remap_index }, + { 16878, TexBumpParameterfvATI_remap_index }, + { 18864, TexBumpParameterivATI_remap_index }, + { 14296, AlphaFragmentOp1ATI_remap_index }, + { 9958, AlphaFragmentOp2ATI_remap_index }, + { 22673, AlphaFragmentOp3ATI_remap_index }, + { 27482, BeginFragmentShaderATI_remap_index }, + { 28735, BindFragmentShaderATI_remap_index }, + { 21864, ColorFragmentOp1ATI_remap_index }, + { 3862, ColorFragmentOp2ATI_remap_index }, { 29037, ColorFragmentOp3ATI_remap_index }, - { 4781, DeleteFragmentShaderATI_remap_index }, + { 4849, DeleteFragmentShaderATI_remap_index }, { 30667, EndFragmentShaderATI_remap_index }, { 29913, GenFragmentShadersATI_remap_index }, - { 23443, PassTexCoordATI_remap_index }, - { 6139, SampleMapATI_remap_index }, - { 5912, SetFragmentShaderConstantATI_remap_index }, - { 319, PointParameteriNV_remap_index }, - { 12999, PointParameterivNV_remap_index }, - { 26454, ActiveStencilFaceEXT_remap_index }, - { 25264, BindVertexArrayAPPLE_remap_index }, - { 2522, DeleteVertexArraysAPPLE_remap_index }, - { 16488, GenVertexArraysAPPLE_remap_index }, - { 21532, IsVertexArrayAPPLE_remap_index }, - { 775, GetProgramNamedParameterdvNV_remap_index }, - { 3128, GetProgramNamedParameterfvNV_remap_index }, - { 24773, ProgramNamedParameter4dNV_remap_index }, - { 13325, ProgramNamedParameter4dvNV_remap_index }, - { 8042, ProgramNamedParameter4fNV_remap_index }, - { 10701, ProgramNamedParameter4fvNV_remap_index }, - { 22388, DepthBoundsEXT_remap_index }, - { 1043, BlendEquationSeparateEXT_remap_index }, - { 13444, BindFramebufferEXT_remap_index }, - { 23630, BindRenderbufferEXT_remap_index }, - { 8806, CheckFramebufferStatusEXT_remap_index }, - { 20822, DeleteFramebuffersEXT_remap_index }, + { 23450, PassTexCoordATI_remap_index }, + { 6178, SampleMapATI_remap_index }, + { 5951, SetFragmentShaderConstantATI_remap_index }, + { 358, PointParameteriNV_remap_index }, + { 13006, PointParameterivNV_remap_index }, + { 26493, ActiveStencilFaceEXT_remap_index }, + { 25303, BindVertexArrayAPPLE_remap_index }, + { 2561, DeleteVertexArraysAPPLE_remap_index }, + { 16495, GenVertexArraysAPPLE_remap_index }, + { 21539, IsVertexArrayAPPLE_remap_index }, + { 814, GetProgramNamedParameterdvNV_remap_index }, + { 3167, GetProgramNamedParameterfvNV_remap_index }, + { 24812, ProgramNamedParameter4dNV_remap_index }, + { 13332, ProgramNamedParameter4dvNV_remap_index }, + { 8081, ProgramNamedParameter4fNV_remap_index }, + { 10740, ProgramNamedParameter4fvNV_remap_index }, + { 22395, DepthBoundsEXT_remap_index }, + { 1082, BlendEquationSeparateEXT_remap_index }, + { 13451, BindFramebufferEXT_remap_index }, + { 23637, BindRenderbufferEXT_remap_index }, + { 8845, CheckFramebufferStatusEXT_remap_index }, + { 20829, DeleteFramebuffersEXT_remap_index }, { 29294, DeleteRenderbuffersEXT_remap_index }, - { 12297, FramebufferRenderbufferEXT_remap_index }, - { 12464, FramebufferTexture1DEXT_remap_index }, - { 10495, FramebufferTexture2DEXT_remap_index }, - { 10162, FramebufferTexture3DEXT_remap_index }, - { 21424, GenFramebuffersEXT_remap_index }, - { 16035, GenRenderbuffersEXT_remap_index }, - { 5858, GenerateMipmapEXT_remap_index }, - { 20002, GetFramebufferAttachmentParameterivEXT_remap_index }, + { 12375, FramebufferRenderbufferEXT_remap_index }, + { 12542, FramebufferTexture1DEXT_remap_index }, + { 10534, FramebufferTexture2DEXT_remap_index }, + { 10201, FramebufferTexture3DEXT_remap_index }, + { 21431, GenFramebuffersEXT_remap_index }, + { 16042, GenRenderbuffersEXT_remap_index }, + { 5897, GenerateMipmapEXT_remap_index }, + { 20009, GetFramebufferAttachmentParameterivEXT_remap_index }, { 29819, GetRenderbufferParameterivEXT_remap_index }, - { 18737, IsFramebufferEXT_remap_index }, + { 18744, IsFramebufferEXT_remap_index }, { 30566, IsRenderbufferEXT_remap_index }, - { 7353, RenderbufferStorageEXT_remap_index }, - { 651, BlitFramebufferEXT_remap_index }, - { 13144, BufferParameteriAPPLE_remap_index }, - { 17606, FlushMappedBufferRangeAPPLE_remap_index }, - { 2701, FramebufferTextureLayerEXT_remap_index }, - { 4956, ColorMaskIndexedEXT_remap_index }, - { 17232, DisableIndexedEXT_remap_index }, - { 24429, EnableIndexedEXT_remap_index }, - { 19973, GetBooleanIndexedvEXT_remap_index }, - { 9952, GetIntegerIndexedvEXT_remap_index }, - { 20898, IsEnabledIndexedEXT_remap_index }, - { 4074, BeginConditionalRenderNV_remap_index }, - { 23416, EndConditionalRenderNV_remap_index }, - { 8453, BeginTransformFeedbackEXT_remap_index }, - { 17256, BindBufferBaseEXT_remap_index }, - { 17126, BindBufferOffsetEXT_remap_index }, - { 11136, BindBufferRangeEXT_remap_index }, - { 13059, EndTransformFeedbackEXT_remap_index }, - { 9804, GetTransformFeedbackVaryingEXT_remap_index }, - { 19042, TransformFeedbackVaryingsEXT_remap_index }, - { 27165, ProvokingVertexEXT_remap_index }, - { 9752, GetTexParameterPointervAPPLE_remap_index }, - { 4436, TextureRangeAPPLE_remap_index }, - { 10567, GetObjectParameterivAPPLE_remap_index }, - { 18181, ObjectPurgeableAPPLE_remap_index }, - { 4985, ObjectUnpurgeableAPPLE_remap_index }, - { 26480, StencilFuncSeparateATI_remap_index }, - { 16555, ProgramEnvParameters4fvEXT_remap_index }, - { 19936, ProgramLocalParameters4fvEXT_remap_index }, - { 12927, GetQueryObjecti64vEXT_remap_index }, - { 9394, GetQueryObjectui64vEXT_remap_index }, - { 21926, EGLImageTargetRenderbufferStorageOES_remap_index }, - { 11054, EGLImageTargetTexture2DOES_remap_index }, + { 7392, RenderbufferStorageEXT_remap_index }, + { 690, BlitFramebufferEXT_remap_index }, + { 13151, BufferParameteriAPPLE_remap_index }, + { 17613, FlushMappedBufferRangeAPPLE_remap_index }, + { 2740, FramebufferTextureLayerEXT_remap_index }, + { 4613, ColorMaskIndexedEXT_remap_index }, + { 17239, DisableIndexedEXT_remap_index }, + { 24436, EnableIndexedEXT_remap_index }, + { 19980, GetBooleanIndexedvEXT_remap_index }, + { 9991, GetIntegerIndexedvEXT_remap_index }, + { 20905, IsEnabledIndexedEXT_remap_index }, + { 4113, BeginConditionalRenderNV_remap_index }, + { 23423, EndConditionalRenderNV_remap_index }, + { 8492, BeginTransformFeedbackEXT_remap_index }, + { 17263, BindBufferBaseEXT_remap_index }, + { 17133, BindBufferOffsetEXT_remap_index }, + { 11214, BindBufferRangeEXT_remap_index }, + { 13066, EndTransformFeedbackEXT_remap_index }, + { 9843, GetTransformFeedbackVaryingEXT_remap_index }, + { 19049, TransformFeedbackVaryingsEXT_remap_index }, + { 27204, ProvokingVertexEXT_remap_index }, + { 9791, GetTexParameterPointervAPPLE_remap_index }, + { 4475, TextureRangeAPPLE_remap_index }, + { 10606, GetObjectParameterivAPPLE_remap_index }, + { 18188, ObjectPurgeableAPPLE_remap_index }, + { 5024, ObjectUnpurgeableAPPLE_remap_index }, + { 26519, StencilFuncSeparateATI_remap_index }, + { 16562, ProgramEnvParameters4fvEXT_remap_index }, + { 19943, ProgramLocalParameters4fvEXT_remap_index }, + { 12934, GetQueryObjecti64vEXT_remap_index }, + { 9433, GetQueryObjectui64vEXT_remap_index }, + { 21933, EGLImageTargetRenderbufferStorageOES_remap_index }, + { 11093, 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 */ - { 2440, _gloffset_BlendColor }, + { 2479, _gloffset_BlendColor }, /* from GL_EXT_blend_minmax */ - { 10219, _gloffset_BlendEquation }, + { 10258, _gloffset_BlendEquation }, /* from GL_EXT_color_subtable */ - { 15623, _gloffset_ColorSubTable }, + { 15630, _gloffset_ColorSubTable }, { 29226, _gloffset_CopyColorSubTable }, /* from GL_EXT_convolution */ - { 213, _gloffset_ConvolutionFilter1D }, - { 2284, _gloffset_CopyConvolutionFilter1D }, - { 3624, _gloffset_GetConvolutionParameteriv }, - { 7702, _gloffset_ConvolutionFilter2D }, - { 7868, _gloffset_ConvolutionParameteriv }, - { 8328, _gloffset_ConvolutionParameterfv }, - { 18885, _gloffset_GetSeparableFilter }, - { 22156, _gloffset_SeparableFilter2D }, - { 22968, _gloffset_ConvolutionParameteri }, - { 23091, _gloffset_ConvolutionParameterf }, - { 24608, _gloffset_GetConvolutionParameterfv }, - { 25430, _gloffset_GetConvolutionFilter }, - { 27705, _gloffset_CopyConvolutionFilter2D }, + { 252, _gloffset_ConvolutionFilter1D }, + { 2323, _gloffset_CopyConvolutionFilter1D }, + { 3663, _gloffset_GetConvolutionParameteriv }, + { 7741, _gloffset_ConvolutionFilter2D }, + { 7907, _gloffset_ConvolutionParameteriv }, + { 8367, _gloffset_ConvolutionParameterfv }, + { 18892, _gloffset_GetSeparableFilter }, + { 22163, _gloffset_SeparableFilter2D }, + { 22975, _gloffset_ConvolutionParameteri }, + { 23098, _gloffset_ConvolutionParameterf }, + { 24615, _gloffset_GetConvolutionParameterfv }, + { 25469, _gloffset_GetConvolutionFilter }, + { 27744, _gloffset_CopyConvolutionFilter2D }, /* from GL_EXT_copy_texture */ - { 13803, _gloffset_CopyTexSubImage3D }, - { 15363, _gloffset_CopyTexImage2D }, - { 22576, _gloffset_CopyTexImage1D }, - { 25111, _gloffset_CopyTexSubImage2D }, - { 27343, _gloffset_CopyTexSubImage1D }, + { 13810, _gloffset_CopyTexSubImage3D }, + { 15370, _gloffset_CopyTexImage2D }, + { 22583, _gloffset_CopyTexImage1D }, + { 25150, _gloffset_CopyTexSubImage2D }, + { 27382, _gloffset_CopyTexSubImage1D }, /* from GL_EXT_draw_range_elements */ - { 8665, _gloffset_DrawRangeElements }, + { 8704, _gloffset_DrawRangeElements }, /* from GL_EXT_histogram */ - { 812, _gloffset_Histogram }, - { 3088, _gloffset_ResetHistogram }, - { 9065, _gloffset_GetMinmax }, - { 14137, _gloffset_GetHistogramParameterfv }, - { 22501, _gloffset_GetMinmaxParameteriv }, - { 24498, _gloffset_ResetMinmax }, - { 25327, _gloffset_GetHistogramParameteriv }, - { 26414, _gloffset_GetHistogram }, - { 28812, _gloffset_Minmax }, + { 851, _gloffset_Histogram }, + { 3127, _gloffset_ResetHistogram }, + { 9104, _gloffset_GetMinmax }, + { 14144, _gloffset_GetHistogramParameterfv }, + { 22508, _gloffset_GetMinmaxParameteriv }, + { 24505, _gloffset_ResetMinmax }, + { 25366, _gloffset_GetHistogramParameteriv }, + { 26453, _gloffset_GetHistogram }, + { 28851, _gloffset_Minmax }, { 30313, _gloffset_GetMinmaxParameterfv }, /* from GL_EXT_paletted_texture */ - { 7564, _gloffset_ColorTable }, - { 13983, _gloffset_GetColorTable }, - { 21171, _gloffset_GetColorTableParameterfv }, - { 23147, _gloffset_GetColorTableParameteriv }, + { 7603, _gloffset_ColorTable }, + { 13990, _gloffset_GetColorTable }, + { 21178, _gloffset_GetColorTableParameterfv }, + { 23154, _gloffset_GetColorTableParameteriv }, /* from GL_EXT_subtexture */ - { 6285, _gloffset_TexSubImage1D }, - { 9679, _gloffset_TexSubImage2D }, + { 6324, _gloffset_TexSubImage1D }, + { 9718, _gloffset_TexSubImage2D }, /* from GL_EXT_texture3D */ - { 1658, _gloffset_TexImage3D }, - { 20940, _gloffset_TexSubImage3D }, + { 1697, _gloffset_TexImage3D }, + { 20947, _gloffset_TexSubImage3D }, /* from GL_EXT_texture_object */ - { 2964, _gloffset_PrioritizeTextures }, - { 6734, _gloffset_AreTexturesResident }, - { 12382, _gloffset_GenTextures }, - { 14469, _gloffset_DeleteTextures }, - { 17887, _gloffset_IsTexture }, - { 27408, _gloffset_BindTexture }, + { 3003, _gloffset_PrioritizeTextures }, + { 6773, _gloffset_AreTexturesResident }, + { 12460, _gloffset_GenTextures }, + { 14476, _gloffset_DeleteTextures }, + { 17894, _gloffset_IsTexture }, + { 27447, _gloffset_BindTexture }, /* from GL_EXT_vertex_array */ - { 22328, _gloffset_ArrayElement }, - { 28400, _gloffset_GetPointerv }, + { 22335, _gloffset_ArrayElement }, + { 28439, _gloffset_GetPointerv }, { 29940, _gloffset_DrawArrays }, /* from GL_SGI_color_table */ - { 6852, _gloffset_ColorTableParameteriv }, - { 7564, _gloffset_ColorTable }, - { 13983, _gloffset_GetColorTable }, - { 14093, _gloffset_CopyColorTable }, - { 17748, _gloffset_ColorTableParameterfv }, - { 21171, _gloffset_GetColorTableParameterfv }, - { 23147, _gloffset_GetColorTableParameteriv }, + { 6891, _gloffset_ColorTableParameteriv }, + { 7603, _gloffset_ColorTable }, + { 13990, _gloffset_GetColorTable }, + { 14100, _gloffset_CopyColorTable }, + { 17755, _gloffset_ColorTableParameterfv }, + { 21178, _gloffset_GetColorTableParameterfv }, + { 23154, _gloffset_GetColorTableParameteriv }, /* from GL_VERSION_1_3 */ - { 381, _gloffset_MultiTexCoord3sARB }, - { 613, _gloffset_ActiveTextureARB }, - { 3761, _gloffset_MultiTexCoord1fvARB }, - { 5386, _gloffset_MultiTexCoord3dARB }, - { 5431, _gloffset_MultiTexCoord2iARB }, - { 5555, _gloffset_MultiTexCoord2svARB }, - { 7520, _gloffset_MultiTexCoord2fARB }, - { 9424, _gloffset_MultiTexCoord3fvARB }, - { 9981, _gloffset_MultiTexCoord4sARB }, - { 10615, _gloffset_MultiTexCoord2dvARB }, - { 10997, _gloffset_MultiTexCoord1svARB }, - { 11369, _gloffset_MultiTexCoord3svARB }, - { 11430, _gloffset_MultiTexCoord4iARB }, - { 12153, _gloffset_MultiTexCoord3iARB }, - { 12956, _gloffset_MultiTexCoord1dARB }, - { 13173, _gloffset_MultiTexCoord3dvARB }, - { 14337, _gloffset_MultiTexCoord3ivARB }, - { 14382, _gloffset_MultiTexCoord2sARB }, - { 15680, _gloffset_MultiTexCoord4ivARB }, - { 17398, _gloffset_ClientActiveTextureARB }, - { 19681, _gloffset_MultiTexCoord2dARB }, - { 20122, _gloffset_MultiTexCoord4dvARB }, - { 20433, _gloffset_MultiTexCoord4fvARB }, - { 21312, _gloffset_MultiTexCoord3fARB }, - { 23675, _gloffset_MultiTexCoord4dARB }, - { 23941, _gloffset_MultiTexCoord1sARB }, - { 24145, _gloffset_MultiTexCoord1dvARB }, - { 24955, _gloffset_MultiTexCoord1ivARB }, - { 25048, _gloffset_MultiTexCoord2ivARB }, - { 25387, _gloffset_MultiTexCoord1iARB }, - { 26689, _gloffset_MultiTexCoord4svARB }, - { 27207, _gloffset_MultiTexCoord1fARB }, - { 27470, _gloffset_MultiTexCoord4fARB }, + { 420, _gloffset_MultiTexCoord3sARB }, + { 652, _gloffset_ActiveTextureARB }, + { 3800, _gloffset_MultiTexCoord1fvARB }, + { 5425, _gloffset_MultiTexCoord3dARB }, + { 5470, _gloffset_MultiTexCoord2iARB }, + { 5594, _gloffset_MultiTexCoord2svARB }, + { 7559, _gloffset_MultiTexCoord2fARB }, + { 9463, _gloffset_MultiTexCoord3fvARB }, + { 10020, _gloffset_MultiTexCoord4sARB }, + { 10654, _gloffset_MultiTexCoord2dvARB }, + { 11036, _gloffset_MultiTexCoord1svARB }, + { 11447, _gloffset_MultiTexCoord3svARB }, + { 11508, _gloffset_MultiTexCoord4iARB }, + { 12231, _gloffset_MultiTexCoord3iARB }, + { 12963, _gloffset_MultiTexCoord1dARB }, + { 13180, _gloffset_MultiTexCoord3dvARB }, + { 14344, _gloffset_MultiTexCoord3ivARB }, + { 14389, _gloffset_MultiTexCoord2sARB }, + { 15687, _gloffset_MultiTexCoord4ivARB }, + { 17405, _gloffset_ClientActiveTextureARB }, + { 19688, _gloffset_MultiTexCoord2dARB }, + { 20129, _gloffset_MultiTexCoord4dvARB }, + { 20440, _gloffset_MultiTexCoord4fvARB }, + { 21319, _gloffset_MultiTexCoord3fARB }, + { 23682, _gloffset_MultiTexCoord4dARB }, + { 23948, _gloffset_MultiTexCoord1sARB }, + { 24152, _gloffset_MultiTexCoord1dvARB }, + { 24994, _gloffset_MultiTexCoord1ivARB }, + { 25087, _gloffset_MultiTexCoord2ivARB }, + { 25426, _gloffset_MultiTexCoord1iARB }, + { 26728, _gloffset_MultiTexCoord4svARB }, + { 27246, _gloffset_MultiTexCoord1fARB }, + { 27509, _gloffset_MultiTexCoord4fARB }, { 29774, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; @@ -5004,7 +5002,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[] = { - { 8386, -1 }, /* TbufferMask3DFX */ + { 8425, -1 }, /* TbufferMask3DFX */ { -1, -1 } }; #endif @@ -5075,7 +5073,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[] = { - { 11333, -1 }, /* FramebufferTextureLayer */ + { 11411, -1 }, /* FramebufferTextureLayer */ { -1, -1 } }; #endif @@ -5089,11 +5087,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[] = { - { 3339, -1 }, /* MatrixIndexusvARB */ - { 11974, -1 }, /* MatrixIndexuivARB */ - { 13295, -1 }, /* MatrixIndexPointerARB */ - { 18136, -1 }, /* CurrentPaletteMatrixARB */ - { 21056, -1 }, /* MatrixIndexubvARB */ + { 3378, -1 }, /* MatrixIndexusvARB */ + { 12052, -1 }, /* MatrixIndexuivARB */ + { 13302, -1 }, /* MatrixIndexPointerARB */ + { 18143, -1 }, /* CurrentPaletteMatrixARB */ + { 21063, -1 }, /* MatrixIndexubvARB */ { -1, -1 } }; #endif @@ -5170,14 +5168,14 @@ 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[] = { - { 2226, -1 }, /* WeightubvARB */ - { 5746, -1 }, /* WeightivARB */ - { 10084, -1 }, /* WeightPointerARB */ - { 12674, -1 }, /* WeightfvARB */ - { 16175, -1 }, /* WeightbvARB */ - { 19349, -1 }, /* WeightusvARB */ - { 22082, -1 }, /* VertexBlendARB */ - { 27291, -1 }, /* WeightsvARB */ + { 2265, -1 }, /* WeightubvARB */ + { 5785, -1 }, /* WeightivARB */ + { 10123, -1 }, /* WeightPointerARB */ + { 12720, -1 }, /* WeightfvARB */ + { 16182, -1 }, /* WeightbvARB */ + { 19356, -1 }, /* WeightusvARB */ + { 22089, -1 }, /* VertexBlendARB */ + { 27330, -1 }, /* WeightsvARB */ { 29276, -1 }, /* WeightdvARB */ { 29974, -1 }, /* WeightuivARB */ { -1, -1 } @@ -5249,7 +5247,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[] = { - { 2440, _gloffset_BlendColor }, + { 2479, _gloffset_BlendColor }, { -1, -1 } }; #endif @@ -5270,14 +5268,14 @@ 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[] = { - { 10219, _gloffset_BlendEquation }, + { 10258, _gloffset_BlendEquation }, { -1, -1 } }; #endif #if defined(need_GL_EXT_color_subtable) static const struct gl_function_remap GL_EXT_color_subtable_functions[] = { - { 15623, _gloffset_ColorSubTable }, + { 15630, _gloffset_ColorSubTable }, { 29226, _gloffset_CopyColorSubTable }, { -1, -1 } }; @@ -5292,42 +5290,42 @@ 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[] = { - { 213, _gloffset_ConvolutionFilter1D }, - { 2284, _gloffset_CopyConvolutionFilter1D }, - { 3624, _gloffset_GetConvolutionParameteriv }, - { 7702, _gloffset_ConvolutionFilter2D }, - { 7868, _gloffset_ConvolutionParameteriv }, - { 8328, _gloffset_ConvolutionParameterfv }, - { 18885, _gloffset_GetSeparableFilter }, - { 22156, _gloffset_SeparableFilter2D }, - { 22968, _gloffset_ConvolutionParameteri }, - { 23091, _gloffset_ConvolutionParameterf }, - { 24608, _gloffset_GetConvolutionParameterfv }, - { 25430, _gloffset_GetConvolutionFilter }, - { 27705, _gloffset_CopyConvolutionFilter2D }, + { 252, _gloffset_ConvolutionFilter1D }, + { 2323, _gloffset_CopyConvolutionFilter1D }, + { 3663, _gloffset_GetConvolutionParameteriv }, + { 7741, _gloffset_ConvolutionFilter2D }, + { 7907, _gloffset_ConvolutionParameteriv }, + { 8367, _gloffset_ConvolutionParameterfv }, + { 18892, _gloffset_GetSeparableFilter }, + { 22163, _gloffset_SeparableFilter2D }, + { 22975, _gloffset_ConvolutionParameteri }, + { 23098, _gloffset_ConvolutionParameterf }, + { 24615, _gloffset_GetConvolutionParameterfv }, + { 25469, _gloffset_GetConvolutionFilter }, + { 27744, _gloffset_CopyConvolutionFilter2D }, { -1, -1 } }; #endif #if defined(need_GL_EXT_coordinate_frame) static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { - { 9563, -1 }, /* TangentPointerEXT */ - { 11488, -1 }, /* Binormal3ivEXT */ - { 12106, -1 }, /* Tangent3sEXT */ - { 13360, -1 }, /* Tangent3fvEXT */ - { 17107, -1 }, /* Tangent3dvEXT */ - { 17834, -1 }, /* Binormal3bvEXT */ - { 18938, -1 }, /* Binormal3dEXT */ - { 20988, -1 }, /* Tangent3fEXT */ - { 23040, -1 }, /* Binormal3sEXT */ - { 23485, -1 }, /* Tangent3ivEXT */ - { 23504, -1 }, /* Tangent3dEXT */ - { 24372, -1 }, /* Binormal3svEXT */ - { 24853, -1 }, /* Binormal3fEXT */ - { 25705, -1 }, /* Binormal3dvEXT */ - { 26911, -1 }, /* Tangent3iEXT */ - { 27990, -1 }, /* Tangent3bvEXT */ - { 28435, -1 }, /* Tangent3bEXT */ + { 9602, -1 }, /* TangentPointerEXT */ + { 11566, -1 }, /* Binormal3ivEXT */ + { 12184, -1 }, /* Tangent3sEXT */ + { 13367, -1 }, /* Tangent3fvEXT */ + { 17114, -1 }, /* Tangent3dvEXT */ + { 17841, -1 }, /* Binormal3bvEXT */ + { 18945, -1 }, /* Binormal3dEXT */ + { 20995, -1 }, /* Tangent3fEXT */ + { 23047, -1 }, /* Binormal3sEXT */ + { 23492, -1 }, /* Tangent3ivEXT */ + { 23511, -1 }, /* Tangent3dEXT */ + { 24379, -1 }, /* Binormal3svEXT */ + { 24892, -1 }, /* Binormal3fEXT */ + { 25744, -1 }, /* Binormal3dvEXT */ + { 26950, -1 }, /* Tangent3iEXT */ + { 28029, -1 }, /* Tangent3bvEXT */ + { 28474, -1 }, /* Tangent3bEXT */ { 28999, -1 }, /* Binormal3fvEXT */ { 29673, -1 }, /* BinormalPointerEXT */ { 30078, -1 }, /* Tangent3svEXT */ @@ -5339,18 +5337,19 @@ static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { #if defined(need_GL_EXT_copy_texture) static const struct gl_function_remap GL_EXT_copy_texture_functions[] = { - { 13803, _gloffset_CopyTexSubImage3D }, - { 15363, _gloffset_CopyTexImage2D }, - { 22576, _gloffset_CopyTexImage1D }, - { 25111, _gloffset_CopyTexSubImage2D }, - { 27343, _gloffset_CopyTexSubImage1D }, + { 13810, _gloffset_CopyTexSubImage3D }, + { 15370, _gloffset_CopyTexImage2D }, + { 22583, _gloffset_CopyTexImage1D }, + { 25150, _gloffset_CopyTexSubImage2D }, + { 27382, _gloffset_CopyTexSubImage1D }, { -1, -1 } }; #endif #if defined(need_GL_EXT_cull_vertex) -/* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_EXT_cull_vertex_functions[] = { + { 8056, -1 }, /* CullParameterdvEXT */ + { 10699, -1 }, /* CullParameterfvEXT */ { -1, -1 } }; #endif @@ -5378,7 +5377,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[] = { - { 8665, _gloffset_DrawRangeElements }, + { 8704, _gloffset_DrawRangeElements }, { -1, -1 } }; #endif @@ -5420,15 +5419,15 @@ static const struct gl_function_remap GL_EXT_gpu_program_parameters_functions[] #if defined(need_GL_EXT_histogram) static const struct gl_function_remap GL_EXT_histogram_functions[] = { - { 812, _gloffset_Histogram }, - { 3088, _gloffset_ResetHistogram }, - { 9065, _gloffset_GetMinmax }, - { 14137, _gloffset_GetHistogramParameterfv }, - { 22501, _gloffset_GetMinmaxParameteriv }, - { 24498, _gloffset_ResetMinmax }, - { 25327, _gloffset_GetHistogramParameteriv }, - { 26414, _gloffset_GetHistogram }, - { 28812, _gloffset_Minmax }, + { 851, _gloffset_Histogram }, + { 3127, _gloffset_ResetHistogram }, + { 9104, _gloffset_GetMinmax }, + { 14144, _gloffset_GetHistogramParameterfv }, + { 22508, _gloffset_GetMinmaxParameteriv }, + { 24505, _gloffset_ResetMinmax }, + { 25366, _gloffset_GetHistogramParameteriv }, + { 26453, _gloffset_GetHistogram }, + { 28851, _gloffset_Minmax }, { 30313, _gloffset_GetMinmaxParameterfv }, { -1, -1 } }; @@ -5436,23 +5435,23 @@ static const struct gl_function_remap GL_EXT_histogram_functions[] = { #if defined(need_GL_EXT_index_func) static const struct gl_function_remap GL_EXT_index_func_functions[] = { - { 10446, -1 }, /* IndexFuncEXT */ + { 10485, -1 }, /* IndexFuncEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_index_material) static const struct gl_function_remap GL_EXT_index_material_functions[] = { - { 19436, -1 }, /* IndexMaterialEXT */ + { 19443, -1 }, /* IndexMaterialEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_light_texture) static const struct gl_function_remap GL_EXT_light_texture_functions[] = { - { 24392, -1 }, /* ApplyTextureEXT */ - { 24452, -1 }, /* TextureMaterialEXT */ - { 24477, -1 }, /* TextureLightEXT */ + { 24399, -1 }, /* ApplyTextureEXT */ + { 24459, -1 }, /* TextureMaterialEXT */ + { 24484, -1 }, /* TextureLightEXT */ { -1, -1 } }; #endif @@ -5473,19 +5472,19 @@ 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[] = { - { 7564, _gloffset_ColorTable }, - { 13983, _gloffset_GetColorTable }, - { 21171, _gloffset_GetColorTableParameterfv }, - { 23147, _gloffset_GetColorTableParameteriv }, + { 7603, _gloffset_ColorTable }, + { 13990, _gloffset_GetColorTable }, + { 21178, _gloffset_GetColorTableParameterfv }, + { 23154, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif #if defined(need_GL_EXT_pixel_transform) static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = { - { 20087, -1 }, /* PixelTransformParameterfEXT */ - { 20167, -1 }, /* PixelTransformParameteriEXT */ - { 28173, -1 }, /* PixelTransformParameterfvEXT */ + { 20094, -1 }, /* PixelTransformParameterfEXT */ + { 20174, -1 }, /* PixelTransformParameteriEXT */ + { 28212, -1 }, /* PixelTransformParameterfvEXT */ { 29637, -1 }, /* PixelTransformParameterivEXT */ { -1, -1 } }; @@ -5528,16 +5527,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[] = { - { 6285, _gloffset_TexSubImage1D }, - { 9679, _gloffset_TexSubImage2D }, + { 6324, _gloffset_TexSubImage1D }, + { 9718, _gloffset_TexSubImage2D }, { -1, -1 } }; #endif #if defined(need_GL_EXT_texture3D) static const struct gl_function_remap GL_EXT_texture3D_functions[] = { - { 1658, _gloffset_TexImage3D }, - { 20940, _gloffset_TexSubImage3D }, + { 1697, _gloffset_TexImage3D }, + { 20947, _gloffset_TexSubImage3D }, { -1, -1 } }; #endif @@ -5551,19 +5550,19 @@ static const struct gl_function_remap GL_EXT_texture_array_functions[] = { #if defined(need_GL_EXT_texture_object) static const struct gl_function_remap GL_EXT_texture_object_functions[] = { - { 2964, _gloffset_PrioritizeTextures }, - { 6734, _gloffset_AreTexturesResident }, - { 12382, _gloffset_GenTextures }, - { 14469, _gloffset_DeleteTextures }, - { 17887, _gloffset_IsTexture }, - { 27408, _gloffset_BindTexture }, + { 3003, _gloffset_PrioritizeTextures }, + { 6773, _gloffset_AreTexturesResident }, + { 12460, _gloffset_GenTextures }, + { 14476, _gloffset_DeleteTextures }, + { 17894, _gloffset_IsTexture }, + { 27447, _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[] = { - { 12624, -1 }, /* TextureNormalEXT */ + { 12670, -1 }, /* TextureNormalEXT */ { -1, -1 } }; #endif @@ -5585,8 +5584,8 @@ 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[] = { - { 22328, _gloffset_ArrayElement }, - { 28400, _gloffset_GetPointerv }, + { 22335, _gloffset_ArrayElement }, + { 28439, _gloffset_GetPointerv }, { 29940, _gloffset_DrawArrays }, { -1, -1 } }; @@ -5594,21 +5593,21 @@ static const struct gl_function_remap GL_EXT_vertex_array_functions[] = { #if defined(need_GL_EXT_vertex_weighting) static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { - { 17917, -1 }, /* VertexWeightfvEXT */ - { 24831, -1 }, /* VertexWeightfEXT */ - { 26383, -1 }, /* VertexWeightPointerEXT */ + { 17924, -1 }, /* VertexWeightfvEXT */ + { 24870, -1 }, /* VertexWeightfEXT */ + { 26422, -1 }, /* VertexWeightPointerEXT */ { -1, -1 } }; #endif #if defined(need_GL_HP_image_transform) static const struct gl_function_remap GL_HP_image_transform_functions[] = { - { 2157, -1 }, /* GetImageTransformParameterfvHP */ - { 3305, -1 }, /* ImageTransformParameterfHP */ - { 9257, -1 }, /* ImageTransformParameterfvHP */ - { 10915, -1 }, /* ImageTransformParameteriHP */ - { 11223, -1 }, /* GetImageTransformParameterivHP */ - { 17981, -1 }, /* ImageTransformParameterivHP */ + { 2196, -1 }, /* GetImageTransformParameterfvHP */ + { 3344, -1 }, /* ImageTransformParameterfHP */ + { 9296, -1 }, /* ImageTransformParameterfvHP */ + { 10954, -1 }, /* ImageTransformParameteriHP */ + { 11301, -1 }, /* GetImageTransformParameterivHP */ + { 17988, -1 }, /* ImageTransformParameterivHP */ { -1, -1 } }; #endif @@ -5622,13 +5621,13 @@ 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[] = { - { 3857, -1 }, /* SecondaryColorPointerListIBM */ - { 5252, -1 }, /* NormalPointerListIBM */ - { 6908, -1 }, /* FogCoordPointerListIBM */ - { 7215, -1 }, /* VertexPointerListIBM */ - { 10836, -1 }, /* ColorPointerListIBM */ - { 12213, -1 }, /* TexCoordPointerListIBM */ - { 12646, -1 }, /* IndexPointerListIBM */ + { 3896, -1 }, /* SecondaryColorPointerListIBM */ + { 5291, -1 }, /* NormalPointerListIBM */ + { 6947, -1 }, /* FogCoordPointerListIBM */ + { 7254, -1 }, /* VertexPointerListIBM */ + { 10875, -1 }, /* ColorPointerListIBM */ + { 12291, -1 }, /* TexCoordPointerListIBM */ + { 12692, -1 }, /* IndexPointerListIBM */ { 30256, -1 }, /* EdgeFlagPointerListIBM */ { -1, -1 } }; @@ -5643,10 +5642,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[] = { - { 11600, -1 }, /* VertexPointervINTEL */ - { 14230, -1 }, /* ColorPointervINTEL */ - { 27679, -1 }, /* NormalPointervINTEL */ - { 28105, -1 }, /* TexCoordPointervINTEL */ + { 11678, -1 }, /* VertexPointervINTEL */ + { 14237, -1 }, /* ColorPointervINTEL */ + { 27718, -1 }, /* NormalPointervINTEL */ + { 28144, -1 }, /* TexCoordPointervINTEL */ { -1, -1 } }; #endif @@ -5660,10 +5659,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[] = { - { 1522, -1 }, /* GetDebugLogLengthMESA */ - { 3063, -1 }, /* ClearDebugLogMESA */ - { 4018, -1 }, /* GetDebugLogMESA */ - { 28593, -1 }, /* CreateDebugObjectMESA */ + { 1561, -1 }, /* GetDebugLogLengthMESA */ + { 3102, -1 }, /* ClearDebugLogMESA */ + { 4057, -1 }, /* GetDebugLogMESA */ + { 28632, -1 }, /* CreateDebugObjectMESA */ { -1, -1 } }; #endif @@ -5684,15 +5683,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[] = { - { 5947, -1 }, /* GetMapAttribParameterivNV */ - { 7670, -1 }, /* MapControlPointsNV */ - { 7769, -1 }, /* MapParameterfvNV */ - { 9662, -1 }, /* EvalMapsNV */ - { 15845, -1 }, /* GetMapAttribParameterfvNV */ - { 16011, -1 }, /* MapParameterivNV */ - { 22891, -1 }, /* GetMapParameterivNV */ - { 23389, -1 }, /* GetMapParameterfvNV */ - { 27015, -1 }, /* GetMapControlPointsNV */ + { 5986, -1 }, /* GetMapAttribParameterivNV */ + { 7709, -1 }, /* MapControlPointsNV */ + { 7808, -1 }, /* MapParameterfvNV */ + { 9701, -1 }, /* EvalMapsNV */ + { 15852, -1 }, /* GetMapAttribParameterfvNV */ + { 16018, -1 }, /* MapParameterivNV */ + { 22898, -1 }, /* GetMapParameterivNV */ + { 23396, -1 }, /* GetMapParameterfvNV */ + { 27054, -1 }, /* GetMapControlPointsNV */ { -1, -1 } }; #endif @@ -5727,8 +5726,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[] = { - { 14700, -1 }, /* CombinerStageParameterfvNV */ - { 15015, -1 }, /* GetCombinerStageParameterfvNV */ + { 14707, -1 }, /* CombinerStageParameterfvNV */ + { 15022, -1 }, /* GetCombinerStageParameterfvNV */ { -1, -1 } }; #endif @@ -5756,23 +5755,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[] = { - { 7854, -1 }, /* HintPGI */ + { 7893, -1 }, /* HintPGI */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_detail_texture) static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = { - { 14988, -1 }, /* GetDetailTexFuncSGIS */ - { 15308, -1 }, /* DetailTexFuncSGIS */ + { 14995, -1 }, /* GetDetailTexFuncSGIS */ + { 15315, -1 }, /* DetailTexFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_fog_function) static const struct gl_function_remap GL_SGIS_fog_function_functions[] = { - { 25093, -1 }, /* FogFuncSGIS */ - { 25758, -1 }, /* GetFogFuncSGIS */ + { 25132, -1 }, /* FogFuncSGIS */ + { 25797, -1 }, /* GetFogFuncSGIS */ { -1, -1 } }; #endif @@ -5800,42 +5799,42 @@ 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[] = { - { 6008, -1 }, /* GetSharpenTexFuncSGIS */ - { 20407, -1 }, /* SharpenTexFuncSGIS */ + { 6047, -1 }, /* GetSharpenTexFuncSGIS */ + { 20414, -1 }, /* SharpenTexFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture4D) static const struct gl_function_remap GL_SGIS_texture4D_functions[] = { - { 894, -1 }, /* TexImage4DSGIS */ - { 14538, -1 }, /* TexSubImage4DSGIS */ + { 933, -1 }, /* TexImage4DSGIS */ + { 14545, -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[] = { - { 13936, -1 }, /* TextureColorMaskSGIS */ + { 13943, -1 }, /* TextureColorMaskSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture_filter4) static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = { - { 6185, -1 }, /* GetTexFilterFuncSGIS */ - { 15134, -1 }, /* TexFilterFuncSGIS */ + { 6224, -1 }, /* GetTexFilterFuncSGIS */ + { 15141, -1 }, /* TexFilterFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_async) static const struct gl_function_remap GL_SGIX_async_functions[] = { - { 3014, -1 }, /* AsyncMarkerSGIX */ - { 3997, -1 }, /* FinishAsyncSGIX */ - { 4762, -1 }, /* PollAsyncSGIX */ - { 20554, -1 }, /* DeleteAsyncMarkersSGIX */ - { 20609, -1 }, /* IsAsyncMarkerSGIX */ + { 3053, -1 }, /* AsyncMarkerSGIX */ + { 4036, -1 }, /* FinishAsyncSGIX */ + { 4830, -1 }, /* PollAsyncSGIX */ + { 20561, -1 }, /* DeleteAsyncMarkersSGIX */ + { 20616, -1 }, /* IsAsyncMarkerSGIX */ { 30053, -1 }, /* GenAsyncMarkersSGIX */ { -1, -1 } }; @@ -5843,29 +5842,29 @@ static const struct gl_function_remap GL_SGIX_async_functions[] = { #if defined(need_GL_SGIX_flush_raster) static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = { - { 6562, -1 }, /* FlushRasterSGIX */ + { 6601, -1 }, /* FlushRasterSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_fragment_lighting) static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { - { 2410, -1 }, /* FragmentMaterialfvSGIX */ - { 4713, -1 }, /* FragmentLightiSGIX */ - { 5688, -1 }, /* GetFragmentMaterialfvSGIX */ - { 7282, -1 }, /* FragmentMaterialfSGIX */ - { 7443, -1 }, /* GetFragmentLightivSGIX */ - { 8280, -1 }, /* FragmentLightModeliSGIX */ - { 9725, -1 }, /* FragmentLightivSGIX */ - { 10027, -1 }, /* GetFragmentMaterialivSGIX */ - { 17804, -1 }, /* FragmentLightModelfSGIX */ - { 18104, -1 }, /* FragmentColorMaterialSGIX */ - { 18504, -1 }, /* FragmentMaterialiSGIX */ - { 19764, -1 }, /* LightEnviSGIX */ - { 21263, -1 }, /* FragmentLightModelfvSGIX */ - { 21572, -1 }, /* FragmentLightfvSGIX */ - { 26142, -1 }, /* FragmentLightModelivSGIX */ - { 26265, -1 }, /* FragmentLightfSGIX */ + { 2449, -1 }, /* FragmentMaterialfvSGIX */ + { 4781, -1 }, /* FragmentLightiSGIX */ + { 5727, -1 }, /* GetFragmentMaterialfvSGIX */ + { 7321, -1 }, /* FragmentMaterialfSGIX */ + { 7482, -1 }, /* GetFragmentLightivSGIX */ + { 8319, -1 }, /* FragmentLightModeliSGIX */ + { 9764, -1 }, /* FragmentLightivSGIX */ + { 10066, -1 }, /* GetFragmentMaterialivSGIX */ + { 17811, -1 }, /* FragmentLightModelfSGIX */ + { 18111, -1 }, /* FragmentColorMaterialSGIX */ + { 18511, -1 }, /* FragmentMaterialiSGIX */ + { 19771, -1 }, /* LightEnviSGIX */ + { 21270, -1 }, /* FragmentLightModelfvSGIX */ + { 21579, -1 }, /* FragmentLightfvSGIX */ + { 26181, -1 }, /* FragmentLightModelivSGIX */ + { 26304, -1 }, /* FragmentLightfSGIX */ { 28969, -1 }, /* GetFragmentLightfvSGIX */ { 30536, -1 }, /* FragmentMaterialivSGIX */ { -1, -1 } @@ -5874,37 +5873,37 @@ static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { #if defined(need_GL_SGIX_framezoom) static const struct gl_function_remap GL_SGIX_framezoom_functions[] = { - { 20632, -1 }, /* FrameZoomSGIX */ + { 20639, -1 }, /* FrameZoomSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_igloo_interface) static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { - { 26573, -1 }, /* IglooInterfaceSGIX */ + { 26612, -1 }, /* IglooInterfaceSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_instruments) static const struct gl_function_remap GL_SGIX_instruments_functions[] = { - { 2573, -1 }, /* ReadInstrumentsSGIX */ - { 5764, -1 }, /* PollInstrumentsSGIX */ - { 9623, -1 }, /* GetInstrumentsSGIX */ - { 11811, -1 }, /* StartInstrumentsSGIX */ - { 14734, -1 }, /* StopInstrumentsSGIX */ - { 16388, -1 }, /* InstrumentsBufferSGIX */ + { 2612, -1 }, /* ReadInstrumentsSGIX */ + { 5803, -1 }, /* PollInstrumentsSGIX */ + { 9662, -1 }, /* GetInstrumentsSGIX */ + { 11889, -1 }, /* StartInstrumentsSGIX */ + { 14741, -1 }, /* StopInstrumentsSGIX */ + { 16395, -1 }, /* InstrumentsBufferSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_list_priority) static const struct gl_function_remap GL_SGIX_list_priority_functions[] = { - { 1125, -1 }, /* ListParameterfSGIX */ - { 2763, -1 }, /* GetListParameterfvSGIX */ - { 16303, -1 }, /* ListParameteriSGIX */ - { 17057, -1 }, /* ListParameterfvSGIX */ - { 19170, -1 }, /* ListParameterivSGIX */ + { 1164, -1 }, /* ListParameterfSGIX */ + { 2802, -1 }, /* GetListParameterfvSGIX */ + { 16310, -1 }, /* ListParameteriSGIX */ + { 17064, -1 }, /* ListParameterfvSGIX */ + { 19177, -1 }, /* ListParameterivSGIX */ { 30097, -1 }, /* GetListParameterivSGIX */ { -1, -1 } }; @@ -5919,47 +5918,47 @@ 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[] = { - { 3251, -1 }, /* LoadIdentityDeformationMapSGIX */ - { 14834, -1 }, /* DeformSGIX */ - { 22440, -1 }, /* DeformationMap3fSGIX */ - { 28857, -1 }, /* DeformationMap3dSGIX */ + { 3290, -1 }, /* LoadIdentityDeformationMapSGIX */ + { 11175, -1 }, /* DeformationMap3dSGIX */ + { 14841, -1 }, /* DeformSGIX */ + { 22447, -1 }, /* DeformationMap3fSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_reference_plane) static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { - { 13487, -1 }, /* ReferencePlaneSGIX */ + { 13494, -1 }, /* ReferencePlaneSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_sprite) static const struct gl_function_remap GL_SGIX_sprite_functions[] = { - { 8778, -1 }, /* SpriteParameterfvSGIX */ - { 18959, -1 }, /* SpriteParameteriSGIX */ - { 24532, -1 }, /* SpriteParameterfSGIX */ - { 27137, -1 }, /* SpriteParameterivSGIX */ + { 8817, -1 }, /* SpriteParameterfvSGIX */ + { 18966, -1 }, /* SpriteParameteriSGIX */ + { 24539, -1 }, /* SpriteParameterfSGIX */ + { 27176, -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[] = { - { 19018, -1 }, /* TagSampleBufferSGIX */ + { 19025, -1 }, /* TagSampleBufferSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGI_color_table) static const struct gl_function_remap GL_SGI_color_table_functions[] = { - { 6852, _gloffset_ColorTableParameteriv }, - { 7564, _gloffset_ColorTable }, - { 13983, _gloffset_GetColorTable }, - { 14093, _gloffset_CopyColorTable }, - { 17748, _gloffset_ColorTableParameterfv }, - { 21171, _gloffset_GetColorTableParameterfv }, - { 23147, _gloffset_GetColorTableParameteriv }, + { 6891, _gloffset_ColorTableParameteriv }, + { 7603, _gloffset_ColorTable }, + { 13990, _gloffset_GetColorTable }, + { 14100, _gloffset_CopyColorTable }, + { 17755, _gloffset_ColorTableParameterfv }, + { 21178, _gloffset_GetColorTableParameterfv }, + { 23154, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif @@ -5973,80 +5972,80 @@ static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { #if defined(need_GL_SUN_global_alpha) static const struct gl_function_remap GL_SUN_global_alpha_functions[] = { - { 3035, -1 }, /* GlobalAlphaFactorubSUN */ - { 4224, -1 }, /* GlobalAlphaFactoriSUN */ - { 5789, -1 }, /* GlobalAlphaFactordSUN */ - { 8862, -1 }, /* GlobalAlphaFactoruiSUN */ - { 9214, -1 }, /* GlobalAlphaFactorbSUN */ - { 12126, -1 }, /* GlobalAlphaFactorfSUN */ - { 12245, -1 }, /* GlobalAlphaFactorusSUN */ - { 20871, -1 }, /* GlobalAlphaFactorsSUN */ + { 3074, -1 }, /* GlobalAlphaFactorubSUN */ + { 4263, -1 }, /* GlobalAlphaFactoriSUN */ + { 5828, -1 }, /* GlobalAlphaFactordSUN */ + { 8901, -1 }, /* GlobalAlphaFactoruiSUN */ + { 9253, -1 }, /* GlobalAlphaFactorbSUN */ + { 12204, -1 }, /* GlobalAlphaFactorfSUN */ + { 12323, -1 }, /* GlobalAlphaFactorusSUN */ + { 20878, -1 }, /* GlobalAlphaFactorsSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_mesh_array) static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { - { 26949, -1 }, /* DrawMeshArraysSUN */ + { 26988, -1 }, /* DrawMeshArraysSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_triangle_list) static const struct gl_function_remap GL_SUN_triangle_list_functions[] = { - { 3971, -1 }, /* ReplacementCodeubSUN */ - { 5600, -1 }, /* ReplacementCodeubvSUN */ - { 17469, -1 }, /* ReplacementCodeusvSUN */ - { 17657, -1 }, /* ReplacementCodePointerSUN */ - { 19828, -1 }, /* ReplacementCodeuiSUN */ - { 20583, -1 }, /* ReplacementCodeusSUN */ - { 27594, -1 }, /* ReplacementCodeuivSUN */ + { 4010, -1 }, /* ReplacementCodeubSUN */ + { 5639, -1 }, /* ReplacementCodeubvSUN */ + { 17476, -1 }, /* ReplacementCodeusvSUN */ + { 17664, -1 }, /* ReplacementCodePointerSUN */ + { 19835, -1 }, /* ReplacementCodeuiSUN */ + { 20590, -1 }, /* ReplacementCodeusSUN */ + { 27633, -1 }, /* ReplacementCodeuivSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_vertex) static const struct gl_function_remap GL_SUN_vertex_functions[] = { - { 999, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */ - { 1197, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */ - { 1423, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */ - { 1699, -1 }, /* ReplacementCodeuiVertex3fvSUN */ - { 1833, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */ - { 2346, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */ - { 2642, -1 }, /* Color4ubVertex3fvSUN */ - { 4105, -1 }, /* Color4ubVertex3fSUN */ - { 4181, -1 }, /* TexCoord2fVertex3fSUN */ - { 4508, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */ - { 4866, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */ - { 5495, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ - { 6240, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ - { 6599, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ - { 7311, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ - { 8079, -1 }, /* Color3fVertex3fSUN */ - { 9173, -1 }, /* Color3fVertex3fvSUN */ - { 9588, -1 }, /* Color4fNormal3fVertex3fvSUN */ - { 10325, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ - { 11674, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ - { 13218, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ - { 13629, -1 }, /* TexCoord2fColor3fVertex3fSUN */ - { 14759, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ - { 15093, -1 }, /* Color4ubVertex2fvSUN */ - { 15333, -1 }, /* Normal3fVertex3fSUN */ - { 16329, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ - { 16590, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ - { 17298, -1 }, /* TexCoord2fVertex3fvSUN */ - { 18074, -1 }, /* Color4ubVertex2fSUN */ - { 18295, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ - { 20253, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ - { 20651, -1 }, /* Normal3fVertex3fvSUN */ - { 21080, -1 }, /* Color4fNormal3fVertex3fSUN */ - { 21989, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ - { 23984, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ - { 25209, -1 }, /* TexCoord4fVertex4fSUN */ - { 25635, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ - { 25986, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ - { 26113, -1 }, /* TexCoord4fVertex4fvSUN */ - { 26821, -1 }, /* ReplacementCodeuiVertex3fSUN */ + { 1038, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */ + { 1236, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */ + { 1462, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */ + { 1738, -1 }, /* ReplacementCodeuiVertex3fvSUN */ + { 1872, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */ + { 2385, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */ + { 2681, -1 }, /* Color4ubVertex3fvSUN */ + { 4144, -1 }, /* Color4ubVertex3fSUN */ + { 4220, -1 }, /* TexCoord2fVertex3fSUN */ + { 4547, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */ + { 4934, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */ + { 5534, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ + { 6279, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ + { 6638, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ + { 7350, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ + { 8118, -1 }, /* Color3fVertex3fSUN */ + { 9212, -1 }, /* Color3fVertex3fvSUN */ + { 9627, -1 }, /* Color4fNormal3fVertex3fvSUN */ + { 10364, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ + { 11752, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ + { 13225, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ + { 13636, -1 }, /* TexCoord2fColor3fVertex3fSUN */ + { 14766, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ + { 15100, -1 }, /* Color4ubVertex2fvSUN */ + { 15340, -1 }, /* Normal3fVertex3fSUN */ + { 16336, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ + { 16597, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ + { 17305, -1 }, /* TexCoord2fVertex3fvSUN */ + { 18081, -1 }, /* Color4ubVertex2fSUN */ + { 18302, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ + { 20260, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ + { 20658, -1 }, /* Normal3fVertex3fvSUN */ + { 21087, -1 }, /* Color4fNormal3fVertex3fSUN */ + { 21996, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ + { 23991, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ + { 25248, -1 }, /* TexCoord4fVertex4fSUN */ + { 25674, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ + { 26025, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ + { 26152, -1 }, /* TexCoord4fVertex4fvSUN */ + { 26860, -1 }, /* ReplacementCodeuiVertex3fSUN */ { -1, -1 } }; #endif @@ -6054,39 +6053,39 @@ 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[] = { - { 381, _gloffset_MultiTexCoord3sARB }, - { 613, _gloffset_ActiveTextureARB }, - { 3761, _gloffset_MultiTexCoord1fvARB }, - { 5386, _gloffset_MultiTexCoord3dARB }, - { 5431, _gloffset_MultiTexCoord2iARB }, - { 5555, _gloffset_MultiTexCoord2svARB }, - { 7520, _gloffset_MultiTexCoord2fARB }, - { 9424, _gloffset_MultiTexCoord3fvARB }, - { 9981, _gloffset_MultiTexCoord4sARB }, - { 10615, _gloffset_MultiTexCoord2dvARB }, - { 10997, _gloffset_MultiTexCoord1svARB }, - { 11369, _gloffset_MultiTexCoord3svARB }, - { 11430, _gloffset_MultiTexCoord4iARB }, - { 12153, _gloffset_MultiTexCoord3iARB }, - { 12956, _gloffset_MultiTexCoord1dARB }, - { 13173, _gloffset_MultiTexCoord3dvARB }, - { 14337, _gloffset_MultiTexCoord3ivARB }, - { 14382, _gloffset_MultiTexCoord2sARB }, - { 15680, _gloffset_MultiTexCoord4ivARB }, - { 17398, _gloffset_ClientActiveTextureARB }, - { 19681, _gloffset_MultiTexCoord2dARB }, - { 20122, _gloffset_MultiTexCoord4dvARB }, - { 20433, _gloffset_MultiTexCoord4fvARB }, - { 21312, _gloffset_MultiTexCoord3fARB }, - { 23675, _gloffset_MultiTexCoord4dARB }, - { 23941, _gloffset_MultiTexCoord1sARB }, - { 24145, _gloffset_MultiTexCoord1dvARB }, - { 24955, _gloffset_MultiTexCoord1ivARB }, - { 25048, _gloffset_MultiTexCoord2ivARB }, - { 25387, _gloffset_MultiTexCoord1iARB }, - { 26689, _gloffset_MultiTexCoord4svARB }, - { 27207, _gloffset_MultiTexCoord1fARB }, - { 27470, _gloffset_MultiTexCoord4fARB }, + { 420, _gloffset_MultiTexCoord3sARB }, + { 652, _gloffset_ActiveTextureARB }, + { 3800, _gloffset_MultiTexCoord1fvARB }, + { 5425, _gloffset_MultiTexCoord3dARB }, + { 5470, _gloffset_MultiTexCoord2iARB }, + { 5594, _gloffset_MultiTexCoord2svARB }, + { 7559, _gloffset_MultiTexCoord2fARB }, + { 9463, _gloffset_MultiTexCoord3fvARB }, + { 10020, _gloffset_MultiTexCoord4sARB }, + { 10654, _gloffset_MultiTexCoord2dvARB }, + { 11036, _gloffset_MultiTexCoord1svARB }, + { 11447, _gloffset_MultiTexCoord3svARB }, + { 11508, _gloffset_MultiTexCoord4iARB }, + { 12231, _gloffset_MultiTexCoord3iARB }, + { 12963, _gloffset_MultiTexCoord1dARB }, + { 13180, _gloffset_MultiTexCoord3dvARB }, + { 14344, _gloffset_MultiTexCoord3ivARB }, + { 14389, _gloffset_MultiTexCoord2sARB }, + { 15687, _gloffset_MultiTexCoord4ivARB }, + { 17405, _gloffset_ClientActiveTextureARB }, + { 19688, _gloffset_MultiTexCoord2dARB }, + { 20129, _gloffset_MultiTexCoord4dvARB }, + { 20440, _gloffset_MultiTexCoord4fvARB }, + { 21319, _gloffset_MultiTexCoord3fARB }, + { 23682, _gloffset_MultiTexCoord4dARB }, + { 23948, _gloffset_MultiTexCoord1sARB }, + { 24152, _gloffset_MultiTexCoord1dvARB }, + { 24994, _gloffset_MultiTexCoord1ivARB }, + { 25087, _gloffset_MultiTexCoord2ivARB }, + { 25426, _gloffset_MultiTexCoord1iARB }, + { 26728, _gloffset_MultiTexCoord4svARB }, + { 27246, _gloffset_MultiTexCoord1fARB }, + { 27509, _gloffset_MultiTexCoord4fARB }, { 29774, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index b35d09335d..6f6598db82 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -154,7 +154,6 @@ TNL_SOURCES = \ tnl/t_vb_texgen.c \ tnl/t_vb_texmat.c \ tnl/t_vb_vertex.c \ - tnl/t_vb_cull.c \ tnl/t_vb_fog.c \ tnl/t_vb_light.c \ tnl/t_vb_normals.c \ diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h index d110010f04..a6429869cb 100644 --- a/src/mesa/tnl/t_pipeline.h +++ b/src/mesa/tnl/t_pipeline.h @@ -44,7 +44,6 @@ extern void _tnl_install_pipeline( GLcontext *ctx, /* These are implemented in the t_vb_*.c files: */ extern const struct tnl_pipeline_stage _tnl_vertex_transform_stage; -extern const struct tnl_pipeline_stage _tnl_vertex_cull_stage; extern const struct tnl_pipeline_stage _tnl_normal_transform_stage; extern const struct tnl_pipeline_stage _tnl_lighting_stage; extern const struct tnl_pipeline_stage _tnl_fog_coordinate_stage; diff --git a/src/mesa/tnl/t_vb_cull.c b/src/mesa/tnl/t_vb_cull.c deleted file mode 100644 index 22df716673..0000000000 --- a/src/mesa/tnl/t_vb_cull.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "math/m_xform.h" - -#include "t_context.h" -#include "t_pipeline.h" - - - -/* EXT_vertex_cull. Not really a big win, but probably depends on - * your application. This stage not included in the default pipeline. - */ -static GLboolean run_cull_stage( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - - const GLfloat a = ctx->Transform.CullObjPos[0]; - const GLfloat b = ctx->Transform.CullObjPos[1]; - const GLfloat c = ctx->Transform.CullObjPos[2]; - GLfloat *norm = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - GLuint stride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - GLuint count = VB->Count; - GLuint i; - - if (ctx->VertexProgram._Current || - !ctx->Transform.CullVertexFlag) - return GL_TRUE; - - VB->ClipOrMask &= ~CLIP_CULL_BIT; - VB->ClipAndMask |= CLIP_CULL_BIT; - - for (i = 0 ; i < count ; i++) { - GLfloat dp = (norm[0] * a + - norm[1] * b + - norm[2] * c); - - if (dp < 0) { - VB->ClipMask[i] |= CLIP_CULL_BIT; - VB->ClipOrMask |= CLIP_CULL_BIT; - } - else { - VB->ClipMask[i] &= ~CLIP_CULL_BIT; - VB->ClipAndMask &= ~CLIP_CULL_BIT; - } - - STRIDE_F(norm, stride); - } - - return !(VB->ClipAndMask & CLIP_CULL_BIT); -} - - - -const struct tnl_pipeline_stage _tnl_vertex_cull_stage = -{ - "EXT_cull_vertex", - NULL, /* private data */ - NULL, /* ctr */ - NULL, /* destructor */ - NULL, - run_cull_stage /* run -- initially set to init */ -}; -- cgit v1.2.3 From 8b2d5f431f8c862374d3e352f228b016060cd70a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 20 Sep 2010 15:41:39 +0200 Subject: Remove unnescessary initializations of UpdateTexturePalette This is already NULL'ed in _mesa_init_driver_functions. --- src/mesa/drivers/dri/intel/intel_tex.c | 1 - src/mesa/drivers/dri/mach64/mach64_tex.c | 2 -- src/mesa/drivers/dri/unichrome/via_tex.c | 1 - src/mesa/state_tracker/st_cb_texture.c | 1 - 4 files changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 49b7d5ef6b..e2bff0878a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -203,7 +203,6 @@ intelInitTextureFuncs(struct dd_function_table *functions) functions->NewTextureImage = intelNewTextureImage; functions->DeleteTexture = intelDeleteTextureObject; functions->FreeTexImageData = intelFreeTextureImageData; - functions->UpdateTexturePalette = 0; #if DO_DEBUG && !defined(__ia64__) if (INTEL_DEBUG & DEBUG_BUFMGR) diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 1bce967d58..09367be5b4 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -559,7 +559,5 @@ void mach64InitTextureFuncs( struct dd_function_table *functions ) functions->DeleteTexture = mach64DDDeleteTexture; functions->IsTextureResident = driIsTextureResident; - functions->UpdateTexturePalette = NULL; - driInitTextureFormats(); } diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index e55129c6da..49426fef8d 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -951,7 +951,6 @@ void viaInitTextureFuncs(struct dd_function_table * functions) functions->TextureMemCpy = memcpy; #endif - functions->UpdateTexturePalette = 0; functions->IsTextureResident = viaIsTextureResident; } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 526417df3b..9d232d417e 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1998,7 +1998,6 @@ st_init_texture_functions(struct dd_function_table *functions) functions->NewTextureImage = st_NewTextureImage; functions->DeleteTexture = st_DeleteTextureObject; functions->FreeTexImageData = st_FreeTextureImageData; - functions->UpdateTexturePalette = 0; functions->TextureMemCpy = do_memcpy; -- cgit v1.2.3 From 11ba8bafdbb31f40ecbb6478e26496b547d34c68 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 14:38:51 -0700 Subject: i965: Fix up writemasked assignments in the new FS. Not sure how I managed to get tests to succeed without this. +54 piglits. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 2b517375eb..cf3e4e6ae8 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -868,9 +868,9 @@ fs_visitor::visit(ir_assignment *ir) inst = emit(fs_inst(BRW_OPCODE_MOV, l, r)); if (ir->condition) inst->predicated = true; + r.reg_offset++; } l.reg_offset++; - r.reg_offset++; } } -- cgit v1.2.3 From a5c6c8a31b240729baa12e2eca0ef53199efeed2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 15:10:34 -0700 Subject: i965: Remove swizzling of assignment to vector-splitting single-channel LHS. We'd end up reading some non-x component of the float RHS. +53 piglits. --- src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp index 9b58916cf2..83b4af05bc 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -319,8 +319,6 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) ir->write_mask = (1 << 0); handle_rvalue(&ir->rhs); - ir->rhs = new(mem_ctx) ir_swizzle(ir->rhs, - elem, elem, elem, elem, 1); } else { handle_rvalue(&ir->rhs); } -- cgit v1.2.3 From 169ff0cc9d189f5a00a2a94313a6ce1503d1d5b9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 16:11:18 -0700 Subject: i965: Handle all_equal/any_nequal in the new FS. These are generated for scalar operands instead of plain equal/nequal. But for scalars, they're the same anyway. +30 piglits. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index cf3e4e6ae8..9d022e07fb 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -725,11 +725,13 @@ fs_visitor::visit(ir_expression *ir) 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_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; emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); @@ -750,8 +752,6 @@ fs_visitor::visit(ir_expression *ir) case ir_binop_dot: case ir_binop_cross: case ir_unop_any: - case ir_binop_all_equal: - case ir_binop_any_nequal: assert(!"not reached: should be handled by brw_fs_channel_expressions"); break; -- cgit v1.2.3 From 3610e0c1a0edc87cef32b7d5d3f4d9004e31f6c4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 18:29:15 -0700 Subject: i965: Fix vector splitting RHS channel selection with sparse writemasks. Fixes: glsl-fs-all-02 glsl-fs-dot-vec2 --- src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp index 83b4af05bc..552254df87 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -264,8 +264,10 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) variable_entry *rhs = rhs_deref ? get_splitting_entry(rhs_deref->var) : NULL; if (lhs_deref && rhs_deref && (lhs || rhs) && !ir->condition) { + unsigned int rhs_chan = 0; + /* Straight assignment of vector variables. */ - for (unsigned int i = 0; i < ir->rhs->type->vector_elements; i++) { + for (unsigned int i = 0; i < ir->lhs->type->vector_elements; i++) { ir_dereference *new_lhs; ir_rvalue *new_rhs; void *mem_ctx = lhs ? lhs->mem_ctx : rhs->mem_ctx; @@ -283,15 +285,18 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) } if (rhs) { - new_rhs = new(mem_ctx) ir_dereference_variable(rhs->components[i]); + new_rhs = + new(mem_ctx) ir_dereference_variable(rhs->components[rhs_chan]); } else { new_rhs = new(mem_ctx) ir_swizzle(ir->rhs->clone(mem_ctx, NULL), - i, i, i, i, 1); + rhs_chan, 0, 0, 0, 1); } ir->insert_before(new(mem_ctx) ir_assignment(new_lhs, new_rhs, NULL, writemask)); + + rhs_chan++; } ir->remove(); } else if (lhs) { -- cgit v1.2.3 From 94d44c33c0ced34e222517ed9c3b72d3c5e3b9f0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 18:31:53 -0700 Subject: i965: Add support for dFdx()/dFdy() to the FS backend. Fixes: glsl-fwidth glsl-derivs-swizzle --- src/mesa/drivers/dri/i965/brw_fs.cpp | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 9d022e07fb..7f2bf84a14 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -428,6 +428,8 @@ public: void generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src); void generate_math(fs_inst *inst, struct brw_reg dst, struct brw_reg *src); void generate_discard(fs_inst *inst); + void generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src); + void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src); void emit_dummy_fs(); void emit_interpolation(); @@ -1496,6 +1498,69 @@ fs_visitor::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src) BRW_SAMPLER_SIMD_MODE_SIMD8); } + +/* For OPCODE_DDX and OPCODE_DDY, per channel of output we've got input + * looking like: + * + * arg0: ss0.tl ss0.tr ss0.bl ss0.br ss1.tl ss1.tr ss1.bl ss1.br + * + * and we're trying to produce: + * + * DDX DDY + * dst: (ss0.tr - ss0.tl) (ss0.tl - ss0.bl) + * (ss0.tr - ss0.tl) (ss0.tr - ss0.br) + * (ss0.br - ss0.bl) (ss0.tl - ss0.bl) + * (ss0.br - ss0.bl) (ss0.tr - ss0.br) + * (ss1.tr - ss1.tl) (ss1.tl - ss1.bl) + * (ss1.tr - ss1.tl) (ss1.tr - ss1.br) + * (ss1.br - ss1.bl) (ss1.tl - ss1.bl) + * (ss1.br - ss1.bl) (ss1.tr - ss1.br) + * + * and add another set of two more subspans if in 16-pixel dispatch mode. + * + * For DDX, it ends up being easy: width = 2, horiz=0 gets us the same result + * for each pair, and vertstride = 2 jumps us 2 elements after processing a + * pair. But for DDY, it's harder, as we want to produce the pairs swizzled + * between each other. We could probably do it like ddx and swizzle the right + * order later, but bail for now and just produce + * ((ss0.tl - ss0.bl)x4 (ss1.tl - ss1.bl)x4) + */ +void +fs_visitor::generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src) +{ + struct brw_reg src0 = brw_reg(src.file, src.nr, 1, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_2, + BRW_WIDTH_2, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + struct brw_reg src1 = brw_reg(src.file, src.nr, 0, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_2, + BRW_WIDTH_2, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + brw_ADD(p, dst, src0, negate(src1)); +} + +void +fs_visitor::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src) +{ + struct brw_reg src0 = brw_reg(src.file, src.nr, 0, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_4, + BRW_WIDTH_4, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + struct brw_reg src1 = brw_reg(src.file, src.nr, 2, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_4, + BRW_WIDTH_4, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + brw_ADD(p, dst, src0, negate(src1)); +} + void fs_visitor::generate_discard(fs_inst *inst) { @@ -1795,6 +1860,12 @@ fs_visitor::generate_code() case FS_OPCODE_DISCARD: generate_discard(inst); break; + case FS_OPCODE_DDX: + generate_ddx(inst, dst, src[0]); + break; + case FS_OPCODE_DDY: + generate_ddy(inst, dst, src[0]); + break; case FS_OPCODE_FB_WRITE: generate_fb_write(inst); break; -- cgit v1.2.3 From 82f8e43bfa27b0318b01674e2a273c06becae263 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 28 Sep 2010 02:20:26 +0200 Subject: r300g: code cleanups Some random stuff I had here. 1) Fixed some misleading comments. 2) Removed fake_npot, since it's redundant. 3) lower_texture_rect -> scale_texcoords 4) Reordered and reindented some TEX transform code. --- src/gallium/drivers/r300/r300_fs.c | 55 ++--- src/mesa/drivers/dri/r300/compiler/radeon_code.h | 16 +- .../drivers/dri/r300/compiler/radeon_program_tex.c | 265 ++++++++++----------- 3 files changed, 156 insertions(+), 180 deletions(-) (limited to 'src/mesa') diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index b8dab88ef0..3f89987897 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -150,12 +150,16 @@ static void get_external_state( unsigned char *swizzle; for (i = 0; i < texstate->sampler_state_count; i++) { - struct r300_sampler_state* s = texstate->sampler_states[i]; + struct r300_sampler_state *s = texstate->sampler_states[i]; + struct r300_sampler_view *v = texstate->sampler_views[i]; + struct r300_texture *t; - if (!s) { + if (!s || !v) { continue; } + t = r300_texture(texstate->sampler_views[i]->base.texture); + if (s->state.compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) { state->unit[i].compare_mode_enabled = 1; @@ -176,34 +180,25 @@ static void get_external_state( state->unit[i].non_normalized_coords = !s->state.normalized_coords; - if (texstate->sampler_views[i]) { - struct r300_texture *t; - t = (struct r300_texture*)texstate->sampler_views[i]->base.texture; - - /* XXX this should probably take into account STR, not just S. */ - if (t->desc.is_npot) { - switch (s->state.wrap_s) { - case PIPE_TEX_WRAP_REPEAT: - state->unit[i].wrap_mode = RC_WRAP_REPEAT; - state->unit[i].fake_npot = TRUE; - break; - - case PIPE_TEX_WRAP_MIRROR_REPEAT: - state->unit[i].wrap_mode = RC_WRAP_MIRRORED_REPEAT; - state->unit[i].fake_npot = TRUE; - break; - - case PIPE_TEX_WRAP_MIRROR_CLAMP: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: - state->unit[i].wrap_mode = RC_WRAP_MIRRORED_CLAMP; - state->unit[i].fake_npot = TRUE; - break; - - default: - state->unit[i].wrap_mode = RC_WRAP_NONE; - break; - } + /* XXX this should probably take into account STR, not just S. */ + if (t->desc.is_npot) { + switch (s->state.wrap_s) { + case PIPE_TEX_WRAP_REPEAT: + state->unit[i].wrap_mode = RC_WRAP_REPEAT; + break; + + case PIPE_TEX_WRAP_MIRROR_REPEAT: + state->unit[i].wrap_mode = RC_WRAP_MIRRORED_REPEAT; + break; + + case PIPE_TEX_WRAP_MIRROR_CLAMP: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + state->unit[i].wrap_mode = RC_WRAP_MIRRORED_CLAMP; + break; + + default: + state->unit[i].wrap_mode = RC_WRAP_NONE; } } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h b/src/mesa/drivers/dri/r300/compiler/radeon_code.h index f76676fae8..53cc1bd77e 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h @@ -126,11 +126,7 @@ struct r300_fragment_program_external_state { struct { /** * If the sampler is used as a shadow sampler, - * this field is: - * 0 - GL_LUMINANCE - * 1 - GL_INTENSITY - * 2 - GL_ALPHA - * depending on the depth texture mode. + * this field contains swizzle depending on the depth texture mode. */ unsigned depth_texture_swizzle:12; @@ -150,13 +146,9 @@ struct r300_fragment_program_external_state { unsigned compare_mode_enabled : 1; /** - * If the sampler needs to fake NPOT, this field is set. - */ - unsigned fake_npot : 1; - - /** - * If the sampler will recieve non-normalized coords, - * this field is set. + * If the sampler will receive non-normalized coords, + * this field is set. The scaling factor is given by + * RC_STATE_R300_TEXRECT_FACTOR. */ unsigned non_normalized_coords : 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 ddce590ee6..7ce5fb8639 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Corbin Simpson + * Copyright (C) 2010 Marek Olšák * * All Rights Reserved. * @@ -46,31 +47,28 @@ static struct rc_src_register shadow_ambient(struct r300_fragment_program_compil return reg; } -static void lower_texture_rect(struct r300_fragment_program_compiler *compiler, - struct rc_instruction *inst) +static void scale_texcoords(struct r300_fragment_program_compiler *compiler, + struct rc_instruction *inst, + unsigned state_constant) { - struct rc_instruction *inst_rect; - unsigned temp = rc_find_free_temporary(&compiler->Base); + struct rc_instruction *inst_mov; - if (inst->U.I.TexSrcTarget == RC_TEXTURE_RECT || - compiler->state.unit[inst->U.I.TexSrcUnit].non_normalized_coords) { - inst_rect = rc_insert_new_instruction(&compiler->Base, inst->Prev); + unsigned temp = rc_find_free_temporary(&compiler->Base); - inst_rect->U.I.Opcode = RC_OPCODE_MUL; - inst_rect->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_rect->U.I.DstReg.Index = temp; - inst_rect->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - inst_rect->U.I.SrcReg[1].File = RC_FILE_CONSTANT; - inst_rect->U.I.SrcReg[1].Index = - rc_constants_add_state(&compiler->Base.Program.Constants, - RC_STATE_R300_TEXRECT_FACTOR, inst->U.I.TexSrcUnit); + inst_mov = rc_insert_new_instruction(&compiler->Base, inst->Prev); - reset_srcreg(&inst->U.I.SrcReg[0]); - inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst->U.I.SrcReg[0].Index = temp; + inst_mov->U.I.Opcode = RC_OPCODE_MUL; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = temp; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mov->U.I.SrcReg[1].File = RC_FILE_CONSTANT; + inst_mov->U.I.SrcReg[1].Index = + rc_constants_add_state(&compiler->Base.Program.Constants, + state_constant, inst->U.I.TexSrcUnit); - inst->U.I.TexSrcTarget = RC_TEXTURE_2D; - } + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = temp; } /** @@ -88,6 +86,9 @@ int radeonTransformTEX( { struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)data; + rc_wrap_mode wrapmode = compiler->state.unit[inst->U.I.TexSrcUnit].wrap_mode; + int is_rect = inst->U.I.TexSrcTarget == RC_TEXTURE_RECT || + compiler->state.unit[inst->U.I.TexSrcUnit].non_normalized_coords; if (inst->U.I.Opcode != RC_OPCODE_TEX && inst->U.I.Opcode != RC_OPCODE_TXB && @@ -141,6 +142,7 @@ int radeonTransformTEX( inst_rcp->U.I.DstReg.Index = tmp_recip_w; inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + /* XXX do not take W, instead, see which channel is mapped to W. */ inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; } @@ -206,11 +208,15 @@ int radeonTransformTEX( } } - /* Texture wrap modes don't work on NPOT textures or texrects. - * - * The game plan is simple. We have two flags, fake_npot and - * non_normalized_coords, as well as a tex target. The RECT tex target - * will make the emitted code use non-scaled texcoords. + /* R300 cannot sample from rectangles and the wrap mode fallback needs + * normalized coordinates anyway. */ + if (inst->U.I.Opcode != RC_OPCODE_KIL && + is_rect && (!c->is_r500 || wrapmode != RC_WRAP_NONE)) { + scale_texcoords(compiler, inst, RC_STATE_R300_TEXRECT_FACTOR); + inst->U.I.TexSrcTarget = RC_TEXTURE_2D; + } + + /* Texture wrap modes don't work on NPOT textures. * * Non-wrapped/clamped texcoords with NPOT are free in HW. Repeat and * mirroring are not. If we need to repeat, we do: @@ -235,128 +241,111 @@ int radeonTransformTEX( * ~ C & M. ;) */ if (inst->U.I.Opcode != RC_OPCODE_KIL && - (inst->U.I.TexSrcTarget == RC_TEXTURE_RECT || - compiler->state.unit[inst->U.I.TexSrcUnit].fake_npot || - compiler->state.unit[inst->U.I.TexSrcUnit].non_normalized_coords)) { - rc_wrap_mode wrapmode = compiler->state.unit[inst->U.I.TexSrcUnit].wrap_mode; - - /* R300 cannot sample from rectangles. */ - if (!c->is_r500) { - lower_texture_rect(compiler, inst); - } - - if (compiler->state.unit[inst->U.I.TexSrcUnit].fake_npot && - wrapmode != RC_WRAP_NONE) { + wrapmode != RC_WRAP_NONE) { + struct rc_instruction *inst_mov; + unsigned temp = rc_find_free_temporary(c); + + if (wrapmode == RC_WRAP_REPEAT) { + /* Both instructions will be paired up. */ + struct rc_instruction *inst_frc = rc_insert_new_instruction(c, inst->Prev); + + inst_frc->U.I.Opcode = RC_OPCODE_FRC; + inst_frc->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_frc->U.I.DstReg.Index = temp; + inst_frc->U.I.DstReg.WriteMask = RC_MASK_XYZ; + inst_frc->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + } else if (wrapmode == RC_WRAP_MIRRORED_REPEAT) { + /* + * Function: + * f(v) = 1 - abs(frac(v * 0.5) * 2 - 1) + * + * Code: + * MUL temp, src0, 0.5 + * FRC temp, temp + * MAD temp, temp, 2, -1 + * ADD temp, 1, -abs(temp) + */ + + struct rc_instruction *inst_mul, *inst_frc, *inst_mad, *inst_add; + unsigned two, two_swizzle; + + inst_mul = rc_insert_new_instruction(c, inst->Prev); + + inst_mul->U.I.Opcode = RC_OPCODE_MUL; + inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mul->U.I.DstReg.Index = temp; + inst_mul->U.I.DstReg.WriteMask = RC_MASK_XYZ; + inst_mul->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mul->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_HHHH; + + inst_frc = rc_insert_new_instruction(c, inst->Prev); + + inst_frc->U.I.Opcode = RC_OPCODE_FRC; + inst_frc->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_frc->U.I.DstReg.Index = temp; + inst_frc->U.I.DstReg.WriteMask = RC_MASK_XYZ; + inst_frc->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_frc->U.I.SrcReg[0].Index = temp; + inst_frc->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZ0; + + two = rc_constants_add_immediate_scalar(&c->Program.Constants, 2, &two_swizzle); + inst_mad = rc_insert_new_instruction(c, inst->Prev); + + inst_mad->U.I.Opcode = RC_OPCODE_MAD; + inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mad->U.I.DstReg.Index = temp; + inst_mad->U.I.DstReg.WriteMask = RC_MASK_XYZ; + inst_mad->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[0].Index = temp; + inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZ0; + inst_mad->U.I.SrcReg[1].File = RC_FILE_CONSTANT; + inst_mad->U.I.SrcReg[1].Index = two; + inst_mad->U.I.SrcReg[1].Swizzle = two_swizzle; + inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_1111; + inst_mad->U.I.SrcReg[2].Negate = RC_MASK_XYZ; + + inst_add = rc_insert_new_instruction(c, inst->Prev); + + inst_add->U.I.Opcode = RC_OPCODE_ADD; + inst_add->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_add->U.I.DstReg.Index = temp; + inst_add->U.I.DstReg.WriteMask = RC_MASK_XYZ; + inst_add->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; + inst_add->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_add->U.I.SrcReg[1].Index = temp; + inst_add->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_XYZ0; + inst_add->U.I.SrcReg[1].Abs = 1; + inst_add->U.I.SrcReg[1].Negate = RC_MASK_XYZ; + } else if (wrapmode == RC_WRAP_MIRRORED_CLAMP) { + /* + * Mirrored clamp modes are bloody simple, we just use abs + * to mirror [0, 1] into [-1, 0]. This works for + * all modes i.e. CLAMP, CLAMP_TO_EDGE, and CLAMP_TO_BORDER. + */ struct rc_instruction *inst_mov; - unsigned temp = rc_find_free_temporary(c); - /* For NPOT fallback, we need normalized coordinates anyway. */ - if (c->is_r500) { - lower_texture_rect(compiler, inst); - } - - if (wrapmode == RC_WRAP_REPEAT) { - /* Both instructions will be paired up. */ - struct rc_instruction *inst_frc = rc_insert_new_instruction(c, inst->Prev); - - inst_frc->U.I.Opcode = RC_OPCODE_FRC; - inst_frc->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_frc->U.I.DstReg.Index = temp; - inst_frc->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_frc->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - } else if (wrapmode == RC_WRAP_MIRRORED_REPEAT) { - /* - * Function: - * f(v) = 1 - abs(frac(v * 0.5) * 2 - 1) - * - * Code: - * MUL temp, src0, 0.5 - * FRC temp, temp - * MAD temp, temp, 2, -1 - * ADD temp, 1, -abs(temp) - */ - - struct rc_instruction *inst_mul, *inst_frc, *inst_mad, *inst_add; - unsigned two, two_swizzle; - - inst_mul = rc_insert_new_instruction(c, inst->Prev); - - inst_mul->U.I.Opcode = RC_OPCODE_MUL; - inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_mul->U.I.DstReg.Index = temp; - inst_mul->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mul->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - inst_mul->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_HHHH; - - inst_frc = rc_insert_new_instruction(c, inst->Prev); - - inst_frc->U.I.Opcode = RC_OPCODE_FRC; - inst_frc->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_frc->U.I.DstReg.Index = temp; - inst_frc->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_frc->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_frc->U.I.SrcReg[0].Index = temp; - inst_frc->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZ0; - - two = rc_constants_add_immediate_scalar(&c->Program.Constants, 2, &two_swizzle); - inst_mad = rc_insert_new_instruction(c, inst->Prev); - - inst_mad->U.I.Opcode = RC_OPCODE_MAD; - inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_mad->U.I.DstReg.Index = temp; - inst_mad->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mad->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_mad->U.I.SrcReg[0].Index = temp; - inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZ0; - inst_mad->U.I.SrcReg[1].File = RC_FILE_CONSTANT; - inst_mad->U.I.SrcReg[1].Index = two; - inst_mad->U.I.SrcReg[1].Swizzle = two_swizzle; - inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_1111; - inst_mad->U.I.SrcReg[2].Negate = RC_MASK_XYZ; - - inst_add = rc_insert_new_instruction(c, inst->Prev); - - inst_add->U.I.Opcode = RC_OPCODE_ADD; - inst_add->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_add->U.I.DstReg.Index = temp; - inst_add->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_add->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; - inst_add->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; - inst_add->U.I.SrcReg[1].Index = temp; - inst_add->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_XYZ0; - inst_add->U.I.SrcReg[1].Abs = 1; - inst_add->U.I.SrcReg[1].Negate = RC_MASK_XYZ; - } else if (wrapmode == RC_WRAP_MIRRORED_CLAMP) { - /* - * Mirrored clamp modes are bloody simple, we just use abs - * to mirror [0, 1] into [-1, 0]. This works for - * all modes i.e. CLAMP, CLAMP_TO_EDGE, and CLAMP_TO_BORDER. - */ - struct rc_instruction *inst_mov; - - inst_mov = rc_insert_new_instruction(c, inst->Prev); - - inst_mov->U.I.Opcode = RC_OPCODE_MOV; - inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_mov->U.I.DstReg.Index = temp; - inst_mov->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - inst_mov->U.I.SrcReg[0].Abs = 1; - } - - /* Preserve W for TXP/TXB. */ inst_mov = rc_insert_new_instruction(c, inst->Prev); inst_mov->U.I.Opcode = RC_OPCODE_MOV; inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; inst_mov->U.I.DstReg.Index = temp; - inst_mov->U.I.DstReg.WriteMask = RC_MASK_W; + inst_mov->U.I.DstReg.WriteMask = RC_MASK_XYZ; inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - - reset_srcreg(&inst->U.I.SrcReg[0]); - inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst->U.I.SrcReg[0].Index = temp; + inst_mov->U.I.SrcReg[0].Abs = 1; } + + /* Preserve W for TXP/TXB. */ + inst_mov = rc_insert_new_instruction(c, inst->Prev); + + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = temp; + inst_mov->U.I.DstReg.WriteMask = RC_MASK_W; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = temp; } /* Cannot write texture to output registers (all chips) or with masks (non-r500) */ -- cgit v1.2.3 From 6f747567ec775f37d43b35d957e72334c511e8bc Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 28 Sep 2010 02:28:25 +0200 Subject: r300/compiler: fix projective mapping of 2D NPOT textures NOTE: This is a candidate for the 7.9 branch. --- .../drivers/dri/r300/compiler/radeon_program_tex.c | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/mesa') 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 7ce5fb8639..09cb8b27f6 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c @@ -71,6 +71,39 @@ static void scale_texcoords(struct r300_fragment_program_compiler *compiler, inst->U.I.SrcReg[0].Index = temp; } +static void projective_divide(struct r300_fragment_program_compiler *compiler, + struct rc_instruction *inst) +{ + struct rc_instruction *inst_mul, *inst_rcp; + + unsigned temp = rc_find_free_temporary(&compiler->Base); + + inst_rcp = rc_insert_new_instruction(&compiler->Base, inst->Prev); + inst_rcp->U.I.Opcode = RC_OPCODE_RCP; + inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_rcp->U.I.DstReg.Index = temp; + inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; + inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + /* Because the input can be arbitrarily swizzled, + * read the component mapped to W. */ + inst_rcp->U.I.SrcReg[0].Swizzle = + RC_MAKE_SWIZZLE_SMEAR(GET_SWZ(inst->U.I.SrcReg[0].Swizzle, 3)); + + inst_mul = rc_insert_new_instruction(&compiler->Base, inst->Prev); + inst_mul->U.I.Opcode = RC_OPCODE_MUL; + inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mul->U.I.DstReg.Index = temp; + inst_mul->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mul->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_mul->U.I.SrcReg[1].Index = temp; + inst_mul->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.Opcode = RC_OPCODE_TEX; + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = temp; +} + /** * Transform TEX, TXP, TXB, and KIL instructions in the following ways: * - implement texture compare (shadow extensions) @@ -216,6 +249,12 @@ int radeonTransformTEX( inst->U.I.TexSrcTarget = RC_TEXTURE_2D; } + /* Divide by W if needed. */ + if (inst->U.I.Opcode == RC_OPCODE_TXP && + (wrapmode == RC_WRAP_REPEAT || wrapmode == RC_WRAP_MIRRORED_REPEAT)) { + projective_divide(compiler, inst); + } + /* Texture wrap modes don't work on NPOT textures. * * Non-wrapped/clamped texcoords with NPOT are free in HW. Repeat and -- cgit v1.2.3 From c2ea7ffb0a9368571bb62038aeb318307afedb40 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 28 Sep 2010 04:30:32 +0200 Subject: r300/compiler: do not use copy propagation if SaturateMode is used NOTE: This is a candidate for the 7.9 branch. --- src/mesa/drivers/dri/r300/compiler/radeon_optimize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c index e2889302e6..3be50b93e4 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c @@ -163,7 +163,8 @@ static void copy_propagate(struct radeon_compiler * c, struct rc_instruction * i if (inst_mov->U.I.DstReg.File != RC_FILE_TEMPORARY || inst_mov->U.I.DstReg.RelAddr || - inst_mov->U.I.WriteALUResult) + inst_mov->U.I.WriteALUResult || + inst_mov->U.I.SaturateMode) return; memset(&s, 0, sizeof(s)); -- cgit v1.2.3 From 7128e1625bea502b9bf083f14606d679c90222a6 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 28 Sep 2010 03:58:23 +0200 Subject: r300/compiler: fix shadow sampling with swizzled coords Taking the W component from coords directly ignores swizzling. Instead, take the component which is mapped to W in the TEX instruction parameter. The same for Z. NOTE: This is a candidate for the 7.9 branch. --- src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa') 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 09cb8b27f6..de988b7c10 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c @@ -175,17 +175,18 @@ int radeonTransformTEX( inst_rcp->U.I.DstReg.Index = tmp_recip_w; inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - /* XXX do not take W, instead, see which channel is mapped to W. */ - inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; + inst_rcp->U.I.SrcReg[0].Swizzle = + RC_MAKE_SWIZZLE_SMEAR(GET_SWZ(inst->U.I.SrcReg[0].Swizzle, 3)); } - /* Perspective-divide r by W (if it's TXP) and add the texture sample (see below). */ + /* Perspective-divide Z by W (if it's TXP) and add the texture sample (see below). */ tmp_sum = rc_find_free_temporary(c); inst_mad = rc_insert_new_instruction(c, inst_rcp ? inst_rcp : inst); inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; inst_mad->U.I.DstReg.Index = tmp_sum; inst_mad->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; + inst_mad->U.I.SrcReg[0].Swizzle = + RC_MAKE_SWIZZLE_SMEAR(GET_SWZ(inst->U.I.SrcReg[0].Swizzle, 2)); if (inst->U.I.Opcode == RC_OPCODE_TXP) { inst_mad->U.I.Opcode = RC_OPCODE_MAD; inst_mad->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; -- cgit v1.2.3 From 13359e6a4b732335cdd8da48276960d0b176ffe3 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 29 Aug 2010 03:48:42 +0200 Subject: r300g: add support for 3D NPOT textures without mipmapping The driver actually creates a 3D texture aligned to POT and does all the magic with texture coordinates in the fragment shader. It first emulates REPEAT and MIRRORED wrap modes in the fragment shader to get the coordinates into the range [0, 1]. (already done for 2D NPOT) Then it scales them to get the coordinates of the NPOT subtexture. NPOT textures are now less of a lie and we can at least display something meaningful even for the 3D ones. Supported wrap modes: - REPEAT - MIRRORED_REPEAT - CLAMP_TO_EDGE (NEAREST filtering only) - MIRROR_CLAMP_TO_EDGE (NEAREST filtering only) - The behavior of other CLAMP modes is undefined on borders, but they usually give results very close to CLAMP_TO_EDGE with mirroring working perfectly. This fixes: - piglit/fbo-3d - piglit/tex3d-npot --- src/gallium/drivers/r300/r300_context.h | 7 +++++ src/gallium/drivers/r300/r300_emit.c | 16 +++++++--- src/gallium/drivers/r300/r300_fs.c | 3 ++ src/gallium/drivers/r300/r300_texture.c | 15 ++++------ src/gallium/drivers/r300/r300_texture_desc.c | 35 ++++++++++++++-------- src/mesa/drivers/dri/r300/compiler/radeon_code.h | 9 +++++- .../drivers/dri/r300/compiler/radeon_program_tex.c | 32 +++++++++++++++++++- 7 files changed, 90 insertions(+), 27 deletions(-) (limited to 'src/mesa') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 1927370325..b59bc00261 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -336,6 +336,13 @@ struct r300_texture_desc { /* Parent class. */ struct u_resource b; + /* Width, height, and depth. + * Most of the time, these are equal to pipe_texture::width0, height0, + * and depth0. However, NPOT 3D textures must have dimensions aligned + * to POT, and this is the only case when these variables differ from + * pipe_texture. */ + unsigned width0, height0, depth0; + /* Buffer tiling. * Macrotiling is specified per-level because small mipmaps cannot * be macrotiled. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index db783ff0ad..3a1085d2dc 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -89,7 +89,7 @@ static const float * get_rc_constant_state( { struct r300_textures_state* texstate = r300->textures_state.state; static float vec[4] = { 0.0, 0.0, 0.0, 1.0 }; - struct pipe_resource *tex; + struct r300_texture *tex; assert(constant->Type == RC_CONSTANT_STATE); @@ -97,9 +97,17 @@ static const float * get_rc_constant_state( /* Factor for converting rectangle coords to * normalized coords. Should only show up on non-r500. */ case RC_STATE_R300_TEXRECT_FACTOR: - tex = texstate->sampler_views[constant->u.State[1]]->base.texture; - vec[0] = 1.0 / tex->width0; - vec[1] = 1.0 / tex->height0; + tex = r300_texture(texstate->sampler_views[constant->u.State[1]]->base.texture); + vec[0] = 1.0 / tex->desc.width0; + vec[1] = 1.0 / tex->desc.height0; + break; + + case RC_STATE_R300_TEXSCALE_FACTOR: + tex = r300_texture(texstate->sampler_views[constant->u.State[1]]->base.texture); + /* Add a small number to the texture size to work around rounding errors in hw. */ + vec[0] = tex->desc.b.b.width0 / (tex->desc.width0 + 0.001f); + vec[1] = tex->desc.b.b.height0 / (tex->desc.height0 + 0.001f); + vec[2] = tex->desc.b.b.depth0 / (tex->desc.depth0 + 0.001f); break; case RC_STATE_R300_VIEWPORT_SCALE: diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index 3f89987897..d9d4a9304d 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -200,6 +200,9 @@ static void get_external_state( default: state->unit[i].wrap_mode = RC_WRAP_NONE; } + + if (t->desc.b.b.target == PIPE_TEXTURE_3D) + state->unit[i].clamp_and_scale_before_fetch = TRUE; } } } diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 34105aa4bc..a7911c6fcc 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -556,18 +556,15 @@ void r300_texture_setup_format_state(struct r300_screen *screen, out->tile_config = 0; /* Set sampler state. */ - out->format0 = R300_TX_WIDTH((u_minify(pt->width0, level) - 1) & 0x7ff) | - R300_TX_HEIGHT((u_minify(pt->height0, level) - 1) & 0x7ff); + out->format0 = + R300_TX_WIDTH((u_minify(desc->width0, level) - 1) & 0x7ff) | + R300_TX_HEIGHT((u_minify(desc->height0, level) - 1) & 0x7ff) | + R300_TX_DEPTH(util_logbase2(u_minify(desc->depth0, level)) & 0xf); if (desc->uses_stride_addressing) { /* rectangles love this */ out->format0 |= R300_TX_PITCH_EN; out->format2 = (desc->stride_in_pixels[level] - 1) & 0x1fff; - } else { - /* Power of two textures (3D, mipmaps, and no pitch), - * also NPOT textures with a width being POT. */ - out->format0 |= - R300_TX_DEPTH(util_logbase2(u_minify(pt->depth0, level)) & 0xf); } if (pt->target == PIPE_TEXTURE_CUBE) { @@ -580,10 +577,10 @@ void r300_texture_setup_format_state(struct r300_screen *screen, /* large textures on r500 */ if (is_r500) { - if (pt->width0 > 2048) { + if (desc->width0 > 2048) { out->format2 |= R500_TXWIDTH_BIT11; } - if (pt->height0 > 2048) { + if (desc->height0 > 2048) { out->format2 |= R500_TXHEIGHT_BIT11; } } diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c index 6a1030f8ee..a49029e1e9 100644 --- a/src/gallium/drivers/r300/r300_texture_desc.c +++ b/src/gallium/drivers/r300/r300_texture_desc.c @@ -91,9 +91,9 @@ static boolean r300_texture_macro_switch(struct r300_texture_desc *desc, tile = r300_get_pixel_alignment(desc->b.b.format, desc->b.b.nr_samples, desc->microtile, R300_BUFFER_TILED, dim); if (dim == DIM_WIDTH) { - texdim = u_minify(desc->b.b.width0, level); + texdim = u_minify(desc->width0, level); } else { - texdim = u_minify(desc->b.b.height0, level); + texdim = u_minify(desc->height0, level); } /* See TX_FILTER1_n.MACRO_SWITCH. */ @@ -124,7 +124,7 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen, return 0; } - width = u_minify(desc->b.b.width0, level); + width = u_minify(desc->width0, level); if (util_format_is_plain(desc->b.b.format)) { tile_width = r300_get_pixel_alignment(desc->b.b.format, @@ -172,7 +172,7 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture_desc *desc, { unsigned height, tile_height; - height = u_minify(desc->b.b.height0, level); + height = u_minify(desc->height0, level); if (util_format_is_plain(desc->b.b.format)) { tile_height = r300_get_pixel_alignment(desc->b.b.format, @@ -237,7 +237,7 @@ static void r300_texture_3d_fix_mipmapping(struct r300_screen *screen, r300_texture_get_nblocksy(desc, i, FALSE); } - size *= desc->b.b.depth0; + size *= desc->depth0; desc->size_in_bytes = size; } } @@ -292,7 +292,7 @@ static void r300_setup_miptree(struct r300_screen *screen, if (base->target == PIPE_TEXTURE_CUBE) size = layer_size * 6; else - size = layer_size * u_minify(base->depth0, i); + size = layer_size * u_minify(desc->depth0, i); desc->offset_in_bytes[i] = desc->size_in_bytes; desc->size_in_bytes = desc->offset_in_bytes[i] + size; @@ -303,8 +303,8 @@ static void r300_setup_miptree(struct r300_screen *screen, SCREEN_DBG(screen, DBG_TEXALLOC, "r300: Texture miptree: Level %d " "(%dx%dx%d px, pitch %d bytes) %d bytes total, macrotiled %s\n", - i, u_minify(base->width0, i), u_minify(base->height0, i), - u_minify(base->depth0, i), stride, desc->size_in_bytes, + i, u_minify(desc->width0, i), u_minify(desc->height0, i), + u_minify(desc->depth0, i), stride, desc->size_in_bytes, desc->macrotile[i] ? "TRUE" : "FALSE"); } } @@ -313,14 +313,14 @@ static void r300_setup_flags(struct r300_texture_desc *desc) { desc->uses_stride_addressing = !util_is_power_of_two(desc->b.b.width0) || - !util_is_power_of_two(desc->b.b.height0) || (desc->stride_in_bytes_override && stride_to_width(desc->b.b.format, desc->stride_in_bytes_override) != desc->b.b.width0); desc->is_npot = desc->uses_stride_addressing || - !util_is_power_of_two(desc->b.b.height0); + !util_is_power_of_two(desc->b.b.height0) || + !util_is_power_of_two(desc->b.b.depth0); } static void r300_setup_cbzb_flags(struct r300_screen *rscreen, @@ -416,9 +416,21 @@ boolean r300_texture_desc_init(struct r300_screen *rscreen, { desc->b.b = *base; desc->b.b.screen = &rscreen->screen; - desc->stride_in_bytes_override = stride_in_bytes_override; + desc->width0 = base->width0; + desc->height0 = base->height0; + desc->depth0 = base->depth0; + + r300_setup_flags(desc); + + /* Align a 3D NPOT texture to POT. */ + if (base->target == PIPE_TEXTURE_3D && desc->is_npot) { + desc->width0 = util_next_power_of_two(desc->width0); + desc->height0 = util_next_power_of_two(desc->height0); + desc->depth0 = util_next_power_of_two(desc->depth0); + } + /* Setup tiling. */ if (microtile == R300_BUFFER_SELECT_LAYOUT || macrotile == R300_BUFFER_SELECT_LAYOUT) { r300_setup_tiling(rscreen, desc); @@ -428,7 +440,6 @@ boolean r300_texture_desc_init(struct r300_screen *rscreen, assert(desc->b.b.last_level == 0); } - r300_setup_flags(desc); r300_setup_cbzb_flags(rscreen, desc); /* Setup the miptree description. */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h b/src/mesa/drivers/dri/r300/compiler/radeon_code.h index 53cc1bd77e..2dd9c5e4bd 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h @@ -60,6 +60,7 @@ enum { RC_STATE_R300_WINDOW_DIMENSION, RC_STATE_R300_TEXRECT_FACTOR, + RC_STATE_R300_TEXSCALE_FACTOR, RC_STATE_R300_VIEWPORT_SCALE, RC_STATE_R300_VIEWPORT_OFFSET }; @@ -158,7 +159,13 @@ struct r300_fragment_program_external_state { * If this field is \ref RC_WRAP_NONE (aka 0), no wrapping maths * will be performed on the coordinates. */ - unsigned wrap_mode : 2; + unsigned wrap_mode : 3; + + /** + * The coords are scaled after applying the wrap mode emulation + * and right before texture fetch. The scaling factor is given by + * RC_STATE_R300_TEXSCALE_FACTOR. */ + unsigned clamp_and_scale_before_fetch : 1; } unit[16]; }; 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 de988b7c10..530afa5e08 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c @@ -252,7 +252,8 @@ int radeonTransformTEX( /* Divide by W if needed. */ if (inst->U.I.Opcode == RC_OPCODE_TXP && - (wrapmode == RC_WRAP_REPEAT || wrapmode == RC_WRAP_MIRRORED_REPEAT)) { + (wrapmode == RC_WRAP_REPEAT || wrapmode == RC_WRAP_MIRRORED_REPEAT || + compiler->state.unit[inst->U.I.TexSrcUnit].clamp_and_scale_before_fetch)) { projective_divide(compiler, inst); } @@ -388,6 +389,35 @@ int radeonTransformTEX( inst->U.I.SrcReg[0].Index = temp; } + if (inst->U.I.Opcode != RC_OPCODE_KIL && + compiler->state.unit[inst->U.I.TexSrcUnit].clamp_and_scale_before_fetch) { + struct rc_instruction *inst_mov; + unsigned temp = rc_find_free_temporary(c); + + /* Saturate XYZ. */ + inst_mov = rc_insert_new_instruction(c, inst->Prev); + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.SaturateMode = RC_SATURATE_ZERO_ONE; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = temp; + inst_mov->U.I.DstReg.WriteMask = RC_MASK_XYZ; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + + /* Copy W. */ + inst_mov = rc_insert_new_instruction(c, inst->Prev); + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = temp; + inst_mov->U.I.DstReg.WriteMask = RC_MASK_W; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = temp; + + scale_texcoords(compiler, inst, RC_STATE_R300_TEXSCALE_FACTOR); + } + /* Cannot write texture to output registers (all chips) or with masks (non-r500) */ if (inst->U.I.Opcode != RC_OPCODE_KIL && (inst->U.I.DstReg.File != RC_FILE_TEMPORARY || -- cgit v1.2.3 From 798355d429f3cd6e76bb1d01549c203e443348b6 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 23 Sep 2010 21:15:06 -0700 Subject: r300/compiler: Add more helper functions for iterating through sources rc_for_all_reads_src() and rc_pair_for_all_reads_arg() pass references to instruction sources to the callback so they can be modified directly. --- .../drivers/dri/r300/compiler/radeon_dataflow.c | 125 +++++++++++++++------ .../drivers/dri/r300/compiler/radeon_dataflow.h | 12 ++ 2 files changed, 102 insertions(+), 35 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c index e73700f84a..a27d395587 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -29,49 +29,32 @@ #include "radeon_program.h" +struct read_write_mask_data { + void * UserData; + rc_read_write_mask_fn Cb; +}; + static void reads_normal_callback( - rc_read_write_chan_fn cb, + void * userdata, struct rc_instruction * fullinst, - struct rc_src_register src, - void * userdata) + struct rc_src_register * src) { + struct read_write_mask_data * cb_data = userdata; unsigned int refmask = 0; unsigned int chan; for(chan = 0; chan < 4; chan++) { - refmask |= 1 << GET_SWZ(src.Swizzle, chan); + refmask |= 1 << GET_SWZ(src->Swizzle, chan); } refmask &= RC_MASK_XYZW; - if (refmask) - cb(userdata, fullinst, src.File, src.Index, refmask); - - if (refmask && src.RelAddr) - cb(userdata, fullinst, RC_FILE_ADDRESS, 0, RC_MASK_X); -} - -static void reads_normal(struct rc_instruction * fullinst, rc_read_write_chan_fn cb, void * userdata) -{ - struct rc_sub_instruction * inst = &fullinst->U.I; - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); - - for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { - - if (inst->SrcReg[src].File == RC_FILE_NONE) - return; + if (refmask) { + cb_data->Cb(cb_data->UserData, fullinst, src->File, + src->Index, refmask); + } - if (inst->SrcReg[src].File == RC_FILE_PRESUB) { - unsigned int i; - unsigned int srcp_regs = rc_presubtract_src_reg_count( - inst->PreSub.Opcode); - for( i = 0; i < srcp_regs; i++) { - reads_normal_callback(cb, fullinst, - inst->PreSub.SrcReg[i], - userdata); - } - } else { - reads_normal_callback(cb, fullinst, - inst->SrcReg[src], userdata); - } + if (refmask && src->RelAddr) { + cb_data->Cb(cb_data->UserData, fullinst, RC_FILE_ADDRESS, 0, + RC_MASK_X); } } @@ -112,7 +95,7 @@ static void pair_get_src_refmasks(unsigned int * refmasks, } } -static void reads_pair(struct rc_instruction * fullinst, rc_read_write_mask_fn cb, void * userdata) +static void reads_pair(struct rc_instruction * fullinst, rc_read_write_mask_fn cb, void * userdata) { struct rc_pair_instruction * inst = &fullinst->U.P; unsigned int refmasks[3] = { 0, 0, 0 }; @@ -143,6 +126,74 @@ static void reads_pair(struct rc_instruction * fullinst, rc_read_write_mask_fn } } +static void pair_sub_for_all_args( + struct rc_instruction * fullinst, + struct rc_pair_sub_instruction * sub, + rc_pair_read_arg_fn cb, + void * userdata) +{ + int i; + const struct rc_opcode_info * info = rc_get_opcode_info(sub->Opcode); + + for(i = 0; i < info->NumSrcRegs; i++) { + cb(userdata, fullinst, &sub->Arg[i]); + } +} + +/* This function calls the callback function (cb) for each source used by + * the instruction. + * */ +void rc_for_all_reads_src( + struct rc_instruction * inst, + rc_read_src_fn cb, + void * userdata) +{ + const struct rc_opcode_info * opcode = + rc_get_opcode_info(inst->U.I.Opcode); + + /* This function only works with normal instructions. */ + if (inst->Type != RC_INSTRUCTION_NORMAL) { + assert(0); + return; + } + + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + + if (inst->U.I.SrcReg[src].File == RC_FILE_NONE) + continue; + + if (inst->U.I.SrcReg[src].File == RC_FILE_PRESUB) { + unsigned int i; + unsigned int srcp_regs = rc_presubtract_src_reg_count( + inst->U.I.PreSub.Opcode); + for( i = 0; i < srcp_regs; i++) { + cb(userdata, inst, &inst->U.I.PreSub.SrcReg[i]); + } + } else { + cb(userdata, inst, &inst->U.I.SrcReg[src]); + } + } +} + +/** + * This function calls the callback function (cb) for each arg of the RGB and + * alpha components. + */ +void rc_pair_for_all_reads_arg( + struct rc_instruction * inst, + rc_pair_read_arg_fn cb, + void * userdata) +{ + /* This function only works with pair instructions. */ + if (inst->Type != RC_INSTRUCTION_PAIR) { + assert(0); + return; + } + + pair_sub_for_all_args(inst, &inst->U.P.RGB, cb, userdata); + pair_sub_for_all_args(inst, &inst->U.P.Alpha, cb, userdata); +} + /** * Calls a callback function for all register reads. * @@ -153,7 +204,11 @@ static void reads_pair(struct rc_instruction * fullinst, rc_read_write_mask_fn void rc_for_all_reads_mask(struct rc_instruction * inst, rc_read_write_mask_fn cb, void * userdata) { if (inst->Type == RC_INSTRUCTION_NORMAL) { - reads_normal(inst, cb, userdata); + struct read_write_mask_data cb_data; + cb_data.UserData = userdata; + cb_data.Cb = cb; + + rc_for_all_reads_src(inst, reads_normal_callback, &cb_data); } else { reads_pair(inst, cb, userdata); } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h index 795d9cc2b6..d10ae3c7b7 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h @@ -33,6 +33,8 @@ struct radeon_compiler; struct rc_instruction; struct rc_swizzle_caps; +struct rc_src_register; +struct rc_pair_instruction_arg; /** @@ -49,6 +51,16 @@ typedef void (*rc_read_write_mask_fn)(void * userdata, struct rc_instruction * i void rc_for_all_reads_mask(struct rc_instruction * inst, rc_read_write_mask_fn cb, void * userdata); void rc_for_all_writes_mask(struct rc_instruction * inst, rc_read_write_mask_fn cb, void * userdata); +typedef void (*rc_read_src_fn)(void * userdata, struct rc_instruction * inst, + struct rc_src_register * src); +void rc_for_all_reads_src(struct rc_instruction * inst, rc_read_src_fn cb, + void * userdata); + +typedef void (*rc_pair_read_arg_fn)(void * userdata, + struct rc_instruction * inst, struct rc_pair_instruction_arg * arg); +void rc_pair_for_all_reads_arg(struct rc_instruction * inst, + rc_pair_read_arg_fn cb, void * userdata); + typedef void (*rc_remap_register_fn)(void * userdata, struct rc_instruction * inst, rc_register_file * pfile, unsigned int * pindex); void rc_remap_registers(struct rc_instruction * inst, rc_remap_register_fn cb, void * userdata); -- cgit v1.2.3 From a716952184a7dcd3d95ea6b0d7c130aa801f1cb6 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sun, 26 Sep 2010 22:16:19 -0700 Subject: r300/compiler: Print immediate values after "dead constants" pass --- src/mesa/drivers/dri/r300/compiler/radeon_code.c | 14 ++++++++++++++ src/mesa/drivers/dri/r300/compiler/radeon_code.h | 1 + .../drivers/dri/r300/compiler/radeon_remove_constants.c | 3 +++ 3 files changed, 18 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.c b/src/mesa/drivers/dri/r300/compiler/radeon_code.c index 0eab18c344..6842fb873b 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.c @@ -28,6 +28,7 @@ #include "radeon_code.h" #include +#include #include #include "radeon_program.h" @@ -171,3 +172,16 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da return rc_constants_add(c, &constant); } + +void rc_constants_print(struct rc_constant_list * c) +{ + unsigned int i; + for(i = 0; i < c->Count; i++) { + if (c->Constants[i].Type == RC_CONSTANT_IMMEDIATE) { + float * values = c->Constants[i].u.Immediate; + fprintf(stderr, "CONST[%u] = " + "{ %10.4f %10.4f %10.4f %10.4f }\n", + i, values[0],values[1], values[2], values[3]); + } + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h b/src/mesa/drivers/dri/r300/compiler/radeon_code.h index 2dd9c5e4bd..cfb6df2cd7 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h @@ -90,6 +90,7 @@ unsigned rc_constants_add(struct rc_constant_list * c, struct rc_constant * cons unsigned rc_constants_add_state(struct rc_constant_list * c, unsigned state1, unsigned state2); unsigned rc_constants_add_immediate_vec4(struct rc_constant_list * c, const float * data); unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float data, unsigned * swizzle); +void rc_constants_print(struct rc_constant_list * c); /** * Compare functions. 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 d111319d3d..2e0e4ef898 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c @@ -146,4 +146,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) free(const_used); free(inv_remap_table); + + if (c->Debug) + rc_constants_print(&c->Program.Constants); } -- cgit v1.2.3 From 40d256295cbd038653db15f53211a4946d01aeb8 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 27 Sep 2010 20:35:58 -0700 Subject: r300/compiler: radeon_remove_constants.c: fix indentation --- .../dri/r300/compiler/radeon_remove_constants.c | 150 ++++++++++----------- 1 file changed, 75 insertions(+), 75 deletions(-) (limited to 'src/mesa') 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 2e0e4ef898..7b3468a27e 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c @@ -31,104 +31,104 @@ static void remap_regs(void * userdata, struct rc_instruction * inst, rc_register_file * pfile, unsigned int * pindex) { - unsigned *inv_remap_table = userdata; + unsigned *inv_remap_table = userdata; - if (*pfile == RC_FILE_CONSTANT) { - *pindex = inv_remap_table[*pindex]; - } + if (*pfile == RC_FILE_CONSTANT) { + *pindex = inv_remap_table[*pindex]; + } } void rc_remove_unused_constants(struct radeon_compiler *c, void *user) { unsigned **out_remap_table = (unsigned**)user; - unsigned char *const_used; - unsigned *remap_table; - unsigned *inv_remap_table; - unsigned has_rel_addr = 0; - unsigned is_identity = 1; + unsigned char *const_used; + unsigned *remap_table; + unsigned *inv_remap_table; + unsigned has_rel_addr = 0; + unsigned is_identity = 1; unsigned are_externals_remapped = 0; - struct rc_constant *constants = c->Program.Constants.Constants; + struct rc_constant *constants = c->Program.Constants.Constants; - if (!c->Program.Constants.Count) { - *out_remap_table = NULL; - return; - } + if (!c->Program.Constants.Count) { + *out_remap_table = NULL; + return; + } - const_used = malloc(c->Program.Constants.Count); - memset(const_used, 0, c->Program.Constants.Count); + const_used = malloc(c->Program.Constants.Count); + memset(const_used, 0, c->Program.Constants.Count); /* Pass 1: Mark used constants. */ - for (struct rc_instruction *inst = c->Program.Instructions.Next; - inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info *opcode = rc_get_opcode_info(inst->U.I.Opcode); - - /* XXX: This loop and the if statement after it should be - * replaced by a call to one of the rc_for_all_reads_* functions. - * The reason it does not use one of those functions now is - * because none of them have RelAddr as an argument. */ - for (unsigned i = 0; i < opcode->NumSrcRegs; i++) { - if (inst->U.I.SrcReg[i].File == RC_FILE_CONSTANT) { - if (inst->U.I.SrcReg[i].RelAddr) { - has_rel_addr = 1; - } else { - const_used[inst->U.I.SrcReg[i].Index] = 1; - } - } - } - if (inst->U.I.PreSub.Opcode != RC_PRESUB_NONE) { + for (struct rc_instruction *inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; inst = inst->Next) { + const struct rc_opcode_info *opcode = rc_get_opcode_info(inst->U.I.Opcode); + + /* XXX: This loop and the if statement after it should be + * replaced by a call to one of the rc_for_all_reads_* functions. + * The reason it does not use one of those functions now is + * because none of them have RelAddr as an argument. */ + for (unsigned i = 0; i < opcode->NumSrcRegs; i++) { + if (inst->U.I.SrcReg[i].File == RC_FILE_CONSTANT) { + if (inst->U.I.SrcReg[i].RelAddr) { + has_rel_addr = 1; + } else { + const_used[inst->U.I.SrcReg[i].Index] = 1; + } + } + } + if (inst->U.I.PreSub.Opcode != RC_PRESUB_NONE) { unsigned int i; unsigned int srcp_regs = rc_presubtract_src_reg_count( inst->U.I.PreSub.Opcode); for( i = 0; i < srcp_regs; i++) { - if (inst->U.I.PreSub.SrcReg[i].File == - RC_FILE_CONSTANT) { - const_used[ - inst->U.I.PreSub.SrcReg[i].Index] = 1; - } - } + if (inst->U.I.PreSub.SrcReg[i].File == + RC_FILE_CONSTANT) { + const_used[ + inst->U.I.PreSub.SrcReg[i].Index] = 1; + } + } } - } + } - /* Pass 2: If there is relative addressing, mark all externals as used. */ - if (has_rel_addr) { - for (unsigned i = 0; i < c->Program.Constants.Count; i++) - if (constants[i].Type == RC_CONSTANT_EXTERNAL) - const_used[i] = 1; - } + /* Pass 2: If there is relative addressing, mark all externals as used. */ + if (has_rel_addr) { + for (unsigned i = 0; i < c->Program.Constants.Count; i++) + if (constants[i].Type == RC_CONSTANT_EXTERNAL) + const_used[i] = 1; + } - /* Pass 3: Make the remapping table and remap constants. + /* Pass 3: Make the remapping table and remap constants. * This pass removes unused constants simply by overwriting them by other constants. */ - remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned)); - inv_remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned)); - unsigned new_count = 0; + remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned)); + inv_remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned)); + unsigned new_count = 0; - for (unsigned i = 0; i < c->Program.Constants.Count; i++) { - if (const_used[i]) { - remap_table[new_count] = i; - inv_remap_table[i] = new_count; + for (unsigned i = 0; i < c->Program.Constants.Count; i++) { + if (const_used[i]) { + remap_table[new_count] = i; + inv_remap_table[i] = new_count; - if (i != new_count) { + if (i != new_count) { if (constants[i].Type == RC_CONSTANT_EXTERNAL) are_externals_remapped = 1; constants[new_count] = constants[i]; - is_identity = 0; - } - new_count++; - } - } + is_identity = 0; + } + new_count++; + } + } /* 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)); - /* Pass 4: Redirect reads of all constants to their new locations. */ - if (!is_identity) { - for (struct rc_instruction *inst = c->Program.Instructions.Next; - inst != &c->Program.Instructions; inst = inst->Next) { - rc_remap_registers(inst, remap_regs, inv_remap_table); - } + /* Pass 4: Redirect reads of all constants to their new locations. */ + if (!is_identity) { + for (struct rc_instruction *inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; inst = inst->Next) { + rc_remap_registers(inst, remap_regs, inv_remap_table); + } } @@ -138,14 +138,14 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) c->Program.Constants.Count = new_count; if (are_externals_remapped) { - *out_remap_table = remap_table; - } else { - *out_remap_table = NULL; - free(remap_table); - } - - free(const_used); - free(inv_remap_table); + *out_remap_table = remap_table; + } else { + *out_remap_table = NULL; + free(remap_table); + } + + free(const_used); + free(inv_remap_table); if (c->Debug) rc_constants_print(&c->Program.Constants); -- cgit v1.2.3 From b3e95dc45ce0cef5a1b17324a02f18f40a506ca8 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 27 Sep 2010 20:51:05 -0700 Subject: r300/compiler: Use rc_for_all_reads_src() in "dead constants" pass --- .../dri/r300/compiler/radeon_remove_constants.c | 51 ++++++++++------------ 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'src/mesa') 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 7b3468a27e..c59161640c 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c @@ -28,6 +28,11 @@ #include "radeon_remove_constants.h" #include "radeon_dataflow.h" +struct mark_used_data { + unsigned char * const_used; + unsigned * has_rel_addr; +}; + static void remap_regs(void * userdata, struct rc_instruction * inst, rc_register_file * pfile, unsigned int * pindex) { @@ -38,6 +43,20 @@ static void remap_regs(void * userdata, struct rc_instruction * inst, } } +static void mark_used(void * userdata, struct rc_instruction * inst, + struct rc_src_register * src) +{ + struct mark_used_data * d = userdata; + + if (src->File == RC_FILE_CONSTANT) { + if (src->RelAddr) { + *d->has_rel_addr = 1; + } else { + d->const_used[src->Index] = 1; + } + } +} + void rc_remove_unused_constants(struct radeon_compiler *c, void *user) { unsigned **out_remap_table = (unsigned**)user; @@ -48,6 +67,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) unsigned is_identity = 1; unsigned are_externals_remapped = 0; struct rc_constant *constants = c->Program.Constants.Constants; + struct mark_used_data d; if (!c->Program.Constants.Count) { *out_remap_table = NULL; @@ -57,36 +77,13 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) const_used = malloc(c->Program.Constants.Count); memset(const_used, 0, c->Program.Constants.Count); + d.const_used = const_used; + d.has_rel_addr = &has_rel_addr; + /* Pass 1: Mark used constants. */ for (struct rc_instruction *inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info *opcode = rc_get_opcode_info(inst->U.I.Opcode); - - /* XXX: This loop and the if statement after it should be - * replaced by a call to one of the rc_for_all_reads_* functions. - * The reason it does not use one of those functions now is - * because none of them have RelAddr as an argument. */ - for (unsigned i = 0; i < opcode->NumSrcRegs; i++) { - if (inst->U.I.SrcReg[i].File == RC_FILE_CONSTANT) { - if (inst->U.I.SrcReg[i].RelAddr) { - has_rel_addr = 1; - } else { - const_used[inst->U.I.SrcReg[i].Index] = 1; - } - } - } - if (inst->U.I.PreSub.Opcode != RC_PRESUB_NONE) { - unsigned int i; - unsigned int srcp_regs = rc_presubtract_src_reg_count( - inst->U.I.PreSub.Opcode); - for( i = 0; i < srcp_regs; i++) { - if (inst->U.I.PreSub.SrcReg[i].File == - RC_FILE_CONSTANT) { - const_used[ - inst->U.I.PreSub.SrcReg[i].Index] = 1; - } - } - } + rc_for_all_reads_src(inst, mark_used, &d); } /* Pass 2: If there is relative addressing, mark all externals as used. */ -- cgit v1.2.3 From 79d56577700a4f4b8628b3b61098763d019f17d4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 28 Sep 2010 00:27:31 -0700 Subject: dri: Add GET_PROGRAM_NAME definition for Mac OS X. --- src/mesa/drivers/dri/common/xmlconfig.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index bde6b23c7c..0312c07243 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -56,6 +56,9 @@ extern char *program_invocation_name, *program_invocation_short_name; #elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100) # include # define GET_PROGRAM_NAME() getprogname() +#elif defined(__APPLE__) +# include +# define GET_PROGRAM_NAME() getprogname() #elif defined(__sun) /* Solaris has getexecname() which returns the full path - return just the basename to match BSD getprogname() */ -- cgit v1.2.3 From a66e9a4d86d227b65874c43fbf9e299c7a26389f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 26 Sep 2010 13:28:51 +0800 Subject: i965: Add support for attribute interpolation on Sandybridge. Things are simpler these days thanks to barycentric interpolation parameters being handed in in the payload. --- src/mesa/drivers/dri/i965/brw_wm.c | 51 +++++++++++++++++++++++++++---- src/mesa/drivers/dri/i965/brw_wm.h | 7 +++-- src/mesa/drivers/dri/i965/brw_wm_emit.c | 12 ++++++-- src/mesa/drivers/dri/i965/brw_wm_fp.c | 26 ++++++++++++++-- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 2 ++ src/mesa/drivers/dri/i965/gen6_wm_state.c | 2 ++ 6 files changed, 87 insertions(+), 13 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 17ff3e2b2b..9ca8e709f5 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -279,13 +279,52 @@ static void brw_wm_populate_key( struct brw_context *brw, } } } - - brw_wm_lookup_iz(intel, - line_aa, - lookup, - uses_depth, - key); + 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. */ + } else { + brw_wm_lookup_iz(intel, + line_aa, + lookup, + uses_depth, + key); + } /* BRW_NEW_WM_INPUT_DIMENSIONS */ key->proj_attrib_mask = brw->wm.input_size_masks[4-1]; diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index fed1372969..a38df1e111 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -59,6 +59,7 @@ 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; @@ -182,6 +183,8 @@ struct brw_wm_instruction { #define PROGRAM_PAYLOAD (PROGRAM_FILE_MAX) #define PAYLOAD_DEPTH (FRAG_ATTRIB_MAX) +#define PAYLOAD_W (FRAG_ATTRIB_MAX + 1) +#define PAYLOAD_FP_REG_MAX (FRAG_ATTRIB_MAX + 2) struct brw_wm_compile { struct brw_compile func; @@ -224,7 +227,7 @@ struct brw_wm_compile { } payload; - const struct brw_wm_ref *pass0_fp_reg[PROGRAM_PAYLOAD+1][256][4]; + const struct brw_wm_ref *pass0_fp_reg[PAYLOAD_FP_REG_MAX][256][4]; struct brw_wm_ref undef_ref; struct brw_wm_value undef_value; @@ -252,7 +255,7 @@ struct brw_wm_compile { struct { GLboolean inited; struct brw_reg reg; - } wm_regs[PROGRAM_PAYLOAD+1][256][4]; + } wm_regs[PAYLOAD_FP_REG_MAX][256][4]; GLboolean used_grf[BRW_WM_MAX_GRF]; GLuint first_free_grf; diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index a4754ca8cf..86ec96368c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -254,6 +254,8 @@ void emit_pixel_w(struct brw_wm_compile *c, struct brw_compile *p = &c->func; struct intel_context *intel = &p->brw->intel; + assert(intel->gen < 6); + /* Don't need this if all you are doing is interpolating color, for * instance. */ @@ -288,7 +290,6 @@ void emit_pixel_w(struct brw_wm_compile *c, } } - void emit_linterp(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, @@ -307,7 +308,9 @@ void emit_linterp(struct brw_compile *p, for (i = 0; i < 4; i++) { if (mask & (1<gen >= 6) { + brw_PLN(p, dst[i], interp[i], brw_vec8_grf(2, 0)); + } else if (can_do_pln(intel, deltas)) { brw_PLN(p, dst[i], interp[i], deltas[0]); } else { brw_LINE(p, brw_null_reg(), interp[i], deltas[0]); @@ -330,6 +333,11 @@ void emit_pinterp(struct brw_compile *p, GLuint nr = arg0[0].nr; GLuint i; + if (intel->gen >= 6) { + emit_linterp(p, dst, mask, arg0, interp); + return; + } + interp[0] = brw_vec1_grf(nr, 0); interp[1] = brw_vec1_grf(nr, 4); interp[2] = brw_vec1_grf(nr+1, 0); diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 3870bf10fc..a88b7bdea8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -336,7 +336,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 ) { - if (src_is_undef(c->pixel_w)) { + /* This is only called for producing 1/w in pre-gen6 interp. for + * gen6, the interp opcodes don't use this argument. + */ + if (c->func.brw->intel.gen >= 6) + return src_undef(); + + if (!src_is_undef(c->pixel_w)) { struct prog_dst_register pixel_w = get_temp(c); struct prog_src_register deltas = get_delta_xy(c); struct prog_src_register interp_wpos = src_reg(PROGRAM_PAYLOAD, FRAG_ATTRIB_WPOS); @@ -363,7 +369,13 @@ static void emit_interp( struct brw_wm_compile *c, { struct prog_dst_register dst = dst_reg(PROGRAM_INPUT, idx); struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx); - struct prog_src_register deltas = get_delta_xy(c); + struct prog_src_register deltas; + + if (c->func.brw->intel.gen < 6) { + deltas = get_delta_xy(c); + } else { + deltas = src_undef(); + } /* Need to use PINTERP on attributes which have been * multiplied by 1/W in the SF program, and LINTERP on those @@ -1056,6 +1068,7 @@ static void print_insns( const struct prog_instruction *insn, */ void brw_wm_pass_fp( struct brw_wm_compile *c ) { + struct intel_context *intel = &c->func.brw->intel; struct brw_fragment_program *fp = c->fp; GLuint insn; @@ -1067,7 +1080,14 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) } c->pixel_xy = src_undef(); - c->delta_xy = src_undef(); + if (intel->gen >= 6) { + /* The interpolation deltas come in as the perspective pixel + * location barycentric params. + */ + c->delta_xy = src_reg(PROGRAM_PAYLOAD, PAYLOAD_DEPTH); + } else { + c->delta_xy = src_undef(); + } c->pixel_w = src_undef(); c->nr_fp_insns = 0; c->fp->tex_units_used = 0x0; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 7c05e452dd..a0f299195c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -296,6 +296,8 @@ static void prealloc_reg(struct brw_wm_compile *c) 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 */ diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index 2cd640de17..afce1da666 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -151,6 +151,8 @@ upload_wm_state(struct brw_context *brw) if (fp->program.UsesKill || ctx->Color.AlphaEnabled) dw5 |= GEN6_WM_KILL_ENABLE; + dw6 |= GEN6_WM_PERSPECTIVE_PIXEL_BARYCENTRIC; + /* This should probably be FS inputs read */ dw6 |= brw_count_bits(brw->vs.prog_data->outputs_written) << GEN6_WM_NUM_SF_OUTPUTS_SHIFT; -- cgit v1.2.3 From 2f914053bc8bba3e6d20334ec44feacc803f5d84 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 20 Aug 2010 18:15:14 -0700 Subject: i965: Set up inputs to the fragment shader according to FP InputsRead. Sending down data that doesn't get read doesn't make any sense, and would make handling things like gl_FrontFacing and gl_PointCoord harder. --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 50 ++++++++++++++++++++----------- src/mesa/drivers/dri/i965/gen6_sf_state.c | 29 ++++++++++-------- src/mesa/drivers/dri/i965/gen6_wm_state.c | 3 +- 3 files changed, 51 insertions(+), 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index a0f299195c..f60245377e 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -347,26 +347,42 @@ static void prealloc_reg(struct brw_wm_compile *c) } } - /* fragment shader inputs */ - 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; + /* 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, fp_input, j, reg); - } - if (c->key.vp_outputs_written & BITFIELD64_BIT(i)) { + 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; diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 6820ca3abf..b5984255af 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -33,20 +33,29 @@ #include "intel_batchbuffer.h" static uint32_t -get_attr_override(struct brw_context *brw, int attr) +get_attr_override(struct brw_context *brw, int fs_attr) { - uint32_t attr_override; - int attr_index = 0, i; + int attr_index = 0, i, vs_attr; + + if (fs_attr <= FRAG_ATTRIB_TEX7) + vs_attr = fs_attr; + else if (fs_attr == FRAG_ATTRIB_FACE) + vs_attr = 0; /* XXX */ + else if (fs_attr == FRAG_ATTRIB_PNTC) + vs_attr = 0; /* XXX */ + else { + assert(fs_attr >= FRAG_ATTRIB_VAR0); + vs_attr = fs_attr - FRAG_ATTRIB_VAR0 + VERT_RESULT_VAR0; + } /* Find the source index (0 = first attribute after the 4D position) * for this output attribute. attr is currently a VERT_RESULT_* but should * be FRAG_ATTRIB_*. */ - for (i = 0; i < attr; i++) { + for (i = 0; i < vs_attr; i++) { if (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(i)) attr_index++; } - attr_override = attr_index; return attr_index; } @@ -58,8 +67,7 @@ upload_sf_state(struct brw_context *brw) GLcontext *ctx = &intel->ctx; /* CACHE_NEW_VS_PROG */ uint32_t num_inputs = brw_count_bits(brw->vs.prog_data->outputs_written); - /* This should probably be FS inputs read */ - uint32_t num_outputs = brw_count_bits(brw->vs.prog_data->outputs_written); + uint32_t num_outputs = brw_count_bits(brw->fragment_program->Base.InputsRead); uint32_t dw1, dw2, dw3, dw4; int i; /* _NEW_BUFFER */ @@ -144,11 +152,8 @@ upload_sf_state(struct brw_context *brw) for (i = 0; i < 8; i++) { uint32_t attr_overrides = 0; - /* These should be generating FS inputs read instead of VS - * outputs written - */ for (; attr < 64; attr++) { - if (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(attr)) { + if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr)) { attr_overrides |= get_attr_override(brw, attr); attr++; break; @@ -156,7 +161,7 @@ upload_sf_state(struct brw_context *brw) } for (; attr < 64; attr++) { - if (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(attr)) { + if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr)) { attr_overrides |= get_attr_override(brw, attr) << 16; attr++; break; diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index afce1da666..d88c86a1b2 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -153,8 +153,7 @@ upload_wm_state(struct brw_context *brw) dw6 |= GEN6_WM_PERSPECTIVE_PIXEL_BARYCENTRIC; - /* This should probably be FS inputs read */ - dw6 |= brw_count_bits(brw->vs.prog_data->outputs_written) << + dw6 |= brw_count_bits(brw->fragment_program->Base.InputsRead) << GEN6_WM_NUM_SF_OUTPUTS_SHIFT; BEGIN_BATCH(9); -- cgit v1.2.3 From fe2d4a5ea02df38c9940a726aa04bcf550fab1da Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 22 Aug 2010 01:33:57 -0700 Subject: i965: Add support for POW in gen6 FS. Fixes glsl-algebraic-pow-2 in brw_wm_glsl.c mode. --- src/mesa/drivers/dri/i965/brw_eu.h | 6 ++ src/mesa/drivers/dri/i965/brw_eu_emit.c | 23 +++++++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 116 +++++++++++++++++++++++++------- 3 files changed, 120 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index c63db16460..c0deb238c2 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -885,6 +885,12 @@ void brw_math( struct brw_compile *p, GLuint data_type, GLuint precision ); +void brw_math2(struct brw_compile *p, + struct brw_reg dest, + GLuint function, + struct brw_reg src0, + struct brw_reg src1); + void brw_dp_READ_16( struct brw_compile *p, struct brw_reg dest, GLuint scratch_offset ); diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index ddd3a94eb0..9c320c613f 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -1131,6 +1131,29 @@ void brw_math( struct brw_compile *p, } } +/** Extended math function, float[8]. + */ +void brw_math2(struct brw_compile *p, + struct brw_reg dest, + GLuint function, + struct brw_reg src0, + struct brw_reg src1) +{ + struct intel_context *intel = &p->brw->intel; + struct brw_instruction *insn = next_insn(p, BRW_OPCODE_MATH); + + assert(intel->gen >= 6); + + /* 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_src0(insn, src0); + brw_set_src1(insn, src1); +} + /** * Extended math function, float[16]. * Use 2 send instructions. diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 86ec96368c..9be3bfbbfe 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -918,10 +918,8 @@ void emit_math2(struct brw_wm_compile *c, const struct brw_reg *arg1) { struct brw_compile *p = &c->func; + struct intel_context *intel = &p->brw->intel; int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; - GLuint saturate = ((mask & SATURATE) ? - BRW_MATH_SATURATE_SATURATE : - BRW_MATH_SATURATE_NONE); if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ @@ -930,35 +928,103 @@ void emit_math2(struct brw_wm_compile *c, brw_push_insn_state(p); - brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_MOV(p, brw_message_reg(3), arg1[0]); - if (c->dispatch_width == 16) { - brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); - brw_MOV(p, brw_message_reg(5), sechalf(arg1[0])); - } + /* math can only operate on up to a vec8 at a time, so in + * dispatch_width==16 we have to do the second half manually. + */ + if (intel->gen >= 6) { + struct brw_reg src0 = arg0[0]; + struct brw_reg src1 = arg1[0]; + 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_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_math(p, - dst[dst_chan], - function, - saturate, - 2, - arg0[0], - BRW_MATH_DATA_VECTOR, - BRW_MATH_PRECISION_FULL); + brw_set_saturate(p, (mask & SATURATE) ? 1 : 0); + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_math2(p, + temp_dst, + function, + src0, + src1); + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_math2(p, + sechalf(temp_dst), + function, + sechalf(src0), + sechalf(src1)); + } - /* Send two messages to perform all 16 operations: - */ - if (c->dispatch_width == 16) { - brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + /* 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 : + BRW_MATH_SATURATE_NONE); + + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_MOV(p, brw_message_reg(3), arg1[0]); + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_MOV(p, brw_message_reg(5), sechalf(arg1[0])); + } + + brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_math(p, - offset(dst[dst_chan],1), + dst[dst_chan], function, saturate, - 4, - sechalf(arg0[0]), + 2, + arg0[0], BRW_MATH_DATA_VECTOR, BRW_MATH_PRECISION_FULL); + + /* Send two messages to perform all 16 operations: + */ + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_math(p, + offset(dst[dst_chan],1), + function, + saturate, + 4, + sechalf(arg0[0]), + BRW_MATH_DATA_VECTOR, + BRW_MATH_PRECISION_FULL); + } } brw_pop_insn_state(p); } -- cgit v1.2.3 From bf60f3593452f6ab6340c7a8737cc74f223f2a62 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 11:13:26 +0800 Subject: i965: disasm quarter and write enable instruction control on sandybridge --- src/mesa/drivers/dri/i965/brw_disasm.c | 70 +++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index f74a236834..90520824f6 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -164,6 +164,11 @@ char *accwr[2] = { [1] = "AccWrEnable" }; +char *wectrl[2] = { + [0] = "WEnormal", + [1] = "WEpredicted" +}; + char *exec_size[8] = { [0] = "1", [1] = "2", @@ -651,6 +656,7 @@ static int src_da16 (FILE *file, err |= control (file, "channel select", chan_sel, swz_z, NULL); err |= control (file, "channel select", chan_sel, swz_w, NULL); } + err |= control (file, "src da16 reg type", reg_encoding, _reg_type, NULL); return err; } @@ -804,6 +810,44 @@ static int src1 (FILE *file, struct brw_instruction *inst) } } +int esize[6] = { + [0] = 1, + [1] = 2, + [2] = 4, + [3] = 8, + [4] = 16, + [5] = 32, +}; + +static int qtr_ctrl(FILE *file, struct brw_instruction *inst) +{ + int qtr_ctl = inst->header.compression_control; + int exec_size = esize[inst->header.execution_size]; + + if (exec_size == 8) { + switch (qtr_ctl) { + case 0: + string (file, " 1Q"); + break; + case 1: + string (file, " 2Q"); + break; + case 2: + string (file, " 3Q"); + break; + case 3: + string (file, " 4Q"); + break; + } + } else if (exec_size == 16){ + if (qtr_ctl < 2) + string (file, " 1H"); + else + string (file, " 2H"); + } + return 0; +} + int brw_disasm (FILE *file, struct brw_instruction *inst, int gen) { int err = 0; @@ -998,18 +1042,26 @@ int brw_disasm (FILE *file, struct brw_instruction *inst, int gen) string (file, "{"); space = 1; err |= control(file, "access mode", access_mode, inst->header.access_mode, &space); - err |= control (file, "mask control", mask_ctrl, inst->header.mask_control, &space); + if (gen >= 6) + err |= control (file, "write enable control", wectrl, inst->header.mask_control, &space); + else + err |= control (file, "mask control", mask_ctrl, inst->header.mask_control, &space); err |= control (file, "dependency control", dep_ctrl, inst->header.dependency_control, &space); - if (inst->header.compression_control == BRW_COMPRESSION_COMPRESSED && - opcode[inst->header.opcode].ndst > 0 && - inst->bits1.da1.dest_reg_file == BRW_MESSAGE_REGISTER_FILE && - inst->bits1.da1.dest_reg_nr & (1 << 7)) { - format (file, " compr4"); - } else { - err |= control (file, "compression control", compr_ctrl, - inst->header.compression_control, &space); + if (gen >= 6) + err |= qtr_ctrl (file, inst); + else { + if (inst->header.compression_control == BRW_COMPRESSION_COMPRESSED && + opcode[inst->header.opcode].ndst > 0 && + inst->bits1.da1.dest_reg_file == BRW_MESSAGE_REGISTER_FILE && + inst->bits1.da1.dest_reg_nr & (1 << 7)) { + format (file, " compr4"); + } else { + err |= control (file, "compression control", compr_ctrl, + inst->header.compression_control, &space); + } } + err |= control (file, "thread control", thread_ctrl, inst->header.thread_control, &space); if (gen >= 6) err |= control (file, "acc write control", accwr, inst->header.acc_wr_control, &space); -- cgit v1.2.3 From b016a78b983295c112421c01d378fbe2862412d4 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 11:17:26 +0800 Subject: i965: new state dump for sandybridge Dump new state object on sandybridge for cc viewport, clip viewport, depth stencil, cc and blend state. --- src/mesa/drivers/dri/i965/brw_state_dump.c | 140 +++++++++++++++++++++++++++-- 1 file changed, 135 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c index d410861bdf..b79b33c2e3 100644 --- a/src/mesa/drivers/dri/i965/brw_state_dump.c +++ b/src/mesa/drivers/dri/i965/brw_state_dump.c @@ -161,6 +161,123 @@ static void dump_sf_viewport_state(struct brw_context *brw) drm_intel_bo_unmap(brw->sf.vp_bo); } +static void dump_clip_viewport_state(struct brw_context *brw) +{ + const char *name = "CLIP VP"; + struct brw_clipper_viewport *vp; + uint32_t vp_off; + + if (brw->clip.vp_bo == NULL) + return; + + drm_intel_bo_map(brw->clip.vp_bo, GL_FALSE); + + vp = brw->clip.vp_bo->virtual; + vp_off = brw->clip.vp_bo->offset; + + state_out(name, vp, vp_off, 0, "xmin = %f\n", vp->xmin); + state_out(name, vp, vp_off, 1, "xmax = %f\n", vp->xmax); + state_out(name, vp, vp_off, 2, "ymin = %f\n", vp->ymin); + state_out(name, vp, vp_off, 3, "ymax = %f\n", vp->ymax); + drm_intel_bo_unmap(brw->clip.vp_bo); +} + +static void dump_cc_viewport_state(struct brw_context *brw) +{ + const char *name = "CC VP"; + struct brw_cc_viewport *vp; + uint32_t vp_off; + + if (brw->cc.vp_bo == NULL) + return; + + drm_intel_bo_map(brw->cc.vp_bo, GL_FALSE); + + vp = brw->cc.vp_bo->virtual; + vp_off = brw->cc.vp_bo->offset; + + state_out(name, vp, vp_off, 0, "min_depth = %f\n", vp->min_depth); + state_out(name, vp, vp_off, 1, "max_depth = %f\n", vp->max_depth); + drm_intel_bo_unmap(brw->cc.vp_bo); +} + +static void dump_depth_stencil_state(struct brw_context *brw) +{ + const char *name = "DEPTH STENCIL"; + struct gen6_depth_stencil_state *ds; + uint32_t ds_off; + + if (brw->cc.depth_stencil_state_bo == NULL) + return; + + drm_intel_bo_map(brw->cc.depth_stencil_state_bo, GL_FALSE); + + ds = brw->cc.depth_stencil_state_bo->virtual; + ds_off = brw->cc.depth_stencil_state_bo->offset; + + state_out(name, ds, ds_off, 0, "stencil %sable, func %d, write %sable\n", + ds->ds0.stencil_enable ? "en" : "dis", + ds->ds0.stencil_func, + ds->ds0.stencil_write_enable ? "en" : "dis"); + state_out(name, ds, ds_off, 1, "stencil test mask 0x%x, write mask 0x%x\n", + ds->ds1.stencil_test_mask, ds->ds1.stencil_write_mask); + state_out(name, ds, ds_off, 2, "depth test %sable, func %d, write %sable\n", + ds->ds2.depth_test_enable ? "en" : "dis", + ds->ds2.depth_test_func, + ds->ds2.depth_write_enable ? "en" : "dis"); + drm_intel_bo_unmap(brw->cc.depth_stencil_state_bo); +} + +static void dump_cc_state(struct brw_context *brw) +{ + const char *name = "CC"; + struct gen6_color_calc_state *cc; + uint32_t cc_off; + + if (brw->cc.state_bo == NULL) + return; + + drm_intel_bo_map(brw->cc.state_bo, GL_FALSE); + cc = brw->cc.state_bo->virtual; + cc_off = brw->cc.state_bo->offset; + + state_out(name, cc, cc_off, 0, "alpha test format %s, round disable %d, stencil ref %d," + "bf stencil ref %d\n", + cc->cc0.alpha_test_format ? "FLOAT32" : "UNORM8", + cc->cc0.round_disable, + cc->cc0.stencil_ref, + cc->cc0.bf_stencil_ref); + state_out(name, cc, cc_off, 1, "\n"); + state_out(name, cc, cc_off, 2, "constant red %f\n", cc->constant_r); + state_out(name, cc, cc_off, 3, "constant green %f\n", cc->constant_g); + state_out(name, cc, cc_off, 4, "constant blue %f\n", cc->constant_b); + state_out(name, cc, cc_off, 5, "constant alpha %f\n", cc->constant_a); + + drm_intel_bo_unmap(brw->cc.state_bo); + +} + +static void dump_blend_state(struct brw_context *brw) +{ + const char *name = "BLEND"; + struct gen6_blend_state *blend; + uint32_t blend_off; + + if (brw->cc.blend_state_bo == NULL) + return; + + drm_intel_bo_map(brw->cc.blend_state_bo, GL_FALSE); + + blend = brw->cc.blend_state_bo->virtual; + blend_off = brw->cc.blend_state_bo->offset; + + state_out(name, blend, blend_off, 0, "\n"); + state_out(name, blend, blend_off, 1, "\n"); + + drm_intel_bo_unmap(brw->cc.blend_state_bo); + +} + static void brw_debug_prog(const char *name, drm_intel_bo *prog) { unsigned int i; @@ -208,16 +325,29 @@ void brw_debug_batch(struct intel_context *intel) state_struct_out("WM bind", brw->wm.bind_bo, 4 * brw->wm.nr_surfaces); dump_wm_surface_state(brw); - state_struct_out("VS", brw->vs.state_bo, sizeof(struct brw_vs_unit_state)); + if (intel->gen < 6) + state_struct_out("VS", brw->vs.state_bo, sizeof(struct brw_vs_unit_state)); brw_debug_prog("VS prog", brw->vs.prog_bo); - state_struct_out("GS", brw->gs.state_bo, sizeof(struct brw_gs_unit_state)); + if (intel->gen < 6) + state_struct_out("GS", brw->gs.state_bo, sizeof(struct brw_gs_unit_state)); brw_debug_prog("GS prog", brw->gs.prog_bo); - state_struct_out("SF", brw->sf.state_bo, sizeof(struct brw_sf_unit_state)); + if (intel->gen < 6) { + state_struct_out("SF", brw->sf.state_bo, sizeof(struct brw_sf_unit_state)); + brw_debug_prog("SF prog", brw->sf.prog_bo); + } dump_sf_viewport_state(brw); - brw_debug_prog("SF prog", brw->sf.prog_bo); - state_struct_out("WM", brw->wm.state_bo, sizeof(struct brw_wm_unit_state)); + if (intel->gen < 6) + state_struct_out("WM", brw->wm.state_bo, sizeof(struct brw_wm_unit_state)); brw_debug_prog("WM prog", brw->wm.prog_bo); + + if (intel->gen >= 6) { + dump_cc_viewport_state(brw); + dump_clip_viewport_state(brw); + dump_depth_stencil_state(brw); + dump_cc_state(brw); + dump_blend_state(brw); + } } -- cgit v1.2.3 From 8c31a4c3cf6655fe4db6befb4a7b029ada62aaf6 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 12:45:01 +0800 Subject: i965: enable accumulator update in PS kernel too on sandybridge Accumulator update flag must be set for implicit update on sandybridge. --- src/mesa/drivers/dri/i965/brw_wm_emit.c | 3 +++ src/mesa/drivers/dri/i965/brw_wm_glsl.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 9be3bfbbfe..260a04c774 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -1627,9 +1627,12 @@ static void spill_values( struct brw_wm_compile *c, void brw_wm_emit( struct brw_wm_compile *c ) { struct brw_compile *p = &c->func; + struct intel_context *intel = &p->brw->intel; GLuint insn; brw_set_compression_control(p, BRW_COMPRESSION_COMPRESSED); + if (intel->gen >= 6) + brw_set_acc_write_control(p, 1); /* Check if any of the payload regs need to be spilled: */ diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index f60245377e..1cbd5d2b55 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -711,6 +711,9 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *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; -- cgit v1.2.3 From 41c31c2ebd5ed2ca021ff9d89f79270562e6c368 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 12:57:35 +0800 Subject: i965: Fix color interpolation on sandybridge Don't double store position in vertex attribute. This makes color interpolation right by using barycentric coordinates. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index ad0d00b87c..ed2625e16f 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -254,7 +254,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->first_overflow_output = 0; if (intel->gen >= 6) - mrf = 4; + mrf = 3; /* no more pos store in attribute */ else if (intel->gen == 5) mrf = 8; else @@ -1451,8 +1451,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) * position. */ brw_MOV(p, brw_message_reg(2), pos); - brw_MOV(p, brw_message_reg(3), pos); - len_vertex_header = 2; + len_vertex_header = 1; } else if (intel->gen == 5) { /* There are 20 DWs (D0-D19) in VUE header on Ironlake: * dword 0-3 (m1) of the header is indices, point width, clip flags. -- cgit v1.2.3 From 03218a00932e83f0ffd0c3077bbbe65a7765c572 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 13:03:32 +0800 Subject: i965: force zero in clipper to ignore RTAIndex on sandybridge --- src/mesa/drivers/dri/i965/brw_defines.h | 1 + src/mesa/drivers/dri/i965/gen6_clip_state.c | 1 + 2 files changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 6b8e9e05d0..f9c12e1555 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -930,6 +930,7 @@ /* DW3 */ # define GEN6_CLIP_MIN_POINT_WIDTH_SHIFT 17 # define GEN6_CLIP_MAX_POINT_WIDTH_SHIFT 6 +# define GEN6_CLIP_FORCE_ZERO_RTAINDEX (1 << 5) #define CMD_3D_SF_STATE 0x7813 /* GEN6+ */ /* DW1 */ diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index acc4b7f101..045d9c6f76 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -59,6 +59,7 @@ upload_clip_state(struct brw_context *brw) GEN6_CLIP_XY_TEST | depth_clamp | provoking); + OUT_BATCH(GEN6_CLIP_FORCE_ZERO_RTAINDEX); OUT_BATCH(0); ADVANCE_BATCH(); -- cgit v1.2.3 From fa589770e8829f02d2742c32d05eecde0b70fe80 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 13:08:22 +0800 Subject: i965: fix point size setting in header on sandybridge --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index ed2625e16f..162ddc93c8 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -1392,8 +1392,11 @@ static void emit_vertex_write( struct brw_vs_compile *c) if (c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_PSIZ)) { struct brw_reg psiz = c->regs[PROGRAM_OUTPUT][VERT_RESULT_PSIZ]; - brw_MUL(p, brw_writemask(header1, WRITEMASK_W), brw_swizzle1(psiz, 0), brw_imm_f(1<<11)); - brw_AND(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(0x7ff<<8)); + if (intel->gen < 6) { + brw_MUL(p, brw_writemask(header1, WRITEMASK_W), brw_swizzle1(psiz, 0), brw_imm_f(1<<11)); + brw_AND(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(0x7ff<<8)); + } else + brw_MOV(p, brw_writemask(header1, WRITEMASK_W), brw_swizzle1(psiz, 0)); } for (i = 0; i < c->key.nr_userclip; i++) { -- cgit v1.2.3 From 67dafa4b56422b44ca26b093d8feb6e743eb89e6 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 14:23:48 +0800 Subject: i965: ff sync message change for sandybridge --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 9c320c613f..1d3f19759d 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -1744,13 +1744,27 @@ void brw_ff_sync(struct brw_compile *p, GLuint response_length, GLboolean eot) { - struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); + struct intel_context *intel = &p->brw->intel; + struct brw_instruction *insn; + /* Sandybridge doesn't have the implied move for SENDs, + * 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 ); + brw_MOV(p, brw_message_reg(msg_reg_nr), src0); + brw_pop_insn_state(p); + src0 = brw_message_reg(msg_reg_nr); + } + + insn = next_insn(p, BRW_OPCODE_SEND); brw_set_dest(insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, brw_imm_d(0)); - insn->header.destreg__conditionalmod = msg_reg_nr; + if (intel->gen < 6) + insn->header.destreg__conditionalmod = msg_reg_nr; brw_set_ff_sync_message(p->brw, insn, -- cgit v1.2.3 From a0b1d7b2b8d35f30793d811d7b5a693e9ea17596 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 14:25:43 +0800 Subject: i965: ignore quads for GS kernel on sandybridge Sandybridge's VF would convert quads to polygon which not required for GS then. Current GS state still would cause hang on lineloop. --- src/mesa/drivers/dri/i965/brw_gs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 5409e55788..8952c9e346 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -60,7 +60,7 @@ static void compile_gs_prog( struct brw_context *brw, */ c.nr_attrs = brw_count_bits(c.key.attrs); - if (intel->gen == 5) + if (intel->gen >= 5) c.nr_regs = (c.nr_attrs + 1) / 2 + 3; /* are vertices packed, or reg-aligned? */ else c.nr_regs = (c.nr_attrs + 1) / 2 + 1; /* are vertices packed, or reg-aligned? */ @@ -85,12 +85,19 @@ static void compile_gs_prog( struct brw_context *brw, */ switch (key->primitive) { case GL_QUADS: + /* Gen6: VF has already converted into polygon. */ + if (intel->gen == 6) + return; brw_gs_quads( &c, key ); break; case GL_QUAD_STRIP: + if (intel->gen == 6) + return; brw_gs_quad_strip( &c, key ); break; case GL_LINE_LOOP: + /* XXX fix GS hang issue */ + assert(intel->gen < 6); brw_gs_lines( &c ); break; case GL_LINES: -- cgit v1.2.3 From 7401a98e29eaaa80fc42e18b126988683b090543 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 14:40:16 +0800 Subject: i965: add sandybridge viewport state bo into validation list --- src/mesa/drivers/dri/i965/gen6_viewport_state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c index 301c68e7f9..84bea323f8 100644 --- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c @@ -107,7 +107,9 @@ const struct brw_tracked_state gen6_sf_vp = { static void prepare_viewport_state_pointers(struct brw_context *brw) { - brw_add_validated_bo(brw, brw->sf.state_bo); + brw_add_validated_bo(brw, brw->clip.vp_bo); + brw_add_validated_bo(brw, brw->sf.vp_bo); + brw_add_validated_bo(brw, brw->cc.vp_bo); } static void upload_viewport_state_pointers(struct brw_context *brw) -- cgit v1.2.3 From 9c39a9fcb2c76897e9b5aff68ce197a411c4e25c Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 14:47:05 +0800 Subject: i965: VS use SPF mode on sandybridge for now Until conditional instructions were fixed, use SPF mode instead for now. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 4 ++++ src/mesa/drivers/dri/i965/gen6_vs_state.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 162ddc93c8..8ac979dcea 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -1635,6 +1635,10 @@ void brw_vs_emit(struct brw_vs_compile *c ) printf("\n"); } + /* FIXME Need to fix conditional instruction to remove this */ + if (intel->gen >= 6) + p->single_program_flow = GL_TRUE; + brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_access_mode(p, BRW_ALIGN_16); if_depth_in_loop[loop_depth] = 0; diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 4080a9dedf..50047a33a8 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -93,7 +93,7 @@ upload_vs_state(struct brw_context *brw) BEGIN_BATCH(6); OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2)); OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); - OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) | + OUT_BATCH(GEN6_VS_SPF_MODE | (0 << GEN6_VS_SAMPLER_COUNT_SHIFT) | (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) | -- cgit v1.2.3 From c5a3b25bb954db49dcb5e7737018979782d2edba Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Tue, 28 Sep 2010 14:54:26 +0800 Subject: i965: fix jump count on sandybridge Jump count is for 64bit long each, so one instruction requires 2 like on Ironlake. --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 1d3f19759d..38ac3be8df 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -819,7 +819,9 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p, struct brw_instruction *insn; GLuint br = 1; - if (intel->gen == 5) + /* jump count is for 64bit data chunk each, so one 128bit + instruction requires 2 chunks. */ + if (intel->gen >= 5) br = 2; if (p->single_program_flow) { @@ -861,7 +863,7 @@ void brw_ENDIF(struct brw_compile *p, struct intel_context *intel = &p->brw->intel; GLuint br = 1; - if (intel->gen == 5) + if (intel->gen >= 5) br = 2; if (p->single_program_flow) { @@ -978,7 +980,7 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p, struct brw_instruction *insn; GLuint br = 1; - if (intel->gen == 5) + if (intel->gen >= 5) br = 2; if (p->single_program_flow) @@ -1022,7 +1024,7 @@ void brw_land_fwd_jump(struct brw_compile *p, struct brw_instruction *landing = &p->store[p->nr_insn]; GLuint jmpi = 1; - if (intel->gen == 5) + if (intel->gen >= 5) jmpi = 2; assert(jmp_insn->header.opcode == BRW_OPCODE_JMPI); -- cgit v1.2.3 From 956f866030f7bea5fc4a2de28c72e60bdc3a5b3d Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 14:17:06 +0800 Subject: i965: Fix sampler on sandybridge Sandybridge has not much change on texture sampler with Ironlake. --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 29 ++++++++++++++++++++---- src/mesa/drivers/dri/i965/brw_structs.h | 14 +++++++----- src/mesa/drivers/dri/i965/brw_tex_layout.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_emit.c | 6 ++--- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 11 +++++++-- 5 files changed, 45 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 38ac3be8df..09cc8b2bd5 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -548,7 +548,7 @@ static void brw_set_sampler_message(struct brw_context *brw, assert(eot == 0); brw_set_src1(insn, brw_imm_d(0)); - if (intel->gen == 5) { + if (intel->gen >= 5) { insn->bits3.sampler_gen5.binding_table_index = binding_table_index; insn->bits3.sampler_gen5.sampler = sampler; insn->bits3.sampler_gen5.msg_type = msg_type; @@ -557,8 +557,12 @@ static void brw_set_sampler_message(struct brw_context *brw, insn->bits3.sampler_gen5.response_length = response_length; insn->bits3.sampler_gen5.msg_length = msg_length; insn->bits3.sampler_gen5.end_of_thread = eot; - insn->bits2.send_gen5.sfid = BRW_MESSAGE_TARGET_SAMPLER; - insn->bits2.send_gen5.end_of_thread = eot; + if (intel->gen >= 6) + insn->header.destreg__conditionalmod = BRW_MESSAGE_TARGET_SAMPLER; + else { + insn->bits2.send_gen5.sfid = BRW_MESSAGE_TARGET_SAMPLER; + insn->bits2.send_gen5.end_of_thread = eot; + } } else if (intel->is_g4x) { insn->bits3.sampler_g4x.binding_table_index = binding_table_index; insn->bits3.sampler_g4x.sampler = sampler; @@ -1581,6 +1585,7 @@ void brw_SAMPLE(struct brw_compile *p, GLuint header_present, GLuint simd_mode) { + struct intel_context *intel = &p->brw->intel; GLboolean need_stall = 0; if (writemask == 0) { @@ -1652,11 +1657,25 @@ void brw_SAMPLE(struct brw_compile *p, } { - struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); + struct brw_instruction *insn; + /* Sandybridge doesn't have the implied move for SENDs, + * 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); + } + + insn = next_insn(p, BRW_OPCODE_SEND); insn->header.predicate_control = 0; /* XXX */ insn->header.compression_control = BRW_COMPRESSION_NONE; - insn->header.destreg__conditionalmod = msg_reg_nr; + if (intel->gen < 6) + insn->header.destreg__conditionalmod = msg_reg_nr; brw_set_dest(insn, dest); brw_set_src0(insn, src0); diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 2a118e01c5..8e8f418eb7 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -1073,7 +1073,7 @@ struct brw_sampler_state GLuint mag_filter:3; GLuint mip_filter:2; GLuint base_level:5; - GLuint pad:1; + GLuint min_mag_neq:1; GLuint lod_preclamp:1; GLuint default_color_mode:1; GLuint pad0:1; @@ -1085,7 +1085,8 @@ struct brw_sampler_state GLuint r_wrap_mode:3; GLuint t_wrap_mode:3; GLuint s_wrap_mode:3; - GLuint pad:3; + GLuint cube_control_mode:1; + GLuint pad:2; GLuint max_lod:10; GLuint min_lod:10; } ss1; @@ -1099,7 +1100,9 @@ struct brw_sampler_state struct { - GLuint pad:19; + GLuint non_normalized_coord:1; + GLuint pad:12; + GLuint address_round:6; GLuint max_aniso:3; GLuint chroma_key_mode:1; GLuint chroma_key_index:2; @@ -1210,10 +1213,9 @@ struct brw_surface_state struct { GLuint pad1:16; - GLuint llc_mapping:1; - GLuint mlc_mapping:1; + GLuint cache_control:2; GLuint gfdt:1; - GLuint gfdt_src:1; + GLuint encrypt:1; GLuint y_offset:4; GLuint pad0:1; GLuint x_offset:7; diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index 768ccfd79c..9ac0713a1d 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -48,7 +48,7 @@ GLboolean brw_miptree_layout(struct intel_context *intel, switch (mt->target) { case GL_TEXTURE_CUBE_MAP: - if (intel->gen == 5) { + if (intel->gen >= 5) { GLuint align_h = 2; GLuint level; GLuint qpitch = 0; diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 260a04c774..a9ebc2689c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -1102,7 +1102,7 @@ void emit_tex(struct brw_wm_compile *c, /* Fill in the shadow comparison reference value. */ if (shadow) { - if (intel->gen == 5) { + if (intel->gen >= 5) { /* Fill in the cube map array index value. */ brw_MOV(p, brw_message_reg(cur_mrf), brw_imm_f(0)); cur_mrf += mrf_per_channel; @@ -1115,7 +1115,7 @@ void emit_tex(struct brw_wm_compile *c, cur_mrf += mrf_per_channel; } - if (intel->gen == 5) { + if (intel->gen >= 5) { if (shadow) msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_GEN5; else @@ -1168,7 +1168,7 @@ void emit_txb(struct brw_wm_compile *c, * from mattering. */ if (c->dispatch_width == 16 || intel->gen < 5) { - if (intel->gen == 5) + if (intel->gen >= 5) msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_GEN5; else msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; 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 1fc802cfa6..f9c48140fb 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -100,10 +100,13 @@ struct wm_sampler_key { * Sets the sampler state for a single unit based off of the sampler key * entry. */ -static void brw_update_sampler_state(struct wm_sampler_entry *key, +static void brw_update_sampler_state(struct brw_context *brw, + struct wm_sampler_entry *key, drm_intel_bo *sdc_bo, struct brw_sampler_state *sampler) { + struct intel_context *intel = &brw->intel; + memset(sampler, 0, sizeof(*sampler)); switch (key->minfilter) { @@ -163,6 +166,10 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key, sampler->ss1.s_wrap_mode = translate_wrap_mode(key->wrap_s); sampler->ss1.t_wrap_mode = translate_wrap_mode(key->wrap_t); + if (intel->gen >= 6 && + sampler->ss0.min_filter != sampler->ss0.mag_filter) + sampler->ss0.min_mag_neq = 1; + /* Cube-maps on 965 and later must use the same wrap mode for all 3 * coordinate dimensions. Futher, only CUBE and CLAMP are valid. */ @@ -329,7 +336,7 @@ static void upload_wm_samplers( struct brw_context *brw ) if (brw->wm.sdc_bo[i] == NULL) continue; - brw_update_sampler_state(&key.sampler[i], brw->wm.sdc_bo[i], + brw_update_sampler_state(brw, &key.sampler[i], brw->wm.sdc_bo[i], &sampler[i]); } -- cgit v1.2.3 From 81aae67e58f7c3123724e629a81e2c937864e3be Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Sun, 26 Sep 2010 13:13:32 +0800 Subject: i965: fix const register count for sandybridge Sandybridge's PS constant buffer payload size is decided from push const buffer command, incorrect size would cause wrong data in payload for position and vertex attributes. This fixes coefficients for tex2d/tex3d. --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 1cbd5d2b55..55aceea9b5 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -342,8 +342,8 @@ static void prealloc_reg(struct brw_wm_compile *c) } } /* number of constant regs used (each reg is float[8]) */ - c->nr_creg = 2 * ((4 * nr_params + 15) / 16); - reg_index += c->nr_creg; + c->nr_creg = ALIGN(nr_params, 2) / 2; + reg_index += c->nr_creg; } } -- cgit v1.2.3 From c8033f1b1ea118f3f47b7f3de557b7a8dcf11082 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Thu, 16 Sep 2010 09:50:02 +0800 Subject: i965: Add all device ids for sandybridge --- src/mesa/drivers/dri/intel/intel_chipset.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h index b5f180bbc8..1e7ceed32a 100644 --- a/src/mesa/drivers/dri/intel/intel_chipset.h +++ b/src/mesa/drivers/dri/intel/intel_chipset.h @@ -71,9 +71,13 @@ #define PCI_CHIP_ILD_G 0x0042 #define PCI_CHIP_ILM_G 0x0046 -#define PCI_CHIP_SANDYBRIDGE 0x0102 -#define PCI_CHIP_SANDYBRIDGE_M 0x0106 -#define PCI_CHIP_SANDYBRIDGE_M_D0 0x0126 +#define PCI_CHIP_SANDYBRIDGE_GT1 0x0102 /* Desktop */ +#define PCI_CHIP_SANDYBRIDGE_GT2 0x0112 +#define PCI_CHIP_SANDYBRIDGE_GT2_PLUS 0x0122 +#define PCI_CHIP_SANDYBRIDGE_M_GT1 0x0106 /* Mobile */ +#define PCI_CHIP_SANDYBRIDGE_M_GT2 0x0116 +#define PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS 0x0126 +#define PCI_CHIP_SANDYBRIDGE_S 0x010A /* Server */ #define IS_MOBILE(devid) (devid == PCI_CHIP_I855_GM || \ devid == PCI_CHIP_I915_GM || \ @@ -119,9 +123,13 @@ /* Compat macro for intel_decode.c */ #define IS_IRONLAKE(devid) IS_GEN5(devid) -#define IS_GEN6(devid) (devid == PCI_CHIP_SANDYBRIDGE || \ - devid == PCI_CHIP_SANDYBRIDGE_M || \ - devid == PCI_CHIP_SANDYBRIDGE_M_D0) +#define IS_GEN6(devid) (devid == PCI_CHIP_SANDYBRIDGE_GT1 || \ + devid == PCI_CHIP_SANDYBRIDGE_GT2 || \ + devid == PCI_CHIP_SANDYBRIDGE_GT2_PLUS || \ + devid == PCI_CHIP_SANDYBRIDGE_M_GT1 || \ + devid == PCI_CHIP_SANDYBRIDGE_M_GT2 || \ + devid == PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS || \ + devid == PCI_CHIP_SANDYBRIDGE_S) #define IS_965(devid) (IS_GEN4(devid) || \ IS_G4X(devid) || \ -- cgit v1.2.3 From 18c3b754f974751550dc9505d50535365beac8f3 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 15:08:09 +0800 Subject: i965: sandybridge pipe control workaround before write cache flush Must issue a pipe control with any non-zero post sync op before write cache flush = 1 pipe control. --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 10 +++++++++- src/mesa/drivers/dri/intel/intel_reg.h | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index ff741fc39a..9b39823917 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -264,10 +264,18 @@ intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch) struct intel_context *intel = batch->intel; if (intel->gen >= 6) { - BEGIN_BATCH(4); + 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 */ diff --git a/src/mesa/drivers/dri/intel/intel_reg.h b/src/mesa/drivers/dri/intel/intel_reg.h index c1a281f261..955b100b21 100644 --- a/src/mesa/drivers/dri/intel/intel_reg.h +++ b/src/mesa/drivers/dri/intel/intel_reg.h @@ -55,6 +55,11 @@ * additional flushing control. */ #define _3DSTATE_PIPE_CONTROL (CMD_3D | (3 << 27) | (2 << 24) | 2) +#define PIPE_CONTROL_CS_STALL (1 << 20) +#define PIPE_CONTROL_GLOBAL_SNAPSHOT_COUNT_RESET (1 << 19) +#define PIPE_CONTROL_TLB_INVALIDATE (1 << 18) +#define PIPE_CONTROL_SYNC_GFDT (1 << 17) +#define PIPE_CONTROL_MEDIA_STATE_CLEAR (1 << 16) #define PIPE_CONTROL_NO_WRITE (0 << 14) #define PIPE_CONTROL_WRITE_IMMEDIATE (1 << 14) #define PIPE_CONTROL_WRITE_DEPTH_COUNT (2 << 14) @@ -62,7 +67,14 @@ #define PIPE_CONTROL_DEPTH_STALL (1 << 13) #define PIPE_CONTROL_WRITE_FLUSH (1 << 12) #define PIPE_CONTROL_INSTRUCTION_FLUSH (1 << 11) +#define PIPE_CONTROL_TC_FLUSH (1 << 10) /* GM45+ only */ +#define PIPE_CONTROL_ISP_DIS (1 << 9) #define PIPE_CONTROL_INTERRUPT_ENABLE (1 << 8) +/* GT */ +#define PIPE_CONTROL_VF_CACHE_INVALIDATE (1 << 4) +#define PIPE_CONTROL_CONST_CACHE_INVALIDATE (1 << 3) +#define PIPE_CONTROL_STATE_CACHE_INVALIDATE (1 << 2) +#define PIPE_CONTROL_DEPTH_CACHE_FLUSH (1 << 0) #define PIPE_CONTROL_PPGTT_WRITE (0 << 2) #define PIPE_CONTROL_GLOBAL_GTT_WRITE (1 << 2) -- cgit v1.2.3 From c58bf2cee5b0f14a585089084fec7767f33887a7 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 17 Sep 2010 16:26:27 +0800 Subject: i965: only allow SIMD8 kernel on sandybridge now Until we fixed SIMD16 kernel, force to SIMD8 on sandybridge now. --- src/mesa/drivers/dri/intel/intel_context.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 109c670c14..edcc9536da 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -786,6 +786,11 @@ 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); -- cgit v1.2.3 From 85fa900b932243785e528e73fe119c27fa1988c4 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Sat, 25 Sep 2010 10:48:52 +0800 Subject: i965: don't do calculation for delta_xy on sandybridge Sandybridge doesn't have Xstart/Ystart in payload header. --- src/mesa/drivers/dri/i965/brw_wm_emit.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index a9ebc2689c..d5219a3d11 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -173,6 +173,7 @@ void emit_delta_xy(struct brw_compile *p, GLuint mask, const struct brw_reg *arg0) { + struct intel_context *intel = &p->brw->intel; struct brw_reg r1 = brw_vec1_grf(1, 0); if (mask == 0) @@ -180,6 +181,21 @@ void emit_delta_xy(struct brw_compile *p, assert(mask == WRITEMASK_XY); + if (intel->gen >= 6) { + /* XXX Gen6 WM doesn't have Xstart/Ystart in payload r1.0/r1.1. + Just add them with 0.0 for dst reg.. */ + r1 = brw_imm_v(0x00000000); + brw_ADD(p, + dst[0], + retype(arg0[0], BRW_REGISTER_TYPE_UW), + r1); + brw_ADD(p, + dst[1], + retype(arg0[1], BRW_REGISTER_TYPE_UW), + r1); + return; + } + /* Calc delta X,Y by subtracting origin in r1 from the pixel * centers produced by emit_pixel_xy(). */ -- cgit v1.2.3 From 15a8e7ec90433eea72416793c263febff078c888 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Sat, 25 Sep 2010 10:50:24 +0800 Subject: i965: fix pixel w interpolation on sandybridge --- src/mesa/drivers/dri/i965/brw_wm_emit.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index d5219a3d11..f52372ee46 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -269,6 +269,13 @@ void emit_pixel_w(struct brw_wm_compile *c, { struct brw_compile *p = &c->func; struct intel_context *intel = &p->brw->intel; + struct brw_reg src; + struct brw_reg temp_dst; + + if (intel->gen >= 6) + temp_dst = dst[3]; + else + temp_dst = brw_message_reg(2); assert(intel->gen < 6); @@ -282,24 +289,29 @@ void emit_pixel_w(struct brw_wm_compile *c, * result straight into a message reg. */ if (can_do_pln(intel, deltas)) { - brw_PLN(p, brw_message_reg(2), interp3, deltas[0]); + brw_PLN(p, temp_dst, interp3, deltas[0]); } else { brw_LINE(p, brw_null_reg(), interp3, deltas[0]); - brw_MAC(p, brw_message_reg(2), suboffset(interp3, 1), deltas[1]); + brw_MAC(p, temp_dst, suboffset(interp3, 1), deltas[1]); } /* Calc w */ + if (intel->gen >= 6) + src = temp_dst; + else + src = brw_null_reg(); + if (c->dispatch_width == 16) { brw_math_16(p, dst[3], BRW_MATH_FUNCTION_INV, BRW_MATH_SATURATE_NONE, - 2, brw_null_reg(), + 2, src, BRW_MATH_PRECISION_FULL); } else { brw_math(p, dst[3], BRW_MATH_FUNCTION_INV, BRW_MATH_SATURATE_NONE, - 2, brw_null_reg(), + 2, src, BRW_MATH_DATA_VECTOR, BRW_MATH_PRECISION_FULL); } -- cgit v1.2.3 From 3f3059fcc0cfb797830eb5e0755b5b4ec3fd218b Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Sun, 26 Sep 2010 13:17:18 +0800 Subject: i965: enable polygon offset on sandybridge Depth offset function is moved to SF stage on sandybridge. --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index b5984255af..a032278468 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -87,6 +87,9 @@ upload_sf_state(struct brw_context *brw) if ((ctx->Polygon.FrontFace == GL_CCW) ^ render_to_fbo) dw2 |= GEN6_SF_WINDING_CCW; + if (ctx->Polygon.OffsetFill) + dw2 |= GEN6_SF_GLOBAL_DEPTH_OFFSET_SOLID; + /* _NEW_SCISSOR */ if (ctx->Scissor.Enabled) dw3 |= GEN6_SF_SCISSOR_ENABLE; -- cgit v1.2.3 From 4b6b0bf24a043035d7ada0c966e01df6327dc529 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Tue, 28 Sep 2010 15:35:22 +0800 Subject: i965: fix scissor state on sandybridge Fix incorrect scissor rect struct and missed scissor state pointer setting for sandybridge. --- src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 1 + src/mesa/drivers/dri/i965/brw_structs.h | 8 +++++--- src/mesa/drivers/dri/i965/gen6_scissor_state.c | 3 +-- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index c5d296b129..3beed16945 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -102,6 +102,7 @@ extern const struct brw_tracked_state gen6_depth_stencil_state; extern const struct brw_tracked_state gen6_gs_state; extern const struct brw_tracked_state gen6_sampler_state; extern const struct brw_tracked_state gen6_scissor_state; +extern const struct brw_tracked_state gen6_scissor_state_pointers; extern const struct brw_tracked_state gen6_sf_state; extern const struct brw_tracked_state gen6_sf_vp; extern const struct brw_tracked_state gen6_urb; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index e4f36a7ec3..1aadd5ca61 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -145,6 +145,7 @@ const struct brw_tracked_state *gen6_atoms[] = &gen6_wm_state, &gen6_scissor_state, + &gen6_scissor_state_pointers, &brw_state_base_address, diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 8e8f418eb7..7b919872c4 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -909,10 +909,12 @@ struct brw_sf_unit_state }; -struct gen6_scissor_state +struct gen6_scissor_rect { - GLuint ymin, xmin; - GLuint ymax, xmax; + GLuint xmin:16; + GLuint ymin:16; + GLuint xmax:16; + GLuint ymax:16; }; struct brw_gs_unit_state diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c index 34a9dc234c..3d483c710c 100644 --- a/src/mesa/drivers/dri/i965/gen6_scissor_state.c +++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c @@ -35,7 +35,7 @@ prepare_scissor_state(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; const GLboolean render_to_fbo = (ctx->DrawBuffer->Name != 0); - struct gen6_scissor_state scissor; + struct gen6_scissor_rect scissor; /* _NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT */ @@ -84,7 +84,6 @@ static void upload_scissor_state_pointers(struct brw_context *brw) OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); ADVANCE_BATCH(); - intel_batchbuffer_emit_mi_flush(intel->batch); } -- cgit v1.2.3 From ec99833e928baf8dc8c958e3df6f3bbdce922794 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Sun, 26 Sep 2010 14:36:14 +0800 Subject: i965: fix point sprite on sandybridge Need to set point sprite function in fixed SF state now on sandybridge. --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index a032278468..6c88338195 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -68,7 +68,7 @@ upload_sf_state(struct brw_context *brw) /* CACHE_NEW_VS_PROG */ uint32_t num_inputs = brw_count_bits(brw->vs.prog_data->outputs_written); uint32_t num_outputs = brw_count_bits(brw->fragment_program->Base.InputsRead); - uint32_t dw1, dw2, dw3, dw4; + uint32_t dw1, dw2, dw3, dw4, dw16; int i; /* _NEW_BUFFER */ GLboolean render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; @@ -82,6 +82,7 @@ upload_sf_state(struct brw_context *brw) GEN6_SF_STATISTICS_ENABLE; dw3 = 0; dw4 = 0; + dw16 = 0; /* _NEW_POLYGON */ if ((ctx->Polygon.FrontFace == GL_CCW) ^ render_to_fbo) @@ -129,7 +130,7 @@ upload_sf_state(struct brw_context *brw) dw4 |= U_FIXED(CLAMP(ctx->Point.Size, 0.125, 225.875), 3) << GEN6_SF_POINT_WIDTH_SHIFT; - if (render_to_fbo) + if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) dw1 |= GEN6_SF_POINT_SPRITE_LOWERLEFT; /* _NEW_LIGHT */ @@ -143,6 +144,13 @@ upload_sf_state(struct brw_context *brw) (1 << GEN6_SF_TRIFAN_PROVOKE_SHIFT); } + if (ctx->Point.PointSprite) { + for (i = 0; i < 8; i++) { + if (ctx->Point.CoordReplace[i]) + dw16 |= (1 << i); + } + } + BEGIN_BATCH(20); OUT_BATCH(CMD_3D_SF_STATE << 16 | (20 - 2)); OUT_BATCH(dw1); @@ -172,7 +180,7 @@ upload_sf_state(struct brw_context *brw) } OUT_BATCH(attr_overrides); } - OUT_BATCH(0); /* point sprite texcoord bitmask */ + OUT_BATCH(dw16); /* point sprite texcoord bitmask */ OUT_BATCH(0); /* constant interp bitmask */ OUT_BATCH(0); /* wrapshortest enables 0-7 */ OUT_BATCH(0); /* wrapshortest enables 8-15 */ -- cgit v1.2.3 From 3074b61f64601be4620f1fb3c48c7c6024d3fd57 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Mon, 27 Sep 2010 09:58:09 +0800 Subject: i965: fix occlusion query on sandybridge Fix pipe control command for depth stall and PS_DEPTH_COUNT write. --- src/mesa/drivers/dri/i965/brw_queryobj.c | 161 ++++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 47 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index f6868c83ac..1b183735d7 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -107,16 +107,29 @@ brw_begin_query(GLcontext *ctx, struct gl_query_object *q) query->bo = drm_intel_bo_alloc(intel->bufmgr, "timer query", 4096, 4096); - BEGIN_BATCH(4); - OUT_BATCH(_3DSTATE_PIPE_CONTROL | - PIPE_CONTROL_WRITE_TIMESTAMP); - OUT_RELOC(query->bo, - I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, - PIPE_CONTROL_GLOBAL_GTT_WRITE | - 0); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); + if (intel->gen >= 6) { + BEGIN_BATCH(4); + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_WRITE_TIMESTAMP); + OUT_RELOC(query->bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + 0); + OUT_BATCH(0); + ADVANCE_BATCH(); + + } else { + BEGIN_BATCH(4); + OUT_BATCH(_3DSTATE_PIPE_CONTROL | + PIPE_CONTROL_WRITE_TIMESTAMP); + OUT_RELOC(query->bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + 0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } } else { /* Reset our driver's tracking of query state. */ drm_intel_bo_unreference(query->bo); @@ -140,16 +153,29 @@ brw_end_query(GLcontext *ctx, struct gl_query_object *q) struct brw_query_object *query = (struct brw_query_object *)q; if (query->Base.Target == GL_TIME_ELAPSED_EXT) { - BEGIN_BATCH(4); - OUT_BATCH(_3DSTATE_PIPE_CONTROL | - PIPE_CONTROL_WRITE_TIMESTAMP); - OUT_RELOC(query->bo, - I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, - PIPE_CONTROL_GLOBAL_GTT_WRITE | - 8); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); + if (intel->gen >= 6) { + BEGIN_BATCH(4); + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_WRITE_TIMESTAMP); + OUT_RELOC(query->bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + 8); + OUT_BATCH(0); + ADVANCE_BATCH(); + + } else { + BEGIN_BATCH(4); + OUT_BATCH(_3DSTATE_PIPE_CONTROL | + PIPE_CONTROL_WRITE_TIMESTAMP); + OUT_RELOC(query->bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + 8); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } intel_batchbuffer_flush(intel->batch); } else { @@ -223,22 +249,43 @@ brw_emit_query_begin(struct brw_context *brw) if (!query || brw->query.active) return; - BEGIN_BATCH(4); - OUT_BATCH(_3DSTATE_PIPE_CONTROL | - PIPE_CONTROL_DEPTH_STALL | - PIPE_CONTROL_WRITE_DEPTH_COUNT); - /* This object could be mapped cacheable, but we don't have an exposed - * mechanism to support that. Since it's going uncached, tell GEM that - * we're writing to it. The usual clflush should be all that's required - * to pick up the results. - */ - OUT_RELOC(brw->query.bo, - I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, - PIPE_CONTROL_GLOBAL_GTT_WRITE | - ((brw->query.index * 2) * sizeof(uint64_t))); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); + if (intel->gen >= 6) { + BEGIN_BATCH(8); + + /* workaround: CS stall required before depth stall. */ + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_CS_STALL); + OUT_BATCH(0); /* write address */ + OUT_BATCH(0); /* write data */ + + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_DEPTH_STALL | + PIPE_CONTROL_WRITE_DEPTH_COUNT); + OUT_RELOC(brw->query.bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + ((brw->query.index * 2) * sizeof(uint64_t))); + OUT_BATCH(0); + ADVANCE_BATCH(); + + } else { + BEGIN_BATCH(4); + OUT_BATCH(_3DSTATE_PIPE_CONTROL | + PIPE_CONTROL_DEPTH_STALL | + PIPE_CONTROL_WRITE_DEPTH_COUNT); + /* This object could be mapped cacheable, but we don't have an exposed + * mechanism to support that. Since it's going uncached, tell GEM that + * we're writing to it. The usual clflush should be all that's required + * to pick up the results. + */ + OUT_RELOC(brw->query.bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + ((brw->query.index * 2) * sizeof(uint64_t))); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } if (query->bo != brw->query.bo) { if (query->bo != NULL) @@ -260,17 +307,37 @@ brw_emit_query_end(struct brw_context *brw) if (!brw->query.active) return; - BEGIN_BATCH(4); - OUT_BATCH(_3DSTATE_PIPE_CONTROL | - PIPE_CONTROL_DEPTH_STALL | - PIPE_CONTROL_WRITE_DEPTH_COUNT); - OUT_RELOC(brw->query.bo, - I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, - PIPE_CONTROL_GLOBAL_GTT_WRITE | - ((brw->query.index * 2 + 1) * sizeof(uint64_t))); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); + if (intel->gen >= 6) { + BEGIN_BATCH(8); + /* workaround: CS stall required before depth stall. */ + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_CS_STALL); + OUT_BATCH(0); /* write address */ + OUT_BATCH(0); /* write data */ + + OUT_BATCH(_3DSTATE_PIPE_CONTROL); + OUT_BATCH(PIPE_CONTROL_DEPTH_STALL | + PIPE_CONTROL_WRITE_DEPTH_COUNT); + OUT_RELOC(brw->query.bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + ((brw->query.index * 2 + 1) * sizeof(uint64_t))); + OUT_BATCH(0); + ADVANCE_BATCH(); + + } else { + BEGIN_BATCH(4); + OUT_BATCH(_3DSTATE_PIPE_CONTROL | + PIPE_CONTROL_DEPTH_STALL | + PIPE_CONTROL_WRITE_DEPTH_COUNT); + OUT_RELOC(brw->query.bo, + I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, + PIPE_CONTROL_GLOBAL_GTT_WRITE | + ((brw->query.index * 2 + 1) * sizeof(uint64_t))); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } brw->query.active = GL_FALSE; brw->query.index++; -- cgit v1.2.3 From 45b37c4b12bb328e804a2b58c90e0099240879d3 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Tue, 28 Sep 2010 15:50:59 +0800 Subject: i965: fallback bitmap operation on sandybridge Need to bring back correct fb write with header to set pixel write mask. Fallback for now. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index c62e16f587..23410f063c 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -326,9 +326,15 @@ intelBitmap(GLcontext * ctx, const struct gl_pixelstore_attrib *unpack, const GLubyte * pixels) { + struct intel_context *intel = intel_context(ctx); + if (do_blit_bitmap(ctx, x, y, width, height, unpack, pixels)) return; + /* FIXME */ + if (intel->gen == 6) + return _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels); + _mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels); } -- cgit v1.2.3 From fceb78e3cc67d035a69613826f46a18e62235f5c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 21:15:28 -0700 Subject: i965: Fix negation in the new FS backend. Fixes: glsl1-Negation glsl1-Negation2 --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 7f2bf84a14..d05aa29014 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -638,7 +638,7 @@ fs_visitor::visit(ir_expression *ir) emit(fs_inst(BRW_OPCODE_ADD, this->result, op[0], fs_reg(-1))); break; case ir_unop_neg: - op[0].negate = ~op[0].negate; + op[0].negate = !op[0].negate; this->result = op[0]; break; case ir_unop_abs: -- cgit v1.2.3 From e10508812aed4c41c62ea27ac540c8d079bece07 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 21:25:55 -0700 Subject: i965: Actually track the "if" depth in loop in the new FS backend. Fixes: glsl-fs-if-nested-loop. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index d05aa29014..c324be210a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1789,6 +1789,7 @@ fs_visitor::generate_code() case BRW_OPCODE_IF: assert(if_stack_depth < 16); if_stack[if_stack_depth] = brw_IF(p, BRW_EXECUTE_8); + if_depth_in_loop[loop_stack_depth]++; if_stack_depth++; break; case BRW_OPCODE_ELSE: @@ -1798,6 +1799,7 @@ fs_visitor::generate_code() case BRW_OPCODE_ENDIF: if_stack_depth--; brw_ENDIF(p , if_stack[if_stack_depth]); + if_depth_in_loop[loop_stack_depth]--; break; case BRW_OPCODE_DO: -- cgit v1.2.3 From 1723fdb3f0004a685351d005ba0f5bfc1c2a852e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 21:35:54 -0700 Subject: i965: Apply the same set of lowering passes to new FS as to Mesa IR. While much of this we will want to support natively, this should make the task of reaching the Mesa IR backend's quality easier. Fixes: glsl-fs-main-return. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index c324be210a..31f5bbf587 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -141,7 +141,22 @@ brw_link_shader(GLcontext *ctx, struct gl_shader_program *prog) do { progress = false; + progress = do_lower_jumps(shader->ir, true, true, + true, /* main return */ + false, /* continue */ + false /* loops */ + ) || progress; + progress = do_common_optimization(shader->ir, true, 32) || progress; + + progress = lower_noise(shader->ir) || progress; + progress = + lower_variable_index_to_cond_assign(shader->ir, + GL_TRUE, /* input */ + GL_TRUE, /* output */ + GL_TRUE, /* temp */ + GL_TRUE /* uniform */ + ) || progress; } while (progress); validate_ir_tree(shader->ir); -- cgit v1.2.3 From 57edd7c5c116926325e3a86cef618bfd1b5881c1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 22:06:38 -0700 Subject: i965: Fix valgrind complaint about base_ir for new FS debugging. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 31f5bbf587..27ea9121b4 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -405,6 +405,7 @@ public: this->current_annotation = NULL; this->annotation_string = NULL; this->annotation_ir = NULL; + this->base_ir = NULL; } ~fs_visitor() { -- cgit v1.2.3 From 719f84d9aba6b016e1069e0461cbfc4211f5a3b5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 22:15:36 -0700 Subject: i965: Fix up the FS backend for the variable array indexing pass. We need to re-run channel expressions afterwards as it generates new vector expressions, and we need to successfully support conditional assignment (brw_CMP takes 2 operands, not 1). --- src/mesa/drivers/dri/i965/brw_fs.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 27ea9121b4..78c1bc6ea6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -135,12 +135,12 @@ brw_link_shader(GLcontext *ctx, struct gl_shader_program *prog) do_sub_to_add_neg(shader->ir); do_explog_to_explog2(shader->ir); - brw_do_channel_expressions(shader->ir); - brw_do_vector_splitting(shader->ir); - do { progress = false; + brw_do_channel_expressions(shader->ir); + brw_do_vector_splitting(shader->ir); + progress = do_lower_jumps(shader->ir, true, true, true, /* main return */ false, /* continue */ @@ -520,6 +520,14 @@ fs_reg::fs_reg(class fs_visitor *v, const struct glsl_type *type) case GLSL_TYPE_UINT: this->type = BRW_REGISTER_TYPE_UD; break; + case GLSL_TYPE_ARRAY: + case GLSL_TYPE_STRUCT: + /* These should be overridden with the type of the member when + * dereferenced into. BRW_REGISTER_TYPE_UD seems like a likely + * way to trip up if we don't. + */ + this->type = BRW_REGISTER_TYPE_UD; + break; default: assert(!"not reached"); this->type = BRW_REGISTER_TYPE_F; @@ -877,7 +885,7 @@ fs_visitor::visit(ir_assignment *ir) if (ir->condition) { /* Get the condition bool into the predicate. */ ir->condition->accept(this); - inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, fs_reg(0))); + inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null, this->result, fs_reg(0))); inst->conditional_mod = BRW_CONDITIONAL_NZ; } -- cgit v1.2.3 From 07fc8eed8f0398063d87acf3a7ee392da4184822 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 22:19:51 -0700 Subject: i965: Set the variable type when dereferencing an array. We don't set the type on the array virtual reg as a whole, so here's the right place. Fixes: glsl1-GLSL 1.20 arrays glsl1-temp array with constant indexing, fragment shader glsl1-temp array with swizzled variable indexing --- src/mesa/drivers/dri/i965/brw_fs.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 78c1bc6ea6..3b56340343 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -613,6 +613,21 @@ fs_visitor::visit(ir_dereference_array *ir) element_size = ir->type->vector_elements; } else { element_size = type_size(ir->type); + switch (ir->type->base_type) { + case GLSL_TYPE_UINT: + this->result.type = BRW_REGISTER_TYPE_UD; + break; + case GLSL_TYPE_INT: + case GLSL_TYPE_BOOL: + this->result.type = BRW_REGISTER_TYPE_D; + break; + case GLSL_TYPE_FLOAT: + this->result.type = BRW_REGISTER_TYPE_F; + break; + default: + /* deref producing struct, no need to tweak type yet. */ + break; + } } if (index) { -- cgit v1.2.3 From ba481f2046e6427c8bd7fc5f8cb8ef3059a7881a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 22:26:22 -0700 Subject: i965: Add support for dereferencing structs to the new FS backend. Fixes: glsl1-struct(2) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 67 +++++++++++++++++------------------- 1 file changed, 32 insertions(+), 35 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 3b56340343..4f88ca10c1 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -499,42 +499,42 @@ fs_reg::fs_reg(enum register_file file, int hw_reg) this->type = BRW_REGISTER_TYPE_F; } -/** Automatic reg constructor. */ -fs_reg::fs_reg(class fs_visitor *v, const struct glsl_type *type) +int +brw_type_for_base_type(const struct glsl_type *type) { - init(); - - this->file = GRF; - this->reg = v->next_abstract_grf; - this->reg_offset = 0; - v->next_abstract_grf += type_size(type); - switch (type->base_type) { case GLSL_TYPE_FLOAT: - this->type = BRW_REGISTER_TYPE_F; - break; + return BRW_REGISTER_TYPE_F; case GLSL_TYPE_INT: case GLSL_TYPE_BOOL: - this->type = BRW_REGISTER_TYPE_D; - break; + return BRW_REGISTER_TYPE_D; case GLSL_TYPE_UINT: - this->type = BRW_REGISTER_TYPE_UD; - break; + return BRW_REGISTER_TYPE_UD; case GLSL_TYPE_ARRAY: case GLSL_TYPE_STRUCT: /* These should be overridden with the type of the member when * dereferenced into. BRW_REGISTER_TYPE_UD seems like a likely * way to trip up if we don't. */ - this->type = BRW_REGISTER_TYPE_UD; - break; + return BRW_REGISTER_TYPE_UD; default: assert(!"not reached"); - this->type = BRW_REGISTER_TYPE_F; - break; + return BRW_REGISTER_TYPE_F; } } +/** Automatic reg constructor. */ +fs_reg::fs_reg(class fs_visitor *v, const struct glsl_type *type) +{ + init(); + + this->file = GRF; + this->reg = v->next_abstract_grf; + this->reg_offset = 0; + v->next_abstract_grf += type_size(type); + this->type = brw_type_for_base_type(type); +} + fs_reg * fs_visitor::variable_storage(ir_variable *var) { @@ -597,7 +597,18 @@ fs_visitor::visit(ir_dereference_variable *ir) void fs_visitor::visit(ir_dereference_record *ir) { - assert(!"FINISHME"); + const glsl_type *struct_type = ir->record->type; + + ir->record->accept(this); + + unsigned int offset = 0; + for (unsigned int i = 0; i < struct_type->length; i++) { + if (strcmp(struct_type->fields.structure[i].name, ir->field) == 0) + break; + offset += type_size(struct_type->fields.structure[i].type); + } + this->result.reg_offset += offset; + this->result.type = brw_type_for_base_type(ir->type); } void @@ -613,21 +624,7 @@ fs_visitor::visit(ir_dereference_array *ir) element_size = ir->type->vector_elements; } else { element_size = type_size(ir->type); - switch (ir->type->base_type) { - case GLSL_TYPE_UINT: - this->result.type = BRW_REGISTER_TYPE_UD; - break; - case GLSL_TYPE_INT: - case GLSL_TYPE_BOOL: - this->result.type = BRW_REGISTER_TYPE_D; - break; - case GLSL_TYPE_FLOAT: - this->result.type = BRW_REGISTER_TYPE_F; - break; - default: - /* deref producing struct, no need to tweak type yet. */ - break; - } + this->result.type = brw_type_for_base_type(ir->type); } if (index) { -- cgit v1.2.3 From 6bf12c8b7366a9db8c88b9cacaa06266b41a73b5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 09:31:56 -0700 Subject: i965: Add support for struct, array, and matrix uniforms to FS backend. Fixes 16 piglit cases. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 75 ++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 4f88ca10c1..4a63fc61aa 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -453,6 +453,7 @@ public: void emit_fb_writes(); struct brw_reg interp_reg(int location, int channel); + int setup_uniform_values(int loc, const glsl_type *type); struct brw_context *brw; struct intel_context *intel; @@ -541,6 +542,64 @@ fs_visitor::variable_storage(ir_variable *var) return (fs_reg *)hash_table_find(this->variable_ht, var); } +/* Our support for uniforms is piggy-backed on the struct + * gl_fragment_program, because that's where the values actually + * get stored, rather than in some global gl_shader_program uniform + * store. + */ +int +fs_visitor::setup_uniform_values(int loc, const glsl_type *type) +{ + const struct gl_program *fp = &this->brw->fragment_program->Base; + unsigned int offset = 0; + float *vec_values; + + if (type->is_matrix()) { + const glsl_type *column = glsl_type::get_instance(GLSL_TYPE_FLOAT, + type->vector_elements, + 1); + + for (unsigned int i = 0; i < type->matrix_columns; i++) { + offset += setup_uniform_values(loc + offset, column); + } + + return offset; + } + + switch (type->base_type) { + case GLSL_TYPE_FLOAT: + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + case GLSL_TYPE_BOOL: + vec_values = fp->Parameters->ParameterValues[loc]; + for (unsigned int i = 0; i < type->vector_elements; i++) { + c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i]; + } + return 1; + + case GLSL_TYPE_STRUCT: + for (unsigned int i = 0; i < type->length; i++) { + offset += setup_uniform_values(loc + offset, + type->fields.structure[i].type); + } + return offset; + + case GLSL_TYPE_ARRAY: + for (unsigned int i = 0; i < type->length; i++) { + offset += setup_uniform_values(loc + offset, type->fields.array); + } + return offset; + + case GLSL_TYPE_SAMPLER: + /* The sampler takes up a slot, but we don't use any values from it. */ + return 1; + + default: + assert(!"not reached"); + return 0; + } +} + void fs_visitor::visit(ir_variable *ir) { @@ -560,23 +619,9 @@ fs_visitor::visit(ir_variable *ir) } if (ir->mode == ir_var_uniform) { - const float *vec_values; int param_index = c->prog_data.nr_params; - /* FINISHME: This is wildly incomplete. */ - assert(ir->type->is_scalar() || ir->type->is_vector() || - ir->type->is_sampler()); - - const struct gl_program *fp = &this->brw->fragment_program->Base; - /* Our support for uniforms is piggy-backed on the struct - * gl_fragment_program, because that's where the values actually - * get stored, rather than in some global gl_shader_program uniform - * store. - */ - vec_values = fp->Parameters->ParameterValues[ir->location]; - for (unsigned int i = 0; i < ir->type->vector_elements; i++) { - c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i]; - } + setup_uniform_values(ir->location, ir->type); reg = new(this->mem_ctx) fs_reg(UNIFORM, param_index); } -- cgit v1.2.3 From f1dba030564e66ca52f4ed44172681e7d2e90ad2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 10:07:56 -0700 Subject: i965: Fix all non-snb regression in the snb attribute interpolation commit. This apparently had never been tested elsewhere before being merged to master. --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index a88b7bdea8..d4d75d63d8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -342,7 +342,7 @@ static struct prog_src_register get_pixel_w( struct brw_wm_compile *c ) if (c->func.brw->intel.gen >= 6) return src_undef(); - if (!src_is_undef(c->pixel_w)) { + if (src_is_undef(c->pixel_w)) { struct prog_dst_register pixel_w = get_temp(c); struct prog_src_register deltas = get_delta_xy(c); struct prog_src_register interp_wpos = src_reg(PROGRAM_PAYLOAD, FRAG_ATTRIB_WPOS); -- cgit v1.2.3 From ef8e002c75a5def2c400638336dcd55d411d87be Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 10:05:10 -0700 Subject: i965: Fix up part of my Sandybridge attributes support patch. I confused the array sizing for number of files for the number of regs in a file. --- src/mesa/drivers/dri/i965/brw_wm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index a38df1e111..ae6a1d56f7 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -182,6 +182,8 @@ struct brw_wm_instruction { #define MAX_WM_OPCODE (MAX_OPCODE + 9) #define PROGRAM_PAYLOAD (PROGRAM_FILE_MAX) +#define NUM_FILES (PROGRAM_PAYLOAD + 1) + #define PAYLOAD_DEPTH (FRAG_ATTRIB_MAX) #define PAYLOAD_W (FRAG_ATTRIB_MAX + 1) #define PAYLOAD_FP_REG_MAX (FRAG_ATTRIB_MAX + 2) @@ -227,7 +229,7 @@ struct brw_wm_compile { } payload; - const struct brw_wm_ref *pass0_fp_reg[PAYLOAD_FP_REG_MAX][256][4]; + const struct brw_wm_ref *pass0_fp_reg[NUM_FILES][256][4]; struct brw_wm_ref undef_ref; struct brw_wm_value undef_value; @@ -255,7 +257,7 @@ struct brw_wm_compile { struct { GLboolean inited; struct brw_reg reg; - } wm_regs[PAYLOAD_FP_REG_MAX][256][4]; + } wm_regs[NUM_FILES][256][4]; GLboolean used_grf[BRW_WM_MAX_GRF]; GLuint first_free_grf; -- cgit v1.2.3 From 5f7bd68149e59b6940e891928faa532bce0271f6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 09:47:37 -0700 Subject: i965: Add support for gl_FrontFacing to the new FS backend. Fixes: glsl1-gl_FrontFacing var (1) glsl1-gl_FrontFacing var (2) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 4a63fc61aa..0595488c9c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -615,7 +615,21 @@ fs_visitor::visit(ir_variable *ir) } if (ir->mode == ir_var_in) { - reg = &this->interp_attrs[ir->location]; + if (strcmp(ir->name, "gl_FrontFacing") == 0) { + reg = new(this->mem_ctx) fs_reg(this, ir->type); + struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); + /* bit 31 is "primitive is back face", so checking < (1 << 31) gives + * us front face + */ + fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, + *reg, + fs_reg(r1_6ud), + fs_reg(1u << 31))); + inst->conditional_mod = BRW_CONDITIONAL_L; + emit(fs_inst(BRW_OPCODE_AND, *reg, *reg, fs_reg(1u))); + } else { + reg = &this->interp_attrs[ir->location]; + } } if (ir->mode == ir_var_uniform) { @@ -1342,8 +1356,6 @@ fs_visitor::emit_interpolation() this->pixel_w = fs_reg(this, glsl_type::float_type); emit(fs_inst(FS_OPCODE_RCP, this->pixel_w, wpos)); - /* FINISHME: gl_FrontFacing */ - foreach_iter(exec_list_iterator, iter, *this->shader->ir) { ir_instruction *ir = (ir_instruction *)iter.get(); ir_variable *var = ir->as_variable(); -- cgit v1.2.3 From 9e96c737f8cb6faebf7c7339cfcf14f80ed8e73c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 10:18:31 -0700 Subject: i965: Subtract instead of adding when computing y delta in new FS backend. Fixes 7 piglit cases. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 0595488c9c..723ebca61b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1335,7 +1335,7 @@ fs_visitor::emit_interpolation() emit(fs_inst(BRW_OPCODE_ADD, this->delta_y, this->pixel_y, - fs_reg(brw_vec1_grf(1, 1)))); + fs_reg(negate(brw_vec1_grf(1, 1))))); this->current_annotation = "compute pos.w and 1/pos.w"; /* Compute wpos. Unlike many other varying inputs, we usually need it -- cgit v1.2.3 From a32893221ce253da7bb465e0ec9d0df5f7208d8f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 10:43:56 -0700 Subject: mesa: Pull ir_to_mesa's sampler number fetcher out to shared code. --- src/mesa/program/ir_to_mesa.cpp | 90 ++------------------------ src/mesa/program/sampler.cpp | 140 ++++++++++++++++++++++++++++++++++++++++ src/mesa/program/sampler.h | 29 +++++++++ src/mesa/sources.mak | 3 +- 4 files changed, 175 insertions(+), 87 deletions(-) create mode 100644 src/mesa/program/sampler.cpp create mode 100644 src/mesa/program/sampler.h (limited to 'src/mesa') diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 93b6c305f1..aa2add4174 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -54,6 +54,7 @@ extern "C" { #include "program/program.h" #include "program/prog_uniform.h" #include "program/prog_parameter.h" +#include "program/sampler.h" } static int swizzle_for_size(int size); @@ -274,8 +275,6 @@ public: GLboolean try_emit_mad(ir_expression *ir, int mul_operand); - int get_sampler_uniform_value(ir_dereference *deref); - void *mem_ctx; }; @@ -1894,89 +1893,6 @@ ir_to_mesa_visitor::visit(ir_call *ir) this->result = entry->return_reg; } -class get_sampler_name : public ir_hierarchical_visitor -{ -public: - get_sampler_name(ir_to_mesa_visitor *mesa, ir_dereference *last) - { - this->mem_ctx = mesa->mem_ctx; - this->mesa = mesa; - this->name = NULL; - this->offset = 0; - this->last = last; - } - - virtual ir_visitor_status visit(ir_dereference_variable *ir) - { - this->name = ir->var->name; - return visit_continue; - } - - virtual ir_visitor_status visit_leave(ir_dereference_record *ir) - { - this->name = talloc_asprintf(mem_ctx, "%s.%s", name, ir->field); - return visit_continue; - } - - virtual ir_visitor_status visit_leave(ir_dereference_array *ir) - { - ir_constant *index = ir->array_index->as_constant(); - int i; - - if (index) { - i = index->value.i[0]; - } else { - /* GLSL 1.10 and 1.20 allowed variable sampler array indices, - * while GLSL 1.30 requires that the array indices be - * constant integer expressions. We don't expect any driver - * to actually work with a really variable array index, so - * all that would work would be an unrolled loop counter that ends - * up being constant above. - */ - mesa->shader_program->InfoLog = - talloc_asprintf_append(mesa->shader_program->InfoLog, - "warning: Variable sampler array index " - "unsupported.\nThis feature of the language " - "was removed in GLSL 1.20 and is unlikely " - "to be supported for 1.10 in Mesa.\n"); - i = 0; - } - if (ir != last) { - this->name = talloc_asprintf(mem_ctx, "%s[%d]", name, i); - } else { - offset = i; - } - return visit_continue; - } - - ir_to_mesa_visitor *mesa; - const char *name; - void *mem_ctx; - int offset; - ir_dereference *last; -}; - -int -ir_to_mesa_visitor::get_sampler_uniform_value(ir_dereference *sampler) -{ - get_sampler_name getname(this, sampler); - - sampler->accept(&getname); - - GLint index = _mesa_lookup_parameter_index(prog->Parameters, -1, - getname.name); - - if (index < 0) { - fail_link(this->shader_program, - "failed to find sampler named %s.\n", getname.name); - return 0; - } - - index += getname.offset; - - return this->prog->Parameters->ParameterValues[index][0]; -} - void ir_to_mesa_visitor::visit(ir_texture *ir) { @@ -2076,7 +1992,9 @@ ir_to_mesa_visitor::visit(ir_texture *ir) if (ir->shadow_comparitor) inst->tex_shadow = GL_TRUE; - inst->sampler = get_sampler_uniform_value(ir->sampler); + inst->sampler = _mesa_get_sampler_uniform_value(ir->sampler, + this->shader_program, + this->prog); const glsl_type *sampler_type = ir->sampler->type; diff --git a/src/mesa/program/sampler.cpp b/src/mesa/program/sampler.cpp new file mode 100644 index 0000000000..0e58aef9c9 --- /dev/null +++ b/src/mesa/program/sampler.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. + * Copyright (C) 2008 VMware, Inc. All Rights Reserved. + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include + +extern "C" { +#include "main/compiler.h" +#include "main/mtypes.h" +#include "program/prog_parameter.h" +#include "ir.h" +#include "ir_visitor.h" +#include "glsl_types.h" +} + +static void fail_link(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3); + +static void fail_link(struct gl_shader_program *prog, const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + prog->InfoLog = talloc_vasprintf_append(prog->InfoLog, fmt, args); + va_end(args); + + prog->LinkStatus = GL_FALSE; +} + +class get_sampler_name : public ir_hierarchical_visitor +{ +public: + get_sampler_name(ir_dereference *last, + struct gl_shader_program *shader_program) + { + this->mem_ctx = talloc_new(NULL); + this->shader_program = shader_program; + this->name = NULL; + this->offset = 0; + this->last = last; + } + + ~get_sampler_name() + { + talloc_free(this->mem_ctx); + } + + virtual ir_visitor_status visit(ir_dereference_variable *ir) + { + this->name = ir->var->name; + return visit_continue; + } + + virtual ir_visitor_status visit_leave(ir_dereference_record *ir) + { + this->name = talloc_asprintf(mem_ctx, "%s.%s", name, ir->field); + return visit_continue; + } + + virtual ir_visitor_status visit_leave(ir_dereference_array *ir) + { + ir_constant *index = ir->array_index->as_constant(); + int i; + + if (index) { + i = index->value.i[0]; + } else { + /* GLSL 1.10 and 1.20 allowed variable sampler array indices, + * while GLSL 1.30 requires that the array indices be + * constant integer expressions. We don't expect any driver + * to actually work with a really variable array index, so + * all that would work would be an unrolled loop counter that ends + * up being constant above. + */ + shader_program->InfoLog = + talloc_asprintf_append(shader_program->InfoLog, + "warning: Variable sampler array index " + "unsupported.\nThis feature of the language " + "was removed in GLSL 1.20 and is unlikely " + "to be supported for 1.10 in Mesa.\n"); + i = 0; + } + if (ir != last) { + this->name = talloc_asprintf(mem_ctx, "%s[%d]", name, i); + } else { + offset = i; + } + return visit_continue; + } + + struct gl_shader_program *shader_program; + const char *name; + void *mem_ctx; + int offset; + ir_dereference *last; +}; + +extern "C" { +int +_mesa_get_sampler_uniform_value(class ir_dereference *sampler, + struct gl_shader_program *shader_program, + const struct gl_program *prog) +{ + get_sampler_name getname(sampler, shader_program); + + sampler->accept(&getname); + + GLint index = _mesa_lookup_parameter_index(prog->Parameters, -1, + getname.name); + + if (index < 0) { + fail_link(shader_program, + "failed to find sampler named %s.\n", getname.name); + return 0; + } + + index += getname.offset; + + return prog->Parameters->ParameterValues[index][0]; +} +} diff --git a/src/mesa/program/sampler.h b/src/mesa/program/sampler.h new file mode 100644 index 0000000000..22467e9902 --- /dev/null +++ b/src/mesa/program/sampler.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. + * Copyright (C) 2008 VMware, Inc. All Rights Reserved. + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +int +_mesa_get_sampler_uniform_value(class ir_dereference *sampler, + struct gl_shader_program *shader_program, + const struct gl_program *prog); diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 6f6598db82..b2be5ba07f 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -250,7 +250,8 @@ PROGRAM_SOURCES = \ program/symbol_table.c SHADER_CXX_SOURCES = \ - program/ir_to_mesa.cpp + program/ir_to_mesa.cpp \ + program/sampler.cpp ASM_C_SOURCES = \ x86/common_x86.c \ -- cgit v1.2.3 From 2999a44968a045b5516ff23d70b711b01bd696a5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 10:53:47 -0700 Subject: i965: Set up sampler numbers in the FS backend. +10 piglits --- src/mesa/drivers/dri/i965/brw_fs.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 723ebca61b..fd13349ae6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -34,6 +34,7 @@ extern "C" { #include "program/prog_parameter.h" #include "program/prog_print.h" #include "program/prog_optimize.h" +#include "program/sampler.h" #include "program/hash_table.h" #include "brw_context.h" #include "brw_eu.h" @@ -387,6 +388,7 @@ public: this->c = c; this->p = &c->func; this->brw = p->brw; + this->fp = brw->fragment_program; this->intel = &brw->intel; this->ctx = &intel->ctx; this->mem_ctx = talloc_new(NULL); @@ -456,6 +458,7 @@ public: int setup_uniform_values(int loc, const glsl_type *type); struct brw_context *brw; + const struct gl_fragment_program *fp; struct intel_context *intel; GLcontext *ctx; struct brw_wm_compile *c; @@ -550,7 +553,6 @@ fs_visitor::variable_storage(ir_variable *var) int fs_visitor::setup_uniform_values(int loc, const glsl_type *type) { - const struct gl_program *fp = &this->brw->fragment_program->Base; unsigned int offset = 0; float *vec_values; @@ -571,7 +573,7 @@ fs_visitor::setup_uniform_values(int loc, const glsl_type *type) case GLSL_TYPE_UINT: case GLSL_TYPE_INT: case GLSL_TYPE_BOOL: - vec_values = fp->Parameters->ParameterValues[loc]; + vec_values = fp->Base.Parameters->ParameterValues[loc]; for (unsigned int i = 0; i < type->vector_elements; i++) { c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i]; } @@ -1045,6 +1047,12 @@ fs_visitor::visit(ir_texture *ir) break; } + inst->sampler = + _mesa_get_sampler_uniform_value(ir->sampler, + ctx->Shader.CurrentProgram, + &brw->fragment_program->Base); + inst->sampler = c->fp->program.Base.SamplerUnits[inst->sampler]; + this->result = dst; if (ir->shadow_comparitor) -- cgit v1.2.3 From f46a61554f2cc8904a381d3e514403dca9754360 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 28 Sep 2010 12:03:45 -0700 Subject: scons: Add program/sampler.cpp to SCons build. This is a follow-up to commit a32893221ce253da7bb465e0ec9d0df5f7208d8f. Fixes MinGW SCons build. --- src/mesa/SConscript | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 28598f4a17..c89e635aab 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -224,6 +224,7 @@ if env['platform'] != 'winddk': 'program/prog_statevars.c', 'program/prog_uniform.c', 'program/programopt.c', + 'program/sampler.cpp', 'program/symbol_table.c', ] -- cgit v1.2.3 From 86fd11262cb5697e5c3563e876781b3587788737 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 12:07:30 -0700 Subject: i965: Add support for non-color render target write data to new FS backend. This is the first time these payload bits have made sense to me, outside of brw_wm_pass* structure. Fixes: glsl1-gl_FragDepth writing --- src/mesa/drivers/dri/i965/brw_fs.cpp | 43 ++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index fd13349ae6..e8aff6bab9 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -75,6 +75,7 @@ enum fs_opcodes { }; static int using_new_fs = -1; +static struct brw_reg brw_reg_from_fs_reg(class fs_reg *reg); struct gl_shader * brw_new_shader(GLcontext *ctx, GLuint name, GLuint type) @@ -613,7 +614,6 @@ fs_visitor::visit(ir_variable *ir) this->frag_data = ir; } else if (strcmp(ir->name, "gl_FragDepth") == 0) { this->frag_depth = ir; - assert(!"FINISHME: this hangs currently."); } if (ir->mode == ir_var_in) { @@ -1418,17 +1418,45 @@ void fs_visitor::emit_fb_writes() { this->current_annotation = "FB write"; + int nr = 0; + + /* m0, m1 header */ + nr += 2; + + if (c->key.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)))); + } assert(this->frag_color || !"FINISHME: MRT"); fs_reg color = *(variable_storage(this->frag_color)); for (int i = 0; i < 4; i++) { emit(fs_inst(BRW_OPCODE_MOV, - fs_reg(MRF, 2 + i), + fs_reg(MRF, nr++), color)); color.reg_offset++; } + if (c->key.source_depth_to_render_target) { + if (c->key.computes_depth) { + /* Hand over gl_FragDepth. */ + assert(this->frag_depth); + fs_reg depth = *(variable_storage(this->frag_depth)); + + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++), depth)); + } 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)))); + } + } + + if (c->key.dest_depth_reg) { + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++), + fs_reg(brw_vec8_grf(c->key.dest_depth_reg, 0)))); + } + emit(fs_inst(FS_OPCODE_FB_WRITE, fs_reg(0), fs_reg(0))); @@ -1440,7 +1468,6 @@ void fs_visitor::generate_fb_write(fs_inst *inst) { GLboolean eot = 1; /* FINISHME: MRT */ - /* FINISHME: AADS */ /* Header is 2 regs, g0 and g1 are the contents. g0 will be implied * move, here's g1. @@ -1453,7 +1480,15 @@ fs_visitor::generate_fb_write(fs_inst *inst) brw_vec8_grf(1, 0)); brw_pop_insn_state(p); - int nr = 2 + 4; + int nr = 0; + nr += 2; /* header */ + if (c->key.aa_dest_stencil_reg) + nr++; + nr += 4; /* color */ + if (c->key.source_depth_to_render_target) + nr++; + if (c->key.dest_depth_reg) + nr++; brw_fb_WRITE(p, 8, /* dispatch_width */ -- cgit v1.2.3 From 89f6783d1769c61b835b49a5fb4405a3249031f4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 12:34:21 -0700 Subject: i965: Add support for MRT to the new FS backend. Fixes these tests using gl_FragData or just gl_FragDepth: glsl1-Preprocessor test (extension test 1) glsl1-Preprocessor test (extension test 2) glsl-bug-22603 --- src/mesa/drivers/dri/i965/brw_fs.cpp | 75 +++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 27 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index e8aff6bab9..f351b75081 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -320,6 +320,8 @@ public: this->conditional_mod = BRW_CONDITIONAL_NONE; this->predicated = false; this->sampler = 0; + this->target = 0; + this->eot = false; this->shadow_compare = false; } @@ -368,8 +370,10 @@ public: bool predicated; int conditional_mod; /**< BRW_CONDITIONAL_* */ - int mlen; /** SEND message length */ + int mlen; /**< SEND message length */ int sampler; + int target; /**< MRT target. */ + bool eot; bool shadow_compare; /** @{ @@ -1417,7 +1421,7 @@ fs_visitor::emit_pinterp(int location) void fs_visitor::emit_fb_writes() { - this->current_annotation = "FB write"; + this->current_annotation = "FB write header"; int nr = 0; /* m0, m1 header */ @@ -1428,15 +1432,9 @@ fs_visitor::emit_fb_writes() fs_reg(brw_vec8_grf(c->key.aa_dest_stencil_reg, 0)))); } - assert(this->frag_color || !"FINISHME: MRT"); - fs_reg color = *(variable_storage(this->frag_color)); - - for (int i = 0; i < 4; i++) { - emit(fs_inst(BRW_OPCODE_MOV, - fs_reg(MRF, nr++), - color)); - color.reg_offset++; - } + /* 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) { @@ -1457,9 +1455,42 @@ fs_visitor::emit_fb_writes() fs_reg(brw_vec8_grf(c->key.dest_depth_reg, 0)))); } - emit(fs_inst(FS_OPCODE_FB_WRITE, - fs_reg(0), - fs_reg(0))); + fs_reg color = reg_undef; + if (this->frag_color) + color = *(variable_storage(this->frag_color)); + else if (this->frag_data) + color = *(variable_storage(this->frag_data)); + + for (int target = 0; target < c->key.nr_color_regions; target++) { + this->current_annotation = talloc_asprintf(this->mem_ctx, + "FB write target %d", + target); + if (this->frag_color || this->frag_data) { + for (int i = 0; i < 4; i++) { + emit(fs_inst(BRW_OPCODE_MOV, + fs_reg(MRF, color_mrf + i), + color)); + color.reg_offset++; + } + } + + if (this->frag_color) + color.reg_offset -= 4; + + fs_inst *inst = emit(fs_inst(FS_OPCODE_FB_WRITE, + reg_undef, reg_undef)); + inst->target = target; + inst->mlen = nr; + if (target == c->key.nr_color_regions - 1) + inst->eot = true; + } + + if (c->key.nr_color_regions == 0) { + fs_inst *inst = emit(fs_inst(FS_OPCODE_FB_WRITE, + reg_undef, reg_undef)); + inst->mlen = nr; + inst->eot = true; + } this->current_annotation = NULL; } @@ -1467,7 +1498,7 @@ fs_visitor::emit_fb_writes() void fs_visitor::generate_fb_write(fs_inst *inst) { - GLboolean eot = 1; /* FINISHME: MRT */ + GLboolean eot = inst->eot; /* Header is 2 regs, g0 and g1 are the contents. g0 will be implied * move, here's g1. @@ -1480,23 +1511,13 @@ fs_visitor::generate_fb_write(fs_inst *inst) brw_vec8_grf(1, 0)); brw_pop_insn_state(p); - int nr = 0; - nr += 2; /* header */ - if (c->key.aa_dest_stencil_reg) - nr++; - nr += 4; /* color */ - if (c->key.source_depth_to_render_target) - nr++; - if (c->key.dest_depth_reg) - nr++; - brw_fb_WRITE(p, 8, /* dispatch_width */ retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW), 0, /* base MRF */ retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), - 0, /* FINISHME: MRT target */ - nr, + inst->target, + inst->mlen, 0, eot); } -- cgit v1.2.3 From 701c5f11c9102047c8962f053843469ada3b3a1a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 13:00:46 -0700 Subject: i965: Add support for ir_loop counters to the new FS backend. Fixes: glsl1-discard statement in for loop glsl-fs-loop-two-counter-02 glsl-fs-loop-two-counter-04 --- src/mesa/drivers/dri/i965/brw_fs.cpp | 64 +++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index f351b75081..c1e6206231 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -612,6 +612,9 @@ fs_visitor::visit(ir_variable *ir) { fs_reg *reg = NULL; + if (variable_storage(ir)) + return; + if (strcmp(ir->name, "gl_FragColor") == 0) { this->frag_color = ir; } else if (strcmp(ir->name, "gl_FragData") == 0) { @@ -1175,12 +1178,20 @@ fs_visitor::visit(ir_if *ir) void fs_visitor::visit(ir_loop *ir) { - assert(!ir->from); - assert(!ir->to); - assert(!ir->increment); - assert(!ir->counter); + fs_reg counter = reg_undef; - emit(fs_inst(BRW_OPCODE_DO)); + if (ir->counter) { + this->base_ir = ir->counter; + ir->counter->accept(this); + counter = *(variable_storage(ir->counter)); + + if (ir->from) { + this->base_ir = ir->from; + ir->from->accept(this); + + emit(fs_inst(BRW_OPCODE_MOV, counter, this->result)); + } + } /* Start a safety counter. If the user messed up their loop * counting, we don't want to hang the GPU. @@ -1188,6 +1199,43 @@ fs_visitor::visit(ir_loop *ir) fs_reg max_iter = fs_reg(this, glsl_type::int_type); emit(fs_inst(BRW_OPCODE_MOV, max_iter, fs_reg(10000))); + emit(fs_inst(BRW_OPCODE_DO)); + + if (ir->to) { + this->base_ir = ir->to; + ir->to->accept(this); + + fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null, + 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 = emit(fs_inst(BRW_OPCODE_BREAK)); + inst->predicated = true; + } + foreach_iter(exec_list_iterator, iter, ir->body_instructions) { ir_instruction *ir = (ir_instruction *)iter.get(); fs_inst *inst; @@ -1203,6 +1251,12 @@ fs_visitor::visit(ir_loop *ir) inst->predicated = true; } + if (ir->increment) { + this->base_ir = ir->increment; + ir->increment->accept(this); + emit(fs_inst(BRW_OPCODE_ADD, counter, counter, this->result)); + } + emit(fs_inst(BRW_OPCODE_WHILE)); } -- cgit v1.2.3 From b9a59f0358f6f6afc7fafc1b417fa1b2c4cdaf37 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 13:29:45 -0700 Subject: i965: Add support for ARB_fragment_coord_conventions to the new FS backend. Fixes: glsl-arb-frag-coord-conventions glsl-fs-fragcoord --- src/mesa/drivers/dri/i965/brw_fs.cpp | 70 ++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index c1e6206231..8f547fc8ba 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -455,6 +455,7 @@ public: void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src); void emit_dummy_fs(); + void emit_fragcoord_interpolation(ir_variable *ir); void emit_interpolation(); void emit_pinterp(int location); void emit_fb_writes(); @@ -490,6 +491,7 @@ public: fs_reg pixel_x; fs_reg pixel_y; + fs_reg wpos_w; fs_reg pixel_w; fs_reg delta_x; fs_reg delta_y; @@ -607,6 +609,49 @@ fs_visitor::setup_uniform_values(int loc, const glsl_type *type) } } +void +fs_visitor::emit_fragcoord_interpolation(ir_variable *ir) +{ + fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); + fs_reg wpos = *reg; + fs_reg neg_y = this->pixel_y; + neg_y.negate = true; + + /* gl_FragCoord.x */ + if (ir->pixel_center_integer) { + emit(fs_inst(BRW_OPCODE_MOV, wpos, this->pixel_x)); + } else { + emit(fs_inst(BRW_OPCODE_ADD, wpos, this->pixel_x, fs_reg(0.5f))); + } + wpos.reg_offset++; + + /* gl_FragCoord.y */ + if (ir->origin_upper_left && ir->pixel_center_integer) { + emit(fs_inst(BRW_OPCODE_MOV, wpos, this->pixel_y)); + } else { + fs_reg pixel_y = this->pixel_y; + float offset = (ir->pixel_center_integer ? 0.0 : 0.5); + + if (!ir->origin_upper_left) { + pixel_y.negate = true; + offset += c->key.drawable_height - 1.0; + } + + emit(fs_inst(BRW_OPCODE_ADD, wpos, pixel_y, fs_reg(offset))); + } + 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))); + wpos.reg_offset++; + + /* gl_FragCoord.w: Already set up in emit_interpolation */ + emit(fs_inst(BRW_OPCODE_MOV, wpos, this->wpos_w)); + + hash_table_insert(this->variable_ht, reg, ir); +} + void fs_visitor::visit(ir_variable *ir) { @@ -624,7 +669,10 @@ fs_visitor::visit(ir_variable *ir) } if (ir->mode == ir_var_in) { - if (strcmp(ir->name, "gl_FrontFacing") == 0) { + if (!strcmp(ir->name, "gl_FragCoord")) { + emit_fragcoord_interpolation(ir); + return; + } else if (!strcmp(ir->name, "gl_FrontFacing")) { reg = new(this->mem_ctx) fs_reg(this, ir->type); struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); /* bit 31 is "primitive is back face", so checking < (1 << 31) gives @@ -1404,23 +1452,15 @@ fs_visitor::emit_interpolation() fs_reg(negate(brw_vec1_grf(1, 1))))); this->current_annotation = "compute pos.w and 1/pos.w"; - /* Compute wpos. Unlike many other varying inputs, we usually need it - * to produce 1/w, and the varying variable wouldn't show up. + /* Compute wpos.w. It's always in our setup, since it's needed to + * interpolate the other attributes. */ - fs_reg wpos = fs_reg(this, glsl_type::vec4_type); - this->interp_attrs[FRAG_ATTRIB_WPOS] = wpos; - emit(fs_inst(BRW_OPCODE_MOV, wpos, this->pixel_x)); /* FINISHME: ARB_fcc */ - wpos.reg_offset++; - emit(fs_inst(BRW_OPCODE_MOV, wpos, this->pixel_y)); /* FINISHME: ARB_fcc */ - wpos.reg_offset++; - emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y, - interp_reg(FRAG_ATTRIB_WPOS, 2))); - wpos.reg_offset++; - emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y, + this->wpos_w = fs_reg(this, glsl_type::float_type); + emit(fs_inst(FS_OPCODE_LINTERP, wpos_w, this->delta_x, this->delta_y, interp_reg(FRAG_ATTRIB_WPOS, 3))); - /* Compute the pixel W value from wpos.w. */ + /* Compute the pixel 1/W value from wpos.w. */ this->pixel_w = fs_reg(this, glsl_type::float_type); - emit(fs_inst(FS_OPCODE_RCP, this->pixel_w, wpos)); + emit(fs_inst(FS_OPCODE_RCP, this->pixel_w, wpos_w)); foreach_iter(exec_list_iterator, iter, *this->shader->ir) { ir_instruction *ir = (ir_instruction *)iter.get(); -- cgit v1.2.3 From 5272c6a7a23ba74c696608fc2cb07fbfaf9e822a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 3 Sep 2010 13:22:38 -0700 Subject: i965: Do interpolation for varying matrices and arrays in the FS backend. Fixes: glsl-array-varying-01 glsl-vs-mat-add-1 glsl-vs-mat-div-1 glsl-vs-mat-div-2 glsl-vs-mat-mul-2 glsl-vs-mat-mul-3 --- src/mesa/drivers/dri/i965/brw_fs.cpp | 116 +++++++++++++++++------------------ 1 file changed, 57 insertions(+), 59 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 8f547fc8ba..fbd2464357 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -456,8 +456,8 @@ public: void emit_dummy_fs(); void emit_fragcoord_interpolation(ir_variable *ir); - void emit_interpolation(); - void emit_pinterp(int location); + void emit_general_interpolation(ir_variable *ir); + void emit_interpolation_setup(); void emit_fb_writes(); struct brw_reg interp_reg(int location, int channel); @@ -495,7 +495,6 @@ public: fs_reg pixel_w; fs_reg delta_x; fs_reg delta_y; - fs_reg interp_attrs[64]; int grf_used; @@ -652,6 +651,57 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir) hash_table_insert(this->variable_ht, reg, ir); } + +void +fs_visitor::emit_general_interpolation(ir_variable *ir) +{ + fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); + /* Interpolation is always in floating point regs. */ + reg->type = BRW_REGISTER_TYPE_F; + fs_reg attr = *reg; + + unsigned int array_elements; + const glsl_type *type; + + if (ir->type->is_array()) { + array_elements = ir->type->length; + if (array_elements == 0) { + this->fail = true; + } + type = ir->type->fields.array; + } else { + array_elements = 1; + type = ir->type; + } + + int location = ir->location; + for (unsigned int i = 0; i < array_elements; i++) { + for (unsigned int j = 0; j < type->matrix_columns; j++) { + 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++; + } + 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++; + } + } + + hash_table_insert(this->variable_ht, reg, ir); +} + void fs_visitor::visit(ir_variable *ir) { @@ -685,7 +735,8 @@ fs_visitor::visit(ir_variable *ir) inst->conditional_mod = BRW_CONDITIONAL_L; emit(fs_inst(BRW_OPCODE_AND, *reg, *reg, fs_reg(1u))); } else { - reg = &this->interp_attrs[ir->location]; + emit_general_interpolation(ir); + return; } } @@ -1416,14 +1467,9 @@ fs_visitor::interp_reg(int location, int channel) /** Emits the interpolation for the varying inputs. */ void -fs_visitor::emit_interpolation() +fs_visitor::emit_interpolation_setup() { struct brw_reg g1_uw = retype(brw_vec1_grf(1, 0), BRW_REGISTER_TYPE_UW); - /* For now, the source regs for the setup URB data will be unset, - * since we don't know until codegen how many push constants we'll - * use, and therefore what the setup URB offset is. - */ - fs_reg src_reg = reg_undef; this->current_annotation = "compute pixel centers"; this->pixel_x = fs_reg(this, glsl_type::uint_type); @@ -1461,57 +1507,9 @@ fs_visitor::emit_interpolation() /* Compute the pixel 1/W value from wpos.w. */ this->pixel_w = fs_reg(this, glsl_type::float_type); emit(fs_inst(FS_OPCODE_RCP, this->pixel_w, wpos_w)); - - foreach_iter(exec_list_iterator, iter, *this->shader->ir) { - ir_instruction *ir = (ir_instruction *)iter.get(); - ir_variable *var = ir->as_variable(); - - if (!var) - continue; - - if (var->mode != ir_var_in) - continue; - - /* If it's already set up (WPOS), skip. */ - if (var->location == 0) - continue; - - this->current_annotation = talloc_asprintf(this->mem_ctx, - "interpolate %s " - "(FRAG_ATTRIB[%d])", - var->name, - var->location); - emit_pinterp(var->location); - } this->current_annotation = NULL; } -void -fs_visitor::emit_pinterp(int location) -{ - fs_reg interp_attr = fs_reg(this, glsl_type::vec4_type); - this->interp_attrs[location] = interp_attr; - - for (unsigned int i = 0; i < 4; i++) { - struct brw_reg interp = interp_reg(location, i); - emit(fs_inst(FS_OPCODE_LINTERP, - interp_attr, - this->delta_x, - this->delta_y, - fs_reg(interp))); - interp_attr.reg_offset++; - } - interp_attr.reg_offset -= 4; - - for (unsigned int i = 0; i < 4; i++) { - emit(fs_inst(BRW_OPCODE_MUL, - interp_attr, - interp_attr, - this->pixel_w)); - interp_attr.reg_offset++; - } -} - void fs_visitor::emit_fb_writes() { @@ -2200,7 +2198,7 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) if (0) { v.emit_dummy_fs(); } else { - v.emit_interpolation(); + v.emit_interpolation_setup(); /* Generate FS IR for main(). (the visitor only descends into * functions called "main"). -- cgit v1.2.3 From 17f3b8097d01a63917afaaefccd6eea070271652 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 14:53:36 -0700 Subject: i965: Don't try to emit interpolation for unused varying slots. Fixes: glsl-fs-varying-array glsl-texcoord-array glsl-texcoord-array-2 glsl-vs-varying-array --- src/mesa/drivers/dri/i965/brw_fs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index fbd2464357..feb0cc156c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -677,6 +677,15 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) int location = ir->location; for (unsigned int i = 0; i < array_elements; i++) { for (unsigned int j = 0; j < type->matrix_columns; j++) { + if (!(fp->Base.InputsRead & BITFIELD64_BIT(location))) { + /* If there's no incoming setup data for this slot, don't + * emit interpolation for it (since it's not used, and + * we'd fall over later trying to find the setup data. + */ + attr.reg_offset += type->vector_elements; + 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, -- cgit v1.2.3 From ff0eb45f47ebf2fcc1af06a8b6b934c79dff1d41 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 15:25:40 -0700 Subject: i965: Fix array indexing of arrays of matrices. The deleted code was meant to be handling indexing of a matrix, which would have been a noop if it had been correct. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index feb0cc156c..2ed5f26ebd 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -796,12 +796,8 @@ fs_visitor::visit(ir_dereference_array *ir) ir->array->accept(this); index = ir->array_index->as_constant(); - if (ir->type->is_matrix()) { - element_size = ir->type->vector_elements; - } else { - element_size = type_size(ir->type); - this->result.type = brw_type_for_base_type(ir->type); - } + element_size = type_size(ir->type); + this->result.type = brw_type_for_base_type(ir->type); if (index) { assert(this->result.file == UNIFORM || @@ -809,7 +805,7 @@ fs_visitor::visit(ir_dereference_array *ir) this->result.reg != 0)); this->result.reg_offset += index->value.i[0] * element_size; } else { - assert(!"FINISHME: non-constant matrix column"); + assert(!"FINISHME: non-constant array element"); } } -- cgit v1.2.3 From 9ac910cfcddf1b6e7c520261371e78fc9bcbddcf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 15:28:06 -0700 Subject: i965: Clean up obsolete FINISHME comment. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 2ed5f26ebd..4f5ca4e9fe 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -186,7 +186,6 @@ type_size(const struct glsl_type *type) case GLSL_TYPE_BOOL: return type->components(); case GLSL_TYPE_ARRAY: - /* FINISHME: uniform/varying arrays. */ return type_size(type->fields.array) * type->length; case GLSL_TYPE_STRUCT: size = 0; -- cgit v1.2.3 From daacaac3c8b91c87ab2cfc2d9f821474552b8181 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 16:06:35 -0700 Subject: mesa: Move the list of builtin uniform info from ir_to_mesa to shared code. I'm still not pleased with how builtin uniforms are handled, but as long as we're relying on the prog_statevar stuff this seems about as good as it'll get. --- src/mesa/main/uniforms.c | 231 ++++++++++++++++++++++++++++++++++++- src/mesa/main/uniforms.h | 15 +++ src/mesa/program/ir_to_mesa.cpp | 248 +--------------------------------------- 3 files changed, 251 insertions(+), 243 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index a5d7da51f0..29a9be8c99 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -3,6 +3,7 @@ * * Copyright (C) 2004-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved. + * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -44,7 +45,7 @@ #include "program/prog_parameter.h" #include "program/prog_statevars.h" #include "program/prog_uniform.h" - +#include "program/prog_instruction.h" static GLenum @@ -79,6 +80,234 @@ base_uniform_type(GLenum type) } } +static struct gl_builtin_uniform_element gl_DepthRange_elements[] = { + {"near", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_XXXX}, + {"far", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_YYYY}, + {"diff", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_ZZZZ}, +}; + +static struct gl_builtin_uniform_element gl_ClipPlane_elements[] = { + {NULL, {STATE_CLIPPLANE, 0, 0}, SWIZZLE_XYZW} +}; + +static struct gl_builtin_uniform_element gl_Point_elements[] = { + {"size", {STATE_POINT_SIZE}, SWIZZLE_XXXX}, + {"sizeMin", {STATE_POINT_SIZE}, SWIZZLE_YYYY}, + {"sizeMax", {STATE_POINT_SIZE}, SWIZZLE_ZZZZ}, + {"fadeThresholdSize", {STATE_POINT_SIZE}, SWIZZLE_WWWW}, + {"distanceConstantAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_XXXX}, + {"distanceLinearAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_YYYY}, + {"distanceQuadraticAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_ZZZZ}, +}; + +static struct gl_builtin_uniform_element gl_FrontMaterial_elements[] = { + {"emission", {STATE_MATERIAL, 0, STATE_EMISSION}, SWIZZLE_XYZW}, + {"ambient", {STATE_MATERIAL, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, + {"diffuse", {STATE_MATERIAL, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, + {"specular", {STATE_MATERIAL, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, + {"shininess", {STATE_MATERIAL, 0, STATE_SHININESS}, SWIZZLE_XXXX}, +}; + +static struct gl_builtin_uniform_element gl_BackMaterial_elements[] = { + {"emission", {STATE_MATERIAL, 1, STATE_EMISSION}, SWIZZLE_XYZW}, + {"ambient", {STATE_MATERIAL, 1, STATE_AMBIENT}, SWIZZLE_XYZW}, + {"diffuse", {STATE_MATERIAL, 1, STATE_DIFFUSE}, SWIZZLE_XYZW}, + {"specular", {STATE_MATERIAL, 1, STATE_SPECULAR}, SWIZZLE_XYZW}, + {"shininess", {STATE_MATERIAL, 1, STATE_SHININESS}, SWIZZLE_XXXX}, +}; + +static struct gl_builtin_uniform_element gl_LightSource_elements[] = { + {"ambient", {STATE_LIGHT, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, + {"diffuse", {STATE_LIGHT, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, + {"specular", {STATE_LIGHT, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, + {"position", {STATE_LIGHT, 0, STATE_POSITION}, SWIZZLE_XYZW}, + {"halfVector", {STATE_LIGHT, 0, STATE_HALF_VECTOR}, SWIZZLE_XYZW}, + {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_XYZW}, + {"spotCosCutoff", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_WWWW}, + {"spotCutoff", {STATE_LIGHT, 0, STATE_SPOT_CUTOFF}, SWIZZLE_XXXX}, + {"spotExponent", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_WWWW}, + {"constantAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_XXXX}, + {"linearAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_YYYY}, + {"quadraticAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_ZZZZ}, +}; + +static struct gl_builtin_uniform_element gl_LightModel_elements[] = { + {"ambient", {STATE_LIGHTMODEL_AMBIENT, 0}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_FrontLightModelProduct_elements[] = { + {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 0}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_BackLightModelProduct_elements[] = { + {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 1}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_FrontLightProduct_elements[] = { + {"ambient", {STATE_LIGHTPROD, 0, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, + {"diffuse", {STATE_LIGHTPROD, 0, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, + {"specular", {STATE_LIGHTPROD, 0, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_BackLightProduct_elements[] = { + {"ambient", {STATE_LIGHTPROD, 0, 1, STATE_AMBIENT}, SWIZZLE_XYZW}, + {"diffuse", {STATE_LIGHTPROD, 0, 1, STATE_DIFFUSE}, SWIZZLE_XYZW}, + {"specular", {STATE_LIGHTPROD, 0, 1, STATE_SPECULAR}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_TextureEnvColor_elements[] = { + {NULL, {STATE_TEXENV_COLOR, 0}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_EyePlaneS_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_S}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_EyePlaneT_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_T}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_EyePlaneR_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_R}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_EyePlaneQ_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_Q}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_ObjectPlaneS_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_S}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_ObjectPlaneT_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_T}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_ObjectPlaneR_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_R}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_ObjectPlaneQ_elements[] = { + {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_Q}, SWIZZLE_XYZW}, +}; + +static struct gl_builtin_uniform_element gl_Fog_elements[] = { + {"color", {STATE_FOG_COLOR}, SWIZZLE_XYZW}, + {"density", {STATE_FOG_PARAMS}, SWIZZLE_XXXX}, + {"start", {STATE_FOG_PARAMS}, SWIZZLE_YYYY}, + {"end", {STATE_FOG_PARAMS}, SWIZZLE_ZZZZ}, + {"scale", {STATE_FOG_PARAMS}, SWIZZLE_WWWW}, +}; + +static struct gl_builtin_uniform_element gl_NormalScale_elements[] = { + {NULL, {STATE_NORMAL_SCALE}, SWIZZLE_XXXX}, +}; + +#define MATRIX(name, statevar, modifier) \ + static struct gl_builtin_uniform_element name ## _elements[] = { \ + { NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW }, \ + { NULL, { statevar, 0, 1, 1, modifier}, SWIZZLE_XYZW }, \ + { NULL, { statevar, 0, 2, 2, modifier}, SWIZZLE_XYZW }, \ + { NULL, { statevar, 0, 3, 3, modifier}, SWIZZLE_XYZW }, \ + } + +MATRIX(gl_ModelViewMatrix, + STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE); +MATRIX(gl_ModelViewMatrixInverse, + STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVTRANS); +MATRIX(gl_ModelViewMatrixTranspose, + STATE_MODELVIEW_MATRIX, 0); +MATRIX(gl_ModelViewMatrixInverseTranspose, + STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVERSE); + +MATRIX(gl_ProjectionMatrix, + STATE_PROJECTION_MATRIX, STATE_MATRIX_TRANSPOSE); +MATRIX(gl_ProjectionMatrixInverse, + STATE_PROJECTION_MATRIX, STATE_MATRIX_INVTRANS); +MATRIX(gl_ProjectionMatrixTranspose, + STATE_PROJECTION_MATRIX, 0); +MATRIX(gl_ProjectionMatrixInverseTranspose, + STATE_PROJECTION_MATRIX, STATE_MATRIX_INVERSE); + +MATRIX(gl_ModelViewProjectionMatrix, + STATE_MVP_MATRIX, STATE_MATRIX_TRANSPOSE); +MATRIX(gl_ModelViewProjectionMatrixInverse, + STATE_MVP_MATRIX, STATE_MATRIX_INVTRANS); +MATRIX(gl_ModelViewProjectionMatrixTranspose, + STATE_MVP_MATRIX, 0); +MATRIX(gl_ModelViewProjectionMatrixInverseTranspose, + STATE_MVP_MATRIX, STATE_MATRIX_INVERSE); + +MATRIX(gl_TextureMatrix, + STATE_TEXTURE_MATRIX, STATE_MATRIX_TRANSPOSE); +MATRIX(gl_TextureMatrixInverse, + STATE_TEXTURE_MATRIX, STATE_MATRIX_INVTRANS); +MATRIX(gl_TextureMatrixTranspose, + STATE_TEXTURE_MATRIX, 0); +MATRIX(gl_TextureMatrixInverseTranspose, + STATE_TEXTURE_MATRIX, STATE_MATRIX_INVERSE); + +static struct gl_builtin_uniform_element gl_NormalMatrix_elements[] = { + { NULL, { STATE_MODELVIEW_MATRIX, 0, 0, 0, STATE_MATRIX_INVERSE}, + SWIZZLE_XYZW }, + { NULL, { STATE_MODELVIEW_MATRIX, 0, 1, 1, STATE_MATRIX_INVERSE}, + SWIZZLE_XYZW }, + { NULL, { STATE_MODELVIEW_MATRIX, 0, 2, 2, STATE_MATRIX_INVERSE}, + SWIZZLE_XYZW }, +}; + +#undef MATRIX + +#define STATEVAR(name) {#name, name ## _elements, Elements(name ## _elements)} + +const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = { + STATEVAR(gl_DepthRange), + STATEVAR(gl_ClipPlane), + STATEVAR(gl_Point), + STATEVAR(gl_FrontMaterial), + STATEVAR(gl_BackMaterial), + STATEVAR(gl_LightSource), + STATEVAR(gl_LightModel), + STATEVAR(gl_FrontLightModelProduct), + STATEVAR(gl_BackLightModelProduct), + STATEVAR(gl_FrontLightProduct), + STATEVAR(gl_BackLightProduct), + STATEVAR(gl_TextureEnvColor), + STATEVAR(gl_EyePlaneS), + STATEVAR(gl_EyePlaneT), + STATEVAR(gl_EyePlaneR), + STATEVAR(gl_EyePlaneQ), + STATEVAR(gl_ObjectPlaneS), + STATEVAR(gl_ObjectPlaneT), + STATEVAR(gl_ObjectPlaneR), + STATEVAR(gl_ObjectPlaneQ), + STATEVAR(gl_Fog), + + STATEVAR(gl_ModelViewMatrix), + STATEVAR(gl_ModelViewMatrixInverse), + STATEVAR(gl_ModelViewMatrixTranspose), + STATEVAR(gl_ModelViewMatrixInverseTranspose), + + STATEVAR(gl_ProjectionMatrix), + STATEVAR(gl_ProjectionMatrixInverse), + STATEVAR(gl_ProjectionMatrixTranspose), + STATEVAR(gl_ProjectionMatrixInverseTranspose), + + STATEVAR(gl_ModelViewProjectionMatrix), + STATEVAR(gl_ModelViewProjectionMatrixInverse), + STATEVAR(gl_ModelViewProjectionMatrixTranspose), + STATEVAR(gl_ModelViewProjectionMatrixInverseTranspose), + + STATEVAR(gl_TextureMatrix), + STATEVAR(gl_TextureMatrixInverse), + STATEVAR(gl_TextureMatrixTranspose), + STATEVAR(gl_TextureMatrixInverseTranspose), + + STATEVAR(gl_NormalMatrix), + STATEVAR(gl_NormalScale), + + {NULL, NULL, 0} +}; static GLboolean is_boolean_type(GLenum type) diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h index f823c61444..ac2cf30d97 100644 --- a/src/mesa/main/uniforms.h +++ b/src/mesa/main/uniforms.h @@ -26,6 +26,7 @@ #define UNIFORMS_H #include "glheader.h" +#include "program/prog_parameter.h" struct gl_program; struct _glapi_table; @@ -172,4 +173,18 @@ _mesa_update_shader_textures_used(struct gl_program *prog); extern void _mesa_init_shader_uniform_dispatch(struct _glapi_table *exec); +struct gl_builtin_uniform_element { + const char *field; + int tokens[STATE_LENGTH]; + int swizzle; +}; + +struct gl_builtin_uniform_desc { + const char *name; + struct gl_builtin_uniform_element *elements; + unsigned int num_elements; +}; + +extern const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[]; + #endif /* UNIFORMS_H */ diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index aa2add4174..5c92bc9865 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -577,243 +577,6 @@ ir_to_mesa_visitor::find_variable_storage(ir_variable *var) return NULL; } -struct statevar_element { - const char *field; - int tokens[STATE_LENGTH]; - int swizzle; -}; - -static struct statevar_element gl_DepthRange_elements[] = { - {"near", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_XXXX}, - {"far", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_YYYY}, - {"diff", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_ZZZZ}, -}; - -static struct statevar_element gl_ClipPlane_elements[] = { - {NULL, {STATE_CLIPPLANE, 0, 0}, SWIZZLE_XYZW} -}; - -static struct statevar_element gl_Point_elements[] = { - {"size", {STATE_POINT_SIZE}, SWIZZLE_XXXX}, - {"sizeMin", {STATE_POINT_SIZE}, SWIZZLE_YYYY}, - {"sizeMax", {STATE_POINT_SIZE}, SWIZZLE_ZZZZ}, - {"fadeThresholdSize", {STATE_POINT_SIZE}, SWIZZLE_WWWW}, - {"distanceConstantAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_XXXX}, - {"distanceLinearAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_YYYY}, - {"distanceQuadraticAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_ZZZZ}, -}; - -static struct statevar_element gl_FrontMaterial_elements[] = { - {"emission", {STATE_MATERIAL, 0, STATE_EMISSION}, SWIZZLE_XYZW}, - {"ambient", {STATE_MATERIAL, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, - {"diffuse", {STATE_MATERIAL, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, - {"specular", {STATE_MATERIAL, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, - {"shininess", {STATE_MATERIAL, 0, STATE_SHININESS}, SWIZZLE_XXXX}, -}; - -static struct statevar_element gl_BackMaterial_elements[] = { - {"emission", {STATE_MATERIAL, 1, STATE_EMISSION}, SWIZZLE_XYZW}, - {"ambient", {STATE_MATERIAL, 1, STATE_AMBIENT}, SWIZZLE_XYZW}, - {"diffuse", {STATE_MATERIAL, 1, STATE_DIFFUSE}, SWIZZLE_XYZW}, - {"specular", {STATE_MATERIAL, 1, STATE_SPECULAR}, SWIZZLE_XYZW}, - {"shininess", {STATE_MATERIAL, 1, STATE_SHININESS}, SWIZZLE_XXXX}, -}; - -static struct statevar_element gl_LightSource_elements[] = { - {"ambient", {STATE_LIGHT, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, - {"diffuse", {STATE_LIGHT, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, - {"specular", {STATE_LIGHT, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, - {"position", {STATE_LIGHT, 0, STATE_POSITION}, SWIZZLE_XYZW}, - {"halfVector", {STATE_LIGHT, 0, STATE_HALF_VECTOR}, SWIZZLE_XYZW}, - {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_XYZW}, - {"spotCosCutoff", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_WWWW}, - {"spotCutoff", {STATE_LIGHT, 0, STATE_SPOT_CUTOFF}, SWIZZLE_XXXX}, - {"spotExponent", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_WWWW}, - {"constantAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_XXXX}, - {"linearAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_YYYY}, - {"quadraticAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_ZZZZ}, -}; - -static struct statevar_element gl_LightModel_elements[] = { - {"ambient", {STATE_LIGHTMODEL_AMBIENT, 0}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_FrontLightModelProduct_elements[] = { - {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 0}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_BackLightModelProduct_elements[] = { - {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 1}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_FrontLightProduct_elements[] = { - {"ambient", {STATE_LIGHTPROD, 0, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, - {"diffuse", {STATE_LIGHTPROD, 0, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, - {"specular", {STATE_LIGHTPROD, 0, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_BackLightProduct_elements[] = { - {"ambient", {STATE_LIGHTPROD, 0, 1, STATE_AMBIENT}, SWIZZLE_XYZW}, - {"diffuse", {STATE_LIGHTPROD, 0, 1, STATE_DIFFUSE}, SWIZZLE_XYZW}, - {"specular", {STATE_LIGHTPROD, 0, 1, STATE_SPECULAR}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_TextureEnvColor_elements[] = { - {NULL, {STATE_TEXENV_COLOR, 0}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_EyePlaneS_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_S}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_EyePlaneT_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_T}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_EyePlaneR_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_R}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_EyePlaneQ_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_Q}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_ObjectPlaneS_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_S}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_ObjectPlaneT_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_T}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_ObjectPlaneR_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_R}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_ObjectPlaneQ_elements[] = { - {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_Q}, SWIZZLE_XYZW}, -}; - -static struct statevar_element gl_Fog_elements[] = { - {"color", {STATE_FOG_COLOR}, SWIZZLE_XYZW}, - {"density", {STATE_FOG_PARAMS}, SWIZZLE_XXXX}, - {"start", {STATE_FOG_PARAMS}, SWIZZLE_YYYY}, - {"end", {STATE_FOG_PARAMS}, SWIZZLE_ZZZZ}, - {"scale", {STATE_FOG_PARAMS}, SWIZZLE_WWWW}, -}; - -static struct statevar_element gl_NormalScale_elements[] = { - {NULL, {STATE_NORMAL_SCALE}, SWIZZLE_XXXX}, -}; - -#define MATRIX(name, statevar, modifier) \ - static struct statevar_element name ## _elements[] = { \ - { NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW }, \ - { NULL, { statevar, 0, 1, 1, modifier}, SWIZZLE_XYZW }, \ - { NULL, { statevar, 0, 2, 2, modifier}, SWIZZLE_XYZW }, \ - { NULL, { statevar, 0, 3, 3, modifier}, SWIZZLE_XYZW }, \ - } - -MATRIX(gl_ModelViewMatrix, - STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE); -MATRIX(gl_ModelViewMatrixInverse, - STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVTRANS); -MATRIX(gl_ModelViewMatrixTranspose, - STATE_MODELVIEW_MATRIX, 0); -MATRIX(gl_ModelViewMatrixInverseTranspose, - STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVERSE); - -MATRIX(gl_ProjectionMatrix, - STATE_PROJECTION_MATRIX, STATE_MATRIX_TRANSPOSE); -MATRIX(gl_ProjectionMatrixInverse, - STATE_PROJECTION_MATRIX, STATE_MATRIX_INVTRANS); -MATRIX(gl_ProjectionMatrixTranspose, - STATE_PROJECTION_MATRIX, 0); -MATRIX(gl_ProjectionMatrixInverseTranspose, - STATE_PROJECTION_MATRIX, STATE_MATRIX_INVERSE); - -MATRIX(gl_ModelViewProjectionMatrix, - STATE_MVP_MATRIX, STATE_MATRIX_TRANSPOSE); -MATRIX(gl_ModelViewProjectionMatrixInverse, - STATE_MVP_MATRIX, STATE_MATRIX_INVTRANS); -MATRIX(gl_ModelViewProjectionMatrixTranspose, - STATE_MVP_MATRIX, 0); -MATRIX(gl_ModelViewProjectionMatrixInverseTranspose, - STATE_MVP_MATRIX, STATE_MATRIX_INVERSE); - -MATRIX(gl_TextureMatrix, - STATE_TEXTURE_MATRIX, STATE_MATRIX_TRANSPOSE); -MATRIX(gl_TextureMatrixInverse, - STATE_TEXTURE_MATRIX, STATE_MATRIX_INVTRANS); -MATRIX(gl_TextureMatrixTranspose, - STATE_TEXTURE_MATRIX, 0); -MATRIX(gl_TextureMatrixInverseTranspose, - STATE_TEXTURE_MATRIX, STATE_MATRIX_INVERSE); - -static struct statevar_element gl_NormalMatrix_elements[] = { - { NULL, { STATE_MODELVIEW_MATRIX, 0, 0, 0, STATE_MATRIX_INVERSE}, - SWIZZLE_XYZW }, - { NULL, { STATE_MODELVIEW_MATRIX, 0, 1, 1, STATE_MATRIX_INVERSE}, - SWIZZLE_XYZW }, - { NULL, { STATE_MODELVIEW_MATRIX, 0, 2, 2, STATE_MATRIX_INVERSE}, - SWIZZLE_XYZW }, -}; - -#undef MATRIX - -#define STATEVAR(name) {#name, name ## _elements, Elements(name ## _elements)} - -static const struct statevar { - const char *name; - struct statevar_element *elements; - unsigned int num_elements; -} statevars[] = { - STATEVAR(gl_DepthRange), - STATEVAR(gl_ClipPlane), - STATEVAR(gl_Point), - STATEVAR(gl_FrontMaterial), - STATEVAR(gl_BackMaterial), - STATEVAR(gl_LightSource), - STATEVAR(gl_LightModel), - STATEVAR(gl_FrontLightModelProduct), - STATEVAR(gl_BackLightModelProduct), - STATEVAR(gl_FrontLightProduct), - STATEVAR(gl_BackLightProduct), - STATEVAR(gl_TextureEnvColor), - STATEVAR(gl_EyePlaneS), - STATEVAR(gl_EyePlaneT), - STATEVAR(gl_EyePlaneR), - STATEVAR(gl_EyePlaneQ), - STATEVAR(gl_ObjectPlaneS), - STATEVAR(gl_ObjectPlaneT), - STATEVAR(gl_ObjectPlaneR), - STATEVAR(gl_ObjectPlaneQ), - STATEVAR(gl_Fog), - - STATEVAR(gl_ModelViewMatrix), - STATEVAR(gl_ModelViewMatrixInverse), - STATEVAR(gl_ModelViewMatrixTranspose), - STATEVAR(gl_ModelViewMatrixInverseTranspose), - - STATEVAR(gl_ProjectionMatrix), - STATEVAR(gl_ProjectionMatrixInverse), - STATEVAR(gl_ProjectionMatrixTranspose), - STATEVAR(gl_ProjectionMatrixInverseTranspose), - - STATEVAR(gl_ModelViewProjectionMatrix), - STATEVAR(gl_ModelViewProjectionMatrixInverse), - STATEVAR(gl_ModelViewProjectionMatrixTranspose), - STATEVAR(gl_ModelViewProjectionMatrixInverseTranspose), - - STATEVAR(gl_TextureMatrix), - STATEVAR(gl_TextureMatrixInverse), - STATEVAR(gl_TextureMatrixTranspose), - STATEVAR(gl_TextureMatrixInverseTranspose), - - STATEVAR(gl_NormalMatrix), - STATEVAR(gl_NormalScale), -}; - void ir_to_mesa_visitor::visit(ir_variable *ir) { @@ -826,19 +589,20 @@ ir_to_mesa_visitor::visit(ir_variable *ir) if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) { unsigned int i; + const struct gl_builtin_uniform_desc *statevar; - for (i = 0; i < Elements(statevars); i++) { - if (strcmp(ir->name, statevars[i].name) == 0) + for (i = 0; _mesa_builtin_uniform_desc[i].name; i++) { + if (strcmp(ir->name, _mesa_builtin_uniform_desc[i].name) == 0) break; } - if (i == Elements(statevars)) { + if (!_mesa_builtin_uniform_desc[i].name) { fail_link(this->shader_program, "Failed to find builtin uniform `%s'\n", ir->name); return; } - const struct statevar *statevar = &statevars[i]; + statevar = &_mesa_builtin_uniform_desc[i]; int array_count; if (ir->type->is_array()) { @@ -881,7 +645,7 @@ ir_to_mesa_visitor::visit(ir_variable *ir) for (int a = 0; a < array_count; a++) { for (unsigned int i = 0; i < statevar->num_elements; i++) { - struct statevar_element *element = &statevar->elements[i]; + struct gl_builtin_uniform_element *element = &statevar->elements[i]; int tokens[STATE_LENGTH]; memcpy(tokens, element->tokens, sizeof(element->tokens)); -- cgit v1.2.3 From 1747aa6755088398108febb121a80d9572c1533e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Sep 2010 16:23:04 -0700 Subject: i965: Add support for builtin uniforms to the new FS backend. Fixes 8 piglit tests. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 71 +++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 4f5ca4e9fe..2ecacb5646 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -31,6 +31,7 @@ extern "C" { #include "main/macros.h" #include "main/shaderobj.h" +#include "main/uniforms.h" #include "program/prog_parameter.h" #include "program/prog_print.h" #include "program/prog_optimize.h" @@ -461,6 +462,7 @@ public: struct brw_reg interp_reg(int location, int channel); int setup_uniform_values(int loc, const glsl_type *type); + void setup_builtin_uniform_values(ir_variable *ir); struct brw_context *brw; const struct gl_fragment_program *fp; @@ -607,6 +609,69 @@ fs_visitor::setup_uniform_values(int loc, const glsl_type *type) } } + +/* Our support for builtin uniforms is even scarier than non-builtin. + * It sits on top of the PROG_STATE_VAR parameters that are + * automatically updated from GL context state. + */ +void +fs_visitor::setup_builtin_uniform_values(ir_variable *ir) +{ + const struct gl_builtin_uniform_desc *statevar = NULL; + + for (unsigned int i = 0; _mesa_builtin_uniform_desc[i].name; i++) { + statevar = &_mesa_builtin_uniform_desc[i]; + if (strcmp(ir->name, _mesa_builtin_uniform_desc[i].name) == 0) + break; + } + + if (!statevar->name) { + this->fail = true; + printf("Failed to find builtin uniform `%s'\n", ir->name); + return; + } + + int array_count; + if (ir->type->is_array()) { + array_count = ir->type->length; + } else { + array_count = 1; + } + + for (int a = 0; a < array_count; a++) { + for (unsigned int i = 0; i < statevar->num_elements; i++) { + struct gl_builtin_uniform_element *element = &statevar->elements[i]; + int tokens[STATE_LENGTH]; + + memcpy(tokens, element->tokens, sizeof(element->tokens)); + if (ir->type->is_array()) { + tokens[1] = a; + } + + /* This state reference has already been setup by ir_to_mesa, + * but we'll get the same index back here. + */ + int index = _mesa_add_state_reference(this->fp->Base.Parameters, + (gl_state_index *)tokens); + float *vec_values = this->fp->Base.Parameters->ParameterValues[index]; + + /* Add each of the unique swizzles of the element as a + * parameter. This'll end up matching the expected layout of + * the array/matrix/structure we're trying to fill in. + */ + int last_swiz = -1; + for (unsigned int i = 0; i < 4; i++) { + int this_swiz = GET_SWZ(element->swizzle, i); + if (this_swiz == last_swiz) + break; + last_swiz = this_swiz; + + c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i]; + } + } + } +} + void fs_visitor::emit_fragcoord_interpolation(ir_variable *ir) { @@ -751,7 +816,11 @@ fs_visitor::visit(ir_variable *ir) if (ir->mode == ir_var_uniform) { int param_index = c->prog_data.nr_params; - setup_uniform_values(ir->location, ir->type); + if (!strncmp(ir->name, "gl_", 3)) { + setup_builtin_uniform_values(ir); + } else { + setup_uniform_values(ir->location, ir->type); + } reg = new(this->mem_ctx) fs_reg(UNIFORM, param_index); } -- cgit v1.2.3 From 0a1910c26760762eb8d67f68dfd87494ab479e38 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Wed, 29 Sep 2010 13:59:03 +0800 Subject: i965: Always set tiling for depth buffer on sandybridge Sandybridge only support tiling depth buffer, always set tiling bit. Fix 'fbo_firecube' demo. --- src/mesa/drivers/dri/i965/brw_misc_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 6eeaba7772..7a334126f2 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -289,7 +289,7 @@ static void emit_depthbuffer(struct brw_context *brw) OUT_BATCH(((region->pitch * region->cpp) - 1) | (format << 18) | (BRW_TILEWALK_YMAJOR << 26) | - ((region->tiling != I915_TILING_NONE) << 27) | + (1 << 27) | (BRW_SURFACE_2D << 29)); OUT_RELOC(region->buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, -- cgit v1.2.3 From 73dab75b4165f7d2214a68d4ba8e3cb7aab9b4ac Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Sun, 26 Sep 2010 13:15:39 +0800 Subject: i965: fallback lineloop on sandybridge for now Until we fixed GS hang issue. --- src/mesa/drivers/dri/i965/brw_draw.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 16331cc3ac..6a4dda2a40 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -204,6 +204,13 @@ static GLboolean check_fallbacks( struct brw_context *brw, GLcontext *ctx = &brw->intel.ctx; GLuint i; + /* XXX FIXME */ + if (brw->intel.gen >= 6) { + for (i = 0; i < nr_prims; i++) + if (prim[i].mode == GL_LINE_LOOP) + return GL_TRUE; + } + /* If we don't require strict OpenGL conformance, never * use fallbacks. If we're forcing fallbacks, always * use fallfacks. -- cgit v1.2.3 From d40ff5510ce60c5bc9db238e2650fa79104d84e9 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 28 Sep 2010 09:21:05 -0700 Subject: r300/compiler: Fix segfault in error path https://bugs.freedesktop.org/show_bug.cgi?id=30415 NOTE: This is a candidate for the 7.9 branch. --- src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index bad1684696..407d92531a 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -250,7 +250,7 @@ static void emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair if (inst->RGB.OutputWriteMask || inst->Alpha.OutputWriteMask || inst->Alpha.DepthWriteMask) { code->inst[ip].inst0 = R500_INST_TYPE_OUT; if (inst->WriteALUResult) { - error("%s: cannot write output and ALU result at the same time"); + error("Cannot write output and ALU result at the same time"); return; } } else { -- cgit v1.2.3 From 1b76dde0cd90509da0acc631f6599fb6f7fe676d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 28 Sep 2010 09:57:18 -0700 Subject: r300/compiler: Don't use rc_error() unless the error is unrecoverable https://bugs.freedesktop.org/show_bug.cgi?id=30416 NOTE: This is a candidate for the 7.9 branch. --- src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c index cd4fcbabb9..02a52f92fc 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c @@ -386,8 +386,6 @@ static int build_loop_info(struct radeon_compiler * c, struct loop_info * loop, case RC_OPCODE_SNE: break; default: - rc_error(c, "%s: expected conditional", - __FUNCTION__); return 0; } loop->Cond = loop->If->Prev; @@ -431,8 +429,10 @@ static int transform_loop(struct emulate_loop_state * s, loop = &s->Loops[s->LoopCount++]; - if (!build_loop_info(s->C, loop, inst)) + if (!build_loop_info(s->C, loop, inst)) { + rc_error(s->C, "Failed to build loop info\n"); return 0; + } if(try_unroll_loop(s->C, loop)){ return 1; -- cgit v1.2.3 From b27a809266bd664cd101fcfdf20886cc2b7df787 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 28 Sep 2010 23:10:09 -0700 Subject: r300/compiler: Don't merge instructions that write output regs and ALU result https://bugs.freedesktop.org/show_bug.cgi?id=30415 NOTE: This is a candidate for the 7.9 branch. --- src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') 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 a33b2fde7b..38bae26f3c 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -475,6 +475,12 @@ static int merge_instructions(struct rc_pair_instruction * rgb, struct rc_pair_i { struct rc_pair_instruction backup; + /*Instructions can't write output registers and ALU result at the + * same time. */ + if ((rgb->WriteALUResult && alpha->Alpha.OutputWriteMask) + || (rgb->RGB.OutputWriteMask && alpha->WriteALUResult)) { + return 0; + } memcpy(&backup, rgb, sizeof(struct rc_pair_instruction)); if (destructive_merge_instructions(rgb, alpha)) -- cgit v1.2.3 From d4da253b298677c63def5f2f774608d660be31a1 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Wed, 29 Sep 2010 15:18:37 +0800 Subject: Revert "i965: Always set tiling for depth buffer on sandybridge" This reverts commit 0a1910c26760762eb8d67f68dfd87494ab479e38. oops, shouldn't apply tiling depth buffer for other chips as well. --- src/mesa/drivers/dri/i965/brw_misc_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 7a334126f2..6eeaba7772 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -289,7 +289,7 @@ static void emit_depthbuffer(struct brw_context *brw) OUT_BATCH(((region->pitch * region->cpp) - 1) | (format << 18) | (BRW_TILEWALK_YMAJOR << 26) | - (1 << 27) | + ((region->tiling != I915_TILING_NONE) << 27) | (BRW_SURFACE_2D << 29)); OUT_RELOC(region->buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, -- cgit v1.2.3 From ae0cd811892d55bee12afed88fd12bb2611517d3 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 10:30:04 -0700 Subject: mesa: Fix printf format warning. Fixes this GCC warning. math/m_debug_clip.c: In function '_math_test_all_cliptest_functions': math/m_debug_clip.c:363: warning: format not a string literal and no format arguments --- src/mesa/math/m_debug_clip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index 7ea5428aa2..e97afafac3 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -360,7 +360,7 @@ void _math_test_all_cliptest_functions( char *description ) char buf[100]; sprintf( buf, "%s[%d] failed test (%s)", cnames[np], psize, description ); - _mesa_problem( NULL, buf ); + _mesa_problem( NULL, "%s", buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) -- cgit v1.2.3 From 9c841abebc809be232032066c314d37231e595e2 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 10:44:17 -0700 Subject: mesa: Fix printf format warning. Fixes this GCC warning. math/m_debug_norm.c: In function '_math_test_all_normal_transform_functions': math/m_debug_norm.c:365: warning: format not a string literal and no format arguments --- src/mesa/math/m_debug_norm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index 710bad14dd..02eb1f989f 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -362,7 +362,7 @@ void _math_test_all_normal_transform_functions( char *description ) char buf[100]; sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)", norm_strings[mtype], description ); - _mesa_problem( NULL, buf ); + _mesa_problem( NULL, "%s", buf ); } #ifdef RUN_DEBUG_BENCHMARK -- cgit v1.2.3 From aa62416ae17b707ce059e92197f719a6896d109c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 10:46:46 -0700 Subject: mesa: Fix printf format warning. Fixes this GCC warning. math/m_debug_xform.c: In function '_math_test_all_transform_functions': math/m_debug_xform.c:320: warning: format not a string literal and no format arguments --- src/mesa/math/m_debug_xform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index 46bd454517..7d815664a1 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -317,7 +317,7 @@ void _math_test_all_transform_functions( char *description ) char buf[100]; sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)", psize, mstrings[mtype], description ); - _mesa_problem( NULL, buf ); + _mesa_problem( NULL, "%s", buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) -- cgit v1.2.3 From 760d7c5d7d8e2c77866917853cab6b3c033815f6 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 11:10:08 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings with linux-x86 build. radeon_emulate_branches.c: In function ‘handle_if’: radeon_emulate_branches.c:65: warning: ISO C90 forbids mixed declarations and code radeon_emulate_branches.c:71: warning: ISO C90 forbids mixed declarations and code radeon_emulate_branches.c: In function ‘handle_else’: radeon_emulate_branches.c:94: warning: ISO C90 forbids mixed declarations and code radeon_emulate_branches.c: In function ‘handle_endif’: radeon_emulate_branches.c:201: warning: ISO C90 forbids mixed declarations and code radeon_emulate_branches.c: In function ‘fix_output_writes’: radeon_emulate_branches.c:267: warning: ISO C90 forbids mixed declarations and code radeon_emulate_branches.c:284: warning: ISO C90 forbids mixed declarations and code radeon_emulate_branches.c: In function ‘rc_emulate_branches’: radeon_emulate_branches.c:307: warning: ISO C90 forbids mixed declarations and code --- .../dri/r300/compiler/radeon_emulate_branches.c | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_branches.c b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_branches.c index 222e5b7e02..7bede344f3 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_branches.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_branches.c @@ -57,18 +57,21 @@ struct emulate_branch_state { static void handle_if(struct emulate_branch_state * s, struct rc_instruction * inst) { + struct branch_info * branch; + struct rc_instruction * inst_mov; + memory_pool_array_reserve(&s->C->Pool, struct branch_info, s->Branches, s->BranchCount, s->BranchReserved, 1); DBG("%s\n", __FUNCTION__); - struct branch_info * branch = &s->Branches[s->BranchCount++]; + branch = &s->Branches[s->BranchCount++]; memset(branch, 0, sizeof(struct branch_info)); branch->If = inst; /* Make a safety copy of the decision register, because we will need * it at ENDIF time and it might be overwritten in both branches. */ - struct rc_instruction * inst_mov = rc_insert_new_instruction(s->C, inst->Prev); + inst_mov = rc_insert_new_instruction(s->C, inst->Prev); inst_mov->U.I.Opcode = RC_OPCODE_MOV; inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; inst_mov->U.I.DstReg.Index = rc_find_free_temporary(s->C); @@ -84,6 +87,8 @@ static void handle_if(struct emulate_branch_state * s, struct rc_instruction * i static void handle_else(struct emulate_branch_state * s, struct rc_instruction * inst) { + struct branch_info * branch; + if (!s->BranchCount) { rc_error(s->C, "Encountered ELSE outside of branches"); return; @@ -91,7 +96,7 @@ static void handle_else(struct emulate_branch_state * s, struct rc_instruction * DBG("%s\n", __FUNCTION__); - struct branch_info * branch = &s->Branches[s->BranchCount - 1]; + branch = &s->Branches[s->BranchCount - 1]; branch->Else = inst; } @@ -191,6 +196,10 @@ static void inject_cmp(struct emulate_branch_state * s, static void handle_endif(struct emulate_branch_state * s, struct rc_instruction * inst) { + struct branch_info * branch; + struct register_proxies IfProxies; + struct register_proxies ElseProxies; + if (!s->BranchCount) { rc_error(s->C, "Encountered ENDIF outside of branches"); return; @@ -198,9 +207,7 @@ static void handle_endif(struct emulate_branch_state * s, struct rc_instruction DBG("%s\n", __FUNCTION__); - struct branch_info * branch = &s->Branches[s->BranchCount - 1]; - struct register_proxies IfProxies; - struct register_proxies ElseProxies; + branch = &s->Branches[s->BranchCount - 1]; memset(&IfProxies, 0, sizeof(IfProxies)); memset(&ElseProxies, 0, sizeof(ElseProxies)); @@ -261,16 +268,19 @@ static void remap_output_function(void * userdata, struct rc_instruction * inst, */ static void fix_output_writes(struct emulate_branch_state * s, struct rc_instruction * inst) { + const struct rc_opcode_info * opcode; + if (!s->BranchCount) return; - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + opcode = rc_get_opcode_info(inst->U.I.Opcode); if (!opcode->HasDstReg) return; if (inst->U.I.DstReg.File == RC_FILE_OUTPUT) { struct remap_output_data remap; + struct rc_instruction * inst_mov; remap.Output = inst->U.I.DstReg.Index; remap.Temporary = rc_find_free_temporary(s->C); @@ -281,7 +291,7 @@ static void fix_output_writes(struct emulate_branch_state * s, struct rc_instruc rc_remap_registers(inst, &remap_output_function, &remap); } - struct rc_instruction * inst_mov = rc_insert_new_instruction(s->C, s->C->Program.Instructions.Prev); + inst_mov = rc_insert_new_instruction(s->C, s->C->Program.Instructions.Prev); inst_mov->U.I.Opcode = RC_OPCODE_MOV; inst_mov->U.I.DstReg.File = RC_FILE_OUTPUT; inst_mov->U.I.DstReg.Index = remap.Output; @@ -299,12 +309,13 @@ static void fix_output_writes(struct emulate_branch_state * s, struct rc_instruc void rc_emulate_branches(struct radeon_compiler *c, void *user) { struct emulate_branch_state s; + struct rc_instruction * ptr; memset(&s, 0, sizeof(s)); s.C = c; /* Untypical loop because we may remove the current instruction */ - struct rc_instruction * ptr = c->Program.Instructions.Next; + ptr = c->Program.Instructions.Next; while(ptr != &c->Program.Instructions) { struct rc_instruction * inst = ptr; ptr = ptr->Next; -- cgit v1.2.3 From 483971e649946bd8d3399240de5b483be9bd3402 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 11:19:55 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes this GCC warning on linux-x86 build. radeon_emulate_loops.c: In function ‘rc_emulate_loops’: radeon_emulate_loops.c:517: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c index 02a52f92fc..205eecd112 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c @@ -511,11 +511,12 @@ void rc_emulate_loops(struct radeon_compiler *c, void *user) * loops are unrolled first. */ for( i = s->LoopCount - 1; i >= 0; i-- ){ + unsigned int iterations; + if(!s->Loops[i].EndLoop){ continue; } - unsigned int iterations = loop_max_possible_iterations( - s->C, &s->Loops[i]); + iterations = loop_max_possible_iterations(s->C, &s->Loops[i]); unroll_loop(s->C, &s->Loops[i], iterations); } } -- cgit v1.2.3 From 45d22a9b20b6728adf4ed7c96cdf6ebf572f186d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 11:29:12 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. radeon_program_alu.c: In function ‘r300_transform_trig_simple’: radeon_program_alu.c:882: warning: ISO C90 forbids mixed declarations and code radeon_program_alu.c:932: warning: ISO C90 forbids mixed declarations and code radeon_program_alu.c: In function ‘radeonTransformTrigScale’: radeon_program_alu.c:996: warning: ISO C90 forbids mixed declarations and code radeon_program_alu.c: In function ‘r300_transform_trig_scale_vertex’: radeon_program_alu.c:1033: warning: ISO C90 forbids mixed declarations and code --- .../drivers/dri/r300/compiler/radeon_program_alu.c | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/mesa') 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 4d3e26f28c..39408845d5 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -874,13 +874,15 @@ int r300_transform_trig_simple(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { + unsigned int constants[2]; + unsigned int tempreg; + if (inst->U.I.Opcode != RC_OPCODE_COS && inst->U.I.Opcode != RC_OPCODE_SIN && inst->U.I.Opcode != RC_OPCODE_SCS) return 0; - unsigned int constants[2]; - unsigned int tempreg = rc_find_free_temporary(c); + tempreg = rc_find_free_temporary(c); sincos_constants(c, constants); @@ -918,6 +920,8 @@ int r300_transform_trig_simple(struct radeon_compiler* c, swizzle_wwww(srcreg(RC_FILE_TEMPORARY, tempreg)), constants); } else { + struct rc_dst_register dst; + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_XY), swizzle_xxxx(inst->U.I.SrcReg[0]), swizzle_zzzz(srcreg(RC_FILE_CONSTANT, constants[1])), @@ -929,7 +933,7 @@ int r300_transform_trig_simple(struct radeon_compiler* c, swizzle_wwww(srcreg(RC_FILE_CONSTANT, constants[1])), negate(swizzle_zzzz(srcreg(RC_FILE_CONSTANT, constants[0])))); - struct rc_dst_register dst = inst->U.I.DstReg; + dst = inst->U.I.DstReg; dst.WriteMask = inst->U.I.DstReg.WriteMask & RC_MASK_X; sin_approx(c, inst, dst, @@ -988,16 +992,16 @@ int radeonTransformTrigScale(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->U.I.Opcode != RC_OPCODE_COS && - inst->U.I.Opcode != RC_OPCODE_SIN && - inst->U.I.Opcode != RC_OPCODE_SCS) - return 0; - static const float RCP_2PI = 0.15915494309189535; unsigned int temp; unsigned int constant; unsigned int constant_swizzle; + if (inst->U.I.Opcode != RC_OPCODE_COS && + inst->U.I.Opcode != RC_OPCODE_SIN && + inst->U.I.Opcode != RC_OPCODE_SCS) + return 0; + temp = rc_find_free_temporary(c); constant = rc_constants_add_immediate_scalar(&c->Program.Constants, RCP_2PI, &constant_swizzle); @@ -1020,6 +1024,10 @@ int r300_transform_trig_scale_vertex(struct radeon_compiler *c, struct rc_instruction *inst, void *unused) { + static const float cons[4] = {0.15915494309189535, 0.5, 6.28318530717959, -3.14159265358979}; + unsigned int temp; + unsigned int constant; + if (inst->U.I.Opcode != RC_OPCODE_COS && inst->U.I.Opcode != RC_OPCODE_SIN && inst->U.I.Opcode != RC_OPCODE_SCS) @@ -1030,10 +1038,6 @@ int r300_transform_trig_scale_vertex(struct radeon_compiler *c, * repeat(x) = frac(x / 2PI + 0.5) * 2PI - PI */ - static const float cons[4] = {0.15915494309189535, 0.5, 6.28318530717959, -3.14159265358979}; - unsigned int temp; - unsigned int constant; - temp = rc_find_free_temporary(c); constant = rc_constants_add_immediate_vec4(&c->Program.Constants, cons); -- cgit v1.2.3 From 4e07aadabbf4b3ff57d79033e92dfab9fe299f45 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 11:41:14 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. radeon_pair_translate.c: In function ‘set_pair_instruction’: radeon_pair_translate.c:153: warning: ISO C90 forbids mixed declarations and code radeon_pair_translate.c:170: warning: ISO C90 forbids mixed declarations and code radeon_pair_translate.c: In function ‘rc_pair_translate’: radeon_pair_translate.c:336: warning: ISO C90 forbids mixed declarations and code radeon_pair_translate.c:341: warning: ISO C90 forbids mixed declarations and code --- .../drivers/dri/r300/compiler/radeon_pair_translate.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c index ff82584466..c549be5218 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c @@ -148,9 +148,12 @@ static void set_pair_instruction(struct r300_fragment_program_compiler *c, struct rc_pair_instruction * pair, struct rc_sub_instruction * inst) { + int needrgb, needalpha, istranscendent; + const struct rc_opcode_info * opcode; + int i; + memset(pair, 0, sizeof(struct rc_pair_instruction)); - int needrgb, needalpha, istranscendent; classify_instruction(inst, &needrgb, &needalpha, &istranscendent); if (needrgb) { @@ -167,8 +170,7 @@ static void set_pair_instruction(struct r300_fragment_program_compiler *c, pair->Alpha.Saturate = 1; } - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); - int i; + opcode = rc_get_opcode_info(inst->Opcode); /* Presubtract handling: * We need to make sure that the values used by the presubtract @@ -330,15 +332,18 @@ void rc_pair_translate(struct radeon_compiler *cc, void *user) for(struct rc_instruction * inst = c->Base.Program.Instructions.Next; inst != &c->Base.Program.Instructions; inst = inst->Next) { + const struct rc_opcode_info * opcode; + struct rc_sub_instruction copy; + if (inst->Type != RC_INSTRUCTION_NORMAL) continue; - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + opcode = rc_get_opcode_info(inst->U.I.Opcode); if (opcode->HasTexture || opcode->IsFlowControl || opcode->Opcode == RC_OPCODE_KIL) continue; - struct rc_sub_instruction copy = inst->U.I; + copy = inst->U.I; check_opcode_support(c, ©); -- cgit v1.2.3 From 4f80a2d1700a1916e0ac6f24f60b117f9c4dfef1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 12:00:19 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. radeon_pair_schedule.c: In function ‘emit_all_tex’: radeon_pair_schedule.c:244: warning: ISO C90 forbids mixed declarations and code radeon_pair_schedule.c: In function ‘destructive_merge_instructions’: radeon_pair_schedule.c:291: warning: ISO C90 forbids mixed declarations and code radeon_pair_schedule.c:438: warning: ISO C90 forbids mixed declarations and code radeon_pair_schedule.c: In function ‘scan_read’: radeon_pair_schedule.c:619: warning: ISO C90 forbids mixed declarations and code radeon_pair_schedule.c: In function ‘scan_write’: radeon_pair_schedule.c:645: warning: ISO C90 forbids mixed declarations and code radeon_pair_schedule.c: In function ‘schedule_block’: radeon_pair_schedule.c:673: warning: ISO C90 forbids mixed declarations and code radeon_pair_schedule.c: In function ‘rc_pair_schedule’: radeon_pair_schedule.c:730: warning: ISO C90 forbids mixed declarations and code --- .../dri/r300/compiler/radeon_pair_schedule.c | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/mesa') 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 38bae26f3c..bfe3553460 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -237,11 +237,12 @@ static void commit_alu_instruction(struct schedule_state * s, struct schedule_in static void emit_all_tex(struct schedule_state * s, struct rc_instruction * before) { struct schedule_instruction *readytex; + struct rc_instruction * inst_begin; assert(s->ReadyTEX); /* Node marker for R300 */ - struct rc_instruction * inst_begin = rc_insert_new_instruction(s->C, before->Prev); + inst_begin = rc_insert_new_instruction(s->C, before->Prev); inst_begin->U.I.Opcode = RC_OPCODE_BEGIN_TEX; /* Link texture instructions back in */ @@ -280,6 +281,8 @@ static int destructive_merge_instructions( struct rc_pair_instruction * alpha) { const struct rc_opcode_info * opcode; + const struct rc_opcode_info * rgb_info; + assert(rgb->Alpha.Opcode == RC_OPCODE_NOP); assert(alpha->RGB.Opcode == RC_OPCODE_NOP); @@ -288,8 +291,7 @@ static int destructive_merge_instructions( * src1. */ /* Merge the rgb presubtract registers. */ - const struct rc_opcode_info * rgb_info = - rc_get_opcode_info(rgb->RGB.Opcode); + rgb_info = rc_get_opcode_info(rgb->RGB.Opcode); if (alpha->RGB.Src[RC_PAIR_PRESUB_SRC].Used) { unsigned int srcp_src; unsigned int srcp_regs; @@ -424,6 +426,7 @@ static int destructive_merge_instructions( unsigned int oldsrc = alpha->Alpha.Arg[arg].Source; rc_register_file file = 0; unsigned int index = 0; + int source; if (alpha->Alpha.Arg[arg].Swizzle < 3) { srcrgb = 1; @@ -435,7 +438,7 @@ static int destructive_merge_instructions( index = alpha->Alpha.Src[oldsrc].Index; } - int source = rc_pair_alloc_source(rgb, srcrgb, srcalpha, file, index); + source = rc_pair_alloc_source(rgb, srcrgb, srcalpha, file, index); if (source < 0) return 0; @@ -603,6 +606,7 @@ static void scan_read(void * data, struct rc_instruction * inst, { struct schedule_state * s = data; struct reg_value * v = get_reg_value(s, file, index, chan); + struct reg_value_reader * reader; if (!v) return; @@ -616,7 +620,7 @@ static void scan_read(void * data, struct rc_instruction * inst, DBG("%i: read %i[%i] chan %i\n", s->Current->Instruction->IP, file, index, chan); - struct reg_value_reader * reader = memory_pool_malloc(&s->C->Pool, sizeof(*reader)); + reader = memory_pool_malloc(&s->C->Pool, sizeof(*reader)); reader->Reader = s->Current; reader->Next = v->Readers; v->Readers = reader; @@ -636,13 +640,14 @@ static void scan_write(void * data, struct rc_instruction * inst, { struct schedule_state * s = data; struct reg_value ** pv = get_reg_valuep(s, file, index, chan); + struct reg_value * newv; if (!pv) return; DBG("%i: write %i[%i] chan %i\n", s->Current->Instruction->IP, file, index, chan); - struct reg_value * newv = memory_pool_malloc(&s->C->Pool, sizeof(*newv)); + newv = memory_pool_malloc(&s->C->Pool, sizeof(*newv)); memset(newv, 0, sizeof(*newv)); newv->Writer = s->Current; @@ -665,12 +670,13 @@ static void schedule_block(struct r300_fragment_program_compiler * c, struct rc_instruction * begin, struct rc_instruction * end) { struct schedule_state s; + unsigned int ip; memset(&s, 0, sizeof(s)); s.C = &c->Base; /* Scan instructions for data dependencies */ - unsigned int ip = 0; + ip = 0; for(struct rc_instruction * inst = begin; inst != end; inst = inst->Next) { s.Current = memory_pool_malloc(&c->Base.Pool, sizeof(*s.Current)); memset(s.Current, 0, sizeof(struct schedule_instruction)); @@ -722,12 +728,14 @@ void rc_pair_schedule(struct radeon_compiler *cc, void *user) struct r300_fragment_program_compiler *c = (struct r300_fragment_program_compiler*)cc; struct rc_instruction * inst = c->Base.Program.Instructions.Next; while(inst != &c->Base.Program.Instructions) { + struct rc_instruction * first; + if (is_controlflow(inst)) { inst = inst->Next; continue; } - struct rc_instruction * first = inst; + first = inst; while(inst != &c->Base.Program.Instructions && !is_controlflow(inst)) inst = inst->Next; -- cgit v1.2.3 From a9d5808232087ace460fe0d30dc9b8a49c30fd5c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 12:15:14 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes this GCC warning on linux-x86 build. radeon_pair_regalloc.c: In function ‘rc_pair_regalloc_inputs_only’: radeon_pair_regalloc.c:330: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') 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 c73845512f..91524f5ec6 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c @@ -322,12 +322,13 @@ void rc_pair_regalloc_inputs_only(struct radeon_compiler *cc, void *user) { struct r300_fragment_program_compiler *c = (struct r300_fragment_program_compiler*)cc; struct regalloc_state s; + int temp_reg_offset; compute_live_intervals(cc, &s); c->AllocateHwInputs(c, &alloc_input, &s); - int temp_reg_offset = 0; + temp_reg_offset = 0; for (unsigned i = 0; i < RC_REGISTER_MAX_INDEX; i++) { if (s.Input[i].Allocated && temp_reg_offset <= s.Input[i].Index) temp_reg_offset = s.Input[i].Index + 1; -- cgit v1.2.3 From 07a38505c6ee96b6ab1836fa5c0642a2ed86a2b4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 13:13:09 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. radeon_dataflow_deadcode.c: In function ‘push_branch’: radeon_dataflow_deadcode.c:112: warning: ISO C90 forbids mixed declarations and code radeon_dataflow_deadcode.c: In function ‘update_instruction’: radeon_dataflow_deadcode.c:183: warning: ISO C90 forbids mixed declarations and code radeon_dataflow_deadcode.c: In function ‘rc_dataflow_deadcode’: radeon_dataflow_deadcode.c:352: warning: ISO C90 forbids mixed declarations and code radeon_dataflow_deadcode.c:379: warning: ISO C90 forbids mixed declarations and code --- .../drivers/dri/r300/compiler/radeon_dataflow_deadcode.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c index 9d17b4772a..87906f37b1 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c @@ -106,10 +106,12 @@ static void push_loop(struct deadcode_state * s) static void push_branch(struct deadcode_state * s) { + struct branchinfo * branch; + memory_pool_array_reserve(&s->C->Pool, struct branchinfo, s->BranchStack, s->BranchStackSize, s->BranchStackReserved, 1); - struct branchinfo * branch = &s->BranchStack[s->BranchStackSize++]; + branch = &s->BranchStack[s->BranchStackSize++]; branch->HaveElse = 0; memcpy(&branch->StoreEndif, &s->R, sizeof(s->R)); } @@ -152,6 +154,7 @@ static void update_instruction(struct deadcode_state * s, struct rc_instruction const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); struct instruction_state * insts = &s->Instructions[inst->IP]; unsigned int usedmask = 0; + unsigned int srcmasks[3]; if (opcode->HasDstReg) { unsigned char * pused = get_used_ptr(s, inst->U.I.DstReg.File, inst->U.I.DstReg.Index); @@ -180,7 +183,6 @@ static void update_instruction(struct deadcode_state * s, struct rc_instruction } } - unsigned int srcmasks[3]; rc_compute_sources_for_writemask(inst, usedmask, srcmasks); for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { @@ -219,6 +221,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, void *user) unsigned int nr_instructions; unsigned has_temp_reladdr_src = 0; rc_dataflow_mark_outputs_fn dce = (rc_dataflow_mark_outputs_fn)user; + unsigned int ip; /* Give up if there is relative addressing of destination operands. */ for(struct rc_instruction * inst = c->Program.Instructions.Next; @@ -349,12 +352,14 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, void *user) update_instruction(&s, inst); } - unsigned int ip = 0; + ip = 0; for(struct rc_instruction * inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next, ++ip) { const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); int dead = 1; + unsigned int srcmasks[3]; + unsigned int usemask; if (!opcode->HasDstReg) { dead = 0; @@ -376,8 +381,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, void *user) continue; } - unsigned int srcmasks[3]; - unsigned int usemask = s.Instructions[ip].WriteMask; + usemask = s.Instructions[ip].WriteMask; if (inst->U.I.WriteALUResult == RC_ALURESULT_X) usemask |= RC_MASK_X; -- cgit v1.2.3 From 4cd4fd37aa1a68104c80526923f49cd0998779d9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 13:30:34 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warning on linux-x86 build. radeon_optimize.c: In function ‘constant_folding’: radeon_optimize.c:419: warning: ISO C90 forbids mixed declarations and code radeon_optimize.c:425: warning: ISO C90 forbids mixed declarations and code radeon_optimize.c:432: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/radeon_optimize.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c index 3be50b93e4..41769e347e 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c @@ -411,27 +411,34 @@ static void constant_folding(struct radeon_compiler * c, struct rc_instruction * /* Replace 0.0, 1.0 and 0.5 immediates by their explicit swizzles */ for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + struct rc_constant * constant; + struct rc_src_register newsrc; + int have_real_reference; + if (inst->U.I.SrcReg[src].File != RC_FILE_CONSTANT || inst->U.I.SrcReg[src].RelAddr || inst->U.I.SrcReg[src].Index >= c->Program.Constants.Count) continue; - struct rc_constant * constant = + constant = &c->Program.Constants.Constants[inst->U.I.SrcReg[src].Index]; if (constant->Type != RC_CONSTANT_IMMEDIATE) continue; - struct rc_src_register newsrc = inst->U.I.SrcReg[src]; - int have_real_reference = 0; + newsrc = inst->U.I.SrcReg[src]; + have_real_reference = 0; for(unsigned int chan = 0; chan < 4; ++chan) { unsigned int swz = GET_SWZ(newsrc.Swizzle, chan); + unsigned int newswz; + float imm; + float baseimm; + if (swz >= 4) continue; - unsigned int newswz; - float imm = constant->u.Immediate[swz]; - float baseimm = imm; + imm = constant->u.Immediate[swz]; + baseimm = imm; if (imm < 0.0) baseimm = -baseimm; -- cgit v1.2.3 From 0d0273142a4a9a8c895eb6eb90c45772061ae234 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 13:34:56 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes this GCC warning on linux-x86 build. radeon_remove_constants.c: In function ‘rc_remove_unused_constants’: radeon_remove_constants.c:100: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') 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 c59161640c..d6c808ad81 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c @@ -68,6 +68,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) unsigned are_externals_remapped = 0; struct rc_constant *constants = c->Program.Constants.Constants; struct mark_used_data d; + unsigned new_count; if (!c->Program.Constants.Count) { *out_remap_table = NULL; @@ -97,7 +98,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) * This pass removes unused constants simply by overwriting them by other constants. */ remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned)); inv_remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned)); - unsigned new_count = 0; + new_count = 0; for (unsigned i = 0; i < c->Program.Constants.Count; i++) { if (const_used[i]) { -- cgit v1.2.3 From dafbf480dbf30e191594cb505bca6007024262e8 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 13:40:45 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes this GCC warning on linux-x86 build. radeon_rename_regs.c: In function ‘rc_rename_regs’: radeon_rename_regs.c:112: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') 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 31d25f9ab8..60e228be5b 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c @@ -104,13 +104,14 @@ void rc_rename_regs(struct radeon_compiler *c, void *user) inst != &c->Program.Instructions; inst = inst->Next) { const struct rc_opcode_info * info; + unsigned int old_index, temp_index; + struct rc_dst_register * dst; if(inst->Type != RC_INSTRUCTION_NORMAL) { rc_error(c, "%s only works with normal instructions.", __FUNCTION__); return; } - unsigned int old_index, temp_index; - struct rc_dst_register * dst = &inst->U.I.DstReg; + dst = &inst->U.I.DstReg; info = rc_get_opcode_info(inst->U.I.Opcode); if(!info->HasDstReg || dst->File != RC_FILE_TEMPORARY) { continue; -- cgit v1.2.3 From b96a391d14bdfcb4a7183a0767a9b45440330034 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 13:44:10 -0700 Subject: r300/compiler: Remove declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. r300_fragprog_swizzle.c: In function ‘r300_swizzle_is_native’: r300_fragprog_swizzle.c:120: warning: ISO C90 forbids mixed declarations and code r300_fragprog_swizzle.c: In function ‘r300_swizzle_split’: r300_fragprog_swizzle.c:159: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c index caa48fe478..2d28b06539 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c @@ -94,6 +94,9 @@ static const struct swizzle_data* lookup_native_swizzle(unsigned int swizzle) */ static int r300_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { + unsigned int relevant; + int j; + if (reg.Abs) reg.Negate = RC_MASK_NONE; @@ -101,8 +104,6 @@ static int r300_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) opcode == RC_OPCODE_TEX || opcode == RC_OPCODE_TXB || opcode == RC_OPCODE_TXP) { - int j; - if (reg.Abs || reg.Negate) return 0; @@ -117,8 +118,7 @@ static int r300_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) return 1; } - unsigned int relevant = 0; - int j; + relevant = 0; for(j = 0; j < 3; ++j) if (GET_SWZ(reg.Swizzle, j) != RC_SWIZZLE_UNUSED) @@ -154,9 +154,10 @@ static void r300_swizzle_split( unsigned int matchcount = 0; unsigned int matchmask = 0; for(comp = 0; comp < 3; ++comp) { + unsigned int swz; if (!GET_BIT(mask, comp)) continue; - unsigned int swz = GET_SWZ(src.Swizzle, comp); + swz = GET_SWZ(src.Swizzle, comp); if (swz == RC_SWIZZLE_UNUSED) continue; if (swz == GET_SWZ(sd->hash, comp)) { -- cgit v1.2.3 From a4f296d6180d1990916c8e874adb587f6d8cdb7d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 13:56:27 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. r300_fragprog_emit.c: In function ‘emit_alu’: r300_fragprog_emit.c:143: warning: ISO C90 forbids mixed declarations and code r300_fragprog_emit.c:156: warning: ISO C90 forbids mixed declarations and code r300_fragprog_emit.c: In function ‘finish_node’: r300_fragprog_emit.c:271: warning: ISO C90 forbids mixed declarations and code r300_fragprog_emit.c: In function ‘emit_tex’: r300_fragprog_emit.c:344: warning: ISO C90 forbids mixed declarations and code --- .../drivers/dri/r300/compiler/r300_fragprog_emit.c | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c index 4f13e51bcc..8be32ea91f 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c @@ -133,6 +133,8 @@ static unsigned int translate_alpha_opcode(struct r300_fragment_program_compiler */ static int emit_alu(struct r300_emit_state * emit, struct rc_pair_instruction* inst) { + int ip; + int j; PROG_CODE; if (code->alu.length >= c->Base.max_alu_insts) { @@ -140,20 +142,20 @@ static int emit_alu(struct r300_emit_state * emit, struct rc_pair_instruction* i return 0; } - int ip = code->alu.length++; - int j; + ip = code->alu.length++; code->alu.inst[ip].rgb_inst = translate_rgb_opcode(c, inst->RGB.Opcode); code->alu.inst[ip].alpha_inst = translate_alpha_opcode(c, inst->Alpha.Opcode); for(j = 0; j < 3; ++j) { unsigned int src = use_source(code, inst->RGB.Src[j]); + unsigned int arg; code->alu.inst[ip].rgb_addr |= src << (6*j); src = use_source(code, inst->Alpha.Src[j]); code->alu.inst[ip].alpha_addr |= src << (6*j); - unsigned int arg = r300FPTranslateRGBSwizzle(inst->RGB.Arg[j].Source, inst->RGB.Arg[j].Swizzle); + arg = r300FPTranslateRGBSwizzle(inst->RGB.Arg[j].Source, inst->RGB.Arg[j].Swizzle); arg |= inst->RGB.Arg[j].Abs << 6; arg |= inst->RGB.Arg[j].Negate << 5; code->alu.inst[ip].rgb_inst |= arg << (7*j); @@ -259,6 +261,10 @@ static int finish_node(struct r300_emit_state * emit) { struct r300_fragment_program_compiler * c = emit->compiler; struct r300_fragment_program_code *code = &emit->compiler->code->code.r300; + unsigned alu_offset; + unsigned alu_end; + unsigned tex_offset; + unsigned tex_end; if (code->alu.length == emit->node_first_alu) { /* Generate a single NOP for this node */ @@ -268,10 +274,10 @@ static int finish_node(struct r300_emit_state * emit) return 0; } - unsigned alu_offset = emit->node_first_alu; - unsigned alu_end = code->alu.length - alu_offset - 1; - unsigned tex_offset = emit->node_first_tex; - unsigned tex_end = code->tex.length - tex_offset - 1; + alu_offset = emit->node_first_alu; + alu_end = code->alu.length - alu_offset - 1; + tex_offset = emit->node_first_tex; + tex_end = code->tex.length - tex_offset - 1; if (code->tex.length == emit->node_first_tex) { if (emit->current_node > 0) { @@ -334,6 +340,9 @@ static int begin_tex(struct r300_emit_state * emit) static int emit_tex(struct r300_emit_state * emit, struct rc_instruction * inst) { + unsigned int unit; + unsigned int dest; + unsigned int opcode; PROG_CODE; if (code->tex.length >= R300_PFS_MAX_TEX_INST) { @@ -341,9 +350,8 @@ static int emit_tex(struct r300_emit_state * emit, struct rc_instruction * inst) return 0; } - unsigned int unit = inst->U.I.TexSrcUnit; - unsigned int dest = inst->U.I.DstReg.Index; - unsigned int opcode; + unit = inst->U.I.TexSrcUnit; + dest = inst->U.I.DstReg.Index; switch(inst->U.I.Opcode) { case RC_OPCODE_KIL: opcode = R300_TEX_OP_KIL; break; -- cgit v1.2.3 From ae664daa25ac230e3a97cae0b82b7cd3c392c4bb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 14:04:06 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. r500_fragprog.c: In function ‘r500_transform_IF’: r500_fragprog.c:45: warning: ISO C90 forbids mixed declarations and code r500_fragprog.c: In function ‘r500FragmentProgramDump’: r500_fragprog.c:256: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 627ce374ef..289bb87ae5 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -39,10 +39,12 @@ int r500_transform_IF( struct rc_instruction * inst, void* data) { + struct rc_instruction * inst_mov; + if (inst->U.I.Opcode != RC_OPCODE_IF) return 0; - struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); + inst_mov = rc_insert_new_instruction(c, inst->Prev); inst_mov->U.I.Opcode = RC_OPCODE_MOV; inst_mov->U.I.DstReg.WriteMask = 0; inst_mov->U.I.WriteALUResult = RC_ALURESULT_W; @@ -251,12 +253,11 @@ void r500FragmentProgramDump(struct radeon_compiler *c, void *user) { struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)c; struct r500_fragment_program_code *code = &compiler->code->code.r500; - fprintf(stderr, "R500 Fragment Program:\n--------\n"); - int n, i; uint32_t inst; uint32_t inst0; char *str = NULL; + fprintf(stderr, "R500 Fragment Program:\n--------\n"); for (n = 0; n < code->inst_end+1; n++) { inst0 = inst = code->inst[n].inst0; -- cgit v1.2.3 From 7c7fdef3b1cfa0db7ec3eb45e39d72ca60753f30 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 14:13:49 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these GCC warnings on linux-x86 build. r500_fragprog_emit.c: In function ‘emit_paired’: r500_fragprog_emit.c:237: warning: ISO C90 forbids mixed declarations and code r500_fragprog_emit.c: In function ‘emit_tex’: r500_fragprog_emit.c:367: warning: ISO C90 forbids mixed declarations and code r500_fragprog_emit.c: In function ‘emit_flowcontrol’: r500_fragprog_emit.c:415: warning: ISO C90 forbids mixed declarations and code r500_fragprog_emit.c: In function ‘r500BuildFragmentProgramHwCode’: r500_fragprog_emit.c:633: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index 407d92531a..6f101c68eb 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -227,6 +227,7 @@ static void alu_nop(struct r300_fragment_program_compiler *c, int ip) */ static void emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair_instruction *inst) { + int ip; PROG_CODE; if (code->inst_end >= c->Base.max_alu_insts-1) { @@ -234,7 +235,7 @@ static void emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair return; } - int ip = ++code->inst_end; + ip = ++code->inst_end; /* Quirk: MDH/MDV (DDX/DDY) need a NOP on previous non-TEX instructions. */ if (inst->RGB.Opcode == RC_OPCODE_DDX || inst->Alpha.Opcode == RC_OPCODE_DDX || @@ -357,6 +358,7 @@ static unsigned int translate_strq_swizzle(unsigned int swizzle) */ static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_instruction *inst) { + int ip; PROG_CODE; if (code->inst_end >= c->Base.max_alu_insts-1) { @@ -364,7 +366,7 @@ static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_inst return 0; } - int ip = ++code->inst_end; + ip = ++code->inst_end; code->inst[ip].inst0 = R500_INST_TYPE_TEX | (inst->DstReg.WriteMask << 11) @@ -407,12 +409,14 @@ static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_inst static void emit_flowcontrol(struct emit_state * s, struct rc_instruction * inst) { + unsigned int newip; + if (s->Code->inst_end >= s->C->max_alu_insts-1) { rc_error(s->C, "emit_tex: Too many instructions"); return; } - unsigned int newip = ++s->Code->inst_end; + newip = ++s->Code->inst_end; /* Currently all loops use the same integer constant to intialize * the loop variables. */ @@ -623,6 +627,8 @@ void r500BuildFragmentProgramHwCode(struct radeon_compiler *c, void *user) if (code->inst_end == -1 || (code->inst[code->inst_end].inst0 & R500_INST_TYPE_MASK) != R500_INST_TYPE_OUT) { + int ip; + /* This may happen when dead-code elimination is disabled or * when most of the fragment program logic is leading to a KIL */ if (code->inst_end >= compiler->Base.max_alu_insts-1) { @@ -630,7 +636,7 @@ void r500BuildFragmentProgramHwCode(struct radeon_compiler *c, void *user) return; } - int ip = ++code->inst_end; + ip = ++code->inst_end; code->inst[ip].inst0 = R500_INST_TYPE_OUT | R500_INST_TEX_SEM_WAIT; } -- cgit v1.2.3 From 02b8fb3ed5ac9f3be34b9822c78fa971dfee274d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 29 Sep 2010 14:22:20 -0700 Subject: r300/compiler: Move declaration before code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes this GCC warning on linux-x86 build. r3xx_vertprog.c: In function ‘ei_if’: r3xx_vertprog.c:396: warning: ISO C90 forbids mixed declarations and code --- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index 08785716db..d7d49e514b 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -392,9 +392,9 @@ static void ei_if(struct r300_vertex_program_compiler * compiler, * don't already have one. */ if (!compiler->PredicateMask) { unsigned int writemasks[RC_REGISTER_MAX_INDEX]; - memset(writemasks, 0, sizeof(writemasks)); struct rc_instruction * inst; unsigned int i; + memset(writemasks, 0, sizeof(writemasks)); for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { -- cgit v1.2.3 From 3da98c1ca530cba9907735e6bf397017ffc8bd77 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Sep 2010 15:19:52 -0700 Subject: i965: Fix use of undefined mem_ctx in vector splitting. --- src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp index 552254df87..38195f6910 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -212,7 +212,6 @@ public: struct variable_entry *get_splitting_entry(ir_variable *var); exec_list *variable_list; - void *mem_ctx; }; struct variable_entry * @@ -300,6 +299,7 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) } ir->remove(); } else if (lhs) { + void *mem_ctx = lhs->mem_ctx; int elem = -1; switch (ir->write_mask) { -- cgit v1.2.3 From 0efea25c4b9c6b5505fdbba25b525efb27468de4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Sep 2010 15:48:21 -0700 Subject: i956: Make new FS discard do its work in a temp, not the null reg! Fixes: glsl-fs-discard-02 (GPU hang) glsl1-discard statement (2) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 2ecacb5646..7dde020e36 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -450,7 +450,7 @@ public: struct brw_reg *src); void generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src); void generate_math(fs_inst *inst, struct brw_reg dst, struct brw_reg *src); - void generate_discard(fs_inst *inst); + void generate_discard(fs_inst *inst, struct brw_reg temp); void generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src); void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src); @@ -1276,9 +1276,11 @@ fs_visitor::visit(ir_swizzle *ir) void fs_visitor::visit(ir_discard *ir) { + fs_reg temp = fs_reg(this, glsl_type::uint_type); + assert(ir->condition == NULL); /* FINISHME */ - emit(fs_inst(FS_OPCODE_DISCARD)); + emit(fs_inst(FS_OPCODE_DISCARD, temp, temp)); } void @@ -1884,13 +1886,15 @@ fs_visitor::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src) } void -fs_visitor::generate_discard(fs_inst *inst) +fs_visitor::generate_discard(fs_inst *inst, struct brw_reg temp) { struct brw_reg g0 = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW); + temp = brw_uw1_reg(temp.file, temp.nr, 0); + 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, g0, c->emit_mask_reg, g0); + brw_NOT(p, temp, brw_mask_reg(1)); /* IMASK */ + brw_AND(p, g0, temp, g0); brw_pop_insn_state(p); } @@ -2182,7 +2186,7 @@ fs_visitor::generate_code() generate_tex(inst, dst, src[0]); break; case FS_OPCODE_DISCARD: - generate_discard(inst); + generate_discard(inst, dst /* src0 == dst */); break; case FS_OPCODE_DDX: generate_ddx(inst, dst, src[0]); -- cgit v1.2.3 From 21148e1c0a3cf9cf25ded006a3d5ce2b12803ea9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Sep 2010 10:43:46 -0700 Subject: i965: Clean up the virtual GRF handling. Now, virtual GRFs are consecutive integers, rather than offsetting the next one by the size. We need the size information to still be around for real register allocation, anyway. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 76 +++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 7dde020e36..e91351cb6c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -276,9 +276,9 @@ public: /** Register file: ARF, GRF, MRF, IMM. */ enum register_file file; - /** Abstract register number. 0 = fixed hw reg */ + /** virtual register number. 0 = fixed hw reg */ int reg; - /** Offset within the abstract register. */ + /** Offset within the virtual register. */ int reg_offset; /** HW register number. Generally unset until register allocation. */ int hw_reg; @@ -399,7 +399,6 @@ public: this->mem_ctx = talloc_new(NULL); this->shader = shader; this->fail = false; - this->next_abstract_grf = 1; this->variable_ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); @@ -413,6 +412,10 @@ public: this->annotation_string = NULL; this->annotation_ir = NULL; this->base_ir = NULL; + + this->virtual_grf_sizes = NULL; + this->virtual_grf_next = 1; + this->virtual_grf_array_size = 0; } ~fs_visitor() { @@ -421,6 +424,7 @@ public: } fs_reg *variable_storage(ir_variable *var); + int virtual_grf_alloc(int size); void visit(ir_variable *ir); void visit(ir_assignment *ir); @@ -473,7 +477,11 @@ public: struct brw_shader *shader; void *mem_ctx; exec_list instructions; - int next_abstract_grf; + + int *virtual_grf_sizes; + int virtual_grf_next; + int virtual_grf_array_size; + struct hash_table *variable_ht; ir_variable *frag_color, *frag_data, *frag_depth; int first_non_payload_grf; @@ -501,6 +509,24 @@ public: }; +int +fs_visitor::virtual_grf_alloc(int size) +{ + if (virtual_grf_array_size <= virtual_grf_next) { + if (virtual_grf_array_size == 0) + virtual_grf_array_size = 16; + else + virtual_grf_array_size *= 2; + virtual_grf_sizes = talloc_realloc(mem_ctx, virtual_grf_sizes, + int, virtual_grf_array_size); + + /* This slot is always unused. */ + virtual_grf_sizes[0] = 0; + } + virtual_grf_sizes[virtual_grf_next] = size; + return virtual_grf_next++; +} + /** Fixed HW reg constructor. */ fs_reg::fs_reg(enum register_file file, int hw_reg) { @@ -540,9 +566,8 @@ fs_reg::fs_reg(class fs_visitor *v, const struct glsl_type *type) init(); this->file = GRF; - this->reg = v->next_abstract_grf; + this->reg = v->virtual_grf_alloc(type_size(type)); this->reg_offset = 0; - v->next_abstract_grf += type_size(type); this->type = brw_type_for_base_type(type); } @@ -1898,15 +1923,6 @@ fs_visitor::generate_discard(fs_inst *inst, struct brw_reg temp) brw_pop_insn_state(p); } -static void -trivial_assign_reg(int header_size, fs_reg *reg) -{ - if (reg->file == GRF && reg->reg != 0) { - reg->hw_reg = header_size + reg->reg - 1 + reg->reg_offset; - reg->reg = 0; - } -} - void fs_visitor::assign_curb_setup() { @@ -1980,23 +1996,37 @@ fs_visitor::assign_urb_setup() this->first_non_payload_grf = urb_start + c->prog_data.urb_read_length; } +static void +trivial_assign_reg(int *reg_hw_locations, fs_reg *reg) +{ + if (reg->file == GRF && reg->reg != 0) { + reg->hw_reg = reg_hw_locations[reg->reg] + reg->reg_offset; + reg->reg = 0; + } +} + void fs_visitor::assign_regs() { - int header_size = this->first_non_payload_grf; int last_grf = 0; + int hw_reg_mapping[this->virtual_grf_next]; + int i; + + hw_reg_mapping[0] = 0; + hw_reg_mapping[1] = this->first_non_payload_grf; + for (i = 2; i < this->virtual_grf_next; i++) { + hw_reg_mapping[i] = (hw_reg_mapping[i - 1] + + this->virtual_grf_sizes[i - 1]); + } + last_grf = hw_reg_mapping[i - 1] + this->virtual_grf_sizes[i - 1]; /* FINISHME: trivial assignment of register numbers */ foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); - trivial_assign_reg(header_size, &inst->dst); - trivial_assign_reg(header_size, &inst->src[0]); - trivial_assign_reg(header_size, &inst->src[1]); - - last_grf = MAX2(last_grf, inst->dst.hw_reg); - last_grf = MAX2(last_grf, inst->src[0].hw_reg); - last_grf = MAX2(last_grf, inst->src[1].hw_reg); + trivial_assign_reg(hw_reg_mapping, &inst->dst); + trivial_assign_reg(hw_reg_mapping, &inst->src[0]); + trivial_assign_reg(hw_reg_mapping, &inst->src[1]); } this->grf_used = last_grf + 1; -- cgit v1.2.3 From 9ff90b7230cceb362c7e0fe1c3d5029b8cbfe6bd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Sep 2010 12:34:33 -0700 Subject: ra: First cut at a graph-coloring register allocator for mesa. Notably missing is choice of registers to spill. --- src/mesa/program/register_allocate.c | 361 +++++++++++++++++++++++++++++++++++ src/mesa/program/register_allocate.h | 69 +++++++ src/mesa/sources.mak | 1 + 3 files changed, 431 insertions(+) create mode 100644 src/mesa/program/register_allocate.c create mode 100644 src/mesa/program/register_allocate.h (limited to 'src/mesa') diff --git a/src/mesa/program/register_allocate.c b/src/mesa/program/register_allocate.c new file mode 100644 index 0000000000..03f04697bf --- /dev/null +++ b/src/mesa/program/register_allocate.c @@ -0,0 +1,361 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +/** @file register_allocate.c + * + * Graph-coloring register allocator. + */ + +#include + +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "register_allocate.h" + +struct ra_reg { + char *name; + GLboolean *conflicts; +}; + +struct ra_regs { + struct ra_reg *regs; + unsigned int count; + + struct ra_class **classes; + unsigned int class_count; +}; + +struct ra_class { + GLboolean *regs; + + /** + * p_B in Runeson/Nyström paper. + * + * This is "how many regs are in the set." + */ + unsigned int p; + + /** + * q_B,C in Runeson/Nyström paper. + */ + unsigned int *q; +}; + +struct ra_node { + GLboolean *adjacency; + unsigned int class; + unsigned int adjacency_count; + unsigned int reg; + GLboolean in_stack; +}; + +struct ra_graph { + struct ra_regs *regs; + /** + * the variables that need register allocation. + */ + struct ra_node *nodes; + unsigned int count; /**< count of nodes. */ + + unsigned int *stack; + unsigned int stack_count; +}; + +struct ra_regs * +ra_alloc_reg_set(unsigned int count) +{ + unsigned int i; + struct ra_regs *regs; + + regs = talloc_zero(NULL, struct ra_regs); + regs->count = count; + regs->regs = talloc_zero_array(regs, struct ra_reg, count); + + for (i = 0; i < count; i++) { + regs->regs[i].conflicts = talloc_zero_array(regs->regs, GLboolean, count); + regs->regs[i].conflicts[i] = GL_TRUE; + } + + return regs; +} + +void +ra_add_reg_conflict(struct ra_regs *regs, unsigned int r1, unsigned int r2) +{ + regs->regs[r1].conflicts[r2] = GL_TRUE; + regs->regs[r2].conflicts[r1] = GL_TRUE; +} + +unsigned int +ra_alloc_reg_class(struct ra_regs *regs) +{ + struct ra_class *class; + + regs->classes = talloc_realloc(regs, regs->classes, + struct ra_class *, + regs->class_count + 1); + + class = talloc_zero(regs, struct ra_class); + regs->classes[regs->class_count] = class; + + class->regs = talloc_zero_array(class, GLboolean, regs->count); + + return regs->class_count++; +} + +void +ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int r) +{ + struct ra_class *class = regs->classes[c]; + + class->regs[r] = GL_TRUE; + class->p++; +} + +/** + * Must be called after all conflicts and register classes have been + * set up and before the register set is used for allocation. + */ +void +ra_set_finalize(struct ra_regs *regs) +{ + unsigned int b, c; + + for (b = 0; b < regs->class_count; b++) { + regs->classes[b]->q = talloc_array(regs, unsigned int, regs->class_count); + } + + /* Compute, for each class B and C, how many regs of B an + * allocation to C could conflict with. + */ + for (b = 0; b < regs->class_count; b++) { + for (c = 0; c < regs->class_count; c++) { + unsigned int rc; + int max_conflicts = 0; + + for (rc = 0; rc < regs->count; rc++) { + unsigned int rb; + int conflicts = 0; + + if (!regs->classes[c]->regs[rc]) + continue; + + for (rb = 0; rb < regs->count; rb++) { + if (regs->classes[b]->regs[rb] && + regs->regs[rb].conflicts[rc]) + conflicts++; + } + max_conflicts = MAX2(max_conflicts, conflicts); + } + regs->classes[b]->q[c] = max_conflicts; + } + } +} + +struct ra_graph * +ra_alloc_interference_graph(struct ra_regs *regs, unsigned int count) +{ + struct ra_graph *g; + unsigned int i; + + g = talloc_zero(regs, struct ra_graph); + g->regs = regs; + g->nodes = talloc_zero_array(g, struct ra_node, count); + g->count = count; + + g->stack = talloc_zero_array(g, unsigned int, count); + + for (i = 0; i < count; i++) { + g->nodes[i].adjacency = talloc_zero_array(g, GLboolean, count); + g->nodes[i].adjacency[i] = GL_TRUE; + g->nodes[i].reg = ~0; + } + + return g; +} + +void +ra_set_node_class(struct ra_graph *g, + unsigned int n, unsigned int class) +{ + g->nodes[n].class = class; +} + +void +ra_add_node_interference(struct ra_graph *g, + unsigned int n1, unsigned int n2) +{ + if (g->nodes[n1].adjacency[n2]) + return; + + g->nodes[n1].adjacency[n2] = GL_TRUE; + g->nodes[n2].adjacency_count++; + g->nodes[n2].adjacency[n1] = GL_TRUE; + g->nodes[n2].adjacency_count++; +} + +static GLboolean pq_test(struct ra_graph *g, unsigned int n) +{ + unsigned int j; + unsigned int q = 0; + int n_class = g->nodes[n].class; + + for (j = 0; j < g->count; j++) { + if (j == n || g->nodes[j].in_stack) + continue; + + if (g->nodes[n].adjacency[j]) { + unsigned int j_class = g->nodes[j].class; + q += g->regs->classes[n_class]->q[j_class]; + } + } + + return q < g->regs->classes[n_class]->p; +} + +/** + * Simplifies the interference graph by pushing all + * trivially-colorable nodes into a stack of nodes to be colored, + * removing them from the graph, and rinsing and repeating. + * + * Returns GL_TRUE if all nodes were removed from the graph. GL_FALSE + * means that either spilling will be required, or optimistic coloring + * should be applied. + */ +GLboolean +ra_simplify(struct ra_graph *g) +{ + GLboolean progress = GL_TRUE; + int i; + + while (progress) { + progress = GL_FALSE; + + for (i = g->count - 1; i >= 0; i--) { + if (g->nodes[i].in_stack) + continue; + + if (pq_test(g, i)) { + g->stack[g->stack_count] = i; + g->stack_count++; + g->nodes[i].in_stack = GL_TRUE; + progress = GL_TRUE; + } + } + } + + for (i = 0; i < g->count; i++) { + if (!g->nodes[i].in_stack) + return GL_FALSE; + } + + return GL_TRUE; +} + +/** + * Pops nodes from the stack back into the graph, coloring them with + * registers as they go. + * + * If all nodes were trivially colorable, then this must succeed. If + * not (optimistic coloring), then it may return GL_FALSE; + */ +GLboolean +ra_select(struct ra_graph *g) +{ + int i; + + while (g->stack_count != 0) { + unsigned int r; + int n = g->stack[g->stack_count - 1]; + struct ra_class *c = g->regs->classes[g->nodes[n].class]; + + /* Find the lowest-numbered reg which is not used by a member + * of the graph adjacent to us. + */ + for (r = 0; r < g->regs->count; r++) { + if (!c->regs[r]) + continue; + + /* Check if any of our neighbors conflict with this register choice. */ + for (i = 0; i < g->count; i++) { + if (g->nodes[n].adjacency[i] && + !g->nodes[i].in_stack && + g->regs->regs[r].conflicts[g->nodes[i].reg]) { + break; + } + } + if (i == g->count) + break; + } + if (r == g->regs->count) + return GL_FALSE; + + g->nodes[n].reg = r; + g->nodes[n].in_stack = GL_FALSE; + g->stack_count--; + } + + return GL_TRUE; +} + +/** + * Optimistic register coloring: Just push the remaining nodes + * on the stack. They'll be colored first in ra_select(), and + * if they succeed then the locally-colorable nodes are still + * locally-colorable and the rest of the register allocation + * will succeed. + */ +void +ra_optimistic_color(struct ra_graph *g) +{ + unsigned int i; + + for (i = 0; i < g->count; i++) { + if (g->nodes[i].in_stack) + continue; + + g->stack[g->stack_count] = i; + g->stack_count++; + g->nodes[i].in_stack = GL_TRUE; + } +} + +GLboolean +ra_allocate_no_spills(struct ra_graph *g) +{ + if (!ra_simplify(g)) { + ra_optimistic_color(g); + } + return ra_select(g); +} + +unsigned int +ra_get_node_reg(struct ra_graph *g, unsigned int n) +{ + return g->nodes[n].reg; +} diff --git a/src/mesa/program/register_allocate.h b/src/mesa/program/register_allocate.h new file mode 100644 index 0000000000..42647b50b8 --- /dev/null +++ b/src/mesa/program/register_allocate.h @@ -0,0 +1,69 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +struct ra_class; +struct ra_regs; + +/* @{ + * Register set setup. + * + * This should be done once at backend initializaion, as + * ra_set_finalize is O(r^2*c^2). The registers may be virtual + * registers, such as aligned register pairs that conflict with the + * two real registers from which they are composed. + */ +struct ra_regs *ra_alloc_reg_set(unsigned int count); +unsigned int ra_alloc_reg_class(struct ra_regs *regs); +void ra_add_reg_conflict(struct ra_regs *regs, + unsigned int r1, unsigned int r2); +void ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int reg); +void ra_set_finalize(struct ra_regs *regs); +/** @} */ + +/** @{ Interference graph setup. + * + * Each interference graph node is a virtual variable in the IL. It + * is up to the user to ra_set_node_class() for the virtual variable, + * and compute live ranges and ra_node_interfere() between conflicting + * live ranges. + */ +struct ra_graph *ra_alloc_interference_graph(struct ra_regs *regs, + unsigned int count); +void ra_set_node_class(struct ra_graph *g, unsigned int n, unsigned int c); +void ra_add_node_interference(struct ra_graph *g, + unsigned int n1, unsigned int n2); +/** @} */ + +/** @{ Graph-coloring register allocation */ +GLboolean ra_simplify(struct ra_graph *g); +void ra_optimistic_color(struct ra_graph *g); +GLboolean ra_select(struct ra_graph *g); +GLboolean ra_allocate_no_spills(struct ra_graph *g); + +unsigned int ra_get_node_reg(struct ra_graph *g, unsigned int n); +/** @} */ + diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index b2be5ba07f..11a93d47f6 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -247,6 +247,7 @@ PROGRAM_SOURCES = \ program/prog_statevars.c \ program/prog_uniform.c \ program/programopt.c \ + program/register_allocate.c \ program/symbol_table.c SHADER_CXX_SOURCES = \ -- cgit v1.2.3 From e1261d3c493ff48348483a0084f3017c7e663dc0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Sep 2010 12:08:11 -0700 Subject: i965: First cut at register allocation using graph coloring. The interference is totally bogus (maximal), so this is equivalent to our trivial register assignment before. As in, passes the same set of piglit tests. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 158 +++++++++++++++++++++++++++++++++-- 1 file changed, 151 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index e91351cb6c..4de64f0927 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -35,6 +35,7 @@ extern "C" { #include "program/prog_parameter.h" #include "program/prog_print.h" #include "program/prog_optimize.h" +#include "program/register_allocate.h" #include "program/sampler.h" #include "program/hash_table.h" #include "brw_context.h" @@ -448,6 +449,7 @@ public: void assign_curb_setup(); void assign_urb_setup(); void assign_regs(); + void assign_regs_trivial(); void generate_code(); void generate_fb_write(fs_inst *inst); void generate_linterp(fs_inst *inst, struct brw_reg dst, @@ -1997,7 +1999,7 @@ fs_visitor::assign_urb_setup() } static void -trivial_assign_reg(int *reg_hw_locations, fs_reg *reg) +assign_reg(int *reg_hw_locations, fs_reg *reg) { if (reg->file == GRF && reg->reg != 0) { reg->hw_reg = reg_hw_locations[reg->reg] + reg->reg_offset; @@ -2006,7 +2008,7 @@ trivial_assign_reg(int *reg_hw_locations, fs_reg *reg) } void -fs_visitor::assign_regs() +fs_visitor::assign_regs_trivial() { int last_grf = 0; int hw_reg_mapping[this->virtual_grf_next]; @@ -2020,18 +2022,157 @@ fs_visitor::assign_regs() } last_grf = hw_reg_mapping[i - 1] + this->virtual_grf_sizes[i - 1]; - /* FINISHME: trivial assignment of register numbers */ foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); - trivial_assign_reg(hw_reg_mapping, &inst->dst); - trivial_assign_reg(hw_reg_mapping, &inst->src[0]); - trivial_assign_reg(hw_reg_mapping, &inst->src[1]); + assign_reg(hw_reg_mapping, &inst->dst); + assign_reg(hw_reg_mapping, &inst->src[0]); + assign_reg(hw_reg_mapping, &inst->src[1]); } this->grf_used = last_grf + 1; } +void +fs_visitor::assign_regs() +{ + int last_grf = 0; + int hw_reg_mapping[this->virtual_grf_next + 1]; + int base_reg_count = BRW_MAX_GRF - this->first_non_payload_grf; + int class_sizes[base_reg_count]; + int class_count = 0; + + /* Set up the register classes. + * + * The base registers store a scalar value. For texture samples, + * we get virtual GRFs composed of 4 contiguous hw register. For + * structures and arrays, we store them as contiguous larger things + * than that, though we should be able to do better most of the + * time. + */ + class_sizes[class_count++] = 1; + for (int r = 1; r < this->virtual_grf_next; r++) { + int i; + + for (i = 0; i < class_count; i++) { + if (class_sizes[i] == this->virtual_grf_sizes[r]) + break; + } + if (i == class_count) { + class_sizes[class_count++] = this->virtual_grf_sizes[r]; + } + } + + int ra_reg_count = 0; + int class_base_reg[class_count]; + int class_reg_count[class_count]; + int classes[class_count]; + + for (int i = 0; i < class_count; i++) { + class_base_reg[i] = ra_reg_count; + class_reg_count[i] = base_reg_count - (class_sizes[i] - 1); + ra_reg_count += class_reg_count[i]; + } + + struct ra_regs *regs = ra_alloc_reg_set(ra_reg_count); + for (int i = 0; i < class_count; i++) { + classes[i] = ra_alloc_reg_class(regs); + + for (int i_r = 0; i_r < class_reg_count[i]; i_r++) { + ra_class_add_reg(regs, classes[i], class_base_reg[i] + i_r); + } + + /* Add conflicts between our contiguous registers aliasing + * base regs and other register classes' contiguous registers + * that alias base regs, or the base regs themselves for classes[0]. + */ + for (int c = 0; c <= i; c++) { + for (int i_r = 0; i_r < class_reg_count[i] - 1; i_r++) { + for (int c_r = MAX2(0, i_r - (class_sizes[c] - 1)); + c_r <= MIN2(class_reg_count[c] - 1, i_r + class_sizes[i] - 1); + c_r++) { + + if (0) { + printf("%d/%d conflicts %d/%d\n", + class_sizes[i], i_r, + class_sizes[c], c_r); + } + + ra_add_reg_conflict(regs, + class_base_reg[i] + i_r, + class_base_reg[c] + c_r); + } + } + } + } + + ra_set_finalize(regs); + + struct ra_graph *g = ra_alloc_interference_graph(regs, + this->virtual_grf_next); + /* Node 0 is just a placeholder to keep virtual_grf[] mapping 1:1 + * with nodes. + */ + ra_set_node_class(g, 0, classes[0]); + + /* FINISHME: Proper interference (live interval analysis) */ + for (int i = 1; i < this->virtual_grf_next; i++) { + for (int c = 0; c < class_count; c++) { + if (class_sizes[c] == this->virtual_grf_sizes[i]) { + ra_set_node_class(g, i, classes[c]); + break; + } + } + + for (int j = 1; j < i; j++) { + ra_add_node_interference(g, i, j); + } + } + + /* FINISHME: Handle spilling */ + if (!ra_allocate_no_spills(g)) { + fprintf(stderr, "Failed to allocate registers.\n"); + this->fail = true; + return; + } + + /* Get the chosen virtual registers for each node, and map virtual + * regs in the register classes back down to real hardware reg + * numbers. + */ + hw_reg_mapping[0] = 0; /* unused */ + for (int i = 1; i < this->virtual_grf_next; i++) { + int reg = ra_get_node_reg(g, i); + int hw_reg = -1; + + for (int c = 0; c < class_count; c++) { + if (reg >= class_base_reg[c] && + reg < class_base_reg[c] + class_reg_count[c] - 1) { + hw_reg = reg - class_base_reg[c]; + break; + } + } + + assert(hw_reg != -1); + hw_reg_mapping[i] = this->first_non_payload_grf + hw_reg; + last_grf = MAX2(last_grf, + hw_reg_mapping[i] + this->virtual_grf_sizes[i] - 1); + } + + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + + assign_reg(hw_reg_mapping, &inst->dst); + assign_reg(hw_reg_mapping, &inst->src[0]); + assign_reg(hw_reg_mapping, &inst->src[1]); + } + + this->grf_used = last_grf + 1; + + talloc_free(g); + talloc_free(regs); +} + static struct brw_reg brw_reg_from_fs_reg(fs_reg *reg) { struct brw_reg brw_reg; @@ -2319,7 +2460,10 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) v.emit_fb_writes(); v.assign_curb_setup(); v.assign_urb_setup(); - v.assign_regs(); + if (0) + v.assign_regs_trivial(); + else + v.assign_regs(); } v.generate_code(); -- cgit v1.2.3 From b90c7d1713c5a52fd85cb9dacad5828ae2fdbf6c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Sep 2010 15:20:12 -0700 Subject: i965: Add live interval analysis and hook it up to the register allocator. Fixes 13 piglit cases that failed at register allocation before. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 85 +++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 4de64f0927..b00930d5cf 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -417,6 +417,8 @@ public: this->virtual_grf_sizes = NULL; this->virtual_grf_next = 1; this->virtual_grf_array_size = 0; + this->virtual_grf_def = NULL; + this->virtual_grf_use = NULL; } ~fs_visitor() { @@ -450,6 +452,8 @@ public: void assign_urb_setup(); void assign_regs(); void assign_regs_trivial(); + void calculate_live_intervals(); + bool virtual_grf_interferes(int a, int b); void generate_code(); void generate_fb_write(fs_inst *inst); void generate_linterp(fs_inst *inst, struct brw_reg dst, @@ -483,6 +487,8 @@ public: int *virtual_grf_sizes; int virtual_grf_next; int virtual_grf_array_size; + int *virtual_grf_def; + int *virtual_grf_use; struct hash_table *variable_ht; ir_variable *frag_color, *frag_data, *frag_depth; @@ -2042,6 +2048,8 @@ fs_visitor::assign_regs() int class_sizes[base_reg_count]; int class_count = 0; + calculate_live_intervals(); + /* Set up the register classes. * * The base registers store a scalar value. For texture samples, @@ -2115,7 +2123,6 @@ fs_visitor::assign_regs() */ ra_set_node_class(g, 0, classes[0]); - /* FINISHME: Proper interference (live interval analysis) */ for (int i = 1; i < this->virtual_grf_next; i++) { for (int c = 0; c < class_count; c++) { if (class_sizes[c] == this->virtual_grf_sizes[i]) { @@ -2125,7 +2132,9 @@ fs_visitor::assign_regs() } for (int j = 1; j < i; j++) { - ra_add_node_interference(g, i, j); + if (virtual_grf_interferes(i, j)) { + ra_add_node_interference(g, i, j); + } } } @@ -2173,6 +2182,78 @@ fs_visitor::assign_regs() talloc_free(regs); } +void +fs_visitor::calculate_live_intervals() +{ + int num_vars = this->virtual_grf_next; + int *def = talloc_array(mem_ctx, int, num_vars); + int *use = talloc_array(mem_ctx, int, num_vars); + int loop_depth = 0; + int loop_start = 0; + + for (int i = 0; i < num_vars; i++) { + def[i] = 1 << 30; + use[i] = 0; + } + + int ip = 0; + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + + if (inst->opcode == BRW_OPCODE_DO) { + if (loop_depth++ == 0) + loop_start = ip; + } else if (inst->opcode == BRW_OPCODE_WHILE) { + loop_depth--; + + if (loop_depth == 0) { + /* FINISHME: + * + * Patches up any vars marked for use within the loop as + * live until the end. This is conservative, as there + * will often be variables defined and used inside the + * loop but dead at the end of the loop body. + */ + for (int i = 0; i < num_vars; i++) { + if (use[i] == loop_start) { + use[i] = ip; + } + } + } + } else { + int eip = ip; + + if (loop_depth) + eip = loop_start; + + for (unsigned int i = 0; i < 3; i++) { + if (inst->src[i].file == GRF && inst->src[i].reg != 0) { + def[inst->src[i].reg] = MIN2(def[inst->src[i].reg], eip); + use[inst->src[i].reg] = MAX2(use[inst->src[i].reg], eip); + } + } + if (inst->dst.file == GRF && inst->dst.reg != 0) { + def[inst->dst.reg] = MIN2(def[inst->dst.reg], eip); + use[inst->dst.reg] = MAX2(use[inst->dst.reg], eip); + } + } + + ip++; + } + + this->virtual_grf_def = def; + this->virtual_grf_use = use; +} + +bool +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]); + + return start <= end; +} + static struct brw_reg brw_reg_from_fs_reg(fs_reg *reg) { struct brw_reg brw_reg; -- cgit v1.2.3 From ad1506c5ac61b75e45f24a2e18c91dc8a49a3bb0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Sep 2010 16:20:48 -0700 Subject: i965: Remove my "safety counter" code from loops. I've screwed this up enough times that I don't think it's worth it. This time, it was that I was doing it once per top-level body instruction instead of just once at the end of the loop body. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b00930d5cf..efbb4c6692 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1400,12 +1400,6 @@ fs_visitor::visit(ir_loop *ir) } } - /* Start a safety counter. If the user messed up their loop - * counting, we don't want to hang the GPU. - */ - fs_reg max_iter = fs_reg(this, glsl_type::int_type); - emit(fs_inst(BRW_OPCODE_MOV, max_iter, fs_reg(10000))); - emit(fs_inst(BRW_OPCODE_DO)); if (ir->to) { @@ -1445,17 +1439,9 @@ fs_visitor::visit(ir_loop *ir) foreach_iter(exec_list_iterator, iter, ir->body_instructions) { ir_instruction *ir = (ir_instruction *)iter.get(); - fs_inst *inst; this->base_ir = ir; ir->accept(this); - - /* Check the maximum loop iters counter. */ - inst = emit(fs_inst(BRW_OPCODE_ADD, max_iter, max_iter, fs_reg(-1))); - inst->conditional_mod = BRW_CONDITIONAL_Z; - - inst = emit(fs_inst(BRW_OPCODE_BREAK)); - inst->predicated = true; } if (ir->increment) { -- cgit v1.2.3 From 72b368ae69bc037681ab4e458296c07cb04349be Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Thu, 30 Sep 2010 10:49:47 +0800 Subject: i965: always set tiling for fbo depth buffer on sandybridge Sandybridge requires depth buffer must be tiling. Fix 'fbo_firecube' demo. --- src/mesa/drivers/dri/intel/intel_fbo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 984585027c..8c0491d59a 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -102,7 +102,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, { struct intel_context *intel = intel_context(ctx); struct intel_renderbuffer *irb = intel_renderbuffer(rb); - int cpp; + int cpp, tiling; ASSERT(rb->Name != 0); @@ -176,7 +176,13 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, /* alloc hardware renderbuffer */ DBG("Allocating %d x %d Intel RBO\n", width, height); - irb->region = intel_region_alloc(intel->intelScreen, I915_TILING_NONE, cpp, + tiling = I915_TILING_NONE; + + /* Gen6 requires depth must be tiling */ + if (intel->gen >= 6 && rb->Format == MESA_FORMAT_S8_Z24) + tiling = I915_TILING_Y; + + irb->region = intel_region_alloc(intel->intelScreen, tiling, cpp, width, height, GL_TRUE); if (!irb->region) return GL_FALSE; /* out of memory? */ -- cgit v1.2.3 From 6f39280ba910e290fb3cda378057dc91e5811c95 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 28 Sep 2010 22:20:12 +0200 Subject: dri/nouveau: Have a smaller amount of larger scratch buffers. Larger VBOs avoid many kernel trips to get them in sync with the GPU. --- src/mesa/drivers/dri/nouveau/nouveau_render.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_render.h b/src/mesa/drivers/dri/nouveau/nouveau_render.h index 923b79b2cf..29d96eda77 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_render.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_render.h @@ -55,8 +55,8 @@ struct nouveau_array_state { extract_f_t extract_f; }; -#define RENDER_SCRATCH_COUNT 32 -#define RENDER_SCRATCH_SIZE 64*1024 +#define RENDER_SCRATCH_COUNT 2 +#define RENDER_SCRATCH_SIZE 2*1024*1024 struct nouveau_scratch_state { struct nouveau_bo *bo[RENDER_SCRATCH_COUNT]; -- cgit v1.2.3 From bdd19da2183c685056c4c2eee5cea8358d9935cb Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 28 Sep 2010 22:24:05 +0200 Subject: dri/nouveau: Remove unnecessary flush. --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index fbe4edea58..1121d2d3d3 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -353,8 +353,6 @@ nouveau_validate_framebuffer(GLcontext *ctx) validate_framebuffer(dri_ctx, dri_read, &dri_ctx->dri2.read_stamp); - if (nouveau_next_dirty_state(ctx) >= 0) { + if (nouveau_next_dirty_state(ctx) >= 0) nouveau_state_emit(ctx); - FIRE_RING(context_chan(ctx)); - } } -- cgit v1.2.3 From 065163bcd2df12494ca523538736282fc847fa6b Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sat, 25 Sep 2010 15:29:02 +0200 Subject: dri/nv10: Use fast Z clears. --- src/mesa/drivers/dri/nouveau/nouveau_class.h | 6 ++++ src/mesa/drivers/dri/nouveau/nouveau_context.h | 5 +++ src/mesa/drivers/dri/nouveau/nouveau_fbo.h | 6 +++- src/mesa/drivers/dri/nouveau/nv10_context.c | 45 +++++++++++++++++++++++--- src/mesa/drivers/dri/nouveau/nv10_driver.h | 8 +++++ src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 29 ++++++++++++++--- 6 files changed, 88 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_class.h b/src/mesa/drivers/dri/nouveau/nouveau_class.h index 5cb13acf7b..d41d431f79 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_class.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_class.h @@ -3191,6 +3191,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV17TCL_DMA_IN_MEMORY4 0x000001ac #define NV17TCL_DMA_IN_MEMORY5 0x000001b0 #define NV17TCL_COLOR_MASK_ENABLE 0x000002bc +#define NV17TCL_ZCLEAR_ENABLE 0x000003f8 +#define NV17TCL_ZCLEAR_VALUE 0x000003fc +#define NV17TCL_ZCLEAR_VALUE_DEPTH_SHIFT 8 +#define NV17TCL_ZCLEAR_VALUE_DEPTH_MASK 0xffffff00 +#define NV17TCL_ZCLEAR_VALUE_SEQUENCE_SHIFT 0 +#define NV17TCL_ZCLEAR_VALUE_SEQUENCE_MASK 0x000000ff #define NV17TCL_LMA_DEPTH_BUFFER_PITCH 0x00000d5c #define NV17TCL_LMA_DEPTH_BUFFER_OFFSET 0x00000d60 #define NV17TCL_LMA_DEPTH_FILL_VALUE 0x00000d68 diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 3dbe72900a..5f00327119 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -67,6 +67,11 @@ struct nouveau_context { struct nouveau_hw_state hw; struct nouveau_bo_state bo; struct nouveau_render_state render; + + struct { + GLboolean clear_blocked; + int clear_seq; + } hierz; }; #define to_nouveau_context(ctx) ((struct nouveau_context *)(ctx)) diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.h b/src/mesa/drivers/dri/nouveau/nouveau_fbo.h index 0fe6c08be5..05ea03a075 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.h @@ -29,8 +29,12 @@ struct nouveau_framebuffer { struct gl_framebuffer base; - struct nouveau_bo *lma_bo; GLboolean need_front; + + struct { + struct nouveau_bo *bo; + uint32_t clear_value; + } hierz; }; #define to_nouveau_framebuffer(x) ((struct nouveau_framebuffer *)(x)) diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c index 08be2a25a0..41723ff190 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_context.c +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c @@ -40,9 +40,31 @@ static const struct dri_extension nv10_extensions[] = { { NULL, NULL } }; +static GLboolean +use_fast_zclear(GLcontext *ctx, GLbitfield buffers) +{ + struct nouveau_context *nctx = to_nouveau_context(ctx); + struct gl_framebuffer *fb = ctx->DrawBuffer; + + if (buffers & BUFFER_BIT_STENCIL) { + /* + * The stencil test is bypassed when fast Z clears are + * enabled. + */ + nctx->hierz.clear_blocked = GL_TRUE; + context_dirty(ctx, ZCLEAR); + return GL_FALSE; + } + + return !nctx->hierz.clear_blocked && + fb->_Xmax == fb->Width && fb->_Xmin == 0 && + fb->_Ymax == fb->Height && fb->_Ymin == 0; +} + static void nv10_clear(GLcontext *ctx, GLbitfield buffers) { + struct nouveau_context *nctx = to_nouveau_context(ctx); struct nouveau_channel *chan = context_chan(ctx); struct nouveau_grobj *celsius = context_eng3d(ctx); struct nouveau_framebuffer *nfb = to_nouveau_framebuffer( @@ -50,16 +72,28 @@ nv10_clear(GLcontext *ctx, GLbitfield buffers) nouveau_validate_framebuffer(ctx); - /* Clear the LMA depth buffer, if present. */ - if ((buffers & BUFFER_BIT_DEPTH) && ctx->Depth.Mask && - nfb->lma_bo) { + if ((buffers & BUFFER_BIT_DEPTH) && + ctx->Depth.Mask && nfb->hierz.bo) { struct nouveau_surface *s = &to_nouveau_renderbuffer( nfb->base._DepthBuffer->Wrapped)->surface; + /* Clear the hierarchical depth buffer */ BEGIN_RING(chan, celsius, NV17TCL_LMA_DEPTH_FILL_VALUE, 1); OUT_RING(chan, pack_zs_f(s->format, ctx->Depth.Clear, 0)); BEGIN_RING(chan, celsius, NV17TCL_LMA_DEPTH_BUFFER_CLEAR, 1); OUT_RING(chan, 1); + + /* Mark the depth buffer as cleared */ + if (use_fast_zclear(ctx, buffers)) { + if (nctx->hierz.clear_seq) + buffers &= ~BUFFER_BIT_DEPTH; + + nfb->hierz.clear_value = + pack_zs_f(s->format, ctx->Depth.Clear, 0); + nctx->hierz.clear_seq++; + + context_dirty(ctx, ZCLEAR); + } } nouveau_clear(ctx, buffers); @@ -423,7 +457,8 @@ const struct nouveau_driver nv10_driver = { nv10_emit_tex_obj, nouveau_emit_nothing, nouveau_emit_nothing, - nv10_emit_viewport + nv10_emit_viewport, + nv10_emit_zclear }, - .num_emit = NUM_NOUVEAU_STATE, + .num_emit = NUM_NV10_STATE, }; diff --git a/src/mesa/drivers/dri/nouveau/nv10_driver.h b/src/mesa/drivers/dri/nouveau/nv10_driver.h index cefd6c6fba..340ba05ade 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_driver.h +++ b/src/mesa/drivers/dri/nouveau/nv10_driver.h @@ -27,6 +27,11 @@ #ifndef __NV10_DRIVER_H__ #define __NV10_DRIVER_H__ +enum { + NOUVEAU_STATE_ZCLEAR = NUM_NOUVEAU_STATE, + NUM_NV10_STATE +}; + #define NV10_TEXTURE_UNITS 2 /* nv10_context.c */ @@ -52,6 +57,9 @@ nv10_emit_scissor(GLcontext *ctx, int emit); void nv10_emit_viewport(GLcontext *ctx, int emit); +void +nv10_emit_zclear(GLcontext *ctx, int emit); + /* nv10_state_polygon.c */ void nv10_emit_cull_face(GLcontext *ctx, int emit); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c index a2fcb6b695..98eb0e8ece 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c @@ -62,14 +62,14 @@ setup_lma_buffer(GLcontext *ctx) height = align(fb->Height, 2), size = pitch * height; - if (!nfb->lma_bo || nfb->lma_bo->size != size) { - nouveau_bo_ref(NULL, &nfb->lma_bo); + if (!nfb->hierz.bo || nfb->hierz.bo->size != size) { + nouveau_bo_ref(NULL, &nfb->hierz.bo); nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_VRAM, 0, size, - &nfb->lma_bo); + &nfb->hierz.bo); } nouveau_bo_markl(bctx, celsius, NV17TCL_LMA_DEPTH_BUFFER_OFFSET, - nfb->lma_bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR); + nfb->hierz.bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR); WAIT_RING(chan, 9); BEGIN_RING(chan, celsius, NV17TCL_LMA_DEPTH_WINDOW_X, 4); @@ -134,8 +134,10 @@ nv10_emit_framebuffer(GLcontext *ctx, int emit) nouveau_bo_markl(bctx, celsius, NV10TCL_ZETA_OFFSET, s->bo, 0, bo_flags); - if (context_chipset(ctx) >= 0x17) + if (context_chipset(ctx) >= 0x17) { setup_lma_buffer(ctx); + context_dirty(ctx, ZCLEAR); + } } BEGIN_RING(chan, celsius, NV10TCL_RT_FORMAT, 2); @@ -187,3 +189,20 @@ nv10_emit_viewport(GLcontext *ctx, int emit) context_dirty(ctx, PROJECTION); } + +void +nv10_emit_zclear(GLcontext *ctx, int emit) +{ + struct nouveau_context *nctx = to_nouveau_context(ctx); + struct nouveau_channel *chan = context_chan(ctx); + struct nouveau_grobj *celsius = context_eng3d(ctx); + struct nouveau_framebuffer *nfb = + to_nouveau_framebuffer(ctx->DrawBuffer); + + if (nfb->hierz.bo) { + BEGIN_RING(chan, celsius, NV17TCL_ZCLEAR_ENABLE, 2); + OUT_RING(chan, nctx->hierz.clear_blocked ? 0 : 1); + OUT_RING(chan, nfb->hierz.clear_value | + (nctx->hierz.clear_seq & 0xff)); + } +} -- cgit v1.2.3 From 7d0b89fda056c89c265518a745ec751287723a12 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:25:21 -0700 Subject: swrast: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/swrast/s_aatriangle.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 1d90f322a3..175316790d 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -31,7 +31,6 @@ #include "main/glheader.h" #include "main/context.h" #include "main/colormac.h" -#include "main/context.h" #include "main/macros.h" #include "main/imports.h" #include "s_aatriangle.h" -- cgit v1.2.3 From c24e062fdbf21114904258687f95d3d45911f893 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:36:12 -0700 Subject: dri/common: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/common/vblank.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/vblank.h b/src/mesa/drivers/dri/common/vblank.h index 29d1ad8003..067fb5ed8d 100644 --- a/src/mesa/drivers/dri/common/vblank.h +++ b/src/mesa/drivers/dri/common/vblank.h @@ -61,10 +61,6 @@ extern int driWaitForVBlank( __DRIdrawable *priv, #include /* for usleep() */ #include /* for sched_yield() */ -#ifdef linux -#include /* for sched_yield() */ -#endif - #define DO_USLEEP(nr) \ do { \ if (0) fprintf(stderr, "%s: usleep for %u\n", __FUNCTION__, nr ); \ -- cgit v1.2.3 From b958dabe1602d9a59b0aef0c004f8cf20c3e9c70 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:37:26 -0700 Subject: dri/i810: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/i810/i810tex.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index 2ccb9562e9..5c5c80d16d 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -31,7 +31,6 @@ #include "main/teximage.h" #include "main/texobj.h" #include "main/colormac.h" -#include "main/texobj.h" #include "main/mm.h" #include "texmem.h" -- cgit v1.2.3 From f831212eabe25ea2603be13d8d40b12477012acc Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:38:53 -0700 Subject: dri/i915: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/i915/i915_context.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index bf6762d666..412714ada8 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -40,7 +40,6 @@ #include "i915_reg.h" #include "i915_program.h" -#include "intel_tris.h" #include "intel_span.h" /*************************************** -- cgit v1.2.3 From c24144f41fe797a0448f60705d9023902f1178ce Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:39:59 -0700 Subject: dri/i965: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/i965/brw_vtbl.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 8f1601d10f..3d7a98c981 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -43,7 +43,6 @@ #include "brw_defines.h" #include "brw_state.h" #include "brw_draw.h" -#include "brw_state.h" #include "brw_vs.h" #include "brw_wm.h" -- cgit v1.2.3 From 1a98a463043e1558b1ad6ebf79a1371d6218ac5a Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:41:26 -0700 Subject: dri/intel: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/intel/intel_tex_image.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 03aba58e10..187e537aac 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -10,7 +10,6 @@ #include "main/texstore.h" #include "main/texgetimage.h" #include "main/texobj.h" -#include "main/texstore.h" #include "main/teximage.h" #include "intel_context.h" -- cgit v1.2.3 From f094b352073bf5414a101b056f47f1ee2f814e81 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:42:41 -0700 Subject: dri/mga: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/mga/mga_xmesa.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 069947e252..13f73a83e9 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -57,7 +57,6 @@ #include "mgatris.h" #include "mgavb.h" #include "mgapixel.h" -#include "mga_xmesa.h" #include "mga_dri.h" #include "utils.h" -- cgit v1.2.3 From 705d98deb80db476ef37674d256530fae68171c1 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:43:48 -0700 Subject: dri/r128: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/r128/r128_tex.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index b5a19b510a..2dd47b06a5 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -43,7 +43,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/teximage.h" #include "main/texobj.h" #include "main/imports.h" -#include "main/texobj.h" #include "main/macros.h" #include "xmlpool.h" -- cgit v1.2.3 From 223c4b418854a6c260723ae8bc4afd7a27463c22 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:44:55 -0700 Subject: dri/r300: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/r300/radeon_context.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index da4812d323..e793656dbe 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -49,8 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drm.h" #include "dri_util.h" -#include "radeon_screen.h" - #define FALLBACK( radeon, bit, mode ) fprintf(stderr, "%s:%s\n", __LINE__, __FILE__); /* TCL fallbacks */ -- cgit v1.2.3 From a7670be8a15c56b625f2f1aad08eeff2414200b4 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:46:06 -0700 Subject: dri/r600: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/r600/r600_cmdbuf.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c index b3331fc8b8..ce2f777956 100644 --- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c +++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c @@ -47,7 +47,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_reg.h" #include "r600_cmdbuf.h" #include "radeon_bocs_wrapper.h" -#include "radeon_reg.h" #ifdef HAVE_LIBDRM_RADEON #include "radeon_cs_int.h" -- cgit v1.2.3 From 1663e6da2f15ff8db9f08ca6a7337f8bd28add17 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:47:22 -0700 Subject: dri/radeon: remove duplicated includes Remove duplicated includes. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/radeon/radeon_ioctl.c | 1 - src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 1 - 2 files changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index 5ac526c6de..d08a82f1a5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -44,7 +44,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/glheader.h" #include "main/imports.h" #include "main/simple_list.h" -#include "swrast/swrast.h" #include "radeon_context.h" #include "radeon_common.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 98f96ff2a7..ad3bc2d23d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "math/m_translate.h" #include "tnl/tnl.h" #include "tnl/t_pipeline.h" -#include "math/m_translate.h" #include "radeon_context.h" #include "radeon_state.h" #include "radeon_ioctl.h" -- cgit v1.2.3 From 8c92a80b6210bf7d977816690476ff336b350c79 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:48:29 -0700 Subject: dri/savage: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/drivers/dri/savage/savage_xmesa.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index cbdc9c87ee..bbf2fd3a0e 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -25,7 +25,6 @@ #include -#include "main/context.h" #include "main/context.h" #include "main/matrix.h" #include "main/framebuffer.h" -- cgit v1.2.3 From 9674929bce0c0ea4862b468d0a1a7e58b2664049 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:50:43 -0700 Subject: main: remove duplicated includes Remove duplicated includes. Signed-off-by: Brian Paul --- src/mesa/main/api_exec.c | 5 +---- src/mesa/main/dlist.c | 1 - src/mesa/main/renderbuffer.c | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index b87aa47d88..ae653e1914 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -91,10 +91,7 @@ #include "mtypes.h" #include "varray.h" #include "viewport.h" -#if FEATURE_NV_vertex_program -#include "nvprogram.h" -#endif -#if FEATURE_NV_fragment_program +#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program #include "nvprogram.h" #endif #if FEATURE_ARB_shader_objects diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 3a730f0e40..cccec24853 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -52,7 +52,6 @@ #include "hash.h" #include "image.h" #include "light.h" -#include "dlist.h" #include "macros.h" #include "queryobj.h" #include "teximage.h" diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index adc1199d87..118fb52bb2 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -46,7 +46,6 @@ #include "fbobject.h" #include "formats.h" #include "mtypes.h" -#include "fbobject.h" #include "renderbuffer.h" -- cgit v1.2.3 From bad10b961aeae8d695ecec600d47de5f8505b396 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:52:02 -0700 Subject: math: remove duplicated includes Remove duplicated includes. Signed-off-by: Brian Paul --- src/mesa/math/m_matrix.c | 1 - src/mesa/math/m_vector.c | 1 - 2 files changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 048b231c4e..02aedbad85 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -37,7 +37,6 @@ #include "main/glheader.h" #include "main/imports.h" #include "main/macros.h" -#include "main/imports.h" #include "m_matrix.h" diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index fbd63fd923..4bded31e09 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -30,7 +30,6 @@ #include "main/glheader.h" #include "main/imports.h" #include "main/macros.h" -#include "main/imports.h" #include "m_vector.h" -- cgit v1.2.3 From 4160d947d289c07f1de6b8bf21a874e842b51f51 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Thu, 30 Sep 2010 07:53:13 -0700 Subject: st: remove duplicated include Remove duplicated include. Signed-off-by: Brian Paul --- src/mesa/state_tracker/st_cb_rasterpos.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 7b2eb8012d..e5f7b6f91e 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -44,7 +44,6 @@ #include "st_atom.h" #include "st_draw.h" #include "st_cb_rasterpos.h" -#include "st_draw.h" #include "draw/draw_context.h" #include "draw/draw_pipe.h" #include "vbo/vbo.h" -- cgit v1.2.3 From 0c86e1f29483d9557f30796c03b94a34d965c095 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 30 Sep 2010 14:08:35 -0400 Subject: i965: Update renderer strings for sandybridge Signed-off-by: Adam Jackson --- src/mesa/drivers/dri/intel/intel_context.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index edcc9536da..039ac6d4c1 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -163,6 +163,19 @@ intelGetString(GLcontext * ctx, GLenum name) case PCI_CHIP_ILM_G: chipset = "Intel(R) Ironlake Mobile"; break; + case PCI_CHIP_SANDYBRIDGE_GT1: + case PCI_CHIP_SANDYBRIDGE_GT2: + case PCI_CHIP_SANDYBRIDGE_GT2_PLUS: + chipset = "Intel(R) Sandybridge Desktop"; + break; + case PCI_CHIP_SANDYBRIDGE_M_GT1: + case PCI_CHIP_SANDYBRIDGE_M_GT2: + case PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS: + chipset = "Intel(R) Sandybridge Mobile"; + break; + case PCI_CHIP_SANDYBRIDGE_S: + chipset = "Intel(R) Sandybridge Server"; + break; default: chipset = "Unknown Intel Chipset"; break; -- cgit v1.2.3 From 6f6542a483ec726538f8a4555bddaeb0be6b2146 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Sep 2010 11:46:24 -0700 Subject: i965: Fix whole-structure/array assignment in new FS. We need to walk the type tree to get the right register types for structure components. Fixes glsl-fs-statevar-call. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 76 ++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index efbb4c6692..efa0f2136b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -469,6 +469,8 @@ public: void emit_general_interpolation(ir_variable *ir); void emit_interpolation_setup(); void emit_fb_writes(); + void emit_assignment_writes(fs_reg &l, fs_reg &r, + const glsl_type *type, bool predicated); struct brw_reg interp_reg(int location, int channel); int setup_uniform_values(int loc, const glsl_type *type); @@ -1137,12 +1139,51 @@ fs_visitor::visit(ir_expression *ir) } } +void +fs_visitor::emit_assignment_writes(fs_reg &l, fs_reg &r, + const glsl_type *type, bool predicated) +{ + switch (type->base_type) { + case GLSL_TYPE_FLOAT: + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + case GLSL_TYPE_BOOL: + for (unsigned int i = 0; i < type->components(); i++) { + l.type = brw_type_for_base_type(type); + r.type = brw_type_for_base_type(type); + + fs_inst *inst = emit(fs_inst(BRW_OPCODE_MOV, l, r)); + inst->predicated = predicated; + + l.reg_offset++; + r.reg_offset++; + } + break; + case GLSL_TYPE_ARRAY: + for (unsigned int i = 0; i < type->length; i++) { + emit_assignment_writes(l, r, type->fields.array, predicated); + } + + case GLSL_TYPE_STRUCT: + for (unsigned int i = 0; i < type->length; i++) { + emit_assignment_writes(l, r, type->fields.structure[i].type, + predicated); + } + break; + + case GLSL_TYPE_SAMPLER: + break; + + default: + assert(!"not reached"); + break; + } +} + void fs_visitor::visit(ir_assignment *ir) { struct fs_reg l, r; - int i; - int write_mask; fs_inst *inst; /* FINISHME: arrays on the lhs */ @@ -1152,18 +1193,6 @@ fs_visitor::visit(ir_assignment *ir) ir->rhs->accept(this); r = this->result; - /* FINISHME: This should really set to the correct maximal writemask for each - * FINISHME: component written (in the loops below). This case can only - * FINISHME: occur for matrices, arrays, and structures. - */ - if (ir->write_mask == 0) { - assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector()); - write_mask = WRITEMASK_XYZW; - } else { - assert(ir->lhs->type->is_vector() || ir->lhs->type->is_scalar()); - write_mask = ir->write_mask; - } - assert(l.file != BAD_FILE); assert(r.file != BAD_FILE); @@ -1174,14 +1203,19 @@ fs_visitor::visit(ir_assignment *ir) inst->conditional_mod = BRW_CONDITIONAL_NZ; } - for (i = 0; i < type_size(ir->lhs->type); i++) { - if (i >= 4 || (write_mask & (1 << i))) { - inst = emit(fs_inst(BRW_OPCODE_MOV, l, r)); - if (ir->condition) - inst->predicated = true; - r.reg_offset++; + if (ir->lhs->type->is_scalar() || + ir->lhs->type->is_vector()) { + for (int i = 0; i < ir->lhs->type->vector_elements; i++) { + if (ir->write_mask & (1 << i)) { + inst = emit(fs_inst(BRW_OPCODE_MOV, l, r)); + if (ir->condition) + inst->predicated = true; + r.reg_offset++; + } + l.reg_offset++; } - l.reg_offset++; + } else { + emit_assignment_writes(l, r, ir->lhs->type, ir->condition != NULL); } } -- cgit v1.2.3 From a7cddd7de3123eb13e68c35aa111ff4060669f59 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Sep 2010 13:40:22 -0700 Subject: mesa: Don't reference a W component in setting up a vec3 uniform component. The 965 driver would try to set up storage for the W component, and the offsets would get mixed up. --- src/mesa/main/uniforms.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index 29a9be8c99..87ce6e4938 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -122,7 +122,11 @@ static struct gl_builtin_uniform_element gl_LightSource_elements[] = { {"specular", {STATE_LIGHT, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, {"position", {STATE_LIGHT, 0, STATE_POSITION}, SWIZZLE_XYZW}, {"halfVector", {STATE_LIGHT, 0, STATE_HALF_VECTOR}, SWIZZLE_XYZW}, - {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_XYZW}, + {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, + MAKE_SWIZZLE4(SWIZZLE_X, + SWIZZLE_Y, + SWIZZLE_Z, + SWIZZLE_Z)}, {"spotCosCutoff", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_WWWW}, {"spotCutoff", {STATE_LIGHT, 0, STATE_SPOT_CUTOFF}, SWIZZLE_XXXX}, {"spotExponent", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_WWWW}, -- cgit v1.2.3 From c6960e4471abe287448b9d0e7e6519d588cdf43c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Sep 2010 13:26:38 -0700 Subject: i965: Fix new FS handling of builtin uniforms with packed scalars in structs. We were pointing each element at the .x channel of the ParameterValues. Fixes glsl1-linear fog. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index efa0f2136b..0a77b5ab4e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -696,12 +696,12 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir) */ int last_swiz = -1; for (unsigned int i = 0; i < 4; i++) { - int this_swiz = GET_SWZ(element->swizzle, i); - if (this_swiz == last_swiz) + int swiz = GET_SWZ(element->swizzle, i); + if (swiz == last_swiz) break; - last_swiz = this_swiz; + last_swiz = swiz; - c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i]; + c->prog_data.param[c->prog_data.nr_params++] = &vec_values[swiz]; } } } -- cgit v1.2.3 From a3e9998614da6bd10d9015134bc19f5b8cf6e518 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 30 Sep 2010 20:54:26 -0400 Subject: r600c: add reloc for CB_COLOR0_ATTRIB We'll need a reloc for tiling eventually, so add it now. --- src/mesa/drivers/dri/r600/evergreen_chip.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.c b/src/mesa/drivers/dri/r600/evergreen_chip.c index 1050c776bf..5287a98c05 100644 --- a/src/mesa/drivers/dri/r600/evergreen_chip.c +++ b/src/mesa/drivers/dri/r600/evergreen_chip.c @@ -1415,9 +1415,17 @@ static void evergreenSendCB(GLcontext *ctx, struct radeon_state_atom *atom) R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_VIEW.u32All); END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(4); - EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_ATTRIB, 2); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_ATTRIB, 1); R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_ATTRIB.u32All); + R600_OUT_BATCH_RELOC(0, + rrb->bo, + 0, + 0, RADEON_GEM_DOMAIN_VRAM, 0); + END_BATCH(); + + BEGIN_BATCH_NO_AUTOSTATE(3); + EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_DIM, 1); R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_DIM.u32All); /* R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_CMASK.u32All); @@ -1523,7 +1531,7 @@ void evergreenInitAtoms(context_t *context) EVERGREEN_ALLOC_STATE(sx, always, 9, evergreenSendSX); EVERGREEN_ALLOC_STATE(tx, evergreen_tx, (R700_TEXTURE_NUMBERUNITS * (21+5) + 6), evergreenSendTexState); /* 21 for resource, 5 for sampler */ EVERGREEN_ALLOC_STATE(db, always, 65, evergreenSendDB); - EVERGREEN_ALLOC_STATE(cb, always, 33, evergreenSendCB); + EVERGREEN_ALLOC_STATE(cb, always, 37, evergreenSendCB); EVERGREEN_ALLOC_STATE(vgt, always, 29, evergreenSendVGT); evergreen_init_query_stateobj(&context->radeon, 6 * 2); -- cgit v1.2.3 From 5f237a1ccb28399fbbceecea694f5d18ebba9938 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Sep 2010 20:09:53 -0700 Subject: i965: Use the lowering pass for texture projection. We should end up with the same code, but anyone else with this issue could share the handling (which I got wrong for shadow comparisons in the driver before). --- src/mesa/drivers/dri/i965/brw_fs.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 0a77b5ab4e..c49b27b0b5 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -138,6 +138,7 @@ brw_link_shader(GLcontext *ctx, struct gl_shader_program *prog) do_div_to_mul_rcp(shader->ir); do_sub_to_add_neg(shader->ir); do_explog_to_explog2(shader->ir); + do_lower_texture_projection(shader->ir); do { progress = false; @@ -1229,22 +1230,8 @@ fs_visitor::visit(ir_texture *ir) ir->coordinate->accept(this); fs_reg coordinate = this->result; - if (ir->projector) { - fs_reg inv_proj = fs_reg(this, glsl_type::float_type); - - ir->projector->accept(this); - emit(fs_inst(FS_OPCODE_RCP, inv_proj, this->result)); - - fs_reg proj_coordinate = fs_reg(this, ir->coordinate->type); - for (unsigned int i = 0; i < ir->coordinate->type->vector_elements; i++) { - emit(fs_inst(BRW_OPCODE_MUL, proj_coordinate, coordinate, inv_proj)); - coordinate.reg_offset++; - proj_coordinate.reg_offset++; - } - proj_coordinate.reg_offset = 0; - - coordinate = proj_coordinate; - } + /* Should be lowered by do_lower_texture_projection */ + assert(!ir->projector); for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); -- cgit v1.2.3 From 1d073cb2d920d1c0b8c6d598055b14048fedc96e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Sep 2010 19:18:25 -0700 Subject: i965: Split the gen4 and gen5 sampler handling apart. Trying to track the insanity of the different argument layouts for normal/shadow crossed with normal/lod/bias one generation at a time is enough. Fixes: glsl1-texture2D() with bias. (first test passing in this code that doesn't pass without it!) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 126 ++++++++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index c49b27b0b5..78cdfed3fb 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -469,6 +469,8 @@ public: void emit_fragcoord_interpolation(ir_variable *ir); void emit_general_interpolation(ir_variable *ir); void emit_interpolation_setup(); + fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst, int base_mrf); + fs_inst *emit_texture_gen5(ir_texture *ir, fs_reg dst, int base_mrf); void emit_fb_writes(); void emit_assignment_writes(fs_reg &l, fs_reg &r, const glsl_type *type, bool predicated); @@ -1220,48 +1222,93 @@ fs_visitor::visit(ir_assignment *ir) } } -void -fs_visitor::visit(ir_texture *ir) +fs_inst * +fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, int base_mrf) { - int base_mrf = 2; - fs_inst *inst = NULL; - unsigned int mlen = 0; + /* gen4's SIMD8 sampler always has the slots for u,v,r present. */ + int mlen = 3; - ir->coordinate->accept(this); - fs_reg coordinate = this->result; + if (ir->shadow_comparitor) { + if (ir->op == ir_tex) { + /* There's no plain shadow compare message, so we use shadow + * compare with a bias of 0.0. + */ + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + fs_reg(0.0f))); + mlen++; + } else if (ir->op == ir_txb) { + ir->lod_info.bias->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + this->result)); + mlen++; + } else { + assert(ir->op == ir_txl); + ir->lod_info.lod->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + this->result)); + mlen++; + } - /* Should be lowered by do_lower_texture_projection */ - assert(!ir->projector); + ir->shadow_comparitor->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); + mlen++; + } else { + /* Oh joy. gen4 doesn't have SIMD8 non-shadow-compare sampler + * instructions. We'll need to do SIMD16 here. + */ + abort(); + } - for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { - emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); - coordinate.reg_offset++; + fs_inst *inst = NULL; + switch (ir->op) { + case ir_tex: + inst = emit(fs_inst(FS_OPCODE_TEX, dst, fs_reg(MRF, base_mrf))); + break; + case ir_txb: + inst = emit(fs_inst(FS_OPCODE_TXB, dst, fs_reg(MRF, base_mrf))); + break; + case ir_txl: + inst = emit(fs_inst(FS_OPCODE_TXL, dst, fs_reg(MRF, base_mrf))); + break; + case ir_txd: + case ir_txf: + assert(!"GLSL 1.30 features unsupported"); + break; } + inst->mlen = mlen; - /* Pre-Ironlake, the 8-wide sampler always took u,v,r. */ - if (intel->gen < 5) - mlen = 3; + return inst; +} + +fs_inst * +fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, int base_mrf) +{ + /* gen5's SIMD8 sampler has slots for u, v, r, array index, then + * optional parameters like shadow comparitor or LOD bias. If + * optional parameters aren't present, those base slots are + * optional and don't need to be included in the message. + * + * We don't fill in the unnecessary slots regardless, which may + * look surprising in the disassembly. + */ + int mlen = ir->coordinate->type->vector_elements; if (ir->shadow_comparitor) { - /* For shadow comparisons, we have to supply u,v,r. */ - mlen = 3; + mlen = MAX2(mlen, 4); ir->shadow_comparitor->accept(this); emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); mlen++; } - /* Do we ever want to handle writemasking on texture samples? Is it - * performance relevant? - */ - fs_reg dst = fs_reg(this, glsl_type::vec4_type); - + fs_inst *inst = NULL; switch (ir->op) { case ir_tex: inst = emit(fs_inst(FS_OPCODE_TEX, dst, fs_reg(MRF, base_mrf))); break; case ir_txb: ir->lod_info.bias->accept(this); + mlen = MAX2(mlen, 4); emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); mlen++; @@ -1269,6 +1316,7 @@ fs_visitor::visit(ir_texture *ir) break; case ir_txl: ir->lod_info.lod->accept(this); + mlen = MAX2(mlen, 4); emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); mlen++; @@ -1279,6 +1327,39 @@ fs_visitor::visit(ir_texture *ir) assert(!"GLSL 1.30 features unsupported"); break; } + inst->mlen = mlen; + + return inst; +} + +void +fs_visitor::visit(ir_texture *ir) +{ + int base_mrf = 2; + fs_inst *inst = NULL; + unsigned int mlen = 0; + + ir->coordinate->accept(this); + fs_reg coordinate = this->result; + + /* Should be lowered by do_lower_texture_projection */ + assert(!ir->projector); + + for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); + coordinate.reg_offset++; + } + + /* Writemasking doesn't eliminate channels on SIMD8 texture + * samples, so don't worry about them. + */ + fs_reg dst = fs_reg(this, glsl_type::vec4_type); + + if (intel->gen < 5) { + inst = emit_texture_gen4(ir, dst, base_mrf); + } else { + inst = emit_texture_gen5(ir, dst, base_mrf); + } inst->sampler = _mesa_get_sampler_uniform_value(ir->sampler, @@ -1290,7 +1371,6 @@ fs_visitor::visit(ir_texture *ir) if (ir->shadow_comparitor) inst->shadow_compare = true; - inst->mlen = mlen; } void -- cgit v1.2.3 From 0c39a53aa6b9ef47152e3d44f94fa4486a11831b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 30 Sep 2010 23:13:50 -0400 Subject: r600c: pull over 6xx/7xx vertex fixes for evergreen --- src/mesa/drivers/dri/r600/evergreen_chip.c | 28 ++--------- src/mesa/drivers/dri/r600/evergreen_render.c | 66 ++++++++++++++------------ src/mesa/drivers/dri/r600/evergreen_vertprog.c | 6 +-- 3 files changed, 42 insertions(+), 58 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.c b/src/mesa/drivers/dri/r600/evergreen_chip.c index 5287a98c05..1662741823 100644 --- a/src/mesa/drivers/dri/r600/evergreen_chip.c +++ b/src/mesa/drivers/dri/r600/evergreen_chip.c @@ -275,7 +275,6 @@ static void evergreenSetupVTXConstants(GLcontext * ctx, { context_t *context = EVERGREEN_CONTEXT(ctx); struct radeon_aos * paos = (struct radeon_aos *)pAos; - unsigned int nVBsize; BATCH_LOCALS(&context->radeon); unsigned int uSQ_VTX_CONSTANT_WORD0_0; @@ -289,21 +288,11 @@ static void evergreenSetupVTXConstants(GLcontext * ctx, r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, VC_ACTION_ENA_bit); - if(0 == pStreamDesc->stride) - { - nVBsize = paos->count * pStreamDesc->size * getTypeSize(pStreamDesc->type); - } - else - { - nVBsize = (paos->count - 1) * pStreamDesc->stride - + pStreamDesc->size * getTypeSize(pStreamDesc->type); - } - //uSQ_VTX_CONSTANT_WORD0_0 uSQ_VTX_CONSTANT_WORD0_0 = paos->offset; //uSQ_VTX_CONSTANT_WORD1_0 - uSQ_VTX_CONSTANT_WORD1_0 = nVBsize; + uSQ_VTX_CONSTANT_WORD1_0 = paos->bo->size - paos->offset - 1; //uSQ_VTX_CONSTANT_WORD2_0 SETfield(uSQ_VTX_CONSTANT_WORD2_0, @@ -391,17 +380,6 @@ static void evergreenSendVTX(GLcontext *ctx, struct radeon_state_atom *atom) if (context->radeon.tcl.aos_count == 0) return; - BEGIN_BATCH_NO_AUTOSTATE(6); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 1)); - R600_OUT_BATCH(mmSQ_VTX_BASE_VTX_LOC - ASIC_CTL_CONST_BASE_INDEX); - R600_OUT_BATCH(0); - - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 1)); - R600_OUT_BATCH(mmSQ_VTX_START_INST_LOC - ASIC_CTL_CONST_BASE_INDEX); - R600_OUT_BATCH(0); - END_BATCH(); - COMMIT_BATCH(); - for(i=0; imesa_program->Base.InputsRead & (1 << i)) { @@ -410,7 +388,7 @@ static void evergreenSendVTX(GLcontext *ctx, struct radeon_state_atom *atom) &(context->stream_desc[j])); j++; } - } + } } static void evergreenSendPA(GLcontext *ctx, struct radeon_state_atom *atom) { @@ -1522,7 +1500,7 @@ void evergreenInitAtoms(context_t *context) context->radeon.hw.atomlist.name = "atom-list"; EVERGREEN_ALLOC_STATE(init, always, 19, evergreenSendSQConfig); - EVERGREEN_ALLOC_STATE(vtx, evergreen_vtx, (6 + (VERT_ATTRIB_MAX * 12)), evergreenSendVTX); + EVERGREEN_ALLOC_STATE(vtx, evergreen_vtx, (VERT_ATTRIB_MAX * 12), evergreenSendVTX); EVERGREEN_ALLOC_STATE(pa, always, 124, evergreenSendPA); EVERGREEN_ALLOC_STATE(tp, always, 0, evergreenSendTP); EVERGREEN_ALLOC_STATE(sq, always, 86, evergreenSendSQ); /* 85 */ diff --git a/src/mesa/drivers/dri/r600/evergreen_render.c b/src/mesa/drivers/dri/r600/evergreen_render.c index 85b2f9d6ab..27089bfcf7 100644 --- a/src/mesa/drivers/dri/r600/evergreen_render.c +++ b/src/mesa/drivers/dri/r600/evergreen_render.c @@ -148,7 +148,8 @@ static int evergreenNumVerts(int num_verts, int prim) //same return num_verts - verts_off; } -static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int prim) //same +static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int prim, + GLint basevertex) //same { context_t *context = EVERGREEN_CONTEXT(ctx); BATCH_LOCALS(&context->radeon); @@ -186,6 +187,7 @@ static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ + + 4 /* VTX_BASE_VTX_LOC + VTX_START_INST_LOC */ + 5 + 2; /* DRAW_INDEX */ BEGIN_BATCH_NO_AUTOSTATE(total_emit); @@ -198,6 +200,11 @@ static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int // num instances R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); R600_OUT_BATCH(1); + /* offset */ + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 2)); + R600_OUT_BATCH(mmSQ_VTX_BASE_VTX_LOC - ASIC_CTL_CONST_BASE_INDEX); + R600_OUT_BATCH(basevertex); //VTX_BASE_VTX_LOC + R600_OUT_BATCH(0); //VTX_START_INST_LOC // draw packet R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX, 3)); R600_OUT_BATCH(context->ind_buf.bo_offset); @@ -268,6 +275,7 @@ static void evergreenRunRenderPrimitiveImmediate(GLcontext * ctx, int start, int total_emit += 3 /* VGT_PRIMITIVE_TYPE */ + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ + + 4 /* VTX_BASE_VTX_LOC + VTX_START_INST_LOC */ + 3; /* DRAW */ BEGIN_BATCH_NO_AUTOSTATE(total_emit); @@ -280,6 +288,11 @@ static void evergreenRunRenderPrimitiveImmediate(GLcontext * ctx, int start, int // num instances R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); R600_OUT_BATCH(1); + /* offset */ + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 2)); + R600_OUT_BATCH(mmSQ_VTX_BASE_VTX_LOC - ASIC_CTL_CONST_BASE_INDEX); + R600_OUT_BATCH(0); //VTX_BASE_VTX_LOC + R600_OUT_BATCH(0); //VTX_START_INST_LOC // draw packet if(start == 0) { @@ -527,16 +540,16 @@ static GLuint evergreenPredictRenderSize(GLcontext* ctx, dwords = PRE_EMIT_STATE_BUFSZ; if (ib) - dwords += nr_prims * 14; + dwords += nr_prims * 18; else { for (i = 0; i < nr_prims; ++i) { if (prim[i].start == 0) - dwords += 10; + dwords += 14; else if (prim[i].count > 0xffff) - dwords += prim[i].count + 10; + dwords += prim[i].count + 14; else - dwords += ((prim[i].count + 1) / 2) + 10; + dwords += ((prim[i].count + 1) / 2) + 14; } } @@ -665,11 +678,11 @@ static void evergreenSetupStreams(GLcontext *ctx, const struct gl_client_array * stride = (input[i]->StrideB == 0) ? getTypeSize(input[i]->Type) * input[i]->Size : input[i]->StrideB; - if (input[i]->Type == GL_DOUBLE || input[i]->Type == GL_UNSIGNED_INT || input[i]->Type == GL_INT || + if (input[i]->Type == GL_DOUBLE || input[i]->Type == GL_UNSIGNED_INT || input[i]->Type == GL_INT #if MESA_BIG_ENDIAN - getTypeSize(input[i]->Type) != 4 || + || getTypeSize(input[i]->Type) != 4 #endif - stride < 4) + ) { evergreenConvertAttrib(ctx, count, input[i], &context->stream_desc[index]); } @@ -677,19 +690,10 @@ static void evergreenSetupStreams(GLcontext *ctx, const struct gl_client_array * { if (input[i]->BufferObj->Name) { - if (stride % 4 != 0) - { - assert(((intptr_t) input[i]->Ptr) % input[i]->StrideB == 0); - evergreenAlignDataToDword(ctx, input[i], count, &context->stream_desc[index]); - context->stream_desc[index].is_named_bo = GL_FALSE; - } - else - { - context->stream_desc[index].stride = input[i]->StrideB; - context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; - context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; - context->stream_desc[index].is_named_bo = GL_TRUE; - } + context->stream_desc[index].stride = input[i]->StrideB; + context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; + context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; + context->stream_desc[index].is_named_bo = GL_TRUE; } else { @@ -857,7 +861,8 @@ static GLboolean evergreenTryDrawPrims(GLcontext *ctx, evergreenRunRenderPrimitive(ctx, prim[i].start, prim[i].start + prim[i].count, - prim[i].mode); + prim[i].mode, + prim[i].basevertex); else evergreenRunRenderPrimitiveImmediate(ctx, prim[i].start, @@ -907,15 +912,16 @@ static void evergreenDrawPrims(GLcontext *ctx, /* This check should get folded into just the places that * min/max index are really needed. */ - if (!index_bounds_valid) { - vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); - } - - if (min_index) { - vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, evergreenDrawPrims ); - return; + if (!vbo_all_varyings_in_vbos(arrays)) { + if (!index_bounds_valid) + vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); + /* do we want to rebase, minimizes the + * amount of data to upload? */ + if (min_index) { + vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, evergreenDrawPrims ); + return; + } } - /* Make an attempt at drawing */ retval = evergreenTryDrawPrims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); diff --git a/src/mesa/drivers/dri/r600/evergreen_vertprog.c b/src/mesa/drivers/dri/r600/evergreen_vertprog.c index 6840fa3c86..0099cef527 100644 --- a/src/mesa/drivers/dri/r600/evergreen_vertprog.c +++ b/src/mesa/drivers/dri/r600/evergreen_vertprog.c @@ -459,11 +459,11 @@ static void evergreenTranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, co stride = (input->StrideB == 0) ? evergreen_getTypeSize(input->Type) * input->Size : input->StrideB; - if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT || + if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT #if MESA_BIG_ENDIAN - evergreen_getTypeSize(input->Type) != 4 || + || evergreen_getTypeSize(input->Type) != 4 #endif - stride < 4) + ) { pStreamDesc->type = GL_FLOAT; -- cgit v1.2.3 From efc4a6f7909dbf554ee440210233c4b0f89ac89e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 10:45:26 -0700 Subject: i965: Add gen6 attribute interpolation to new FS backend. Untested, since my hardware is not booting at the moment. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 42 +++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 78cdfed3fb..864c0b91e5 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -468,7 +468,8 @@ public: void emit_dummy_fs(); void emit_fragcoord_interpolation(ir_variable *ir); void emit_general_interpolation(ir_variable *ir); - void emit_interpolation_setup(); + void emit_interpolation_setup_gen4(); + void emit_interpolation_setup_gen6(); fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst, int base_mrf); fs_inst *emit_texture_gen5(ir_texture *ir, fs_reg dst, int base_mrf); void emit_fb_writes(); @@ -1662,7 +1663,7 @@ fs_visitor::interp_reg(int location, int channel) /** Emits the interpolation for the varying inputs. */ void -fs_visitor::emit_interpolation_setup() +fs_visitor::emit_interpolation_setup_gen4() { struct brw_reg g1_uw = retype(brw_vec1_grf(1, 0), BRW_REGISTER_TYPE_UW); @@ -1705,6 +1706,38 @@ fs_visitor::emit_interpolation_setup() this->current_annotation = NULL; } +/** Emits the interpolation for the varying inputs. */ +void +fs_visitor::emit_interpolation_setup_gen6() +{ + struct brw_reg g1_uw = retype(brw_vec1_grf(1, 0), BRW_REGISTER_TYPE_UW); + + /* If the pixel centers end up used, the setup is the same as for gen4. */ + this->current_annotation = "compute pixel centers"; + this->pixel_x = fs_reg(this, glsl_type::uint_type); + this->pixel_y = fs_reg(this, glsl_type::uint_type); + this->pixel_x.type = BRW_REGISTER_TYPE_UW; + this->pixel_y.type = BRW_REGISTER_TYPE_UW; + emit(fs_inst(BRW_OPCODE_ADD, + this->pixel_x, + fs_reg(stride(suboffset(g1_uw, 4), 2, 4, 0)), + fs_reg(brw_imm_v(0x10101010)))); + emit(fs_inst(BRW_OPCODE_ADD, + this->pixel_y, + fs_reg(stride(suboffset(g1_uw, 5), 2, 4, 0)), + fs_reg(brw_imm_v(0x11001100)))); + + this->current_annotation = "compute 1/pos.w"; + this->wpos_w = fs_reg(brw_vec8_grf(c->key.source_w_reg, 0)); + this->pixel_w = fs_reg(this, glsl_type::float_type); + emit(fs_inst(FS_OPCODE_RCP, this->pixel_w, wpos_w)); + + this->delta_x = fs_reg(brw_vec8_grf(2, 0)); + this->delta_y = fs_reg(brw_vec8_grf(3, 0)); + + this->current_annotation = NULL; +} + void fs_visitor::emit_fb_writes() { @@ -2614,7 +2647,10 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) if (0) { v.emit_dummy_fs(); } else { - v.emit_interpolation_setup(); + if (intel->gen < 6) + v.emit_interpolation_setup_gen4(); + else + v.emit_interpolation_setup_gen6(); /* Generate FS IR for main(). (the visitor only descends into * functions called "main"). -- cgit v1.2.3 From 354c40a62411262d1223f439fdaf2176ca9adbe9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 10:49:01 -0700 Subject: i965: Fix the gen6 jump size for BREAK/CONT in new FS. Since gen5, jumps are in increments of 64 bits instead of increments of 128-bit instructions. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 864c0b91e5..1968e7fde0 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2518,7 +2518,7 @@ fs_visitor::generate_code() struct brw_instruction *inst0, *inst1; GLuint br = 1; - if (intel->gen == 5) + if (intel->gen >= 5) br = 2; assert(loop_stack_depth > 0); -- cgit v1.2.3 From ff5ce9289b5159e7de34706b31be771d3e3cefd6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 11:44:27 -0700 Subject: i965: Also increment attribute location when skipping unused slots. Fixes glsl1-texcoord varying. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 1968e7fde0..9567141229 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -786,6 +786,7 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) * we'd fall over later trying to find the setup data. */ attr.reg_offset += type->vector_elements; + location++; continue; } -- cgit v1.2.3 From 8f63a44636e4fef2f35fe73f24c27db9b04389b1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 12:15:48 -0700 Subject: i965: Pre-gen6, map VS outputs (not FS inputs) to URB setup in the new FS. We should fix the SF to actually give us just the data we need, but this fixes regressions in the new FS until then. Fixes: glsl-kwin-blur glsl-routing --- src/mesa/drivers/dri/i965/brw_fs.cpp | 72 ++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 9567141229..9783e6170b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -450,6 +450,7 @@ public: fs_inst *emit(fs_inst inst); void assign_curb_setup(); + void calculate_urb_setup(); void assign_urb_setup(); void assign_regs(); void assign_regs_trivial(); @@ -499,6 +500,7 @@ public: struct hash_table *variable_ht; ir_variable *frag_color, *frag_data, *frag_depth; int first_non_payload_grf; + int urb_setup[FRAG_ATTRIB_MAX]; /** @{ debug annotation info */ const char *current_annotation; @@ -780,10 +782,9 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) int location = ir->location; for (unsigned int i = 0; i < array_elements; i++) { for (unsigned int j = 0; j < type->matrix_columns; j++) { - if (!(fp->Base.InputsRead & BITFIELD64_BIT(location))) { + if (urb_setup[location] == -1) { /* If there's no incoming setup data for this slot, don't - * emit interpolation for it (since it's not used, and - * we'd fall over later trying to find the setup data. + * emit interpolation for it. */ attr.reg_offset += type->vector_elements; location++; @@ -1656,9 +1657,11 @@ fs_visitor::emit_dummy_fs() struct brw_reg fs_visitor::interp_reg(int location, int channel) { - int regnr = location * 2 + channel / 2; + int regnr = urb_setup[location] * 2 + channel / 2; int stride = (channel & 1) * 4; + assert(urb_setup[location] != -1); + return brw_vec1_grf(regnr, stride); } @@ -2085,28 +2088,51 @@ fs_visitor::assign_curb_setup() } void -fs_visitor::assign_urb_setup() +fs_visitor::calculate_urb_setup() { - int urb_start = c->prog_data.first_curbe_grf + c->prog_data.curb_read_length; - int interp_reg_nr[FRAG_ATTRIB_MAX]; - - c->prog_data.urb_read_length = 0; + for (unsigned int i = 0; i < FRAG_ATTRIB_MAX; i++) { + urb_setup[i] = -1; + } + int urb_next = 0; /* Figure out where each of the incoming setup attributes lands. */ - for (unsigned int i = 0; i < FRAG_ATTRIB_MAX; i++) { - interp_reg_nr[i] = -1; + if (intel->gen >= 6) { + for (unsigned int i = 0; i < FRAG_ATTRIB_MAX; i++) { + if (i == FRAG_ATTRIB_WPOS || + (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(i))) { + urb_setup[i] = urb_next++; + } + } + } else { + /* FINISHME: The sf doesn't map VS->FS inputs for us very well. */ + for (unsigned int i = 0; i < VERT_RESULT_MAX; i++) { + if (c->key.vp_outputs_written & BITFIELD64_BIT(i)) { + int fp_index; + + if (i >= VERT_RESULT_VAR0) + fp_index = i - (VERT_RESULT_VAR0 - FRAG_ATTRIB_VAR0); + else if (i <= VERT_RESULT_TEX7) + fp_index = i; + else + fp_index = -1; + + if (fp_index >= 0) + urb_setup[fp_index] = urb_next++; + } + } + } - if (i != FRAG_ATTRIB_WPOS && - !(brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(i))) - continue; + /* Each attribute is 4 setup channels, each of which is half a reg. */ + c->prog_data.urb_read_length = urb_next * 2; +} - /* Each attribute is 4 setup channels, each of which is half a reg. */ - interp_reg_nr[i] = urb_start + c->prog_data.urb_read_length; - c->prog_data.urb_read_length += 2; - } +void +fs_visitor::assign_urb_setup() +{ + int urb_start = c->prog_data.first_curbe_grf + c->prog_data.curb_read_length; - /* Map the register numbers for FS_OPCODE_LINTERP so that it uses - * the correct setup input. + /* Offset all the urb_setup[] index by the actual position of the + * setup regs, now that the location of the constants has been chosen. */ foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); @@ -2116,10 +2142,7 @@ fs_visitor::assign_urb_setup() assert(inst->src[2].file == FIXED_HW_REG); - int location = inst->src[2].fixed_hw_reg.nr / 2; - assert(interp_reg_nr[location] != -1); - inst->src[2].fixed_hw_reg.nr = (interp_reg_nr[location] + - (inst->src[2].fixed_hw_reg.nr & 1)); + inst->src[2].fixed_hw_reg.nr += urb_start; } this->first_non_payload_grf = urb_start + c->prog_data.urb_read_length; @@ -2648,6 +2671,7 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) if (0) { v.emit_dummy_fs(); } else { + v.calculate_urb_setup(); if (intel->gen < 6) v.emit_interpolation_setup_gen4(); else -- cgit v1.2.3 From 92eb07a281d3b8748b5570d502c98aca654823de Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 1 Oct 2010 16:10:02 -0400 Subject: evergreen : fix z format setting, enable stencil. --- src/mesa/drivers/dri/r600/evergreen_chip.c | 48 +++++++++++++++++++++-------- src/mesa/drivers/dri/r600/evergreen_state.c | 44 ++++++++++++++++---------- 2 files changed, 62 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.c b/src/mesa/drivers/dri/r600/evergreen_chip.c index 1662741823..b591d5fa27 100644 --- a/src/mesa/drivers/dri/r600/evergreen_chip.c +++ b/src/mesa/drivers/dri/r600/evergreen_chip.c @@ -876,13 +876,13 @@ static void evergreenSetDepthTarget(context_t *context) if(4 == rrb->cpp) { - SETfield(evergreen->DB_Z_INFO.u32All, DEPTH_8_24, + SETfield(evergreen->DB_Z_INFO.u32All, EG_Z_24, EG_DB_Z_INFO__FORMAT_shift, EG_DB_Z_INFO__FORMAT_mask); } else { - SETfield(evergreen->DB_Z_INFO.u32All, DEPTH_16, + SETfield(evergreen->DB_Z_INFO.u32All, EG_Z_16, EG_DB_Z_INFO__FORMAT_shift, EG_DB_Z_INFO__FORMAT_mask); } @@ -896,6 +896,7 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_renderbuffer *rrb; + unsigned int zheight, zpitch, offtostencil; BATCH_LOCALS(&context->radeon); radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); @@ -949,17 +950,28 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) END_BATCH(); rrb = radeon_get_depthbuffer(&context->radeon); + + if (context->radeon.radeonScreen->driScreen->dri2.enabled) + { + zheight = rrb->base.Height; + } + else + { + zheight = context->radeon.radeonScreen->driScreen->fbHeight; + } + zpitch = rrb->pitch; + if( (rrb != NULL) && (rrb->bo != NULL) ) { /* make the hw happy */ BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_HTILE_DATA_BASE, evergreen->DB_HTILE_DATA_BASE.u32All); - R600_OUT_BATCH_RELOC(evergreen->DB_HTILE_DATA_BASE.u32All, + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_HTILE_DATA_BASE, evergreen->DB_HTILE_DATA_BASE.u32All); + R600_OUT_BATCH_RELOC(evergreen->DB_HTILE_DATA_BASE.u32All, rrb->bo, evergreen->DB_HTILE_DATA_BASE.u32All, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); + END_BATCH(); //5 BEGIN_BATCH_NO_AUTOSTATE(3 + 2); @@ -993,27 +1005,37 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) END_BATCH(); } } -/* + if (ctx->DrawBuffer) { rrb = radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); if((rrb != NULL) && (rrb->bo != NULL)) - { + { //5 BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_INFO, evergreen->DB_Z_INFO.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_INFO, evergreen->DB_STENCIL_INFO.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_INFO.u32All, rrb->bo, evergreen->DB_STENCIL_INFO.u32All, 0, RADEON_GEM_DOMAIN_VRAM, 0); END_BATCH(); + + //4 + BEGIN_BATCH_NO_AUTOSTATE(4); + R600_OUT_BATCH_REGSEQ(DB_STENCILREFMASK, 2); + R600_OUT_BATCH(evergreen->DB_STENCILREFMASK.u32All); + R600_OUT_BATCH(evergreen->DB_STENCILREFMASK_BF.u32All); + END_BATCH(); + //------------------------ //10 if((evergreen->DB_DEPTH_CONTROL.u32All & STENCIL_ENABLE_bit) > 0) { - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_READ_BASE, evergreen->DB_STENCIL_READ_BASE.u32All); + offtostencil = ((zheight * zpitch + 255) >> 8) & 0xffffffff; + + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_READ_BASE, offtostencil); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_READ_BASE.u32All, rrb->bo, evergreen->DB_STENCIL_READ_BASE.u32All, @@ -1021,7 +1043,7 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_WRITE_BASE, evergreen->DB_STENCIL_WRITE_BASE.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_WRITE_BASE, offtostencil); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_WRITE_BASE.u32All, rrb->bo, evergreen->DB_STENCIL_WRITE_BASE.u32All, @@ -1030,7 +1052,7 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) } } } -*/ + COMMIT_BATCH(); } @@ -1508,7 +1530,7 @@ void evergreenInitAtoms(context_t *context) EVERGREEN_ALLOC_STATE(spi, always, 59, evergreenSendSPI); EVERGREEN_ALLOC_STATE(sx, always, 9, evergreenSendSX); EVERGREEN_ALLOC_STATE(tx, evergreen_tx, (R700_TEXTURE_NUMBERUNITS * (21+5) + 6), evergreenSendTexState); /* 21 for resource, 5 for sampler */ - EVERGREEN_ALLOC_STATE(db, always, 65, evergreenSendDB); + EVERGREEN_ALLOC_STATE(db, always, 69, evergreenSendDB); EVERGREEN_ALLOC_STATE(cb, always, 37, evergreenSendCB); EVERGREEN_ALLOC_STATE(vgt, always, 29, evergreenSendVGT); diff --git a/src/mesa/drivers/dri/r600/evergreen_state.c b/src/mesa/drivers/dri/r600/evergreen_state.c index 931478caa5..69c5ab656e 100644 --- a/src/mesa/drivers/dri/r600/evergreen_state.c +++ b/src/mesa/drivers/dri/r600/evergreen_state.c @@ -703,24 +703,25 @@ static void evergreenSetDepthState(GLcontext * ctx) //same static void evergreenSetStencilState(GLcontext * ctx, GLboolean state) //same { - context_t *context = EVERGREEN_CONTEXT(ctx); - EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); - GLboolean hw_stencil = GL_FALSE; + context_t *context = EVERGREEN_CONTEXT(ctx); + EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); + GLboolean hw_stencil = GL_FALSE; - if (ctx->DrawBuffer) { - struct radeon_renderbuffer *rrbStencil - = radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); - hw_stencil = (rrbStencil && rrbStencil->bo); - } + if (ctx->DrawBuffer) { + struct radeon_renderbuffer *rrbStencil + = radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); + hw_stencil = (rrbStencil && rrbStencil->bo); + } - if (hw_stencil) { - EVERGREEN_STATECHANGE(context, db); - if (state) { - SETbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); - SETbit(evergreen->DB_DEPTH_CONTROL.u32All, BACKFACE_ENABLE_bit); - } else - CLEARbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); - } + if (hw_stencil) { + EVERGREEN_STATECHANGE(context, db); + if (state) { + SETbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); + SETbit(evergreen->DB_DEPTH_CONTROL.u32All, BACKFACE_ENABLE_bit); + SETbit(evergreen->DB_STENCIL_INFO.u32All, EG_DB_STENCIL_INFO__FORMAT_bit); + } else + CLEARbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); + } } static void evergreenUpdateCulling(GLcontext * ctx) //same @@ -1699,7 +1700,7 @@ void evergreenInitState(GLcontext * ctx) //diff evergreen->DB_STENCIL_INFO.u32All = 0; CLEARbit(evergreen->DB_STENCIL_INFO.u32All, EG_DB_STENCIL_INFO__FORMAT_bit); - SETfield(evergreen->DB_STENCIL_INFO.u32All, EG_ADDR_SURF_TILE_SPLIT_256B, + SETfield(evergreen->DB_STENCIL_INFO.u32All, 0, EG_DB_STENCIL_INFO__TILE_SPLIT_shift, EG_DB_STENCIL_INFO__TILE_SPLIT_mask); evergreen->DB_RENDER_CONTROL.u32All = 0; @@ -1709,6 +1710,15 @@ void evergreenInitState(GLcontext * ctx) //diff SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE1_shift, FORCE_HIS_ENABLE1_mask); + /* stencil */ + evergreenEnable(ctx, GL_STENCIL_TEST, ctx->Stencil._Enabled); + evergreenStencilMaskSeparate(ctx, 0, ctx->Stencil.WriteMask[0]); + evergreenStencilFuncSeparate(ctx, 0, ctx->Stencil.Function[0], + ctx->Stencil.Ref[0], ctx->Stencil.ValueMask[0]); + evergreenStencilOpSeparate(ctx, 0, ctx->Stencil.FailFunc[0], + ctx->Stencil.ZFailFunc[0], + ctx->Stencil.ZPassFunc[0]); + // Disable ROP3 modes by setting src to dst copy: SETfield(evergreen->CB_COLOR_CONTROL.u32All, 0xCC, EG_CB_COLOR_CONTROL__ROP3_shift, -- cgit v1.2.3 From bfd9715c3c9d40b3f937638073ff2f0969ebd143 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 13:37:40 -0700 Subject: i965: Add real support for pre-gen5 texture sampling to the new FS. Fixes 36 testcases, including glsl-fs-shadow2d*-bias which fail on the Mesa IR backend. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 122 ++++++++++++++++++++++++++++------- 1 file changed, 98 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 9783e6170b..99f50b91e1 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -471,8 +471,8 @@ public: void emit_general_interpolation(ir_variable *ir); void emit_interpolation_setup_gen4(); void emit_interpolation_setup_gen6(); - fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst, int base_mrf); - fs_inst *emit_texture_gen5(ir_texture *ir, fs_reg dst, int base_mrf); + fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst, fs_reg coordinate); + fs_inst *emit_texture_gen5(ir_texture *ir, fs_reg dst, fs_reg coordinate); void emit_fb_writes(); void emit_assignment_writes(fs_reg &l, fs_reg &r, const glsl_type *type, bool predicated); @@ -1226,12 +1226,23 @@ fs_visitor::visit(ir_assignment *ir) } fs_inst * -fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, int base_mrf) +fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, fs_reg coordinate) { - /* gen4's SIMD8 sampler always has the slots for u,v,r present. */ - int mlen = 3; + int mlen; + int base_mrf = 2; + bool simd16 = false; + fs_reg orig_dst; if (ir->shadow_comparitor) { + for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + coordinate)); + coordinate.reg_offset++; + mlen++; + } + /* gen4's SIMD8 sampler always has the slots for u,v,r present. */ + mlen = 3; + if (ir->op == ir_tex) { /* There's no plain shadow compare message, so we use shadow * compare with a bias of 0.0. @@ -1255,11 +1266,57 @@ fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, int base_mrf) ir->shadow_comparitor->accept(this); emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); mlen++; + } else if (ir->op == ir_tex) { + for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + coordinate)); + coordinate.reg_offset++; + } + /* gen4's SIMD8 sampler always has the slots for u,v,r present. */ + mlen = 3; } else { - /* Oh joy. gen4 doesn't have SIMD8 non-shadow-compare sampler + /* Oh joy. gen4 doesn't have SIMD8 non-shadow-compare bias/lod * instructions. We'll need to do SIMD16 here. */ - abort(); + assert(ir->op == ir_txb || ir->op == ir_txl); + + for (mlen = 0; mlen < ir->coordinate->type->vector_elements * 2;) { + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + coordinate)); + coordinate.reg_offset++; + mlen++; + + /* The unused upper half. */ + mlen++; + } + + /* lod/bias appears after u/v/r. */ + mlen = 6; + + if (ir->op == ir_txb) { + ir->lod_info.bias->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + this->result)); + mlen++; + } else { + ir->lod_info.lod->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), + this->result)); + mlen++; + } + + /* The unused upper half. */ + mlen++; + + /* Now, since we're doing simd16, the return is 2 interleaved + * vec4s where the odd-indexed ones are junk. We'll need to move + * this weirdness around to the expected layout. + */ + simd16 = true; + orig_dst = dst; + dst = fs_reg(this, glsl_type::get_array_instance(glsl_type::vec4_type, + 2)); + dst.type = BRW_REGISTER_TYPE_F; } fs_inst *inst = NULL; @@ -1280,11 +1337,19 @@ fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, int base_mrf) } inst->mlen = mlen; + if (simd16) { + for (int i = 0; i < 4; i++) { + emit(fs_inst(BRW_OPCODE_MOV, orig_dst, dst)); + orig_dst.reg_offset++; + dst.reg_offset += 2; + } + } + return inst; } fs_inst * -fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, int base_mrf) +fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, fs_reg coordinate) { /* gen5's SIMD8 sampler has slots for u, v, r, array index, then * optional parameters like shadow comparitor or LOD bias. If @@ -1294,7 +1359,14 @@ fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, int base_mrf) * We don't fill in the unnecessary slots regardless, which may * look surprising in the disassembly. */ - int mlen = ir->coordinate->type->vector_elements; + int mlen; + int base_mrf = 2; + + for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); + coordinate.reg_offset++; + mlen++; + } if (ir->shadow_comparitor) { mlen = MAX2(mlen, 4); @@ -1338,9 +1410,7 @@ fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, int base_mrf) void fs_visitor::visit(ir_texture *ir) { - int base_mrf = 2; fs_inst *inst = NULL; - unsigned int mlen = 0; ir->coordinate->accept(this); fs_reg coordinate = this->result; @@ -1348,20 +1418,15 @@ fs_visitor::visit(ir_texture *ir) /* Should be lowered by do_lower_texture_projection */ assert(!ir->projector); - for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { - emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); - coordinate.reg_offset++; - } - /* Writemasking doesn't eliminate channels on SIMD8 texture * samples, so don't worry about them. */ fs_reg dst = fs_reg(this, glsl_type::vec4_type); if (intel->gen < 5) { - inst = emit_texture_gen4(ir, dst, base_mrf); + inst = emit_texture_gen4(ir, dst, coordinate); } else { - inst = emit_texture_gen5(ir, dst, base_mrf); + inst = emit_texture_gen5(ir, dst, coordinate); } inst->sampler = @@ -1919,6 +1984,7 @@ fs_visitor::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src) { int msg_type = -1; int rlen = 4; + uint32_t simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD8; if (intel->gen == 5) { switch (inst->opcode) { @@ -1943,24 +2009,32 @@ fs_visitor::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src) /* Note that G45 and older determines shadow compare and dispatch width * from message length for most messages. */ + msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE; if (inst->shadow_compare) { - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE; + assert(inst->mlen == 5); } else { - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE; + assert(inst->mlen <= 6); } + break; case FS_OPCODE_TXB: if (inst->shadow_compare) { - assert(!"FINISHME: shadow compare with bias."); - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; + assert(inst->mlen == 5); + msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE; } else { + assert(inst->mlen == 8); msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; - rlen = 8; + simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD16; } break; } } assert(msg_type != -1); + if (simd_mode == BRW_SAMPLER_SIMD_MODE_SIMD16) { + rlen = 8; + dst = vec16(dst); + } + /* g0 header. */ src.nr--; @@ -1976,7 +2050,7 @@ fs_visitor::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src) inst->mlen + 1, 0, 1, - BRW_SAMPLER_SIMD_MODE_SIMD8); + simd_mode); } -- cgit v1.2.3 From e9bcc8328968f05a5688a020bfa8165260865a9b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 14:09:00 -0700 Subject: i965: Fix up copy'n'pasteo from moving coordinate setup around for gen4. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 99f50b91e1..4c8aafb254 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1238,7 +1238,6 @@ fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, fs_reg coordinate) emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); coordinate.reg_offset++; - mlen++; } /* gen4's SIMD8 sampler always has the slots for u,v,r present. */ mlen = 3; @@ -1365,7 +1364,6 @@ fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, fs_reg coordinate) for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); coordinate.reg_offset++; - mlen++; } if (ir->shadow_comparitor) { -- cgit v1.2.3 From 3ebbc176f9200ac954d461758937e755220ac551 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Sep 2010 11:11:43 -0700 Subject: ARB_texture_rg: Correct some errors in RED / RG internal format handling Fixes several problems: The half-float, float, and integer internal formats depend on ARB_texture_rg and other extensions. RG_INTEGER is not a valid internal format. Generic compressed formats depend on ARB_texture_rg, not EXT_texture_compression_rgtc. Use GL_RED instead of GL_R. --- src/mesa/main/teximage.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 614f0014da..28d370eb65 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -403,29 +403,54 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) if (ctx->Extensions.ARB_texture_rg) { switch (internalFormat) { - case GL_R8: - case GL_R16: case GL_R16F: + /* R16F depends on both ARB_half_float_pixel and ARB_texture_float. + */ + if (!ctx->Extensions.ARB_half_float_pixel) + break; + /* FALLTHROUGH */ case GL_R32F: + if (!ctx->Extensions.ARB_texture_float) + break; + return GL_RED; case GL_R8I: case GL_R8UI: case GL_R16I: case GL_R16UI: case GL_R32I: case GL_R32UI: - return GL_R; - case GL_RG: - case GL_RG_INTEGER: - case GL_RG8: - case GL_RG16: + if (!ctx->Extensions.EXT_texture_integer) + break; + /* FALLTHROUGH */ + case GL_R8: + case GL_R16: + case GL_RED: + case GL_COMPRESSED_RED: + return GL_RED; + case GL_RG16F: + /* RG16F depends on both ARB_half_float_pixel and ARB_texture_float. + */ + if (!ctx->Extensions.ARB_half_float_pixel) + break; + /* FALLTHROUGH */ case GL_RG32F: + if (!ctx->Extensions.ARB_texture_float) + break; + return GL_RG; case GL_RG8I: case GL_RG8UI: case GL_RG16I: case GL_RG16UI: case GL_RG32I: case GL_RG32UI: + if (!ctx->Extensions.EXT_texture_integer) + break; + /* FALLTHROUGH */ + case GL_RG: + case GL_RG8: + case GL_RG16: + case GL_COMPRESSED_RG: return GL_RG; default: ; /* fallthrough */ @@ -463,11 +488,9 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) if (ctx->Extensions.EXT_texture_compression_rgtc) { switch (internalFormat) { - case GL_COMPRESSED_RED: case GL_COMPRESSED_RED_RGTC1_EXT: case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT: return GL_RED; - case GL_COMPRESSED_RG: case GL_COMPRESSED_RED_GREEN_RGTC2_EXT: case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: return GL_RG; -- cgit v1.2.3 From cc6f13def53eb280b63427fbdeca197a09315062 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Sep 2010 11:17:27 -0700 Subject: ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support --- src/mesa/main/texparam.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 187049c070..58d785812e 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -870,7 +870,17 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Border; break; case GL_TEXTURE_RED_SIZE: + if (img->_BaseFormat == GL_RED) { + *params = _mesa_get_format_bits(texFormat, pname); + break; + } + /* FALLTHROUGH */ case GL_TEXTURE_GREEN_SIZE: + if (img->_BaseFormat == GL_RG) { + *params = _mesa_get_format_bits(texFormat, pname); + break; + } + /* FALLTHROUGH */ case GL_TEXTURE_BLUE_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) *params = _mesa_get_format_bits(texFormat, pname); -- cgit v1.2.3 From cd5dea640144b45ba2e88c2451f1f01ee08c1c4a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Sep 2010 13:50:34 -0700 Subject: ARB_texture_rg: Add GL_RED as a valid GL_DEPTH_TEXTURE_MODE --- src/mesa/main/texparam.c | 3 ++- src/mesa/swrast/s_texfilter.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 58d785812e..e96ace7340 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -351,7 +351,8 @@ set_tex_parameteri(GLcontext *ctx, if (ctx->Extensions.ARB_depth_texture && (params[0] == GL_LUMINANCE || params[0] == GL_INTENSITY || - params[0] == GL_ALPHA)) { + params[0] == GL_ALPHA || + (ctx->Extensions.ARB_texture_rg && params[0] == GL_RED))) { if (texObj->DepthMode != params[0]) { flush(ctx, texObj); texObj->DepthMode = params[0]; diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 1aa2bcaf74..de694c31bf 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -3051,6 +3051,9 @@ sample_depth_texture( GLcontext *ctx, case GL_ALPHA: ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result); break; + case GL_RED: + ASSIGN_4V(texel[i], result, 0.0F, 0.0F, 1.0F); + break; default: _mesa_problem(ctx, "Bad depth texture mode"); } -- cgit v1.2.3 From 214a33f6104511bc163fdb964161d264e67090d3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Sep 2010 13:58:28 -0700 Subject: ARB_texture_rg: Handle RED and RG the same as RGB for tex env --- src/mesa/main/texstate.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index dae173d1bd..30c978c1cd 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -179,6 +179,8 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, break; case GL_LUMINANCE: + case GL_RED: + case GL_RG: case GL_RGB: case GL_YCBCR_MESA: case GL_DUDV_ATI: @@ -219,6 +221,8 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, case GL_INTENSITY: state->SourceRGB[0] = GL_PREVIOUS; break; + case GL_RED: + case GL_RG: case GL_RGB: case GL_YCBCR_MESA: case GL_DUDV_ATI: @@ -244,6 +248,8 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, state->OperandA[2] = GL_SRC_ALPHA; /* FALLTHROUGH */ case GL_LUMINANCE: + case GL_RED: + case GL_RG: case GL_RGB: case GL_LUMINANCE_ALPHA: case GL_RGBA: -- cgit v1.2.3 From 5d1387b2da3626326410804026f8b92f1a121fdc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Sep 2010 17:24:39 -0700 Subject: ARB_texture_rg: Add R8, R16, RG88, and RG1616 internal formats --- src/mesa/main/formats.c | 80 +++++++++++++++++++++ src/mesa/main/formats.h | 6 ++ src/mesa/main/image.c | 88 +++++++++++++++++++++++ src/mesa/main/readpix.c | 1 + src/mesa/main/texfetch.c | 42 +++++++++++ src/mesa/main/texfetch_tmp.h | 144 ++++++++++++++++++++++++++++++++++++++ src/mesa/main/texformat.c | 23 +++++++ src/mesa/main/texstore.c | 161 +++++++++++++++++++++++++++++++++++-------- 8 files changed, 515 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 9db9f1c56e..a82aa9c6a0 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -320,6 +320,60 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 2 /* BlockWidth/Height,Bytes */ }, + { + MESA_FORMAT_R8, + "MESA_FORMAT_R8", + GL_RED, + GL_UNSIGNED_NORMALIZED, + 8, 0, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 1 + }, + { + MESA_FORMAT_RG88, + "MESA_FORMAT_RG88", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_RG88_REV, + "MESA_FORMAT_RG88_REV", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_R16, + "MESA_FORMAT_R16", + GL_RED, + GL_UNSIGNED_NORMALIZED, + 16, 0, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_RG1616, + "MESA_FORMAT_RG1616", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 16, 16, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_RG1616_REV, + "MESA_FORMAT_RG1616_REV", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 16, 16, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, { MESA_FORMAT_Z24_S8, /* Name */ "MESA_FORMAT_Z24_S8", /* StrName */ @@ -1073,6 +1127,22 @@ _mesa_test_formats(void) assert(info->LuminanceBits == 0); assert(info->IntensityBits == 0); } + else if (info->BaseFormat == GL_RG) { + assert(info->RedBits > 0); + assert(info->GreenBits > 0); + assert(info->BlueBits == 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits == 0); + } + else if (info->BaseFormat == GL_RED) { + assert(info->RedBits > 0); + assert(info->GreenBits == 0); + assert(info->BlueBits == 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits == 0); + } else if (info->BaseFormat == GL_LUMINANCE) { assert(info->RedBits == 0); assert(info->GreenBits == 0); @@ -1137,16 +1207,25 @@ _mesa_format_to_type_and_comps(gl_format format, case MESA_FORMAT_AL88: case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_RG88: + case MESA_FORMAT_RG88_REV: *datatype = GL_UNSIGNED_BYTE; *comps = 2; return; case MESA_FORMAT_AL1616: case MESA_FORMAT_AL1616_REV: + case MESA_FORMAT_RG1616: + case MESA_FORMAT_RG1616_REV: *datatype = GL_UNSIGNED_SHORT; *comps = 2; return; + case MESA_FORMAT_R16: + *datatype = GL_UNSIGNED_SHORT; + *comps = 1; + return; + case MESA_FORMAT_RGB332: *datatype = GL_UNSIGNED_BYTE_3_3_2; *comps = 3; @@ -1156,6 +1235,7 @@ _mesa_format_to_type_and_comps(gl_format format, case MESA_FORMAT_L8: case MESA_FORMAT_I8: case MESA_FORMAT_CI8: + case MESA_FORMAT_R8: *datatype = GL_UNSIGNED_BYTE; *comps = 1; return; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index e9467f486b..7674d8eaa4 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -76,6 +76,12 @@ typedef enum MESA_FORMAT_CI8, /* CCCC CCCC */ MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ + MESA_FORMAT_R8, /* RRRR RRRR */ + MESA_FORMAT_RG88, /* RRRR RRRR GGGG GGGG */ + MESA_FORMAT_RG88_REV, /* GGGG GGGG RRRR RRRR */ + 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_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 */ diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 029d2fef8a..1992c7448b 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -286,6 +286,7 @@ _mesa_components_in_format( GLenum format ) return 1; case GL_LUMINANCE_ALPHA: case GL_LUMINANCE_ALPHA_INTEGER_EXT: + case GL_RG: return 2; case GL_RGB: case GL_RGB_INTEGER_EXT: @@ -428,6 +429,24 @@ _mesa_is_legal_format_and_type( GLcontext *ctx, GLenum format, GLenum type ) case GL_LUMINANCE: case GL_LUMINANCE_ALPHA: case GL_DEPTH_COMPONENT: + switch (type) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + return GL_TRUE; + case GL_HALF_FLOAT_ARB: + return ctx->Extensions.ARB_half_float_pixel; + default: + return GL_FALSE; + } + case GL_RG: + if (!ctx->Extensions.ARB_texture_rg) + return GL_FALSE; + switch (type) { case GL_BYTE: case GL_UNSIGNED_BYTE: @@ -596,6 +615,11 @@ _mesa_is_color_format(GLenum format) case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: + case GL_R8: + case GL_R16: + case GL_RG: + case GL_RG8: + case GL_RG16: case 3: case GL_RGB: case GL_BGR: @@ -626,6 +650,10 @@ _mesa_is_color_format(GLenum format) case GL_LUMINANCE_ALPHA32F_ARB: case GL_INTENSITY16F_ARB: case GL_INTENSITY32F_ARB: + case GL_R16F: + case GL_R32F: + case GL_RG16F: + case GL_RG32F: case GL_RGB16F_ARB: case GL_RGB32F_ARB: case GL_RGBA16F_ARB: @@ -1585,6 +1613,25 @@ _mesa_lookup_rgba_float(const struct gl_color_table *table, rgba[i][ACOMP] = alpha;; } break; + case GL_RED: + /* replace RGB with RGB */ + for (i = 0; i < n; i++) { + GLint jR = IROUND(rgba[i][RCOMP] * scale); + jR = CLAMP(jR, 0, max); + rgba[i][RCOMP] = lut[jR * 3 + 0]; + } + break; + case GL_RG: + /* replace RG with RG */ + for (i = 0; i < n; i++) { + GLint jR = IROUND(rgba[i][RCOMP] * scale); + GLint jG = IROUND(rgba[i][GCOMP] * scale); + jR = CLAMP(jR, 0, max); + jG = CLAMP(jG, 0, max); + rgba[i][RCOMP] = lut[jR * 3 + 0]; + rgba[i][GCOMP] = lut[jG * 3 + 1]; + } + break; case GL_RGB: /* replace RGB with RGB */ for (i = 0; i < n; i++) { @@ -3201,6 +3248,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4], srcFormat == GL_LUMINANCE || srcFormat == GL_LUMINANCE_ALPHA || srcFormat == GL_INTENSITY || + srcFormat == GL_RG || srcFormat == GL_RGB || srcFormat == GL_BGR || srcFormat == GL_RGBA || @@ -3283,6 +3331,18 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4], redIndex = greenIndex = blueIndex = alphaIndex = 0; stride = 1; break; + case GL_RG: + case GL_RG_INTEGER: + redIndex = 0; + greenIndex = 1; + blueIndex = -1; + alphaIndex = -1; + rComp = 0; + gComp = 1; + bComp = 2; + aComp = 3; + stride = 2; + break; case GL_RGB: case GL_RGB_INTEGER: redIndex = 0; @@ -3852,6 +3912,8 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA || dstFormat == GL_INTENSITY || + dstFormat == GL_RED || + dstFormat == GL_RG || dstFormat == GL_RGB || dstFormat == GL_RGBA || dstFormat == GL_COLOR_INDEX); @@ -3863,6 +3925,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, srcFormat == GL_LUMINANCE || srcFormat == GL_LUMINANCE_ALPHA || srcFormat == GL_INTENSITY || + srcFormat == GL_RG || srcFormat == GL_RGB || srcFormat == GL_BGR || srcFormat == GL_RGBA || @@ -4090,6 +4153,17 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1; dstLuminanceIndex = -1; break; + case GL_RED: + dstRedIndex = 0; + dstGreenIndex = dstBlueIndex = -1; + dstAlphaIndex = dstLuminanceIndex = dstIntensityIndex = -1; + break; + case GL_RG: + dstRedIndex = 0; + dstGreenIndex = 1; + dstBlueIndex = -1; + dstAlphaIndex = dstLuminanceIndex = dstIntensityIndex = -1; + break; case GL_RGB: dstRedIndex = 0; dstGreenIndex = 1; @@ -4188,6 +4262,8 @@ _mesa_unpack_color_span_float( GLcontext *ctx, dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA || dstFormat == GL_INTENSITY || + dstFormat == GL_RED || + dstFormat == GL_RG || dstFormat == GL_RGB || dstFormat == GL_RGBA || dstFormat == GL_COLOR_INDEX); @@ -4199,6 +4275,7 @@ _mesa_unpack_color_span_float( GLcontext *ctx, srcFormat == GL_LUMINANCE || srcFormat == GL_LUMINANCE_ALPHA || srcFormat == GL_INTENSITY || + srcFormat == GL_RG || srcFormat == GL_RGB || srcFormat == GL_BGR || srcFormat == GL_RGBA || @@ -4315,6 +4392,17 @@ _mesa_unpack_color_span_float( GLcontext *ctx, dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1; dstLuminanceIndex = -1; break; + case GL_RED: + dstRedIndex = 0; + dstGreenIndex = dstBlueIndex = -1; + dstAlphaIndex = dstLuminanceIndex = dstIntensityIndex = -1; + break; + case GL_RG: + dstRedIndex = 0; + dstGreenIndex = 1; + dstBlueIndex = -1; + dstAlphaIndex = dstLuminanceIndex = dstIntensityIndex = -1; + break; case GL_RGB: dstRedIndex = 0; dstGreenIndex = 1; diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 93f2bd31cc..bb3fb9eb66 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -66,6 +66,7 @@ _mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, /* additional checks */ switch (format) { + case GL_RG: case GL_RED: case GL_GREEN: case GL_BLUE: diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index c03bc71cd7..aa3a6961b6 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -313,6 +313,48 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_f_ycbcr_rev, store_texel_ycbcr_rev }, + { + MESA_FORMAT_R8, + fetch_texel_1d_f_r8, + fetch_texel_2d_f_r8, + fetch_texel_3d_f_r8, + store_texel_r8, + }, + { + MESA_FORMAT_RG88, + fetch_texel_1d_f_rg88, + fetch_texel_2d_f_rg88, + fetch_texel_3d_f_rg88, + store_texel_rg88, + }, + { + MESA_FORMAT_RG88_REV, + fetch_texel_1d_f_rg88_rev, + fetch_texel_2d_f_rg88_rev, + fetch_texel_3d_f_rg88_rev, + store_texel_rg88_rev, + }, + { + MESA_FORMAT_R16, + fetch_texel_1d_f_r16, + fetch_texel_2d_f_r16, + fetch_texel_3d_f_r16, + store_texel_r16, + }, + { + MESA_FORMAT_RG1616, + fetch_texel_1d_f_rg1616, + fetch_texel_2d_f_rg1616, + fetch_texel_3d_f_rg1616, + store_texel_rg1616, + }, + { + MESA_FORMAT_RG1616_REV, + fetch_texel_1d_f_rg1616_rev, + fetch_texel_2d_f_rg1616_rev, + fetch_texel_3d_f_rg1616_rev, + store_texel_rg1616_rev, + }, { MESA_FORMAT_Z24_S8, fetch_texel_1d_f_z24_s8, diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index f943554370..2f583ed522 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -810,6 +810,54 @@ static void store_texel_argb1555_rev(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_RG88 **********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */ +static void FETCH(f_rg88)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( s & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( s >> 8 ); + texel[BCOMP] = 0.0; + texel[ACOMP] = 1.0; +} + +#if DIM == 3 +static void store_texel_rg88(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_88(rgba[RCOMP], rgba[GCOMP]); +} +#endif + + +/* MESA_FORMAT_RG88_REV ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D rg88_rev texture, return 4 GLchans */ +static void FETCH(f_rg88_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( s & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( s >> 8 ); + texel[BCOMP] = 0.0; + texel[ACOMP] = 1.0; +} + +#if DIM == 3 +static void store_texel_rg88_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_88(rgba[GCOMP], rgba[RCOMP]); +} +#endif + + /* MESA_FORMAT_AL88 **********************************************************/ /* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ @@ -834,6 +882,54 @@ static void store_texel_al88(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_R8 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */ +static void FETCH(f_r8)(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] = UBYTE_TO_FLOAT(s); + texel[GCOMP] = 0.0; + texel[BCOMP] = 0.0; + texel[ACOMP] = 1.0; +} + +#if DIM == 3 +static void store_texel_r8(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 = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_R16 ***********************************************************/ + +/* Fetch texel from 1D, 2D or 3D r16 texture, return 4 GLchans */ +static void FETCH(f_r16)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = USHORT_TO_FLOAT(s); + texel[GCOMP] = 0.0; + texel[BCOMP] = 0.0; + texel[ACOMP] = 1.0; +} + +#if DIM == 3 +static void store_texel_r16(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_AL88_REV ******************************************************/ /* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ @@ -858,6 +954,54 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_RG1616 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rg1616 texture, return 4 GLchans */ +static void FETCH(f_rg1616)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = USHORT_TO_FLOAT( s & 0xffff ); + texel[GCOMP] = USHORT_TO_FLOAT( s >> 16 ); + texel[BCOMP] = 0.0; + texel[ACOMP] = 1.0; +} + +#if DIM == 3 +static void store_texel_rg1616(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_1616(rgba[RCOMP], rgba[GCOMP]); +} +#endif + + +/* MESA_FORMAT_RG1616_REV ****************************************************/ + +/* Fetch texel from 1D, 2D or 3D rg1616_rev texture, return 4 GLchans */ +static void FETCH(f_rg1616_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = USHORT_TO_FLOAT( s >> 16 ); + texel[GCOMP] = USHORT_TO_FLOAT( s & 0xffff ); + texel[BCOMP] = 0.0; + texel[ACOMP] = 1.0; +} + +#if DIM == 3 +static void store_texel_rg1616_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_1616(rgba[GCOMP], rgba[RCOMP]); +} +#endif + + /* MESA_FORMAT_AL1616 ********************************************************/ /* Fetch texel from 1D, 2D or 3D al1616 texture, return 4 GLchans */ diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index b9271ef58e..24efb108bb 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -429,6 +429,29 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } } + if (ctx->Extensions.ARB_texture_rg) { + switch (internalFormat) { + case GL_R8: + case GL_RED: + case GL_COMPRESSED_RED: + return MESA_FORMAT_R8; + + case GL_R16: + return MESA_FORMAT_R16; + + case GL_RG: + case GL_RG8: + case GL_COMPRESSED_RG: + return MESA_FORMAT_RG88; + + case GL_RG16: + return MESA_FORMAT_RG1616; + + default: + ; /* fallthrough */ + } + } + _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()"); return MESA_FORMAT_NONE; } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index a1574e6cd8..5ca36d955e 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -99,6 +99,7 @@ can_swizzle(GLenum logicalBaseFormat) case GL_BGR: case GL_BGRA: case GL_ABGR_EXT: + case GL_RG: return GL_TRUE; default: return GL_FALSE; @@ -120,6 +121,7 @@ enum { IDX_BGR, IDX_BGRA, IDX_ABGR, + IDX_RG, MAX_IDX }; @@ -207,6 +209,12 @@ static const struct { MAP4(3,2,1,0), MAP4(3,2,1,0) }, + + { + IDX_RG, + MAP4(0, 1, ZERO, ONE), + MAP2(0, 1) + }, }; @@ -230,6 +238,7 @@ get_map_idx(GLenum value) case GL_BGR: return IDX_BGR; case GL_BGRA: return IDX_BGRA; case GL_ABGR_EXT: return IDX_ABGR; + case GL_RG: return IDX_RG; default: _mesa_problem(NULL, "Unexpected inFormat"); return 0; @@ -319,6 +328,8 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, ASSERT(logicalBaseFormat == GL_RGBA || logicalBaseFormat == GL_RGB || + logicalBaseFormat == GL_RG || + logicalBaseFormat == GL_RED || logicalBaseFormat == GL_LUMINANCE_ALPHA || logicalBaseFormat == GL_LUMINANCE || logicalBaseFormat == GL_ALPHA || @@ -328,6 +339,8 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, ASSERT(textureBaseFormat == GL_RGBA || textureBaseFormat == GL_RGB || + textureBaseFormat == GL_RG || + textureBaseFormat == GL_RED || textureBaseFormat == GL_LUMINANCE_ALPHA || textureBaseFormat == GL_LUMINANCE || textureBaseFormat == GL_ALPHA || @@ -445,6 +458,8 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, ASSERT(logicalBaseFormat == GL_RGBA || logicalBaseFormat == GL_RGB || + logicalBaseFormat == GL_RG || + logicalBaseFormat == GL_RED || logicalBaseFormat == GL_LUMINANCE_ALPHA || logicalBaseFormat == GL_LUMINANCE || logicalBaseFormat == GL_ALPHA || @@ -452,6 +467,8 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, ASSERT(textureBaseFormat == GL_RGBA || textureBaseFormat == GL_RGB || + textureBaseFormat == GL_RG || + textureBaseFormat == GL_RED || textureBaseFormat == GL_LUMINANCE_ALPHA || textureBaseFormat == GL_LUMINANCE || textureBaseFormat == GL_ALPHA || @@ -1907,21 +1924,22 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) static GLboolean -_mesa_texstore_al88(TEXSTORE_PARAMS) +_mesa_texstore_unorm88(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_AL88 || - dstFormat == MESA_FORMAT_AL88_REV); + dstFormat == MESA_FORMAT_AL88_REV || + dstFormat == MESA_FORMAT_RG88 || + dstFormat == MESA_FORMAT_RG88_REV); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_AL88 && - baseInternalFormat == GL_LUMINANCE_ALPHA && - srcFormat == GL_LUMINANCE_ALPHA && + (dstFormat == MESA_FORMAT_AL88 || dstFormat == MESA_FORMAT_RG88) && + baseInternalFormat == srcFormat && srcType == GL_UNSIGNED_BYTE && littleEndian) { /* simple memcpy path */ @@ -1942,14 +1960,27 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == MESA_FORMAT_AL88) || - (!littleEndian && dstFormat == MESA_FORMAT_AL88_REV)) { - dstmap[0] = 0; - dstmap[1] = 3; + if (dstFormat == MESA_FORMAT_AL88 || dstFormat == MESA_FORMAT_AL88_REV) { + if ((littleEndian && dstFormat == MESA_FORMAT_AL88) || + (!littleEndian && dstFormat == MESA_FORMAT_AL88_REV)) { + dstmap[0] = 0; + dstmap[1] = 3; + } + else { + dstmap[0] = 3; + dstmap[1] = 0; + } } else { - dstmap[0] = 3; - dstmap[1] = 0; + if ((littleEndian && dstFormat == MESA_FORMAT_RG88) || + (!littleEndian && dstFormat == MESA_FORMAT_RG88_REV)) { + dstmap[0] = 0; + dstmap[1] = 1; + } + else { + dstmap[0] = 1; + dstmap[1] = 0; + } } dstmap[2] = ZERO; /* ? */ dstmap[3] = ONE; /* ? */ @@ -1983,7 +2014,8 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == MESA_FORMAT_AL88) { + if (dstFormat == MESA_FORMAT_AL88 || + dstFormat == MESA_FORMAT_RG88) { for (col = 0; col < srcWidth; col++) { /* src[0] is luminance, src[1] is alpha */ dstUS[col] = PACK_COLOR_88( CHAN_TO_UBYTE(src[1]), @@ -2009,21 +2041,22 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) static GLboolean -_mesa_texstore_al1616(TEXSTORE_PARAMS) +_mesa_texstore_unorm1616(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_AL1616 || - dstFormat == MESA_FORMAT_AL1616_REV); + dstFormat == MESA_FORMAT_AL1616_REV || + dstFormat == MESA_FORMAT_RG1616 || + dstFormat == MESA_FORMAT_RG1616_REV); ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_AL1616 && - baseInternalFormat == GL_LUMINANCE_ALPHA && - srcFormat == GL_LUMINANCE_ALPHA && + (dstFormat == MESA_FORMAT_AL1616 || dstFormat == MESA_FORMAT_RG1616) && + baseInternalFormat == srcFormat && srcType == GL_UNSIGNED_SHORT && littleEndian) { /* simple memcpy path */ @@ -2053,7 +2086,8 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == MESA_FORMAT_AL1616) { + if (dstFormat == MESA_FORMAT_AL1616 || + dstFormat == MESA_FORMAT_RG1616) { for (col = 0; col < srcWidth; col++) { GLushort l, a; @@ -2082,6 +2116,66 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) } +static GLboolean +_mesa_texstore_r16(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(texelBytes == 2); + + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == MESA_FORMAT_R16 && + baseInternalFormat == GL_RED && + srcFormat == GL_RED && + srcType == GL_UNSIGNED_SHORT && + littleEndian) { + /* 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); + 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; + for (row = 0; row < srcHeight; row++) { + GLushort *dstUS = (GLushort *) dstRow; + for (col = 0; col < srcWidth; col++) { + GLushort r; + + UNCLAMPED_FLOAT_TO_USHORT(r, src[0]); + dstUS[col] = r; + src += 1; + } + dstRow += dstRowStride; + } + } + free((void *) tempImage); + } + return GL_TRUE; +} + + static GLboolean _mesa_texstore_rgba_16(TEXSTORE_PARAMS) { @@ -2278,7 +2372,8 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) ASSERT(dstFormat == MESA_FORMAT_A8 || dstFormat == MESA_FORMAT_L8 || - dstFormat == MESA_FORMAT_I8); + dstFormat == MESA_FORMAT_I8 || + dstFormat == MESA_FORMAT_R8); ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && @@ -3604,13 +3699,13 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) /* reuse normal luminance/alpha texstore code */ newDstFormat = MESA_FORMAT_AL88; - k = _mesa_texstore_al88(ctx, dims, baseInternalFormat, - newDstFormat, dstAddr, - dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, - srcAddr, srcPacking); + k = _mesa_texstore_unorm88(ctx, dims, baseInternalFormat, + newDstFormat, dstAddr, + dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, + srcAddr, srcPacking); return k; } @@ -3654,10 +3749,10 @@ 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_AL88, _mesa_texstore_al88 }, - { MESA_FORMAT_AL88_REV, _mesa_texstore_al88 }, - { MESA_FORMAT_AL1616, _mesa_texstore_al1616 }, - { MESA_FORMAT_AL1616_REV, _mesa_texstore_al1616 }, + { 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_L8, _mesa_texstore_a8 }, @@ -3665,6 +3760,12 @@ texstore_funcs[MESA_FORMAT_COUNT] = { 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_RG1616, _mesa_texstore_unorm1616 }, + { MESA_FORMAT_RG1616_REV, _mesa_texstore_unorm1616 }, { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, { MESA_FORMAT_Z16, _mesa_texstore_z16 }, -- cgit v1.2.3 From 421f4d8dc1e324067534719fc096e82fd9ef3017 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Sep 2010 16:30:09 -0700 Subject: ARB_texture_rg: Allow RED and RG textures as FBO color buffer attachments --- src/mesa/main/fbobject.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 5201f50252..f28846c4c9 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -451,7 +451,11 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, if (baseFormat != GL_RGB && baseFormat != GL_RGBA && (!ctx->Extensions.ARB_framebuffer_object || - baseFormat != GL_ALPHA)) { + baseFormat != GL_ALPHA) && + (!ctx->Extensions.ARB_texture_rg || + baseFormat != GL_RED) && + (!ctx->Extensions.ARB_texture_rg || + baseFormat != GL_RG)) { att_incomplete("bad format"); att->Complete = GL_FALSE; return; @@ -631,7 +635,9 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) numImages++; if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT && f != GL_DEPTH_STENCIL_EXT - && (!ctx->Extensions.ARB_framebuffer_object || f != GL_ALPHA)) { + && (!ctx->Extensions.ARB_framebuffer_object || f != GL_ALPHA) + && (!ctx->Extensions.ARB_texture_rg || f != GL_RED) + && (!ctx->Extensions.ARB_texture_rg || f != GL_RG)) { fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; fbo_incomplete("texture attachment incomplete", -1); return; -- cgit v1.2.3 From 9ef390dc14edd0adc0fa0d07c64621b0f220edd8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Sep 2010 16:29:46 -0700 Subject: mesa: Enable GL_ARB_texture_rg in software paths --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 9b723ef74b..e7116d789e 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -270,6 +270,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) /*ctx->Extensions.ARB_texture_float = GL_TRUE;*/ ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE; ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; + ctx->Extensions.ARB_texture_rg = GL_TRUE; ctx->Extensions.ARB_vertex_array_object = GL_TRUE; #if FEATURE_ARB_vertex_program ctx->Extensions.ARB_vertex_program = GL_TRUE; -- cgit v1.2.3 From c77cd9ec10f7c6ad2927740e15900591d1ff388a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 20 Nov 2009 10:45:36 -0800 Subject: i965: Enable GL_ARB_texture_rg --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 24 +++++++++++++ src/mesa/drivers/dri/intel/intel_extensions.c | 1 + src/mesa/drivers/dri/intel/intel_fbo.c | 46 ++++++++++++++++++++++++ src/mesa/drivers/dri/intel/intel_tex_format.c | 20 +++++++++++ 4 files changed, 91 insertions(+) (limited to 'src/mesa') 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 05f1aa1813..37104f1f23 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -89,6 +89,18 @@ static GLuint translate_tex_format( gl_format mesa_format, 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; @@ -444,6 +456,18 @@ brw_update_renderbuffer_surface(struct brw_context *brw, 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); } diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index d741f82767..b1b29d8526 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -166,6 +166,7 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_shadow", NULL }, { "GL_MESA_texture_signed_rgba", NULL }, { "GL_ARB_texture_non_power_of_two", NULL }, + { "GL_ARB_texture_rg", NULL }, { "GL_EXT_draw_buffers2", GL_EXT_draw_buffers2_functions }, { "GL_EXT_shadow_funcs", NULL }, { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 8c0491d59a..a70c83b39d 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -107,6 +107,24 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, 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: @@ -346,6 +364,14 @@ intel_create_renderbuffer(gl_format format) 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"); @@ -459,6 +485,22 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, 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"); @@ -673,6 +715,10 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) 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: fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT; diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index e03b203fb4..97b26efcb7 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -93,6 +93,10 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, 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 @@ -193,6 +197,22 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, 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 default: -- cgit v1.2.3 From e5fd15199dce4cb56e84edb5866167d4906d063f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Oct 2010 16:57:19 -0700 Subject: savage: Remove unnecessary header. --- src/mesa/drivers/dri/savage/savage_xmesa.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index bbf2fd3a0e..45c1e56fe0 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -26,7 +26,6 @@ #include #include "main/context.h" -#include "main/matrix.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/simple_list.h" -- cgit v1.2.3 From e2a054b70cb5dace40fc1426cbf936366dc72fb9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 1 Oct 2010 16:07:28 -0700 Subject: mesa: Add ARB_texture_compression_rgtc as an alias for EXT_texture_compression_rgtc Change the name in the extension tracking structure to ARB (from EXT). --- src/mesa/main/extensions.c | 3 ++- src/mesa/main/mtypes.h | 2 +- src/mesa/main/teximage.c | 10 +++++----- src/mesa/main/version.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index e7116d789e..d845ecee84 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -82,6 +82,7 @@ static const struct { { 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) }, @@ -147,7 +148,7 @@ static const struct { { 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(EXT_texture_compression_rgtc) }, + { 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) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 0a69bcc4e3..269968d677 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2594,6 +2594,7 @@ struct gl_extensions GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_buffer_object; GLboolean ARB_texture_compression; + GLboolean ARB_texture_compression_rgtc; GLboolean ARB_texture_cube_map; GLboolean ARB_texture_env_combine; GLboolean ARB_texture_env_crossbar; @@ -2656,7 +2657,6 @@ struct gl_extensions GLboolean EXT_texture3D; GLboolean EXT_texture_array; GLboolean EXT_texture_compression_s3tc; - GLboolean EXT_texture_compression_rgtc; GLboolean EXT_texture_env_add; GLboolean EXT_texture_env_combine; GLboolean EXT_texture_env_dot3; diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 28d370eb65..6c3f49f667 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -486,13 +486,13 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) } } - if (ctx->Extensions.EXT_texture_compression_rgtc) { + if (ctx->Extensions.ARB_texture_compression_rgtc) { switch (internalFormat) { - case GL_COMPRESSED_RED_RGTC1_EXT: - case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT: + case GL_COMPRESSED_RED_RGTC1: + case GL_COMPRESSED_SIGNED_RED_RGTC1: return GL_RED; - case GL_COMPRESSED_RED_GREEN_RGTC2_EXT: - case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: + case GL_COMPRESSED_RG_RGTC2: + case GL_COMPRESSED_SIGNED_RG_RGTC2: return GL_RG; default: ; /* fallthrough */ diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 5997ca00fd..692e8733c6 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -92,6 +92,7 @@ compute_version(GLcontext *ctx) ctx->Extensions.ARB_map_buffer_range && ctx->Extensions.ARB_texture_float && ctx->Extensions.ARB_texture_rg && + ctx->Extensions.ARB_texture_compression_rgtc && ctx->Extensions.APPLE_vertex_array_object && ctx->Extensions.EXT_draw_buffers2 && ctx->Extensions.EXT_framebuffer_blit && @@ -101,7 +102,6 @@ compute_version(GLcontext *ctx) ctx->Extensions.EXT_packed_depth_stencil && ctx->Extensions.EXT_packed_float && ctx->Extensions.EXT_texture_array && - ctx->Extensions.EXT_texture_compression_rgtc && ctx->Extensions.EXT_texture_integer && ctx->Extensions.EXT_texture_shared_exponent && ctx->Extensions.EXT_transform_feedback && -- cgit v1.2.3 From 7c6147014a726eefb7a73c8520a0b48a57248a03 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 1 Oct 2010 16:21:12 -0700 Subject: ARB_texture_rg: Add GL_COMPRESSED_{RED,RG} cases in _mesa_is_color_format --- src/mesa/main/image.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 1992c7448b..3951b6a207 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -663,6 +663,8 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_LUMINANCE: case GL_COMPRESSED_LUMINANCE_ALPHA: case GL_COMPRESSED_INTENSITY: + case GL_COMPRESSED_RED: + case GL_COMPRESSED_RG: case GL_COMPRESSED_RGB: case GL_COMPRESSED_RGBA: case GL_RGB_S3TC: -- cgit v1.2.3 From 69c78bf2c21c239d6064847dd0628f3526d68f9b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 1 Oct 2010 16:23:06 -0700 Subject: mesa: Fix misplaced #endif If FEATURE_texture_s3tc is not defined, FXT1 formats would erroneously fall through to the MESA_FORMAT_RGBA_FLOAT32 case. --- src/mesa/main/formats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index a82aa9c6a0..654ea038a5 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1338,12 +1338,12 @@ _mesa_format_to_type_and_comps(gl_format format, case MESA_FORMAT_SRGBA_DXT1: case MESA_FORMAT_SRGBA_DXT3: case MESA_FORMAT_SRGBA_DXT5: +#endif #endif /* XXX generate error instead? */ *datatype = GL_UNSIGNED_BYTE; *comps = 0; return; -#endif case MESA_FORMAT_RGBA_FLOAT32: *datatype = GL_FLOAT; -- cgit v1.2.3 From 5ebbabc5ccd03afe59299b8ce52ca862334fd252 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 1 Oct 2010 16:35:25 -0700 Subject: mesa: Trivial correction to comment --- src/mesa/main/texcompress_fxt1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 3d8996c2fd..33f46d4c8b 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -25,7 +25,7 @@ /** * \file texcompress_fxt1.c - * GL_EXT_texture_compression_fxt1 support. + * GL_3DFX_texture_compression_FXT1 support. */ -- cgit v1.2.3 From 1ca6cbec1b1168b55fecb264d4e75a26de2cccaf Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 1 Oct 2010 16:40:14 -0700 Subject: rgtc: Detect RGTC formats as color formats and as compressed formats --- src/mesa/main/image.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 3951b6a207..ce10b3b1f8 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -695,6 +695,10 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_SLUMINANCE_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: #endif /* FEATURE_EXT_texture_sRGB */ + case GL_COMPRESSED_RED_RGTC1: + case GL_COMPRESSED_SIGNED_RED_RGTC1: + case GL_COMPRESSED_RG_RGTC2: + case GL_COMPRESSED_SIGNED_RG_RGTC2: return GL_TRUE; /* signed texture formats */ case GL_RGBA_SNORM: @@ -887,6 +891,11 @@ _mesa_is_compressed_format(GLcontext *ctx, GLenum format) case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_RGBA_FXT1_3DFX: return ctx->Extensions.TDFX_texture_compression_FXT1; + case GL_COMPRESSED_RED_RGTC1: + case GL_COMPRESSED_SIGNED_RED_RGTC1: + case GL_COMPRESSED_RG_RGTC2: + case GL_COMPRESSED_SIGNED_RG_RGTC2: + return ctx->Extensions.ARB_texture_compression_rgtc; default: return GL_FALSE; } -- cgit v1.2.3 From fb0eed84cac3cdb45bd0b46047fc389b81a5b1df Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 1 Oct 2010 20:13:36 -0400 Subject: r600c: fix segfault in evergreen stencil code Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30551 --- src/mesa/drivers/dri/r600/evergreen_chip.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.c b/src/mesa/drivers/dri/r600/evergreen_chip.c index b591d5fa27..770e7f91c6 100644 --- a/src/mesa/drivers/dri/r600/evergreen_chip.c +++ b/src/mesa/drivers/dri/r600/evergreen_chip.c @@ -843,7 +843,7 @@ static void evergreenSetDepthTarget(context_t *context) { EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_renderbuffer *rrb; - unsigned int nPitchInPixel, height; + unsigned int nPitchInPixel, height, offtostencil; rrb = radeon_get_depthbuffer(&context->radeon); if (!rrb) @@ -889,6 +889,12 @@ static void evergreenSetDepthTarget(context_t *context) SETfield(evergreen->DB_Z_INFO.u32All, ARRAY_1D_TILED_THIN1, EG_DB_Z_INFO__ARRAY_MODE_shift, EG_DB_Z_INFO__ARRAY_MODE_mask); + + + offtostencil = ((height * rrb->pitch) + 255) & ~255; + evergreen->DB_STENCIL_WRITE_BASE.u32All = offtostencil >> 8; + evergreen->DB_STENCIL_READ_BASE.u32All = offtostencil >> 8; + } static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) @@ -896,7 +902,6 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_renderbuffer *rrb; - unsigned int zheight, zpitch, offtostencil; BATCH_LOCALS(&context->radeon); radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); @@ -951,16 +956,6 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) rrb = radeon_get_depthbuffer(&context->radeon); - if (context->radeon.radeonScreen->driScreen->dri2.enabled) - { - zheight = rrb->base.Height; - } - else - { - zheight = context->radeon.radeonScreen->driScreen->fbHeight; - } - zpitch = rrb->pitch; - if( (rrb != NULL) && (rrb->bo != NULL) ) { @@ -1032,10 +1027,9 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) //10 if((evergreen->DB_DEPTH_CONTROL.u32All & STENCIL_ENABLE_bit) > 0) { - offtostencil = ((zheight * zpitch + 255) >> 8) & 0xffffffff; BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_READ_BASE, offtostencil); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_READ_BASE, evergreen->DB_STENCIL_READ_BASE.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_READ_BASE.u32All, rrb->bo, evergreen->DB_STENCIL_READ_BASE.u32All, @@ -1043,7 +1037,7 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_WRITE_BASE, offtostencil); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_WRITE_BASE, evergreen->DB_STENCIL_WRITE_BASE.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_WRITE_BASE.u32All, rrb->bo, evergreen->DB_STENCIL_WRITE_BASE.u32All, -- cgit v1.2.3 From a0799725f52386cef911d3e104c5514a2811290b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 15:11:09 -0700 Subject: i965: Restore the forcing of aligned pairs for delta_xy on chips with PLN. By doing so using the register allocator now, we avoid wasting a register to make the alignment happen. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 55 ++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 4c8aafb254..50341ba383 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1749,8 +1749,14 @@ fs_visitor::emit_interpolation_setup_gen4() fs_reg(brw_imm_v(0x11001100)))); this->current_annotation = "compute pixel deltas from v0"; - this->delta_x = fs_reg(this, glsl_type::float_type); - this->delta_y = fs_reg(this, glsl_type::float_type); + if (brw->has_pln) { + this->delta_x = fs_reg(this, glsl_type::vec2_type); + this->delta_y = this->delta_x; + this->delta_y.reg_offset++; + } else { + this->delta_x = fs_reg(this, glsl_type::float_type); + this->delta_y = fs_reg(this, glsl_type::float_type); + } emit(fs_inst(BRW_OPCODE_ADD, this->delta_x, this->pixel_x, @@ -2133,14 +2139,6 @@ fs_visitor::assign_curb_setup() c->prog_data.first_curbe_grf = c->key.nr_payload_regs; c->prog_data.curb_read_length = ALIGN(c->prog_data.nr_params, 8) / 8; - if (intel->gen == 5 && (c->prog_data.first_curbe_grf + - c->prog_data.curb_read_length) & 1) { - /* Align the start of the interpolation coefficients so that we can use - * the PLN instruction. - */ - c->prog_data.first_curbe_grf++; - } - /* Map the offsets in the UNIFORM file to fixed HW regs. */ foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); @@ -2263,6 +2261,7 @@ fs_visitor::assign_regs() int base_reg_count = BRW_MAX_GRF - this->first_non_payload_grf; int class_sizes[base_reg_count]; int class_count = 0; + int aligned_pair_class = -1; calculate_live_intervals(); @@ -2275,6 +2274,12 @@ fs_visitor::assign_regs() * time. */ class_sizes[class_count++] = 1; + if (brw->has_pln && intel->gen < 6) { + /* Always set up the (unaligned) pairs for gen5, so we can find + * them for making the aligned pair class. + */ + class_sizes[class_count++] = 2; + } for (int r = 1; r < this->virtual_grf_next; r++) { int i; @@ -2290,7 +2295,7 @@ fs_visitor::assign_regs() int ra_reg_count = 0; int class_base_reg[class_count]; int class_reg_count[class_count]; - int classes[class_count]; + int classes[class_count + 1]; for (int i = 0; i < class_count; i++) { class_base_reg[i] = ra_reg_count; @@ -2330,6 +2335,27 @@ fs_visitor::assign_regs() } } + /* Add a special class for aligned pairs, which we'll put delta_x/y + * in on gen5 so that we can do PLN. + */ + if (brw->has_pln && intel->gen < 6) { + int reg_count = (base_reg_count - 1) / 2; + int unaligned_pair_class = 1; + assert(class_sizes[unaligned_pair_class] == 2); + + aligned_pair_class = class_count; + classes[aligned_pair_class] = ra_alloc_reg_class(regs); + class_base_reg[aligned_pair_class] = 0; + class_reg_count[aligned_pair_class] = 0; + int start = (this->first_non_payload_grf & 1) ? 1 : 0; + + for (int i = 0; i < reg_count; i++) { + ra_class_add_reg(regs, classes[aligned_pair_class], + class_base_reg[unaligned_pair_class] + i * 2 + start); + } + class_count++; + } + ra_set_finalize(regs); struct ra_graph *g = ra_alloc_interference_graph(regs, @@ -2342,7 +2368,12 @@ fs_visitor::assign_regs() for (int i = 1; i < this->virtual_grf_next; i++) { for (int c = 0; c < class_count; c++) { if (class_sizes[c] == this->virtual_grf_sizes[i]) { - ra_set_node_class(g, i, classes[c]); + if (aligned_pair_class >= 0 && + this->delta_x.reg == i) { + ra_set_node_class(g, i, classes[aligned_pair_class]); + } else { + ra_set_node_class(g, i, classes[c]); + } break; } } -- cgit v1.2.3 From 5ee09413162f4ec83cc7a738e807ffde8c89cca7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 15:42:39 -0700 Subject: i965: When producing a single channel swizzle, don't make a temporary. This quickly cuts 8% of the instructions in my glsl demo. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 50341ba383..b38df71a84 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1445,6 +1445,11 @@ fs_visitor::visit(ir_swizzle *ir) ir->val->accept(this); fs_reg val = this->result; + if (ir->type->vector_elements == 1) { + this->result.reg_offset += ir->mask.x; + return; + } + fs_reg result = fs_reg(this, ir->type); this->result = result; -- cgit v1.2.3 From afb64311e3484002e06aeac62187b68467610449 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 16:35:55 -0700 Subject: i965: Add a sanity check for register allocation sizes. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b38df71a84..ba6c048f38 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2293,6 +2293,11 @@ fs_visitor::assign_regs() break; } if (i == class_count) { + if (this->virtual_grf_sizes[r] >= base_reg_count) { + fprintf(stderr, "Object too large to register allocate.\n"); + this->fail = true; + } + class_sizes[class_count++] = this->virtual_grf_sizes[r]; } } -- cgit v1.2.3 From 6397addd6146661689a0e315b06e543ef12d8868 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 16:36:17 -0700 Subject: i965: Fix off-by-ones in handling the last members of register classes. Luckily, one of them would result in failing out register allocation when the other bugs were encountered. Applies to glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined, which still fails register allocation, but now legitimately. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index ba6c048f38..ddf96ca22d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2326,15 +2326,15 @@ fs_visitor::assign_regs() * that alias base regs, or the base regs themselves for classes[0]. */ for (int c = 0; c <= i; c++) { - for (int i_r = 0; i_r < class_reg_count[i] - 1; i_r++) { + for (int i_r = 0; i_r < class_reg_count[i]; i_r++) { for (int c_r = MAX2(0, i_r - (class_sizes[c] - 1)); - c_r <= MIN2(class_reg_count[c] - 1, i_r + class_sizes[i] - 1); + c_r < MIN2(class_reg_count[c], i_r + class_sizes[i]); c_r++) { if (0) { printf("%d/%d conflicts %d/%d\n", - class_sizes[i], i_r, - class_sizes[c], c_r); + class_sizes[i], this->first_non_payload_grf + i_r, + class_sizes[c], this->first_non_payload_grf + c_r); } ra_add_reg_conflict(regs, @@ -2413,7 +2413,7 @@ fs_visitor::assign_regs() for (int c = 0; c < class_count; c++) { if (reg >= class_base_reg[c] && - reg < class_base_reg[c] + class_reg_count[c] - 1) { + reg < class_base_reg[c] + class_reg_count[c]) { hw_reg = reg - class_base_reg[c]; break; } -- cgit v1.2.3 From 64a9fc3fc15603a8e25d0e1146fe5da5a5bde55b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 17:18:07 -0700 Subject: i965: Don't try to emit code if we failed register allocation. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index ddf96ca22d..dd2af2bd1d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2808,7 +2808,8 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) v.assign_regs(); } - v.generate_code(); + if (!v.fail) + v.generate_code(); assert(!v.fail); /* FINISHME: Cleanly fail, tested at link time, etc. */ -- cgit v1.2.3 From f31771343259d195ba243ce8d307831e495d5a2c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 1 Oct 2010 19:53:24 -0700 Subject: i965: Fix incorrect batchbuffer size in gen6 clip state command. FORCE_ZERO_RTAINDEX should be in the fourth (and final) dword. --- src/mesa/drivers/dri/i965/gen6_clip_state.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index 045d9c6f76..e8bca83e3a 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -60,7 +60,6 @@ upload_clip_state(struct brw_context *brw) depth_clamp | provoking); OUT_BATCH(GEN6_CLIP_FORCE_ZERO_RTAINDEX); - OUT_BATCH(0); ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); -- cgit v1.2.3 From 71a079fb4ecbd17703ac9b5e6d5ef622fd7bc50f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 11 Aug 2010 19:04:05 +1000 Subject: mesa/st: initial attempt at RG support for gallium drivers passes all piglit RG tests with softpipe. --- src/mesa/state_tracker/st_atom_texture.c | 10 ++++- src/mesa/state_tracker/st_cb_fbo.c | 12 ++++++ src/mesa/state_tracker/st_extensions.c | 6 +++ src/mesa/state_tracker/st_format.c | 66 ++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 981129621c..029b040346 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -52,7 +52,7 @@ * * \param format PIPE_FORMAT_*. * \param swizzle Texture swizzle, a bitmask computed using MAKE_SWIZZLE4. - * \param depthmode One of GL_LUMINANCE, GL_INTENSITY, GL_ALPHA. + * \param depthmode One of GL_LUMINANCE, GL_INTENSITY, GL_ALPHA, GL_RED. */ static GLuint apply_depthmode(enum pipe_format format, GLuint swizzle, GLenum depthmode) @@ -96,6 +96,14 @@ static GLuint apply_depthmode(enum pipe_format format, else if (swiz[i] < SWIZZLE_W) swiz[i] = SWIZZLE_ZERO; break; + case GL_RED: + /* Rewrite reads W to 1, XYZ to X00 */ + for (i = 0; i < 4; i++) + if (swiz[i] == SWIZZLE_W) + swiz[i] = SWIZZLE_ONE; + else if (swiz[i] == SWIZZLE_Y || swiz[i] == SWIZZLE_Z) + swiz[i] = SWIZZLE_ZERO; + break; } return MAKE_SWIZZLE4(swiz[0], swiz[1], swiz[2], swiz[3]); diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 71bd4729e0..ac1f6812b8 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -260,6 +260,18 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) case PIPE_FORMAT_R16G16B16A16_SNORM: strb->Base.InternalFormat = GL_RGBA16; break; + case PIPE_FORMAT_R8_UNORM: + strb->Base.InternalFormat = GL_R8; + break; + case PIPE_FORMAT_R8G8_UNORM: + strb->Base.InternalFormat = GL_RG8; + break; + case PIPE_FORMAT_R16_UNORM: + strb->Base.InternalFormat = GL_R16; + break; + case PIPE_FORMAT_R16G16_UNORM: + strb->Base.InternalFormat = GL_RG16; + break; default: _mesa_problem(NULL, "Unexpected format in st_new_renderbuffer_fb"); diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 225f75e3af..9b09601bbc 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -373,6 +373,12 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.EXT_texture_sRGB = GL_TRUE; } + if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0)) { + ctx->Extensions.ARB_texture_rg = GL_TRUE; + } + /* s3tc support */ if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, PIPE_TEXTURE_2D, 0, diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 95064605d7..b7c54cef84 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -202,6 +202,14 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) case MESA_FORMAT_SARGB8: return PIPE_FORMAT_B8G8R8A8_SRGB; #endif + case MESA_FORMAT_R8: + return PIPE_FORMAT_R8_UNORM; + case MESA_FORMAT_R16: + return PIPE_FORMAT_R16_UNORM; + case MESA_FORMAT_RG88: + return PIPE_FORMAT_R8G8_UNORM; + case MESA_FORMAT_RG1616: + return PIPE_FORMAT_R16G16_UNORM; default: assert(0); return PIPE_FORMAT_NONE; @@ -299,6 +307,15 @@ st_pipe_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_B8G8R8A8_SRGB: return MESA_FORMAT_SARGB8; #endif + + case PIPE_FORMAT_R8_UNORM: + return MESA_FORMAT_R8; + case PIPE_FORMAT_R16_UNORM: + return MESA_FORMAT_R16; + case PIPE_FORMAT_R8G8_UNORM: + return MESA_FORMAT_RG88; + case PIPE_FORMAT_R16G16_UNORM: + return MESA_FORMAT_RG1616; default: assert(0); return MESA_FORMAT_NONE; @@ -688,6 +705,55 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_srgba_format( screen, target, sample_count, bindings, geom_flags ); + case GL_RED: + case GL_R8: + if (screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_R8_UNORM; + return PIPE_FORMAT_NONE; + case GL_RG: + case GL_RG8: + if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_R8G8_UNORM; + return PIPE_FORMAT_NONE; + + case GL_R16: + if (screen->is_format_supported(screen, PIPE_FORMAT_R16_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_R16_UNORM; + return PIPE_FORMAT_NONE; + + case GL_RG16: + if (screen->is_format_supported(screen, PIPE_FORMAT_R16G16_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_R16G16_UNORM; + return PIPE_FORMAT_NONE; + + case GL_COMPRESSED_RED_RGTC1: + if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC1_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_RGTC1_UNORM; + return PIPE_FORMAT_NONE; + + case GL_COMPRESSED_SIGNED_RED_RGTC1: + if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC1_SNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_RGTC1_SNORM; + return PIPE_FORMAT_NONE; + + case GL_COMPRESSED_RG_RGTC2: + if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC2_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_RGTC2_UNORM; + return PIPE_FORMAT_NONE; + + case GL_COMPRESSED_SIGNED_RG_RGTC2: + if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC2_SNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_RGTC2_SNORM; + return PIPE_FORMAT_NONE; + default: return PIPE_FORMAT_NONE; } -- cgit v1.2.3 From 4fb0c92c6986cf4e88296bab8837320210f1794f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 2 Oct 2010 23:44:29 -0700 Subject: i965: Add support for EXT_texture_swizzle to the new FS backend. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index dd2af2bd1d..5ebf9063df 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1437,6 +1437,27 @@ fs_visitor::visit(ir_texture *ir) if (ir->shadow_comparitor) inst->shadow_compare = true; + + if (c->key.tex_swizzles[inst->sampler] != SWIZZLE_NOOP) { + fs_reg swizzle_dst = fs_reg(this, glsl_type::vec4_type); + + for (int i = 0; i < 4; i++) { + int swiz = GET_SWZ(c->key.tex_swizzles[inst->sampler], i); + fs_reg l = swizzle_dst; + l.reg_offset += i; + + if (swiz == SWIZZLE_ZERO) { + emit(fs_inst(BRW_OPCODE_MOV, l, fs_reg(0.0f))); + } else if (swiz == SWIZZLE_ONE) { + emit(fs_inst(BRW_OPCODE_MOV, l, fs_reg(1.0f))); + } else { + fs_reg r = dst; + r.reg_offset += GET_SWZ(c->key.tex_swizzles[inst->sampler], i); + emit(fs_inst(BRW_OPCODE_MOV, l, r)); + } + } + this->result = swizzle_dst; + } } void -- cgit v1.2.3 From a7fa00dfc5ab5782b2e497fbf4ca292dde69cdbd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 2 Oct 2010 23:27:31 -0700 Subject: i965: Set up swizzling of shadow compare results for GL_DEPTH_TEXTURE_MODE. The brw_wm_surface_state.c handling of GL_DEPTH_TEXTURE_MODE doesn't apply to shadow compares, which always return an intensity value. The texture swizzles can do the job for us. Fixes: glsl1-shadow2D(): 1 glsl1-shadow2D(): 3 --- src/mesa/drivers/dri/i965/brw_wm.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 9ca8e709f5..66106408c9 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -342,13 +342,44 @@ static void brw_wm_populate_key( struct brw_context *brw, if (unit->_ReallyEnabled) { const struct gl_texture_object *t = unit->_Current; const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; + + key->tex_swizzles[i] = SWIZZLE_NOOP; + + /* GL_DEPTH_TEXTURE_MODE is normally handled through + * brw_wm_surface_state, but it applies to shadow compares as + * well and our shadow compares always return the result in + * all 4 channels. + */ + if (t->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { + if (t->DepthMode == GL_ALPHA) { + key->tex_swizzles[i] = + MAKE_SWIZZLE4(SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_X); + } else if (t->DepthMode == GL_LUMINANCE) { + key->tex_swizzles[i] = + MAKE_SWIZZLE4(SWIZZLE_X, + SWIZZLE_X, + SWIZZLE_X, + SWIZZLE_ONE); + } + } + if (img->InternalFormat == GL_YCBCR_MESA) { key->yuvtex_mask |= 1 << i; if (img->TexFormat == MESA_FORMAT_YCBCR) key->yuvtex_swap_mask |= 1 << i; } - key->tex_swizzles[i] = t->_Swizzle; + key->tex_swizzles[i] = MAKE_SWIZZLE4(GET_SWZ(key->tex_swizzles[i], + GET_SWZ(t->_Swizzle, 0)), + GET_SWZ(key->tex_swizzles[i], + GET_SWZ(t->_Swizzle, 1)), + GET_SWZ(key->tex_swizzles[i], + GET_SWZ(t->_Swizzle, 2)), + GET_SWZ(key->tex_swizzles[i], + GET_SWZ(t->_Swizzle, 3))); } else { key->tex_swizzles[i] = SWIZZLE_NOOP; -- cgit v1.2.3 From 14bf92ba19373d54e9909bbdda5e430e0affea37 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 3 Oct 2010 00:24:09 -0700 Subject: i965: Fix glean/texSwizzle regression in previous commit. Easy enough patch, who needs a full test run. Oh, that's right. Me. --- src/mesa/drivers/dri/i965/brw_wm.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 66106408c9..2ea5967df1 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -342,6 +342,15 @@ static void brw_wm_populate_key( struct brw_context *brw, if (unit->_ReallyEnabled) { const struct gl_texture_object *t = unit->_Current; const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; + int swizzles[SWIZZLE_NIL + 1] = { + SWIZZLE_X, + SWIZZLE_Y, + SWIZZLE_Z, + SWIZZLE_W, + SWIZZLE_ZERO, + SWIZZLE_ONE, + SWIZZLE_NIL + }; key->tex_swizzles[i] = SWIZZLE_NOOP; @@ -352,17 +361,11 @@ static void brw_wm_populate_key( struct brw_context *brw, */ if (t->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { if (t->DepthMode == GL_ALPHA) { - key->tex_swizzles[i] = - MAKE_SWIZZLE4(SWIZZLE_ZERO, - SWIZZLE_ZERO, - SWIZZLE_ZERO, - SWIZZLE_X); + swizzles[0] = SWIZZLE_ZERO; + swizzles[1] = SWIZZLE_ZERO; + swizzles[2] = SWIZZLE_ZERO; } else if (t->DepthMode == GL_LUMINANCE) { - key->tex_swizzles[i] = - MAKE_SWIZZLE4(SWIZZLE_X, - SWIZZLE_X, - SWIZZLE_X, - SWIZZLE_ONE); + swizzles[3] = SWIZZLE_ONE; } } @@ -372,14 +375,11 @@ static void brw_wm_populate_key( struct brw_context *brw, key->yuvtex_swap_mask |= 1 << i; } - key->tex_swizzles[i] = MAKE_SWIZZLE4(GET_SWZ(key->tex_swizzles[i], - GET_SWZ(t->_Swizzle, 0)), - GET_SWZ(key->tex_swizzles[i], - GET_SWZ(t->_Swizzle, 1)), - GET_SWZ(key->tex_swizzles[i], - GET_SWZ(t->_Swizzle, 2)), - GET_SWZ(key->tex_swizzles[i], - GET_SWZ(t->_Swizzle, 3))); + key->tex_swizzles[i] = + MAKE_SWIZZLE4(swizzles[GET_SWZ(t->_Swizzle, 0)], + swizzles[GET_SWZ(t->_Swizzle, 1)], + swizzles[GET_SWZ(t->_Swizzle, 2)], + swizzles[GET_SWZ(t->_Swizzle, 3)]); } else { key->tex_swizzles[i] = SWIZZLE_NOOP; -- cgit v1.2.3 From 9faf64bc32cf7c1a06a302fff9f80d7e2e2685d5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 3 Oct 2010 15:01:20 -0700 Subject: i965: Be more conservative on live interval calculation. This also means that our intervals now highlight dead code. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 5ebf9063df..6106445fbb 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2471,7 +2471,7 @@ fs_visitor::calculate_live_intervals() for (int i = 0; i < num_vars; i++) { def[i] = 1 << 30; - use[i] = 0; + use[i] = -1; } int ip = 0; @@ -2506,13 +2506,11 @@ fs_visitor::calculate_live_intervals() for (unsigned int i = 0; i < 3; i++) { if (inst->src[i].file == GRF && inst->src[i].reg != 0) { - def[inst->src[i].reg] = MIN2(def[inst->src[i].reg], eip); use[inst->src[i].reg] = MAX2(use[inst->src[i].reg], eip); } } if (inst->dst.file == GRF && inst->dst.reg != 0) { def[inst->dst.reg] = MIN2(def[inst->dst.reg], eip); - use[inst->dst.reg] = MAX2(use[inst->dst.reg], eip); } } @@ -2529,6 +2527,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]); + } + return start <= end; } -- cgit v1.2.3 From e27c88d8e6c9d18bfa793f884d02ce6011c4bdde Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 3 Oct 2010 15:15:18 -0700 Subject: i965: Add trivial dead code elimination in the new FS backend. The glsl core should be handling most dead code issues for us, but we generate some things in codegen that may not get used, like the 1/w value or pixel deltas. It seems a lot easier this way than trying to work out up front whether we're going to use those values or not. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 52 ++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 6106445fbb..472e6d06f6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -455,6 +455,7 @@ public: void assign_regs(); void assign_regs_trivial(); void calculate_live_intervals(); + bool dead_code_eliminate(); bool virtual_grf_interferes(int a, int b); void generate_code(); void generate_fb_write(fs_inst *inst); @@ -2289,8 +2290,6 @@ 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, @@ -2517,10 +2516,50 @@ fs_visitor::calculate_live_intervals() ip++; } + talloc_free(this->virtual_grf_def); + talloc_free(this->virtual_grf_use); this->virtual_grf_def = def; this->virtual_grf_use = use; } +/** + * Must be called after calculate_live_intervales() to remove unused + * writes to registers -- register allocation will fail otherwise + * because something deffed but not used won't be considered to + * interfere with other regs. + */ +bool +fs_visitor::dead_code_eliminate() +{ + bool progress = false; + int num_vars = this->virtual_grf_next; + bool dead[num_vars]; + + for (int i = 0; i < num_vars; i++) { + /* This would be ">=", but FS_OPCODE_DISCARD has a src == dst where + * it writes dst then reads it as src. + */ + dead[i] = this->virtual_grf_def[i] > this->virtual_grf_use[i]; + + if (dead[i]) { + /* Mark off its interval so it won't interfere with anything. */ + this->virtual_grf_def[i] = -1; + this->virtual_grf_use[i] = -1; + } + } + + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + + if (inst->dst.file == GRF && dead[inst->dst.reg]) { + inst->remove(); + progress = true; + } + } + + return progress; +} + bool fs_visitor::virtual_grf_interferes(int a, int b) { @@ -2831,6 +2870,15 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) v.emit_fb_writes(); v.assign_curb_setup(); v.assign_urb_setup(); + + bool progress; + do { + progress = false; + + v.calculate_live_intervals(); + progress = v.dead_code_eliminate() || progress; + } while (progress); + if (0) v.assign_regs_trivial(); else -- cgit v1.2.3 From 3bf8774e9c293fcad654d1bd67d4b43247b82f97 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 4 Oct 2010 11:48:04 -0700 Subject: i965: Add initial folding of constants into operand immediate slots. We could try to detect this in expression handling and do it proactively there, but it seems like less logic to do it in one optional pass at the end. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 90 ++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 472e6d06f6..5eaa998447 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -455,6 +455,7 @@ public: void assign_regs(); void assign_regs_trivial(); void calculate_live_intervals(); + bool propagate_constants(); bool dead_code_eliminate(); bool virtual_grf_interferes(int a, int b); void generate_code(); @@ -2522,6 +2523,94 @@ fs_visitor::calculate_live_intervals() this->virtual_grf_use = use; } +/** + * Attempts to move immediate constants into the immediate + * constant slot of following instructions. + * + * Immediate constants are a bit tricky -- they have to be in the last + * operand slot, you can't do abs/negate on them, + */ + +bool +fs_visitor::propagate_constants() +{ + bool progress = false; + + return false; + + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + + if (inst->opcode != BRW_OPCODE_MOV || + inst->predicated || + inst->dst.file != GRF || inst->src[0].file != IMM || + inst->dst.type != inst->src[0].type) + continue; + + /* Don't bother with cases where we should have had the + * operation on the constant folded in GLSL already. + */ + if (inst->saturate) + continue; + + /* Found a move of a constant to a GRF. Find anything else using the GRF + * before it's written, and replace it with the constant if we can. + */ + exec_list_iterator scan_iter = iter; + scan_iter.next(); + 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_ELSE || + scan_inst->opcode == BRW_OPCODE_ENDIF) { + break; + } + + for (int i = 2; i >= 0; i--) { + if (scan_inst->src[i].file != GRF || + scan_inst->src[i].reg != inst->dst.reg || + scan_inst->src[i].reg_offset != inst->dst.reg_offset) + continue; + + /* Don't bother with cases where we should have had the + * operation on the constant folded in GLSL already. + */ + if (scan_inst->src[i].negate || scan_inst->src[i].abs) + continue; + + switch (scan_inst->opcode) { + case BRW_OPCODE_MOV: + scan_inst->src[i] = inst->src[0]; + progress = true; + break; + + case BRW_OPCODE_MUL: + case BRW_OPCODE_ADD: + if (i == 1) { + scan_inst->src[i] = inst->src[0]; + progress = true; + } else if (i == 0 && scan_inst->src[1].file != IMM) { + /* Fit this constant in by commuting the operands */ + scan_inst->src[0] = scan_inst->src[1]; + scan_inst->src[1] = inst->src[0]; + } + break; + } + } + + if (scan_inst->dst.file == GRF && + scan_inst->dst.reg == inst->dst.reg && + (scan_inst->dst.reg_offset == inst->dst.reg_offset || + scan_inst->opcode == FS_OPCODE_TEX)) { + break; + } + } + } + + return progress; +} /** * Must be called after calculate_live_intervales() to remove unused * writes to registers -- register allocation will fail otherwise @@ -2876,6 +2965,7 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) progress = false; v.calculate_live_intervals(); + progress = v.propagate_constants() || progress; progress = v.dead_code_eliminate() || progress; } while (progress); -- cgit v1.2.3 From 739aec39bd25e79adce306d6cf48296b7c9e4fc0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 4 Oct 2010 15:03:32 -0700 Subject: i965: In disasm, gen6 fb writes don't put msg reg # in destreg_conditionalmod. It instead sensibly appears in the src0 slot. --- src/mesa/drivers/dri/i965/brw_disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index 90520824f6..3a93b25377 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -886,7 +886,7 @@ int brw_disasm (FILE *file, struct brw_instruction *inst, int gen) string (file, ")"); } - if (inst->header.opcode == BRW_OPCODE_SEND) + if (inst->header.opcode == BRW_OPCODE_SEND && gen < 6) format (file, " %d", inst->header.destreg__conditionalmod); if (opcode[inst->header.opcode].ndst > 0) { -- cgit v1.2.3 From ea909be58dda7e916cb9ce434ecb78597881ad33 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 4 Oct 2010 15:07:17 -0700 Subject: i965: Add support for gen6 FB writes to the new FS. This uses message headers for now, since we'll need it for MRT. We can cut out the header later. --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 11 +++++++++-- src/mesa/drivers/dri/i965/brw_fs.cpp | 14 +++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 09cc8b2bd5..5954135321 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -448,6 +448,7 @@ static void brw_set_dp_write_message( struct brw_context *brw, GLuint msg_control, GLuint msg_type, GLuint msg_length, + GLboolean header_present, GLuint pixel_scoreboard_clear, GLuint response_length, GLuint end_of_thread, @@ -462,7 +463,7 @@ static void brw_set_dp_write_message( struct brw_context *brw, insn->bits3.dp_render_cache.pixel_scoreboard_clear = pixel_scoreboard_clear; insn->bits3.dp_render_cache.msg_type = msg_type; insn->bits3.dp_render_cache.send_commit_msg = send_commit_msg; - insn->bits3.dp_render_cache.header_present = 0; /* XXX */ + insn->bits3.dp_render_cache.header_present = header_present; insn->bits3.dp_render_cache.response_length = response_length; insn->bits3.dp_render_cache.msg_length = msg_length; insn->bits3.dp_render_cache.end_of_thread = end_of_thread; @@ -476,7 +477,7 @@ static void brw_set_dp_write_message( struct brw_context *brw, insn->bits3.dp_write_gen5.pixel_scoreboard_clear = pixel_scoreboard_clear; insn->bits3.dp_write_gen5.msg_type = msg_type; insn->bits3.dp_write_gen5.send_commit_msg = send_commit_msg; - insn->bits3.dp_write_gen5.header_present = 1; + insn->bits3.dp_write_gen5.header_present = header_present; insn->bits3.dp_write_gen5.response_length = response_length; insn->bits3.dp_write_gen5.msg_length = msg_length; insn->bits3.dp_write_gen5.end_of_thread = end_of_thread; @@ -1293,6 +1294,7 @@ void brw_dp_WRITE_16( struct brw_compile *p, BRW_DATAPORT_OWORD_BLOCK_4_OWORDS, /* msg_control */ BRW_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE, /* msg_type */ msg_length, + GL_TRUE, /* header_present */ 0, /* pixel scoreboard */ send_commit_msg, /* response_length */ 0, /* eot */ @@ -1530,12 +1532,16 @@ void brw_fb_WRITE(struct brw_compile *p, struct intel_context *intel = &p->brw->intel; struct brw_instruction *insn; GLuint msg_control, msg_type; + GLboolean header_present = GL_TRUE; insn = next_insn(p, BRW_OPCODE_SEND); insn->header.predicate_control = 0; /* XXX */ 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); @@ -1559,6 +1565,7 @@ void brw_fb_WRITE(struct brw_compile *p, msg_control, msg_type, msg_length, + header_present, 1, /* pixel scoreboard */ response_length, eot, diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 5eaa998447..f42c469641 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1920,6 +1920,7 @@ void fs_visitor::generate_fb_write(fs_inst *inst) { GLboolean eot = inst->eot; + struct brw_reg implied_header; /* Header is 2 regs, g0 and g1 are the contents. g0 will be implied * move, here's g1. @@ -1927,16 +1928,27 @@ fs_visitor::generate_fb_write(fs_inst *inst) brw_push_insn_state(p); brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_compression_control(p, BRW_COMPRESSION_NONE); + + if (intel->gen >= 6) { + brw_MOV(p, + brw_message_reg(0), + brw_vec8_grf(0, 0)); + implied_header = brw_null_reg(); + } else { + implied_header = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW); + } + brw_MOV(p, brw_message_reg(1), brw_vec8_grf(1, 0)); + brw_pop_insn_state(p); brw_fb_WRITE(p, 8, /* dispatch_width */ retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW), 0, /* base MRF */ - retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), + implied_header, inst->target, inst->mlen, 0, -- cgit v1.2.3 From fb5e6f88fc426e53af26e98d1c336222a8952cc5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 4 Oct 2010 19:59:23 -0600 Subject: swrast: fix choose_depth_texture_level() to respect mipmap filtering state NOTE: this is a candidate for the 7.9 branch. --- src/mesa/swrast/s_texfilter.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index de694c31bf..e5ffe8fa5c 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -2975,11 +2975,16 @@ choose_depth_texture_level(const struct gl_texture_object *tObj, GLfloat lambda) { GLint level; - lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod); - - level = (GLint) lambda; - - level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel); + if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + /* no mipmapping - use base level */ + level = tObj->BaseLevel; + } + else { + /* choose mipmap level */ + lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod); + level = (GLint) lambda; + level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel); + } return level; } -- cgit v1.2.3 From 3d6eec0a87ee5549e817cdabb4b6424960678189 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 5 Oct 2010 14:32:59 -0600 Subject: st/mesa: replace assertion w/ conditional in framebuffer invalidation https://bugs.freedesktop.org/show_bug.cgi?id=30632 NOTE: this is a candidate for the 7.9 branch. --- src/mesa/state_tracker/st_manager.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 66e32b4c9e..cd418a0366 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -486,9 +486,18 @@ st_context_notify_invalid_framebuffer(struct st_context_iface *stctxi, stfb = st_ws_framebuffer(st->ctx->WinSysDrawBuffer); if (!stfb || stfb->iface != stfbi) stfb = st_ws_framebuffer(st->ctx->WinSysReadBuffer); - assert(stfb && stfb->iface == stfbi); - p_atomic_set(&stfb->revalidate, TRUE); + if (stfb && stfb->iface == stfbi) { + p_atomic_set(&stfb->revalidate, TRUE); + } + else { + /* This function is probably getting called when we've detected a + * change in a window's size but the currently bound context is + * not bound to that window. + * If the st_framebuffer_iface structure had a pointer to the + * corresponding st_framebuffer we'd be able to handle this. + */ + } } static void -- cgit v1.2.3 From dcd0261affc293b75d231e612091ec7b1076fff6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 5 Oct 2010 10:20:16 -0700 Subject: i965: Enable the constant propagation code. A debug disable had slipped in. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index f42c469641..0c9f17f8fd 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2548,8 +2548,6 @@ fs_visitor::propagate_constants() { bool progress = false; - return false; - foreach_iter(exec_list_iterator, iter, this->instructions) { fs_inst *inst = (fs_inst *)iter.get(); -- cgit v1.2.3 From 634abbf7b2e6ea21db30aafc0de9472ee31d4173 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 5 Oct 2010 10:25:22 -0700 Subject: i965: Also do constant propagation for the second operand of CMP. We could do the first operand as well by flipping the comparison, but this covered several CMPs in code I was looking at. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 0c9f17f8fd..914141a397 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2607,6 +2607,11 @@ fs_visitor::propagate_constants() scan_inst->src[1] = inst->src[0]; } break; + case BRW_OPCODE_CMP: + if (i == 1) { + scan_inst->src[i] = inst->src[0]; + progress = true; + } } } -- cgit v1.2.3 From 3c97c00e3810d31c3aa26173eb9fdef91b3e7c87 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 09:57:55 -0700 Subject: i965: Add back gen6 headerless FB writes to the new FS backend. It's not that hard to detect when we need the header. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 43 +++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 914141a397..a380eb4452 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -324,6 +324,7 @@ public: this->sampler = 0; this->target = 0; this->eot = false; + this->header_present = false; this->shadow_compare = false; } @@ -376,6 +377,7 @@ public: int sampler; int target; /**< MRT target. */ bool eot; + bool header_present; bool shadow_compare; /** @{ @@ -420,7 +422,10 @@ public: this->virtual_grf_array_size = 0; this->virtual_grf_def = NULL; this->virtual_grf_use = NULL; + + this->kill_emitted = false; } + ~fs_visitor() { talloc_free(this->mem_ctx); @@ -503,6 +508,7 @@ public: ir_variable *frag_color, *frag_data, *frag_depth; int first_non_payload_grf; int urb_setup[FRAG_ATTRIB_MAX]; + bool kill_emitted; /** @{ debug annotation info */ const char *current_annotation; @@ -1509,6 +1515,7 @@ fs_visitor::visit(ir_discard *ir) assert(ir->condition == NULL); /* FINISHME */ emit(fs_inst(FS_OPCODE_DISCARD, temp, temp)); + kill_emitted = true; } void @@ -1843,10 +1850,19 @@ void fs_visitor::emit_fb_writes() { this->current_annotation = "FB write header"; + GLboolean header_present = GL_TRUE; int nr = 0; - /* m0, m1 header */ - nr += 2; + if (intel->gen >= 6 && + !this->kill_emitted && + c->key.nr_color_regions == 1) { + header_present = false; + } + + if (header_present) { + /* m0, m1 header */ + nr += 2; + } if (c->key.aa_dest_stencil_reg) { emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++), @@ -1911,6 +1927,7 @@ fs_visitor::emit_fb_writes() reg_undef, reg_undef)); inst->mlen = nr; inst->eot = true; + inst->header_present = header_present; } this->current_annotation = NULL; @@ -1929,19 +1946,23 @@ fs_visitor::generate_fb_write(fs_inst *inst) brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - if (intel->gen >= 6) { + if (inst->header_present) { + if (intel->gen >= 6) { + brw_MOV(p, + brw_message_reg(0), + brw_vec8_grf(0, 0)); + implied_header = brw_null_reg(); + } else { + implied_header = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW); + } + brw_MOV(p, - brw_message_reg(0), - brw_vec8_grf(0, 0)); - implied_header = brw_null_reg(); + brw_message_reg(1), + brw_vec8_grf(1, 0)); } else { - implied_header = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW); + implied_header = brw_null_reg(); } - brw_MOV(p, - brw_message_reg(1), - brw_vec8_grf(1, 0)); - brw_pop_insn_state(p); brw_fb_WRITE(p, -- cgit v1.2.3 From f7cb28fad9855020e9fbd1481df03bb09346d4be Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 4 Oct 2010 15:09:18 -0700 Subject: i965: Gen6 no longer has the IFF instruction; always use IF. --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 5954135321..fbc6894d05 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -899,9 +899,11 @@ void brw_ENDIF(struct brw_compile *p, * instruction respectively. */ if (patch_insn->header.opcode == BRW_OPCODE_IF) { - /* Automagically turn it into an IFF: - */ - patch_insn->header.opcode = BRW_OPCODE_IFF; + if (intel->gen < 6) { + /* Automagically turn it into an IFF: + */ + patch_insn->header.opcode = BRW_OPCODE_IFF; + } patch_insn->bits3.if_else.jump_count = br * (insn - patch_insn + 1); patch_insn->bits3.if_else.pop_count = 0; patch_insn->bits3.if_else.pad0 = 0; -- cgit v1.2.3 From feca6609390d4642418cf7aab878e654964510c4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 4 Oct 2010 15:08:03 -0700 Subject: i965: Fix up IF/ELSE/ENDIF for gen6. The jump delta is now in the part of the instruction where the destination fields used to be, and the src args are ignored (or not, for the new non-predicated IF that we don't use yet). --- src/mesa/drivers/dri/i965/brw_disasm.c | 5 ++ src/mesa/drivers/dri/i965/brw_eu_emit.c | 86 ++++++++++++++++++++++++--------- src/mesa/drivers/dri/i965/brw_structs.h | 12 +++++ 3 files changed, 79 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index 3a93b25377..be27f9226c 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -892,7 +892,12 @@ int brw_disasm (FILE *file, struct brw_instruction *inst, int gen) if (opcode[inst->header.opcode].ndst > 0) { pad (file, 16); 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)) { + format (file, " %d", inst->bits1.branch_gen6.jump_count); } + if (opcode[inst->header.opcode].nsrc > 0) { pad (file, 32); err |= src0 (file, inst); diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index fbc6894d05..419b40ba84 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -787,6 +787,7 @@ struct brw_instruction *brw_JMPI(struct brw_compile *p, */ struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size) { + struct intel_context *intel = &p->brw->intel; struct brw_instruction *insn; if (p->single_program_flow) { @@ -800,9 +801,15 @@ struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size) /* Override the defaults for this instruction: */ - brw_set_dest(insn, brw_ip_reg()); - brw_set_src0(insn, brw_ip_reg()); - brw_set_src1(insn, brw_imm_d(0x0)); + if (intel->gen < 6) { + brw_set_dest(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_src0(insn, brw_null_reg()); + brw_set_src1(insn, brw_null_reg()); + } insn->header.execution_size = execute_size; insn->header.compression_control = BRW_COMPRESSION_NONE; @@ -835,9 +842,15 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p, insn = next_insn(p, BRW_OPCODE_ELSE); } - brw_set_dest(insn, brw_ip_reg()); - brw_set_src0(insn, brw_ip_reg()); - brw_set_src1(insn, brw_imm_d(0x0)); + if (intel->gen < 6) { + brw_set_dest(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_src0(insn, brw_null_reg()); + brw_set_src1(insn, brw_null_reg()); + } insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.execution_size = if_insn->header.execution_size; @@ -854,9 +867,13 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p, } else { assert(if_insn->header.opcode == BRW_OPCODE_IF); - if_insn->bits3.if_else.jump_count = br * (insn - if_insn); - if_insn->bits3.if_else.pop_count = 0; - if_insn->bits3.if_else.pad0 = 0; + if (intel->gen < 6) { + if_insn->bits3.if_else.jump_count = br * (insn - if_insn); + if_insn->bits3.if_else.pop_count = 0; + if_insn->bits3.if_else.pad0 = 0; + } else { + if_insn->bits1.branch_gen6.jump_count = br * (insn - if_insn + 1); + } } return insn; @@ -884,9 +901,15 @@ void brw_ENDIF(struct brw_compile *p, } else { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_ENDIF); - brw_set_dest(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)); + if (intel->gen < 6) { + brw_set_dest(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, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_W)); + brw_set_src0(insn, brw_null_reg()); + brw_set_src1(insn, brw_null_reg()); + } insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.execution_size = patch_insn->header.execution_size; @@ -900,26 +923,41 @@ void brw_ENDIF(struct brw_compile *p, */ if (patch_insn->header.opcode == BRW_OPCODE_IF) { if (intel->gen < 6) { - /* Automagically turn it into an IFF: + /* Turn it into an IFF, which means no mask stack operations for + * all-false and jumping past the ENDIF. */ patch_insn->header.opcode = BRW_OPCODE_IFF; + patch_insn->bits3.if_else.jump_count = br * (insn - patch_insn + 1); + patch_insn->bits3.if_else.pop_count = 0; + patch_insn->bits3.if_else.pad0 = 0; + } else { + /* As of gen6, there is no IFF and IF must point to the ENDIF. */ + patch_insn->bits1.branch_gen6.jump_count = br * (insn - patch_insn); } - patch_insn->bits3.if_else.jump_count = br * (insn - patch_insn + 1); - patch_insn->bits3.if_else.pop_count = 0; - patch_insn->bits3.if_else.pad0 = 0; - } else if (patch_insn->header.opcode == BRW_OPCODE_ELSE) { - patch_insn->bits3.if_else.jump_count = br * (insn - patch_insn + 1); - patch_insn->bits3.if_else.pop_count = 1; - patch_insn->bits3.if_else.pad0 = 0; } else { - assert(0); + assert(patch_insn->header.opcode == BRW_OPCODE_ELSE); + if (intel->gen < 6) { + /* BRW_OPCODE_ELSE pre-gen6 should point just past the + * matching ENDIF. + */ + patch_insn->bits3.if_else.jump_count = br * (insn - patch_insn + 1); + patch_insn->bits3.if_else.pop_count = 1; + patch_insn->bits3.if_else.pad0 = 0; + } else { + /* BRW_OPCODE_ELSE on gen6 should point to the matching ENDIF. */ + patch_insn->bits1.branch_gen6.jump_count = br * (insn - patch_insn); + } } /* Also pop item off the stack in the endif instruction: */ - insn->bits3.if_else.jump_count = 0; - insn->bits3.if_else.pop_count = 1; - insn->bits3.if_else.pad0 = 0; + if (intel->gen < 6) { + insn->bits3.if_else.jump_count = 0; + insn->bits3.if_else.pop_count = 1; + insn->bits3.if_else.pad0 = 0; + } else { + insn->bits1.branch_gen6.jump_count = 2; + } } } diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 7b919872c4..8ce9af9c4f 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -1381,6 +1381,18 @@ struct brw_instruction GLuint dest_horiz_stride:2; GLuint dest_address_mode:1; } ia16; + + struct { + GLuint dest_reg_file:2; + GLuint dest_reg_type:3; + GLuint src0_reg_file:2; + GLuint src0_reg_type:3; + GLuint src1_reg_file:2; + GLuint src1_reg_type:3; + GLuint pad:1; + + GLint jump_count:16; + } branch_gen6; } bits1; -- cgit v1.2.3 From 5eeaf3671e2f913d38187fd1401c4b22a2900d57 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 11:25:05 -0700 Subject: i965: Fix botch in the header_present case in the new FS. I only set it on the color_regions == 0 case, missing the important case, causing GPU hangs on pre-gen6. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index a380eb4452..6e5ea0782e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1920,6 +1920,7 @@ fs_visitor::emit_fb_writes() inst->mlen = nr; if (target == c->key.nr_color_regions - 1) inst->eot = true; + inst->header_present = header_present; } if (c->key.nr_color_regions == 0) { -- cgit v1.2.3 From 5d99b01501128c7179cdd6aa29bc8953d0d81e75 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 10:22:22 -0700 Subject: i965: Add some clarification of the WECtrl field. --- src/mesa/drivers/dri/i965/brw_defines.h | 21 +++++++++++++++++++-- src/mesa/drivers/dri/i965/brw_disasm.c | 4 ++-- 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index f9c12e1555..9633c95ff5 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -501,9 +501,26 @@ #define BRW_MASK_ENABLE 0 #define BRW_MASK_DISABLE 1 -/* Sandybridge is WECtrl (Write enable control) */ +/** @{ + * + * Gen6 has replaced "mask enable/disable" with WECtrl, which is + * effectively the same but much simpler to think about. Now, there + * are two contributors ANDed together to whether channels are + * executed: The predication on the instruction, and the channel write + * enable. + */ +/** + * This is the default value. It means that a channel's write enable is set + * if the per-channel IP is pointing at this instruction. + */ #define BRW_WE_NORMAL 0 -#define BRW_WE_KILL_PRED 1 +/** + * This is used like BRW_MASK_DISABLE, and causes all channels to have + * their write enable set. Note that predication still contributes to + * whether the channel actually gets written. + */ +#define BRW_WE_ALL 1 +/** @} */ #define BRW_OPCODE_MOV 1 #define BRW_OPCODE_SEL 2 diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index be27f9226c..12b8f2e467 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -165,8 +165,8 @@ char *accwr[2] = { }; char *wectrl[2] = { - [0] = "WEnormal", - [1] = "WEpredicted" + [0] = "WE_normal", + [1] = "WE_all" }; char *exec_size[8] = { -- cgit v1.2.3 From fe6efc25ed3c1edf26073c4e6b6a3a45c857c1eb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 11:00:31 -0700 Subject: i965: Don't do 1/w multiplication in new FS for gen6 Not needed now that we're doing barycentric. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 6e5ea0782e..7327c3a700 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -810,12 +810,14 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) } 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++; + if (intel->gen < 6) { + 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++; } -- cgit v1.2.3 From 75270f705f319b0ecf297d1bdd328e52a8a956aa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 11:04:02 -0700 Subject: i965: Gen6's sampler messages are the same as Ironlake. This should fix texturing in the new FS backend. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 7327c3a700..1973990161 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2054,7 +2054,7 @@ fs_visitor::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src) int rlen = 4; uint32_t simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD8; - if (intel->gen == 5) { + if (intel->gen >= 5) { switch (inst->opcode) { case FS_OPCODE_TEX: if (inst->shadow_compare) { -- cgit v1.2.3 From a760b5b509f85991a10400977576afabcedbb3c5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 11:13:22 -0700 Subject: i965: Refactor gl_FrontFacing setup out of general variable setup. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 53 +++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 1973990161..c5013f0574 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -474,8 +474,9 @@ public: void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src); void emit_dummy_fs(); - void emit_fragcoord_interpolation(ir_variable *ir); - void emit_general_interpolation(ir_variable *ir); + fs_reg *emit_fragcoord_interpolation(ir_variable *ir); + fs_reg *emit_frontfacing_interpolation(ir_variable *ir); + fs_reg *emit_general_interpolation(ir_variable *ir); void emit_interpolation_setup_gen4(); void emit_interpolation_setup_gen6(); fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst, fs_reg coordinate); @@ -721,7 +722,7 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir) } } -void +fs_reg * fs_visitor::emit_fragcoord_interpolation(ir_variable *ir) { fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); @@ -761,11 +762,10 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir) /* gl_FragCoord.w: Already set up in emit_interpolation */ emit(fs_inst(BRW_OPCODE_MOV, wpos, this->wpos_w)); - hash_table_insert(this->variable_ht, reg, ir); + return reg; } - -void +fs_reg * fs_visitor::emit_general_interpolation(ir_variable *ir) { fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); @@ -823,7 +823,25 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) } } - hash_table_insert(this->variable_ht, reg, ir); + return reg; +} + +fs_reg * +fs_visitor::emit_frontfacing_interpolation(ir_variable *ir) +{ + fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); + struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); + /* bit 31 is "primitive is back face", so checking < (1 << 31) gives + * us front face + */ + fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, + *reg, + fs_reg(r1_6ud), + fs_reg(1u << 31))); + inst->conditional_mod = BRW_CONDITIONAL_L; + emit(fs_inst(BRW_OPCODE_AND, *reg, *reg, fs_reg(1u))); + + return reg; } void @@ -844,24 +862,15 @@ fs_visitor::visit(ir_variable *ir) if (ir->mode == ir_var_in) { if (!strcmp(ir->name, "gl_FragCoord")) { - emit_fragcoord_interpolation(ir); - return; + reg = emit_fragcoord_interpolation(ir); } else if (!strcmp(ir->name, "gl_FrontFacing")) { - reg = new(this->mem_ctx) fs_reg(this, ir->type); - struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); - /* bit 31 is "primitive is back face", so checking < (1 << 31) gives - * us front face - */ - fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, - *reg, - fs_reg(r1_6ud), - fs_reg(1u << 31))); - inst->conditional_mod = BRW_CONDITIONAL_L; - emit(fs_inst(BRW_OPCODE_AND, *reg, *reg, fs_reg(1u))); + reg = emit_frontfacing_interpolation(ir); } else { - emit_general_interpolation(ir); - return; + reg = emit_general_interpolation(ir); } + assert(reg); + hash_table_insert(this->variable_ht, reg, ir); + return; } if (ir->mode == ir_var_uniform) { -- cgit v1.2.3 From 1fdc8c007ea66b4c9866bf2c679653a005307fa5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 11:19:48 -0700 Subject: i965: Add support for gl_FrontFacing on gen6. Fixes glsl1-gl_FrontFacing var (2) with new FS. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 49 ++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index c5013f0574..1ccf695a59 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -830,16 +830,33 @@ fs_reg * fs_visitor::emit_frontfacing_interpolation(ir_variable *ir) { fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); - struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); - /* bit 31 is "primitive is back face", so checking < (1 << 31) gives - * us front face - */ - fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, - *reg, - fs_reg(r1_6ud), - fs_reg(1u << 31))); - inst->conditional_mod = BRW_CONDITIONAL_L; - emit(fs_inst(BRW_OPCODE_AND, *reg, *reg, fs_reg(1u))); + + /* The frontfacing comes in as a bit in the thread payload. */ + if (intel->gen >= 6) { + emit(fs_inst(BRW_OPCODE_ASR, + *reg, + fs_reg(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_D)), + fs_reg(15))); + emit(fs_inst(BRW_OPCODE_NOT, + *reg, + *reg)); + emit(fs_inst(BRW_OPCODE_AND, + *reg, + *reg, + fs_reg(1))); + } else { + fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); + struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); + /* bit 31 is "primitive is back face", so checking < (1 << 31) gives + * us front face + */ + fs_inst *inst = emit(fs_inst(BRW_OPCODE_CMP, + *reg, + fs_reg(r1_6ud), + fs_reg(1u << 31))); + inst->conditional_mod = BRW_CONDITIONAL_L; + emit(fs_inst(BRW_OPCODE_AND, *reg, *reg, fs_reg(1u))); + } return reg; } @@ -2818,6 +2835,18 @@ fs_visitor::generate_code() case BRW_OPCODE_XOR: brw_XOR(p, dst, src[0], src[1]); break; + case BRW_OPCODE_NOT: + brw_NOT(p, dst, src[0]); + break; + case BRW_OPCODE_ASR: + brw_ASR(p, dst, src[0], src[1]); + break; + case BRW_OPCODE_SHR: + brw_SHR(p, dst, src[0], src[1]); + break; + case BRW_OPCODE_SHL: + brw_SHL(p, dst, src[0], src[1]); + break; case BRW_OPCODE_CMP: brw_CMP(p, dst, inst->conditional_mod, src[0], src[1]); -- cgit v1.2.3 From b380531fd40e0876218b1116502bafea7911bd3d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 12:10:31 -0700 Subject: i965: Don't assume that WPOS is always provided on gen6 in the new FS. We sensibly only provide it if the FS asks for it. We could actually skip WPOS unless the FS needed WPOS.zw, but that's something for later. Fixes: glsl-texture2d and probably many others. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 1ccf695a59..b93c27ec8f 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2258,8 +2258,7 @@ fs_visitor::calculate_urb_setup() /* Figure out where each of the incoming setup attributes lands. */ if (intel->gen >= 6) { for (unsigned int i = 0; i < FRAG_ATTRIB_MAX; i++) { - if (i == FRAG_ATTRIB_WPOS || - (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(i))) { + if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(i)) { urb_setup[i] = urb_next++; } } -- cgit v1.2.3 From d3163912c1f15fcb44beb33c5069799d56e1dc16 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Oct 2010 17:29:29 -0700 Subject: i965: Fix gen6 pointsize handling to match pre-gen6. Fixes point-line-no-cull. Bug #30532 --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 6c88338195..b2a6bd04e2 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -125,7 +125,8 @@ upload_sf_state(struct brw_context *brw) } /* _NEW_POINT */ - if (ctx->Point._Attenuated) + if (!(ctx->VertexProgram.PointSizeEnabled || + ctx->Point._Attenuated)) dw4 |= GEN6_SF_USE_STATE_POINT_WIDTH; dw4 |= U_FIXED(CLAMP(ctx->Point.Size, 0.125, 225.875), 3) << -- cgit v1.2.3 From 1d595c7cd4aefc7baf1942626f53bec8f6699f7f Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 7 Oct 2010 17:03:53 -0400 Subject: gles2: Add GL_EXT_texture_format_BGRA8888 support --- src/mesa/drivers/dri/intel/intel_extensions_es2.c | 1 + src/mesa/main/APIspec.xml | 11 ++++++++++- src/mesa/main/extensions.c | 4 ++++ src/mesa/main/mtypes.h | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_extensions_es2.c b/src/mesa/drivers/dri/intel/intel_extensions_es2.c index 24f64045ef..ed5db20e38 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions_es2.c +++ b/src/mesa/drivers/dri/intel/intel_extensions_es2.c @@ -69,6 +69,7 @@ static const char *es2_extensions[] = { "GL_ARB_depth_texture", "GL_EXT_packed_depth_stencil", "GL_EXT_framebuffer_object", + "GL_EXT_texture_format_BGRA8888", #if FEATURE_OES_EGL_image "GL_OES_EGL_image", diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 4c5fd59d4f..4dc0b0d485 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -383,6 +383,7 @@ + @@ -458,11 +459,18 @@ - + + + + + + + +