Skip to content

Commit 47fc9b1

Browse files
JackOfBlades232petr.kiyashko
andauthored
Added compare options to samplers for shadow sampling. (#83)
* Added compare options to samplers for shadow sampling. * Corrected comment on BlockingTransferHelper::uploadImage (we do support mip/layer now) --------- Co-authored-by: petr.kiyashko <petr.kiyashko@gaijin.team>
1 parent a0f303f commit 47fc9b1

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

etna/include/etna/BlockingTransferHelper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class BlockingTransferHelper
6161
OneShotCmdMgr& cmd_mgr, std::span<std::byte> dst, const Buffer& src, std::uint32_t offset);
6262

6363

64-
// NOTE: uploads only mip 0 and layer 0 for now and doesn't support 3D images
64+
// NOTE: for now doesn't support 3D images
6565
void uploadImage(
6666
OneShotCmdMgr& cmd_mgr,
6767
Image& dst,

etna/include/etna/Sampler.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class Sampler
2121
std::string_view name;
2222
float minLod = 0.0f;
2323
float maxLod = VK_LOD_CLAMP_NONE;
24+
bool compareEnable = false;
25+
vk::CompareOp compareOp = vk::CompareOp::eLessOrEqual;
2426
};
2527

2628
explicit Sampler(CreateInfo info);

etna/source/Sampler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ Sampler::Sampler(CreateInfo info)
1717
.addressModeW = info.addressMode,
1818
.mipLodBias = 0.0f,
1919
.maxAnisotropy = 1.0f,
20+
.compareEnable = static_cast<vk::Bool32>(info.compareEnable),
21+
.compareOp = info.compareOp,
2022
.minLod = info.minLod,
2123
.maxLod = info.maxLod,
22-
.borderColor = vk::BorderColor::eFloatOpaqueWhite,
2324
};
2425
sampler = unwrap_vk_result(etna::get_context().getDevice().createSamplerUnique(createInfo));
2526
etna::set_debug_name(sampler.get(), info.name.data());

0 commit comments

Comments
 (0)