mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
i915: Remove last usage of surface_alloc_storage
This commit is contained in:
parent
837601af52
commit
79b67d8408
2 changed files with 17 additions and 56 deletions
|
|
@ -104,7 +104,7 @@ i915_miptree_set_image_offset(struct i915_texture *tex,
|
|||
*/
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/* Hack it up to use the old winsys->surface_alloc_storage()
|
||||
* method for now:
|
||||
*/
|
||||
|
|
@ -145,10 +145,7 @@ i915_displaytarget_layout(struct pipe_screen *screen,
|
|||
|
||||
return tex->buffer != NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
i945_miptree_layout_2d( struct i915_texture *tex )
|
||||
|
|
@ -539,32 +536,25 @@ i915_texture_create(struct pipe_screen *screen,
|
|||
tex->base.refcount = 1;
|
||||
tex->base.screen = screen;
|
||||
|
||||
if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) {
|
||||
if (!i915_displaytarget_layout(screen, tex))
|
||||
goto fail;
|
||||
if (i915screen->is_i945) {
|
||||
if (!i945_miptree_layout(tex))
|
||||
goto fail;
|
||||
} else {
|
||||
if (!i915_miptree_layout(tex))
|
||||
goto fail;
|
||||
}
|
||||
else {
|
||||
if (i915screen->is_i945) {
|
||||
if (!i945_miptree_layout(tex))
|
||||
goto fail;
|
||||
}
|
||||
else {
|
||||
if (!i915_miptree_layout(tex))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
tex->buffer = ws->buffer_create(ws, 64,
|
||||
PIPE_BUFFER_USAGE_PIXEL,
|
||||
tex->pitch * tex->base.cpp *
|
||||
tex->total_height);
|
||||
|
||||
if (!tex->buffer)
|
||||
goto fail;
|
||||
}
|
||||
tex->buffer = ws->buffer_create(ws, 64,
|
||||
PIPE_BUFFER_USAGE_PIXEL,
|
||||
tex->pitch * tex->base.cpp *
|
||||
tex->total_height);
|
||||
|
||||
if (!tex->buffer)
|
||||
goto fail;
|
||||
|
||||
return &tex->base;
|
||||
|
||||
fail:
|
||||
fail:
|
||||
FREE(tex);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,36 +232,7 @@ intel_i915_surface_alloc_storage(struct pipe_winsys *winsys,
|
|||
unsigned flags,
|
||||
unsigned tex_usage)
|
||||
{
|
||||
const unsigned alignment = 64;
|
||||
assert(!surf->buffer);
|
||||
#if 0
|
||||
surf->width = width;
|
||||
surf->height = round_up(height, 8);
|
||||
surf->format = format;
|
||||
surf->cpp = pf_get_size(format);
|
||||
surf->pitch = power_of_two(MAX2(width * surf->cpp, 512));
|
||||
|
||||
surf->buffer = winsys->buffer_create(winsys, 2*4096,
|
||||
PIPE_BUFFER_USAGE_PIXEL,
|
||||
surf->pitch * surf->height);
|
||||
|
||||
surf->pitch = surf->pitch / surf->cpp;
|
||||
surf->height = height;
|
||||
#else
|
||||
surf->width = width;
|
||||
surf->height = height;
|
||||
surf->format = format;
|
||||
surf->cpp = pf_get_size(format);
|
||||
surf->pitch = round_up(width, alignment / surf->cpp);
|
||||
|
||||
surf->buffer = winsys->buffer_create(winsys, alignment,
|
||||
PIPE_BUFFER_USAGE_PIXEL,
|
||||
surf->pitch * surf->cpp * surf->height);
|
||||
#endif
|
||||
if(!surf->buffer)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue