@@ -231,6 +231,10 @@ void WrappedOpenGL::CopyDepthTex2DMSToArray(GLuint &destArray, GLuint srcMS, GLi
231
231
GLRenderState rs;
232
232
rs.FetchState (this );
233
233
234
+ GLuint vao = 0 ;
235
+ drv.glGenVertexArrays (1 , &vao);
236
+ drv.glBindVertexArray (vao);
237
+
234
238
GLuint texs[3 ];
235
239
drv.glGenTextures (3 , texs);
236
240
drv.glTextureView (texs[0 ], eGL_TEXTURE_2D_ARRAY, destArray, intFormat, 0 , 1 , 0 ,
@@ -331,10 +335,11 @@ void WrappedOpenGL::CopyDepthTex2DMSToArray(GLuint &destArray, GLuint srcMS, GLi
331
335
}
332
336
}
333
337
338
+ rs.ApplyState (this );
339
+
340
+ drv.glDeleteVertexArrays (1 , &vao);
334
341
drv.glDeleteFramebuffers (1 , &fbo);
335
342
drv.glDeleteTextures (3 , texs);
336
-
337
- rs.ApplyState (this );
338
343
}
339
344
340
345
void WrappedOpenGL::CopyArrayToTex2DMS (GLuint destMS, GLuint srcArray, GLint width, GLint height,
@@ -464,6 +469,10 @@ void WrappedOpenGL::CopyDepthArrayToTex2DMS(GLuint destMS, GLuint srcArray, GLin
464
469
GLRenderState rs;
465
470
rs.FetchState (this );
466
471
472
+ GLuint vao = 0 ;
473
+ drv.glGenVertexArrays (1 , &vao);
474
+ drv.glBindVertexArray (vao);
475
+
467
476
GLuint texs[3 ];
468
477
drv.glGenTextures (3 , texs);
469
478
drv.glTextureView (texs[0 ], eGL_TEXTURE_2D_MULTISAMPLE_ARRAY, destMS, intFormat, 0 , 1 , 0 , arraySize);
@@ -571,8 +580,9 @@ void WrappedOpenGL::CopyDepthArrayToTex2DMS(GLuint destMS, GLuint srcArray, GLin
571
580
}
572
581
}
573
582
583
+ rs.ApplyState (this );
584
+
585
+ drv.glDeleteVertexArrays (1 , &vao);
574
586
drv.glDeleteFramebuffers (1 , &fbo);
575
587
drv.glDeleteTextures (3 , texs);
576
-
577
- rs.ApplyState (this );
578
588
}
0 commit comments