summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/textures')
-rw-r--r--src/video_core/textures/decoders.cpp9
-rw-r--r--src/video_core/textures/texture.h8
2 files changed, 13 insertions, 4 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index e5e9e1898..50c5a56f6 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -61,10 +61,12 @@ u32 BytesPerPixel(TextureFormat format) {
case TextureFormat::A8R8G8B8:
case TextureFormat::A2B10G10R10:
case TextureFormat::BF10GF11RF11:
+ case TextureFormat::R32:
return 4;
case TextureFormat::A1B5G5R5:
case TextureFormat::B5G6R5:
case TextureFormat::G8R8:
+ case TextureFormat::R16:
return 2;
case TextureFormat::R8:
return 1;
@@ -88,6 +90,8 @@ static u32 DepthBytesPerPixel(DepthFormat format) {
case DepthFormat::Z24_S8_UNORM:
case DepthFormat::Z32_FLOAT:
return 4;
+ case DepthFormat::Z32_S8_X24_FLOAT:
+ return 8;
default:
UNIMPLEMENTED_MSG("Format not implemented");
break;
@@ -121,6 +125,8 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width,
case TextureFormat::R16_G16_B16_A16:
case TextureFormat::R32_G32_B32_A32:
case TextureFormat::R32_G32:
+ case TextureFormat::R32:
+ case TextureFormat::R16:
case TextureFormat::BF10GF11RF11:
case TextureFormat::ASTC_2D_4X4:
CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
@@ -146,6 +152,7 @@ std::vector<u8> UnswizzleDepthTexture(VAddr address, DepthFormat format, u32 wid
case DepthFormat::S8_Z24_UNORM:
case DepthFormat::Z24_S8_UNORM:
case DepthFormat::Z32_FLOAT:
+ case DepthFormat::Z32_S8_X24_FLOAT:
CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
unswizzled_data.data(), true, block_height);
break;
@@ -178,6 +185,8 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
case TextureFormat::BF10GF11RF11:
case TextureFormat::R32_G32_B32_A32:
case TextureFormat::R32_G32:
+ case TextureFormat::R32:
+ case TextureFormat::R16:
// TODO(Subv): For the time being just forward the same data without any decoding.
rgba_data = texture_data;
break;
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h
index d1c755033..c6bd2f4b9 100644
--- a/src/video_core/textures/texture.h
+++ b/src/video_core/textures/texture.h
@@ -242,10 +242,10 @@ struct TSCEntry {
BitField<6, 2, TextureMipmapFilter> mip_filter;
};
INSERT_PADDING_BYTES(8);
- u32 border_color_r;
- u32 border_color_g;
- u32 border_color_b;
- u32 border_color_a;
+ float border_color_r;
+ float border_color_g;
+ float border_color_b;
+ float border_color_a;
};
static_assert(sizeof(TSCEntry) == 0x20, "TSCEntry has wrong size");