diff options
Diffstat (limited to 'src/gallium/drivers')
24 files changed, 205 insertions, 128 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c index ce9a522c6ab..9f4e4f83ade 100644 --- a/src/gallium/drivers/freedreno/freedreno_state.c +++ b/src/gallium/drivers/freedreno/freedreno_state.c @@ -158,7 +158,9 @@ fd_set_polygon_stipple(struct pipe_context *pctx, } static void -fd_set_scissor_state(struct pipe_context *pctx, +fd_set_scissor_states(struct pipe_context *pctx, + unsigned start_slot, + unsigned num_scissors, const struct pipe_scissor_state *scissor) { struct fd_context *ctx = fd_context(pctx); @@ -168,7 +170,9 @@ fd_set_scissor_state(struct pipe_context *pctx, } static void -fd_set_viewport_state(struct pipe_context *pctx, +fd_set_viewport_states(struct pipe_context *pctx, + unsigned start_slot, + unsigned num_viewports, const struct pipe_viewport_state *viewport) { struct fd_context *ctx = fd_context(pctx); @@ -234,8 +238,8 @@ fd_state_init(struct pipe_context *pctx) pctx->set_constant_buffer = fd_set_constant_buffer; pctx->set_framebuffer_state = fd_set_framebuffer_state; pctx->set_polygon_stipple = fd_set_polygon_stipple; - pctx->set_scissor_state = fd_set_scissor_state; - pctx->set_viewport_state = fd_set_viewport_state; + pctx->set_scissor_states = fd_set_scissor_states; + pctx->set_viewport_states = fd_set_viewport_states; pctx->set_vertex_buffers = fd_set_vertex_buffers; pctx->set_index_buffer = fd_set_index_buffer; diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index a73a3ad44c0..7e8af565c13 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -524,25 +524,29 @@ galahad_context_set_polygon_stipple(struct pipe_context *_pipe, } static void -galahad_context_set_scissor_state(struct pipe_context *_pipe, +galahad_context_set_scissor_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_scissors, const struct pipe_scissor_state *scissor) { struct galahad_context *glhd_pipe = galahad_context(_pipe); struct pipe_context *pipe = glhd_pipe->pipe; - pipe->set_scissor_state(pipe, - scissor); + pipe->set_scissor_states(pipe, start_slot, num_scissors, + scissor); } static void -galahad_context_set_viewport_state(struct pipe_context *_pipe, +galahad_context_set_viewport_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_viewports, const struct pipe_viewport_state *viewport) { struct galahad_context *glhd_pipe = galahad_context(_pipe); struct pipe_context *pipe = glhd_pipe->pipe; - pipe->set_viewport_state(pipe, - viewport); + pipe->set_viewport_states(pipe, start_slot, num_viewports, + viewport); } static void @@ -1077,8 +1081,8 @@ galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) GLHD_PIPE_INIT(set_constant_buffer); GLHD_PIPE_INIT(set_framebuffer_state); GLHD_PIPE_INIT(set_polygon_stipple); - GLHD_PIPE_INIT(set_scissor_state); - GLHD_PIPE_INIT(set_viewport_state); + GLHD_PIPE_INIT(set_scissor_states); + GLHD_PIPE_INIT(set_viewport_states); GLHD_PIPE_INIT(set_fragment_sampler_views); GLHD_PIPE_INIT(set_vertex_sampler_views); GLHD_PIPE_INIT(set_geometry_sampler_views); diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 4a4faa5298c..06d4d3bd1af 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -534,7 +534,9 @@ static void i915_delete_depth_stencil_state(struct pipe_context *pipe, } -static void i915_set_scissor_state( struct pipe_context *pipe, +static void i915_set_scissor_states( struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, const struct pipe_scissor_state *scissor ) { struct i915_context *i915 = i915_context(pipe); @@ -825,7 +827,9 @@ static void i915_set_clip_state( struct pipe_context *pipe, /* Called when driver state tracker notices changes to the viewport * matrix: */ -static void i915_set_viewport_state( struct pipe_context *pipe, +static void i915_set_viewport_states( struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, const struct pipe_viewport_state *viewport ) { struct i915_context *i915 = i915_context(pipe); @@ -833,7 +837,8 @@ static void i915_set_viewport_state( struct pipe_context *pipe, i915->viewport = *viewport; /* struct copy */ /* pass the viewport info to the draw module */ - draw_set_viewport_state(i915->draw, &i915->viewport); + draw_set_viewport_states(i915->draw, start_slot, num_viewports, + &i915->viewport); i915->dirty |= I915_NEW_VIEWPORT; } @@ -1040,12 +1045,12 @@ i915_init_state_functions( struct i915_context *i915 ) i915->base.set_framebuffer_state = i915_set_framebuffer_state; i915->base.set_polygon_stipple = i915_set_polygon_stipple; - i915->base.set_scissor_state = i915_set_scissor_state; + i915->base.set_scissor_states = i915_set_scissor_states; i915->base.set_fragment_sampler_views = i915_set_fragment_sampler_views; i915->base.set_vertex_sampler_views = i915_set_vertex_sampler_views; i915->base.create_sampler_view = i915_create_sampler_view; i915->base.sampler_view_destroy = i915_sampler_view_destroy; - i915->base.set_viewport_state = i915_set_viewport_state; + i915->base.set_viewport_states = i915_set_viewport_states; i915->base.set_vertex_buffers = i915_set_vertex_buffers; i915->base.set_index_buffer = i915_set_index_buffer; } diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 0eff6c926c2..6b342ebd146 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -486,25 +486,27 @@ identity_set_polygon_stipple(struct pipe_context *_pipe, } static void -identity_set_scissor_state(struct pipe_context *_pipe, - const struct pipe_scissor_state *scissor) +identity_set_scissor_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissor) { struct identity_context *id_pipe = identity_context(_pipe); struct pipe_context *pipe = id_pipe->pipe; - pipe->set_scissor_state(pipe, - scissor); + pipe->set_scissor_states(pipe, start_slot, num_scissors, scissor); } static void -identity_set_viewport_state(struct pipe_context *_pipe, - const struct pipe_viewport_state *viewport) +identity_set_viewport_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *viewport) { struct identity_context *id_pipe = identity_context(_pipe); struct pipe_context *pipe = id_pipe->pipe; - pipe->set_viewport_state(pipe, - viewport); + pipe->set_viewport_states(pipe, start_slot, num_viewports, viewport); } static void @@ -914,8 +916,8 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) id_pipe->base.set_constant_buffer = identity_set_constant_buffer; id_pipe->base.set_framebuffer_state = identity_set_framebuffer_state; id_pipe->base.set_polygon_stipple = identity_set_polygon_stipple; - id_pipe->base.set_scissor_state = identity_set_scissor_state; - id_pipe->base.set_viewport_state = identity_set_viewport_state; + id_pipe->base.set_scissor_states = identity_set_scissor_states; + id_pipe->base.set_viewport_states = identity_set_viewport_states; id_pipe->base.set_fragment_sampler_views = identity_set_fragment_sampler_views; id_pipe->base.set_vertex_sampler_views = identity_set_vertex_sampler_views; id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers; diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c index 8443a2cc9d2..33da429bf37 100644 --- a/src/gallium/drivers/ilo/ilo_state.c +++ b/src/gallium/drivers/ilo/ilo_state.c @@ -563,8 +563,10 @@ ilo_set_polygon_stipple(struct pipe_context *pipe, } static void -ilo_set_scissor_state(struct pipe_context *pipe, - const struct pipe_scissor_state *state) +ilo_set_scissor_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *state) { struct ilo_context *ilo = ilo_context(pipe); @@ -574,8 +576,10 @@ ilo_set_scissor_state(struct pipe_context *pipe, } static void -ilo_set_viewport_state(struct pipe_context *pipe, - const struct pipe_viewport_state *state) +ilo_set_viewport_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *state) { struct ilo_context *ilo = ilo_context(pipe); @@ -992,8 +996,8 @@ ilo_init_state_functions(struct ilo_context *ilo) ilo->base.set_constant_buffer = ilo_set_constant_buffer; ilo->base.set_framebuffer_state = ilo_set_framebuffer_state; ilo->base.set_polygon_stipple = ilo_set_polygon_stipple; - ilo->base.set_scissor_state = ilo_set_scissor_state; - ilo->base.set_viewport_state = ilo_set_viewport_state; + ilo->base.set_scissor_states = ilo_set_scissor_states; + ilo->base.set_viewport_states = ilo_set_viewport_states; ilo->base.set_fragment_sampler_views = ilo_set_fragment_sampler_views; ilo->base.set_vertex_sampler_views = ilo_set_vertex_sampler_views; ilo->base.set_geometry_sampler_views = ilo_set_geometry_sampler_views; diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 073d7519184..35630b95249 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -230,6 +230,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) return 1; case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER: return 0; + case PIPE_CAP_MAX_VIEWPORTS: + return 1; } /* should only get here on unhandled cases */ debug_printf("Unexpected PIPE_CAP %d query\n", param); diff --git a/src/gallium/drivers/llvmpipe/lp_state_clip.c b/src/gallium/drivers/llvmpipe/lp_state_clip.c index 32ae079cc15..a26c79f72f6 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_clip.c +++ b/src/gallium/drivers/llvmpipe/lp_state_clip.c @@ -44,28 +44,33 @@ llvmpipe_set_clip_state(struct pipe_context *pipe, static void -llvmpipe_set_viewport_state(struct pipe_context *pipe, - const struct pipe_viewport_state *viewport) +llvmpipe_set_viewport_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *viewports) { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); /* pass the viewport info to the draw module */ - draw_set_viewport_state(llvmpipe->draw, viewport); + draw_set_viewport_states(llvmpipe->draw, start_slot, num_viewports, + viewports); - llvmpipe->viewport = *viewport; /* struct copy */ + llvmpipe->viewport = *viewports; /* struct copy */ llvmpipe->dirty |= LP_NEW_VIEWPORT; } static void -llvmpipe_set_scissor_state(struct pipe_context *pipe, - const struct pipe_scissor_state *scissor) +llvmpipe_set_scissor_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissors) { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); draw_flush(llvmpipe->draw); - llvmpipe->scissor = *scissor; /* struct copy */ + llvmpipe->scissor = *scissors; /* struct copy */ llvmpipe->dirty |= LP_NEW_SCISSOR; } @@ -89,6 +94,6 @@ llvmpipe_init_clip_funcs(struct llvmpipe_context *llvmpipe) { llvmpipe->pipe.set_clip_state = llvmpipe_set_clip_state; llvmpipe->pipe.set_polygon_stipple = llvmpipe_set_polygon_stipple; - llvmpipe->pipe.set_scissor_state = llvmpipe_set_scissor_state; - llvmpipe->pipe.set_viewport_state = llvmpipe_set_viewport_state; + llvmpipe->pipe.set_scissor_states = llvmpipe_set_scissor_states; + llvmpipe->pipe.set_viewport_states = llvmpipe_set_viewport_states; } diff --git a/src/gallium/drivers/noop/noop_state.c b/src/gallium/drivers/noop/noop_state.c index f56ff597c6c..29eeda87339 100644 --- a/src/gallium/drivers/noop/noop_state.c +++ b/src/gallium/drivers/noop/noop_state.c @@ -152,8 +152,10 @@ static void noop_set_sample_mask(struct pipe_context *pipe, unsigned sample_mask { } -static void noop_set_scissor_state(struct pipe_context *ctx, - const struct pipe_scissor_state *state) +static void noop_set_scissor_states(struct pipe_context *ctx, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *state) { } @@ -162,8 +164,10 @@ static void noop_set_stencil_ref(struct pipe_context *ctx, { } -static void noop_set_viewport_state(struct pipe_context *ctx, - const struct pipe_viewport_state *state) +static void noop_set_viewport_states(struct pipe_context *ctx, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *state) { } @@ -311,12 +315,12 @@ void noop_init_state_functions(struct pipe_context *ctx) ctx->set_framebuffer_state = noop_set_framebuffer_state; ctx->set_polygon_stipple = noop_set_polygon_stipple; ctx->set_sample_mask = noop_set_sample_mask; - ctx->set_scissor_state = noop_set_scissor_state; + ctx->set_scissor_states = noop_set_scissor_states; ctx->set_stencil_ref = noop_set_stencil_ref; ctx->set_vertex_buffers = noop_set_vertex_buffers; ctx->set_index_buffer = noop_set_index_buffer; ctx->set_vertex_sampler_views = noop_set_vs_sampler_view; - ctx->set_viewport_state = noop_set_viewport_state; + ctx->set_viewport_states = noop_set_viewport_states; ctx->sampler_view_destroy = noop_sampler_view_destroy; ctx->surface_destroy = noop_surface_destroy; ctx->draw_vbo = noop_draw_vbo; diff --git a/src/gallium/drivers/nv30/nv30_draw.c b/src/gallium/drivers/nv30/nv30_draw.c index e0a1628eb91..85b4fcd877b 100644 --- a/src/gallium/drivers/nv30/nv30_draw.c +++ b/src/gallium/drivers/nv30/nv30_draw.c @@ -373,7 +373,7 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) nv30_render_validate(nv30); if (nv30->draw_dirty & NV30_NEW_VIEWPORT) - draw_set_viewport_state(draw, &nv30->viewport); + draw_set_viewport_states(draw, 0, 1, &nv30->viewport); if (nv30->draw_dirty & NV30_NEW_RASTERIZER) draw_set_rasterizer_state(draw, &nv30->rast->pipe, NULL); if (nv30->draw_dirty & NV30_NEW_CLIP) diff --git a/src/gallium/drivers/nv30/nv30_state.c b/src/gallium/drivers/nv30/nv30_state.c index 2a80974d126..55f2b8c0a77 100644 --- a/src/gallium/drivers/nv30/nv30_state.c +++ b/src/gallium/drivers/nv30/nv30_state.c @@ -373,8 +373,10 @@ nv30_set_polygon_stipple(struct pipe_context *pipe, } static void -nv30_set_scissor_state(struct pipe_context *pipe, - const struct pipe_scissor_state *scissor) +nv30_set_scissor_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_scissor_state *scissor) { struct nv30_context *nv30 = nv30_context(pipe); @@ -383,8 +385,10 @@ nv30_set_scissor_state(struct pipe_context *pipe, } static void -nv30_set_viewport_state(struct pipe_context *pipe, - const struct pipe_viewport_state *vpt) +nv30_set_viewport_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *vpt) { struct nv30_context *nv30 = nv30_context(pipe); @@ -446,8 +450,8 @@ nv30_state_init(struct pipe_context *pipe) pipe->set_constant_buffer = nv30_set_constant_buffer; pipe->set_framebuffer_state = nv30_set_framebuffer_state; pipe->set_polygon_stipple = nv30_set_polygon_stipple; - pipe->set_scissor_state = nv30_set_scissor_state; - pipe->set_viewport_state = nv30_set_viewport_state; + pipe->set_scissor_states = nv30_set_scissor_states; + pipe->set_viewport_states = nv30_set_viewport_states; pipe->set_vertex_buffers = nv30_set_vertex_buffers; pipe->set_index_buffer = nv30_set_index_buffer; diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index ffabf4cff56..2454a3dc98a 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -871,8 +871,10 @@ nv50_set_polygon_stipple(struct pipe_context *pipe, } static void -nv50_set_scissor_state(struct pipe_context *pipe, - const struct pipe_scissor_state *scissor) +nv50_set_scissor_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissor) { struct nv50_context *nv50 = nv50_context(pipe); @@ -881,8 +883,10 @@ nv50_set_scissor_state(struct pipe_context *pipe, } static void -nv50_set_viewport_state(struct pipe_context *pipe, - const struct pipe_viewport_state *vpt) +nv50_set_viewport_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *vpt) { struct nv50_context *nv50 = nv50_context(pipe); @@ -1090,8 +1094,8 @@ nv50_init_state_functions(struct nv50_context *nv50) pipe->set_constant_buffer = nv50_set_constant_buffer; pipe->set_framebuffer_state = nv50_set_framebuffer_state; pipe->set_polygon_stipple = nv50_set_polygon_stipple; - pipe->set_scissor_state = nv50_set_scissor_state; - pipe->set_viewport_state = nv50_set_viewport_state; + pipe->set_scissor_states = nv50_set_scissor_states; + pipe->set_viewport_states = nv50_set_viewport_states; pipe->create_vertex_elements_state = nv50_vertex_state_create; pipe->delete_vertex_elements_state = nv50_vertex_state_delete; diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c index 9adc99cf014..2f40369310a 100644 --- a/src/gallium/drivers/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nvc0/nvc0_state.c @@ -903,8 +903,10 @@ nvc0_set_polygon_stipple(struct pipe_context *pipe, } static void -nvc0_set_scissor_state(struct pipe_context *pipe, - const struct pipe_scissor_state *scissor) +nvc0_set_scissor_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissor) { struct nvc0_context *nvc0 = nvc0_context(pipe); @@ -913,8 +915,10 @@ nvc0_set_scissor_state(struct pipe_context *pipe, } static void -nvc0_set_viewport_state(struct pipe_context *pipe, - const struct pipe_viewport_state *vpt) +nvc0_set_viewport_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *vpt) { struct nvc0_context *nvc0 = nvc0_context(pipe); @@ -1223,8 +1227,8 @@ nvc0_init_state_functions(struct nvc0_context *nvc0) pipe->set_constant_buffer = nvc0_set_constant_buffer; pipe->set_framebuffer_state = nvc0_set_framebuffer_state; pipe->set_polygon_stipple = nvc0_set_polygon_stipple; - pipe->set_scissor_state = nvc0_set_scissor_state; - pipe->set_viewport_state = nvc0_set_viewport_state; + pipe->set_scissor_states = nvc0_set_scissor_states; + pipe->set_viewport_states = nvc0_set_viewport_states; pipe->create_vertex_elements_state = nvc0_vertex_state_create; pipe->delete_vertex_elements_state = nvc0_vertex_state_delete; diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index ba1859bf8b5..7647f9e2aa0 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -275,7 +275,7 @@ static void r300_init_states(struct pipe_context *pipe) pipe->set_blend_color(pipe, &bc); pipe->set_clip_state(pipe, &cs); - pipe->set_scissor_state(pipe, &ss); + pipe->set_scissor_states(pipe, 0, 1, &ss); pipe->set_sample_mask(pipe, ~0); /* Initialize the GPU flush. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 36d510dc45e..6cfc192900a 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1722,8 +1722,10 @@ static void r300_set_sample_mask(struct pipe_context *pipe, r300_mark_atom_dirty(r300, &r300->sample_mask); } -static void r300_set_scissor_state(struct pipe_context* pipe, - const struct pipe_scissor_state* state) +static void r300_set_scissor_states(struct pipe_context* pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state* state) { struct r300_context* r300 = r300_context(pipe); @@ -1733,8 +1735,10 @@ static void r300_set_scissor_state(struct pipe_context* pipe, r300_mark_atom_dirty(r300, &r300->scissor_state); } -static void r300_set_viewport_state(struct pipe_context* pipe, - const struct pipe_viewport_state* state) +static void r300_set_viewport_states(struct pipe_context* pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state* state) { struct r300_context* r300 = r300_context(pipe); struct r300_viewport_state* viewport = @@ -1743,7 +1747,7 @@ static void r300_set_viewport_state(struct pipe_context* pipe, r300->viewport = *state; if (r300->draw) { - draw_set_viewport_state(r300->draw, state); + draw_set_viewport_states(r300->draw, start_slot, num_viewports, state); viewport->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT; return; } @@ -2162,9 +2166,9 @@ void r300_init_state_functions(struct r300_context* r300) r300->context.create_sampler_view = r300_create_sampler_view; r300->context.sampler_view_destroy = r300_sampler_view_destroy; - r300->context.set_scissor_state = r300_set_scissor_state; + r300->context.set_scissor_states = r300_set_scissor_states; - r300->context.set_viewport_state = r300_set_viewport_state; + r300->context.set_viewport_states = r300_set_viewport_states; if (r300->screen->caps.has_tcl) { r300->context.set_vertex_buffers = r300_set_vertex_buffers_hwtcl; diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index f49c5952104..3ebb157b530 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1309,7 +1309,9 @@ static void evergreen_get_scissor_rect(struct r600_context *rctx, *br = S_028244_BR_X(br_x) | S_028244_BR_Y(br_y); } -static void evergreen_set_scissor_state(struct pipe_context *ctx, +static void evergreen_set_scissor_states(struct pipe_context *ctx, + unsigned start_slot, + unsigned num_scissors, const struct pipe_scissor_state *state) { struct r600_context *rctx = (struct r600_context *)ctx; @@ -3860,7 +3862,7 @@ void evergreen_init_state_functions(struct r600_context *rctx) rctx->context.create_sampler_view = evergreen_create_sampler_view; rctx->context.set_framebuffer_state = evergreen_set_framebuffer_state; rctx->context.set_polygon_stipple = evergreen_set_polygon_stipple; - rctx->context.set_scissor_state = evergreen_set_scissor_state; + rctx->context.set_scissor_states = evergreen_set_scissor_states; if (rctx->chip_class == EVERGREEN) rctx->context.get_sample_position = evergreen_get_sample_position; diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index f0e36753d2b..068d87126e5 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1215,8 +1215,10 @@ static void r600_emit_scissor_state(struct r600_context *rctx, struct r600_atom } } -static void r600_set_scissor_state(struct pipe_context *ctx, - const struct pipe_scissor_state *state) +static void r600_set_scissor_states(struct pipe_context *ctx, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *state) { struct r600_context *rctx = (struct r600_context *)ctx; @@ -3252,7 +3254,7 @@ void r600_init_state_functions(struct r600_context *rctx) rctx->context.create_sampler_view = r600_create_sampler_view; rctx->context.set_framebuffer_state = r600_set_framebuffer_state; rctx->context.set_polygon_stipple = r600_set_polygon_stipple; - rctx->context.set_scissor_state = r600_set_scissor_state; + rctx->context.set_scissor_states = r600_set_scissor_states; rctx->context.get_sample_position = r600_get_sample_position; } diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index fbac57688be..4995c81cc46 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -660,8 +660,10 @@ static void r600_set_ps_sampler_views(struct pipe_context *ctx, unsigned count, r600_set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, count, views); } -static void r600_set_viewport_state(struct pipe_context *ctx, - const struct pipe_viewport_state *state) +static void r600_set_viewport_states(struct pipe_context *ctx, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *state) { struct r600_context *rctx = (struct r600_context *)ctx; @@ -1547,7 +1549,7 @@ void r600_draw_rectangle(struct blitter_context *blitter, viewport.translate[1] = 0.0f; viewport.translate[2] = 0.0f; viewport.translate[3] = 0.0f; - rctx->context.set_viewport_state(&rctx->context, &viewport); + rctx->context.set_viewport_states(&rctx->context, 0, 1, &viewport); /* Upload vertices. The hw rectangle has only 3 vertices, * I guess the 4th one is derived from the first 3. @@ -1750,7 +1752,7 @@ void r600_init_common_state_functions(struct r600_context *rctx) rctx->context.set_constant_buffer = r600_set_constant_buffer; rctx->context.set_sample_mask = r600_set_sample_mask; rctx->context.set_stencil_ref = r600_set_pipe_stencil_ref; - rctx->context.set_viewport_state = r600_set_viewport_state; + rctx->context.set_viewport_states = r600_set_viewport_states; rctx->context.set_vertex_buffers = r600_set_vertex_buffers; rctx->context.set_index_buffer = r600_set_index_buffer; rctx->context.set_fragment_sampler_views = r600_set_ps_sampler_views; diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 4556be699cb..82c16411acd 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -263,8 +263,10 @@ static void si_set_clip_state(struct pipe_context *ctx, si_pm4_set_state(rctx, clip, pm4); } -static void si_set_scissor_state(struct pipe_context *ctx, - const struct pipe_scissor_state *state) +static void si_set_scissor_states(struct pipe_context *ctx, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *state) { struct r600_context *rctx = (struct r600_context *)ctx; struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state); @@ -287,8 +289,10 @@ static void si_set_scissor_state(struct pipe_context *ctx, si_pm4_set_state(rctx, scissor, pm4); } -static void si_set_viewport_state(struct pipe_context *ctx, - const struct pipe_viewport_state *state) +static void si_set_viewport_states(struct pipe_context *ctx, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *state) { struct r600_context *rctx = (struct r600_context *)ctx; struct si_state_viewport *viewport = CALLOC_STRUCT(si_state_viewport); @@ -2705,8 +2709,8 @@ void si_init_state_functions(struct r600_context *rctx) rctx->custom_dsa_flush_inplace = si_create_db_flush_dsa(rctx, false, false); rctx->context.set_clip_state = si_set_clip_state; - rctx->context.set_scissor_state = si_set_scissor_state; - rctx->context.set_viewport_state = si_set_viewport_state; + rctx->context.set_scissor_states = si_set_scissor_states; + rctx->context.set_viewport_states = si_set_viewport_states; rctx->context.set_stencil_ref = si_set_pipe_stencil_ref; rctx->context.set_framebuffer_state = si_set_framebuffer_state; diff --git a/src/gallium/drivers/rbug/rbug_context.c b/src/gallium/drivers/rbug/rbug_context.c index bf939b9b678..721419750bb 100644 --- a/src/gallium/drivers/rbug/rbug_context.c +++ b/src/gallium/drivers/rbug/rbug_context.c @@ -693,28 +693,30 @@ rbug_set_polygon_stipple(struct pipe_context *_pipe, } static void -rbug_set_scissor_state(struct pipe_context *_pipe, - const struct pipe_scissor_state *scissor) +rbug_set_scissor_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissor) { struct rbug_context *rb_pipe = rbug_context(_pipe); struct pipe_context *pipe = rb_pipe->pipe; pipe_mutex_lock(rb_pipe->call_mutex); - pipe->set_scissor_state(pipe, - scissor); + pipe->set_scissor_states(pipe, start_slot, num_scissors, scissor); pipe_mutex_unlock(rb_pipe->call_mutex); } static void -rbug_set_viewport_state(struct pipe_context *_pipe, - const struct pipe_viewport_state *viewport) +rbug_set_viewport_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *viewport) { struct rbug_context *rb_pipe = rbug_context(_pipe); struct pipe_context *pipe = rb_pipe->pipe; pipe_mutex_lock(rb_pipe->call_mutex); - pipe->set_viewport_state(pipe, - viewport); + pipe->set_viewport_states(pipe, start_slot, num_viewports, viewport); pipe_mutex_unlock(rb_pipe->call_mutex); } @@ -1171,8 +1173,8 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) rb_pipe->base.set_constant_buffer = rbug_set_constant_buffer; rb_pipe->base.set_framebuffer_state = rbug_set_framebuffer_state; rb_pipe->base.set_polygon_stipple = rbug_set_polygon_stipple; - rb_pipe->base.set_scissor_state = rbug_set_scissor_state; - rb_pipe->base.set_viewport_state = rbug_set_viewport_state; + rb_pipe->base.set_scissor_states = rbug_set_scissor_states; + rb_pipe->base.set_viewport_states = rbug_set_viewport_states; rb_pipe->base.set_fragment_sampler_views = rbug_set_fragment_sampler_views; rb_pipe->base.set_vertex_sampler_views = rbug_set_vertex_sampler_views; rb_pipe->base.set_vertex_buffers = rbug_set_vertex_buffers; diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index fe5de17ff65..16311fa48f8 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -182,6 +182,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_TGSI_TEXCOORD: case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER: return 0; + case PIPE_CAP_MAX_VIEWPORTS: + return 1; } /* should only get here on unhandled cases */ debug_printf("Unexpected PIPE_CAP %d query\n", param); diff --git a/src/gallium/drivers/softpipe/sp_state_clip.c b/src/gallium/drivers/softpipe/sp_state_clip.c index f3a4c234e27..cd1a1956ae4 100644 --- a/src/gallium/drivers/softpipe/sp_state_clip.c +++ b/src/gallium/drivers/softpipe/sp_state_clip.c @@ -44,13 +44,16 @@ softpipe_set_clip_state(struct pipe_context *pipe, static void -softpipe_set_viewport_state(struct pipe_context *pipe, - const struct pipe_viewport_state *viewport) +softpipe_set_viewport_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *viewport) { struct softpipe_context *softpipe = softpipe_context(pipe); /* pass the viewport info to the draw module */ - draw_set_viewport_state(softpipe->draw, viewport); + draw_set_viewport_states(softpipe->draw, start_slot, num_viewports, + viewport); softpipe->viewport = *viewport; /* struct copy */ softpipe->dirty |= SP_NEW_VIEWPORT; @@ -58,8 +61,10 @@ softpipe_set_viewport_state(struct pipe_context *pipe, static void -softpipe_set_scissor_state(struct pipe_context *pipe, - const struct pipe_scissor_state *scissor) +softpipe_set_scissor_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissor) { struct softpipe_context *softpipe = softpipe_context(pipe); @@ -87,7 +92,7 @@ void softpipe_init_clip_funcs(struct pipe_context *pipe) { pipe->set_clip_state = softpipe_set_clip_state; - pipe->set_viewport_state = softpipe_set_viewport_state; - pipe->set_scissor_state = softpipe_set_scissor_state; + pipe->set_viewport_states = softpipe_set_viewport_states; + pipe->set_scissor_states = softpipe_set_scissor_states; pipe->set_polygon_stipple = softpipe_set_polygon_stipple; } diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c index 7884b6d236b..f1c007b5594 100644 --- a/src/gallium/drivers/svga/svga_pipe_misc.c +++ b/src/gallium/drivers/svga/svga_pipe_misc.c @@ -31,12 +31,14 @@ #include "svga_surface.h" -static void svga_set_scissor_state( struct pipe_context *pipe, - const struct pipe_scissor_state *scissor ) +static void svga_set_scissor_states( struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissors ) { struct svga_context *svga = svga_context(pipe); - memcpy( &svga->curr.scissor, scissor, sizeof(*scissor) ); + memcpy( &svga->curr.scissor, scissors, sizeof(*scissors) ); svga->dirty |= SVGA_NEW_SCISSOR; } @@ -161,12 +163,14 @@ static void svga_set_clip_state( struct pipe_context *pipe, /* Called when driver state tracker notices changes to the viewport * matrix: */ -static void svga_set_viewport_state( struct pipe_context *pipe, - const struct pipe_viewport_state *viewport ) +static void svga_set_viewport_states( struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *viewports ) { struct svga_context *svga = svga_context(pipe); - svga->curr.viewport = *viewport; /* struct copy */ + svga->curr.viewport = *viewports; /* struct copy */ svga->dirty |= SVGA_NEW_VIEWPORT; } @@ -175,11 +179,11 @@ static void svga_set_viewport_state( struct pipe_context *pipe, void svga_init_misc_functions( struct svga_context *svga ) { - svga->pipe.set_scissor_state = svga_set_scissor_state; + svga->pipe.set_scissor_states = svga_set_scissor_states; svga->pipe.set_polygon_stipple = svga_set_polygon_stipple; svga->pipe.set_framebuffer_state = svga_set_framebuffer_state; svga->pipe.set_clip_state = svga_set_clip_state; - svga->pipe.set_viewport_state = svga_set_viewport_state; + svga->pipe.set_viewport_states = svga_set_viewport_states; } diff --git a/src/gallium/drivers/svga/svga_swtnl_state.c b/src/gallium/drivers/svga/svga_swtnl_state.c index dea3a26b6f2..d744f18ee72 100644 --- a/src/gallium/drivers/svga/svga_swtnl_state.c +++ b/src/gallium/drivers/svga/svga_swtnl_state.c @@ -80,7 +80,7 @@ static void set_draw_viewport( struct svga_context *svga ) vp.translate[0] += adjx; vp.translate[1] += adjy; - draw_set_viewport_state(svga->swtnl.draw, &vp); + draw_set_viewport_states(svga->swtnl.draw, 0, 1, &vp); } static enum pipe_error diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 962b15e9b2d..ee23077d960 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -765,36 +765,44 @@ trace_context_set_polygon_stipple(struct pipe_context *_pipe, static INLINE void -trace_context_set_scissor_state(struct pipe_context *_pipe, - const struct pipe_scissor_state *state) +trace_context_set_scissor_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *states) { struct trace_context *tr_ctx = trace_context(_pipe); struct pipe_context *pipe = tr_ctx->pipe; - trace_dump_call_begin("pipe_context", "set_scissor_state"); + trace_dump_call_begin("pipe_context", "set_scissor_states"); trace_dump_arg(ptr, pipe); - trace_dump_arg(scissor_state, state); + trace_dump_arg(uint, start_slot); + trace_dump_arg(uint, num_scissors); + trace_dump_arg(scissor_state, states); - pipe->set_scissor_state(pipe, state); + pipe->set_scissor_states(pipe, start_slot, num_scissors, states); trace_dump_call_end(); } static INLINE void -trace_context_set_viewport_state(struct pipe_context *_pipe, - const struct pipe_viewport_state *state) +trace_context_set_viewport_states(struct pipe_context *_pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *states) { struct trace_context *tr_ctx = trace_context(_pipe); struct pipe_context *pipe = tr_ctx->pipe; - trace_dump_call_begin("pipe_context", "set_viewport_state"); + trace_dump_call_begin("pipe_context", "set_viewport_states"); trace_dump_arg(ptr, pipe); - trace_dump_arg(viewport_state, state); + trace_dump_arg(uint, start_slot); + trace_dump_arg(uint, num_viewports); + trace_dump_arg(viewport_state, states); - pipe->set_viewport_state(pipe, state); + pipe->set_viewport_states(pipe, start_slot, num_viewports, states); trace_dump_call_end(); } @@ -1576,8 +1584,8 @@ trace_context_create(struct trace_screen *tr_scr, TR_CTX_INIT(set_constant_buffer); TR_CTX_INIT(set_framebuffer_state); TR_CTX_INIT(set_polygon_stipple); - TR_CTX_INIT(set_scissor_state); - TR_CTX_INIT(set_viewport_state); + TR_CTX_INIT(set_scissor_states); + TR_CTX_INIT(set_viewport_states); TR_CTX_INIT(set_fragment_sampler_views); TR_CTX_INIT(set_vertex_sampler_views); TR_CTX_INIT(set_geometry_sampler_views); |