mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Feat] (MG_Backend/DirectVulkan): make helper functions static
This commit is contained in:
@@ -184,7 +184,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
return XXH64_digest(m_hashState);
|
||||
}
|
||||
|
||||
VkBlendFactor RenderStateManager::ResolveBlendFactor(BlendFactor factor) const {
|
||||
VkBlendFactor RenderStateManager::ResolveBlendFactor(BlendFactor factor) {
|
||||
switch (factor) {
|
||||
case BlendFactor::Zero:
|
||||
return VK_BLEND_FACTOR_ZERO;
|
||||
@@ -220,7 +220,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
}
|
||||
}
|
||||
|
||||
VkCompareOp RenderStateManager::ResolveDepthCompareOp(DepthTestFunc func) const {
|
||||
VkCompareOp RenderStateManager::ResolveDepthCompareOp(DepthTestFunc func) {
|
||||
switch (func) {
|
||||
case DepthTestFunc::Never:
|
||||
return VK_COMPARE_OP_NEVER;
|
||||
@@ -244,7 +244,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
}
|
||||
}
|
||||
|
||||
VkCullModeFlags RenderStateManager::ResolveCullMode(CullFaceMode mode) const {
|
||||
VkCullModeFlags RenderStateManager::ResolveCullMode(CullFaceMode mode) {
|
||||
switch (mode) {
|
||||
case CullFaceMode::Front:
|
||||
return VK_CULL_MODE_FRONT_BIT;
|
||||
@@ -258,7 +258,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
}
|
||||
}
|
||||
|
||||
VkColorComponentFlags RenderStateManager::ResolveColorWriteMask(const BoolVec4& mask) const {
|
||||
VkColorComponentFlags RenderStateManager::ResolveColorWriteMask(const BoolVec4& mask) {
|
||||
VkColorComponentFlags vkMask = 0;
|
||||
if (mask.x()) vkMask |= VK_COLOR_COMPONENT_R_BIT;
|
||||
if (mask.y()) vkMask |= VK_COLOR_COMPONENT_G_BIT;
|
||||
|
||||
@@ -41,12 +41,12 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
|
||||
private:
|
||||
void Cleanup();
|
||||
void PatchCreateInfoPointers(RenderStateInfo& stateInfo);
|
||||
static void PatchCreateInfoPointers(RenderStateInfo& stateInfo);
|
||||
HashType GetHash(const RenderStateParameters& renderState, Uint colorAttachmentCount);
|
||||
VkBlendFactor ResolveBlendFactor(BlendFactor factor) const;
|
||||
VkCompareOp ResolveDepthCompareOp(DepthTestFunc func) const;
|
||||
VkCullModeFlags ResolveCullMode(CullFaceMode mode) const;
|
||||
VkColorComponentFlags ResolveColorWriteMask(const BoolVec4& mask) const;
|
||||
static VkBlendFactor ResolveBlendFactor(BlendFactor factor);
|
||||
static VkCompareOp ResolveDepthCompareOp(DepthTestFunc func);
|
||||
static VkCullModeFlags ResolveCullMode(CullFaceMode mode);
|
||||
static VkColorComponentFlags ResolveColorWriteMask(const BoolVec4& mask);
|
||||
|
||||
UnorderedMap<HashType, RenderStateInfo> m_renderStateInfo;
|
||||
XXH64_state_t* const m_hashState = XXH64_createState();
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
return XXH64_digest(m_hashState);
|
||||
}
|
||||
|
||||
Uint VertexInputStateManager::GetDataTypeByteSize(DataType type) const {
|
||||
Uint VertexInputStateManager::GetDataTypeByteSize(DataType type) {
|
||||
switch (type) {
|
||||
case DataType::Int8:
|
||||
case DataType::Uint8:
|
||||
@@ -135,7 +135,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
}
|
||||
}
|
||||
|
||||
VkFormat VertexInputStateManager::ResolveVertexFormat(const MG_State::GLState::VertexAttribute& attrib) const {
|
||||
VkFormat VertexInputStateManager::ResolveVertexFormat(const MG_State::GLState::VertexAttribute& attrib) {
|
||||
auto size = attrib.Size;
|
||||
|
||||
auto selectFormat = [size](VkFormat c1, VkFormat c2, VkFormat c3, VkFormat c4) {
|
||||
|
||||
@@ -33,10 +33,10 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
|
||||
private:
|
||||
void Cleanup();
|
||||
void PatchCreateInfoPointers(VertexInputStateInfo& stateInfo);
|
||||
static void PatchCreateInfoPointers(VertexInputStateInfo& stateInfo);
|
||||
HashType GetHash(VertexArrayObject* vaoObject);
|
||||
VkFormat ResolveVertexFormat(const MG_State::GLState::VertexAttribute& attrib) const;
|
||||
Uint GetDataTypeByteSize(DataType type) const;
|
||||
static VkFormat ResolveVertexFormat(const MG_State::GLState::VertexAttribute& attrib);
|
||||
static Uint GetDataTypeByteSize(DataType type);
|
||||
|
||||
UnorderedMap<HashType, VertexInputStateInfo> m_vertexInputStateInfo;
|
||||
XXH64_state_t* const m_hashState = XXH64_createState();
|
||||
|
||||
Reference in New Issue
Block a user