@@ -38,7 +38,7 @@ void nbl_glsl_ext_LumaMeter(in bool wgExecutionMask);
38
38
39
39
float nbl_glsl_ext_LumaMeter_local_process(in bool wgExecutionMask, in vec3 color)
40
40
{
41
- float scaledLogLuma;
41
+ float scaledLogLuma = 0 .f; // this default kind-of makes sense
42
42
// linearize
43
43
if (wgExecutionMask)
44
44
{
@@ -58,7 +58,7 @@ float nbl_glsl_ext_LumaMeter_local_process(in bool wgExecutionMask, in vec3 colo
58
58
int histogramIndex;
59
59
if (wgExecutionMask)
60
60
{
61
- histogramIndex = int (scaledLogLuma * float (_NBL_GLSL_EXT_LUMA_METER_BIN_COUNT- 1u)+ 0.5 );
61
+ histogramIndex = int (scaledLogLuma* float (_NBL_GLSL_EXT_LUMA_METER_BIN_COUNT- 1u)+ 0.5 );
62
62
histogramIndex += int (gl_LocalInvocationIndex& uint (_NBL_GLSL_EXT_LUMA_METER_LOCAL_REPLICATION- 1 ))* _NBL_GLSL_EXT_LUMA_METER_PADDED_BIN_COUNT;
63
63
}
64
64
// barrier so we "see" the cleared histogram
@@ -76,7 +76,7 @@ float nbl_glsl_ext_LumaMeter_local_process(in bool wgExecutionMask, in vec3 colo
76
76
#include "nbl/ builtin/ glsl/ workgroup/ arithmetic.glsl"
77
77
#endif
78
78
79
- nbl_glsl_ext_LumaMeter_WriteOutValue_t nbl_glsl_ext_LumaMeter_workgroup_process(in bool wgExecutionMask, in float scaledLogLuma)
79
+ nbl_glsl_ext_LumaMeter_WriteOutValue_t nbl_glsl_ext_LumaMeter_workgroup_process(in float scaledLogLuma)
80
80
{
81
81
#if _NBL_GLSL_EXT_LUMA_METER_MODE_DEFINED_== _NBL_GLSL_EXT_LUMA_METER_MODE_MEDIAN
82
82
// join the histograms across workgroups
@@ -85,7 +85,7 @@ nbl_glsl_ext_LumaMeter_WriteOutValue_t nbl_glsl_ext_LumaMeter_workgroup_process(
85
85
writeOutVal += _NBL_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex+ i* _NBL_GLSL_EXT_LUMA_METER_PADDED_BIN_COUNT];
86
86
return writeOutVal;
87
87
#elif _NBL_GLSL_EXT_LUMA_METER_MODE_DEFINED_== _NBL_GLSL_EXT_LUMA_METER_MODE_GEOM_MEAN
88
- return nbl_glsl_workgroupAdd(wgExecutionMask ? scaledLogLuma: 0 .f );
88
+ return nbl_glsl_workgroupAdd(scaledLogLuma);
89
89
#endif
90
90
}
91
91
@@ -100,7 +100,7 @@ void nbl_glsl_ext_LumaMeter(in bool wgExecutionMask)
100
100
nbl_glsl_ext_LumaMeter_clearFirstPassOutput();
101
101
102
102
const float scaledLogLuma = nbl_glsl_ext_LumaMeter_local_process(wgExecutionMask,color);
103
- const nbl_glsl_ext_LumaMeter_WriteOutValue_t writeOutVal = nbl_glsl_ext_LumaMeter_workgroup_process(wgExecutionMask, scaledLogLuma);
103
+ const nbl_glsl_ext_LumaMeter_WriteOutValue_t writeOutVal = nbl_glsl_ext_LumaMeter_workgroup_process(scaledLogLuma);
104
104
105
105
nbl_glsl_ext_LumaMeter_setFirstPassOutput(writeOutVal);
106
106
}
0 commit comments