#include "util/u_inlines.h"
#include "util/u_cpu_detect.h"
-#include "util/u_format.h"
+#include "util/format/u_format.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/simple_list.h"
* Check the size of the texture specified by 'res'.
* \return TRUE if OK, FALSE if too large.
*/
-static boolean
+static bool
llvmpipe_can_create_resource(struct pipe_screen *screen,
const struct pipe_resource *res)
{
FREE(lpr);
return NULL;
}
+
+
static struct pipe_resource *
llvmpipe_resource_create(struct pipe_screen *_screen,
const struct pipe_resource *templat)
return llvmpipe_resource_create_front(_screen, templat, NULL);
}
+
static void
llvmpipe_resource_destroy(struct pipe_screen *pscreen,
struct pipe_resource *pt)
}
-static boolean
+static bool
llvmpipe_resource_get_handle(struct pipe_screen *screen,
+ struct pipe_context *ctx,
struct pipe_resource *pt,
struct winsys_handle *whandle,
unsigned usage)
assert(lpr->dt);
if (!lpr->dt)
- return FALSE;
+ return false;
return winsys->displaytarget_get_handle(winsys, lpr->dt, whandle);
}
struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
if (!(presource->bind & (PIPE_BIND_DEPTH_STENCIL |
PIPE_BIND_RENDER_TARGET |
- PIPE_BIND_SAMPLER_VIEW)))
+ PIPE_BIND_SAMPLER_VIEW |
+ PIPE_BIND_SHADER_BUFFER |
+ PIPE_BIND_SHADER_IMAGE)))
return LP_UNREFERENCED;
return lp_setup_is_resource_referenced(llvmpipe->setup, presource);
bytes = size / 8;
- if (!util_is_power_of_two(bytes)) {
+ if (!util_is_power_of_two_or_zero(bytes)) {
bytes /= desc->nr_channels;
}
return size;
}
+static void
+llvmpipe_memory_barrier(struct pipe_context *pipe,
+ unsigned flags)
+{
+ /* this may be an overly large hammer for this nut. */
+ llvmpipe_finish(pipe, "barrier");
+}
#ifdef DEBUG
void
pipe->transfer_flush_region = u_default_transfer_flush_region;
pipe->buffer_subdata = u_default_buffer_subdata;
pipe->texture_subdata = u_default_texture_subdata;
+
+ pipe->memory_barrier = llvmpipe_memory_barrier;
}