Skip to content

Commit 0f4ef4e

Browse files
committed
Merge branch 'erfan_fixes' into erfan_merge
2 parents 7d3719c + 30e6aae commit 0f4ef4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+941
-846
lines changed

examples_tests/06.MeshLoaders/main.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,20 @@ class MeshLoadersApp : public ApplicationBase
313313
}
314314
void onAppTerminated_impl() override
315315
{
316+
const auto& fboCreationParams = fbo[acquiredNextFBO]->getCreationParameters();
317+
auto gpuSourceImageView = fboCreationParams.attachments[0];
318+
319+
bool status = ext::ScreenShot::createScreenShot(
320+
logicalDevice.get(),
321+
queues[CommonAPI::InitOutput::EQT_TRANSFER_DOWN],
322+
renderFinished[resourceIx].get(),
323+
gpuSourceImageView.get(),
324+
assetManager.get(),
325+
"ScreenShot.png",
326+
asset::EIL_PRESENT_SRC,
327+
static_cast<asset::E_ACCESS_FLAGS>(0u));
328+
329+
assert(status);
316330
logicalDevice->waitIdle();
317331
}
318332
void workLoopBody() override

examples_tests/07.SubpassBaking/main.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class SubpassBaking : public ApplicationBase
122122
const auto swapchainImageUsage = static_cast<asset::IImage::E_USAGE_FLAGS>(asset::IImage::EUF_COLOR_ATTACHMENT_BIT);
123123
const video::ISurface::SFormat surfaceFormat(asset::EF_B8G8R8A8_SRGB, asset::ECP_COUNT, asset::EOTF_UNKNOWN);
124124

125-
CommonAPI::InitWithDefaultExt(initOutput, video::EAT_VULKAN, "SubpassBaking", WIN_W, WIN_H, SC_IMG_COUNT, swapchainImageUsage, surfaceFormat, nbl::asset::EF_D32_SFLOAT);
125+
CommonAPI::InitWithDefaultExt(initOutput, video::EAT_OPENGL, "SubpassBaking", WIN_W, WIN_H, SC_IMG_COUNT, swapchainImageUsage, surfaceFormat, nbl::asset::EF_D32_SFLOAT);
126126
window = std::move(initOutput.window);
127127
apiConnection = std::move(initOutput.apiConnection);
128128
surface = std::move(initOutput.surface);
@@ -145,27 +145,24 @@ class SubpassBaking : public ApplicationBase
145145
const asset::COBJMetadata* metaOBJ = nullptr;
146146
{
147147
auto* quantNormalCache = assetManager->getMeshManipulator()->getQuantNormalCache();
148-
quantNormalCache->loadCacheFromFile<asset::EF_A2B10G10R10_SNORM_PACK32>(system.get(), "../../tmp/normalCache101010.sse");
148+
quantNormalCache->loadCacheFromFile<asset::EF_A2B10G10R10_SNORM_PACK32>(system.get(), sharedOutputCWD / "normalCache101010.sse");
149149

150150
system::path archPath = sharedInputCWD / "sponza.zip";
151151
auto arch = system->openFileArchive(archPath);
152-
system->mount(std::move(arch), "resources");
152+
// test no alias loading (TODO: fix loading from absolute paths)
153+
system->mount(std::move(arch));
153154
asset::IAssetLoader::SAssetLoadParams loadParams;
154-
#if 0 // @sadiuk unfuck this please
155-
loadParams.workingDirectory = "resources";
156-
#else
157-
loadParams.workingDirectory = archPath;
158-
#endif
155+
loadParams.workingDirectory = sharedInputCWD;
159156
loadParams.logger = logger.get();
160-
auto meshes_bundle = assetManager->getAsset("sponza.obj", loadParams);
157+
auto meshes_bundle = assetManager->getAsset((sharedInputCWD / "sponza.zip/sponza.obj").string(), loadParams);
161158
assert(!meshes_bundle.getContents().empty());
162159

163160
metaOBJ = meshes_bundle.getMetadata()->selfCast<const asset::COBJMetadata>();
164161

165162
auto cpuMesh = meshes_bundle.getContents().begin()[0];
166163
meshRaw = static_cast<asset::ICPUMesh*>(cpuMesh.get());
167164

168-
quantNormalCache->saveCacheToFile<asset::EF_A2B10G10R10_SNORM_PACK32>(system.get(), "../../tmp/normalCache101010.sse");
165+
quantNormalCache->saveCacheToFile<asset::EF_A2B10G10R10_SNORM_PACK32>(system.get(), sharedOutputCWD / "normalCache101010.sse");
169166
}
170167

