summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c8
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c9
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c28
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c7
-rw-r--r--src/mesa/state_tracker/st_texture.c16
5 files changed, 38 insertions, 30 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 0f2c6307dd..ff236adc5c 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -456,6 +456,7 @@ make_texture(struct st_context *st,
{
GLcontext *ctx = st->ctx;
struct pipe_context *pipe = st->pipe;
+ struct pipe_screen *screen = pipe->screen;
const struct gl_texture_format *mformat;
struct pipe_texture *pt;
enum pipe_format pipeFormat;
@@ -493,7 +494,7 @@ make_texture(struct st_context *st,
/* we'll do pixel transfer in a fragment shader */
ctx->_ImageTransferState = 0x0;
- surface = pipe->get_tex_surface(pipe, pt, 0, 0, 0);
+ surface = screen->get_tex_surface(screen, pt, 0, 0, 0);
/* map texture surface */
dest = pipe_surface_map(surface);
@@ -1031,7 +1032,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
printf("st_Bitmap (sourcing from PBO not implemented yet)\n");
}
- surface = pipe->get_tex_surface(pipe, pt, 0, 0, 0);
+ surface = screen->get_tex_surface(screen, pt, 0, 0, 0);
/* map texture surface */
dest = pipe_surface_map(surface);
@@ -1207,6 +1208,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
{
struct st_context *st = ctx->st;
struct pipe_context *pipe = st->pipe;
+ struct pipe_screen *screen = pipe->screen;
struct st_renderbuffer *rbRead;
struct st_vertex_program *stvp;
struct st_fragment_program *stfp;
@@ -1248,7 +1250,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (!pt)
return;
- psTex = pipe->get_tex_surface(pipe, pt, 0, 0, 0);
+ psTex = screen->get_tex_surface(screen, pt, 0, 0, 0);
if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
srcy = ctx->DrawBuffer->Height - srcy - height;
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 781425b546..5384252a8e 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -307,6 +307,7 @@ st_render_texture(GLcontext *ctx,
struct st_renderbuffer *strb;
struct gl_renderbuffer *rb;
struct pipe_context *pipe = st->pipe;
+ struct pipe_screen *screen = pipe->screen;
struct pipe_texture *pt;
assert(!att->Renderbuffer);
@@ -332,10 +333,10 @@ st_render_texture(GLcontext *ctx,
rb->Height = pt->height[att->TextureLevel];
/* the renderbuffer's surface is inside the texture */
- strb->surface = pipe->get_tex_surface(pipe, pt,
- att->CubeMapFace,
- att->TextureLevel,
- att->Zoffset);
+ strb->surface = screen->get_tex_surface(screen, pt,
+ att->CubeMapFace,
+ att->TextureLevel,
+ att->Zoffset);
assert(strb->surface);
init_renderbuffer_bits(strb, pt->format);
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index f5f956f6ea..1ba3173312 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -144,12 +144,11 @@ st_NewTextureObject(GLcontext * ctx, GLuint name, GLenum target)
static void
st_DeleteTextureObject(GLcontext *ctx,
- struct gl_texture_object *texObj)
+ struct gl_texture_object *texObj)
{
struct st_texture_object *stObj = st_texture_object(texObj);
-
if (stObj->pt)
- ctx->st->pipe->texture_release(ctx->st->pipe, &stObj->pt);
+ pipe_texture_release(&stObj->pt);
_mesa_delete_texture_object(ctx, texObj);
}
@@ -163,7 +162,7 @@ st_FreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
DBG("%s\n", __FUNCTION__);
if (stImage->pt) {
- ctx->st->pipe->texture_release(ctx->st->pipe, &stImage->pt);
+ pipe_texture_release(&stImage->pt);
}
if (texImage->Data) {
@@ -537,7 +536,7 @@ st_TexImage(GLcontext * ctx,
* Release any old malloced memory.
*/
if (stImage->pt) {
- ctx->st->pipe->texture_release(ctx->st->pipe, &stImage->pt);
+ pipe_texture_release(&stImage->pt);
assert(!texImage->Data);
}
else if (texImage->Data) {
@@ -556,7 +555,7 @@ st_TexImage(GLcontext * ctx,
stImage->face, stImage->level)) {
DBG("release it\n");
- ctx->st->pipe->texture_release(ctx->st->pipe, &stObj->pt);
+ pipe_texture_release(&stObj->pt);
assert(!stObj->pt);
}
@@ -1025,6 +1024,7 @@ fallback_copy_texsubimage(GLcontext *ctx,
GLsizei width, GLsizei height)
{
struct pipe_context *pipe = ctx->st->pipe;
+ struct pipe_screen *screen = pipe->screen;
const uint face = texture_face(target);
struct pipe_texture *pt = stImage->pt;
struct pipe_surface *src_surf, *dest_surf;
@@ -1042,8 +1042,7 @@ fallback_copy_texsubimage(GLcontext *ctx,
src_surf = strb->surface;
- dest_surf = pipe->get_tex_surface(pipe, pt,
- face, level, destZ);
+ dest_surf = screen->get_tex_surface(screen, pt, face, level, destZ);
/* buffer for one row */
data = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
@@ -1096,6 +1095,7 @@ do_copy_texsubimage(GLcontext *ctx,
struct gl_framebuffer *fb = ctx->ReadBuffer;
struct st_renderbuffer *strb;
struct pipe_context *pipe = ctx->st->pipe;
+ struct pipe_screen *screen = pipe->screen;
struct pipe_surface *dest_surface;
uint dest_format, src_format;
uint do_flip = FALSE;
@@ -1126,8 +1126,8 @@ do_copy_texsubimage(GLcontext *ctx,
src_format = strb->surface->format;
dest_format = stImage->pt->format;
- dest_surface = pipe->get_tex_surface(pipe, stImage->pt, stImage->face,
- stImage->level, destZ);
+ dest_surface = screen->get_tex_surface(screen, stImage->pt, stImage->face,
+ stImage->level, destZ);
if (src_format == dest_format &&
ctx->_ImageTransferState == 0x0 &&
@@ -1352,7 +1352,7 @@ copy_image_data_to_texture(struct st_context *st,
stImage->face
);
- st->pipe->texture_release(st->pipe, &stImage->pt);
+ pipe_texture_release(&stImage->pt);
}
else {
assert(stImage->base.Data != NULL);
@@ -1408,7 +1408,7 @@ st_finalize_texture(GLcontext *ctx,
*/
if (firstImage->base.Border) {
if (stObj->pt) {
- ctx->st->pipe->texture_release(ctx->st->pipe, &stObj->pt);
+ pipe_texture_release(&stObj->pt);
}
return GL_FALSE;
}
@@ -1424,7 +1424,7 @@ st_finalize_texture(GLcontext *ctx,
firstImage->pt->last_level >= stObj->lastLevel) {
if (stObj->pt)
- ctx->st->pipe->texture_release(ctx->st->pipe, &stObj->pt);
+ pipe_texture_release(&stObj->pt);
pipe_texture_reference(&stObj->pt, firstImage->pt);
}
@@ -1450,7 +1450,7 @@ st_finalize_texture(GLcontext *ctx,
stObj->pt->depth[0] != firstImage->base.Depth ||
stObj->pt->cpp != cpp ||
stObj->pt->compressed != firstImage->base.IsCompressed)) {
- ctx->st->pipe->texture_release(ctx->st->pipe, &stObj->pt);
+ pipe_texture_release(&stObj->pt);
}
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 2b16310602..243dc0b1d0 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -276,7 +276,7 @@ st_render_mipmap(struct st_context *st,
/*
* Setup framebuffer / dest surface
*/
- fb.cbufs[0] = pipe->get_tex_surface(pipe, pt, face, dstLevel, zslice);
+ fb.cbufs[0] = screen->get_tex_surface(screen, pt, face, dstLevel, zslice);
pipe->set_framebuffer_state(pipe, &fb);
/*
@@ -325,6 +325,7 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj)
{
struct pipe_context *pipe = ctx->st->pipe;
+ struct pipe_screen *screen = pipe->screen;
struct pipe_winsys *ws = pipe->winsys;
struct pipe_texture *pt = st_get_texobj_texture(texObj);
const uint baseLevel = texObj->BaseLevel;
@@ -345,8 +346,8 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
const ubyte *srcData;
ubyte *dstData;
- srcSurf = pipe->get_tex_surface(pipe, pt, face, srcLevel, zslice);
- dstSurf = pipe->get_tex_surface(pipe, pt, face, dstLevel, zslice);
+ srcSurf = screen->get_tex_surface(screen, pt, face, srcLevel, zslice);
+ dstSurf = screen->get_tex_surface(screen, pt, face, dstLevel, zslice);
srcData = (ubyte *) ws->buffer_map(ws, srcSurf->buffer,
PIPE_BUFFER_USAGE_CPU_READ)
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index ad284170e4..c2b0aa8a4a 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -77,6 +77,7 @@ st_texture_create(struct st_context *st,
GLuint compress_byte)
{
struct pipe_texture pt, *newtex;
+ struct pipe_screen *screen = st->pipe->screen;
assert(target <= PIPE_TEXTURE_CUBE);
@@ -96,7 +97,7 @@ st_texture_create(struct st_context *st,
pt.compressed = compress_byte ? 1 : 0;
pt.cpp = pt.compressed ? compress_byte : st_sizeof_format(format);
- newtex = st->pipe->texture_create(st->pipe, &pt);
+ newtex = screen->texture_create(screen, &pt);
assert(!newtex || newtex->refcount == 1);
@@ -183,11 +184,12 @@ GLubyte *
st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
GLuint zoffset)
{
+ struct pipe_screen *screen = st->pipe->screen;
struct pipe_texture *pt = stImage->pt;
DBG("%s \n", __FUNCTION__);
- stImage->surface = st->pipe->get_tex_surface(st->pipe, pt, stImage->face,
- stImage->level, zoffset);
+ stImage->surface = screen->get_tex_surface(screen, pt, stImage->face,
+ stImage->level, zoffset);
return pipe_surface_map(stImage->surface);
}
@@ -239,6 +241,7 @@ st_texture_image_data(struct pipe_context *pipe,
void *src,
GLuint src_row_pitch, GLuint src_image_pitch)
{
+ struct pipe_screen *screen = pipe->screen;
GLuint depth = dst->depth[level];
GLuint i;
GLuint height = 0;
@@ -251,7 +254,7 @@ st_texture_image_data(struct pipe_context *pipe,
if(dst->compressed)
height /= 4;
- dst_surface = pipe->get_tex_surface(pipe, dst, face, level, i);
+ dst_surface = screen->get_tex_surface(screen, dst, face, level, i);
st_surface_data(pipe, dst_surface,
0, 0, /* dstx, dsty */
@@ -275,6 +278,7 @@ st_texture_image_copy(struct pipe_context *pipe,
struct pipe_texture *src,
GLuint face)
{
+ struct pipe_screen *screen = pipe->screen;
GLuint width = dst->width[dstLevel];
GLuint height = dst->height[dstLevel];
GLuint depth = dst->depth[dstLevel];
@@ -299,8 +303,8 @@ st_texture_image_copy(struct pipe_context *pipe,
assert(src->width[srcLevel] == width);
assert(src->height[srcLevel] == height);
- dst_surface = pipe->get_tex_surface(pipe, dst, face, dstLevel, i);
- src_surface = pipe->get_tex_surface(pipe, src, face, srcLevel, i);
+ dst_surface = screen->get_tex_surface(screen, dst, face, dstLevel, i);
+ src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i);
pipe->surface_copy(pipe,
FALSE,