From e3cc42069f00911933f1c246873c017987690921 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Tue, 15 Nov 2022 00:38:24 -0600 Subject: VideoBackends:OGL: Creating vertex formats shouldn't unbind anything --- Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp') diff --git a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp index 16bcabab4b..b77755bb12 100644 --- a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp @@ -59,7 +59,6 @@ GLVertexFormat::GLVertexFormat(const PortableVertexDeclaration& vtx_decl) glGenVertexArrays(1, &VAO); glBindVertexArray(VAO); - ProgramShaderCache::BindVertexFormat(this); // the element buffer is bound directly to the vao, so we must it set for every vao glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vm->GetIndexBufferHandle()); @@ -77,6 +76,9 @@ GLVertexFormat::GLVertexFormat(const PortableVertexDeclaration& vtx_decl) SetPointer(ShaderAttrib::TexCoord0 + i, vertex_stride, vtx_decl.texcoords[i]); SetPointer(ShaderAttrib::PositionMatrix, vertex_stride, vtx_decl.posmtx); + + // Other code shouldn't have to worry about its vertex formats being randomly unbound + ProgramShaderCache::ReBindVertexFormat(); } GLVertexFormat::~GLVertexFormat() -- cgit v1.2.3