mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 12:21:51 +01:00
Add function to check if any guest texture mappings are unmapped
This commit is contained in:
parent
98cb94ca6c
commit
849184452c
@ -145,7 +145,10 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
auto mappings{ctx.channelCtx.asCtx->gmmu.TranslateRange(target.offset, guest.GetSize())};
|
||||
guest.mappings.assign(mappings.begin(), mappings.end());
|
||||
|
||||
view = ctx.executor.AcquireTextureManager().FindOrCreate(guest, ctx.executor.tag);
|
||||
if (guest.MappingsValid())
|
||||
view = ctx.executor.AcquireTextureManager().FindOrCreate(guest, ctx.executor.tag);
|
||||
else
|
||||
view = {};
|
||||
}
|
||||
|
||||
/* Depth Render Target */
|
||||
@ -209,7 +212,10 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
auto mappings{ctx.channelCtx.asCtx->gmmu.TranslateRange(engine->ztOffset, guest.GetSize())};
|
||||
guest.mappings.assign(mappings.begin(), mappings.end());
|
||||
|
||||
view = ctx.executor.AcquireTextureManager().FindOrCreate(guest, ctx.executor.tag);
|
||||
if (guest.MappingsValid())
|
||||
view = ctx.executor.AcquireTextureManager().FindOrCreate(guest, ctx.executor.tag);
|
||||
else
|
||||
view = {};
|
||||
}
|
||||
|
||||
/* Pipeline Stages */
|
||||
|
@ -66,6 +66,10 @@ namespace skyline::gpu {
|
||||
return GetLayerStride() * (layerCount - baseArrayLayer);
|
||||
}
|
||||
|
||||
bool GuestTexture::MappingsValid() const {
|
||||
return ranges::all_of(mappings, [](const auto &mapping) { return mapping.valid(); });
|
||||
}
|
||||
|
||||
TextureView::TextureView(std::shared_ptr<Texture> texture, vk::ImageViewType type, vk::ImageSubresourceRange range, texture::Format format, vk::ComponentMapping mapping) : texture(std::move(texture)), type(type), format(format), mapping(mapping), range(range) {}
|
||||
|
||||
Texture::TextureViewStorage::TextureViewStorage(vk::ImageViewType type, texture::Format format, vk::ComponentMapping mapping, vk::ImageSubresourceRange range, vk::raii::ImageView &&vkView) : type(type), format(format), mapping(mapping), range(range), vkView(std::move(vkView)) {}
|
||||
|
@ -285,6 +285,8 @@ namespace skyline::gpu {
|
||||
u32 GetViewDepth() const;
|
||||
|
||||
size_t GetSize();
|
||||
|
||||
bool MappingsValid() const;
|
||||
};
|
||||
|
||||
class TextureManager;
|
||||
|
Loading…
Reference in New Issue
Block a user