fixing lots of warnings

This commit is contained in:
Dynamitos
2025-03-26 13:38:48 +01:00
parent edfe34a394
commit 9cce5977c5
33 changed files with 204 additions and 185 deletions
@@ -74,6 +74,8 @@ void RayTracingPass::beginFrame(const Component::Camera& cam) {
}
void RayTracingPass::render() {
texture->changeLayout(Gfx::SE_IMAGE_LAYOUT_GENERAL, Gfx::SE_ACCESS_SHADER_READ_BIT, Gfx::SE_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
Gfx::SE_ACCESS_SHADER_WRITE_BIT, Gfx::SE_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR);
Array<Gfx::RayTracingHitGroup> callableGroups;
Array<Gfx::PBottomLevelAS> accelerationStructures;
Array<InstanceData> instanceData;
@@ -168,15 +170,9 @@ void RayTracingPass::render() {
}
pass++;
std::cout << pass << std::endl;
texture->pipelineBarrier(Gfx::SE_ACCESS_SHADER_WRITE_BIT, Gfx::SE_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR,
Gfx::SE_ACCESS_TRANSFER_READ_BIT, Gfx::SE_PIPELINE_STAGE_TRANSFER_BIT);
Array<Gfx::ORenderCommand> commands;
commands.add(std::move(command));
graphics->executeCommands(std::move(commands));
viewport->getOwner()->getBackBuffer()->changeLayout(Gfx::SE_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, Gfx::SE_ACCESS_NONE,
Gfx::SE_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, Gfx::SE_ACCESS_TRANSFER_WRITE_BIT,
Gfx::SE_PIPELINE_STAGE_TRANSFER_BIT);
graphics->copyTexture(Gfx::PTexture2D(texture), viewport->getOwner()->getBackBuffer());
}
void RayTracingPass::endFrame() {}
@@ -200,6 +196,8 @@ void RayTracingPass::publishOutputs() {
texture->changeLayout(Gfx::SE_IMAGE_LAYOUT_GENERAL, Gfx::SE_ACCESS_NONE, Gfx::SE_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
Gfx::SE_ACCESS_SHADER_WRITE_BIT,
Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT | Gfx::SE_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR);
resources->registerRenderPassOutput("BASEPASS_COLOR", Gfx::RenderTargetAttachment(texture, Gfx::SE_IMAGE_LAYOUT_UNDEFINED,
Gfx::SE_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL));
ShaderCompilationInfo compileInfo = {
.name = "RayGenMiss",
.modules = {"RayGen", "AnyHit", "Miss"},
@@ -131,7 +131,7 @@ void ToneMappingPass::render() {
Gfx::SE_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
histogramLayout->reset();
Gfx::PDescriptorSet histogramSet = histogramLayout->allocateDescriptorSet();
histogramSet = histogramLayout->allocateDescriptorSet();
histogramSet->updateConstants("minLogLum", 0, &minLogLum);
histogramSet->updateConstants("inverseLogLumRange", 0, &inverseLogLumRange);
histogramSet->updateConstants("timeCoeff", 0, &timeCoeff);
@@ -10,8 +10,8 @@ WaterRenderer::WaterRenderer(Gfx::PGraphics graphics, PScene scene, Gfx::PDescri
: graphics(graphics), scene(scene) {
skyBox = AssetRegistry::findTexture("", "skyboxsun5deg_tn")->getTexture().cast<Gfx::TextureCube>();
logN = (int)log2(params.N);
threadGroupsX = ceil(params.N / 8.0f);
threadGroupsY = ceil(params.N / 8.0f);
threadGroupsX = (uint32)ceil(params.N / 8.0f);
threadGroupsY = (uint32)ceil(params.N / 8.0f);
materialUniforms = graphics->createUniformBuffer(UniformBufferCreateInfo{
.sourceData =
@@ -263,7 +263,7 @@ WaterRenderer::WaterRenderer(Gfx::PGraphics graphics, PScene scene, Gfx::PDescri
.windSpeed = 2,
.windDirection = 22,
.fetch = 100000,
.spreadBlend = 0.642,
.spreadBlend = 0.642f,
.swell = 1,
.peakEnhancement = 1,
.shortWavesFade = 0.25f,
@@ -523,8 +523,8 @@ void WaterRenderer::updateFFTDescriptor() {
spectrumBuffer->pipelineBarrier(Gfx::SE_ACCESS_TRANSFER_WRITE_BIT, Gfx::SE_PIPELINE_STAGE_TRANSFER_BIT, Gfx::SE_ACCESS_SHADER_READ_BIT,
Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
params.deltaTime = Gfx::getCurrentFrameDelta();
params.frameTime = Gfx::getCurrentFrameTime();
params.deltaTime = (float)Gfx::getCurrentFrameDelta();
params.frameTime = (float)Gfx::getCurrentFrameTime();
paramsBuffer->updateContents(0, sizeof(ComputeParams), &params);
paramsBuffer->pipelineBarrier(Gfx::SE_ACCESS_TRANSFER_WRITE_BIT, Gfx::SE_PIPELINE_STAGE_TRANSFER_BIT, Gfx::SE_ACCESS_UNIFORM_READ_BIT,
Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
@@ -57,8 +57,8 @@ class WaterRenderer {
};
StaticArray<DisplaySpectrumSettings, 8> displaySpectrums;
struct ComputeParams {
float frameTime;
float deltaTime;
float frameTime = 0.0f;
float deltaTime = 0.0f;
float gravity = 9.81f;
float repeatTime = 200.0f;
float depth = 20.0f;