struct gl_texture_image *newImage
= att->Texture->Image[att->CubeMapFace][att->TextureLevel];
struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
- struct intel_texture_image *intel_image;
+ struct st_texture_image *st_image;
GLuint imageOffset;
(void) fb;
irb->Base.RefCount);
/* point the renderbufer's region to the texture image region */
- intel_image = intel_texture_image(newImage);
- if (irb->region != intel_image->mt->region) {
+ st_image = st_texture_image(newImage);
+ if (irb->region != st_image->mt->region) {
if (irb->region)
intel->pipe->region_release(intel->pipe, &irb->region);
- pipe_region_reference(&irb->region, intel_image->mt->region);
+ pipe_region_reference(&irb->region, st_image->mt->region);
}
/* compute offset of the particular 2D image within the texture region */
- imageOffset = st_miptree_image_offset(intel_image->mt,
+ imageOffset = st_miptree_image_offset(st_image->mt,
att->CubeMapFace,
att->TextureLevel);
if (att->Texture->Target == GL_TEXTURE_3D) {
- const GLuint *offsets = st_miptree_depth_offsets(intel_image->mt,
+ const GLuint *offsets = st_miptree_depth_offsets(st_image->mt,
att->TextureLevel);
imageOffset += offsets[att->Zoffset];
}
/* store that offset in the region */
- intel_image->mt->region->draw_offset = imageOffset;
+ st_image->mt->region->draw_offset = imageOffset;
/* update drawing region, etc */
intel_draw_buffer(ctx, fb);
{
#if 0
struct intel_context *intel = intel_context(ctx);
- struct intel_texture_object *intelObj = intel_texture_object(texObj);
+ struct st_texture_object *stObj = st_texture_object(texObj);
return
- intelObj->mt &&
- intelObj->mt->region &&
- intel_is_region_resident(intel, intelObj->mt->region);
+ stObj->mt &&
+ stObj->mt->region &&
+ intel_is_region_resident(intel, stObj->mt->region);
#endif
return 1;
}
{
DBG("%s\n", __FUNCTION__);
(void) ctx;
- return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image);
+ return (struct gl_texture_image *) CALLOC_STRUCT(st_texture_image);
}
static struct gl_texture_object *
intelNewTextureObject(GLcontext * ctx, GLuint name, GLenum target)
{
- struct intel_texture_object *obj = CALLOC_STRUCT(intel_texture_object);
+ struct st_texture_object *obj = CALLOC_STRUCT(st_texture_object);
DBG("%s\n", __FUNCTION__);
_mesa_initialize_texture_object(&obj->base, name, target);
struct gl_texture_object *texObj)
{
struct intel_context *intel = intel_context(ctx);
- struct intel_texture_object *intelObj = intel_texture_object(texObj);
+ struct st_texture_object *stObj = st_texture_object(texObj);
- if (intelObj->mt)
- st_miptree_release(intel->pipe, &intelObj->mt);
+ if (stObj->mt)
+ st_miptree_release(intel->pipe, &stObj->mt);
_mesa_delete_texture_object(ctx, texObj);
}
intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
{
struct intel_context *intel = intel_context(ctx);
- struct intel_texture_image *intelImage = intel_texture_image(texImage);
+ struct st_texture_image *stImage = st_texture_image(texImage);
DBG("%s\n", __FUNCTION__);
- if (intelImage->mt) {
- st_miptree_release(intel->pipe, &intelImage->mt);
+ if (stImage->mt) {
+ st_miptree_release(intel->pipe, &stImage->mt);
}
if (texImage->Data) {
#include "intel_context.h"
#include "texmem.h"
-struct intel_texture_object
+struct st_texture_object
{
struct gl_texture_object base; /* The "parent" object */
-struct intel_texture_image
+struct st_texture_image
{
struct gl_texture_image base;
GLuint level;
GLuint face;
- /* If intelImage->mt != NULL, image data is stored here.
- * Else if intelImage->base.Data != NULL, image is stored there.
+ /* If stImage->mt != NULL, image data is stored here.
+ * Else if stImage->base.Data != NULL, image is stored there.
* Else there is no image data.
*/
struct pipe_mipmap_tree *mt;
#if 0
void intel_tex_map_images(struct pipe_context *pipe,
- struct intel_texture_object *intelObj);
+ struct st_texture_object *stObj);
void intel_tex_unmap_images(struct pipe_context *pipe,
- struct intel_texture_object *intelObj);
+ struct st_texture_object *stObj);
#endif
int intel_compressed_num_bytes(GLuint mesaFormat);
-static INLINE struct intel_texture_object *
-intel_texture_object(struct gl_texture_object *obj)
+static INLINE struct st_texture_object *
+st_texture_object(struct gl_texture_object *obj)
{
- return (struct intel_texture_object *) obj;
+ return (struct st_texture_object *) obj;
}
-static INLINE struct intel_texture_image *
-intel_texture_image(struct gl_texture_image *img)
+static INLINE struct st_texture_image *
+st_texture_image(struct gl_texture_image *img)
{
- return (struct intel_texture_image *) img;
+ return (struct st_texture_image *) img;
}
static GLboolean
do_copy_texsubimage(struct intel_context *intel,
- struct intel_texture_image *intelImage,
+ struct st_texture_image *intelImage,
GLenum internalFormat,
GLint dstx, GLint dsty,
GLint x, GLint y, GLsizei width, GLsizei height)
&ctx->DefaultPacking, texObj, texImage);
if (!do_copy_texsubimage(intel_context(ctx),
- intel_texture_image(texImage),
+ st_texture_image(texImage),
internalFormat, 0, 0, x, y, width, 1))
goto fail;
if (!do_copy_texsubimage(intel_context(ctx),
- intel_texture_image(texImage),
+ st_texture_image(texImage),
internalFormat, 0, 0, x, y, width, height))
goto fail;
*/
if (!do_copy_texsubimage(intel_context(ctx),
- intel_texture_image(texImage),
+ st_texture_image(texImage),
internalFormat, xoffset, 0, x, y, width, 1)) {
#if 0
_swrast_copy_texsubimage1d(ctx, target, level, xoffset, x, y, width);
*/
if (!do_copy_texsubimage(intel_context(ctx),
- intel_texture_image(texImage),
+ st_texture_image(texImage),
internalFormat,
xoffset, yoffset, x, y, width, height)) {
#if 0
* saving is worth it.
*/
static void
-guess_and_alloc_mipmap_tree(struct intel_context *intel,
- struct intel_texture_object *intelObj,
- struct intel_texture_image *intelImage)
+guess_and_alloc_mipmap_tree(struct pipe_context *pipe,
+ struct st_texture_object *intelObj,
+ struct st_texture_image *intelImage)
{
GLuint firstLevel;
GLuint lastLevel;
assert(!intelObj->mt);
if (intelImage->base.IsCompressed)
comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
- intelObj->mt = st_miptree_create(intel->pipe,
+ intelObj->mt = st_miptree_create(pipe,
intelObj->base.Target,
intelImage->base.InternalFormat,
firstLevel,
*/
static GLboolean
try_pbo_upload(struct intel_context *intel,
- struct intel_texture_image *intelImage,
+ struct st_texture_image *intelImage,
const struct gl_pixelstore_attrib *unpack,
GLint internalFormat,
GLint width, GLint height,
static GLboolean
try_pbo_zcopy(struct intel_context *intel,
- struct intel_texture_image *intelImage,
+ struct st_texture_image *intelImage,
const struct gl_pixelstore_attrib *unpack,
GLint internalFormat,
GLint width, GLint height,
struct gl_texture_image *texImage, GLsizei imageSize, int compressed)
{
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);
+ struct st_texture_object *intelObj = st_texture_object(texObj);
+ struct st_texture_image *intelImage = st_texture_image(texImage);
GLint postConvWidth = width;
GLint postConvHeight = height;
GLint texelBytes, sizeInBytes;
}
if (!intelObj->mt) {
- guess_and_alloc_mipmap_tree(intel, intelObj, intelImage);
+ guess_and_alloc_mipmap_tree(intel->pipe, intelObj, intelImage);
if (!intelObj->mt) {
DBG("guess_and_alloc_mipmap_tree: failed\n");
}
struct gl_texture_image *texImage, int compressed)
{
struct intel_context *intel = intel_context(ctx);
- struct intel_texture_image *intelImage = intel_texture_image(texImage);
+ struct st_texture_image *intelImage = st_texture_image(texImage);
/* Map */
if (intelImage->mt) {
struct intel_context *intel = (struct intel_context*)
((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
- struct intel_texture_object *intelObj = intel_texture_object(tObj);
+ struct st_texture_object *stObj = st_texture_object(tObj);
- if (!intelObj)
+ if (!stObj)
return;
- if (intelObj->mt)
- st_miptree_release(intel->pipe, &intelObj->mt);
+ if (stObj->mt)
+ st_miptree_release(intel->pipe, &stObj->mt);
- intelObj->imageOverride = GL_TRUE;
- intelObj->depthOverride = depth;
- intelObj->pitchOverride = pitch;
+ stObj->imageOverride = GL_TRUE;
+ stObj->depthOverride = depth;
+ stObj->pitchOverride = pitch;
if (offset)
- intelObj->textureOffset = offset;
+ stObj->textureOffset = offset;
}
struct gl_texture_image *texImage)
{
struct intel_context *intel = intel_context(ctx);
- struct intel_texture_image *intelImage = intel_texture_image(texImage);
+ struct st_texture_image *intelImage = st_texture_image(texImage);
GLuint dstRowStride;
DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
* GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL.
*/
static void
-intel_calculate_first_last_level(struct intel_texture_object *intelObj)
+intel_calculate_first_last_level(struct st_texture_object *intelObj)
{
struct gl_texture_object *tObj = &intelObj->base;
const struct gl_texture_image *const baseImage =
static void
copy_image_data_to_tree(struct pipe_context *pipe,
- struct intel_texture_object *intelObj,
- struct intel_texture_image *intelImage)
+ struct st_texture_object *intelObj,
+ struct st_texture_image *intelImage)
{
if (intelImage->mt) {
/* Copy potentially with the blitter:
GLboolean *needFlush)
{
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
- struct intel_texture_object *intelObj = intel_texture_object(tObj);
+ struct st_texture_object *intelObj = st_texture_object(tObj);
int comp_byte = 0;
int cpp;
GLuint face, i;
GLuint nr_faces = 0;
- struct intel_texture_image *firstImage;
+ struct st_texture_image *firstImage;
*needFlush = GL_FALSE;
*/
intel_calculate_first_last_level(intelObj);
firstImage =
- intel_texture_image(intelObj->base.Image[0][intelObj->firstLevel]);
+ st_texture_image(intelObj->base.Image[0][intelObj->firstLevel]);
/* Fallback case:
*/
nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
for (face = 0; face < nr_faces; face++) {
for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
- struct intel_texture_image *intelImage =
- intel_texture_image(intelObj->base.Image[face][i]);
+ struct st_texture_image *intelImage =
+ st_texture_image(intelObj->base.Image[face][i]);
/* Need to import images in main memory or held in other trees.
*/
#if 0 /* unused? */
void
intel_tex_map_images(struct pipe_context *pipe,
- struct intel_texture_object *intelObj)
+ struct st_texture_object *intelObj)
{
GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
GLuint face, i;
for (face = 0; face < nr_faces; face++) {
for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
- struct intel_texture_image *intelImage =
- intel_texture_image(intelObj->base.Image[face][i]);
+ struct st_texture_image *intelImage =
+ st_texture_image(intelObj->base.Image[face][i]);
if (intelImage->mt) {
intelImage->base.Data =
void
intel_tex_unmap_images(struct pipe_context *pipe,
- struct intel_texture_object *intelObj)
+ struct st_texture_object *intelObj)
{
GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
GLuint face, i;
for (face = 0; face < nr_faces; face++) {
for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
- struct intel_texture_image *intelImage =
- intel_texture_image(intelObj->base.Image[face][i]);
+ struct st_texture_image *intelImage =
+ st_texture_image(intelObj->base.Image[face][i]);
if (intelImage->mt) {
st_miptree_image_unmap(pipe, intelImage->mt);