summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-12-16 00:01:08 +0100
committerGravatar Tony Wasserka2014-12-20 18:06:54 +0100
commit346012f29e244489681d2cdf2cf6291d04fbed33 (patch)
tree66b4818f362957699106d6c854f96517eaeb1162 /src
parentPica/CommandProcessor: Fix vertex decoding if multiple memory areas are acces... (diff)
downloadyuzu-346012f29e244489681d2cdf2cf6291d04fbed33.tar.gz
yuzu-346012f29e244489681d2cdf2cf6291d04fbed33.tar.xz
yuzu-346012f29e244489681d2cdf2cf6291d04fbed33.zip
Pica/CommandProcessor: Add a safety check for invalid (?) GPU configurations.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/command_processor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index d4559fad6..d8bddd569 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -110,6 +110,13 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
110 for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) { 110 for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) {
111 for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { 111 for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) {
112 const u8* srcdata = Memory::GetPointer(PAddrToVAddr(vertex_attribute_sources[i] + vertex_attribute_strides[i] * vertex + comp * vertex_attribute_element_size[i])); 112 const u8* srcdata = Memory::GetPointer(PAddrToVAddr(vertex_attribute_sources[i] + vertex_attribute_strides[i] * vertex + comp * vertex_attribute_element_size[i]));
113
114 // TODO(neobrain): Ocarina of Time 3D has GetNumTotalAttributes return 8,
115 // yet only provides 2 valid source data addresses. Need to figure out
116 // what's wrong there, until then we just continue when address lookup fails
117 if (srcdata == nullptr)
118 continue;
119
113 const float srcval = (vertex_attribute_formats[i] == 0) ? *(s8*)srcdata : 120 const float srcval = (vertex_attribute_formats[i] == 0) ? *(s8*)srcdata :
114 (vertex_attribute_formats[i] == 1) ? *(u8*)srcdata : 121 (vertex_attribute_formats[i] == 1) ? *(u8*)srcdata :
115 (vertex_attribute_formats[i] == 2) ? *(s16*)srcdata : 122 (vertex_attribute_formats[i] == 2) ? *(s16*)srcdata :