summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2017-06-12 12:37:28 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2017-06-13 00:41:56 -0500
commite4896d39bd927b0b8e109e0334fa15cdb8e004f3 (patch)
tree60375e0e8c776699b146bc26c3018be03b459225 /Source/Core/VideoBackends
parent2cdc93f4ab690279df064832d4c9688741556f0c (diff)
Video Backends: Move and rename HostTextureFormat to AbstractTextureFormat
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/D3D/DXTexture.cpp12
-rw-r--r--Source/Core/VideoBackends/OGL/OGLTexture.cpp20
-rw-r--r--Source/Core/VideoBackends/Vulkan/Util.cpp10
-rw-r--r--Source/Core/VideoBackends/Vulkan/Util.h3
-rw-r--r--Source/Core/VideoBackends/Vulkan/VKTexture.cpp2
5 files changed, 24 insertions, 23 deletions
diff --git a/Source/Core/VideoBackends/D3D/DXTexture.cpp b/Source/Core/VideoBackends/D3D/DXTexture.cpp
index 29b8824f5c..765438d679 100644
--- a/Source/Core/VideoBackends/D3D/DXTexture.cpp
+++ b/Source/Core/VideoBackends/D3D/DXTexture.cpp
@@ -27,17 +27,17 @@ namespace DX11
{
namespace
{
-DXGI_FORMAT GetDXGIFormatForHostFormat(HostTextureFormat format)
+DXGI_FORMAT GetDXGIFormatForHostFormat(AbstractTextureFormat format)
{
switch (format)
{
- case HostTextureFormat::DXT1:
+ case AbstractTextureFormat::DXT1:
return DXGI_FORMAT_BC1_UNORM;
- case HostTextureFormat::DXT3:
+ case AbstractTextureFormat::DXT3:
return DXGI_FORMAT_BC2_UNORM;
- case HostTextureFormat::DXT5:
+ case AbstractTextureFormat::DXT5:
return DXGI_FORMAT_BC3_UNORM;
- case HostTextureFormat::RGBA8:
+ case AbstractTextureFormat::RGBA8:
default:
return DXGI_FORMAT_R8G8B8A8_UNORM;
}
@@ -96,7 +96,7 @@ bool DXTexture::Save(const std::string& filename, unsigned int level)
// We can't dump compressed textures currently (it would mean drawing them to a RGBA8
// framebuffer, and saving that). TextureCache does not call Save for custom textures
// anyway, so this is fine for now.
- _assert_(m_config.format == HostTextureFormat::RGBA8);
+ _assert_(m_config.format == AbstractTextureFormat::RGBA8);
// Create a staging/readback texture with the dimensions of the specified mip level.
u32 mip_width = std::max(m_config.width >> level, 1u);
diff --git a/Source/Core/VideoBackends/OGL/OGLTexture.cpp b/Source/Core/VideoBackends/OGL/OGLTexture.cpp
index 3d6c04926d..242e19888e 100644
--- a/Source/Core/VideoBackends/OGL/OGLTexture.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLTexture.cpp
@@ -23,27 +23,27 @@ namespace
std::array<u32, 8> s_Textures;
u32 s_ActiveTexture;
-GLenum GetGLInternalFormatForTextureFormat(HostTextureFormat format, bool storage)
+GLenum GetGLInternalFormatForTextureFormat(AbstractTextureFormat format, bool storage)
{
switch (format)
{
- case HostTextureFormat::DXT1:
+ case AbstractTextureFormat::DXT1:
return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
- case HostTextureFormat::DXT3:
+ case AbstractTextureFormat::DXT3:
return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
- case HostTextureFormat::DXT5:
+ case AbstractTextureFormat::DXT5:
return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
- case HostTextureFormat::RGBA8:
+ case AbstractTextureFormat::RGBA8:
default:
return storage ? GL_RGBA8 : GL_RGBA;
}
}
-GLenum GetGLFormatForTextureFormat(HostTextureFormat format)
+GLenum GetGLFormatForTextureFormat(AbstractTextureFormat format)
{
switch (format)
{
- case HostTextureFormat::RGBA8:
+ case AbstractTextureFormat::RGBA8:
return GL_RGBA;
// Compressed texture formats don't use this parameter.
default:
@@ -51,11 +51,11 @@ GLenum GetGLFormatForTextureFormat(HostTextureFormat format)
}
}
-GLenum GetGLTypeForTextureFormat(HostTextureFormat format)
+GLenum GetGLTypeForTextureFormat(AbstractTextureFormat format)
{
switch (format)
{
- case HostTextureFormat::RGBA8:
+ case AbstractTextureFormat::RGBA8:
return GL_UNSIGNED_BYTE;
// Compressed texture formats don't use this parameter.
default:
@@ -167,7 +167,7 @@ bool OGLTexture::Save(const std::string& filename, unsigned int level)
// We can't dump compressed textures currently (it would mean drawing them to a RGBA8
// framebuffer, and saving that). TextureCache does not call Save for custom textures
// anyway, so this is fine for now.
- _assert_(m_config.format == HostTextureFormat::RGBA8);
+ _assert_(m_config.format == AbstractTextureFormat::RGBA8);
return SaveTexture(filename, GL_TEXTURE_2D_ARRAY, m_texId, m_config.width, m_config.height,
level);
diff --git a/Source/Core/VideoBackends/Vulkan/Util.cpp b/Source/Core/VideoBackends/Vulkan/Util.cpp
index 7ce433a79e..dd676d0b6c 100644
--- a/Source/Core/VideoBackends/Vulkan/Util.cpp
+++ b/Source/Core/VideoBackends/Vulkan/Util.cpp
@@ -88,20 +88,20 @@ VkFormat GetLinearFormat(VkFormat format)
}
}
-VkFormat GetVkFormatForHostTextureFormat(HostTextureFormat format)
+VkFormat GetVkFormatForHostTextureFormat(AbstractTextureFormat format)
{
switch (format)
{
- case HostTextureFormat::DXT1:
+ case AbstractTextureFormat::DXT1:
return VK_FORMAT_BC1_RGBA_UNORM_BLOCK;
- case HostTextureFormat::DXT3:
+ case AbstractTextureFormat::DXT3:
return VK_FORMAT_BC2_UNORM_BLOCK;
- case HostTextureFormat::DXT5:
+ case AbstractTextureFormat::DXT5:
return VK_FORMAT_BC3_UNORM_BLOCK;
- case HostTextureFormat::RGBA8:
+ case AbstractTextureFormat::RGBA8:
default:
return VK_FORMAT_R8G8B8A8_UNORM;
}
diff --git a/Source/Core/VideoBackends/Vulkan/Util.h b/Source/Core/VideoBackends/Vulkan/Util.h
index 85d447cf75..79b070cbb8 100644
--- a/Source/Core/VideoBackends/Vulkan/Util.h
+++ b/Source/Core/VideoBackends/Vulkan/Util.h
@@ -11,6 +11,7 @@
#include "VideoBackends/Vulkan/Constants.h"
#include "VideoBackends/Vulkan/ObjectCache.h"
#include "VideoCommon/RenderState.h"
+#include "VideoCommon/TextureConfig.h"
namespace Vulkan
{
@@ -27,7 +28,7 @@ u32 MakeRGBA8Color(float r, float g, float b, float a);
bool IsDepthFormat(VkFormat format);
bool IsCompressedFormat(VkFormat format);
VkFormat GetLinearFormat(VkFormat format);
-VkFormat GetVkFormatForHostTextureFormat(HostTextureFormat format);
+VkFormat GetVkFormatForHostTextureFormat(AbstractTextureFormat format);
u32 GetTexelSize(VkFormat format);
u32 GetBlockSize(VkFormat format);
diff --git a/Source/Core/VideoBackends/Vulkan/VKTexture.cpp b/Source/Core/VideoBackends/Vulkan/VKTexture.cpp
index a493518101..e937f06f33 100644
--- a/Source/Core/VideoBackends/Vulkan/VKTexture.cpp
+++ b/Source/Core/VideoBackends/Vulkan/VKTexture.cpp
@@ -120,7 +120,7 @@ bool VKTexture::Save(const std::string& filename, unsigned int level)
// We can't dump compressed textures currently (it would mean drawing them to a RGBA8
// framebuffer, and saving that). TextureCache does not call Save for custom textures
// anyway, so this is fine for now.
- _assert_(m_config.format == HostTextureFormat::RGBA8);
+ _assert_(m_config.format == AbstractTextureFormat::RGBA8);
// Determine dimensions of image we want to save.
u32 level_width = std::max(1u, m_config.width >> level);