171168
core::smart_refctd_ptr<video::IGPUDescriptorSet> perCameraDescSet;

examples_tests/09.ColorSpaceTest/main.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ColorSpaceTestSampleApp : public ApplicationBase
7171
void onAppInitialized_impl() override
7272
{
7373
const auto swapchainImageUsage = static_cast<asset::IImage::E_USAGE_FLAGS>(asset::IImage::EUF_COLOR_ATTACHMENT_BIT);
74-
const video::ISurface::SFormat surfaceFormat(asset::EF_B8G8R8A8_SRGB, asset::ECP_COUNT, asset::EOTF_UNKNOWN);
74+
const video::ISurface::SFormat surfaceFormat(asset::EF_B8G8R8A8_SRGB, asset::ECP_SRGB, asset::EOTF_sRGB);
7575

7676
CommonAPI::InitOutput initOutput;
7777
initOutput.window = core::smart_refctd_ptr(window);
@@ -114,7 +114,10 @@ class ColorSpaceTestSampleApp : public ApplicationBase
114114
}
115115
};
116116

117-
video::IGPUDescriptorSetLayout::SBinding binding{ 0u, nbl::asset::EDT_COMBINED_IMAGE_SAMPLER, 1u, nbl::video::IGPUShader::ESS_FRAGMENT, nullptr };
117+
nbl::asset::ISampler::SParams samplerParams = { nbl::asset::ISampler::ETC_CLAMP_TO_EDGE, nbl::asset::ISampler::ETC_CLAMP_TO_EDGE, nbl::asset::ISampler::ETC_CLAMP_TO_EDGE, nbl::asset::ISampler::ETBC_FLOAT_OPAQUE_BLACK, nbl::asset::ISampler::ETF_LINEAR, nbl::asset::ISampler::ETF_LINEAR, nbl::asset::ISampler::ESMM_LINEAR, 0u, false, nbl::asset::ECO_ALWAYS };
118+
auto immutableSampler = logicalDevice->createGPUSampler(samplerParams);
119+
120+
video::IGPUDescriptorSetLayout::SBinding binding{ 0u, nbl::asset::EDT_COMBINED_IMAGE_SAMPLER, 1u, nbl::video::IGPUShader::ESS_FRAGMENT, &immutableSampler };
118121
auto gpuDescriptorSetLayout3 = logicalDevice->createGPUDescriptorSetLayout(&binding, &binding + 1u);
119122
auto gpuDescriptorPool = createDescriptorPool(1u); // per single texture
120123
auto fstProtoPipeline = nbl::ext::FullScreenTriangle::createProtoPipeline(cpu2gpuParams);
@@ -299,8 +302,7 @@ class ColorSpaceTestSampleApp : public ApplicationBase
299302
nbl::video::IGPUDescriptorSet::SDescriptorInfo info;
300303
{
301304
info.desc = gpuImageView;
302-
nbl::asset::ISampler::SParams samplerParams = { nbl::asset::ISampler::ETC_CLAMP_TO_EDGE, nbl::asset::ISampler::ETC_CLAMP_TO_EDGE, nbl::asset::ISampler::ETC_CLAMP_TO_EDGE, nbl::asset::ISampler::ETBC_FLOAT_OPAQUE_BLACK, nbl::asset::ISampler::ETF_LINEAR, nbl::asset::ISampler::ETF_LINEAR, nbl::asset::ISampler::ESMM_LINEAR, 0u, false, nbl::asset::ECO_ALWAYS };
303-
info.image.sampler = logicalDevice->createGPUSampler(samplerParams);
305+
info.image.sampler = nullptr;
304306
info.image.imageLayout = nbl::asset::EIL_SHADER_READ_ONLY_OPTIMAL;
305307
}
306308

