mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
gallium: Remove the need for set_clip_state() on !PIPE_CAP_CLIP_PLANES.
More driver boilerplate we don't need. We do still have to go through the transformation in st_atom_clip.c because the clip state can get used in draw fallbacks. This revealed that lima had a dirty bit being set that nobody was reading. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8953>
This commit is contained in:
parent
a9b622bcca
commit
211e03d026
11 changed files with 10 additions and 51 deletions
|
|
@ -590,7 +590,11 @@ Capability about the features and limits of the driver/GPU.
|
|||
that back-facing primitives should use the back-side color as the FS input
|
||||
color. If unset, mesa/st will lower it to gl_FrontFacing reads in the
|
||||
fragment shader.
|
||||
* ``pipe_caps.clip_planes``: Driver supports user-defined clip-planes. 0 denotes none, 1 denotes MAX_CLIP_PLANES. > 1 overrides MAX. When is 0, pipe_rasterizer_state::clip_plane_enable is unused.
|
||||
* ``pipe_caps.clip_planes``: Driver supports user-defined clip-planes. 0 denotes
|
||||
none, 1 denotes MAX_CLIP_PLANES. > 1 overrides MAX. When is 0,
|
||||
``set_clip_state()`` will never be called. Instead, user clip planes are
|
||||
lowered to clip distance writes to CLIP_DIST[] corresponding to
|
||||
pipe_rasterizer_state::clip_plane_enable bits.
|
||||
* ``pipe_caps.max_vertex_buffers``: Number of supported vertex buffers.
|
||||
* ``pipe_caps.opencl_integer_functions``: Driver supports extended OpenCL-style integer functions. This includes average, saturating addition, saturating subtraction, absolute difference, count leading zeros, and count trailing zeros.
|
||||
* ``pipe_caps.integer_multiply_32x16``: Driver supports integer multiplication between a 32-bit integer and a 16-bit integer. If the second operand is 32-bits, the upper 16-bits are ignored, and the low 16-bits are possibly sign extended as necessary.
|
||||
|
|
|
|||
|
|
@ -857,12 +857,6 @@ agx_sampler_view_destroy(struct pipe_context *ctx,
|
|||
FREE(view);
|
||||
}
|
||||
|
||||
static void
|
||||
agx_set_clip_state(struct pipe_context *ctx,
|
||||
const struct pipe_clip_state *state)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
agx_set_polygon_stipple(struct pipe_context *pctx,
|
||||
const struct pipe_poly_stipple *state)
|
||||
|
|
@ -5550,7 +5544,6 @@ agx_init_state_functions(struct pipe_context *ctx)
|
|||
ctx->delete_tcs_state = agx_delete_shader_state;
|
||||
ctx->delete_tes_state = agx_delete_shader_state;
|
||||
ctx->set_blend_color = agx_set_blend_color;
|
||||
ctx->set_clip_state = agx_set_clip_state;
|
||||
ctx->set_constant_buffer = agx_set_constant_buffer;
|
||||
ctx->set_shader_buffers = agx_set_shader_buffers;
|
||||
ctx->set_shader_images = agx_set_shader_images;
|
||||
|
|
|
|||
|
|
@ -1484,12 +1484,6 @@ d3d12_set_stencil_ref(struct pipe_context *pctx,
|
|||
ctx->state_dirty |= D3D12_DIRTY_STENCIL_REF;
|
||||
}
|
||||
|
||||
static void
|
||||
d3d12_set_clip_state(struct pipe_context *pctx,
|
||||
const struct pipe_clip_state *pcs)
|
||||
{
|
||||
}
|
||||
|
||||
static struct pipe_stream_output_target *
|
||||
d3d12_create_stream_output_target(struct pipe_context *pctx,
|
||||
struct pipe_resource *pres,
|
||||
|
|
@ -2298,7 +2292,6 @@ d3d12_init_graphics_context_functions(struct d3d12_context *ctx)
|
|||
ctx->base.set_scissor_states = d3d12_set_scissor_states;
|
||||
ctx->base.set_constant_buffer = d3d12_set_constant_buffer;
|
||||
ctx->base.set_framebuffer_state = d3d12_set_framebuffer_state;
|
||||
ctx->base.set_clip_state = d3d12_set_clip_state;
|
||||
ctx->base.set_blend_color = d3d12_set_blend_color;
|
||||
ctx->base.set_sample_mask = d3d12_set_sample_mask;
|
||||
ctx->base.set_stencil_ref = d3d12_set_stencil_ref;
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ struct lima_context {
|
|||
LIMA_CONTEXT_DIRTY_STENCIL_REF = (1 << 12),
|
||||
LIMA_CONTEXT_DIRTY_CONST_BUFF = (1 << 13),
|
||||
LIMA_CONTEXT_DIRTY_TEXTURES = (1 << 14),
|
||||
LIMA_CONTEXT_DIRTY_CLIP = (1 << 15),
|
||||
LIMA_CONTEXT_DIRTY_UNCOMPILED_VS = (1 << 16),
|
||||
LIMA_CONTEXT_DIRTY_UNCOMPILED_FS = (1 << 17),
|
||||
LIMA_CONTEXT_DIRTY_SAMPLE_MASK = (1 << 18),
|
||||
|
|
|
|||
|
|
@ -262,16 +262,6 @@ lima_set_stencil_ref(struct pipe_context *pctx,
|
|||
ctx->dirty |= LIMA_CONTEXT_DIRTY_STENCIL_REF;
|
||||
}
|
||||
|
||||
static void
|
||||
lima_set_clip_state(struct pipe_context *pctx,
|
||||
const struct pipe_clip_state *clip)
|
||||
{
|
||||
struct lima_context *ctx = lima_context(pctx);
|
||||
ctx->clip = *clip;
|
||||
|
||||
ctx->dirty |= LIMA_CONTEXT_DIRTY_CLIP;
|
||||
}
|
||||
|
||||
static void
|
||||
lima_set_constant_buffer(struct pipe_context *pctx,
|
||||
enum pipe_shader_type shader, uint index,
|
||||
|
|
@ -425,7 +415,6 @@ lima_state_init(struct lima_context *ctx)
|
|||
ctx->base.set_scissor_states = lima_set_scissor_states;
|
||||
ctx->base.set_blend_color = lima_set_blend_color;
|
||||
ctx->base.set_stencil_ref = lima_set_stencil_ref;
|
||||
ctx->base.set_clip_state = lima_set_clip_state;
|
||||
|
||||
ctx->base.set_vertex_buffers = lima_set_vertex_buffers;
|
||||
ctx->base.set_constant_buffer = lima_set_constant_buffer;
|
||||
|
|
|
|||
|
|
@ -479,13 +479,6 @@ panfrost_set_min_samples(struct pipe_context *pipe, unsigned min_samples)
|
|||
ctx->dirty |= PAN_DIRTY_MSAA;
|
||||
}
|
||||
|
||||
static void
|
||||
panfrost_set_clip_state(struct pipe_context *pipe,
|
||||
const struct pipe_clip_state *clip)
|
||||
{
|
||||
// struct panfrost_context *panfrost = pan_context(pipe);
|
||||
}
|
||||
|
||||
static void
|
||||
panfrost_set_viewport_states(struct pipe_context *pipe, unsigned start_slot,
|
||||
unsigned num_viewports,
|
||||
|
|
@ -1045,7 +1038,6 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
|
|||
gallium->set_sample_mask = panfrost_set_sample_mask;
|
||||
gallium->set_min_samples = panfrost_set_min_samples;
|
||||
|
||||
gallium->set_clip_state = panfrost_set_clip_state;
|
||||
gallium->set_viewport_states = panfrost_set_viewport_states;
|
||||
gallium->set_scissor_states = panfrost_set_scissor_states;
|
||||
gallium->set_polygon_stipple = panfrost_set_polygon_stipple;
|
||||
|
|
|
|||
|
|
@ -2769,7 +2769,6 @@ vc4_update_compiled_fs(struct vc4_context *vc4, uint8_t prim_mode)
|
|||
memset(key, 0, sizeof(*key));
|
||||
vc4_setup_shared_key(vc4, &key->base, &vc4->fragtex);
|
||||
key->base.shader_state = vc4->prog.bind_fs;
|
||||
nir_shader *vs = vc4->prog.bind_vs->base.ir.nir;
|
||||
key->ucp_enables = vc4->rasterizer->base.clip_plane_enable;
|
||||
key->is_points = (prim_mode == MESA_PRIM_POINTS);
|
||||
key->is_lines = (prim_mode >= MESA_PRIM_LINES &&
|
||||
|
|
|
|||
|
|
@ -67,12 +67,6 @@ vc4_set_stencil_ref(struct pipe_context *pctx,
|
|||
vc4->dirty |= VC4_DIRTY_STENCIL_REF;
|
||||
}
|
||||
|
||||
static void
|
||||
vc4_set_clip_state(struct pipe_context *pctx,
|
||||
const struct pipe_clip_state *clip)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vc4_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask)
|
||||
{
|
||||
|
|
@ -672,7 +666,6 @@ vc4_state_init(struct pipe_context *pctx)
|
|||
{
|
||||
pctx->set_blend_color = vc4_set_blend_color;
|
||||
pctx->set_stencil_ref = vc4_set_stencil_ref;
|
||||
pctx->set_clip_state = vc4_set_clip_state;
|
||||
pctx->set_sample_mask = vc4_set_sample_mask;
|
||||
pctx->set_constant_buffer = vc4_set_constant_buffer;
|
||||
pctx->set_framebuffer_state = vc4_set_framebuffer_state;
|
||||
|
|
|
|||
|
|
@ -2787,12 +2787,6 @@ zink_set_stencil_ref(struct pipe_context *pctx,
|
|||
ctx->stencil_ref_changed = true;
|
||||
}
|
||||
|
||||
static void
|
||||
zink_set_clip_state(struct pipe_context *pctx,
|
||||
const struct pipe_clip_state *pcs)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
zink_set_tess_state(struct pipe_context *pctx,
|
||||
const float default_outer_level[4],
|
||||
|
|
@ -5475,7 +5469,6 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
|||
ctx->base.set_shader_images = zink_set_shader_images;
|
||||
ctx->base.set_framebuffer_state = zink_set_framebuffer_state;
|
||||
ctx->base.set_stencil_ref = zink_set_stencil_ref;
|
||||
ctx->base.set_clip_state = zink_set_clip_state;
|
||||
ctx->base.set_blend_color = zink_set_blend_color;
|
||||
ctx->base.set_tess_state = zink_set_tess_state;
|
||||
ctx->base.set_patch_vertices = zink_set_patch_vertices;
|
||||
|
|
|
|||
|
|
@ -449,6 +449,9 @@ struct pipe_context {
|
|||
void (*set_min_samples)(struct pipe_context *,
|
||||
unsigned min_samples);
|
||||
|
||||
/* Called to set user clip plane state. Unused on GL drivers with
|
||||
* !caps->clip_planes.
|
||||
*/
|
||||
void (*set_clip_state)(struct pipe_context *,
|
||||
const struct pipe_clip_state *);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ void st_update_clip( struct st_context *st )
|
|||
|
||||
if (memcmp(&st->state.clip, &clip, sizeof(clip)) != 0) {
|
||||
st->state.clip = clip;
|
||||
st->pipe->set_clip_state(st->pipe, &clip);
|
||||
if (!st->lower_ucp)
|
||||
st->pipe->set_clip_state(st->pipe, &clip);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue