diff options
| author | Pokechu22 <pokechu022@gmail.com> | 2022-11-28 20:18:17 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-28 20:18:17 -0800 |
| commit | 421af09b1eda251c56027a52d4263536826db98b (patch) | |
| tree | 11ddd54fec93582e56abae1eaa079c95a375fcc5 /Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp | |
| parent | 44f8b8c1007f2ead8530d53c4aca3df8fee6d6af (diff) | |
| parent | e3cc42069f00911933f1c246873c017987690921 (diff) | |
Merge pull request #11279 from tellowkrinkle/GlobalStateIsGreat
VideoBackends:OGL: Creating vertex formats shouldn't unbind anything
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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() |