examples_tests/35.GeometryCreator/main.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,14 @@ class GeometryCreatorSampleApp : public ApplicationBase
389389
auto buf = geometryObject.bindings[i].buffer.get();
390390
if (buf)
391391
{
392-
const auto newUsageFlags = buf->getUsageFlags() | asset::IBuffer::EUF_VERTEX_BUFFER_BIT;
393-
buf->setUsageFlags(newUsageFlags);
392+
buf->addUsageFlags(asset::IBuffer::EUF_VERTEX_BUFFER_BIT);
394393
cpubuffers.push_back(buf);
395394
}
396395
}
397396
auto cpuindexbuffer = geometryObject.indexBuffer.buffer.get();
398397
if (cpuindexbuffer)
399398
{
400-
const auto newUsageFlags = cpuindexbuffer->getUsageFlags() | asset::IBuffer::EUF_INDEX_BUFFER_BIT;
401-
cpuindexbuffer->setUsageFlags(newUsageFlags);
399+
cpuindexbuffer->addUsageFlags(asset::IBuffer::EUF_INDEX_BUFFER_BIT);
402400
cpubuffers.push_back(cpuindexbuffer);
403401
}
404402

examples_tests/42.FragmentShaderPathTracer/common.glsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ void missProgram(in ImmutableRay_t _immutable, inout Payload_t _payload)
392392
const vec3 kConstantEnvLightRadiance = vec3(0.15, 0.21, 0.3);
393393
finalContribution *= kConstantEnvLightRadiance;
394394
_payload.accumulation += finalContribution;
395+
#endif
395396
}
396397

397398
#include <nbl/builtin/glsl/bxdf/brdf/diffuse/oren_nayar.glsl>

examples_tests/43.SumAndCDFFilters/main.cpp

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ class SumAndCDFFilterSampleApp : public NonGraphicalApplicationBase
207207
state.inMipLevel = MIPMAP_IMAGE;
208208
state.outMipLevel = MIPMAP_IMAGE;
209209
#endif // IMAGE_VIEW
210+
state.axesToSum = (1 << 2) | (1 << 1) | (1 << 0); // ZYX
210211

211212
if (!sumFilter.execute(core::execution::par_unseq,&state))
212213
logger->log("Something went wrong while performing sum operation!", nbl::system::ILogger::ELL_WARNING);
@@ -215,17 +216,19 @@ class SumAndCDFFilterSampleApp : public NonGraphicalApplicationBase
215216
}
216217
return newSumImage;
217218
};
218-
219-
IAssetLoader::SAssetLoadParams lp(0ull, nullptr, IAssetLoader::ECF_DONT_CACHE_REFERENCES);
220-
219+
220+
asset::IAssetLoader::SAssetLoadParams loadParams;
221+
loadParams.logger = logger.get();
222+
221223
#ifdef IMAGE_VIEW
222-
auto bundle = assetManager->getAsset("../../media/GLI/earth-cubemap3.dds", lp);
223-
auto cpuImageViewFetched = core::smart_refctd_ptr_static_cast<asset::ICPUImageView>(bundle.getContents().begin()[0]);
224-
224+
auto imgPath = sharedInputCWD / "GLI/earth-cubemap3.dds";
225+
auto bundle = assetManager->getAsset(imgPath.string(), loadParams);
226+
auto cpuImageViewFetched = core::smart_refctd_ptr_static_cast<asset::ICPUImageView>(bundle.getContents()[0]);
225227
auto cpuImage = getSummedImage(cpuImageViewFetched->getCreationParameters().image);
226228
#else
227-
auto bundle = assetManager->getAsset("../../media/colorexr.exr", lp);
228-
auto cpuImage = getSummedImage(core::smart_refctd_ptr_static_cast<asset::ICPUImage>(bundle.getContents().begin()[0]));
229+
auto imgPath = sharedInputCWD / "colorexr.exr";
230+
auto bundle = assetManager->getAsset(imgPath.string(), loadParams);
231+
auto cpuImage = getSummedImage(core::smart_refctd_ptr_static_cast<asset::ICPUImage>(bundle.getContents()[0]));
229232
#endif // IMAGE_VIEW
230233

231234
ICPUImageView::SCreationParams viewParams;
@@ -262,16 +265,20 @@ class SumAndCDFFilterSampleApp : public NonGraphicalApplicationBase
262265
();
263266

264267
asset::IAssetWriter::SAssetWriteParams wparams(cpuImageView.get());
268+
wparams.logger = logger.get();
269+
265270
#ifdef IMAGE_VIEW
266-
assetManager->writeAsset(outputFileName = std::string(MODE.data()) + "IMG_VIEW.dds", wparams);
271+
outputFileName = std::string(MODE.data()) + "IMG_VIEW.dds";
267272
#else
268273
#ifdef OVERLAPPING_REGIONS
269-
assetManager->writeAsset(outputFileName = std::string(MODE.data()) + "IMG_OVERLAPPING_REGIONS.exr", wparams);
274+
outputFileName = std::string(MODE.data()) + "IMG_OVERLAPPING_REGIONS.exr";
270275
#else
271-
assetManager->writeAsset(outputFileName = std::string(MODE.data()) + "IMG.exr", wparams);
276+
outputFileName = std::string(MODE.data()) + "IMG.exr";
272277
#endif // OVERLAPPING_REGIONS
273278
#endif // IMAGE_VIEW
274-
279+
280+
auto outputFilePath = localOutputCWD / outputFileName;
281+
assetManager->writeAsset(outputFilePath.string(), wparams);
275282
return outputFileName;
276283
};
277284

@@ -320,8 +327,9 @@ class SumAndCDFFilterSampleApp : public NonGraphicalApplicationBase
320327
{
321328
const std::string satFileName = writeSATandGetItsOutputName();
322329
const std::string convolutedSatFileName = "CONVOLUTED_" + satFileName;
330+
const auto convolutedSatFilePath = localOutputCWD / convolutedSatFileName;
323331

324-
auto bundle = assetManager->getAsset(satFileName, lp);
332+
auto bundle = assetManager->getAsset(satFileName, loadParams);
325333
#ifdef IMAGE_VIEW
326334
auto cpuImageViewFetched = core::smart_refctd_ptr_static_cast<asset::ICPUImageView>(bundle.getContents().begin()[0]);
327335
auto cpuImage = getDisConvolutedImage(cpuImageViewFetched->getCreationParameters().image);
@@ -337,7 +345,7 @@ class SumAndCDFFilterSampleApp : public NonGraphicalApplicationBase
337345
assert(cpuImageView.get(), "The imageView didn't pass creation validation!");
338346

339347
asset::IAssetWriter::SAssetWriteParams wparams(cpuImageView.get());
340-
assetManager->writeAsset(convolutedSatFileName, wparams);
348+
assetManager->writeAsset(convolutedSatFilePath.string(), wparams);
341349
}
342350
}
343351

include/nbl/asset/ICommandBuffer.h

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,23 @@ class ICommandBuffer
118118
ERF_RELEASE_RESOURCES_BIT = 0x01
119119
};
120120

