mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-16 23:30:35 +01:00
nir/compiler_options: add nir_load_pixel_coord
And use it for nir_printf_fmt_at_px(). Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38996>
This commit is contained in:
parent
063d480a62
commit
12be2a580c
2 changed files with 8 additions and 2 deletions
|
|
@ -311,8 +311,11 @@ void nir_printf_fmt_at_px(nir_builder *b, unsigned ptr_bit_size, unsigned x_px,
|
|||
{
|
||||
va_list ap;
|
||||
|
||||
nir_def *xy_px = nir_f2u32(b,nir_load_frag_coord(b));
|
||||
nir_def *is_at_px = nir_ball_iequal(b, nir_imm_ivec2(b, x_px, y_px), xy_px);
|
||||
nir_def *xy_px = b->shader->options->has_pixel_coord ?
|
||||
nir_load_pixel_coord(b) : nir_f2u32(b, nir_load_frag_coord(b));
|
||||
nir_def *is_at_px = b->shader->options->has_pixel_coord ?
|
||||
nir_ball_iequal(b, nir_imm_uvec2_intN(b, x_px, y_px, 16), xy_px) :
|
||||
nir_ball_iequal(b, nir_imm_ivec2(b, x_px, y_px), xy_px);
|
||||
|
||||
nir_push_if(b, is_at_px);
|
||||
va_start(ap, fmt);
|
||||
|
|
|
|||
|
|
@ -612,6 +612,9 @@ typedef struct nir_shader_compiler_options {
|
|||
/** Backend supports pack_32_4x8 or pack_32_4x8_split. */
|
||||
bool has_pack_32_4x8;
|
||||
|
||||
/** Backend supports nir_load_pixel_coord */
|
||||
bool has_pixel_coord;
|
||||
|
||||
/** Backend supports nir_load_texture_scale and prefers it over txs for nir
|
||||
* lowerings. */
|
||||
bool has_texture_scaling;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue