-
Notifications
You must be signed in to change notification settings - Fork 13
Subgroup2 Benchmark #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subgroup2 Benchmark #190
Conversation
73_ArithmeticBench/main.cpp
Outdated
options.spirvOptimizer = nullptr; | ||
//#ifndef _NBL_DEBUG | ||
// ISPIRVOptimizer::E_OPTIMIZER_PASS optPasses = ISPIRVOptimizer::EOP_STRIP_DEBUG_INFO; | ||
// auto opt = make_smart_refctd_ptr<ISPIRVOptimizer>(std::span<ISPIRVOptimizer::E_OPTIMIZER_PASS>(&optPasses, 1)); | ||
// options.spirvOptimizer = opt.get(); | ||
//#endif | ||
options.debugInfoFlags |= IShaderCompiler::E_DEBUG_INFO_FLAGS::EDIF_LINE_BIT; |
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 must use zero debug flags and a SPIR-V optimizer to get representable perf, just ask @Fletterio about his FFT examples
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.
It's in the createShader
method in main.cpp
of example 28, but to get a standard optimizer + strip debug info you just provide an optimizer with a single strip debug info flag to the compiler.
I don't remember exactly whether this invokes other optimizations or just the strip debug
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.
It should invoke the standard passes specified in the SPIRV compiler repo when you run with -O, but in that regard I think the intent of the optimizer is busted (providing a custom optimizer likely is intended to disable all other passes by default)
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.
@keptsecret you correctly optimize and strip bedug info in 23 the test, but not ex 29 the benchmark?
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.
@keptsecret bump
// barrier transition to GENERAL | ||
{ | ||
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[1]; | ||
imageBarriers[0].barrier = { | ||
.dep = { | ||
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE, | ||
.srcAccessMask = ACCESS_FLAGS::NONE, | ||
.dstStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT, | ||
.dstAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS | ||
} | ||
}; | ||
imageBarriers[0].image = dummyImg.get(); | ||
imageBarriers[0].subresourceRange = { | ||
.aspectMask = IImage::EAF_COLOR_BIT, | ||
.baseMipLevel = 0u, | ||
.levelCount = 1u, | ||
.baseArrayLayer = 0u, | ||
.layerCount = 1u | ||
}; | ||
imageBarriers[0].oldLayout = IImage::LAYOUT::UNDEFINED; | ||
imageBarriers[0].newLayout = IImage::LAYOUT::GENERAL; | ||
|
||
cmdbuf->pipelineBarrier(E_DEPENDENCY_FLAGS::EDF_NONE, { .imgBarriers = imageBarriers }); | ||
} |
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.
if you don't actually touch the image, you don't need to transition it (you may need to transition right after creation / first frame so validation layer doesn't complain about it being in UNDEFINED layout)
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.
@keptsecret do you need the pipeline barriers for Nsight to capture?
// barrier transition to PRESENT | ||
{ | ||
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[1]; | ||
imageBarriers[0].barrier = { | ||
.dep = { | ||
.srcStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT, | ||
.srcAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS, | ||
.dstStageMask = PIPELINE_STAGE_FLAGS::NONE, | ||
.dstAccessMask = ACCESS_FLAGS::NONE | ||
} | ||
}; | ||
imageBarriers[0].image = m_surface->getSwapchainResources()->getImage(m_currentImageAcquire.imageIndex); | ||
imageBarriers[0].subresourceRange = { | ||
.aspectMask = IImage::EAF_COLOR_BIT, | ||
.baseMipLevel = 0u, | ||
.levelCount = 1u, | ||
.baseArrayLayer = 0u, | ||
.layerCount = 1u | ||
}; | ||
imageBarriers[0].oldLayout = IImage::LAYOUT::TRANSFER_DST_OPTIMAL; | ||
imageBarriers[0].newLayout = IImage::LAYOUT::PRESENT_SRC; | ||
|
||
cmdbuf->pipelineBarrier(E_DEPENDENCY_FLAGS::EDF_NONE, { .imgBarriers = imageBarriers }); | ||
} |
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.
transition once to PRESENT and never touch later on
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.
let me know if nsight needs some barrier usage of the swapchain in order to capture, I don't think it does
Should close, replace with #192 |
No description provided.