mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-12 20:10:25 +01:00
gallivm/sample: add gather component selection to the key.
This allows for component selection to work as per ARB_gpu_shader5/GLES3.1 Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
5084e9785b
commit
1e65757f4e
2 changed files with 16 additions and 1 deletions
|
|
@ -96,6 +96,8 @@ enum lp_sampler_op_type {
|
|||
#define LP_SAMPLER_LOD_CONTROL_MASK (3 << 4)
|
||||
#define LP_SAMPLER_LOD_PROPERTY_SHIFT 6
|
||||
#define LP_SAMPLER_LOD_PROPERTY_MASK (3 << 6)
|
||||
#define LP_SAMPLER_GATHER_COMP_SHIFT 8
|
||||
#define LP_SAMPLER_GATHER_COMP_MASK (3 << 8)
|
||||
|
||||
struct lp_sampler_params
|
||||
{
|
||||
|
|
@ -345,6 +347,7 @@ struct lp_build_sample_context
|
|||
/** number of lod values (valid are 1, length/4, length) */
|
||||
unsigned num_lods;
|
||||
|
||||
unsigned gather_comp;
|
||||
boolean no_quad_lod;
|
||||
boolean no_brilinear;
|
||||
boolean no_rho_approx;
|
||||
|
|
|
|||
|
|
@ -1033,6 +1033,17 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
|||
boolean seamless_cube_filter, accurate_cube_corners;
|
||||
unsigned chan_swiz = bld->static_texture_state->swizzle_r;
|
||||
|
||||
if (is_gather) {
|
||||
switch (bld->gather_comp) {
|
||||
case 0: chan_swiz = bld->static_texture_state->swizzle_r; break;
|
||||
case 1: chan_swiz = bld->static_texture_state->swizzle_g; break;
|
||||
case 2: chan_swiz = bld->static_texture_state->swizzle_b; break;
|
||||
case 3: chan_swiz = bld->static_texture_state->swizzle_a; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
seamless_cube_filter = (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_CUBE_ARRAY) &&
|
||||
bld->static_sampler_state->seamless_cube_map;
|
||||
|
|
@ -2978,7 +2989,8 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
|||
bld.num_lods = num_quads;
|
||||
}
|
||||
|
||||
|
||||
if (op_is_gather)
|
||||
bld.gather_comp = (sample_key & LP_SAMPLER_GATHER_COMP_MASK) >> LP_SAMPLER_GATHER_COMP_SHIFT;
|
||||
bld.lodf_type = type;
|
||||
/* we want native vector size to be able to use our intrinsics */
|
||||
if (bld.num_lods != type.length) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue