vtn: set is_gather_implicit_lod

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22315>
This commit is contained in:
Rhys Perry
2023-03-31 19:40:27 +01:00
committed by Marge Bot
parent 48158636bf
commit dbb9f3a8a9
2 changed files with 10 additions and 0 deletions
+9
View File
@@ -3086,6 +3086,14 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
is_shadow && glsl_get_components(ret_type->type) == 1;
instr->component = gather_component;
/* If SpvCapabilityImageGatherBiasLodAMD is enabled, texture gather without an explicit LOD
* has an implicit one (instead of using level 0).
*/
if (texop == nir_texop_tg4 && b->image_gather_bias_lod &&
!(operands & SpvImageOperandsLodMask)) {
instr->is_gather_implicit_lod = true;
}
/* The Vulkan spec says:
*
* "If an instruction loads from or stores to a resource (including
@@ -4797,6 +4805,7 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
case SpvCapabilityImageGatherBiasLodAMD:
spv_check_supported(amd_image_gather_bias_lod, cap);
b->image_gather_bias_lod = true;
break;
case SpvCapabilityAtomicFloat16AddEXT:
+1
View File
@@ -738,6 +738,7 @@ struct vtn_builder {
struct vtn_value *entry_point;
struct vtn_value *workgroup_size_builtin;
bool variable_pointers;
bool image_gather_bias_lod;
uint32_t *interface_ids;
size_t interface_ids_count;