@@ -42,7 +42,7 @@ class AutoexposureApp final : public SimpleWindowedApplication, public BuiltinRe
4242 " app_resources/present.frag.hlsl"
4343 };
4444 constexpr static inline MeteringMode MeterMode = MeteringMode::AVERAGE;
45- constexpr static inline uint32_t BinCount = 8000 ;
45+ constexpr static inline uint32_t BinCount = 8000 ; // TODO: it's 8000 here why? gonna set it to workgroup size (1024) for now
4646 constexpr static inline uint32_t2 Dimensions = { 1280 , 720 };
4747 constexpr static inline float32_t2 MeteringWindowScale = { 0 .8f , 0 .8f };
4848 constexpr static inline float32_t2 MeteringWindowOffset = { 0 .1f , 0 .1f };
@@ -314,16 +314,26 @@ class AutoexposureApp final : public SimpleWindowedApplication, public BuiltinRe
314314
315315 const uint32_t workgroupSize = m_physicalDevice->getLimits ().maxComputeWorkGroupInvocations ;
316316 const uint32_t subgroupSize = m_physicalDevice->getLimits ().maxSubgroupSize ;
317- const IShaderCompiler::SMacroDefinition defines[2 ] = {
317+
318+ struct MacroDefines
319+ {
320+ std::string identifier;
321+ std::string definition;
322+ };
323+ const MacroDefines definesBuf[2 ] = {
318324 { " WorkgroupSize" , std::to_string (workgroupSize) },
319325 { " DeviceSubgroupSize" , std::to_string (subgroupSize) }
320326 };
321- options.preprocessorOptions .extraDefines = { defines, defines + 2 };
327+
328+ std::vector<IShaderCompiler::SMacroDefinition> defines;
329+ for (uint32_t i = 0 ; i < 2 ; i++)
330+ defines.emplace_back (definesBuf[i].identifier , definesBuf[i].definition );
331+ options.preprocessorOptions .extraDefines = defines;
322332
323333 auto overriddenSource = compiler->compileToSPIRV ((const char *)source->getContent ()->getPointer (), options);
324334 if (!overriddenSource)
325335 {
326- m_logger->log (" Shader creationed failed: %s!" , ILogger::ELL_ERROR, pathToShader);
336+ m_logger->log (" Shader creationed failed: %s!" , ILogger::ELL_ERROR, pathToShader. c_str () );
327337 std::exit (-1 );
328338 }
329339
0 commit comments