Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Autoexposure example restoration #137

Open
wants to merge 62 commits into
base: master
Choose a base branch
from

Conversation

devshgraphicsprogramming
Copy link
Member

No description provided.

nipunG314 and others added 28 commits July 19, 2024 22:07
Comment on lines 12 to 17
float meteringWindowScaleX, meteringWindowScaleY;
float meteringWindowOffsetX, meteringWindowOffsetY;
float lumaMin, lumaMax;
uint32_t sampleCountX, sampleCountY;
uint32_t viewportSizeX, viewportSizeY;
uint64_t lumaMeterBDA;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should pack these up intro structs in nbl::hlsl::luma_meter and friends

P.S. I see you already have, why not use things like nbl::hlsl::luma_meter::LumaMeteringWindow directly here?

@devshgraphicsprogramming
Copy link
Member Author

Whats the status on this?

@devshgraphicsprogramming
Copy link
Member Author

Before merge this needs to become example 27 or some other free number

Comment on lines +583 to +649
// transition m_tonemappedImgView to GENERAL
{
auto transitionSemaphore = m_device->createSemaphore(0);
auto queue = getGraphicsQueue();
auto cmdbuf = m_cmdBufs[0].get();
cmdbuf->reset(IGPUCommandBuffer::RESET_FLAGS::NONE);

m_api->startCapture();

cmdbuf->begin(IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT);

// TRANSITION m_outImgView to GENERAL (because of descriptorSets0 -> ComputeShader Writes into the image)
{
const IGPUCommandBuffer::SImageMemoryBarrier<IGPUCommandBuffer::SOwnershipTransferBarrier> imgBarriers[] = {
{
.barrier = {
.dep = {
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE,
.dstStageMask = PIPELINE_STAGE_FLAGS::ALL_COMMANDS_BITS,
}
},
.image = m_tonemappedImgView->getCreationParameters().image.get(),
.subresourceRange = {
.aspectMask = IImage::EAF_COLOR_BIT,
.baseMipLevel = 0u,
.levelCount = 1u,
.baseArrayLayer = 0u,
.layerCount = 1u
},
.oldLayout = IImage::LAYOUT::UNDEFINED,
.newLayout = IImage::LAYOUT::GENERAL
}
};
cmdbuf->pipelineBarrier(E_DEPENDENCY_FLAGS::EDF_NONE, { .imgBarriers = imgBarriers });
}
cmdbuf->end();

const IQueue::SSubmitInfo::SSemaphoreInfo rendered[] =
{
{
.semaphore = transitionSemaphore.get(),
.value = 1,
.stageMask = PIPELINE_STAGE_FLAGS::ALL_COMMANDS_BITS
}
};
const IQueue::SSubmitInfo::SCommandBufferInfo commandBuffers[] =
{
{.cmdbuf = cmdbuf }
};
const IQueue::SSubmitInfo infos[] =
{
{
.waitSemaphores = {},
.commandBuffers = commandBuffers,
.signalSemaphores = rendered
}
};
queue->submit(infos);
const ISemaphore::SWaitInfo waits[] = {
{
.semaphore = transitionSemaphore.get(),
.value = 1
}
};
m_device->blockForSemaphores(waits);
m_api->endCapture();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw you could also create the m_tonemappedImgView from an empt ICPUImage using asset converter and override its layout in the callback, that would give you an already transitioned empty image

devsh and others added 5 commits January 23, 2025 20:50
…ould the SPIR-V legalization pass just decide to kill implicit lod texture sampling operations and just warn? GLSL makes them into explicit lod with implied lod 0.
Comment on lines +54 to +57
uint32_t3 glsl::gl_WorkGroupSize()
{
return uint32_t3(DeviceSubgroupSize, DeviceSubgroupSize, 1);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong, because some devices will do 128 or 64 subgroups and you can't have a 128x128 or 64x64 workgroup

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants