panfrost: Lower user clip planes

Since we don't export the relevant CAP, the state tracker calls
nir_lower_clip_vs for us. However, for some reason we're still responsible for
calling nir_lower_clip_fs. Now that we have sane shader key infrastructure,
let's do so.

Fixes the floor rendering wrong in the title screen of Neverball.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
This commit is contained in:
Alyssa Rosenzweig 2022-04-26 16:32:01 -04:00
parent 013bb50168
commit 5bab8e6cbe
4 changed files with 14 additions and 6 deletions

View file

@ -57,6 +57,12 @@ panfrost_shader_compile(struct pipe_screen *pscreen,
true /* point coord is sysval */,
false /* Y-invert */);
}
if (state->key.fs.clip_plane_enable) {
NIR_PASS_V(s, nir_lower_clip_fs,
state->key.fs.clip_plane_enable,
false);
}
}
/* Call out to Midgard compiler given the above NIR */

View file

@ -380,6 +380,11 @@ panfrost_build_key(struct panfrost_context *ctx,
key->fs.sprite_coord_enable = rast->sprite_coord_enable;
}
/* User clip plane lowering needed everywhere */
if (rast) {
key->fs.clip_plane_enable = rast->clip_plane_enable;
}
if (dev->arch <= 5) {
u_foreach_bit(i, (nir->info.outputs_read >> FRAG_RESULT_DATA0)) {
enum pipe_format fmt = PIPE_FORMAT_R8G8B8A8_UNORM;

View file

@ -266,6 +266,9 @@ struct panfrost_fs_key {
/* From rasterize state, to lower point sprites */
uint16_t sprite_coord_enable;
/* User clip plane lowering */
uint8_t clip_plane_enable;
};
struct panfrost_shader_key {

View file

@ -169,7 +169,6 @@ spec@arb_texture_view@sampling-2d-array-as-cubemap,Crash
spec@arb_transform_feedback_instanced@draw-auto instanced,Fail
spec@arb_uniform_buffer_object@rendering-dsa-offset,Fail
spec@arb_uniform_buffer_object@rendering-offset,Fail
spec@arb_vertex_program@clip-plane-transformation arb,Fail
spec@egl 1.4@eglterminate then unbind context,Fail
spec@egl_chromium_sync_control@conformance@eglGetSyncValuesCHROMIUM_msc_and_sbc_test,Fail
spec@egl_chromium_sync_control@conformance,Fail
@ -337,9 +336,6 @@ spec@ext_transform_feedback@tessellation triangle_strip flat_last,Fail
spec@ext_transform_feedback@tessellation triangle_strip monochrome,Fail
spec@ext_transform_feedback@tessellation triangle_strip smooth,Fail
spec@ext_transform_feedback@tessellation triangle_strip wireframe,Fail
spec@glsl-1.10@execution@clipping@clip-plane-transformation clipvert_pos,Fail
spec@glsl-1.10@execution@clipping@clip-plane-transformation fixed,Fail
spec@glsl-1.10@execution@clipping@clip-plane-transformation pos_clipvert,Fail
spec@glsl-1.10@execution@varying-packing@simple float array,Fail
spec@glsl-1.10@execution@varying-packing@simple float arrays_of_arrays,Fail
spec@glsl-1.10@execution@varying-packing@simple int array,Fail
@ -394,7 +390,6 @@ spec@glsl-1.10@execution@varying-packing@simple vec3 arrays_of_arrays,Fail
spec@glsl-1.10@execution@varying-packing@simple vec3 separate,Fail
spec@glsl-1.10@execution@varying-packing@simple vec4 array,Fail
spec@glsl-1.10@execution@varying-packing@simple vec4 arrays_of_arrays,Fail
spec@glsl-1.30@execution@clipping@clip-plane-transformation pos,Fail
spec@glsl-1.30@execution@tex-miplevel-selection texture() 2drect,Crash
spec@glsl-1.30@execution@tex-miplevel-selection texture() 2drectshadow,Crash
spec@glsl-1.30@execution@tex-miplevel-selection texturegrad 2drect,Crash
@ -534,7 +529,6 @@ spec@!opengl 1.0@gl-1.0-edgeflag,Fail
spec@!opengl 1.0@gl-1.0-edgeflag-quads,Fail
spec@!opengl 1.0@gl-1.0-no-op-paths,Fail
spec@!opengl 1.0@gl-1.0-spot-light,Fail
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
spec@!opengl 1.0@rasterpos,Crash
spec@!opengl 1.1@dlist-fdo3129-01,Crash
spec@!opengl 1.1@getteximage-formats,Fail