Commit 05891846 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Import some routine stubs for Gallium

parent 7072d291
......@@ -1634,6 +1634,110 @@ panfrost_transfer_map(struct pipe_context *pctx,
return ((uint8_t *) rsrc->cpu) + transfer->box.x + transfer->box.y * transfer->stride;
}
static void
panfrost_set_framebuffer_state(struct pipe_context *pctx,
const struct pipe_framebuffer_state *fb)
{
struct panfrost_context *ctx = panfrost_context(pctx);
#if 0
int i;
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
struct pipe_surface *cb = i < fb->nr_cbufs ? fb->cbufs[i] : NULL;
/* check if changing cbuf */
if (ctx->pipe_framebuffer.cbufs[i] != cb) {
if (i != 0) {
printf("XXX: Multiple render targets not supported before t7xx!\n");
break;
}
/* assign new */
pipe_surface_reference(&ctx->pipe_framebuffer.cbufs[i], cb);
struct softpipe_screen* scr = ctx->base.screen;
struct sw_winsys *winsys = scr->winsys;
struct pipe_surface *surf = ctx->pipe_framebuffer.cbufs[i];
uint8_t *map = winsys->displaytarget_map(winsys, ((struct softpipe_resource *) surf->texture)->dt, PIPE_TRANSFER_WRITE);
trans_setup_framebuffer(ctx, map, fb->width, fb->height);
}
}
#endif
trans_setup_framebuffer(ctx, NULL, fb->width, fb->height);
ctx->pipe_framebuffer.nr_cbufs = fb->nr_cbufs;
ctx->pipe_framebuffer.width = fb->width;
ctx->pipe_framebuffer.height = fb->height;
ctx->pipe_framebuffer.samples = fb->samples;
ctx->pipe_framebuffer.layers = fb->layers;
}
#define mem_dup(mem, sz) (memcpy(malloc(sz), mem, sz))
static void *
panfrost_create_blend_state(struct pipe_context *pipe,
const struct pipe_blend_state *blend)
{
return mem_dup(blend, sizeof(*blend));
}
static void
panfrost_bind_blend_state(struct pipe_context *pipe,
void *blend)
{
struct panfrost_context *panfrost = panfrost_context(pipe);
}
static void
panfrost_delete_blend_state(struct pipe_context *pipe,
void *blend)
{
free( blend );
}
static void
panfrost_set_blend_color(struct pipe_context *pipe,
const struct pipe_blend_color *blend_color)
{
struct panfrost_context *panfrost = panfrost_context(pipe);
}
static void *
panfrost_create_depth_stencil_state(struct pipe_context *pipe,
const struct pipe_depth_stencil_alpha_state *depth_stencil)
{
return mem_dup(depth_stencil, sizeof(*depth_stencil));
}
static void
panfrost_bind_depth_stencil_state(struct pipe_context *pipe,
void *depth_stencil)
{
struct panfrost_context *panfrost = panfrost_context(pipe);
}
static void
panfrost_delete_depth_stencil_state(struct pipe_context *pipe, void *depth)
{
free( depth );
}
static void
panfrost_set_sample_mask(struct pipe_context *pipe,
unsigned sample_mask)
{
}
static void
panfrost_tile_texture(struct panfrost_context *ctx, struct panfrost_resource *rsrc)
{
......@@ -1799,6 +1903,8 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
gallium->screen = screen;
gallium->set_framebuffer_state = panfrost_set_framebuffer_state;
gallium->transfer_map = panfrost_transfer_map;
gallium->transfer_unmap = panfrost_transfer_unmap;
#ifdef HAVE_DRI3
......@@ -1837,6 +1943,18 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
gallium->delete_sampler_state = panfrost_generic_cso_delete;
gallium->bind_sampler_states = panfrost_bind_sampler_states;
gallium->create_blend_state = panfrost_create_blend_state;
gallium->bind_blend_state = panfrost_bind_blend_state;
gallium->delete_blend_state = panfrost_delete_blend_state;
gallium->set_blend_color = panfrost_set_blend_color;
gallium->create_depth_stencil_alpha_state = panfrost_create_depth_stencil_state;
gallium->bind_depth_stencil_alpha_state = panfrost_bind_depth_stencil_state;
gallium->delete_depth_stencil_alpha_state = panfrost_delete_depth_stencil_state;
gallium->set_sample_mask = panfrost_set_sample_mask;
#ifdef HAVE_DRI3
/* XXX: leaks */
gallium->stream_uploader = u_upload_create_default(gallium);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment