vc4: let st lower rect tex
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:

committed by
Marge Bot

parent
9c67324542
commit
337ba88293
@@ -473,17 +473,6 @@ ntq_emit_tex(struct vc4_compile *c, nir_tex_instr *instr)
|
|||||||
};
|
};
|
||||||
uint32_t next_texture_u = 0;
|
uint32_t next_texture_u = 0;
|
||||||
|
|
||||||
/* There is no native support for GL texture rectangle coordinates, so
|
|
||||||
* we have to rescale from ([0, width], [0, height]) to ([0, 1], [0,
|
|
||||||
* 1]).
|
|
||||||
*/
|
|
||||||
if (instr->sampler_dim == GLSL_SAMPLER_DIM_RECT) {
|
|
||||||
s = qir_FMUL(c, s,
|
|
||||||
qir_uniform(c, QUNIFORM_TEXRECT_SCALE_X, unit));
|
|
||||||
t = qir_FMUL(c, t,
|
|
||||||
qir_uniform(c, QUNIFORM_TEXRECT_SCALE_Y, unit));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE || is_txl) {
|
if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE || is_txl) {
|
||||||
texture_u[2] = qir_uniform(c, QUNIFORM_TEXTURE_CONFIG_P2,
|
texture_u[2] = qir_uniform(c, QUNIFORM_TEXTURE_CONFIG_P2,
|
||||||
unit | (is_txl << 16));
|
unit | (is_txl << 16));
|
||||||
@@ -1877,6 +1866,17 @@ ntq_emit_intrinsic(struct vc4_compile *c, nir_intrinsic_instr *instr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case nir_intrinsic_load_texture_rect_scaling: {
|
||||||
|
assert(nir_src_is_const(instr->src[0]));
|
||||||
|
int sampler = nir_src_as_int(instr->src[0]);
|
||||||
|
|
||||||
|
ntq_store_dest(c, &instr->dest, 0,
|
||||||
|
qir_uniform(c, QUNIFORM_TEXRECT_SCALE_X, sampler));
|
||||||
|
ntq_store_dest(c, &instr->dest, 1,
|
||||||
|
qir_uniform(c, QUNIFORM_TEXRECT_SCALE_Y, sampler));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unknown intrinsic: ");
|
fprintf(stderr, "Unknown intrinsic: ");
|
||||||
nir_print_instr(&instr->instr, stderr);
|
nir_print_instr(&instr->instr, stderr);
|
||||||
@@ -2258,11 +2258,6 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct nir_lower_tex_options tex_options = {
|
struct nir_lower_tex_options tex_options = {
|
||||||
/* We would need to implement txs, but we don't want the
|
|
||||||
* int/float conversions
|
|
||||||
*/
|
|
||||||
.lower_rect = false,
|
|
||||||
|
|
||||||
.lower_txp = ~0,
|
.lower_txp = ~0,
|
||||||
|
|
||||||
/* Apply swizzles to all samplers. */
|
/* Apply swizzles to all samplers. */
|
||||||
|
@@ -200,6 +200,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||||||
case PIPE_CAP_ALPHA_TEST:
|
case PIPE_CAP_ALPHA_TEST:
|
||||||
case PIPE_CAP_VERTEX_COLOR_CLAMPED:
|
case PIPE_CAP_VERTEX_COLOR_CLAMPED:
|
||||||
case PIPE_CAP_TWO_SIDED_COLOR:
|
case PIPE_CAP_TWO_SIDED_COLOR:
|
||||||
|
case PIPE_CAP_TEXRECT:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user