diff options
| author | 2017-01-28 12:34:31 -0800 | |
|---|---|---|
| committer | 2017-02-04 13:59:11 -0800 | |
| commit | 8fca90b5d56892758a98a0ece15b5845009893e3 (patch) | |
| tree | 16cc7c03687ec58c209c90e5d54f34a2eb9dcf74 /src/video_core/vertex_loader.cpp | |
| parent | VideoCore: Split lighting regs from Regs struct (diff) | |
| download | yuzu-8fca90b5d56892758a98a0ece15b5845009893e3.tar.gz yuzu-8fca90b5d56892758a98a0ece15b5845009893e3.tar.xz yuzu-8fca90b5d56892758a98a0ece15b5845009893e3.zip | |
VideoCore: Split geometry pipeline regs from Regs struct
Diffstat (limited to 'src/video_core/vertex_loader.cpp')
| -rw-r--r-- | src/video_core/vertex_loader.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index bf83b61ca..20e2370be 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp | |||
| @@ -16,7 +16,7 @@ | |||
| 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) { |