Browse Source

st/dri: update for pipe_resources

gallium-resources
Keith Whitwell 16 years ago
parent
commit
eb39977fe7

+ 9
- 9
src/gallium/state_trackers/dri/dri1.c View File

@@ -214,7 +214,7 @@ dri1_swap_copy(struct pipe_context *pipe,
}

static struct pipe_surface *
dri1_get_pipe_surface(struct dri_drawable *drawable, struct pipe_texture *ptex)
dri1_get_pipe_surface(struct dri_drawable *drawable, struct pipe_resource *ptex)
{
struct pipe_screen *pipe_screen = dri_screen(drawable->sPriv)->pipe_screen;
struct pipe_surface *psurf = drawable->dri1_surface;
@@ -248,7 +248,7 @@ dri1_get_pipe_context(struct dri_drawable *drawable)

static void
dri1_present_texture_locked(__DRIdrawable * dPriv,
struct pipe_texture *ptex,
struct pipe_resource *ptex,
const struct drm_clip_rect *sub_box,
struct pipe_fence_handle **fence)
{
@@ -291,7 +291,7 @@ dri1_present_texture_locked(__DRIdrawable * dPriv,

static void
dri1_copy_to_front(struct dri_context *ctx,
struct pipe_texture *ptex,
struct pipe_resource *ptex,
__DRIdrawable * dPriv,
const struct drm_clip_rect *sub_box,
struct pipe_fence_handle **fence)
@@ -319,7 +319,7 @@ dri1_copy_to_front(struct dri_context *ctx,

void
dri1_flush_frontbuffer(struct dri_drawable *drawable,
struct pipe_texture *ptex)
struct pipe_resource *ptex)
{
struct st_api *stapi = dri_get_st_api();
struct dri_screen *screen = dri_screen(drawable->sPriv);
@@ -349,7 +349,7 @@ dri1_swap_buffers(__DRIdrawable * dPriv)
struct dri_screen *screen = dri_screen(draw->sPriv);
struct pipe_screen *pipe_screen = screen->pipe_screen;
struct pipe_fence_handle *fence;
struct pipe_texture *ptex;
struct pipe_resource *ptex;

assert(__dri1_api_hooks != NULL);

@@ -379,7 +379,7 @@ dri1_copy_sub_buffer(__DRIdrawable * dPriv, int x, int y, int w, int h)
struct drm_clip_rect sub_bbox;
struct dri_drawable *draw = dri_drawable(dPriv);
struct pipe_fence_handle *dummy_fence;
struct pipe_texture *ptex;
struct pipe_resource *ptex;

assert(__dri1_api_hooks != NULL);

@@ -405,13 +405,13 @@ dri1_allocate_textures(struct dri_drawable *drawable,
unsigned mask)
{
struct dri_screen *screen = dri_screen(drawable->sPriv);
struct pipe_texture templ;
struct pipe_resource templ;
int i;

/* remove outdated textures */
if (drawable->old_w != width || drawable->old_h != height) {
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
pipe_texture_reference(&drawable->textures[i], NULL);
pipe_resource_reference(&drawable->textures[i], NULL);
}

memset(&templ, 0, sizeof(templ));
@@ -456,7 +456,7 @@ dri1_allocate_textures(struct dri_drawable *drawable,
templ.tex_usage = tex_usage;

drawable->textures[i] =
screen->pipe_screen->texture_create(screen->pipe_screen, &templ);
screen->pipe_screen->resource_create(screen->pipe_screen, &templ);
}
}


+ 1
- 1
src/gallium/state_trackers/dri/dri1.h View File

@@ -45,7 +45,7 @@ dri1_init_screen(__DRIscreen * sPriv);

void
dri1_flush_frontbuffer(struct dri_drawable *drawable,
struct pipe_texture *ptex);
struct pipe_resource *ptex);

void
dri1_allocate_textures(struct dri_drawable *drawable,

+ 2
- 2
src/gallium/state_trackers/dri/dri_drawable.c View File

@@ -48,7 +48,7 @@ void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
{
struct dri_context *ctx = dri_context(pDRICtx);
struct dri_drawable *drawable = dri_drawable(dPriv);
struct pipe_texture *pt =
struct pipe_resource *pt =
dri_get_st_framebuffer_texture(drawable->stfb, ST_ATTACHMENT_FRONT_LEFT);

if (pt) {
@@ -109,7 +109,7 @@ dri_destroy_buffer(__DRIdrawable * dPriv)

pipe_surface_reference(&drawable->dri1_surface, NULL);
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
pipe_texture_reference(&drawable->textures[i], NULL);
pipe_resource_reference(&drawable->textures[i], NULL);

dri_destroy_st_framebuffer(drawable->stfb);


+ 1
- 1
src/gallium/state_trackers/dri/dri_drawable.h View File

@@ -55,7 +55,7 @@ struct dri_drawable
unsigned old_w;
unsigned old_h;

struct pipe_texture *textures[ST_ATTACHMENT_COUNT];
struct pipe_resource *textures[ST_ATTACHMENT_COUNT];
unsigned int texture_mask, texture_stamp;

struct pipe_fence_handle *swap_fences[DRI_SWAP_FENCES_MAX];

+ 7
- 7
src/gallium/state_trackers/dri/dri_st_api.c View File

@@ -79,7 +79,7 @@ dri_drawable_process_buffers(struct dri_drawable *drawable,
{
struct dri_screen *screen = dri_screen(drawable->sPriv);
__DRIdrawable *dri_drawable = drawable->dPriv;
struct pipe_texture templ;
struct pipe_resource templ;
struct winsys_handle whandle;
boolean have_depth = FALSE;
unsigned i;
@@ -91,7 +91,7 @@ dri_drawable_process_buffers(struct dri_drawable *drawable,
return;

for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
pipe_texture_reference(&drawable->textures[i], NULL);
pipe_resource_reference(&drawable->textures[i], NULL);

memset(&templ, 0, sizeof(templ));
templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET;
@@ -145,7 +145,7 @@ dri_drawable_process_buffers(struct dri_drawable *drawable,
whandle.stride = buf->pitch;
drawable->textures[statt] =
screen->pipe_screen->texture_from_handle(screen->pipe_screen,
screen->pipe_screen->resource_from_handle(screen->pipe_screen,
&templ, &whandle);
}

@@ -254,7 +254,7 @@ static boolean
dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
const enum st_attachment_type *statts,
unsigned count,
struct pipe_texture **out)
struct pipe_resource **out)
{
struct dri_drawable *drawable =
(struct dri_drawable *) stfbi->st_manager_private;
@@ -294,7 +294,7 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,

for (i = 0; i < count; i++) {
out[i] = NULL;
pipe_texture_reference(&out[i], drawable->textures[statts[i]]);
pipe_resource_reference(&out[i], drawable->textures[statts[i]]);
}

return TRUE;
@@ -310,7 +310,7 @@ dri_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi,
drawable->sPriv->dri2.loader;

if (__dri1_api_hooks) {
struct pipe_texture *ptex = drawable->textures[statt];
struct pipe_resource *ptex = drawable->textures[statt];
if (ptex)
dri1_flush_frontbuffer(drawable, ptex);
return TRUE;
@@ -356,7 +356,7 @@ dri_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi)
* Return the texture at an attachment. Allocate the texture if it does not
* exist.
*/
struct pipe_texture *
struct pipe_resource *
dri_get_st_framebuffer_texture(struct st_framebuffer_iface *stfbi,
enum st_attachment_type statt)
{

+ 1
- 1
src/gallium/state_trackers/dri/dri_st_api.h View File

@@ -48,7 +48,7 @@ dri_create_st_framebuffer(struct dri_drawable *drawable);
void
dri_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi);

struct pipe_texture *
struct pipe_resource *
dri_get_st_framebuffer_texture(struct st_framebuffer_iface *stfbi,
enum st_attachment_type statt);


Loading…
Cancel
Save