pctx->set_vertex_buffers(pctx, blitter->vb_slot, 1,
&ctx->solid_vbuf_state.vertexbuf.vb[0]);
pctx->set_stream_output_targets(pctx, 0, NULL, NULL);
- pctx->bind_vs_state(pctx, ctx->solid_prog.vs);
+
+ if (pfb->layers > 1)
+ pctx->bind_vs_state(pctx, ctx->solid_layered_prog.vs);
+ else
+ pctx->bind_vs_state(pctx, ctx->solid_prog.vs);
+
pctx->bind_fs_state(pctx, ctx->solid_prog.fs);
/* Clear geom/tess shaders, lest the draw emit code think we are
struct pipe_draw_info info = {
.mode = PIPE_PRIM_MAX, /* maps to DI_PT_RECTLIST */
.max_index = 1,
- .instance_count = 1,
+ .instance_count = MAX2(1, pfb->layers),
};
struct pipe_draw_start_count draw = {
.count = 2,
/* shaders used by clear, and gmem->mem blits: */
struct fd_program_stateobj solid_prog; // TODO move to screen?
+ struct fd_program_stateobj solid_layered_prog;
/* shaders used by mem->gmem blits: */
struct fd_program_stateobj blit_prog[MAX_RENDER_TARGETS]; // TODO move to screen?
#include "tgsi/tgsi_text.h"
#include "tgsi/tgsi_ureg.h"
+#include "util/u_simple_shaders.h"
+
#include "freedreno_program.h"
#include "freedreno_context.h"
ctx->solid_prog.fs = assemble_tgsi(pctx, solid_fs, true);
ctx->solid_prog.vs = assemble_tgsi(pctx, solid_vs, false);
+ if (ctx->screen->gpu_id >= 600) {
+ ctx->solid_layered_prog.fs = assemble_tgsi(pctx, solid_fs, true);
+ ctx->solid_layered_prog.vs =
+ util_make_layered_clear_vertex_shader(pctx);
+ }
+
if (ctx->screen->gpu_id >= 500)
return;
pctx->delete_vs_state(pctx, ctx->solid_prog.vs);
pctx->delete_fs_state(pctx, ctx->solid_prog.fs);
+
+ if (ctx->screen->gpu_id >= 600) {
+ pctx->delete_vs_state(pctx, ctx->solid_layered_prog.vs);
+ pctx->delete_fs_state(pctx, ctx->solid_layered_prog.fs);
+ }
+
if (ctx->screen->gpu_id >= 500)
return;