diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index daceb05f47..c115dabe1c 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp @@ -504,8 +504,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { } } if (info.uses_render_area) { - const auto render_area_width(static_cast(regs.render_area.width)); - const auto render_area_height(static_cast(regs.render_area.height)); + const auto render_area_width(static_cast(regs.surface_clip.width)); + const auto render_area_height(static_cast(regs.surface_clip.height)); if (use_assembly) { glProgramLocalParameter4fARB(AssemblyStage(stage), 1, render_area_width, render_area_height, 0.0f, 0.0f); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 79d7908d4e..72e314d39a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -618,11 +618,11 @@ void RasterizerOpenGL::SyncViewport() { } flags[Dirty::Viewport0 + index] = false; - if (!regs.viewport_transform_enabled) { - const auto x = static_cast(regs.render_area.x); - const auto y = static_cast(regs.render_area.y); - const auto width = static_cast(regs.render_area.width); - const auto height = static_cast(regs.render_area.height); + if (!regs.viewport_scale_offset_enbled) { + const auto x = static_cast(regs.surface_clip.x); + const auto y = static_cast(regs.surface_clip.y); + const auto width = static_cast(regs.surface_clip.width); + const auto height = static_cast(regs.surface_clip.height); glViewportIndexedf(static_cast(index), x, y, width != 0.0f ? width : 1.0f, height != 0.0f ? height : 1.0f); continue; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index b4372a839e..81b6c372d5 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -444,8 +444,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { const auto& info{stage_infos[0]}; if (info.uses_render_area) { render_area.uses_render_area = true; - render_area.words = {static_cast(regs.render_area.width), - static_cast(regs.render_area.height)}; + render_area.words = {static_cast(regs.surface_clip.width), + static_cast(regs.surface_clip.height)}; } }}; if constexpr (Spec::enabled_stages[0]) { diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 5af3c930ba..f79fa8313f 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -683,11 +683,11 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D::Regs& reg if (!state_tracker.TouchViewports()) { return; } - if (!regs.viewport_transform_enabled) { - const auto x = static_cast(regs.render_area.x); - const auto y = static_cast(regs.render_area.y); - const auto width = static_cast(regs.render_area.width); - const auto height = static_cast(regs.render_area.height); + if (!regs.viewport_scale_offset_enbled) { + const auto x = static_cast(regs.surface_clip.x); + const auto y = static_cast(regs.surface_clip.y); + const auto width = static_cast(regs.surface_clip.width); + const auto height = static_cast(regs.surface_clip.height); VkViewport viewport{ .x = x, .y = y, diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp index 997e71249e..37bb76b726 100644 --- a/src/video_core/shader_environment.cpp +++ b/src/video_core/shader_environment.cpp @@ -332,8 +332,9 @@ u32 GraphicsEnvironment::ReadCbufValue(u32 cbuf_index, u32 cbuf_offset) { Shader::TextureType GraphicsEnvironment::ReadTextureType(u32 handle) { const auto& regs{maxwell3d->regs}; - const bool via_header_index{regs.sampler_index == Maxwell::SamplerIndex::ViaHeaderIndex}; - auto entry = ReadTextureInfo(regs.tic.Address(), regs.tic.limit, via_header_index, handle); + const bool via_header_index{regs.sampler_binding == Maxwell::SamplerBinding::ViaHeaderBinding}; + auto entry = + ReadTextureInfo(regs.tex_header.Address(), regs.tex_header.limit, via_header_index, handle); const Shader::TextureType result{ConvertTextureType(entry)}; texture_types.emplace(handle, result); return result; @@ -341,8 +342,9 @@ Shader::TextureType GraphicsEnvironment::ReadTextureType(u32 handle) { Shader::TexturePixelFormat GraphicsEnvironment::ReadTexturePixelFormat(u32 handle) { const auto& regs{maxwell3d->regs}; - const bool via_header_index{regs.sampler_index == Maxwell::SamplerIndex::ViaHeaderIndex}; - auto entry = ReadTextureInfo(regs.tic.Address(), regs.tic.limit, via_header_index, handle); + const bool via_header_index{regs.sampler_binding == Maxwell::SamplerBinding::ViaHeaderBinding}; + auto entry = + ReadTextureInfo(regs.tex_header.Address(), regs.tex_header.limit, via_header_index, handle); const Shader::TexturePixelFormat result(ConvertTexturePixelFormat(entry)); texture_pixel_formats.emplace(handle, result); return result; @@ -350,7 +352,7 @@ Shader::TexturePixelFormat GraphicsEnvironment::ReadTexturePixelFormat(u32 handl u32 GraphicsEnvironment::ReadViewportTransformState() { const auto& regs{maxwell3d->regs}; - viewport_transform_state = regs.viewport_transform_enabled; + viewport_transform_state = regs.viewport_scale_offset_enbled; return viewport_transform_state; } diff --git a/src/video_core/shader_environment.h b/src/video_core/shader_environment.h index e43764c87c..bb55b029fe 100644 --- a/src/video_core/shader_environment.h +++ b/src/video_core/shader_environment.h @@ -131,7 +131,6 @@ public: u32 ReadViewportTransformState() override; - private: Tegra::Engines::KeplerCompute* kepler_compute{}; }; @@ -156,7 +155,7 @@ public: [[nodiscard]] Shader::TextureType ReadTextureType(u32 handle) override; [[nodiscard]] Shader::TexturePixelFormat ReadTexturePixelFormat(u32 handle) override; - + [[nodiscard]] u32 ReadViewportTransformState() override; [[nodiscard]] u32 LocalMemorySize() const override;