mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-15 18:40:05 +00:00
gl_texture_cache: Fix software ASTC fallback
This commit is contained in:
parent
2f0da10dc3
commit
dd1232755b
@ -129,8 +129,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
|
|||||||
|
|
||||||
const FormatTuple& GetFormatTuple(PixelFormat pixel_format) {
|
const FormatTuple& GetFormatTuple(PixelFormat pixel_format) {
|
||||||
ASSERT(static_cast<std::size_t>(pixel_format) < tex_format_tuples.size());
|
ASSERT(static_cast<std::size_t>(pixel_format) < tex_format_tuples.size());
|
||||||
const auto& format{tex_format_tuples[static_cast<std::size_t>(pixel_format)]};
|
return tex_format_tuples[static_cast<std::size_t>(pixel_format)];
|
||||||
return format;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GLenum GetTextureTarget(const SurfaceTarget& target) {
|
GLenum GetTextureTarget(const SurfaceTarget& target) {
|
||||||
@ -243,11 +242,17 @@ OGLTexture CreateTexture(const SurfaceParams& params, GLenum target, GLenum inte
|
|||||||
CachedSurface::CachedSurface(const GPUVAddr gpu_addr, const SurfaceParams& params,
|
CachedSurface::CachedSurface(const GPUVAddr gpu_addr, const SurfaceParams& params,
|
||||||
bool is_astc_supported)
|
bool is_astc_supported)
|
||||||
: VideoCommon::SurfaceBase<View>(gpu_addr, params, is_astc_supported) {
|
: VideoCommon::SurfaceBase<View>(gpu_addr, params, is_astc_supported) {
|
||||||
|
if (is_converted) {
|
||||||
|
internal_format = params.srgb_conversion ? GL_SRGB8_ALPHA8 : GL_RGBA8;
|
||||||
|
format = GL_RGBA;
|
||||||
|
type = GL_UNSIGNED_BYTE;
|
||||||
|
} else {
|
||||||
const auto& tuple{GetFormatTuple(params.pixel_format)};
|
const auto& tuple{GetFormatTuple(params.pixel_format)};
|
||||||
internal_format = tuple.internal_format;
|
internal_format = tuple.internal_format;
|
||||||
format = tuple.format;
|
format = tuple.format;
|
||||||
type = tuple.type;
|
type = tuple.type;
|
||||||
is_compressed = !is_converted && params.IsCompressed();
|
is_compressed = params.IsCompressed();
|
||||||
|
}
|
||||||
target = GetTextureTarget(params.target);
|
target = GetTextureTarget(params.target);
|
||||||
texture = CreateTexture(params, target, internal_format, texture_buffer);
|
texture = CreateTexture(params, target, internal_format, texture_buffer);
|
||||||
DecorateSurfaceName();
|
DecorateSurfaceName();
|
||||||
|
Loading…
Reference in New Issue
Block a user