diff options
Diffstat (limited to 'src/video_core/dirty_flags.cpp')
| -rw-r--r-- | src/video_core/dirty_flags.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/video_core/dirty_flags.cpp b/src/video_core/dirty_flags.cpp index b1eaac00c..7149af290 100644 --- a/src/video_core/dirty_flags.cpp +++ b/src/video_core/dirty_flags.cpp | |||
| @@ -12,13 +12,30 @@ | |||
| 12 | #define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / (sizeof(u32))) | 12 | #define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / (sizeof(u32))) |
| 13 | 13 | ||
| 14 | namespace VideoCommon::Dirty { | 14 | namespace VideoCommon::Dirty { |
| 15 | 15 | namespace { | |
| 16 | using Tegra::Engines::Maxwell3D; | 16 | using Tegra::Engines::Maxwell3D; |
| 17 | 17 | ||
| 18 | void SetupDirtyRenderTargets(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables) { | 18 | void SetupDirtyVertexBuffers(Maxwell3D::DirtyState::Tables& tables) { |
| 19 | static constexpr std::size_t num_array = 3; | ||
| 20 | for (std::size_t i = 0; i < Maxwell3D::Regs::NumVertexArrays; ++i) { | ||
| 21 | const std::size_t array_offset = OFF(vertex_array) + i * NUM(vertex_array[0]); | ||
| 22 | const std::size_t limit_offset = OFF(vertex_array_limit) + i * NUM(vertex_array_limit[0]); | ||
| 23 | |||
| 24 | FillBlock(tables, array_offset, num_array, VertexBuffer0 + i, VertexBuffers); | ||
| 25 | FillBlock(tables, limit_offset, NUM(vertex_array_limit), VertexBuffer0 + i, VertexBuffers); | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | void SetupIndexBuffer(Maxwell3D::DirtyState::Tables& tables) { | ||
| 30 | FillBlock(tables[0], OFF(index_array), NUM(index_array), IndexBuffer); | ||
| 31 | } | ||
| 32 | |||
| 33 | void SetupDirtyDescriptors(Maxwell3D::DirtyState::Tables& tables) { | ||
| 19 | FillBlock(tables[0], OFF(tic), NUM(tic), Descriptors); | 34 | FillBlock(tables[0], OFF(tic), NUM(tic), Descriptors); |
| 20 | FillBlock(tables[0], OFF(tsc), NUM(tsc), Descriptors); | 35 | FillBlock(tables[0], OFF(tsc), NUM(tsc), Descriptors); |
| 36 | } | ||
| 21 | 37 | ||
| 38 | void SetupDirtyRenderTargets(Maxwell3D::DirtyState::Tables& tables) { | ||
| 22 | static constexpr std::size_t num_per_rt = NUM(rt[0]); | 39 | static constexpr std::size_t num_per_rt = NUM(rt[0]); |
| 23 | static constexpr std::size_t begin = OFF(rt); | 40 | static constexpr std::size_t begin = OFF(rt); |
| 24 | static constexpr std::size_t num = num_per_rt * Maxwell3D::Regs::NumRenderTargets; | 41 | static constexpr std::size_t num = num_per_rt * Maxwell3D::Regs::NumRenderTargets; |
| @@ -41,5 +58,13 @@ void SetupDirtyRenderTargets(Tegra::Engines::Maxwell3D::DirtyState::Tables& tabl | |||
| 41 | FillBlock(table, OFF(zeta), NUM(zeta), flag); | 58 | FillBlock(table, OFF(zeta), NUM(zeta), flag); |
| 42 | } | 59 | } |
| 43 | } | 60 | } |
| 61 | } // Anonymous namespace | ||
| 62 | |||
| 63 | void SetupDirtyFlags(Maxwell3D::DirtyState::Tables& tables) { | ||
| 64 | SetupDirtyVertexBuffers(tables); | ||
| 65 | SetupIndexBuffer(tables); | ||
| 66 | SetupDirtyDescriptors(tables); | ||
| 67 | SetupDirtyRenderTargets(tables); | ||
| 68 | } | ||
| 44 | 69 | ||
| 45 | } // namespace VideoCommon::Dirty | 70 | } // namespace VideoCommon::Dirty |