CWorldShadowShader construct fixes

This commit is contained in:
Jack Andersen 2017-10-01 15:01:11 -10:00
parent a84f5441a7
commit 8e98a5b058
6 changed files with 11 additions and 11 deletions

View File

@ -4,11 +4,16 @@ namespace urde
{
CWorldShadowShader::CWorldShadowShader(u32 w, u32 h)
: m_w(w), m_h(h) {}
void CWorldShadowShader::_buildTex(boo::IGraphicsDataFactory::Context& ctx)
: m_w(w), m_h(h)
{
m_token = CGraphics::g_BooFactory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
{
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, 16, 4);
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
m_dataBind = TShader<CWorldShadowShader>::BuildShaderDataBinding(ctx, *this);
m_tex = ctx.newRenderTexture(m_w, m_h, boo::TextureClampMode::ClampToWhite, 1, 0);
return true;
});
}
void CWorldShadowShader::bindRenderTarget()

View File

@ -15,6 +15,7 @@ class CWorldShadowShader
friend struct CWorldShadowShaderD3DDataBindingFactory;
friend struct CWorldShadowShaderMetalDataBindingFactory;
boo::GraphicsDataToken m_token;
boo::ITextureR* m_tex;
std::experimental::optional<CTexturedQuadFilter> m_prevQuad;
u32 m_w, m_h;
@ -31,8 +32,6 @@ class CWorldShadowShader
boo::IShaderDataBinding* m_zDataBind = nullptr;
Uniform m_uniform;
void _buildTex(boo::IGraphicsDataFactory::Context& ctx);
public:
CWorldShadowShader(u32 w, u32 h);
void bindRenderTarget();

View File

@ -67,7 +67,6 @@ struct CWorldShadowShaderGLDataBindingFactory : TShader<CWorldShadowShader>::IDa
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline,
vtxFmt, filter.m_vbo, nullptr, nullptr,
1, bufs, stages, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
filter._buildTex(ctx);
return nullptr;
}
};
@ -87,7 +86,6 @@ struct CWorldShadowShaderVulkanDataBindingFactory : TShader<CWorldShadowShader>:
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
filter.m_vbo, nullptr, nullptr, 1, bufs,
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
filter._buildTex(ctx);
return nullptr;
}
};

View File

@ -61,7 +61,6 @@ struct CWorldShadowShaderD3DDataBindingFactory : TShader<CWorldShadowShader>::ID
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
filter.m_vbo, nullptr, nullptr, 1, bufs,
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
filter._buildTex(ctx);
return nullptr;
}
};

View File

@ -65,7 +65,6 @@ struct CWorldShadowShaderMetalDataBindingFactory : TShader<CWorldShadowShader>::
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
filter.m_vbo, nullptr, nullptr, 1, bufs,
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
filter._buildTex(ctx);
return nullptr;
}
};

2
hecl

@ -1 +1 @@
Subproject commit 2ff1ff22b3ba5ef8c89de1faea6c992ad4542952
Subproject commit 8f8c02721a9d28b1e0ff4e9c741e55102e1c62b5