mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
glsl: Add support for separate reference Z for shadow samplers
ARB_gpu_shader5's textureGather*() functions which take shadow samplers have a separate `refz` parameter rather than adding it to the coordinate. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
fb08769bb6
commit
af1dfd99b7
1 changed files with 15 additions and 5 deletions
|
|
@ -3383,11 +3383,21 @@ builtin_builder::_texture(ir_texture_opcode opcode,
|
||||||
if (flags & TEX_PROJECT)
|
if (flags & TEX_PROJECT)
|
||||||
tex->projector = swizzle(P, coord_type->vector_elements - 1, 1);
|
tex->projector = swizzle(P, coord_type->vector_elements - 1, 1);
|
||||||
|
|
||||||
/* The shadow comparitor is normally in the Z component, but a few types
|
if (sampler_type->sampler_shadow) {
|
||||||
* have sufficiently large coordinates that it's in W.
|
if (opcode == ir_tg4) {
|
||||||
*/
|
/* gather has refz as a separate parameter, immediately after the
|
||||||
if (sampler_type->sampler_shadow)
|
* coordinate
|
||||||
tex->shadow_comparitor = swizzle(P, MAX2(coord_size, SWIZZLE_Z), 1);
|
*/
|
||||||
|
ir_variable *refz = in_var(glsl_type::float_type, "refz");
|
||||||
|
sig->parameters.push_tail(refz);
|
||||||
|
tex->shadow_comparitor = var_ref(refz);
|
||||||
|
} else {
|
||||||
|
/* The shadow comparitor is normally in the Z component, but a few types
|
||||||
|
* have sufficiently large coordinates that it's in W.
|
||||||
|
*/
|
||||||
|
tex->shadow_comparitor = swizzle(P, MAX2(coord_size, SWIZZLE_Z), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (opcode == ir_txl) {
|
if (opcode == ir_txl) {
|
||||||
ir_variable *lod = in_var(glsl_type::float_type, "lod");
|
ir_variable *lod = in_var(glsl_type::float_type, "lod");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue