summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/command_processor.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 33414258a..4b59984ad 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -200,7 +200,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
200 for (int loader = 0; loader < 12; ++loader) { 200 for (int loader = 0; loader < 12; ++loader) {
201 const auto& loader_config = attribute_config.attribute_loaders[loader]; 201 const auto& loader_config = attribute_config.attribute_loaders[loader];
202 202
203 u32 load_address = base_address + loader_config.data_offset; 203 u32 offset = 0;
204 204
205 // TODO: What happens if a loader overwrites a previous one's data? 205 // TODO: What happens if a loader overwrites a previous one's data?
206 for (unsigned component = 0; component < loader_config.component_count; ++component) { 206 for (unsigned component = 0; component < loader_config.component_count; ++component) {
@@ -212,17 +212,17 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
212 u32 attribute_index = loader_config.GetComponent(component); 212 u32 attribute_index = loader_config.GetComponent(component);
213 if (attribute_index < 12) { 213 if (attribute_index < 12) {
214 int element_size = attribute_config.GetElementSizeInBytes(attribute_index); 214 int element_size = attribute_config.GetElementSizeInBytes(attribute_index);
215 load_address = Common::AlignUp(load_address, element_size); 215 offset = Common::AlignUp(offset, element_size);
216 vertex_attribute_sources[attribute_index] = load_address; 216 vertex_attribute_sources[attribute_index] = base_address + loader_config.data_offset + offset;
217 vertex_attribute_strides[attribute_index] = static_cast<u32>(loader_config.byte_count); 217 vertex_attribute_strides[attribute_index] = static_cast<u32>(loader_config.byte_count);
218 vertex_attribute_formats[attribute_index] = attribute_config.GetFormat(attribute_index); 218 vertex_attribute_formats[attribute_index] = attribute_config.GetFormat(attribute_index);
219 vertex_attribute_elements[attribute_index] = attribute_config.GetNumElements(attribute_index); 219 vertex_attribute_elements[attribute_index] = attribute_config.GetNumElements(attribute_index);
220 vertex_attribute_element_size[attribute_index] = element_size; 220 vertex_attribute_element_size[attribute_index] = element_size;
221 load_address += attribute_config.GetStride(attribute_index); 221 offset += attribute_config.GetStride(attribute_index);
222 } else if (attribute_index < 16) { 222 } else if (attribute_index < 16) {
223 // Attribute ids 12, 13, 14 and 15 signify 4, 8, 12 and 16-byte paddings, respectively 223 // Attribute ids 12, 13, 14 and 15 signify 4, 8, 12 and 16-byte paddings, respectively
224 load_address = Common::AlignUp(load_address, 4); 224 offset = Common::AlignUp(offset, 4);
225 load_address += (attribute_index - 11) * 4; 225 offset += (attribute_index - 11) * 4;
226 } else { 226 } else {
227 UNREACHABLE(); // This is truly unreachable due to the number of bits for each component 227 UNREACHABLE(); // This is truly unreachable due to the number of bits for each component
228 } 228 }