Skip to content

Commit 01c2b69

Browse files
author
kevyuu
committed
Fix example 67 indentation to use tabs
1 parent 0bc0557 commit 01c2b69

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

67_RayQueryGeometry/main.cpp

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
279279
{
280280
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[1];
281281
imageBarriers[0].barrier = {
282-
.dep = {
283-
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE,
284-
.srcAccessMask = ACCESS_FLAGS::NONE,
285-
.dstStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT,
286-
.dstAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS
282+
.dep = {
283+
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE,
284+
.srcAccessMask = ACCESS_FLAGS::NONE,
285+
.dstStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT,
286+
.dstAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS
287287
}
288288
};
289289
imageBarriers[0].image = outHDRImage.get();
@@ -319,11 +319,11 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
319319
{
320320
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[2];
321321
imageBarriers[0].barrier = {
322-
.dep = {
323-
.srcStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT,
324-
.srcAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS,
325-
.dstStageMask = PIPELINE_STAGE_FLAGS::BLIT_BIT,
326-
.dstAccessMask = ACCESS_FLAGS::TRANSFER_WRITE_BIT
322+
.dep = {
323+
.srcStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT,
324+
.srcAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS,
325+
.dstStageMask = PIPELINE_STAGE_FLAGS::BLIT_BIT,
326+
.dstAccessMask = ACCESS_FLAGS::TRANSFER_WRITE_BIT
327327
}
328328
};
329329
imageBarriers[0].image = outHDRImage.get();
@@ -338,11 +338,11 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
338338
imageBarriers[0].newLayout = IImage::LAYOUT::TRANSFER_SRC_OPTIMAL;
339339

340340
imageBarriers[1].barrier = {
341-
.dep = {
342-
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE,
343-
.srcAccessMask = ACCESS_FLAGS::NONE,
344-
.dstStageMask = PIPELINE_STAGE_FLAGS::BLIT_BIT,
345-
.dstAccessMask = ACCESS_FLAGS::TRANSFER_WRITE_BIT
341+
.dep = {
342+
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE,
343+
.srcAccessMask = ACCESS_FLAGS::NONE,
344+
.dstStageMask = PIPELINE_STAGE_FLAGS::BLIT_BIT,
345+
.dstAccessMask = ACCESS_FLAGS::TRANSFER_WRITE_BIT
346346
}
347347
};
348348
imageBarriers[1].image = m_surface->getSwapchainResources()->getImage(m_currentImageAcquire.imageIndex);
@@ -384,11 +384,11 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
384384
{
385385
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[1];
386386
imageBarriers[0].barrier = {
387-
.dep = {
388-
.srcStageMask = PIPELINE_STAGE_FLAGS::BLIT_BIT,
389-
.srcAccessMask = ACCESS_FLAGS::TRANSFER_WRITE_BIT,
390-
.dstStageMask = PIPELINE_STAGE_FLAGS::NONE,
391-
.dstAccessMask = ACCESS_FLAGS::NONE
387+
.dep = {
388+
.srcStageMask = PIPELINE_STAGE_FLAGS::BLIT_BIT,
389+
.srcAccessMask = ACCESS_FLAGS::TRANSFER_WRITE_BIT,
390+
.dstStageMask = PIPELINE_STAGE_FLAGS::NONE,
391+
.dstAccessMask = ACCESS_FLAGS::NONE
392392
}
393393
};
394394
imageBarriers[0].image = m_surface->getSwapchainResources()->getImage(m_currentImageAcquire.imageIndex);
@@ -488,8 +488,8 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
488488
{
489489
using namespace nbl::scene;
490490

491-
// triangles geometries
492-
auto gc = make_smart_refctd_ptr<CGeometryCreator>();
491+
// triangles geometries
492+
auto gc = make_smart_refctd_ptr<CGeometryCreator>();
493493

494494
std::array<ReferenceObjectCpu, OT_COUNT> cpuObjects;
495495
cpuObjects[OT_CUBE] = ReferenceObjectCpu{ .meta = {.type = OT_CUBE, .name = "Cube Mesh" }, .shadersType = GP_BASIC, .data = gc->createCube({1.f, 1.f, 1.f}) };
@@ -518,7 +518,7 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
518518
tri = cpuObjects[i].data->exportForBLAS();
519519

520520
auto& blas = cpuBlas[i];
521-
blas = make_smart_refctd_ptr<ICPUBottomLevelAccelerationStructure>();
521+
blas = make_smart_refctd_ptr<ICPUBottomLevelAccelerationStructure>();
522522
blas->setGeometries(std::move(triangles), std::move(primitiveCounts));
523523

524524
auto blasFlags = bitflag(IGPUBottomLevelAccelerationStructure::BUILD_FLAGS::PREFER_FAST_TRACE_BIT) | IGPUBottomLevelAccelerationStructure::BUILD_FLAGS::ALLOW_COMPACTION_BIT;
@@ -613,25 +613,25 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
613613
CAssetConverter::patch_t<ICPUTopLevelAccelerationStructure> tlasPatch = {};
614614
tlasPatch.compactAfterBuild = true;
615615
std::array<CAssetConverter::patch_t<ICPUBottomLevelAccelerationStructure>,OT_COUNT> tmpBLASPatches = {};
616-
std::array<ICPUPolygonGeometry*, std::size(cpuObjects)> tmpGeometries;
617-
std::array<CAssetConverter::patch_t<asset::ICPUPolygonGeometry>, std::size(cpuObjects)> tmpGeometryPatches;
616+
std::array<ICPUPolygonGeometry*, std::size(cpuObjects)> tmpGeometries;
617+
std::array<CAssetConverter::patch_t<asset::ICPUPolygonGeometry>, std::size(cpuObjects)> tmpGeometryPatches;
618618
{
619619
tmpBLASPatches.front().compactAfterBuild = true;
620620
std::fill(tmpBLASPatches.begin(),tmpBLASPatches.end(),tmpBLASPatches.front());
621621
//
622-
for (uint32_t i = 0; i < cpuObjects.size(); i++)
623-
{
624-
tmpGeometries[i] = cpuObjects[i].data.get();
625-
tmpGeometryPatches[i].indexBufferUsages= IGPUBuffer::E_USAGE_FLAGS::EUF_SHADER_DEVICE_ADDRESS_BIT;
626-
}
622+
for (uint32_t i = 0; i < cpuObjects.size(); i++)
623+
{
624+
tmpGeometries[i] = cpuObjects[i].data.get();
625+
tmpGeometryPatches[i].indexBufferUsages= IGPUBuffer::E_USAGE_FLAGS::EUF_SHADER_DEVICE_ADDRESS_BIT;
626+
}
627627

628628
std::get<CAssetConverter::SInputs::asset_span_t<ICPUDescriptorSet>>(inputs.assets) = {&descriptorSet.get(),1};
629629
std::get<CAssetConverter::SInputs::asset_span_t<ICPUTopLevelAccelerationStructure>>(inputs.assets) = {&cpuTlas.get(),1};
630630
std::get<CAssetConverter::SInputs::patch_span_t<ICPUTopLevelAccelerationStructure>>(inputs.patches) = {&tlasPatch,1};
631631
std::get<CAssetConverter::SInputs::asset_span_t<ICPUBottomLevelAccelerationStructure>>(inputs.assets) = {&cpuBlas.data()->get(),cpuBlas.size()};
632632
std::get<CAssetConverter::SInputs::patch_span_t<ICPUBottomLevelAccelerationStructure>>(inputs.patches) = tmpBLASPatches;
633-
std::get<CAssetConverter::SInputs::asset_span_t<ICPUPolygonGeometry>>(inputs.assets) = tmpGeometries;
634-
std::get<CAssetConverter::SInputs::patch_span_t<ICPUPolygonGeometry>>(inputs.patches) = tmpGeometryPatches;
633+
std::get<CAssetConverter::SInputs::asset_span_t<ICPUPolygonGeometry>>(inputs.assets) = tmpGeometries;
634+
std::get<CAssetConverter::SInputs::patch_span_t<ICPUPolygonGeometry>>(inputs.patches) = tmpGeometryPatches;
635635
}
636636

637637
auto reservation = converter->reserve(inputs);
@@ -754,38 +754,38 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
754754
return {};
755755
}
756756

757-
auto&& tlases = reservation.getGPUObjects<ICPUTopLevelAccelerationStructure>();
758-
m_gpuTlas = tlases[0].value;
757+
auto&& tlases = reservation.getGPUObjects<ICPUTopLevelAccelerationStructure>();
758+
m_gpuTlas = tlases[0].value;
759759

760-
auto&& gpuPolygonGeometries = reservation.getGPUObjects<ICPUPolygonGeometry>();
761-
m_gpuPolygons.resize(gpuPolygonGeometries.size());
760+
auto&& gpuPolygonGeometries = reservation.getGPUObjects<ICPUPolygonGeometry>();
761+
m_gpuPolygons.resize(gpuPolygonGeometries.size());
762762

763763
// assign gpu objects to output
764764
for (uint32_t i = 0; i < gpuPolygonGeometries.size(); i++)
765-
{
766-
const auto& cpuObject = cpuObjects[i];
767-
const auto& gpuPolygon = gpuPolygonGeometries[i].value;
768-
const auto gpuTriangles = gpuPolygon->exportForBLAS();
769-
770-
const auto& vertexBufferBinding = gpuTriangles.vertexData[0];
771-
const uint64_t vertexBufferAddress = vertexBufferBinding.buffer->getDeviceAddress() + vertexBufferBinding.offset;
772-
773-
const auto& normalView = gpuPolygon->getNormalView();
774-
const uint64_t normalBufferAddress = normalView ? normalView.src.buffer->getDeviceAddress() + normalView.src.offset : 0;
775-
776-
const auto& indexBufferBinding = gpuTriangles.indexData;
777-
auto& geomInfo = geomInfos[i];
778-
geomInfo = {
779-
.vertexBufferAddress = vertexBufferAddress,
780-
.indexBufferAddress = indexBufferBinding.buffer ? indexBufferBinding.buffer->getDeviceAddress() + indexBufferBinding.offset : vertexBufferAddress,
781-
.normalBufferAddress = normalBufferAddress,
782-
.vertexStride = gpuTriangles.vertexStride,
783-
.indexType = gpuTriangles.indexType,
784-
.smoothNormals = s_smoothNormals[cpuObject.meta.type],
785-
};
786-
787-
m_gpuPolygons[i] = gpuPolygon;
788-
}
765+
{
766+
const auto& cpuObject = cpuObjects[i];
767+
const auto& gpuPolygon = gpuPolygonGeometries[i].value;
768+
const auto gpuTriangles = gpuPolygon->exportForBLAS();
769+
770+
const auto& vertexBufferBinding = gpuTriangles.vertexData[0];
771+
const uint64_t vertexBufferAddress = vertexBufferBinding.buffer->getDeviceAddress() + vertexBufferBinding.offset;
772+
773+
const auto& normalView = gpuPolygon->getNormalView();
774+
const uint64_t normalBufferAddress = normalView ? normalView.src.buffer->getDeviceAddress() + normalView.src.offset : 0;
775+
776+
const auto& indexBufferBinding = gpuTriangles.indexData;
777+
auto& geomInfo = geomInfos[i];
778+
geomInfo = {
779+
.vertexBufferAddress = vertexBufferAddress,
780+
.indexBufferAddress = indexBufferBinding.buffer ? indexBufferBinding.buffer->getDeviceAddress() + indexBufferBinding.offset : vertexBufferAddress,
781+
.normalBufferAddress = normalBufferAddress,
782+
.vertexStride = gpuTriangles.vertexStride,
783+
.indexType = gpuTriangles.indexType,
784+
.smoothNormals = s_smoothNormals[cpuObject.meta.type],
785+
};
786+
787+
m_gpuPolygons[i] = gpuPolygon;
788+
}
789789
}
790790

791791
//
@@ -901,8 +901,8 @@ class RayQueryGeometryApp final : public SimpleWindowedApplication, public Built
901901

902902
smart_refctd_ptr<IGPUBuffer> geometryInfoBuffer;
903903
smart_refctd_ptr<IGPUImage> outHDRImage;
904-
core::vector<smart_refctd_ptr<IGPUPolygonGeometry>> m_gpuPolygons;
905-
smart_refctd_ptr<IGPUTopLevelAccelerationStructure> m_gpuTlas;
904+
core::vector<smart_refctd_ptr<IGPUPolygonGeometry>> m_gpuPolygons;
905+
smart_refctd_ptr<IGPUTopLevelAccelerationStructure> m_gpuTlas;
906906

907907
smart_refctd_ptr<IGPUComputePipeline> renderPipeline;
908908
smart_refctd_ptr<IGPUDescriptorSet> renderDs;

0 commit comments

Comments
 (0)