This involved adding a new st_texture_image_const() helper also.
Reviewed-by: Eric Anholt <eric@anholt.net>
#include "main/mtypes.h"
#include "main/glformats.h"
#include "main/samplerobj.h"
+#include "main/teximage.h"
#include "main/texobj.h"
#include "st_context.h"
texobj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX);
}
- teximg = texobj->Image[0][texobj->BaseLevel];
+ teximg = _mesa_base_tex_image_const(texobj);
texBaseFormat = teximg ? teximg->_BaseFormat : GL_RGBA;
msamp = _mesa_get_samplerobj(ctx, texUnit);
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/samplerobj.h"
+#include "main/teximage.h"
#include "main/texobj.h"
#include "program/prog_instruction.h"
get_texture_format_swizzle(const struct st_texture_object *stObj)
{
const struct gl_texture_image *texImage =
- stObj->base.Image[0][stObj->base.BaseLevel];
+ _mesa_base_tex_image_const(&stObj->base);
unsigned tex_swizzle;
if (texImage) {
#include "main/imports.h"
#include "main/image.h"
#include "main/macros.h"
+#include "main/teximage.h"
#include "program/program.h"
#include "program/prog_print.h"
if (ctx->Texture.Unit[i]._Current &&
ctx->Texture.Unit[i]._Current->Target == GL_TEXTURE_2D) {
struct gl_texture_object *obj = ctx->Texture.Unit[i]._Current;
- struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
+ const struct gl_texture_image *img = _mesa_base_tex_image(obj);
const GLfloat wt = (GLfloat) img->Width;
const GLfloat ht = (GLfloat) img->Height;
const GLfloat s0 = obj->CropRect[0] / wt;
struct st_texture_object *stObj = st_texture_object(tObj);
const GLuint nr_faces = (stObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
GLuint face;
- struct st_texture_image *firstImage;
+ const struct st_texture_image *firstImage;
enum pipe_format firstImageFormat;
GLuint ptWidth, ptHeight, ptDepth, ptLayers, ptNumSamples;
}
- firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);
+ firstImage = st_texture_image_const(_mesa_base_tex_image(&stObj->base));
assert(firstImage);
/* If both firstImage and stObj point to a texture which can contain
return (struct st_texture_image *) img;
}
+static INLINE const struct st_texture_image *
+st_texture_image_const(const struct gl_texture_image *img)
+{
+ return (const struct st_texture_image *) img;
+}
+
static INLINE struct st_texture_object *
st_texture_object(struct gl_texture_object *obj)
{