From 4a27b8a45fd535fa28496bb79c675bf8fd90a6cb Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Wed, 11 Apr 2018 21:06:57 -0700 Subject: Vulkan: added blend state desc conversion --- .../GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Graphics/GraphicsEngineD3DBase') diff --git a/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h b/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h index e5d328e3..047bf37c 100644 --- a/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h +++ b/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h @@ -23,6 +23,8 @@ #pragma once +#include + /// \file /// Implementation of D3D type conversions @@ -70,7 +72,7 @@ namespace Diligent D3D_PRIM_TOPOLOGY TopologyToD3DTopology(PRIMITIVE_TOPOLOGY Topology) { static bool bIsInit = false; - static D3D_PRIM_TOPOLOGY d3dPrimTopology[PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES] = {}; + static std::array d3dPrimTopology = {}; if( !bIsInit ) { d3dPrimTopology[PRIMITIVE_TOPOLOGY_UNDEFINED] = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED; @@ -126,7 +128,7 @@ namespace Diligent { // D3D12_FILL_MODE is identical tp D3D11_FILL_MODE static bool bIsInit = false; - static D3D_FILL_MODE d3dFillModes[FILL_MODE_NUM_MODES] = {}; + static std::array d3dFillModes = {}; if( !bIsInit ) { d3dFillModes[ FILL_MODE_WIREFRAME ] = D3D_FILL_MODE_WIREFRAME; @@ -152,7 +154,7 @@ namespace Diligent { // D3D_CULL_MODE is identical to D3D11_CULL_MODE static bool bIsInit = false; - static D3D_CULL_MODE d3dCullModes[CULL_MODE_NUM_MODES] = {}; + static std::array d3dCullModes = {}; if( !bIsInit ) { d3dCullModes[ CULL_MODE_NONE ] = D3D_CULL_MODE_NONE; @@ -204,7 +206,7 @@ namespace Diligent // Note that this code is safe for multithreaded environments since // bIsInit is set to true only AFTER the entire map is initialized. static bool bIsInit = false; - static D3D_BLEND D3DBlend[BLEND_FACTOR_NUM_FACTORS] = {}; + static std::array D3DBlend = {}; if( !bIsInit ) { // In a multithreaded environment, several threads can potentially enter @@ -249,7 +251,7 @@ namespace Diligent // D3D12_BLEND_OP and D3D11_BLEND_OP are identical static bool bIsInit = false; - static D3D_BLEND_OP D3DBlendOp[BLEND_OPERATION_NUM_OPERATIONS] = {}; + static std::array D3DBlendOp = {}; if( !bIsInit ) { D3DBlendOp[ BLEND_OPERATION_ADD ] = D3D_BLEND_OP_ADD; @@ -311,7 +313,7 @@ namespace Diligent D3D_STENCIL_OP StencilOpToD3DStencilOp( STENCIL_OP StencilOp ) { static bool bIsInit = false; - static D3D_STENCIL_OP StOpToD3DStOpMap[STENCIL_OP_NUM_OPS] = {}; + static std::array StOpToD3DStOpMap = {}; if( !bIsInit ) { StOpToD3DStOpMap[ STENCIL_OP_KEEP ] = D3D_STENCIL_OP_KEEP; -- cgit v1.2.3