mirror of
https://github.com/AxioDL/boo.git
synced 2025-07-04 12:15:52 +00:00
D3D sync
This commit is contained in:
parent
21548bada8
commit
29364a8024
@ -15,19 +15,19 @@ constexpr type operator&(type a, type b)\
|
||||
using T = std::underlying_type_t<type>;\
|
||||
return type(static_cast<T>(a) & static_cast<T>(b));\
|
||||
}\
|
||||
constexpr type& operator|=(type& a, const type& b)\
|
||||
inline type& operator|=(type& a, const type& b)\
|
||||
{\
|
||||
using T = std::underlying_type_t<type>;\
|
||||
a = type(static_cast<T>(a) | static_cast<T>(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<type>;\
|
||||
a = type(static_cast<T>(a) & static_cast<T>(b));\
|
||||
return a;\
|
||||
}\
|
||||
constexpr type operator~(const type& key)\
|
||||
inline type operator~(const type& key)\
|
||||
{\
|
||||
using T = std::underlying_type_t<type>;\
|
||||
return type(~static_cast<T>(key));\
|
||||
|
@ -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 ; i<texCount ; ++i)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
if (!texs[i])
|
||||
Log.report(logvisor::Fatal, "null texture %d provided to newShaderDataBinding", int(i));
|
||||
#endif
|
||||
m_texs[i] = texs[i];
|
||||
}
|
||||
}
|
||||
@ -747,8 +743,10 @@ struct D3D11ShaderDataBinding : IShaderDataBinding
|
||||
|
||||
if (m_texCount)
|
||||
{
|
||||
ID3D11ShaderResourceView* srvs[8];
|
||||
ID3D11ShaderResourceView* srvs[8] = {};
|
||||
for (int i=0 ; i<8 && i<m_texCount ; ++i)
|
||||
{
|
||||
if (m_texs[i])
|
||||
{
|
||||
switch (m_texs[i]->type())
|
||||
{
|
||||
@ -778,6 +776,7 @@ struct D3D11ShaderDataBinding : IShaderDataBinding
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx->PSSetShaderResources(0, m_texCount, srvs);
|
||||
}
|
||||
}
|
||||
|
@ -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<texCount ; ++i)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
if (!texs[i])
|
||||
Log.report(logvisor::Fatal, "null texture %d provided to newShaderDataBinding", int(i));
|
||||
#endif
|
||||
m_texs[i] = texs[i];
|
||||
}
|
||||
}
|
||||
@ -996,7 +992,7 @@ struct D3D12ShaderDataBinding : IShaderDataBinding
|
||||
}
|
||||
for (size_t i=0 ; i<MAX_TEXTURE_COUNT ; ++i)
|
||||
{
|
||||
if (i<m_texCount)
|
||||
if (i<m_texCount && m_texs[i])
|
||||
{
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc;
|
||||
ID3D12Resource* res = GetTextureGPUResource(m_texs[i], b, srvDesc);
|
||||
@ -1602,6 +1598,9 @@ public:
|
||||
{
|
||||
ComPtr<ID3DBlob> errBlob;
|
||||
|
||||
//printf("%s\n", vertSource);
|
||||
//printf("%s\n", fragSource);
|
||||
|
||||
if (!vertBlobOut)
|
||||
{
|
||||
if (FAILED(D3DCompilePROC(vertSource, strlen(vertSource), "HECL Vert Source", nullptr, nullptr, "main",
|
||||
|
Loading…
x
Reference in New Issue
Block a user