diff --git a/include/boo/System.hpp b/include/boo/System.hpp index 4ca25a1..6992d26 100644 --- a/include/boo/System.hpp +++ b/include/boo/System.hpp @@ -15,19 +15,19 @@ constexpr type operator&(type a, type b)\ using T = std::underlying_type_t;\ return type(static_cast(a) & static_cast(b));\ }\ -constexpr type& operator|=(type& a, const type& b)\ +inline type& operator|=(type& a, const type& b)\ {\ using T = std::underlying_type_t;\ a = type(static_cast(a) | static_cast(b));\ return a;\ }\ -constexpr type& operator&=(type& a, const type& b)\ +inline type& operator&=(type& a, const type& b)\ {\ using T = std::underlying_type_t;\ a = type(static_cast(a) & static_cast(b));\ return a;\ }\ -constexpr type operator~(const type& key)\ +inline type operator~(const type& key)\ {\ using T = std::underlying_type_t;\ return type(~static_cast(key));\ diff --git a/lib/graphicsdev/D3D11.cpp b/lib/graphicsdev/D3D11.cpp index 91ffd52..d6ae49c 100644 --- a/lib/graphicsdev/D3D11.cpp +++ b/lib/graphicsdev/D3D11.cpp @@ -500,7 +500,7 @@ class D3D11ShaderPipeline : public IShaderPipeline CD3D11_DEPTH_STENCIL_DESC dsDesc(D3D11_DEFAULT); dsDesc.DepthEnable = depthTest; dsDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK(depthWrite); - dsDesc.DepthFunc = D3D11_COMPARISON_GREATER; + dsDesc.DepthFunc = D3D11_COMPARISON_GREATER_EQUAL; ThrowIfFailed(ctx->m_dev->CreateDepthStencilState(&dsDesc, &m_dsState)); CD3D11_BLEND_DESC blDesc(D3D11_DEFAULT); @@ -595,10 +595,6 @@ struct D3D11ShaderDataBinding : IShaderDataBinding } for (size_t i=0 ; itype()) + if (m_texs[i]) { - case TextureType::Dynamic: - { - D3D11TextureD* ctex = static_cast(m_texs[i]); - srvs[i] = ctex->m_srvs[b].Get(); - break; - } - case TextureType::Static: - { - D3D11TextureS* ctex = static_cast(m_texs[i]); - srvs[i] = ctex->m_srv.Get(); - break; - } - case TextureType::StaticArray: - { - D3D11TextureSA* ctex = static_cast(m_texs[i]); - srvs[i] = ctex->m_srv.Get(); - break; - } - case TextureType::Render: - { - D3D11TextureR* ctex = static_cast(m_texs[i]); - srvs[i] = ctex->m_colorSrv.Get(); - break; - } + switch (m_texs[i]->type()) + { + case TextureType::Dynamic: + { + D3D11TextureD* ctex = static_cast(m_texs[i]); + srvs[i] = ctex->m_srvs[b].Get(); + break; + } + case TextureType::Static: + { + D3D11TextureS* ctex = static_cast(m_texs[i]); + srvs[i] = ctex->m_srv.Get(); + break; + } + case TextureType::StaticArray: + { + D3D11TextureSA* ctex = static_cast(m_texs[i]); + srvs[i] = ctex->m_srv.Get(); + break; + } + case TextureType::Render: + { + D3D11TextureR* ctex = static_cast(m_texs[i]); + srvs[i] = ctex->m_colorSrv.Get(); + break; + } + } } } ctx->PSSetShaderResources(0, m_texCount, srvs); diff --git a/lib/graphicsdev/D3D12.cpp b/lib/graphicsdev/D3D12.cpp index 91a3dcb..684b1d2 100644 --- a/lib/graphicsdev/D3D12.cpp +++ b/lib/graphicsdev/D3D12.cpp @@ -648,7 +648,7 @@ class D3D12ShaderPipeline : public IShaderPipeline if (!backfaceCulling) desc.RasterizerState.CullMode = D3D12_CULL_MODE_NONE; desc.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC(D3D12_DEFAULT); - desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_GREATER; + desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_GREATER_EQUAL; if (!depthTest) desc.DepthStencilState.DepthEnable = false; if (!depthWrite) @@ -935,10 +935,6 @@ struct D3D12ShaderDataBinding : IShaderDataBinding } for (size_t i=0 ; i errBlob; + //printf("%s\n", vertSource); + //printf("%s\n", fragSource); + if (!vertBlobOut) { if (FAILED(D3DCompilePROC(vertSource, strlen(vertSource), "HECL Vert Source", nullptr, nullptr, "main",