diff options
Diffstat (limited to 'src/video_core/vertex_loader.cpp')
| -rw-r--r-- | src/video_core/vertex_loader.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index bf83b61ca..37c5224a9 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp | |||
| @@ -8,15 +8,15 @@ | |||
| 8 | #include "common/vector_math.h" | 8 | #include "common/vector_math.h" |
| 9 | #include "core/memory.h" | 9 | #include "core/memory.h" |
| 10 | #include "video_core/debug_utils/debug_utils.h" | 10 | #include "video_core/debug_utils/debug_utils.h" |
| 11 | #include "video_core/pica.h" | ||
| 12 | #include "video_core/pica_state.h" | 11 | #include "video_core/pica_state.h" |
| 13 | #include "video_core/pica_types.h" | 12 | #include "video_core/pica_types.h" |
| 13 | #include "video_core/regs_pipeline.h" | ||
| 14 | #include "video_core/shader/shader.h" | 14 | #include "video_core/shader/shader.h" |
| 15 | #include "video_core/vertex_loader.h" | 15 | #include "video_core/vertex_loader.h" |
| 16 | 16 | ||
| 17 | namespace Pica { | 17 | namespace Pica { |
| 18 | 18 | ||
| 19 | void VertexLoader::Setup(const Pica::Regs& regs) { | 19 | void VertexLoader::Setup(const PipelineRegs& regs) { |
| 20 | ASSERT_MSG(!is_setup, "VertexLoader is not intended to be setup more than once."); | 20 | ASSERT_MSG(!is_setup, "VertexLoader is not intended to be setup more than once."); |
| 21 | 21 | ||
| 22 | const auto& attribute_config = regs.vertex_attributes; | 22 | const auto& attribute_config = regs.vertex_attributes; |
| @@ -85,15 +85,16 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, | |||
| 85 | memory_accesses.AddAccess( | 85 | memory_accesses.AddAccess( |
| 86 | source_addr, | 86 | source_addr, |
| 87 | vertex_attribute_elements[i] * | 87 | vertex_attribute_elements[i] * |
| 88 | ((vertex_attribute_formats[i] == Regs::VertexAttributeFormat::FLOAT) | 88 | ((vertex_attribute_formats[i] == PipelineRegs::VertexAttributeFormat::FLOAT) |
| 89 | ? 4 | 89 | ? 4 |
| 90 | : (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::SHORT) | 90 | : (vertex_attribute_formats[i] == |
| 91 | PipelineRegs::VertexAttributeFormat::SHORT) | ||
| 91 | ? 2 | 92 | ? 2 |
| 92 | : 1)); | 93 | : 1)); |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 95 | switch (vertex_attribute_formats[i]) { | 96 | switch (vertex_attribute_formats[i]) { |
| 96 | case Regs::VertexAttributeFormat::BYTE: { | 97 | case PipelineRegs::VertexAttributeFormat::BYTE: { |
| 97 | const s8* srcdata = | 98 | const s8* srcdata = |
| 98 | reinterpret_cast<const s8*>(Memory::GetPhysicalPointer(source_addr)); | 99 | reinterpret_cast<const s8*>(Memory::GetPhysicalPointer(source_addr)); |
| 99 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { | 100 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { |
| @@ -101,7 +102,7 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, | |||
| 101 | } | 102 | } |
| 102 | break; | 103 | break; |
| 103 | } | 104 | } |
| 104 | case Regs::VertexAttributeFormat::UBYTE: { | 105 | case PipelineRegs::VertexAttributeFormat::UBYTE: { |
| 105 | const u8* srcdata = | 106 | const u8* srcdata = |
| 106 | reinterpret_cast<const u8*>(Memory::GetPhysicalPointer(source_addr)); | 107 | reinterpret_cast<const u8*>(Memory::GetPhysicalPointer(source_addr)); |
| 107 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { | 108 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { |
| @@ -109,7 +110,7 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, | |||
| 109 | } | 110 | } |
| 110 | break; | 111 | break; |
| 111 | } | 112 | } |
| 112 | case Regs::VertexAttributeFormat::SHORT: { | 113 | case PipelineRegs::VertexAttributeFormat::SHORT: { |
| 113 | const s16* srcdata = | 114 | const s16* srcdata = |
| 114 | reinterpret_cast<const s16*>(Memory::GetPhysicalPointer(source_addr)); | 115 | reinterpret_cast<const s16*>(Memory::GetPhysicalPointer(source_addr)); |
| 115 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { | 116 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { |
| @@ -117,7 +118,7 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, | |||
| 117 | } | 118 | } |
| 118 | break; | 119 | break; |
| 119 | } | 120 | } |
| 120 | case Regs::VertexAttributeFormat::FLOAT: { | 121 | case PipelineRegs::VertexAttributeFormat::FLOAT: { |
| 121 | const float* srcdata = | 122 | const float* srcdata = |
| 122 | reinterpret_cast<const float*>(Memory::GetPhysicalPointer(source_addr)); | 123 | reinterpret_cast<const float*>(Memory::GetPhysicalPointer(source_addr)); |
| 123 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { | 124 | for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { |