mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
remove intel dependencies from intel_mipmap_tree.c
This commit is contained in:
parent
e6c8691b1a
commit
681f04f6d3
8 changed files with 68 additions and 69 deletions
|
|
@ -566,12 +566,12 @@ intel_render_texture(GLcontext * ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compute offset of the particular 2D image within the texture region */
|
/* compute offset of the particular 2D image within the texture region */
|
||||||
imageOffset = intel_miptree_image_offset(intel_image->mt,
|
imageOffset = st_miptree_image_offset(intel_image->mt,
|
||||||
att->CubeMapFace,
|
att->CubeMapFace,
|
||||||
att->TextureLevel);
|
att->TextureLevel);
|
||||||
|
|
||||||
if (att->Texture->Target == GL_TEXTURE_3D) {
|
if (att->Texture->Target == GL_TEXTURE_3D) {
|
||||||
const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt,
|
const GLuint *offsets = st_miptree_depth_offsets(intel_image->mt,
|
||||||
att->TextureLevel);
|
att->TextureLevel);
|
||||||
imageOffset += offsets[att->Zoffset];
|
imageOffset += offsets[att->Zoffset];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
*
|
*
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "intel_context.h"
|
|
||||||
#include "intel_mipmap_tree.h"
|
#include "intel_mipmap_tree.h"
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
|
|
||||||
|
|
@ -52,7 +51,7 @@ target_to_target(GLenum target)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pipe_mipmap_tree *
|
struct pipe_mipmap_tree *
|
||||||
intel_miptree_create(struct intel_context *intel,
|
st_miptree_create(struct pipe_context *pipe,
|
||||||
GLenum target,
|
GLenum target,
|
||||||
GLenum internal_format,
|
GLenum internal_format,
|
||||||
GLuint first_level,
|
GLuint first_level,
|
||||||
|
|
@ -79,9 +78,9 @@ intel_miptree_create(struct intel_context *intel,
|
||||||
mt->compressed = compress_byte ? 1 : 0;
|
mt->compressed = compress_byte ? 1 : 0;
|
||||||
mt->refcount = 1;
|
mt->refcount = 1;
|
||||||
|
|
||||||
ok = intel->pipe->mipmap_tree_layout(intel->pipe, mt);
|
ok = pipe->mipmap_tree_layout(pipe, mt);
|
||||||
if (ok)
|
if (ok)
|
||||||
mt->region = intel->pipe->region_alloc(intel->pipe,
|
mt->region = pipe->region_alloc(pipe,
|
||||||
mt->cpp, mt->pitch, mt->total_height);
|
mt->cpp, mt->pitch, mt->total_height);
|
||||||
|
|
||||||
if (!mt->region) {
|
if (!mt->region) {
|
||||||
|
|
@ -94,7 +93,7 @@ intel_miptree_create(struct intel_context *intel,
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
intel_miptree_reference(struct pipe_mipmap_tree **dst,
|
st_miptree_reference(struct pipe_mipmap_tree **dst,
|
||||||
struct pipe_mipmap_tree *src)
|
struct pipe_mipmap_tree *src)
|
||||||
{
|
{
|
||||||
src->refcount++;
|
src->refcount++;
|
||||||
|
|
@ -103,8 +102,8 @@ intel_miptree_reference(struct pipe_mipmap_tree **dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
intel_miptree_release(struct intel_context *intel,
|
st_miptree_release(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree **mt)
|
struct pipe_mipmap_tree **mt)
|
||||||
{
|
{
|
||||||
if (!*mt)
|
if (!*mt)
|
||||||
return;
|
return;
|
||||||
|
|
@ -115,7 +114,7 @@ intel_miptree_release(struct intel_context *intel,
|
||||||
|
|
||||||
DBG("%s deleting %p\n", __FUNCTION__, *mt);
|
DBG("%s deleting %p\n", __FUNCTION__, *mt);
|
||||||
|
|
||||||
intel->pipe->region_release(intel->pipe, &((*mt)->region));
|
pipe->region_release(pipe, &((*mt)->region));
|
||||||
|
|
||||||
for (i = 0; i < MAX_TEXTURE_LEVELS; i++)
|
for (i = 0; i < MAX_TEXTURE_LEVELS; i++)
|
||||||
if ((*mt)->level[i].image_offset)
|
if ((*mt)->level[i].image_offset)
|
||||||
|
|
@ -135,7 +134,7 @@ intel_miptree_release(struct intel_context *intel,
|
||||||
* Not sure whether I want to pass gl_texture_image here.
|
* Not sure whether I want to pass gl_texture_image here.
|
||||||
*/
|
*/
|
||||||
GLboolean
|
GLboolean
|
||||||
intel_miptree_match_image(struct pipe_mipmap_tree *mt,
|
st_miptree_match_image(struct pipe_mipmap_tree *mt,
|
||||||
struct gl_texture_image *image,
|
struct gl_texture_image *image,
|
||||||
GLuint face, GLuint level)
|
GLuint face, GLuint level)
|
||||||
{
|
{
|
||||||
|
|
@ -168,7 +167,7 @@ intel_miptree_match_image(struct pipe_mipmap_tree *mt,
|
||||||
* These functions present that view to mesa:
|
* These functions present that view to mesa:
|
||||||
*/
|
*/
|
||||||
const GLuint *
|
const GLuint *
|
||||||
intel_miptree_depth_offsets(struct pipe_mipmap_tree *mt, GLuint level)
|
st_miptree_depth_offsets(struct pipe_mipmap_tree *mt, GLuint level)
|
||||||
{
|
{
|
||||||
static const GLuint zero = 0;
|
static const GLuint zero = 0;
|
||||||
|
|
||||||
|
|
@ -180,8 +179,8 @@ intel_miptree_depth_offsets(struct pipe_mipmap_tree *mt, GLuint level)
|
||||||
|
|
||||||
|
|
||||||
GLuint
|
GLuint
|
||||||
intel_miptree_image_offset(struct pipe_mipmap_tree * mt,
|
st_miptree_image_offset(struct pipe_mipmap_tree * mt,
|
||||||
GLuint face, GLuint level)
|
GLuint face, GLuint level)
|
||||||
{
|
{
|
||||||
if (mt->target == GL_TEXTURE_CUBE_MAP_ARB)
|
if (mt->target == GL_TEXTURE_CUBE_MAP_ARB)
|
||||||
return (mt->level[level].level_offset +
|
return (mt->level[level].level_offset +
|
||||||
|
|
@ -199,7 +198,7 @@ intel_miptree_image_offset(struct pipe_mipmap_tree * mt,
|
||||||
* \return address of mapping
|
* \return address of mapping
|
||||||
*/
|
*/
|
||||||
GLubyte *
|
GLubyte *
|
||||||
intel_miptree_image_map(struct intel_context * intel,
|
st_miptree_image_map(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree * mt,
|
struct pipe_mipmap_tree * mt,
|
||||||
GLuint face,
|
GLuint face,
|
||||||
GLuint level,
|
GLuint level,
|
||||||
|
|
@ -215,17 +214,17 @@ intel_miptree_image_map(struct intel_context * intel,
|
||||||
memcpy(image_offsets, mt->level[level].image_offset,
|
memcpy(image_offsets, mt->level[level].image_offset,
|
||||||
mt->level[level].depth * sizeof(GLuint));
|
mt->level[level].depth * sizeof(GLuint));
|
||||||
|
|
||||||
ptr = intel->pipe->region_map(intel->pipe, mt->region);
|
ptr = pipe->region_map(pipe, mt->region);
|
||||||
|
|
||||||
return ptr + intel_miptree_image_offset(mt, face, level);
|
return ptr + st_miptree_image_offset(mt, face, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
intel_miptree_image_unmap(struct intel_context *intel,
|
st_miptree_image_unmap(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree *mt)
|
struct pipe_mipmap_tree *mt)
|
||||||
{
|
{
|
||||||
DBG("%s\n", __FUNCTION__);
|
DBG("%s\n", __FUNCTION__);
|
||||||
intel->pipe->region_unmap(intel->pipe, mt->region);
|
pipe->region_unmap(pipe, mt->region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -233,7 +232,7 @@ intel_miptree_image_unmap(struct intel_context *intel,
|
||||||
/* Upload data for a particular image.
|
/* Upload data for a particular image.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
intel_miptree_image_data(struct intel_context *intel,
|
st_miptree_image_data(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree *dst,
|
struct pipe_mipmap_tree *dst,
|
||||||
GLuint face,
|
GLuint face,
|
||||||
GLuint level,
|
GLuint level,
|
||||||
|
|
@ -241,8 +240,8 @@ intel_miptree_image_data(struct intel_context *intel,
|
||||||
GLuint src_row_pitch, GLuint src_image_pitch)
|
GLuint src_row_pitch, GLuint src_image_pitch)
|
||||||
{
|
{
|
||||||
GLuint depth = dst->level[level].depth;
|
GLuint depth = dst->level[level].depth;
|
||||||
GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
|
GLuint dst_offset = st_miptree_image_offset(dst, face, level);
|
||||||
const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level);
|
const GLuint *dst_depth_offset = st_miptree_depth_offsets(dst, level);
|
||||||
GLuint i;
|
GLuint i;
|
||||||
GLuint height = 0;
|
GLuint height = 0;
|
||||||
|
|
||||||
|
|
@ -251,7 +250,7 @@ intel_miptree_image_data(struct intel_context *intel,
|
||||||
height = dst->level[level].height;
|
height = dst->level[level].height;
|
||||||
if(dst->compressed)
|
if(dst->compressed)
|
||||||
height /= 4;
|
height /= 4;
|
||||||
intel->pipe->region_data(intel->pipe, dst->region,
|
pipe->region_data(pipe, dst->region,
|
||||||
dst_offset + dst_depth_offset[i], /* dst_offset */
|
dst_offset + dst_depth_offset[i], /* dst_offset */
|
||||||
0, 0, /* dstx, dsty */
|
0, 0, /* dstx, dsty */
|
||||||
src,
|
src,
|
||||||
|
|
@ -266,7 +265,7 @@ intel_miptree_image_data(struct intel_context *intel,
|
||||||
/* Copy mipmap image between trees
|
/* Copy mipmap image between trees
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
intel_miptree_image_copy(struct intel_context *intel,
|
st_miptree_image_copy(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree *dst,
|
struct pipe_mipmap_tree *dst,
|
||||||
GLuint face, GLuint level,
|
GLuint face, GLuint level,
|
||||||
struct pipe_mipmap_tree *src)
|
struct pipe_mipmap_tree *src)
|
||||||
|
|
@ -274,16 +273,16 @@ intel_miptree_image_copy(struct intel_context *intel,
|
||||||
GLuint width = src->level[level].width;
|
GLuint width = src->level[level].width;
|
||||||
GLuint height = src->level[level].height;
|
GLuint height = src->level[level].height;
|
||||||
GLuint depth = src->level[level].depth;
|
GLuint depth = src->level[level].depth;
|
||||||
GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
|
GLuint dst_offset = st_miptree_image_offset(dst, face, level);
|
||||||
GLuint src_offset = intel_miptree_image_offset(src, face, level);
|
GLuint src_offset = st_miptree_image_offset(src, face, level);
|
||||||
const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level);
|
const GLuint *dst_depth_offset = st_miptree_depth_offsets(dst, level);
|
||||||
const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level);
|
const GLuint *src_depth_offset = st_miptree_depth_offsets(src, level);
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
if (dst->compressed)
|
if (dst->compressed)
|
||||||
height /= 4;
|
height /= 4;
|
||||||
for (i = 0; i < depth; i++) {
|
for (i = 0; i < depth; i++) {
|
||||||
intel->pipe->region_copy(intel->pipe,
|
pipe->region_copy(pipe,
|
||||||
dst->region, dst_offset + dst_depth_offset[i],
|
dst->region, dst_offset + dst_depth_offset[i],
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
struct pipe_region;
|
struct pipe_region;
|
||||||
|
|
||||||
|
|
||||||
struct pipe_mipmap_tree *intel_miptree_create(struct intel_context *intel,
|
struct pipe_mipmap_tree *st_miptree_create(struct pipe_context *pipe,
|
||||||
GLenum target,
|
GLenum target,
|
||||||
GLenum internal_format,
|
GLenum internal_format,
|
||||||
GLuint first_level,
|
GLuint first_level,
|
||||||
|
|
@ -45,47 +45,47 @@ struct pipe_mipmap_tree *intel_miptree_create(struct intel_context *intel,
|
||||||
GLuint cpp,
|
GLuint cpp,
|
||||||
GLuint compress_byte);
|
GLuint compress_byte);
|
||||||
|
|
||||||
void intel_miptree_reference(struct pipe_mipmap_tree **dst,
|
void st_miptree_reference(struct pipe_mipmap_tree **dst,
|
||||||
struct pipe_mipmap_tree *src);
|
struct pipe_mipmap_tree *src);
|
||||||
|
|
||||||
void intel_miptree_release(struct intel_context *intel,
|
void st_miptree_release(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree **mt);
|
struct pipe_mipmap_tree **mt);
|
||||||
|
|
||||||
/* Check if an image fits an existing mipmap tree layout
|
/* Check if an image fits an existing mipmap tree layout
|
||||||
*/
|
*/
|
||||||
GLboolean intel_miptree_match_image(struct pipe_mipmap_tree *mt,
|
GLboolean st_miptree_match_image(struct pipe_mipmap_tree *mt,
|
||||||
struct gl_texture_image *image,
|
struct gl_texture_image *image,
|
||||||
GLuint face, GLuint level);
|
GLuint face, GLuint level);
|
||||||
|
|
||||||
/* Return a pointer to an image within a tree. Return image stride as
|
/* Return a pointer to an image within a tree. Return image stride as
|
||||||
* well.
|
* well.
|
||||||
*/
|
*/
|
||||||
GLubyte *intel_miptree_image_map(struct intel_context *intel,
|
GLubyte *st_miptree_image_map(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree *mt,
|
struct pipe_mipmap_tree *mt,
|
||||||
GLuint face,
|
GLuint face,
|
||||||
GLuint level,
|
GLuint level,
|
||||||
GLuint * row_stride, GLuint * image_stride);
|
GLuint * row_stride, GLuint * image_stride);
|
||||||
|
|
||||||
void intel_miptree_image_unmap(struct intel_context *intel,
|
void st_miptree_image_unmap(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree *mt);
|
struct pipe_mipmap_tree *mt);
|
||||||
|
|
||||||
|
|
||||||
/* Return the linear offset of an image relative to the start of the
|
/* Return the linear offset of an image relative to the start of the
|
||||||
* tree:
|
* tree:
|
||||||
*/
|
*/
|
||||||
GLuint intel_miptree_image_offset(struct pipe_mipmap_tree *mt,
|
GLuint st_miptree_image_offset(struct pipe_mipmap_tree *mt,
|
||||||
GLuint face, GLuint level);
|
GLuint face, GLuint level);
|
||||||
|
|
||||||
/* Return pointers to each 2d slice within an image. Indexed by depth
|
/* Return pointers to each 2d slice within an image. Indexed by depth
|
||||||
* value.
|
* value.
|
||||||
*/
|
*/
|
||||||
const GLuint *intel_miptree_depth_offsets(struct pipe_mipmap_tree *mt,
|
const GLuint *st_miptree_depth_offsets(struct pipe_mipmap_tree *mt,
|
||||||
GLuint level);
|
GLuint level);
|
||||||
|
|
||||||
|
|
||||||
/* Upload an image into a tree
|
/* Upload an image into a tree
|
||||||
*/
|
*/
|
||||||
void intel_miptree_image_data(struct intel_context *intel,
|
void st_miptree_image_data(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree *dst,
|
struct pipe_mipmap_tree *dst,
|
||||||
GLuint face,
|
GLuint face,
|
||||||
GLuint level,
|
GLuint level,
|
||||||
|
|
@ -94,7 +94,7 @@ void intel_miptree_image_data(struct intel_context *intel,
|
||||||
|
|
||||||
/* Copy an image between two trees
|
/* Copy an image between two trees
|
||||||
*/
|
*/
|
||||||
void intel_miptree_image_copy(struct intel_context *intel,
|
void st_miptree_image_copy(struct pipe_context *pipe,
|
||||||
struct pipe_mipmap_tree *dst,
|
struct pipe_mipmap_tree *dst,
|
||||||
GLuint face, GLuint level,
|
GLuint face, GLuint level,
|
||||||
struct pipe_mipmap_tree *src);
|
struct pipe_mipmap_tree *src);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ intelDeleteTextureObject(GLcontext *ctx,
|
||||||
struct intel_texture_object *intelObj = intel_texture_object(texObj);
|
struct intel_texture_object *intelObj = intel_texture_object(texObj);
|
||||||
|
|
||||||
if (intelObj->mt)
|
if (intelObj->mt)
|
||||||
intel_miptree_release(intel, &intelObj->mt);
|
st_miptree_release(intel->pipe, &intelObj->mt);
|
||||||
|
|
||||||
_mesa_delete_texture_object(ctx, texObj);
|
_mesa_delete_texture_object(ctx, texObj);
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
|
||||||
DBG("%s\n", __FUNCTION__);
|
DBG("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
intel_miptree_release(intel, &intelImage->mt);
|
st_miptree_release(intel->pipe, &intelImage->mt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texImage->Data) {
|
if (texImage->Data) {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ do_copy_texsubimage(struct intel_context *intel,
|
||||||
/* XXX still need the lock ? */
|
/* XXX still need the lock ? */
|
||||||
LOCK_HARDWARE(intel);
|
LOCK_HARDWARE(intel);
|
||||||
{
|
{
|
||||||
GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
|
GLuint image_offset = st_miptree_image_offset(intelImage->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level);
|
intelImage->level);
|
||||||
const GLint orig_x = x;
|
const GLint orig_x = x;
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
|
||||||
assert(!intelObj->mt);
|
assert(!intelObj->mt);
|
||||||
if (intelImage->base.IsCompressed)
|
if (intelImage->base.IsCompressed)
|
||||||
comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
|
comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
|
||||||
intelObj->mt = intel_miptree_create(intel,
|
intelObj->mt = st_miptree_create(intel->pipe,
|
||||||
intelObj->base.Target,
|
intelObj->base.Target,
|
||||||
intelImage->base.InternalFormat,
|
intelImage->base.InternalFormat,
|
||||||
firstLevel,
|
firstLevel,
|
||||||
|
|
@ -214,7 +214,7 @@ try_pbo_upload(struct intel_context *intel,
|
||||||
else
|
else
|
||||||
src_stride = width;
|
src_stride = width;
|
||||||
|
|
||||||
dst_offset = intel_miptree_image_offset(intelImage->mt,
|
dst_offset = st_miptree_image_offset(intelImage->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level);
|
intelImage->level);
|
||||||
|
|
||||||
|
|
@ -328,7 +328,7 @@ intelTexImage(GLcontext * ctx,
|
||||||
* Release any old malloced memory.
|
* Release any old malloced memory.
|
||||||
*/
|
*/
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
intel_miptree_release(intel, &intelImage->mt);
|
st_miptree_release(intel->pipe, &intelImage->mt);
|
||||||
assert(!texImage->Data);
|
assert(!texImage->Data);
|
||||||
}
|
}
|
||||||
else if (texImage->Data) {
|
else if (texImage->Data) {
|
||||||
|
|
@ -343,11 +343,11 @@ intelTexImage(GLcontext * ctx,
|
||||||
intelObj->mt->first_level == level &&
|
intelObj->mt->first_level == level &&
|
||||||
intelObj->mt->last_level == level &&
|
intelObj->mt->last_level == level &&
|
||||||
intelObj->mt->target != GL_TEXTURE_CUBE_MAP_ARB &&
|
intelObj->mt->target != GL_TEXTURE_CUBE_MAP_ARB &&
|
||||||
!intel_miptree_match_image(intelObj->mt, &intelImage->base,
|
!st_miptree_match_image(intelObj->mt, &intelImage->base,
|
||||||
intelImage->face, intelImage->level)) {
|
intelImage->face, intelImage->level)) {
|
||||||
|
|
||||||
DBG("release it\n");
|
DBG("release it\n");
|
||||||
intel_miptree_release(intel, &intelObj->mt);
|
st_miptree_release(intel->pipe, &intelObj->mt);
|
||||||
assert(!intelObj->mt);
|
assert(!intelObj->mt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -361,10 +361,10 @@ intelTexImage(GLcontext * ctx,
|
||||||
assert(!intelImage->mt);
|
assert(!intelImage->mt);
|
||||||
|
|
||||||
if (intelObj->mt &&
|
if (intelObj->mt &&
|
||||||
intel_miptree_match_image(intelObj->mt, &intelImage->base,
|
st_miptree_match_image(intelObj->mt, &intelImage->base,
|
||||||
intelImage->face, intelImage->level)) {
|
intelImage->face, intelImage->level)) {
|
||||||
|
|
||||||
intel_miptree_reference(&intelImage->mt, intelObj->mt);
|
st_miptree_reference(&intelImage->mt, intelObj->mt);
|
||||||
assert(intelImage->mt);
|
assert(intelImage->mt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -438,7 +438,7 @@ intelTexImage(GLcontext * ctx,
|
||||||
LOCK_HARDWARE(intel);
|
LOCK_HARDWARE(intel);
|
||||||
|
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
texImage->Data = intel_miptree_image_map(intel,
|
texImage->Data = st_miptree_image_map(intel->pipe,
|
||||||
intelImage->mt,
|
intelImage->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level,
|
intelImage->level,
|
||||||
|
|
@ -485,7 +485,7 @@ intelTexImage(GLcontext * ctx,
|
||||||
_mesa_unmap_teximage_pbo(ctx, unpack);
|
_mesa_unmap_teximage_pbo(ctx, unpack);
|
||||||
|
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
intel_miptree_image_unmap(intel, intelImage->mt);
|
st_miptree_image_unmap(intel->pipe, intelImage->mt);
|
||||||
texImage->Data = NULL;
|
texImage->Data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -580,7 +580,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
|
||||||
* kernel. Need to explicitly map and unmap it.
|
* kernel. Need to explicitly map and unmap it.
|
||||||
*/
|
*/
|
||||||
intelImage->base.Data =
|
intelImage->base.Data =
|
||||||
intel_miptree_image_map(intel,
|
st_miptree_image_map(intel->pipe,
|
||||||
intelImage->mt,
|
intelImage->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level,
|
intelImage->level,
|
||||||
|
|
@ -612,7 +612,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
|
||||||
|
|
||||||
/* Unmap */
|
/* Unmap */
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
intel_miptree_image_unmap(intel, intelImage->mt);
|
st_miptree_image_unmap(intel->pipe, intelImage->mt);
|
||||||
intelImage->base.Data = NULL;
|
intelImage->base.Data = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -653,7 +653,7 @@ intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (intelObj->mt)
|
if (intelObj->mt)
|
||||||
intel_miptree_release(intel, &intelObj->mt);
|
st_miptree_release(intel->pipe, &intelObj->mt);
|
||||||
|
|
||||||
intelObj->imageOverride = GL_TRUE;
|
intelObj->imageOverride = GL_TRUE;
|
||||||
intelObj->depthOverride = depth;
|
intelObj->depthOverride = depth;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ intelTexSubimage(GLcontext * ctx,
|
||||||
* from uploading the buffer under us.
|
* from uploading the buffer under us.
|
||||||
*/
|
*/
|
||||||
if (intelImage->mt)
|
if (intelImage->mt)
|
||||||
texImage->Data = intel_miptree_image_map(intel,
|
texImage->Data = st_miptree_image_map(intel->pipe,
|
||||||
intelImage->mt,
|
intelImage->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level,
|
intelImage->level,
|
||||||
|
|
@ -108,7 +108,7 @@ intelTexSubimage(GLcontext * ctx,
|
||||||
_mesa_unmap_teximage_pbo(ctx, packing);
|
_mesa_unmap_teximage_pbo(ctx, packing);
|
||||||
|
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
intel_miptree_image_unmap(intel, intelImage->mt);
|
st_miptree_image_unmap(intel->pipe, intelImage->mt);
|
||||||
texImage->Data = NULL;
|
texImage->Data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,19 +72,19 @@ copy_image_data_to_tree(struct intel_context *intel,
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
/* Copy potentially with the blitter:
|
/* Copy potentially with the blitter:
|
||||||
*/
|
*/
|
||||||
intel_miptree_image_copy(intel,
|
st_miptree_image_copy(intel->pipe,
|
||||||
intelObj->mt,
|
intelObj->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level, intelImage->mt);
|
intelImage->level, intelImage->mt);
|
||||||
|
|
||||||
intel_miptree_release(intel, &intelImage->mt);
|
st_miptree_release(intel->pipe, &intelImage->mt);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(intelImage->base.Data != NULL);
|
assert(intelImage->base.Data != NULL);
|
||||||
|
|
||||||
/* More straightforward upload.
|
/* More straightforward upload.
|
||||||
*/
|
*/
|
||||||
intel_miptree_image_data(intel,
|
st_miptree_image_data(intel->pipe,
|
||||||
intelObj->mt,
|
intelObj->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level,
|
intelImage->level,
|
||||||
|
|
@ -96,7 +96,7 @@ copy_image_data_to_tree(struct intel_context *intel,
|
||||||
intelImage->base.Data = NULL;
|
intelImage->base.Data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_miptree_reference(&intelImage->mt, intelObj->mt);
|
st_miptree_reference(&intelImage->mt, intelObj->mt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -130,7 +130,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
|
||||||
*/
|
*/
|
||||||
if (firstImage->base.Border) {
|
if (firstImage->base.Border) {
|
||||||
if (intelObj->mt) {
|
if (intelObj->mt) {
|
||||||
intel_miptree_release(intel, &intelObj->mt);
|
st_miptree_release(intel->pipe, &intelObj->mt);
|
||||||
}
|
}
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -147,9 +147,9 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
|
||||||
firstImage->mt->last_level >= intelObj->lastLevel) {
|
firstImage->mt->last_level >= intelObj->lastLevel) {
|
||||||
|
|
||||||
if (intelObj->mt)
|
if (intelObj->mt)
|
||||||
intel_miptree_release(intel, &intelObj->mt);
|
st_miptree_release(intel->pipe, &intelObj->mt);
|
||||||
|
|
||||||
intel_miptree_reference(&intelObj->mt, firstImage->mt);
|
st_miptree_reference(&intelObj->mt, firstImage->mt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstImage->base.IsCompressed) {
|
if (firstImage->base.IsCompressed) {
|
||||||
|
|
@ -177,14 +177,14 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
|
||||||
intelObj->mt->depth0 != firstImage->base.Depth ||
|
intelObj->mt->depth0 != firstImage->base.Depth ||
|
||||||
intelObj->mt->cpp != cpp ||
|
intelObj->mt->cpp != cpp ||
|
||||||
intelObj->mt->compressed != firstImage->base.IsCompressed)) {
|
intelObj->mt->compressed != firstImage->base.IsCompressed)) {
|
||||||
intel_miptree_release(intel, &intelObj->mt);
|
st_miptree_release(intel->pipe, &intelObj->mt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* May need to create a new tree:
|
/* May need to create a new tree:
|
||||||
*/
|
*/
|
||||||
if (!intelObj->mt) {
|
if (!intelObj->mt) {
|
||||||
intelObj->mt = intel_miptree_create(intel,
|
intelObj->mt = st_miptree_create(intel->pipe,
|
||||||
intelObj->base.Target,
|
intelObj->base.Target,
|
||||||
firstImage->base.InternalFormat,
|
firstImage->base.InternalFormat,
|
||||||
intelObj->firstLevel,
|
intelObj->firstLevel,
|
||||||
|
|
@ -237,7 +237,7 @@ intel_tex_map_images(struct intel_context *intel,
|
||||||
|
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
intelImage->base.Data =
|
intelImage->base.Data =
|
||||||
intel_miptree_image_map(intel,
|
st_miptree_image_map(intel->pipe,
|
||||||
intelImage->mt,
|
intelImage->mt,
|
||||||
intelImage->face,
|
intelImage->face,
|
||||||
intelImage->level,
|
intelImage->level,
|
||||||
|
|
@ -266,7 +266,7 @@ intel_tex_unmap_images(struct intel_context *intel,
|
||||||
intel_texture_image(intelObj->base.Image[face][i]);
|
intel_texture_image(intelObj->base.Image[face][i]);
|
||||||
|
|
||||||
if (intelImage->mt) {
|
if (intelImage->mt) {
|
||||||
intel_miptree_image_unmap(intel, intelImage->mt);
|
st_miptree_image_unmap(intel->pipe, intelImage->mt);
|
||||||
intelImage->base.Data = NULL;
|
intelImage->base.Data = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue