Skip to content

Commit e91662b

Browse files
committed
[EX_55] New API Changes Applied
1 parent abc0374 commit e91662b

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

examples_tests/55.RGB18E7S3/main.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,21 @@ int main()
4444
{
4545
constexpr std::string_view APP_NAME = "RGB18E7S3 utility test";
4646

47-
auto initOutput = CommonAPI::Init(video::EAT_OPENGL, APP_NAME.data());
47+
CommonAPI::InitOutput initOutput;
48+
CommonAPI::InitWithNoExt(initOutput, video::EAT_OPENGL, APP_NAME.data());
4849
auto system = std::move(initOutput.system);
4950
auto gl = std::move(initOutput.apiConnection);
5051
auto logger = std::move(initOutput.logger);
5152
auto gpuPhysicalDevice = std::move(initOutput.physicalDevice);
5253
auto logicalDevice = std::move(initOutput.logicalDevice);
5354
auto queues = std::move(initOutput.queues);
5455
auto renderpass = std::move(initOutput.renderpass);
55-
auto commandPool = std::move(initOutput.commandPool);
56+
auto commandPools = std::move(initOutput.commandPools);
5657
auto assetManager = std::move(initOutput.assetManager);
5758
auto cpu2gpuParams = std::move(initOutput.cpu2gpuParams);
5859
auto utilities = std::move(initOutput.utilities);
5960

60-
core::smart_refctd_ptr<video::IGPUFence> gpuTransferFence = nullptr;
61-
core::smart_refctd_ptr<video::IGPUFence> gpuComputeFence = nullptr;
62-
6361
nbl::video::IGPUObjectFromAssetConverter cpu2gpu;
64-
{
65-
cpu2gpuParams.perQueue[nbl::video::IGPUObjectFromAssetConverter::EQU_TRANSFER].fence = &gpuTransferFence;
66-
cpu2gpuParams.perQueue[nbl::video::IGPUObjectFromAssetConverter::EQU_COMPUTE].fence = &gpuComputeFence;
67-
}
6862

6963
auto createDescriptorPool = [&](const uint32_t count, asset::E_DESCRIPTOR_TYPE type)
7064
{
@@ -144,11 +138,11 @@ int main()
144138

145139
video::IGPUDescriptorSetLayout::SBinding gpuBindingsLayout[ES_COUNT] =
146140
{
147-
{ES_RGB, asset::EDT_STORAGE_BUFFER, 1u, video::IGPUSpecializedShader::ESS_COMPUTE, nullptr},
148-
{ES_RGB_CPP_DECODED, asset::EDT_STORAGE_BUFFER, 1u, video::IGPUSpecializedShader::ESS_COMPUTE, nullptr},
149-
{ES_RGB_GLSL_DECODED, asset::EDT_STORAGE_BUFFER, 1u, video::IGPUSpecializedShader::ESS_COMPUTE, nullptr},
150-
{ES_RGB_CPP_ENCODED, asset::EDT_STORAGE_BUFFER, 1u, video::IGPUSpecializedShader::ESS_COMPUTE, nullptr},
151-
{ES_RGB_GLSL_ENCODED, asset::EDT_STORAGE_BUFFER, 1u, video::IGPUSpecializedShader::ESS_COMPUTE, nullptr}
141+
{ES_RGB, asset::EDT_STORAGE_BUFFER, 1u, asset::IShader::ESS_COMPUTE, nullptr},
142+
{ES_RGB_CPP_DECODED, asset::EDT_STORAGE_BUFFER, 1u, asset::IShader::ESS_COMPUTE, nullptr},
143+
{ES_RGB_GLSL_DECODED, asset::EDT_STORAGE_BUFFER, 1u, asset::IShader::ESS_COMPUTE, nullptr},
144+
{ES_RGB_CPP_ENCODED, asset::EDT_STORAGE_BUFFER, 1u, asset::IShader::ESS_COMPUTE, nullptr},
145+
{ES_RGB_GLSL_ENCODED, asset::EDT_STORAGE_BUFFER, 1u, asset::IShader::ESS_COMPUTE, nullptr}
152146
};
153147

154148
auto gpuCDescriptorPool = createDescriptorPool(ES_COUNT, asset::EDT_STORAGE_BUFFER);
@@ -189,7 +183,7 @@ int main()
189183
auto gpuComputePipeline = logicalDevice->createGPUComputePipeline(nullptr, std::move(gpuCPipelineLayout), std::move(gpuComputeShader));
190184

191185
core::smart_refctd_ptr<video::IGPUCommandBuffer> commandBuffers[FRAMES_IN_FLIGHT];
192-
logicalDevice->createCommandBuffers(commandPool.get(), video::IGPUCommandBuffer::EL_PRIMARY, FRAMES_IN_FLIGHT, commandBuffers);
186+
logicalDevice->createCommandBuffers(commandPools[CommonAPI::InitOutput::EQT_COMPUTE].get(), video::IGPUCommandBuffer::EL_PRIMARY, FRAMES_IN_FLIGHT, commandBuffers);
193187
auto gpuFence = logicalDevice->createFence(static_cast<video::IGPUFence::E_CREATE_FLAGS>(0));
194188

195189
for(size_t i = 0; i < FRAMES_IN_FLIGHT; ++i)
@@ -199,7 +193,7 @@ int main()
199193
commandBuffer->begin(0);
200194

201195
commandBuffer->bindComputePipeline(gpuComputePipeline.get());
202-
commandBuffer->bindDescriptorSets(asset::EPBP_COMPUTE, gpuComputePipeline->getLayout(), 0, 1, &gpuCDescriptorSet.get(), nullptr);
196+
commandBuffer->bindDescriptorSets(asset::EPBP_COMPUTE, gpuComputePipeline->getLayout(), 0, 1, &gpuCDescriptorSet.get());
203197

204198
static_assert(MAX_TEST_RGB_VALUES % WORK_GROUP_SIZE == 0, "Inccorect amount!");
205199
_NBL_STATIC_INLINE_CONSTEXPR size_t groupCountX = MAX_TEST_RGB_VALUES / WORK_GROUP_SIZE;

0 commit comments

Comments
 (0)