From 2dad1204e857259e65e50880c7416606c8382b2d Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 11 Aug 2018 20:36:40 -0500 Subject: RasterizerGL: Ignore invalid/unset vertex attributes. This should make the es2gears example not crash anymore. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/video_core/renderer_opengl') diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 8360feb5d..3646a1b1b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -161,11 +161,16 @@ std::pair RasterizerOpenGL::SetupVertexArrays(u8* array_ptr, // assume every shader uses them all. for (unsigned index = 0; index < 16; ++index) { auto& attrib = regs.vertex_attrib_format[index]; + + // Ignore invalid attributes. + if (!attrib.IsValid()) + continue; + + auto& buffer = regs.vertex_array[attrib.buffer]; LOG_TRACE(HW_GPU, "vertex attrib {}, count={}, size={}, type={}, offset={}, normalize={}", index, attrib.ComponentCount(), attrib.SizeString(), attrib.TypeString(), attrib.offset.Value(), attrib.IsNormalized()); - auto& buffer = regs.vertex_array[attrib.buffer]; ASSERT(buffer.IsEnabled()); glEnableVertexAttribArray(index); -- cgit v1.2.3