mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Stabilize Vulkan rendering state for minimap, foliage, and water
This commit is contained in:
parent
8efc1548dc
commit
bd0305f6dd
10 changed files with 834 additions and 117 deletions
|
|
@ -82,6 +82,11 @@ public:
|
|||
void recreatePipelines();
|
||||
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const Camera& camera, float time);
|
||||
void captureSceneHistory(VkCommandBuffer cmd,
|
||||
VkImage srcColorImage,
|
||||
VkImage srcDepthImage,
|
||||
VkExtent2D srcExtent,
|
||||
bool srcDepthIsMsaa);
|
||||
|
||||
void setEnabled(bool enabled) { renderingEnabled = enabled; }
|
||||
bool isEnabled() const { return renderingEnabled; }
|
||||
|
|
@ -100,6 +105,8 @@ private:
|
|||
|
||||
void updateMaterialUBO(WaterSurface& surface);
|
||||
VkDescriptorSet allocateMaterialSet();
|
||||
void createSceneHistoryResources(VkExtent2D extent, VkFormat colorFormat, VkFormat depthFormat);
|
||||
void destroySceneHistoryResources();
|
||||
|
||||
VkContext* vkCtx = nullptr;
|
||||
|
||||
|
|
@ -108,8 +115,22 @@ private:
|
|||
VkPipelineLayout pipelineLayout = VK_NULL_HANDLE;
|
||||
VkDescriptorSetLayout materialSetLayout = VK_NULL_HANDLE;
|
||||
VkDescriptorPool materialDescPool = VK_NULL_HANDLE;
|
||||
VkDescriptorSetLayout sceneSetLayout = VK_NULL_HANDLE;
|
||||
VkDescriptorPool sceneDescPool = VK_NULL_HANDLE;
|
||||
VkDescriptorSet sceneSet = VK_NULL_HANDLE;
|
||||
static constexpr uint32_t MAX_WATER_SETS = 2048;
|
||||
|
||||
VkSampler sceneColorSampler = VK_NULL_HANDLE;
|
||||
VkSampler sceneDepthSampler = VK_NULL_HANDLE;
|
||||
VkImage sceneColorImage = VK_NULL_HANDLE;
|
||||
VmaAllocation sceneColorAlloc = VK_NULL_HANDLE;
|
||||
VkImageView sceneColorView = VK_NULL_HANDLE;
|
||||
VkImage sceneDepthImage = VK_NULL_HANDLE;
|
||||
VmaAllocation sceneDepthAlloc = VK_NULL_HANDLE;
|
||||
VkImageView sceneDepthView = VK_NULL_HANDLE;
|
||||
VkExtent2D sceneHistoryExtent = {0, 0};
|
||||
bool sceneHistoryReady = false;
|
||||
|
||||
std::vector<WaterSurface> surfaces;
|
||||
bool renderingEnabled = true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue