gl_texture_runtime: Fix custom allocation recycling
This commit is contained in:
@@ -22,7 +22,7 @@ namespace {
|
|||||||
MICROPROFILE_DEFINE(CustomTexManager_TickFrame, "CustomTexManager", "TickFrame",
|
MICROPROFILE_DEFINE(CustomTexManager_TickFrame, "CustomTexManager", "TickFrame",
|
||||||
MP_RGB(54, 16, 32));
|
MP_RGB(54, 16, 32));
|
||||||
|
|
||||||
constexpr std::size_t MAX_UPLOADS_PER_TICK = 16;
|
constexpr std::size_t MAX_UPLOADS_PER_TICK = 8;
|
||||||
|
|
||||||
bool IsPow2(u32 value) {
|
bool IsPow2(u32 value) {
|
||||||
return value != 0 && (value & (value - 1)) == 0;
|
return value != 0 && (value & (value - 1)) == 0;
|
||||||
|
@@ -184,8 +184,8 @@ Allocation TextureRuntime::Allocate(const VideoCore::SurfaceParams& params,
|
|||||||
const auto& tuple =
|
const auto& tuple =
|
||||||
is_custom ? GetFormatTuple(params.custom_format) : GetFormatTuple(params.pixel_format);
|
is_custom ? GetFormatTuple(params.custom_format) : GetFormatTuple(params.pixel_format);
|
||||||
const HostTextureTag key = {
|
const HostTextureTag key = {
|
||||||
.width = params.GetScaledWidth(),
|
.width = params.width,
|
||||||
.height = params.GetScaledHeight(),
|
.height = params.height,
|
||||||
.levels = params.levels,
|
.levels = params.levels,
|
||||||
.res_scale = params.res_scale,
|
.res_scale = params.res_scale,
|
||||||
.tuple = tuple,
|
.tuple = tuple,
|
||||||
@@ -230,10 +230,11 @@ Allocation TextureRuntime::Allocate(const VideoCore::SurfaceParams& params,
|
|||||||
.textures = std::move(textures),
|
.textures = std::move(textures),
|
||||||
.handles = std::move(handles),
|
.handles = std::move(handles),
|
||||||
.tuple = tuple,
|
.tuple = tuple,
|
||||||
.width = params.GetScaledWidth(),
|
.width = params.width,
|
||||||
.height = params.GetScaledHeight(),
|
.height = params.height,
|
||||||
.levels = params.levels,
|
.levels = params.levels,
|
||||||
.res_scale = params.res_scale,
|
.res_scale = params.res_scale,
|
||||||
|
.is_custom = is_custom,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,7 +615,7 @@ HostTextureTag Surface::MakeTag() const noexcept {
|
|||||||
.res_scale = alloc.res_scale,
|
.res_scale = alloc.res_scale,
|
||||||
.tuple = alloc.tuple,
|
.tuple = alloc.tuple,
|
||||||
.type = texture_type,
|
.type = texture_type,
|
||||||
.is_custom = True(flags & VideoCore::SurfaceFlagBits::Custom),
|
.is_custom = alloc.is_custom,
|
||||||
.has_normal = HasNormalMap(),
|
.has_normal = HasNormalMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -59,6 +59,7 @@ struct Allocation {
|
|||||||
u32 height;
|
u32 height;
|
||||||
u32 levels;
|
u32 levels;
|
||||||
u32 res_scale;
|
u32 res_scale;
|
||||||
|
bool is_custom;
|
||||||
|
|
||||||
operator bool() const noexcept {
|
operator bool() const noexcept {
|
||||||
return textures[0].handle;
|
return textures[0].handle;
|
||||||
|
Reference in New Issue
Block a user