mirror of https://github.com/AxioDL/metaforce.git
CWorldShadowShader construct fixes
This commit is contained in:
parent
a84f5441a7
commit
8e98a5b058
|
@ -4,11 +4,16 @@ namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
CWorldShadowShader::CWorldShadowShader(u32 w, u32 h)
|
CWorldShadowShader::CWorldShadowShader(u32 w, u32 h)
|
||||||
: m_w(w), m_h(h) {}
|
: m_w(w), m_h(h)
|
||||||
|
|
||||||
void CWorldShadowShader::_buildTex(boo::IGraphicsDataFactory::Context& ctx)
|
|
||||||
{
|
{
|
||||||
m_tex = ctx.newRenderTexture(m_w, m_h, boo::TextureClampMode::ClampToWhite, 1, 0);
|
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()
|
void CWorldShadowShader::bindRenderTarget()
|
||||||
|
|
|
@ -15,6 +15,7 @@ class CWorldShadowShader
|
||||||
friend struct CWorldShadowShaderD3DDataBindingFactory;
|
friend struct CWorldShadowShaderD3DDataBindingFactory;
|
||||||
friend struct CWorldShadowShaderMetalDataBindingFactory;
|
friend struct CWorldShadowShaderMetalDataBindingFactory;
|
||||||
|
|
||||||
|
boo::GraphicsDataToken m_token;
|
||||||
boo::ITextureR* m_tex;
|
boo::ITextureR* m_tex;
|
||||||
std::experimental::optional<CTexturedQuadFilter> m_prevQuad;
|
std::experimental::optional<CTexturedQuadFilter> m_prevQuad;
|
||||||
u32 m_w, m_h;
|
u32 m_w, m_h;
|
||||||
|
@ -31,8 +32,6 @@ class CWorldShadowShader
|
||||||
boo::IShaderDataBinding* m_zDataBind = nullptr;
|
boo::IShaderDataBinding* m_zDataBind = nullptr;
|
||||||
Uniform m_uniform;
|
Uniform m_uniform;
|
||||||
|
|
||||||
void _buildTex(boo::IGraphicsDataFactory::Context& ctx);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CWorldShadowShader(u32 w, u32 h);
|
CWorldShadowShader(u32 w, u32 h);
|
||||||
void bindRenderTarget();
|
void bindRenderTarget();
|
||||||
|
|
|
@ -67,7 +67,6 @@ struct CWorldShadowShaderGLDataBindingFactory : TShader<CWorldShadowShader>::IDa
|
||||||
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline,
|
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline,
|
||||||
vtxFmt, filter.m_vbo, nullptr, nullptr,
|
vtxFmt, filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
1, bufs, stages, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
||||||
filter._buildTex(ctx);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -87,7 +86,6 @@ struct CWorldShadowShaderVulkanDataBindingFactory : TShader<CWorldShadowShader>:
|
||||||
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
|
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
||||||
filter._buildTex(ctx);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,7 +61,6 @@ struct CWorldShadowShaderD3DDataBindingFactory : TShader<CWorldShadowShader>::ID
|
||||||
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
|
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
||||||
filter._buildTex(ctx);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -65,7 +65,6 @@ struct CWorldShadowShaderMetalDataBindingFactory : TShader<CWorldShadowShader>::
|
||||||
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
|
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
||||||
filter._buildTex(ctx);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 2ff1ff22b3ba5ef8c89de1faea6c992ad4542952
|
Subproject commit 8f8c02721a9d28b1e0ff4e9c741e55102e1c62b5
|
Loading…
Reference in New Issue