Vulkan: Fill unused descriptor array elements with a dummy image (required by API)

This commit is contained in:
DrChat
2017-02-13 14:43:06 -06:00
parent 75b34b83a6
commit 4a99b88650
3 changed files with 155 additions and 4 deletions

View File

@@ -134,6 +134,9 @@ class TextureCache {
VkSampler sampler;
};
void SetupEmptySet();
void DestroyEmptySet();
// Allocates a new texture and memory to back it on the GPU.
Texture* AllocateTexture(const TextureInfo& texture_info);
bool FreeTexture(Texture* texture);
@@ -188,6 +191,12 @@ class TextureCache {
std::unordered_map<uint64_t, VkDescriptorSet> texture_bindings_;
VkDescriptorSetLayout texture_descriptor_set_layout_ = nullptr;
VkImage empty_image_ = nullptr;
VkImageView empty_image_view_ = nullptr;
VkDeviceMemory empty_image_memory_ = nullptr;
VkSampler empty_sampler_ = nullptr;
VkDescriptorSet empty_set_ = nullptr;
ui::vulkan::CircularBuffer staging_buffer_;
std::unordered_map<uint64_t, Texture*> textures_;
std::unordered_map<uint64_t, Sampler*> samplers_;