GL: Actually upload data to stream buffers

This commit is contained in:
wheremyfoodat 2024-08-25 03:49:07 +03:00
parent e34bdb6841
commit f96b609123
5 changed files with 46 additions and 27 deletions

View file

@ -11,15 +11,16 @@ namespace PICA {
struct AttributeInfo {
u8* data;
u32 offset;
u32 size;
u8 type;
u8 componentCount;
bool fixed;
bool isPadding;
std::array<float, 4> fixedValue; // For fixed attributes
};
u8* vertexBuffer;
u8* indexBuffer;
// Minimum and maximum index in the index buffer for a draw call
@ -31,5 +32,6 @@ namespace PICA {
bool canBeAccelerated;
bool indexed;
bool useShortIndices;
};
} // namespace PICA

View file

@ -38,7 +38,6 @@ struct GLStateManager {
GLuint stencilMask;
GLuint boundVAO;
GLuint boundVBO;
GLuint currentProgram;
GLuint boundUBO;
@ -173,13 +172,6 @@ struct GLStateManager {
}
}
void bindVBO(GLuint handle) {
if (boundVBO != handle) {
boundVBO = handle;
glBindBuffer(GL_ARRAY_BUFFER, handle);
}
}
void useProgram(GLuint handle) {
if (currentProgram != handle) {
currentProgram = handle;
@ -195,7 +187,6 @@ struct GLStateManager {
}
void bindVAO(const OpenGL::VertexArray& vao) { bindVAO(vao.handle()); }
void bindVBO(const OpenGL::VertexBuffer& vbo) { bindVBO(vbo.handle()); }
void useProgram(const OpenGL::Program& program) { useProgram(program.handle()); }
void setColourMask(bool r, bool g, bool b, bool a) {