diff options
author | Brian Paul <[email protected]> | 2015-01-02 16:56:12 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-01-05 13:50:55 -0700 |
commit | 934e41c0b31cffa4efc08f61cff2389e3149b3f3 (patch) | |
tree | 47f638f83ab5520de8fd1a94d1a413cde320ae7c /src/mesa/state_tracker | |
parent | f262ed6e3dd9d447355ea2490e84c0a6b0fd1ddb (diff) |
mesa: create, use new _mesa_texture_base_format() function
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_sampler.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index f8d7cd7f9b3..b68eb16d7be 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -134,7 +134,6 @@ convert_sampler(struct st_context *st, const struct gl_texture_object *texobj; struct gl_context *ctx = st->ctx; struct gl_sampler_object *msamp; - const struct gl_texture_image *teximg; GLenum texBaseFormat; texobj = ctx->Texture.Unit[texUnit]._Current; @@ -142,8 +141,7 @@ convert_sampler(struct st_context *st, texobj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX); } - teximg = _mesa_base_tex_image_const(texobj); - texBaseFormat = teximg ? teximg->_BaseFormat : GL_RGBA; + texBaseFormat = _mesa_texture_base_format(texobj); msamp = _mesa_get_samplerobj(ctx, texUnit); diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index c95e36abc0f..eff28fc6f37 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -176,12 +176,11 @@ compute_texture_format_swizzle(GLenum baseFormat, GLenum depthMode, static unsigned get_texture_format_swizzle(const struct st_texture_object *stObj) { - const struct gl_texture_image *texImage = - _mesa_base_tex_image_const(&stObj->base); + GLenum baseFormat = _mesa_texture_base_format(&stObj->base); unsigned tex_swizzle; - if (texImage) { - tex_swizzle = compute_texture_format_swizzle(texImage->_BaseFormat, + if (baseFormat != GL_NONE) { + tex_swizzle = compute_texture_format_swizzle(baseFormat, stObj->base.DepthMode, stObj->pt->format); } |