mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
gallium/st: lower rectangle textures if not supported
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>
This commit is contained in:
parent
758a2d5343
commit
08e072015a
4 changed files with 16 additions and 0 deletions
|
|
@ -728,6 +728,8 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
|
|||
screen->get_param(screen, PIPE_CAP_CONDITIONAL_RENDER);
|
||||
st->lower_texcoord_replace =
|
||||
!screen->get_param(screen, PIPE_CAP_POINT_SPRITE);
|
||||
st->lower_rect_tex =
|
||||
!screen->get_param(screen, PIPE_CAP_TEXRECT);
|
||||
st->allow_st_finalize_nir_twice = screen->finalize_nir != NULL;
|
||||
|
||||
st->has_hw_atomics =
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ struct st_context
|
|||
boolean prefer_real_buffer_in_constbuf0;
|
||||
boolean has_conditional_render;
|
||||
boolean lower_texcoord_replace;
|
||||
boolean lower_rect_tex;
|
||||
|
||||
/* There are consequences for drivers wanting to call st_finalize_nir
|
||||
* twice, once before shader caching and once after lowering for shader
|
||||
|
|
|
|||
|
|
@ -1026,6 +1026,14 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog,
|
|||
NIR_PASS_V(nir, nir_split_var_copies);
|
||||
NIR_PASS_V(nir, nir_lower_var_copies);
|
||||
|
||||
if (st->lower_rect_tex) {
|
||||
struct nir_lower_tex_options opts = { 0 };
|
||||
|
||||
opts.lower_rect = true;
|
||||
|
||||
NIR_PASS_V(nir, nir_lower_tex, &opts);
|
||||
}
|
||||
|
||||
st_nir_assign_varying_locations(st, nir);
|
||||
st_nir_assign_uniform_locations(st->ctx, prog, nir);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@ st_nir_finish_builtin_shader(struct st_context *st,
|
|||
NIR_PASS_V(nir, nir_lower_io_to_scalar_early, mask);
|
||||
}
|
||||
|
||||
if (st->lower_rect_tex) {
|
||||
const struct nir_lower_tex_options opts = { .lower_rect = true, };
|
||||
NIR_PASS_V(nir, nir_lower_tex, &opts);
|
||||
}
|
||||
|
||||
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
|
||||
|
||||
st_nir_assign_vs_in_locations(nir);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue