mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 13:50:11 +01:00
gallium: add PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER
It's required by the latest IO refactoring. screen.rst explains it and it's not pretty. It can be argued that finalize_nir shouldn't exist. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32175>
This commit is contained in:
parent
b8ee69f7fe
commit
89dad5618d
8 changed files with 9 additions and 1 deletions
|
|
@ -653,6 +653,7 @@ The integer capabilities:
|
|||
* ``PIPE_CAP_SHADER_SUBGROUP_SUPPORTED_FEATURES``: Bitmask of shader subgroup features listed in :ext:`GL_KHR_shader_subgroup`.
|
||||
* ``PIPE_CAP_SHADER_SUBGROUP_QUAD_ALL_STAGES``: Whether shader subgroup quad operations are supported by shader stages other than fragment shader.
|
||||
* ``PIPE_CAP_MULTIVIEW``: Whether multiview rendering of array textures is supported. A return of ``1`` indicates support for OVR_multiview, and ``2`` additionally supports OVR_multiview2.
|
||||
* ``PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER``: Whether `pipe_screen::finalize_nir` can be called in the GLSL linker before the NIR is stored in the shader cache. It's always called again after st/mesa adds code for shader variants. It must be 1 if the driver wants to report compile failures to the GLSL linker. It must be 0 if two consecutive `finalize_nir` calls on the same shader can break it, or if `finalize_nir` can't handle NIR that isn't fully lowered for the driver, or if `finalize_nir` breaks passes that st/mesa runs after it. Setting it to 1 is generally safe for drivers that expose nir_io_has_intrinsics and that don't enable any optional shader variants in st/mesa. Since it's difficult to support, any future refactoring can change it to 0.
|
||||
|
||||
|
||||
.. _pipe_capf:
|
||||
|
|
|
|||
|
|
@ -565,6 +565,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
|
|||
case PIPE_CAP_SHADER_SUBGROUP_SUPPORTED_STAGES:
|
||||
case PIPE_CAP_SHADER_SUBGROUP_SUPPORTED_FEATURES:
|
||||
case PIPE_CAP_SHADER_SUBGROUP_QUAD_ALL_STAGES:
|
||||
case PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -413,6 +413,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
|
|||
case PIPE_CAP_USER_VERTEX_BUFFERS:
|
||||
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
|
||||
case PIPE_CAP_TGSI_TEXCOORD:
|
||||
case PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER:
|
||||
return 1;
|
||||
|
||||
case PIPE_CAP_TEXTURE_TRANSFER_MODES:
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
|
||||
case PIPE_CAP_LEGACY_MATH_RULES:
|
||||
case PIPE_CAP_TGSI_TEXCOORD:
|
||||
case PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER:
|
||||
return 1;
|
||||
|
||||
case PIPE_CAP_TEXTURE_TRANSFER_MODES:
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_NULL_TEXTURES:
|
||||
case PIPE_CAP_HAS_CONST_BW:
|
||||
case PIPE_CAP_CL_GL_SHARING:
|
||||
case PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER:
|
||||
return 1;
|
||||
|
||||
/* Tahiti and Verde only: reduction mode is unsupported due to a bug
|
||||
|
|
|
|||
|
|
@ -645,6 +645,7 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
|
||||
case PIPE_CAP_ALLOW_GLTHREAD_BUFFER_SUBDATA_OPT:
|
||||
case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
|
||||
case PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER:
|
||||
return 1;
|
||||
|
||||
case PIPE_CAP_DRAW_VERTEX_STATE:
|
||||
|
|
|
|||
|
|
@ -987,6 +987,7 @@ enum pipe_cap
|
|||
PIPE_CAP_SHADER_SUBGROUP_SUPPORTED_FEATURES,
|
||||
PIPE_CAP_SHADER_SUBGROUP_QUAD_ALL_STAGES,
|
||||
PIPE_CAP_MULTIVIEW,
|
||||
PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER,
|
||||
PIPE_CAP_LAST,
|
||||
/* XXX do not add caps after PIPE_CAP_LAST! */
|
||||
};
|
||||
|
|
|
|||
|
|
@ -625,7 +625,8 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
|
|||
screen->get_param(screen, PIPE_CAP_CONDITIONAL_RENDER);
|
||||
st->lower_rect_tex =
|
||||
!screen->get_param(screen, PIPE_CAP_TEXRECT);
|
||||
st->allow_st_finalize_nir_twice = screen->finalize_nir != NULL;
|
||||
st->allow_st_finalize_nir_twice =
|
||||
screen->get_param(screen, PIPE_CAP_CALL_FINALIZE_NIR_IN_LINKER);
|
||||
|
||||
st->has_hw_atomics =
|
||||
screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue