From 3a9356831a962997e37589c7a04e12aaa85a99e3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 14 Aug 2020 13:22:27 -0700 Subject: [PATCH] nir: Update the comment about nir_lower_uniforms_to_ubo()'s multiplier. I remembered doing this analysis and was arguing in another MR that this pass didn't have any driver dependency, but it actually does based on PIPE_CAP_PACKED_UNIFORMS. Reviewed-by: Kristian H. Kristensen Reviewed-by: Rob Clark Part-of: --- src/compiler/nir/nir_lower_uniforms_to_ubo.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/compiler/nir/nir_lower_uniforms_to_ubo.c b/src/compiler/nir/nir_lower_uniforms_to_ubo.c index bdee9e927cb..78afc7f6232 100644 --- a/src/compiler/nir/nir_lower_uniforms_to_ubo.c +++ b/src/compiler/nir/nir_lower_uniforms_to_ubo.c @@ -26,13 +26,16 @@ * Simultaneously, remap existing UBO accesses by increasing their binding * point by 1. * - * Both the base and the offset are interpreted as 16-byte units. + * Note that nir_intrinsic_load_uniform base/ranges can be set in different + * units, and the multiplier argument caters to supporting these different + * units. * - * Note that locations can be set in different units, and the multiplier - * argument caters to supporting these different units. * For example: - * - st_glsl_to_nir uses dwords (4 bytes) so the multiplier should be 4 - * - tgsi_to_nir uses bytes, so the multiplier should be 16 + * - st_glsl_to_nir for PIPE_CAP_PACKED_UNIFORMS uses dwords (4 bytes) so the + * multiplier should be 4 + * - st_glsl_to_nir for !PIPE_CAP_PACKED_UNIFORMS uses vec4s so the + * multiplier should be 16 + * - tgsi_to_nir uses vec4s, so the multiplier should be 16 */ #include "nir.h"