Fixed compilation with MSVC.

This commit is contained in:
Patrick 2024-06-26 10:04:01 +02:00
parent c5a9d960e8
commit 99821bf2f5
4 changed files with 10 additions and 6 deletions

View File

@ -324,6 +324,8 @@ void unregisterObject(BaseObject* object) noexcept;
} }
return std::string(functionName.substr(begin, end - begin)); return std::string(functionName.substr(begin, end - begin));
#else #else
(void) sourceLocation;
(void) ERROR_NAME;
return "<unsupported compiler family>"; return "<unsupported compiler family>";
#endif #endif
} }
@ -382,7 +384,7 @@ protected:
friend class ObjectPtr; friend class ObjectPtr;
}; };
template<typename TConcrete, typename TBase = BaseObject, typename TOwner = TBase::owner_t> template<typename TConcrete, typename TBase = BaseObject, typename TOwner = typename TBase::owner_t>
class Object : public TBase class Object : public TBase
{ {
public: public:

View File

@ -165,6 +165,8 @@ namespace impl
} }
return std::string(functionName.substr(begin, end - begin)); return std::string(functionName.substr(begin, end - begin));
#else #else
(void) sourceLocation;
(void) ERROR_NAME;
return "<unsupported compiler family>"; return "<unsupported compiler family>";
#endif #endif
} }

View File

@ -33,7 +33,7 @@ void buildDefaultInstanceExtensionList(std::vector<ExtensionInfo>& outExtensions
outExtensions.push_back({.name = "VK_KHR_xcb_surface", .required = false}); outExtensions.push_back({.name = "VK_KHR_xcb_surface", .required = false});
outExtensions.push_back({.name = "VK_KHR_xlib_surface", .required = false}); outExtensions.push_back({.name = "VK_KHR_xlib_surface", .required = false});
#elif MIJIN_TARGET_OS == MIJIN_OS_WINDOWS #elif MIJIN_TARGET_OS == MIJIN_OS_WINDOWS
g_instanceExtensions.push_back({.name = "VK_KHR_win32_surface", .required = true}); outExtensions.push_back({.name = "VK_KHR_win32_surface", .required = true});
#endif #endif
} }
} }

View File

@ -101,7 +101,7 @@ void addShaderAttribute(std::vector<ShaderAttribute>& attributes, ShaderAttribut
ShaderVariableStructType::ShaderVariableStructType() {} // NOLINT(modernize-use-equals-default) ShaderVariableStructType::ShaderVariableStructType() {} // NOLINT(modernize-use-equals-default)
ShaderVariableStructType::~ShaderVariableStructType() {} // NOLINT(modernize-use-equals-default) ShaderVariableStructType::~ShaderVariableStructType() {} // NOLINT(modernize-use-equals-default)
void ShaderMeta::extendPushConstant(ShaderPushConstantBlock pushConstantBlock_, ShaderTypeBits stages) void ShaderMeta::extendPushConstant(ShaderPushConstantBlock pushConstantBlock_, ShaderTypeBits pushConstantStages_)
{ {
if (pushConstantBlock_.type.baseType == ShaderVariableBaseType::NONE) { if (pushConstantBlock_.type.baseType == ShaderVariableBaseType::NONE) {
return; return;
@ -109,14 +109,14 @@ void ShaderMeta::extendPushConstant(ShaderPushConstantBlock pushConstantBlock_,
if (pushConstantBlock.type.baseType == ShaderVariableBaseType::NONE) if (pushConstantBlock.type.baseType == ShaderVariableBaseType::NONE)
{ {
pushConstantBlock = std::move(pushConstantBlock_); pushConstantBlock = std::move(pushConstantBlock_);
pushConstantStages = stages; pushConstantStages = pushConstantStages_;
return; return;
} }
// now comes the actual merging // now comes the actual merging
assert(pushConstantBlock.type.baseType == ShaderVariableBaseType::STRUCT); assert(pushConstantBlock.type.baseType == ShaderVariableBaseType::STRUCT);
assert(pushConstantBlock_.type.baseType == ShaderVariableBaseType::STRUCT); assert(pushConstantBlock_.type.baseType == ShaderVariableBaseType::STRUCT);
assert(stages); assert(pushConstantStages_);
for (ShaderVariableStructMember& member : pushConstantBlock_.type.struct_.members) for (ShaderVariableStructMember& member : pushConstantBlock_.type.struct_.members)
{ {
@ -158,7 +158,7 @@ void ShaderMeta::extendPushConstant(ShaderPushConstantBlock pushConstantBlock_,
pushConstantBlock.type.struct_.members.insert(it, std::move(member)); pushConstantBlock.type.struct_.members.insert(it, std::move(member));
} }
pushConstantStages |= stages; pushConstantStages |= pushConstantStages_;
} }
void ShaderMeta::addInputAttribute(ShaderAttribute attribute) void ShaderMeta::addInputAttribute(ShaderAttribute attribute)