Drawable Renderer (#1570), Rebase on main.

Fix drawable ordering issue that was leading to rendering without setting up the VAO
This commit is contained in:
Tim Sylvester
2023-04-26 13:58:24 -07:00
committed by Bart Louwers
parent 107a4ef467
commit 3122f81328
9 changed files with 22 additions and 21 deletions

View File

@@ -449,7 +449,7 @@ void Context::setDirtyState() {
globalVertexArrayState.setDirty();
}
void Context::setupDraw(const gfx::Drawable& drawable) {
bool Context::setupDraw(const gfx::Drawable& drawable) {
if (const auto &shader = drawable.getShader()) {
const auto& shaderGL = static_cast<const ShaderProgramGL&>(*shader);
if (shaderGL.getGLProgramID() != program.getCurrentValue()) {
@@ -471,11 +471,10 @@ void Context::setupDraw(const gfx::Drawable& drawable) {
auto& vao = drawableGL.getVertexArray();
if (vao.isValid()) {
bindVertexArray = vao.getID(); // glBindVertexArray
//vertexBuffer = static_cast<gl::VertexBufferResource&>(*drawableGL.getBuffer()).buffer.get();
//globalVertexArrayState.indexBuffer =
// drawableGL.getIndexBuffer().getResource<gl::IndexBufferResource>().buffer;
return true;
} else {
bindVertexArray = value::BindVertexArray::Default;
return false;
}
}