From bd759399d4e25397dc169ddf278de96cd9bd3097 Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Tue, 1 Jul 2025 03:19:01 +0200 Subject: [PATCH] get application to compile temporarily --- src/lsfg.cpp | 156 +++++++++++++++++++++++++-------------------------- src/main.cpp | 14 ++--- 2 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/lsfg.cpp b/src/lsfg.cpp index 80a3589..98b3a7f 100644 --- a/src/lsfg.cpp +++ b/src/lsfg.cpp @@ -9,90 +9,90 @@ Generator::Generator(const Context& context) { // TODO: temporal frames // create shader chains - this->downsampleChain = Shaderchains::Downsample(context.device, context.descPool, - this->fullFrame0, this->fullFrame1); - for (size_t i = 0; i < 7; i++) - this->alphaChains.at(i) = Shaderchains::Alpha(context.device, context.descPool, - this->downsampleChain.getOutImages().at(i), i == 0); - this->betaChain = Shaderchains::Beta(context.device, context.descPool, - this->alphaChains.at(0).getOutImages0(), - this->alphaChains.at(0).getOutImages1(), - this->alphaChains.at(0).getOutImages2()); - for (size_t i = 0; i < 7; i++) { - if (i < 4) { - this->gammaChains.at(i) = Shaderchains::Gamma(context.device, context.descPool, - this->alphaChains.at(6 - i).getOutImages1(), - this->alphaChains.at(6 - i).getOutImages0(), - this->betaChain.getOutImages().at(std::min(5UL, 6 - i)), - i == 0 ? std::nullopt - : std::optional{this->gammaChains.at(i - 1).getOutImage2()}, - i == 0 ? std::nullopt - : std::optional{this->gammaChains.at(i - 1).getOutImage1()}, - this->alphaChains.at(6 - i - 1).getOutImages0().at(0).getExtent() - ); - } else { - // this->magicChains.at(i - 4) = Shaderchains::Magic(context.device, context.descPool, - // this->alphaChains.at(6 - i).getOutImages(), - // i == 4 ? this->gammaChains.at(i - 1).getOutImage2() - // : this->extractChains.at(i - 5).getOutImage(), - // i == 4 ? this->gammaChains.at(i - 1).getOutImage1() - // : this->zetaChains.at(i - 5).getOutImage(), - // i == 4 ? std::nullopt : std::optional{this->epsilonChains.at(i - 5).getOutImage()} - // ); - this->deltaChains.at(i - 4) = Shaderchains::Delta(context.device, context.descPool, - this->magicChains.at(i - 4).getOutImages1(), - i == 4 ? std::nullopt - : std::optional{this->deltaChains.at(i - 5).getOutImage()} - ); - this->epsilonChains.at(i - 4) = Shaderchains::Epsilon(context.device, context.descPool, - this->magicChains.at(i - 4).getOutImages2(), - this->betaChain.getOutImages().at(6 - i), - i == 4 ? std::nullopt - : std::optional{this->epsilonChains.at(i - 5).getOutImage()} - ); - this->zetaChains.at(i - 4) = Shaderchains::Zeta(context.device, context.descPool, - this->magicChains.at(i - 4).getOutImages3(), - i == 4 ? this->gammaChains.at(i - 1).getOutImage1() - : this->zetaChains.at(i - 5).getOutImage(), - this->betaChain.getOutImages().at(6 - i) - ); - if (i >= 6) - continue; // no extract for i >= 6 - this->extractChains.at(i - 4) = Shaderchains::Extract(context.device, context.descPool, - this->zetaChains.at(i - 4).getOutImage(), - this->epsilonChains.at(i - 4).getOutImage(), - this->extractChains.at(i - 5).getOutImage().getExtent() - ); - } - } - this->mergeChain = Shaderchains::Merge(context.device, context.descPool, - this->fullFrame0, - this->fullFrame1, - this->zetaChains.at(2).getOutImage(), - this->epsilonChains.at(2).getOutImage(), - this->deltaChains.at(2).getOutImage() - ); + // this->downsampleChain = Shaderchains::Downsample(context.device, context.descPool, + // this->fullFrame0, this->fullFrame1); + // for (size_t i = 0; i < 7; i++) + // this->alphaChains.at(i) = Shaderchains::Alpha(context.device, context.descPool, + // this->downsampleChain.getOutImages().at(i), i == 0); + // this->betaChain = Shaderchains::Beta(context.device, context.descPool, + // this->alphaChains.at(0).getOutImages0(), + // this->alphaChains.at(0).getOutImages1(), + // this->alphaChains.at(0).getOutImages2()); + // for (size_t i = 0; i < 7; i++) { + // if (i < 4) { + // this->gammaChains.at(i) = Shaderchains::Gamma(context.device, context.descPool, + // this->alphaChains.at(6 - i).getOutImages1(), + // this->alphaChains.at(6 - i).getOutImages0(), + // this->betaChain.getOutImages().at(std::min(5UL, 6 - i)), + // i == 0 ? std::nullopt + // : std::optional{this->gammaChains.at(i - 1).getOutImage2()}, + // i == 0 ? std::nullopt + // : std::optional{this->gammaChains.at(i - 1).getOutImage1()}, + // this->alphaChains.at(6 - i - 1).getOutImages0().at(0).getExtent() + // ); + // } else { + // // this->magicChains.at(i - 4) = Shaderchains::Magic(context.device, context.descPool, + // // this->alphaChains.at(6 - i).getOutImages(), + // // i == 4 ? this->gammaChains.at(i - 1).getOutImage2() + // // : this->extractChains.at(i - 5).getOutImage(), + // // i == 4 ? this->gammaChains.at(i - 1).getOutImage1() + // // : this->zetaChains.at(i - 5).getOutImage(), + // // i == 4 ? std::nullopt : std::optional{this->epsilonChains.at(i - 5).getOutImage()} + // // ); + // this->deltaChains.at(i - 4) = Shaderchains::Delta(context.device, context.descPool, + // this->magicChains.at(i - 4).getOutImages1(), + // i == 4 ? std::nullopt + // : std::optional{this->deltaChains.at(i - 5).getOutImage()} + // ); + // this->epsilonChains.at(i - 4) = Shaderchains::Epsilon(context.device, context.descPool, + // this->magicChains.at(i - 4).getOutImages2(), + // this->betaChain.getOutImages().at(6 - i), + // i == 4 ? std::nullopt + // : std::optional{this->epsilonChains.at(i - 5).getOutImage()} + // ); + // this->zetaChains.at(i - 4) = Shaderchains::Zeta(context.device, context.descPool, + // this->magicChains.at(i - 4).getOutImages3(), + // i == 4 ? this->gammaChains.at(i - 1).getOutImage1() + // : this->zetaChains.at(i - 5).getOutImage(), + // this->betaChain.getOutImages().at(6 - i) + // ); + // if (i >= 6) + // continue; // no extract for i >= 6 + // this->extractChains.at(i - 4) = Shaderchains::Extract(context.device, context.descPool, + // this->zetaChains.at(i - 4).getOutImage(), + // this->epsilonChains.at(i - 4).getOutImage(), + // this->extractChains.at(i - 5).getOutImage().getExtent() + // ); + // } + // } + // this->mergeChain = Shaderchains::Merge(context.device, context.descPool, + // this->fullFrame0, + // this->fullFrame1, + // this->zetaChains.at(2).getOutImage(), + // this->epsilonChains.at(2).getOutImage(), + // this->deltaChains.at(2).getOutImage() + // ); } void Generator::present(const Context& context) { Core::CommandBuffer cmdBuffer(context.device, context.cmdPool); cmdBuffer.begin(); - this->downsampleChain.Dispatch(cmdBuffer, fc); - for (size_t i = 0; i < 7; i++) - this->alphaChains.at(6 - i).Dispatch(cmdBuffer, fc); - this->betaChain.Dispatch(cmdBuffer, fc); - for (size_t i = 0; i < 4; i++) - this->gammaChains.at(i).Dispatch(cmdBuffer); - for (size_t i = 0; i < 3; i++) { - this->magicChains.at(i).Dispatch(cmdBuffer); - this->deltaChains.at(i).Dispatch(cmdBuffer); - this->epsilonChains.at(i).Dispatch(cmdBuffer); - this->zetaChains.at(i).Dispatch(cmdBuffer); - if (i < 2) - this->extractChains.at(i).Dispatch(cmdBuffer); - } - this->mergeChain.Dispatch(cmdBuffer, fc); + // this->downsampleChain.Dispatch(cmdBuffer, fc); + // for (size_t i = 0; i < 7; i++) + // this->alphaChains.at(6 - i).Dispatch(cmdBuffer, fc); + // this->betaChain.Dispatch(cmdBuffer, fc); + // for (size_t i = 0; i < 4; i++) + // this->gammaChains.at(i).Dispatch(cmdBuffer); + // for (size_t i = 0; i < 3; i++) { + // this->magicChains.at(i).Dispatch(cmdBuffer); + // this->deltaChains.at(i).Dispatch(cmdBuffer); + // this->epsilonChains.at(i).Dispatch(cmdBuffer); + // this->zetaChains.at(i).Dispatch(cmdBuffer); + // if (i < 2) + // this->extractChains.at(i).Dispatch(cmdBuffer); + // } + // this->mergeChain.Dispatch(cmdBuffer, fc); cmdBuffer.end(); diff --git a/src/main.cpp b/src/main.cpp index 5cbc601..de8e249 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -51,12 +51,12 @@ int main() { // Globals::initializeGlobals(device); // create downsample shader chain - Core::Image inputImage( - device, { 2560, 1411 }, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, - VK_IMAGE_ASPECT_COLOR_BIT - ); - Utils::uploadImage(device, commandPool, inputImage, "rsc/images/source.dds"); + // Core::Image inputImage( + // device, { 2560, 1411 }, VK_FORMAT_R8G8B8A8_UNORM, + // VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, + // VK_IMAGE_ASPECT_COLOR_BIT + // ); + // Utils::uploadImage(device, commandPool, inputImage, "rsc/images/source.dds"); // Shaderchains::Downsample downsample(device, descriptorPool, inputImage); @@ -83,7 +83,7 @@ int main() { // Shaderchains::Beta beta(device, descriptorPool, // betaTemporalImages, // alphas.at(0).getOutImages() - ); + // ); // create gamma to zeta shader chains // std::vector gammas;