Skip to content

Commit 8ae32e1

Browse files
committed
removed redundant barrier
1 parent 8fd7f5d commit 8ae32e1

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

29_Arithmetic2Bench/main.cpp

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -398,31 +398,6 @@ class ArithmeticBenchApp final : public examples::SimpleWindowedApplication, pub
398398
cmdbuf->reset(IGPUCommandBuffer::RESET_FLAGS::RELEASE_RESOURCES_BIT);
399399
cmdbuf->begin(IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT);
400400

401-
// barrier transition to GENERAL
402-
{
403-
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[1];
404-
imageBarriers[0].barrier = {
405-
.dep = {
406-
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE,
407-
.srcAccessMask = ACCESS_FLAGS::NONE,
408-
.dstStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT,
409-
.dstAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS
410-
}
411-
};
412-
imageBarriers[0].image = m_surface->getSwapchainResources()->getImage(m_currentImageAcquire.imageIndex);
413-
imageBarriers[0].subresourceRange = {
414-
.aspectMask = IImage::EAF_COLOR_BIT,
415-
.baseMipLevel = 0u,
416-
.levelCount = 1u,
417-
.baseArrayLayer = 0u,
418-
.layerCount = 1u
419-
};
420-
imageBarriers[0].oldLayout = IImage::LAYOUT::UNDEFINED;
421-
imageBarriers[0].newLayout = IImage::LAYOUT::GENERAL;
422-
423-
cmdbuf->pipelineBarrier(E_DEPENDENCY_FLAGS::EDF_NONE, { .imgBarriers = imageBarriers });
424-
}
425-
426401
const auto MaxSubgroupSize = m_physicalDevice->getLimits().maxSubgroupSize;
427402
const auto SubgroupSizeLog2 = hlsl::findMSB(MaxSubgroupSize);
428403

@@ -451,7 +426,7 @@ class ArithmeticBenchApp final : public examples::SimpleWindowedApplication, pub
451426
.baseArrayLayer = 0u,
452427
.layerCount = 1u
453428
};
454-
imageBarriers[0].oldLayout = IImage::LAYOUT::GENERAL;
429+
imageBarriers[0].oldLayout = IImage::LAYOUT::UNDEFINED;
455430
imageBarriers[0].newLayout = IImage::LAYOUT::PRESENT_SRC;
456431

457432
cmdbuf->pipelineBarrier(E_DEPENDENCY_FLAGS::EDF_NONE, { .imgBarriers = imageBarriers });
@@ -568,7 +543,8 @@ class ArithmeticBenchApp final : public examples::SimpleWindowedApplication, pub
568543

569544
const uint32_t subgroupSize = 0x1u << subgroupSizeLog2;
570545
const uint32_t workgroupSizeLog2 = hlsl::findMSB(workgroupSize);
571-
hlsl::workgroup2::SArithmeticConfiguration wgConfig = hlsl::workgroup2::SArithmeticConfiguration::create(workgroupSizeLog2, subgroupSizeLog2, itemsPerInvoc);
546+
hlsl::workgroup2::SArithmeticConfiguration wgConfig;
547+
wgConfig.init(workgroupSizeLog2, subgroupSizeLog2, itemsPerInvoc);
572548
const uint32_t itemsPerWG = wgConfig.VirtualWorkgroupSize * wgConfig.ItemsPerInvocation_0;
573549
smart_refctd_ptr<ICPUShader> overriddenUnspecialized;
574550
if constexpr (WorkgroupBench)

0 commit comments

Comments
 (0)