GPUBatch: GL backend isolation

This changes the drawing paradigm a bit. The VAO configuration is done
JIT-style and depends on context active shader.

This is to allow more flexibility for implementations to do optimization
at lower level.

The vao cache is now its own class to isolate the concept. It is this
class that is reference by the GLContext for ownership of the containing
VAO ids.
This commit is contained in:
2020-08-11 01:31:40 +02:00
parent 47bfb0f7ad
commit efc97b3919
15 changed files with 626 additions and 496 deletions

View File

@@ -0,0 +1,44 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2020 Blender Foundation.
* All rights reserved.
*/
/** \file
* \ingroup gpu
*/
#pragma once
#include "glew-mx.h"
#include "GPU_batch.h"
#include "GPU_shader_interface.h"
namespace blender {
namespace gpu {
namespace GLVertArray {
void update_bindings(const GLuint vao,
const GPUBatch *batch,
const GPUShaderInterface *interface,
const int base_instance);
} // namespace GLVertArray
} // namespace gpu
} // namespace blender