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:
committed by
Bart Louwers
parent
107a4ef467
commit
3122f81328
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user