#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_transfer.h"
+#include "util/u_surface.h"
#include "sp_context.h"
#include "sp_flush.h"
pipe_reference_init(&spr->base.reference, 1);
spr->base.screen = screen;
- spr->pot = (util_is_power_of_two(templat->width0) &&
- util_is_power_of_two(templat->height0) &&
- util_is_power_of_two(templat->depth0));
+ spr->pot = (util_is_power_of_two_or_zero(templat->width0) &&
+ util_is_power_of_two_or_zero(templat->height0) &&
+ util_is_power_of_two_or_zero(templat->depth0));
if (spr->base.bind & (PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_SCANOUT |
pipe_reference_init(&spr->base.reference, 1);
spr->base.screen = screen;
- spr->pot = (util_is_power_of_two(templat->width0) &&
- util_is_power_of_two(templat->height0) &&
- util_is_power_of_two(templat->depth0));
+ spr->pot = (util_is_power_of_two_or_zero(templat->width0) &&
+ util_is_power_of_two_or_zero(templat->height0) &&
+ util_is_power_of_two_or_zero(templat->depth0));
spr->dt = winsys->displaytarget_from_handle(winsys,
templat,
static boolean
softpipe_resource_get_handle(struct pipe_screen *screen,
+ struct pipe_context *ctx,
struct pipe_resource *pt,
struct winsys_handle *whandle,
unsigned usage)
* Helper function to compute offset (in bytes) for a particular
* texture level/face/slice from the start of the buffer.
*/
-static unsigned
-sp_get_tex_image_offset(const struct softpipe_resource *spr,
- unsigned level, unsigned layer)
+unsigned
+softpipe_get_tex_image_offset(const struct softpipe_resource *spr,
+ unsigned level, unsigned layer)
{
unsigned offset = spr->level_offset[level];
pt->stride = spr->stride[level];
pt->layer_stride = spr->img_stride[level];
- spt->offset = sp_get_tex_image_offset(spr, level, box->z);
+ spt->offset = softpipe_get_tex_image_offset(spr, level, box->z);
spt->offset +=
box->y / util_format_get_blockheight(format) * spt->base.stride +
pipe->transfer_unmap = softpipe_transfer_unmap;
pipe->transfer_flush_region = u_default_transfer_flush_region;
- pipe->transfer_inline_write = u_default_transfer_inline_write;
+ pipe->buffer_subdata = u_default_buffer_subdata;
+ pipe->texture_subdata = u_default_texture_subdata;
pipe->create_surface = softpipe_create_surface;
pipe->surface_destroy = softpipe_surface_destroy;
+ pipe->clear_texture = util_clear_texture;
}