#include "pipe/p_defines.h"
#include "util/u_inlines.h"
-#include "util/u_format.h"
+#include "util/format/u_format.h"
#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"
#include "sp_texture.h"
#include "sp_screen.h"
-#include "state_tracker/sw_winsys.h"
+#include "frontend/sw_winsys.h"
/**
* Check the size of the texture specified by 'res'.
* \return TRUE if OK, FALSE if too large.
*/
-static boolean
+static bool
softpipe_can_create_resource(struct pipe_screen *screen,
const struct pipe_resource *res)
{
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
+static bool
softpipe_resource_get_handle(struct pipe_screen *screen,
+ struct pipe_context *ctx,
struct pipe_resource *pt,
struct winsys_handle *whandle,
unsigned usage)
assert(spr->dt);
if (!spr->dt)
- return FALSE;
+ return false;
return winsys->displaytarget_get_handle(winsys, spr->dt, whandle);
}
pipe->create_surface = softpipe_create_surface;
pipe->surface_destroy = softpipe_surface_destroy;
+ pipe->clear_texture = util_clear_texture;
}