Merge pull request #749 from lioncash/consistency

gpu: Rename Get3DEngine() to Maxwell3D()
This commit is contained in:
bunnei 2018-07-21 10:51:00 -07:00 committed by GitHub
commit 552aac7e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 14 deletions

View File

@ -20,7 +20,11 @@ GPU::GPU() {
GPU::~GPU() = default; GPU::~GPU() = default;
const Tegra::Engines::Maxwell3D& GPU::Get3DEngine() const { const Engines::Maxwell3D& GPU::Maxwell3D() const {
return *maxwell_3d;
}
Engines::Maxwell3D& GPU::Maxwell3D() {
return *maxwell_3d; return *maxwell_3d;
} }

View File

@ -93,15 +93,14 @@ public:
/// Processes a command list stored at the specified address in GPU memory. /// Processes a command list stored at the specified address in GPU memory.
void ProcessCommandList(GPUVAddr address, u32 size); void ProcessCommandList(GPUVAddr address, u32 size);
/// Returns a const reference to the Maxwell3D GPU engine.
const Engines::Maxwell3D& Maxwell3D() const;
/// Returns a reference to the Maxwell3D GPU engine. /// Returns a reference to the Maxwell3D GPU engine.
const Engines::Maxwell3D& Get3DEngine() const; Engines::Maxwell3D& Maxwell3D();
std::unique_ptr<MemoryManager> memory_manager; std::unique_ptr<MemoryManager> memory_manager;
Engines::Maxwell3D& Maxwell3D() {
return *maxwell_3d;
}
private: private:
/// Writes a single register in the engine bound to the specified subchannel /// Writes a single register in the engine bound to the specified subchannel
void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params); void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params);

View File

@ -634,8 +634,8 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(const Tegra::Texture::TSCEntr
u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint program, u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint program,
u32 current_bindpoint, u32 current_bindpoint,
const std::vector<GLShader::ConstBufferEntry>& entries) { const std::vector<GLShader::ConstBufferEntry>& entries) {
auto& gpu = Core::System::GetInstance().GPU(); const auto& gpu = Core::System::GetInstance().GPU();
auto& maxwell3d = gpu.Get3DEngine(); const auto& maxwell3d = gpu.Maxwell3D();
// Reset all buffer draw state for this stage. // Reset all buffer draw state for this stage.
for (auto& buffer : state.draw.const_buffers[static_cast<size_t>(stage)]) { for (auto& buffer : state.draw.const_buffers[static_cast<size_t>(stage)]) {
@ -644,7 +644,7 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
} }
// Upload only the enabled buffers from the 16 constbuffers of each shader stage // Upload only the enabled buffers from the 16 constbuffers of each shader stage
auto& shader_stage = maxwell3d.state.shader_stages[static_cast<size_t>(stage)]; const auto& shader_stage = maxwell3d.state.shader_stages[static_cast<size_t>(stage)];
for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) {
const auto& used_buffer = entries[bindpoint]; const auto& used_buffer = entries[bindpoint];
@ -700,8 +700,8 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, u32 current_unit, u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, u32 current_unit,
const std::vector<GLShader::SamplerEntry>& entries) { const std::vector<GLShader::SamplerEntry>& entries) {
auto& gpu = Core::System::GetInstance().GPU(); const auto& gpu = Core::System::GetInstance().GPU();
auto& maxwell3d = gpu.Get3DEngine(); const auto& maxwell3d = gpu.Maxwell3D();
ASSERT_MSG(current_unit + entries.size() <= std::size(state.texture_units), ASSERT_MSG(current_unit + entries.size() <= std::size(state.texture_units),
"Exceeded the number of active textures."); "Exceeded the number of active textures.");

View File

@ -336,8 +336,8 @@ void GraphicsSurfaceWidget::OnUpdate() {
// TODO: Store a reference to the registers in the debug context instead of accessing them // TODO: Store a reference to the registers in the debug context instead of accessing them
// directly... // directly...
auto& registers = gpu.Get3DEngine().regs; const auto& registers = gpu.Maxwell3D().regs;
auto& rt = registers.rt[static_cast<size_t>(surface_source) - const auto& rt = registers.rt[static_cast<size_t>(surface_source) -
static_cast<size_t>(Source::RenderTarget0)]; static_cast<size_t>(Source::RenderTarget0)];
surface_address = rt.Address(); surface_address = rt.Address();