summaryrefslogtreecommitdiff
path: root/src/video_core/surface.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-11-08 22:38:26 -0300
committerGravatar ReinUsesLisp2019-11-14 18:21:42 -0300
commit48a1687f515110b602c64ffbc27eacef3e57a575 (patch)
tree16a9945ee8d4f01e2d1a7c0dde0313464e1f9c18 /src/video_core/surface.cpp
parentMerge pull request #3110 from greggameplayer/CompleteRGBA16UI (diff)
downloadyuzu-48a1687f515110b602c64ffbc27eacef3e57a575.tar.gz
yuzu-48a1687f515110b602c64ffbc27eacef3e57a575.tar.xz
yuzu-48a1687f515110b602c64ffbc27eacef3e57a575.zip
texture_cache: Drop abstracted ComponentType
Abstracted ComponentType was not being used in a meaningful way. This commit drops its usage. There is one place where it was being used to test compatibility between two cached surfaces, but this one is implied in the pixel format. Removing the component type test doesn't change the behaviour.
Diffstat (limited to 'src/video_core/surface.cpp')
-rw-r--r--src/video_core/surface.cpp85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 4b6846113..20bcda6bc 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -404,75 +404,6 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
404 return PixelFormat::ABGR8U; 404 return PixelFormat::ABGR8U;
405} 405}
406 406
407ComponentType ComponentTypeFromTexture(Tegra::Texture::ComponentType type) {
408 // TODO(Subv): Implement more component types
409 switch (type) {
410 case Tegra::Texture::ComponentType::UNORM:
411 return ComponentType::UNorm;
412 case Tegra::Texture::ComponentType::FLOAT:
413 return ComponentType::Float;
414 case Tegra::Texture::ComponentType::SNORM:
415 return ComponentType::SNorm;
416 case Tegra::Texture::ComponentType::UINT:
417 return ComponentType::UInt;
418 case Tegra::Texture::ComponentType::SINT:
419 return ComponentType::SInt;
420 default:
421 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
422 UNREACHABLE();
423 return ComponentType::UNorm;
424 }
425}
426
427ComponentType ComponentTypeFromRenderTarget(Tegra::RenderTargetFormat format) {
428 // TODO(Subv): Implement more render targets
429 switch (format) {
430 case Tegra::RenderTargetFormat::RGBA8_UNORM:
431 case Tegra::RenderTargetFormat::RGBA8_SRGB:
432 case Tegra::RenderTargetFormat::BGRA8_UNORM:
433 case Tegra::RenderTargetFormat::BGRA8_SRGB:
434 case Tegra::RenderTargetFormat::RGB10_A2_UNORM:
435 case Tegra::RenderTargetFormat::R8_UNORM:
436 case Tegra::RenderTargetFormat::RG16_UNORM:
437 case Tegra::RenderTargetFormat::R16_UNORM:
438 case Tegra::RenderTargetFormat::B5G6R5_UNORM:
439 case Tegra::RenderTargetFormat::BGR5A1_UNORM:
440 case Tegra::RenderTargetFormat::RG8_UNORM:
441 case Tegra::RenderTargetFormat::RGBA16_UNORM:
442 return ComponentType::UNorm;
443 case Tegra::RenderTargetFormat::RGBA8_SNORM:
444 case Tegra::RenderTargetFormat::RG16_SNORM:
445 case Tegra::RenderTargetFormat::R16_SNORM:
446 case Tegra::RenderTargetFormat::RG8_SNORM:
447 return ComponentType::SNorm;
448 case Tegra::RenderTargetFormat::RGBA16_FLOAT:
449 case Tegra::RenderTargetFormat::RGBX16_FLOAT:
450 case Tegra::RenderTargetFormat::R11G11B10_FLOAT:
451 case Tegra::RenderTargetFormat::RGBA32_FLOAT:
452 case Tegra::RenderTargetFormat::RG32_FLOAT:
453 case Tegra::RenderTargetFormat::RG16_FLOAT:
454 case Tegra::RenderTargetFormat::R16_FLOAT:
455 case Tegra::RenderTargetFormat::R32_FLOAT:
456 return ComponentType::Float;
457 case Tegra::RenderTargetFormat::RGBA32_UINT:
458 case Tegra::RenderTargetFormat::RGBA16_UINT:
459 case Tegra::RenderTargetFormat::RG16_UINT:
460 case Tegra::RenderTargetFormat::R8_UINT:
461 case Tegra::RenderTargetFormat::R16_UINT:
462 case Tegra::RenderTargetFormat::RG32_UINT:
463 case Tegra::RenderTargetFormat::R32_UINT:
464 case Tegra::RenderTargetFormat::RGBA8_UINT:
465 return ComponentType::UInt;
466 case Tegra::RenderTargetFormat::RG16_SINT:
467 case Tegra::RenderTargetFormat::R16_SINT:
468 return ComponentType::SInt;
469 default:
470 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
471 UNREACHABLE();
472 return ComponentType::UNorm;
473 }
474}
475
476PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format) { 407PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format) {
477 switch (format) { 408 switch (format) {
478 case Tegra::FramebufferConfig::PixelFormat::ABGR8: 409 case Tegra::FramebufferConfig::PixelFormat::ABGR8:
@@ -487,22 +418,6 @@ PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat
487 } 418 }
488} 419}
489 420
490ComponentType ComponentTypeFromDepthFormat(Tegra::DepthFormat format) {
491 switch (format) {
492 case Tegra::DepthFormat::Z16_UNORM:
493 case Tegra::DepthFormat::S8_Z24_UNORM:
494 case Tegra::DepthFormat::Z24_S8_UNORM:
495 return ComponentType::UNorm;
496 case Tegra::DepthFormat::Z32_FLOAT:
497 case Tegra::DepthFormat::Z32_S8_X24_FLOAT:
498 return ComponentType::Float;
499 default:
500 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
501 UNREACHABLE();
502 return ComponentType::UNorm;
503 }
504}
505
506SurfaceType GetFormatType(PixelFormat pixel_format) { 421SurfaceType GetFormatType(PixelFormat pixel_format) {
507 if (static_cast<std::size_t>(pixel_format) < 422 if (static_cast<std::size_t>(pixel_format) <
508 static_cast<std::size_t>(PixelFormat::MaxColorFormat)) { 423 static_cast<std::size_t>(PixelFormat::MaxColorFormat)) {