Vulkan: Add simple manager for compute shaders that upload data to images.

This commit is contained in:
Henrik Rydgård authored and Unknown W. Brackets committed 2019-09-29 10:24:48 -07:00
1 parent 360e138c2c
commit e6bec3e555
4 files changed
+189 -4

No files matched your search

+6 -1
View File
@@ -141,7 +141,8 @@ std::vector<std::string> SamplerCache::DebugGetSamplerIDs() const {
TextureCacheVulkan::TextureCacheVulkan(Draw::DrawContext *draw, VulkanContext *vulkan)
: TextureCacheCommon(draw),
vulkan_(vulkan),
samplerCache_(vulkan) {
samplerCache_(vulkan),
upload_(vulkan) {
timesInvalidatedAllThisFrame_ = 0;
DeviceRestore(vulkan, draw);
SetupTextureDecoder();
@@ -180,6 +181,8 @@ void TextureCacheVulkan::DeviceLost() {
if (samplerNearest_)
vulkan_->Delete().QueueDeleteSampler(samplerNearest_);
upload_.DeviceLost();
nextTexture_ = nullptr;
}
@@ -200,6 +203,8 @@ void TextureCacheVulkan::DeviceRestore(VulkanContext *vulkan, Draw::DrawContext
samp.minFilter = VK_FILTER_NEAREST;
samp.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
vkCreateSampler(vulkan_->GetDevice(), &samp, nullptr, &samplerNearest_);
upload_.DeviceRestore(vulkan);
}
void TextureCacheVulkan::ReleaseTexture(TexCacheEntry *entry, bool delete_them) {