Use main buffers for utility draws

This commit is contained in:
Stenzek
2018-11-27 17:16:53 +10:00
parent 5ca18ff04e
commit 7afd5cc2fb
32 changed files with 533 additions and 681 deletions

View File

@ -30,10 +30,6 @@ public:
static bool CreateInstance();
static void DestroyInstance();
const std::array<VkDescriptorImageInfo, NUM_PIXEL_SHADER_SAMPLERS>& GetPSSamplerBindings() const
{
return m_bindings.ps_samplers;
}
VkFramebuffer GetFramebuffer() const { return m_framebuffer; }
const VKPipeline* GetPipeline() const { return m_pipeline; }
void SetVertexBuffer(VkBuffer buffer, VkDeviceSize offset);
@ -47,6 +43,9 @@ public:
void UpdateGeometryShaderConstants();
void UpdatePixelShaderConstants();
// Updates constants from external data, e.g. utility draws.
void UpdateConstants(const void* data, u32 data_size);
void SetTexture(size_t index, VkImageView view);
void SetSampler(size_t index, VkSampler sampler);
@ -104,7 +103,8 @@ private:
// Number of descriptor sets for game draws.
enum
{
NUM_GX_DRAW_DESCRIPTOR_SETS = DESCRIPTOR_SET_BIND_POINT_STORAGE_OR_TEXEL_BUFFER + 1
NUM_GX_DRAW_DESCRIPTOR_SETS = DESCRIPTOR_SET_BIND_POINT_STORAGE_OR_TEXEL_BUFFER + 1,
NUM_UTILITY_DRAW_DESCRIPTOR_SETS = 2
};
enum DITRY_FLAG : u32
@ -133,6 +133,8 @@ private:
bool IsViewportWithinRenderArea() const;
bool UpdateDescriptorSet();
bool UpdateGXDescriptorSet();
bool UpdateUtilityDescriptorSet();
// Allocates storage in the uniform buffer of the specified size. If this storage cannot be
// allocated immediately, the current command buffer will be submitted and all stage's
@ -167,6 +169,7 @@ private:
} m_bindings;
size_t m_uniform_buffer_reserve_size = 0;
u32 m_num_active_descriptor_sets = 0;
u32 m_num_dynamic_offsets = 0;
// rasterization
VkViewport m_viewport = {0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f};