- Remove put/get tile, just have users call put_tile_raw, etc directly.
- Remove surface_data call, just map it locally.
#endif
failover->pipe.get_tex_surface = hw->get_tex_surface;
- failover->pipe.surface_data = hw->surface_data;
failover->pipe.surface_copy = hw->surface_copy;
failover->pipe.surface_fill = hw->surface_fill;
failover->pipe.texture_create = hw->texture_create;
}
-/* Upload data to a rectangular sub-region. Lots of choices how to do this:
- *
- * - memcpy by span to current destination
- * - upload data as new buffer and blit
- *
- * Currently always memcpy.
- */
-static void
-i915_surface_data(struct pipe_context *pipe,
- struct pipe_surface *dst,
- unsigned dstx, unsigned dsty,
- const void *src, unsigned src_pitch,
- unsigned srcx, unsigned srcy, unsigned width, unsigned height)
-{
- pipe_copy_rect(pipe_surface_map(dst),
- dst->cpp, dst->pitch,
- dstx, dsty, width, height, src, src_pitch, srcx, srcy);
-
- pipe_surface_unmap(dst);
-}
-
/* Assumes all values are within bounds -- no checking at this level -
* do it higher up if required.
i915_init_surface_functions(struct i915_context *i915)
{
i915->pipe.get_tex_surface = i915_get_tex_surface;
- i915->pipe.get_tile = pipe_get_tile_raw;
- i915->pipe.put_tile = pipe_put_tile_raw;
- i915->pipe.surface_data = i915_surface_data;
i915->pipe.surface_copy = i915_surface_copy;
i915->pipe.surface_fill = i915_surface_fill;
}
brw_init_surface_functions(struct brw_context *brw)
{
brw->pipe.get_tex_surface = brw_get_tex_surface;
- brw->pipe.get_tile = pipe_get_tile_raw;
- brw->pipe.put_tile = pipe_put_tile_raw;
-
- brw->pipe.surface_data = brw_surface_data;
brw->pipe.surface_copy = brw_surface_copy;
brw->pipe.surface_fill = brw_surface_fill;
}
unsigned indexSize,
unsigned mode, unsigned start, unsigned count);
- /** Clear a surface to given value (no scissor; clear whole surface) */
- void (*clear)(struct pipe_context *pipe, struct pipe_surface *ps,
- unsigned clearValue);
/**
* Query objects
const struct pipe_vertex_element * );
- /** Get a surface which is a "view" into a texture */
- struct pipe_surface *(*get_tex_surface)(struct pipe_context *pipe,
- struct pipe_texture *texture,
- unsigned face, unsigned level,
- unsigned zslice);
-
- /** Get a block of raw pixel data from a surface */
- void (*get_tile)(struct pipe_context *pipe,
- struct pipe_surface *ps,
- uint x, uint y, uint w, uint h,
- void *p, int dst_stride);
- /** Put a block of raw pixel data into a surface */
- void (*put_tile)(struct pipe_context *pipe,
- struct pipe_surface *ps,
- uint x, uint y, uint w, uint h,
- const void *p, int src_stride);
-
-
/*
* Surface functions
*/
- void (*surface_data)(struct pipe_context *pipe,
- struct pipe_surface *dest,
- unsigned destx, unsigned desty,
- const void *src, unsigned src_stride,
- unsigned srcx, unsigned srcy,
- unsigned width, unsigned height);
void (*surface_copy)(struct pipe_context *pipe,
struct pipe_surface *dest,
unsigned width, unsigned height,
unsigned value);
+ void (*clear)(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ unsigned clearValue);
+
/*
* Texture functions
void (*texture_release)(struct pipe_context *pipe,
struct pipe_texture **pt);
+ /** Get a surface which is a "view" into a texture */
+ struct pipe_surface *(*get_tex_surface)(struct pipe_context *pipe,
+ struct pipe_texture *texture,
+ unsigned face, unsigned level,
+ unsigned zslice);
/* Flush rendering:
*/
#include "sp_surface.h"
-/* Upload data to a rectangular sub-region. Lots of choices how to do this:
- *
- * - memcpy by span to current destination
- * - upload data as new buffer and blit
- *
- * Currently always memcpy.
- */
-static void
-sp_surface_data(struct pipe_context *pipe,
- struct pipe_surface *dst,
- unsigned dstx, unsigned dsty,
- const void *src, unsigned src_pitch,
- unsigned srcx, unsigned srcy, unsigned width, unsigned height)
-{
- pipe_copy_rect(pipe_surface_map(dst),
- dst->cpp,
- dst->pitch,
- dstx, dsty, width, height, src, src_pitch, srcx, srcy);
-
- pipe_surface_unmap(dst);
-}
/* Assumes all values are within bounds -- no checking at this level -
* do it higher up if required.
void
sp_init_surface_functions(struct softpipe_context *sp)
{
- sp->pipe.get_tile = pipe_get_tile_raw;
- sp->pipe.put_tile = pipe_put_tile_raw;
-
- sp->pipe.surface_data = sp_surface_data;
sp->pipe.surface_copy = sp_surface_copy;
sp->pipe.surface_fill = sp_surface_fill;
}
for (y = 0; y < h; y += TILE_SIZE) {
for (x = 0; x < w; x += TILE_SIZE) {
if (is_clear_flag_set(tc->clear_flags, x, y)) {
- pipe->put_tile(pipe, ps,
+ pipe_put_tile_raw(pipe, ps,
x, y, TILE_SIZE, TILE_SIZE,
tc->tile.data.color32, 0/*STRIDE*/);
struct softpipe_cached_tile *tile = tc->entries + pos;
if (tile->x >= 0) {
if (tc->depth_stencil) {
- pipe->put_tile(pipe, ps,
+ pipe_put_tile_raw(pipe, ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
tile->data.depth32, 0/*STRIDE*/);
}
if (tile->x != -1) {
/* put dirty tile back in framebuffer */
if (tc->depth_stencil) {
- pipe->put_tile(pipe, ps,
+ pipe_put_tile_raw(pipe, ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
tile->data.depth32, 0/*STRIDE*/);
}
else {
/* get new tile data from surface */
if (tc->depth_stencil) {
- pipe->get_tile(pipe, ps,
+ pipe_put_tile_raw(pipe, ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
tile->data.depth32, 0/*STRIDE*/);
}
if (!packed)
return;
- pipe->get_tile(pipe, ps, x, y, w, h, packed, w * ps->cpp);
+ pipe_get_tile_raw(pipe, ps, x, y, w, h, packed, w * ps->cpp);
switch (ps->format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
assert(0);
}
- pipe->put_tile(pipe, ps, x, y, w, h, packed, w * ps->cpp);
+ pipe_put_tile_raw(pipe, ps, x, y, w, h, packed, w * ps->cpp);
FREE(packed);
}
+/* Upload data to a rectangular sub-region. Lots of choices how to do this:
+ *
+ * - memcpy by span to current destination
+ * - upload data as new buffer and blit
+ *
+ * Currently always memcpy.
+ */
+static void
+st_surface_data(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ unsigned dstx, unsigned dsty,
+ const void *src, unsigned src_pitch,
+ unsigned srcx, unsigned srcy, unsigned width, unsigned height)
+{
+ pipe_copy_rect(pipe_surface_map(dst),
+ dst->cpp,
+ dst->pitch,
+ dstx, dsty, width, height, src, src_pitch, srcx, srcy);
+
+ pipe_surface_unmap(dst);
+}
+
+
/* Upload data for a particular image.
*/
void
dst_surface = pipe->get_tex_surface(pipe, dst, face, level, i);
- pipe->surface_data(pipe, dst_surface,
- 0, 0, /* dstx, dsty */
- srcUB,
- src_row_pitch,
- 0, 0, /* source x, y */
- dst->width[level], height); /* width, height */
+ st_surface_data(pipe, dst_surface,
+ 0, 0, /* dstx, dsty */
+ srcUB,
+ src_row_pitch,
+ 0, 0, /* source x, y */
+ dst->width[level], height); /* width, height */
pipe_surface_reference(&dst_surface, NULL);