@@ -21,7 +21,9 @@ using PtrAccessor = BdaAccessor < uint32_t >;
2121
2222[[vk::push_constant]] AutoexposurePushData pushData;
2323
24- groupshared uint32_t sdata[WorkgroupSize];
24+ #define BIN_COUNT 1024
25+
26+ groupshared uint32_t sdata[BIN_COUNT];
2527struct SharedAccessor
2628{
2729 using type = uint32_t;
@@ -72,7 +74,7 @@ void main(uint32_t3 ID : SV_GroupThreadID, uint32_t3 GroupID : SV_GroupID)
7274 SharedAccessor sdata;
7375 TexAccessor tex;
7476
75- using LumaMeter = luma_meter::median_meter< WorkgroupSize, 8000 , PtrAccessor, SharedAccessor, TexAccessor>;
77+ using LumaMeter = luma_meter::median_meter< WorkgroupSize, BIN_COUNT , PtrAccessor, SharedAccessor, TexAccessor>;
7678 LumaMeter meter = LumaMeter::create (pushData.lumaMinMax);
7779
7880 float32_t EV = meter.gatherLuma (histo_accessor, sdata);
@@ -84,10 +86,10 @@ void main(uint32_t3 ID : SV_GroupThreadID, uint32_t3 GroupID : SV_GroupID)
8486
8587 uint32_t2 pos = (glsl::gl_WorkGroupID () * glsl::gl_WorkGroupSize ()).xy + coord;
8688 float32_t2 uv = (float32_t2)(pos) / pushData.viewportSize;
87- float32_t3 color = colorspace::oetf ::sRGB (tex.get (uv).rgb);
89+ float32_t3 color = colorspace::eotf ::sRGB (tex.get (uv).rgb);
8890 float32_t3 CIEColor = mul (colorspace::sRGBtoXYZ, color);
8991 tonemapper::Reinhard<float32_t> reinhard = tonemapper::Reinhard<float32_t>::create (EV, 0.18 , 0.85f );
9092 float32_t3 tonemappedColor = mul (colorspace::decode::XYZtoscRGB, reinhard (CIEColor));
9193
92- textureOut[pos] = float32_t4 (tonemappedColor, 1.0f );
94+ textureOut[pos] = float32_t4 (colorspace::oetf:: sRGB ( tonemappedColor) , 1.0f );
9395}
0 commit comments