Skip to content

Commit 9f935ef

Browse files
author
devsh
committed
do not use core::bitflag or non HLSL stuff for the default values of device_limits.json or device_features.json
Also an alias screwed us over.
1 parent c15b84e commit 9f935ef

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

include/nbl/asset/IRenderpass.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ class NBL_API2 IRenderpass
165165
{
166166
enum RESOLVE_MODE : uint8_t
167167
{
168-
NONE = nbl::hlsl::ResolveModeFlags::NONE,
169-
SAMPLE_ZERO_BIT = nbl::hlsl::ResolveModeFlags::SAMPLE_ZERO_BIT,
170-
AVERAGE_BIT = nbl::hlsl::ResolveModeFlags::AVERAGE_BIT,
171-
MIN_BIT = nbl::hlsl::ResolveModeFlags::MIN_BIT,
172-
MAX_BIT = nbl::hlsl::ResolveModeFlags::MAX_BIT
168+
NONE = hlsl::ResolveModeFlags::NONE,
169+
SAMPLE_ZERO_BIT = hlsl::ResolveModeFlags::SAMPLE_ZERO_BIT,
170+
AVERAGE_BIT = hlsl::ResolveModeFlags::AVERAGE_BIT,
171+
MIN_BIT = hlsl::ResolveModeFlags::MIN_BIT,
172+
MAX_BIT = hlsl::ResolveModeFlags::MAX_BIT
173173
};
174174
struct ResolveMode
175175
{

include/nbl/builtin/hlsl/enums.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ enum SwapchainMode : uint16_t {
9393
NBL_ENUM_ADD_BITWISE_OPERATORS(ShaderStage)
9494
NBL_ENUM_ADD_BITWISE_OPERATORS(SampleCountFlags)
9595
NBL_ENUM_ADD_BITWISE_OPERATORS(ResolveModeFlags)
96-
NBL_ENUM_ADD_BITWISE_OPERATORS(SpirvVersion)
96+
NBL_ENUM_ADD_BITWISE_OPERATORS(SpirvVersion) // erm do we want this?
9797
NBL_ENUM_ADD_BITWISE_OPERATORS(PointClippingBehavior)
9898
NBL_ENUM_ADD_BITWISE_OPERATORS(SwapchainMode)
9999
#endif

include/nbl/video/SPhysicalDeviceLimits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct SPhysicalDeviceLimits
2323
EPCB_ALL_CLIP_PLANES = nbl::hlsl::PointClippingBehavior::EPCB_ALL_CLIP_PLANES,
2424
EPCB_USER_CLIP_PLANES_ONLY = nbl::hlsl::PointClippingBehavior::EPCB_USER_CLIP_PLANES_ONLY
2525
};
26-
using RESOLVE_MODE_FLAGS = asset::IRenderpass::SCreationParams::SSubpassDescription::SDepthStencilAttachmentsRef::RESOLVE_MODE;
26+
using RESOLVE_MODE_FLAGS = nbl::hlsl::ResolveModeFlags;
2727

2828
#include "nbl/video/SPhysicalDeviceLimits_members.h"
2929

src/nbl/video/CVulkanPhysicalDevice.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
443443
properties.limits.maxDescriptorSetUpdateAfterBindStorageImages = vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages;
444444
properties.limits.maxDescriptorSetUpdateAfterBindInputAttachments = vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments;
445445

446-
properties.limits.supportedDepthResolveModes = static_cast<SPhysicalDeviceLimits::RESOLVE_MODE_FLAGS>(vulkan12Properties.supportedDepthResolveModes);
447-
properties.limits.supportedStencilResolveModes = static_cast<SPhysicalDeviceLimits::RESOLVE_MODE_FLAGS>(vulkan12Properties.supportedStencilResolveModes);
446+
properties.limits.supportedDepthResolveModes = static_cast<nbl::hlsl::ResolveModeFlags>(vulkan12Properties.supportedDepthResolveModes);
447+
properties.limits.supportedStencilResolveModes = static_cast<nbl::hlsl::ResolveModeFlags>(vulkan12Properties.supportedStencilResolveModes);
448448

449449
if (!vulkan12Properties.independentResolve || !vulkan12Properties.independentResolveNone)
450450
return nullptr;

src/nbl/video/ILogicalDevice.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,10 +712,9 @@ core::smart_refctd_ptr<IGPURenderpass> ILogicalDevice::createRenderpass(const IG
712712
{
713713
depthSamples = params.depthStencilAttachments[subpass.depthStencilAttachment.render.attachmentIndex].samples;
714714

715-
using resolve_flag_t = IGPURenderpass::SCreationParams::SSubpassDescription::SDepthStencilAttachmentsRef::RESOLVE_MODE;
716715
// TODO: seems like `multisampledRenderToSingleSampledEnable` needs resolve modes but not necessarily a resolve attachmen
717-
const resolve_flag_t depthResolve = subpass.depthStencilAttachment.resolveMode.depth;
718-
const resolve_flag_t stencilResolve = subpass.depthStencilAttachment.resolveMode.stencil;
716+
const hlsl::ResolveModeFlags depthResolve = static_cast<hlsl::ResolveModeFlags>(subpass.depthStencilAttachment.resolveMode.depth);
717+
const hlsl::ResolveModeFlags stencilResolve = static_cast<hlsl::ResolveModeFlags>(subpass.depthStencilAttachment.resolveMode.stencil);
719718
if (subpass.depthStencilAttachment.resolve.used() || /*multisampledToSingleSampledUsed*/false)
720719
{
721720
const auto& attachment = params.depthStencilAttachments[(subpass.depthStencilAttachment.resolve.used() ? subpass.depthStencilAttachment.resolve : subpass.depthStencilAttachment.render).attachmentIndex];
@@ -739,7 +738,7 @@ core::smart_refctd_ptr<IGPURenderpass> ILogicalDevice::createRenderpass(const IG
739738
}
740739

741740
// https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSubpassDescriptionDepthStencilResolve-pNext-06873
742-
if (/*multisampledToSingleSampledUsed*/false && depthResolve == resolve_flag_t::NONE && stencilResolve == resolve_flag_t::NONE)
741+
if (/*multisampledToSingleSampledUsed*/false && depthResolve == hlsl::ResolveModeFlags::NONE && stencilResolve == hlsl::ResolveModeFlags::NONE)
743742
{
744743
NBL_LOG_ERROR("Invalid stencil attachment's resolve mode (subpasses[%u])", i);
745744
return nullptr;

src/nbl/video/device_capabilities/device_limits.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@
11101110
{
11111111
"type": "core::bitflag<RESOLVE_MODE_FLAGS>",
11121112
"name": "supportedDepthResolveModes",
1113-
"value": "core::bitflag<RESOLVE_MODE_FLAGS>(RESOLVE_MODE_FLAGS::SAMPLE_ZERO_BIT) | RESOLVE_MODE_FLAGS::MIN_BIT | RESOLVE_MODE_FLAGS::MAX_BIT"
1113+
"value": "RESOLVE_MODE_FLAGS::SAMPLE_ZERO_BIT | RESOLVE_MODE_FLAGS::MIN_BIT | RESOLVE_MODE_FLAGS::MAX_BIT"
11141114
},
11151115
{
11161116
"type": "core::bitflag<RESOLVE_MODE_FLAGS>",

0 commit comments

Comments
 (0)