diff options
| author | 2019-02-26 22:47:49 -0500 | |
|---|---|---|
| committer | 2019-02-27 03:38:39 -0500 | |
| commit | b9238edd0d0bfa7c88ad81ef00347b5194ebed77 (patch) | |
| tree | 73cbfa304b41edc3fc92f7b8e9bfb8832f701d49 /src/video_core | |
| parent | common/vector_math: Move Vec[x] types into the Common namespace (diff) | |
| download | yuzu-b9238edd0d0bfa7c88ad81ef00347b5194ebed77.tar.gz yuzu-b9238edd0d0bfa7c88ad81ef00347b5194ebed77.tar.xz yuzu-b9238edd0d0bfa7c88ad81ef00347b5194ebed77.zip | |
common/math_util: Move contents into the Common namespace
These types are within the common library, so they should be within the
Common namespace.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 2 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 2 | ||||
| -rw-r--r-- | src/video_core/rasterizer_interface.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 4 |
9 files changed, 23 insertions, 23 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index ec1a57226..540dcc52c 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp | |||
| @@ -44,10 +44,10 @@ void Fermi2D::HandleSurfaceCopy() { | |||
| 44 | const u32 src_blit_y2{ | 44 | const u32 src_blit_y2{ |
| 45 | static_cast<u32>((regs.blit_src_y + (regs.blit_dst_height * regs.blit_dv_dy)) >> 32)}; | 45 | static_cast<u32>((regs.blit_src_y + (regs.blit_dst_height * regs.blit_dv_dy)) >> 32)}; |
| 46 | 46 | ||
| 47 | const MathUtil::Rectangle<u32> src_rect{src_blit_x1, src_blit_y1, src_blit_x2, src_blit_y2}; | 47 | const Common::Rectangle<u32> src_rect{src_blit_x1, src_blit_y1, src_blit_x2, src_blit_y2}; |
| 48 | const MathUtil::Rectangle<u32> dst_rect{regs.blit_dst_x, regs.blit_dst_y, | 48 | const Common::Rectangle<u32> dst_rect{regs.blit_dst_x, regs.blit_dst_y, |
| 49 | regs.blit_dst_x + regs.blit_dst_width, | 49 | regs.blit_dst_x + regs.blit_dst_width, |
| 50 | regs.blit_dst_y + regs.blit_dst_height}; | 50 | regs.blit_dst_y + regs.blit_dst_height}; |
| 51 | 51 | ||
| 52 | if (!rasterizer.AccelerateSurfaceCopy(regs.src, regs.dst, src_rect, dst_rect)) { | 52 | if (!rasterizer.AccelerateSurfaceCopy(regs.src, regs.dst, src_rect, dst_rect)) { |
| 53 | UNIMPLEMENTED(); | 53 | UNIMPLEMENTED(); |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 0e3873ffd..584f51c48 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -503,7 +503,7 @@ public: | |||
| 503 | f32 translate_z; | 503 | f32 translate_z; |
| 504 | INSERT_PADDING_WORDS(2); | 504 | INSERT_PADDING_WORDS(2); |
| 505 | 505 | ||
| 506 | MathUtil::Rectangle<s32> GetRect() const { | 506 | Common::Rectangle<s32> GetRect() const { |
| 507 | return { | 507 | return { |
| 508 | GetX(), // left | 508 | GetX(), // left |
| 509 | GetY() + GetHeight(), // top | 509 | GetY() + GetHeight(), // top |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 0f5bfdcbf..6313702f2 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -100,7 +100,7 @@ struct FramebufferConfig { | |||
| 100 | 100 | ||
| 101 | using TransformFlags = Service::NVFlinger::BufferQueue::BufferTransformFlags; | 101 | using TransformFlags = Service::NVFlinger::BufferQueue::BufferTransformFlags; |
| 102 | TransformFlags transform_flags; | 102 | TransformFlags transform_flags; |
| 103 | MathUtil::Rectangle<int> crop_rect; | 103 | Common::Rectangle<int> crop_rect; |
| 104 | }; | 104 | }; |
| 105 | 105 | ||
| 106 | namespace Engines { | 106 | namespace Engines { |
diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index b2a223705..6a1dc9cf6 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h | |||
| @@ -47,8 +47,8 @@ public: | |||
| 47 | /// Attempt to use a faster method to perform a surface copy | 47 | /// Attempt to use a faster method to perform a surface copy |
| 48 | virtual bool AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, | 48 | virtual bool AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, |
| 49 | const Tegra::Engines::Fermi2D::Regs::Surface& dst, | 49 | const Tegra::Engines::Fermi2D::Regs::Surface& dst, |
| 50 | const MathUtil::Rectangle<u32>& src_rect, | 50 | const Common::Rectangle<u32>& src_rect, |
| 51 | const MathUtil::Rectangle<u32>& dst_rect) { | 51 | const Common::Rectangle<u32>& dst_rect) { |
| 52 | return false; | 52 | return false; |
| 53 | } | 53 | } |
| 54 | 54 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 12d876120..09fa01d25 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -779,8 +779,8 @@ void RasterizerOpenGL::FlushAndInvalidateRegion(VAddr addr, u64 size) { | |||
| 779 | 779 | ||
| 780 | bool RasterizerOpenGL::AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, | 780 | bool RasterizerOpenGL::AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, |
| 781 | const Tegra::Engines::Fermi2D::Regs::Surface& dst, | 781 | const Tegra::Engines::Fermi2D::Regs::Surface& dst, |
| 782 | const MathUtil::Rectangle<u32>& src_rect, | 782 | const Common::Rectangle<u32>& src_rect, |
| 783 | const MathUtil::Rectangle<u32>& dst_rect) { | 783 | const Common::Rectangle<u32>& dst_rect) { |
| 784 | MICROPROFILE_SCOPE(OpenGL_Blits); | 784 | MICROPROFILE_SCOPE(OpenGL_Blits); |
| 785 | res_cache.FermiCopySurface(src, dst, src_rect, dst_rect); | 785 | res_cache.FermiCopySurface(src, dst, src_rect, dst_rect); |
| 786 | return true; | 786 | return true; |
| @@ -1034,7 +1034,7 @@ void RasterizerOpenGL::SyncViewport(OpenGLState& current_state) { | |||
| 1034 | for (std::size_t i = 0; i < viewport_count; i++) { | 1034 | for (std::size_t i = 0; i < viewport_count; i++) { |
| 1035 | auto& viewport = current_state.viewports[i]; | 1035 | auto& viewport = current_state.viewports[i]; |
| 1036 | const auto& src = regs.viewports[i]; | 1036 | const auto& src = regs.viewports[i]; |
| 1037 | const MathUtil::Rectangle<s32> viewport_rect{regs.viewport_transform[i].GetRect()}; | 1037 | const Common::Rectangle<s32> viewport_rect{regs.viewport_transform[i].GetRect()}; |
| 1038 | viewport.x = viewport_rect.left; | 1038 | viewport.x = viewport_rect.left; |
| 1039 | viewport.y = viewport_rect.bottom; | 1039 | viewport.y = viewport_rect.bottom; |
| 1040 | viewport.width = viewport_rect.GetWidth(); | 1040 | viewport.width = viewport_rect.GetWidth(); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 258d62259..2f0524f85 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -62,8 +62,8 @@ public: | |||
| 62 | void FlushAndInvalidateRegion(VAddr addr, u64 size) override; | 62 | void FlushAndInvalidateRegion(VAddr addr, u64 size) override; |
| 63 | bool AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, | 63 | bool AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, |
| 64 | const Tegra::Engines::Fermi2D::Regs::Surface& dst, | 64 | const Tegra::Engines::Fermi2D::Regs::Surface& dst, |
| 65 | const MathUtil::Rectangle<u32>& src_rect, | 65 | const Common::Rectangle<u32>& src_rect, |
| 66 | const MathUtil::Rectangle<u32>& dst_rect) override; | 66 | const Common::Rectangle<u32>& dst_rect) override; |
| 67 | bool AccelerateDisplay(const Tegra::FramebufferConfig& config, VAddr framebuffer_addr, | 67 | bool AccelerateDisplay(const Tegra::FramebufferConfig& config, VAddr framebuffer_addr, |
| 68 | u32 pixel_stride) override; | 68 | u32 pixel_stride) override; |
| 69 | bool AccelerateDrawBatch(bool is_indexed) override; | 69 | bool AccelerateDrawBatch(bool is_indexed) override; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index e6d47ce41..49c79811d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -399,7 +399,7 @@ static const FormatTuple& GetFormatTuple(PixelFormat pixel_format, ComponentType | |||
| 399 | return format; | 399 | return format; |
| 400 | } | 400 | } |
| 401 | 401 | ||
| 402 | MathUtil::Rectangle<u32> SurfaceParams::GetRect(u32 mip_level) const { | 402 | Common::Rectangle<u32> SurfaceParams::GetRect(u32 mip_level) const { |
| 403 | u32 actual_height{std::max(1U, unaligned_height >> mip_level)}; | 403 | u32 actual_height{std::max(1U, unaligned_height >> mip_level)}; |
| 404 | if (IsPixelFormatASTC(pixel_format)) { | 404 | if (IsPixelFormatASTC(pixel_format)) { |
| 405 | // ASTC formats must stop at the ATSC block size boundary | 405 | // ASTC formats must stop at the ATSC block size boundary |
| @@ -1062,8 +1062,8 @@ void RasterizerCacheOpenGL::FastLayeredCopySurface(const Surface& src_surface, | |||
| 1062 | } | 1062 | } |
| 1063 | 1063 | ||
| 1064 | static bool BlitSurface(const Surface& src_surface, const Surface& dst_surface, | 1064 | static bool BlitSurface(const Surface& src_surface, const Surface& dst_surface, |
| 1065 | const MathUtil::Rectangle<u32>& src_rect, | 1065 | const Common::Rectangle<u32>& src_rect, |
| 1066 | const MathUtil::Rectangle<u32>& dst_rect, GLuint read_fb_handle, | 1066 | const Common::Rectangle<u32>& dst_rect, GLuint read_fb_handle, |
| 1067 | GLuint draw_fb_handle, GLenum src_attachment = 0, GLenum dst_attachment = 0, | 1067 | GLuint draw_fb_handle, GLenum src_attachment = 0, GLenum dst_attachment = 0, |
| 1068 | std::size_t cubemap_face = 0) { | 1068 | std::size_t cubemap_face = 0) { |
| 1069 | 1069 | ||
| @@ -1193,7 +1193,7 @@ static bool BlitSurface(const Surface& src_surface, const Surface& dst_surface, | |||
| 1193 | void RasterizerCacheOpenGL::FermiCopySurface( | 1193 | void RasterizerCacheOpenGL::FermiCopySurface( |
| 1194 | const Tegra::Engines::Fermi2D::Regs::Surface& src_config, | 1194 | const Tegra::Engines::Fermi2D::Regs::Surface& src_config, |
| 1195 | const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, | 1195 | const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, |
| 1196 | const MathUtil::Rectangle<u32>& src_rect, const MathUtil::Rectangle<u32>& dst_rect) { | 1196 | const Common::Rectangle<u32>& src_rect, const Common::Rectangle<u32>& dst_rect) { |
| 1197 | 1197 | ||
| 1198 | const auto& src_params = SurfaceParams::CreateForFermiCopySurface(src_config); | 1198 | const auto& src_params = SurfaceParams::CreateForFermiCopySurface(src_config); |
| 1199 | const auto& dst_params = SurfaceParams::CreateForFermiCopySurface(dst_config); | 1199 | const auto& dst_params = SurfaceParams::CreateForFermiCopySurface(dst_config); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 89d733c50..838554c35 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -28,7 +28,7 @@ namespace OpenGL { | |||
| 28 | 28 | ||
| 29 | class CachedSurface; | 29 | class CachedSurface; |
| 30 | using Surface = std::shared_ptr<CachedSurface>; | 30 | using Surface = std::shared_ptr<CachedSurface>; |
| 31 | using SurfaceSurfaceRect_Tuple = std::tuple<Surface, Surface, MathUtil::Rectangle<u32>>; | 31 | using SurfaceSurfaceRect_Tuple = std::tuple<Surface, Surface, Common::Rectangle<u32>>; |
| 32 | 32 | ||
| 33 | using SurfaceTarget = VideoCore::Surface::SurfaceTarget; | 33 | using SurfaceTarget = VideoCore::Surface::SurfaceTarget; |
| 34 | using SurfaceType = VideoCore::Surface::SurfaceType; | 34 | using SurfaceType = VideoCore::Surface::SurfaceType; |
| @@ -71,7 +71,7 @@ struct SurfaceParams { | |||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | /// Returns the rectangle corresponding to this surface | 73 | /// Returns the rectangle corresponding to this surface |
| 74 | MathUtil::Rectangle<u32> GetRect(u32 mip_level = 0) const; | 74 | Common::Rectangle<u32> GetRect(u32 mip_level = 0) const; |
| 75 | 75 | ||
| 76 | /// Returns the total size of this surface in bytes, adjusted for compression | 76 | /// Returns the total size of this surface in bytes, adjusted for compression |
| 77 | std::size_t SizeInBytesRaw(bool ignore_tiled = false) const { | 77 | std::size_t SizeInBytesRaw(bool ignore_tiled = false) const { |
| @@ -430,8 +430,8 @@ public: | |||
| 430 | /// Copies the contents of one surface to another | 430 | /// Copies the contents of one surface to another |
| 431 | void FermiCopySurface(const Tegra::Engines::Fermi2D::Regs::Surface& src_config, | 431 | void FermiCopySurface(const Tegra::Engines::Fermi2D::Regs::Surface& src_config, |
| 432 | const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, | 432 | const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, |
| 433 | const MathUtil::Rectangle<u32>& src_rect, | 433 | const Common::Rectangle<u32>& src_rect, |
| 434 | const MathUtil::Rectangle<u32>& dst_rect); | 434 | const Common::Rectangle<u32>& dst_rect); |
| 435 | 435 | ||
| 436 | private: | 436 | private: |
| 437 | void LoadSurface(const Surface& surface); | 437 | void LoadSurface(const Surface& surface); |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 7e13e566b..c168fa89e 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h | |||
| @@ -39,7 +39,7 @@ struct TextureInfo { | |||
| 39 | /// Structure used for storing information about the display target for the Switch screen | 39 | /// Structure used for storing information about the display target for the Switch screen |
| 40 | struct ScreenInfo { | 40 | struct ScreenInfo { |
| 41 | GLuint display_texture; | 41 | GLuint display_texture; |
| 42 | const MathUtil::Rectangle<float> display_texcoords{0.0f, 0.0f, 1.0f, 1.0f}; | 42 | const Common::Rectangle<float> display_texcoords{0.0f, 0.0f, 1.0f, 1.0f}; |
| 43 | TextureInfo texture; | 43 | TextureInfo texture; |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| @@ -102,7 +102,7 @@ private: | |||
| 102 | 102 | ||
| 103 | /// Used for transforming the framebuffer orientation | 103 | /// Used for transforming the framebuffer orientation |
| 104 | Tegra::FramebufferConfig::TransformFlags framebuffer_transform_flags; | 104 | Tegra::FramebufferConfig::TransformFlags framebuffer_transform_flags; |
| 105 | MathUtil::Rectangle<int> framebuffer_crop_rect; | 105 | Common::Rectangle<int> framebuffer_crop_rect; |
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | } // namespace OpenGL | 108 | } // namespace OpenGL |