From: Dave Airlie Date: Tue, 3 Dec 2019 23:26:46 +0000 (+1000) Subject: llvmpipe: enable texcoord semantics X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3263c9824ebf35a24380e401bb1b1852d538a46d;p=mesa.git llvmpipe: enable texcoord semantics To make NIR transitioning easier, move the driver to using texcoord semantics. Reviewed-by: Eric Anholt --- diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 0814145512c..ce41baa529b 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -227,8 +227,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: - case PIPE_CAP_TGSI_TEXCOORD: return 0; + case PIPE_CAP_TGSI_TEXCOORD: case PIPE_CAP_DRAW_INDIRECT: return 1; diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c index 0c4b1b758f9..073ca5b1c88 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_point.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c @@ -241,27 +241,35 @@ setup_point_coefficients( struct lp_setup_context *setup, case LP_INTERP_LINEAR: /* Sprite tex coords may use linear interpolation someday */ /* fall-through */ - case LP_INTERP_PERSPECTIVE: + case LP_INTERP_PERSPECTIVE: { /* check if the sprite coord flag is set for this attribute. * If so, set it up so it up so x and y vary from 0 to 1. */ - if (shader->info.base.input_semantic_name[slot] == TGSI_SEMANTIC_GENERIC) { + bool do_texcoord_coef = false; + if (shader->info.base.input_semantic_name[slot] == TGSI_SEMANTIC_PCOORD) { + do_texcoord_coef = true; + } + else if (shader->info.base.input_semantic_name[slot] == TGSI_SEMANTIC_TEXCOORD) { unsigned semantic_index = shader->info.base.input_semantic_index[slot]; /* Note that sprite_coord enable is a bitfield of * PIPE_MAX_SHADER_OUTPUTS bits. */ if (semantic_index < PIPE_MAX_SHADER_OUTPUTS && (setup->sprite_coord_enable & (1u << semantic_index))) { - for (i = 0; i < NUM_CHANNELS; i++) { - if (usage_mask & (1 << i)) { - texcoord_coef(setup, info, slot + 1, i, - setup->sprite_coord_origin, - perspective); - } + do_texcoord_coef = true; + } + } + if (do_texcoord_coef) { + for (i = 0; i < NUM_CHANNELS; i++) { + if (usage_mask & (1 << i)) { + texcoord_coef(setup, info, slot + 1, i, + setup->sprite_coord_origin, + perspective); } - break; } + break; } + } /* fall-through */ case LP_INTERP_CONSTANT: for (i = 0; i < NUM_CHANNELS; i++) {