121+
/*
122+
CommandBuffer Lifecycle Tracking in Nabla:
123+
* We say a command buffer is "resettable" If it was allocated from a command pool which was created with `ECF_RESET_COMMAND_BUFFER_BIT` flag.
124+
- ES_INITIAL
125+
-> When a command buffer is allocated, it is in the ES_INITIAL state.
126+
-> If a command buffer is "resettable", Calling `reset()` on a command buffer will change it's state to ES_INITIAL If it's not PENDING
127+
- ES_RECORDING
128+
-> Calling `begin()` on a command buffer will change it's state to `ES_RECORDING` If It's not already RECORDING, and should be INITIAL for non-resettable command buffers.
129+
- ES_EXECUTABLE
130+
-> Calling `end()` on a command buffer will change it's state to `ES_EXECUTABLE` If it's RECORDING
131+
-> After submission for non-resettable command buffers.
132+
- ES_PENDING
133+
* ES_PENDING Is impossible to track correctly without a fence. So `ES_PENDING` actually means the engine is in the process of SUBMITTING and It will be changed to either `ES_EXECUTABLE` or `ES_INVALID` after SUBMISSION.
134+
* So the convention here is different than Vulkan's command buffer lifecycle and therefore contains false negatives (It is not PENDING but actually is PENDING and working on GPU)
135+
- ES_INVALID
136+
-> After submission for resettable command buffers.
137+
*/
121138
enum E_STATE : uint32_t
122139
{
123140
ES_INITIAL,
@@ -193,27 +210,34 @@ class ICommandBuffer
193210
// hm now i think having begin(), reset() and end() as command buffer API is a little weird
194211

195212
//! `_flags` takes bits from E_USAGE
196-
virtual void begin(uint32_t _flags)
213+
virtual bool begin(uint32_t _flags)
197214
{
198-
assert(m_state != ES_PENDING);
215+
if(m_state == ES_RECORDING)
216+
{
217+
assert(false);
218+
return false;
219+
}
199220
m_state = ES_RECORDING;
200221
m_recordingFlags = _flags;
222+
return true;
201223
}
202-
224+
203225
//! `_flags` takes bits from E_RESET_FLAGS
204226
virtual bool reset(uint32_t _flags)
205227
{
206-
if (m_state==ES_PENDING);
207-
return false;
208228
m_state = ES_INITIAL;
209-
210229
return true;
211230
}
212231

213-
virtual void end()
232+
virtual bool end()
214233
{
215-
assert(m_state!=ES_PENDING);
234+
if(m_state!=ES_RECORDING)
235+
{
236+
assert(false);
237+
return false;
238+
}
216239
m_state = ES_EXECUTABLE;
240+
return true;
217241
}
218242

219243
virtual bool bindIndexBuffer(const buffer_t* buffer, size_t offset, E_INDEX_TYPE indexType) = 0;
@@ -285,13 +309,11 @@ class ICommandBuffer
285309
virtual bool bindComputePipeline(const compute_pipeline_t* pipeline) = 0;
286310

287311
virtual bool resetQueryPool(video::IQueryPool* queryPool, uint32_t firstQuery, uint32_t queryCount) {return false;}
288-
virtual bool beginQuery(video::IQueryPool* queryPool, uint32_t query, video::IQueryPool::E_QUERY_CONTROL_FLAGS flags = static_cast<video::IQueryPool::E_QUERY_CONTROL_FLAGS>(0)) {return false;}
312+
virtual bool beginQuery(video::IQueryPool* queryPool, uint32_t query, core::bitflag<video::IQueryPool::E_QUERY_CONTROL_FLAGS> flags = video::IQueryPool::E_QUERY_CONTROL_FLAGS::EQCF_NONE) {return false;}
289313
virtual bool endQuery(video::IQueryPool* queryPool, uint32_t query) {return false;}
290-
virtual bool copyQueryPoolResults(video::IQueryPool* queryPool, uint32_t firstQuery, uint32_t queryCount, buffer_t* dstBuffer, size_t dstOffset, size_t stride, video::IQueryPool::E_QUERY_RESULTS_FLAGS flags) {return false;}
314+
virtual bool copyQueryPoolResults(video::IQueryPool* queryPool, uint32_t firstQuery, uint32_t queryCount, buffer_t* dstBuffer, size_t dstOffset, size_t stride, core::bitflag<video::IQueryPool::E_QUERY_RESULTS_FLAGS> flags) {return false;}
291315
virtual bool writeTimestamp(asset::E_PIPELINE_STAGE_FLAGS pipelineStage, video::IQueryPool* queryPool, uint32_t query) {return false;}
292-
// TRANSFORM_FEEDBACK_STREAM
293-
virtual bool beginQueryIndexed(video::IQueryPool* queryPool, uint32_t query, uint32_t index, video::IQueryPool::E_QUERY_CONTROL_FLAGS flags = static_cast<video::IQueryPool::E_QUERY_CONTROL_FLAGS>(0)) {return false;}
294-
virtual bool endQueryIndexed(video::IQueryPool* queryPool, uint32_t query, uint32_t index) {return false;}
316+
295317
// Acceleration Structure Properties (Only available on Vulkan)
296318
virtual bool writeAccelerationStructureProperties(const core::SRange<video::IGPUAccelerationStructure>& pAccelerationStructures, video::IQueryPool::E_QUERY_TYPE queryType, video::IQueryPool* queryPool, uint32_t firstQuery) {return false;}
297319

include/nbl/asset/filters/CSummedAreaTableImageFilter.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CSummedAreaTableImageFilterBase
3030
uint8_t* scratchMemory = nullptr; //!< memory covering all regions used for temporary filling within computation of sum values
3131
size_t scratchMemoryByteSize = {}; //!< required byte size for entire scratch memory
3232
bool normalizeImageByTotalSATValues = false; //!< after sum performation division will be performed for the entire image by the max sum values in (maxX, 0, z) depending on input image - needed for UNORM and SNORM
33-
uint8_t axesToSum = 0u; //!< which axes you want to sum; X: bit0, Y: bit1, Z: bit2
33+
uint8_t axesToSum = 0u; //!< which axes you want to sum; X: bit0, Y: bit1, Z: bit2 // TODO: make ALL_AXES the default and make sure examples using it work as expected.
3434

3535
static inline size_t getRequiredScratchByteSize(const ICPUImage* inputImage, asset::VkExtent3D extent)
3636
{
@@ -96,13 +96,16 @@ class CSummedAreaTableImageFilter : public CMatchedSizeInOutImageFilterCommon, p
9696

9797
if (state->scratchMemoryByteSize < state_type::getRequiredScratchByteSize(state->inImage, state->extent))
9898
return false;
99+
100+
if (state->axesToSum == 0u)
101+
return false;
99102

100103
if (asset::getFormatChannelCount(outFormat) != asset::getFormatChannelCount(inFormat))
101104
return false;
102105

103106
if (asset::getFormatClass(inFormat) > asset::getFormatClass(outFormat)) // TODO in future! Change to a function checking a bit-depth for an each single channel
104107
return false;
105-
108+
106109
return true;
107110
}
108111

include/nbl/core/execution.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ namespace nbl::core
2929
#if !defined (__clang__)
3030
namespace execution = std::execution;
3131

32-
3332
ALIAS_TEMPLATE_FUNCTION(for_each_n, std::for_each_n)
3433
ALIAS_TEMPLATE_FUNCTION(for_each, std::for_each)
3534
ALIAS_TEMPLATE_FUNCTION(swap_ranges, std::swap_ranges)
@@ -60,5 +59,7 @@ ALIAS_TEMPLATE_FUNCTION(nth_element, oneapi::dpl::nth_element)
6059
#endif
6160
}
6261

