GL: Respect minimum UBO alignment requirement (#794)
* GL: Respect minimum UBO alignment requirement * Use glBindBufferRange for UBOs * Fix fragment shadergen UBO bindings * Nit
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "opengl.hpp"
|
||||
|
||||
// Information about our OpenGL/OpenGL ES driver that we should keep track of
|
||||
// Stuff like whether specific extensions are supported, and potentially things like OpenGL context information
|
||||
@@ -8,6 +9,9 @@ namespace OpenGL {
|
||||
bool supportsExtFbFetch = false;
|
||||
bool supportsArmFbFetch = false;
|
||||
|
||||
// Minimum alignment for UBO offsets. Fetched by the OpenGL renderer using glGetIntegerV.
|
||||
GLuint uboAlignment = 16;
|
||||
|
||||
bool supportFbFetch() const { return supportsExtFbFetch || supportsArmFbFetch; }
|
||||
};
|
||||
} // namespace OpenGL
|
||||
@@ -101,6 +101,9 @@ class RendererGL final : public Renderer {
|
||||
std::unique_ptr<StreamBuffer> hwVertexBuffer;
|
||||
std::unique_ptr<StreamBuffer> hwIndexBuffer;
|
||||
|
||||
// Current offset for our hw shader uniform UBO
|
||||
u32 hwShaderUniformUBOOffset = 0;
|
||||
|
||||
// Cache of fixed attribute values so that we don't do any duplicate updates
|
||||
std::array<std::array<float, 4>, 16> fixedAttrValues;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user