image_info.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "video_core/engines/fermi_2d.h"
  5. #include "video_core/engines/maxwell_3d.h"
  6. #include "video_core/engines/maxwell_dma.h"
  7. #include "video_core/surface.h"
  8. #include "video_core/texture_cache/types.h"
  9. namespace VideoCommon {
  10. using Tegra::Texture::TICEntry;
  11. using VideoCore::Surface::PixelFormat;
  12. struct ImageInfo {
  13. ImageInfo() = default;
  14. explicit ImageInfo(const TICEntry& config) noexcept;
  15. explicit ImageInfo(const Tegra::Engines::Maxwell3D::Regs::RenderTargetConfig& ct,
  16. Tegra::Texture::MsaaMode msaa_mode) noexcept;
  17. explicit ImageInfo(const Tegra::Engines::Maxwell3D::Regs::Zeta& zt,
  18. const Tegra::Engines::Maxwell3D::Regs::ZetaSize& zt_size,
  19. Tegra::Texture::MsaaMode msaa_mode) noexcept;
  20. explicit ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept;
  21. explicit ImageInfo(const Tegra::DMA::ImageOperand& config) noexcept;
  22. PixelFormat format = PixelFormat::Invalid;
  23. ImageType type = ImageType::e1D;
  24. SubresourceExtent resources;
  25. Extent3D size{1, 1, 1};
  26. union {
  27. Extent3D block{0, 0, 0};
  28. u32 pitch;
  29. };
  30. u32 layer_stride = 0;
  31. u32 maybe_unaligned_layer_stride = 0;
  32. u32 num_samples = 1;
  33. u32 tile_width_spacing = 0;
  34. bool rescaleable = false;
  35. bool downscaleable = false;
  36. bool forced_flushed = false;
  37. bool dma_downloaded = false;
  38. bool is_sparse = false;
  39. };
  40. } // namespace VideoCommon