62+
#undef ALIAS_TEMPLATE_FUNCTION
63+
6364
#endif
6465

include/nbl/video/IGPUCommandBuffer.h

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,47 @@ class IGPUCommandBuffer :
5454
>;
5555

5656
public:
57+
58+
inline bool isResettable() const
59+
{
60+
return m_cmdpool->getCreationFlags().hasValue(IGPUCommandPool::ECF_RESET_COMMAND_BUFFER_BIT);
61+
}
62+
63+
inline bool canReset() const
64+
{
65+
if(isResettable())
66+
return m_state != ES_PENDING;
67+
return false;
68+
}
69+
5770
virtual bool begin(uint32_t _flags, const SInheritanceInfo* inheritanceInfo = nullptr)
5871
{
59-
base_t::begin(_flags);
60-
if ((m_cmdpool->getCreationFlags()&IGPUCommandPool::ECF_RESET_COMMAND_BUFFER_BIT)==0u)
72+
if (!isResettable())
6173
{
62-
assert(m_state != ES_INITIAL);
74+
if(m_state != ES_INITIAL)
75+
{
76+
assert(false);
77+
return false;
78+
}
6379
}
64-
return true;
80+
81+
if(m_state == ES_PENDING)
82+
{
83+
assert(false);
84+
return false;
85+
}
86+
87+
return base_t::begin(_flags);
88+
}
89+
90+
virtual bool reset(uint32_t _flags)
91+
{
92+
if (!canReset())
93+
{
94+
assert(false);
95+
return false;
96+
}
97+
return base_t::reset(_flags);
6598
}
6699

67100
uint32_t getQueueFamilyIndex() const { return m_cmdpool->getQueueFamilyIndex(); }
@@ -135,7 +168,9 @@ class IGPUCommandBuffer :
135168
}
136169

137170
protected:
138-
IGPUCommandBuffer(core::smart_refctd_ptr<const ILogicalDevice>&& dev, E_LEVEL lvl, IGPUCommandPool* _cmdpool) : base_t(lvl), IBackendObject(std::move(dev)), m_cmdpool(_cmdpool)
171+
friend class IGPUQueue;
172+
173+
IGPUCommandBuffer(core::smart_refctd_ptr<const ILogicalDevice>&& dev, E_LEVEL lvl, core::smart_refctd_ptr<IGPUCommandPool>&& _cmdpool) : base_t(lvl), IBackendObject(std::move(dev)), m_cmdpool(_cmdpool)
139174
{
140175
}
141176
virtual ~IGPUCommandBuffer() = default;

0 commit comments

Comments
 (0)