mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 12:00:12 +01:00
radeonsi: support 8 non-ClipVertex clip planes instead of 6
If there are more than 6 planes without gl_ClipVertex and gl_ClipDistance, add "gl_ClipVertex = gl_Position;" to support up to 8 planes. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35529>
This commit is contained in:
parent
1b594e6745
commit
c743c3dd1a
17 changed files with 24 additions and 17 deletions
|
|
@ -411,7 +411,6 @@ spec@khr_texture_compression_astc@miptree-gles srgb-fp,Fail
|
|||
spec@khr_texture_compression_astc@miptree-gles srgb-fp@sRGB decode full precision,Fail
|
||||
spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp,Fail
|
||||
spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp@sRGB decode full precision,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.0@rasterpos,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ spec@khr_texture_compression_astc@miptree-gles srgb-fp@sRGB decode full precisio
|
|||
spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp,Fail
|
||||
spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp@sRGB decode full precision,Fail
|
||||
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
|
||||
# since Debian 12 (bookworm) uprev
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
glx@glx-multi-window-single-context,Fail
|
||||
glx@glx-swap-pixmap-bad,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.0@rasterpos,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.0@rasterpos,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ glx@glx-visuals-depth -pixmap,Fail
|
|||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
glx@glx_arb_create_context_no_error@no error,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail
|
||||
|
|
|
|||
|
|
|
@ -7,7 +7,6 @@ glx@glx-multi-window-single-context,Fail
|
|||
glx@glx-swap-event_interval,Fail
|
||||
glx@glx_arb_create_context_no_error@no error,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@arb_pipeline_statistics_query@arb_pipeline_statistics_query-frag,Fail
|
||||
spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail
|
||||
|
|
|
|||
|
|
|
@ -9,7 +9,6 @@ glx@glx-swap-event_interval,Fail
|
|||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
glx@glx-visuals-depth -pixmap,Warn
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@arb_pipeline_statistics_query@arb_pipeline_statistics_query-frag,Fail
|
||||
spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgradcube,Fail
|
||||
|
|
|
|||
|
|
|
@ -5,7 +5,6 @@ glx@glx-swap-event_interval,Fail
|
|||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@arb_pipeline_statistics_query@arb_pipeline_statistics_query-clip,Fail
|
||||
spec@arb_pipeline_statistics_query@arb_pipeline_statistics_query-frag,Fail
|
||||
|
|
|
|||
|
|
|
@ -28,7 +28,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp@sRGB decode ful
|
|||
spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp,Fail
|
||||
spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp@sRGB decode full precision,Fail
|
||||
spec@oes_shader_io_blocks@compiler@layout-location-aliasing.vert,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
|
||||
# These are hw bugs related to GS and primitive restart
|
||||
|
|
|
|||
|
Can't render this file because it has a wrong number of fields in line 33.
|
|
|
@ -15,7 +15,6 @@ glx@glx_ext_import_context@make current- multi process,Fail
|
|||
glx@glx_ext_import_context@make current- single process,Fail
|
||||
glx@glx_ext_import_context@query context info,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@!opengl 1.1@texwrap formats bordercolor-swizzled,Fail
|
||||
spec@!opengl 1.1@texwrap formats bordercolor-swizzled@GL_R3_G3_B2- swizzled- border color only,Fail
|
||||
|
|
|
|||
|
|
|
@ -5,7 +5,6 @@ glx@glx-multi-window-single-context,Fail
|
|||
glx@glx-swap-event_interval,Fail
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@!opengl 1.1@texwrap formats bordercolor-swizzled,Fail
|
||||
spec@!opengl 1.1@texwrap formats bordercolor-swizzled@GL_R3_G3_B2- swizzled- border color only,Fail
|
||||
|
|
|
|||
|
|
|
@ -19,7 +19,6 @@ spec@arb_texture_query_lod@compiler@built-in-functions@texturequerylod-samplercu
|
|||
spec@arb_texture_query_lod@compiler@built-in-functions@texturequerylod-samplercubeshadow.frag,Crash
|
||||
spec@arb_uniform_buffer_object@referenced-by-shader,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail
|
||||
spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex@'vs_input2[1][0]' on GL_PROGRAM_INPUT,Fail
|
||||
|
|
|
|||
|
|
|
@ -18,7 +18,6 @@ glx@glx_ext_import_context@make current- multi process,Fail
|
|||
glx@glx_ext_import_context@make current- single process,Fail
|
||||
glx@glx_ext_import_context@query context info,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@!opengl 3.2@gl-3.2-adj-prims cull-back pv-last,Fail
|
||||
spec@!opengl 3.2@gl-3.2-adj-prims cull-front pv-last,Fail
|
||||
|
|
|
|||
|
|
|
@ -994,6 +994,7 @@ static void si_dump_shader_key(const struct si_shader *shader, FILE *f)
|
|||
stage == MESA_SHADER_VERTEX) &&
|
||||
!key->ge.as_es && !key->ge.as_ls) {
|
||||
fprintf(f, " mono.remove_streamout = 0x%x\n", key->ge.mono.remove_streamout);
|
||||
fprintf(f, " mono.write_pos_to_clipvertex = %u\n", key->ge.mono.write_pos_to_clipvertex);
|
||||
fprintf(f, " opt.kill_outputs = 0x%" PRIx64 "\n", key->ge.opt.kill_outputs);
|
||||
fprintf(f, " opt.kill_clip_distances = 0x%x\n", key->ge.opt.kill_clip_distances);
|
||||
fprintf(f, " opt.kill_pointsize = %u\n", key->ge.opt.kill_pointsize);
|
||||
|
|
@ -1121,6 +1122,7 @@ static void si_lower_ngg(struct si_shader *shader, nir_shader *nir,
|
|||
.vs_output_param_offset = temp_info->vs_output_param_offset,
|
||||
.has_param_exports = shader->info.nr_param_exports,
|
||||
.export_clipdist_mask = shader->info.clipdist_mask | shader->info.culldist_mask,
|
||||
.write_pos_to_clipvertex = shader->key.ge.mono.write_pos_to_clipvertex,
|
||||
.force_vrs = sel->screen->options.vrs2x2,
|
||||
.use_gfx12_xfb_intrinsic = !nir->info.use_aco_amd,
|
||||
.skip_viewport_state_culling = sel->info.writes_viewport_index,
|
||||
|
|
@ -1534,7 +1536,7 @@ static void run_late_optimization_and_lowering_passes(struct si_nir_shader_ctx *
|
|||
NIR_PASS_V(nir, ac_nir_lower_legacy_vs,
|
||||
sel->screen->info.gfx_level,
|
||||
shader->info.clipdist_mask | shader->info.culldist_mask,
|
||||
false, false,
|
||||
shader->key.ge.mono.write_pos_to_clipvertex, false,
|
||||
ctx->temp_info.vs_output_param_offset,
|
||||
shader->info.nr_param_exports,
|
||||
shader->key.ge.mono.u.vs_export_prim_id,
|
||||
|
|
@ -1566,6 +1568,7 @@ static void run_late_optimization_and_lowering_passes(struct si_nir_shader_ctx *
|
|||
.has_pipeline_stats_query = sel->screen->use_ngg,
|
||||
.gfx_level = sel->screen->info.gfx_level,
|
||||
.export_clipdist_mask = shader->info.clipdist_mask | shader->info.culldist_mask,
|
||||
.write_pos_to_clipvertex = shader->key.ge.mono.write_pos_to_clipvertex,
|
||||
.param_offsets = ctx->temp_info.vs_output_param_offset,
|
||||
.has_param_exports = shader->info.nr_param_exports,
|
||||
.disable_streamout = !shader->info.num_streamout_vec4s,
|
||||
|
|
|
|||
|
|
@ -635,6 +635,11 @@ struct si_shader_key_ge {
|
|||
|
||||
/* Gfx12: When no streamout buffers are bound, streamout must be disabled. */
|
||||
unsigned remove_streamout : 1;
|
||||
|
||||
/* Emulate 8 clip planes using the CLIP_VERTEX output. Only 6 clip planes are supported
|
||||
* without this.
|
||||
*/
|
||||
unsigned write_pos_to_clipvertex : 1;
|
||||
} mono;
|
||||
|
||||
/* Optimization flags for asynchronous compilation only. */
|
||||
|
|
|
|||
|
|
@ -259,8 +259,10 @@ void si_get_shader_variant_info(struct si_shader *shader,
|
|||
shader->info.num_streamout_vec4s = DIV_ROUND_UP(num_streamout_dwords, 4);
|
||||
}
|
||||
|
||||
shader->info.clipdist_mask = shader->selector->info.clipdist_mask &
|
||||
~shader->key.ge.opt.kill_clip_distances;
|
||||
shader->info.clipdist_mask =
|
||||
(shader->key.ge.mono.write_pos_to_clipvertex ?
|
||||
SI_USER_CLIP_PLANE_MASK : shader->selector->info.clipdist_mask) &
|
||||
~shader->key.ge.opt.kill_clip_distances;
|
||||
shader->info.culldist_mask = BITFIELD_RANGE(nir->info.clip_distance_array_size,
|
||||
nir->info.cull_distance_array_size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2474,6 +2474,16 @@ static void si_get_vs_key_outputs(struct si_context *sctx, struct si_shader_sele
|
|||
|
||||
if (sctx->gfx_level >= GFX12)
|
||||
key->ge.mono.remove_streamout = key->ge.opt.remove_streamout;
|
||||
|
||||
/* The fixed-func hw only supports 6 clip planes, while gl_ClipVertex supports 8. */
|
||||
if (!vs->info.clipdist_mask &&
|
||||
sctx->queued.named.rasterizer->clip_plane_enable & BITFIELD_RANGE(6, 2)) {
|
||||
key->ge.mono.write_pos_to_clipvertex = 1;
|
||||
key->ge.opt.kill_clip_distances = SI_USER_CLIP_PLANE_MASK &
|
||||
~sctx->queued.named.rasterizer->clip_plane_enable;
|
||||
} else {
|
||||
key->ge.mono.write_pos_to_clipvertex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void si_clear_vs_key_outputs(struct si_context *sctx, struct si_shader_selector *vs,
|
||||
|
|
@ -2486,6 +2496,7 @@ static void si_clear_vs_key_outputs(struct si_context *sctx, struct si_shader_se
|
|||
key->ge.opt.ngg_vs_streamout_num_verts_per_prim = 0;
|
||||
key->ge.mono.u.vs_export_prim_id = 0;
|
||||
key->ge.mono.remove_streamout = 0;
|
||||
key->ge.mono.write_pos_to_clipvertex = 0;
|
||||
}
|
||||
|
||||
void si_ps_key_update_framebuffer(struct si_context *sctx)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue