summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-08-12 03:36:40 +0200
committerSubv <subv2112@gmail.com>2018-08-12 03:36:40 +0200
commit2dad1204e857259e65e50880c7416606c8382b2d (patch)
tree1dd40e5540b56198fc64437eacdbdc2981396f82
parentMerge pull request #1010 from bunnei/unk-vert-attrib-shader (diff)
downloadyuzu-2dad1204e857259e65e50880c7416606c8382b2d.tar
yuzu-2dad1204e857259e65e50880c7416606c8382b2d.tar.gz
yuzu-2dad1204e857259e65e50880c7416606c8382b2d.tar.bz2
yuzu-2dad1204e857259e65e50880c7416606c8382b2d.tar.lz
yuzu-2dad1204e857259e65e50880c7416606c8382b2d.tar.xz
yuzu-2dad1204e857259e65e50880c7416606c8382b2d.tar.zst
yuzu-2dad1204e857259e65e50880c7416606c8382b2d.zip
-rw-r--r--src/video_core/engines/maxwell_3d.h5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 0506ac8fe..d795323b0 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -93,6 +93,7 @@ public:
struct VertexAttribute {
enum class Size : u32 {
+ Invalid = 0x0,
Size_32_32_32_32 = 0x01,
Size_32_32_32 = 0x02,
Size_16_16_16_16 = 0x03,
@@ -257,6 +258,10 @@ public:
bool IsNormalized() const {
return (type == Type::SignedNorm) || (type == Type::UnsignedNorm);
}
+
+ bool IsValid() const {
+ return size != Size::Invalid;
+ }
};
enum class PrimitiveTopology : u32 {
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<u8*, GLintptr> 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);