mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-30 02:32:46 +01:00
Pica/CommandProcessor: Add a safety check for invalid (?) GPU configurations.
This commit is contained in:
parent
1e960e9ee2
commit
346012f29e
1 changed files with 7 additions and 0 deletions
|
@ -110,6 +110,13 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
|
||||||
for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) {
|
for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) {
|
||||||
for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) {
|
for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) {
|
||||||
const u8* srcdata = Memory::GetPointer(PAddrToVAddr(vertex_attribute_sources[i] + vertex_attribute_strides[i] * vertex + comp * vertex_attribute_element_size[i]));
|
const u8* srcdata = Memory::GetPointer(PAddrToVAddr(vertex_attribute_sources[i] + vertex_attribute_strides[i] * vertex + comp * vertex_attribute_element_size[i]));
|
||||||
|
|
||||||
|
// TODO(neobrain): Ocarina of Time 3D has GetNumTotalAttributes return 8,
|
||||||
|
// yet only provides 2 valid source data addresses. Need to figure out
|
||||||
|
// what's wrong there, until then we just continue when address lookup fails
|
||||||
|
if (srcdata == nullptr)
|
||||||
|
continue;
|
||||||
|
|
||||||
const float srcval = (vertex_attribute_formats[i] == 0) ? *(s8*)srcdata :
|
const float srcval = (vertex_attribute_formats[i] == 0) ? *(s8*)srcdata :
|
||||||
(vertex_attribute_formats[i] == 1) ? *(u8*)srcdata :
|
(vertex_attribute_formats[i] == 1) ? *(u8*)srcdata :
|
||||||
(vertex_attribute_formats[i] == 2) ? *(s16*)srcdata :
|
(vertex_attribute_formats[i] == 2) ? *(s16*)srcdata :
|
||||||
|
|
Loading…
Reference in a new issue