if (buffers & PIPE_CLEAR_COLOR0)
memcpy(ctx->batch->clear_color, color->f, sizeof(color->f));
+
+ if (buffers & PIPE_CLEAR_DEPTH)
+ ctx->batch->clear_depth = depth;
+
+ if (buffers & PIPE_CLEAR_STENCIL)
+ ctx->batch->clear_stencil = stencil;
}
pipeline_null.gpu,
pipeline_clear,
pipeline_store,
- clear_pipeline_textures);
+ clear_pipeline_textures,
+ ctx->batch->clear_depth,
+ ctx->batch->clear_stencil);
/* Generate the mapping table from the BO list */
demo_mem_map(dev->memmap.ptr.cpu, dev->memmap.size, handles, handle_count,
uint32_t clear, draw;
float clear_color[4];
+ double clear_depth;
+ unsigned clear_stencil;
/* Resource list requirements, represented as a bit set indexed by BO
* handles (GEM handles on Linux, or IOGPU's equivalent on macOS) */
uint32_t pipeline_null,
uint32_t pipeline_clear,
uint32_t pipeline_store,
- bool clear_pipeline_textures)
+ bool clear_pipeline_textures,
+ double clear_depth,
+ unsigned clear_stencil)
{
uint32_t *map = (uint32_t *) buf;
memset(map, 0, 518 * 4);
}
agx_pack(map + 292, IOGPU_CLEAR_Z_S, cfg) {
- cfg.depth_clear_value = fui(1.0); // TODO
- cfg.stencil_clear_value = 0;
+ cfg.depth_clear_value = fui(clear_depth);
+ cfg.stencil_clear_value = clear_stencil;
}
map[312] = 0xffff8212;
uint32_t pipeline_null,
uint32_t pipeline_clear,
uint32_t pipeline_store,
- bool clear_pipeline_textures);
+ bool clear_pipeline_textures,
+ double clear_depth,
+ unsigned clear_stencil);
void
demo_mem_map(void *map, size_t size, unsigned *handles,