Graphics: Add support for draw call data (texture overlay)

This commit is contained in:
Jérôme Leclercq
2021-09-05 18:26:12 +02:00
parent 26e5a41dce
commit abdcd63058
16 changed files with 160 additions and 18 deletions

View File

@@ -10,6 +10,23 @@
namespace Nz
{
SubmeshRenderer::SubmeshRenderer()
{
Graphics* graphics = Graphics::Instance();
const auto& whiteTexture = graphics->GetDefaultTextures().whiteTexture2d;
const auto& defaultSampler = graphics->GetSamplerCache().Get({});
m_renderDataBinding = graphics->GetReferencePipelineLayout()->AllocateShaderBinding(Graphics::DrawDataBindingSet);
m_renderDataBinding->Update({
{
0,
ShaderBinding::TextureBinding {
whiteTexture.get(), defaultSampler.get()
}
}
});
}
std::unique_ptr<ElementRendererData> SubmeshRenderer::InstanciateData()
{
return {};
@@ -22,6 +39,8 @@ namespace Nz
const RenderPipeline* currentPipeline = nullptr;
const ShaderBinding* currentMaterialBinding = nullptr;
commandBuffer.BindShaderBinding(Graphics::DrawDataBindingSet, *m_renderDataBinding);
for (std::size_t i = 0; i < elementCount; ++i)
{
assert(elements[i]->GetElementType() == UnderlyingCast(BasicRenderElement::Submesh));