-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: master
Are you sure you want to change the base?
Conversation
…Examples-and-Tests into autoexposure_ex
…Examples-and-Tests into autoexposure_ex
…Examples-and-Tests into autoexposure_ex
…Examples-and-Tests into autoexposure_ex
…Examples-and-Tests into autoexposure_ex
float meteringWindowScaleX, meteringWindowScaleY; | ||
float meteringWindowOffsetX, meteringWindowOffsetY; | ||
float lumaMin, lumaMax; | ||
uint32_t sampleCountX, sampleCountY; | ||
uint32_t viewportSizeX, viewportSizeY; | ||
uint64_t lumaMeterBDA; |
There was a problem hiding this comment.
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 struct
s 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?
…Examples-and-Tests into autoexposure_ex
Whats the status on this? |
Before merge this needs to become example 27 or some other free number |
…Examples-and-Tests into autoexposure_ex
…Examples-and-Tests into autoexposure_ex
…e sure its asset conversion cache is written to
// 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(); | ||
} |
There was a problem hiding this comment.
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
…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.
uint32_t3 glsl::gl_WorkGroupSize() | ||
{ | ||
return uint32_t3(DeviceSubgroupSize, DeviceSubgroupSize, 1); | ||
} |
There was a problem hiding this comment.
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
No description provided.