Skip to content

Commit 0148f60

Browse files
committed
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-Examples-and-Tests into autoexposure_ex
2 parents 640e6a3 + e6b5218 commit 0148f60

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

62_CAD/DrawResourcesFiller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ void DrawResourcesFiller::submitCurrentObjectsAndReset(SIntendedSubmitInfo& inte
516516
// We don't reset counters for styles because we will be reusing them
517517
resetGeometryCounters();
518518

519-
uint32_t newClipProjectionAddress = acquireCurrentClipProjectionAddress(intendedNextSubmit);
519+
uint64_t newClipProjectionAddress = acquireCurrentClipProjectionAddress(intendedNextSubmit);
520520
// If the clip projection stack is non-empty, then it means we need to re-push the clipProjectionData (because it exists in geometry data and it was reset)
521521
if (newClipProjectionAddress != InvalidClipProjectionAddress)
522522
{
@@ -564,7 +564,7 @@ uint32_t DrawResourcesFiller::addLineStyle_Internal(const LineStyleInfo& lineSty
564564
return currentLineStylesCount++;
565565
}
566566

567-
inline uint64_t DrawResourcesFiller::acquireCurrentClipProjectionAddress(SIntendedSubmitInfo& intendedNextSubmit)
567+
uint64_t DrawResourcesFiller::acquireCurrentClipProjectionAddress(SIntendedSubmitInfo& intendedNextSubmit)
568568
{
569569
if (clipProjectionAddresses.empty())
570570
return InvalidClipProjectionAddress;

62_CAD/main.cpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using namespace video;
3838

3939
static constexpr bool DebugModeWireframe = false;
4040
static constexpr bool DebugRotatingViewProj = false;
41-
static constexpr bool FragmentShaderPixelInterlock = false;
41+
static constexpr bool FragmentShaderPixelInterlock = true;
4242

4343
enum class ExampleMode
4444
{
@@ -67,7 +67,7 @@ constexpr std::array<float, (uint32_t)ExampleMode::CASE_COUNT> cameraExtents =
6767
600.0, // CASE_8
6868
};
6969

70-
constexpr ExampleMode mode = ExampleMode::CASE_8;
70+
constexpr ExampleMode mode = ExampleMode::CASE_3;
7171

7272
class Camera2D
7373
{
@@ -479,7 +479,9 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
479479

480480
// Create the Semaphores
481481
m_renderSemaphore = m_device->createSemaphore(0ull);
482+
m_renderSemaphore->setObjectDebugName("m_renderSemaphore");
482483
m_overflowSubmitScratchSemaphore = m_device->createSemaphore(0ull);
484+
m_overflowSubmitScratchSemaphore->setObjectDebugName("m_overflowSubmitScratchSemaphore");
483485
if (!m_renderSemaphore || !m_overflowSubmitScratchSemaphore)
484486
return logFail("Failed to Create Semaphores!");
485487

@@ -508,7 +510,7 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
508510

509511
m_framesInFlight = min(m_surface->getMaxFramesInFlight(), MaxFramesInFlight);
510512

511-
allocateResources(40960u);
513+
allocateResources(256u);
512514

513515
const bitflag<IGPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS> bindlessTextureFlags =
514516
IGPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS::ECF_UPDATE_AFTER_BIND_BIT |
@@ -697,8 +699,6 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
697699
constexpr auto debugfragmentShaderPath = "../fragment_shader_debug.hlsl";
698700
constexpr auto resolveAlphasShaderPath = "../resolve_alphas.hlsl";
699701
#if defined(SHADER_CACHE_TEST_COMPILATION_CACHE_STORE)
700-
701-
702702
auto cache = core::make_smart_refctd_ptr<IShaderCompiler::CCache>();
703703

704704
// Load Custom Shader
@@ -742,7 +742,6 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
742742
const bool success = bool(succ);
743743
assert(success);
744744
#elif defined(SHADER_CACHE_TEST_CACHE_RETRIEVE)
745-
746745
auto savePath = localOutputCWD / "cache.bin";
747746

748747
core::smart_refctd_ptr<system::IFile> f;
@@ -1314,7 +1313,10 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
13141313

13151314
if (inBetweenSubmit)
13161315
{
1317-
intendedSubmitInfo.overflowSubmit();
1316+
if (intendedSubmitInfo.overflowSubmit() != IQueue::RESULT::SUCCESS)
1317+
{
1318+
m_logger->log("overflow submit failed.", ILogger::ELL_ERROR);
1319+
}
13181320
}
13191321
else
13201322
{
@@ -1335,6 +1337,10 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
13351337
presentWait.stageMask = PIPELINE_STAGE_FLAGS::NONE; // top of pipe, there's no explicit presentation engine stage
13361338
m_surface->present(m_currentImageAcquire.imageIndex,{&presentWait,1});
13371339
}
1340+
else
1341+
{
1342+
m_logger->log("regular submit failed.", ILogger::ELL_ERROR);
1343+
}
13381344
}
13391345
}
13401346

@@ -1370,6 +1376,14 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
13701376
return retval;
13711377
}
13721378

1379+
virtual video::IAPIConnection::SFeatures getAPIFeaturesToEnable() override
1380+
{
1381+
auto retval = base_t::getAPIFeaturesToEnable();
1382+
// We only support one swapchain mode, surface, the other one is Display which we have not implemented yet.
1383+
retval.swapchainMode = video::E_SWAPCHAIN_MODE::ESM_SURFACE;
1384+
retval.validations = true;
1385+
return retval;
1386+
}
13731387
protected:
13741388

13751389
void addObjects(SIntendedSubmitInfo& intendedNextSubmit)

0 commit comments

Comments
 (0)