From f55a308c75d1c18dc3e8268ba7cdc3e6f66067b9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Dec 2019 14:48:39 -0800 Subject: [PATCH] v3d: Enable PIPE_CAP_TGSI_TEXCOORD. Dave wants to drop the !TEXCOORD path from NIR, and it's easy enough to do. Untested. Reviewed-by: Jose Maria Casanova Crespo Part-of: --- src/broadcom/compiler/nir_to_vir.c | 17 ++++++----------- src/gallium/drivers/v3d/v3d_screen.c | 1 + 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index e7b8cf9cb3a..1092c6b41da 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -23,6 +23,7 @@ #include #include "util/format/u_format.h" +#include "util/u_helpers.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/ralloc.h" @@ -1562,21 +1563,14 @@ ntq_setup_vs_inputs(struct v3d_compile *c) } } -static bool -var_needs_point_coord(struct v3d_compile *c, nir_variable *var) -{ - return (var->data.location == VARYING_SLOT_PNTC || - (var->data.location >= VARYING_SLOT_VAR0 && - (c->fs_key->point_sprite_mask & - (1 << (var->data.location - VARYING_SLOT_VAR0))))); -} - static bool program_reads_point_coord(struct v3d_compile *c) { nir_foreach_variable(var, &c->s->inputs) { - if (var_needs_point_coord(c, var)) + if (util_varying_is_point_coord(var->data.location, + c->fs_key->point_sprite_mask)) { return true; + } } return false; @@ -1657,7 +1651,8 @@ ntq_setup_fs_inputs(struct v3d_compile *c) if (var->data.location == VARYING_SLOT_POS) { emit_fragcoord_input(c, loc); - } else if (var_needs_point_coord(c, var)) { + } else if (util_varying_is_point_coord(var->data.location, + c->fs_key->point_sprite_mask)) { c->inputs[loc * 4 + 0] = c->point_x; c->inputs[loc * 4 + 1] = c->point_y; } else { diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index bafe7301266..4766563f019 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -136,6 +136,7 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR: case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT: case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL: + case PIPE_CAP_TGSI_TEXCOORD: return 1; case PIPE_CAP_TEXTURE_QUERY_LOD: -- 2.30.2