Fixing more stuff so i can import the car as well
This commit is contained in:
@@ -17,7 +17,7 @@ static Map<Vulkan::Buffer*, PendingBuffer> pendingBuffers;
|
||||
|
||||
Buffer::Buffer(PGraphics graphics, uint64 size, VkBufferUsageFlags usage, Gfx::QueueType& queueType, bool dynamic,
|
||||
std::string name)
|
||||
: graphics(graphics), currentBuffer(0), size(size), owner(queueType), usage(usage), name(name) {
|
||||
: graphics(graphics), currentBuffer(0), size(size), owner(queueType), usage(usage | VK_BUFFER_USAGE_TRANSFER_DST_BIT), name(name) {
|
||||
createBuffer();
|
||||
}
|
||||
|
||||
|
||||
@@ -321,6 +321,7 @@ PipelineLayout::PipelineLayout(PGraphics graphics, const std::string& name, Gfx:
|
||||
|
||||
PipelineLayout::~PipelineLayout() {}
|
||||
|
||||
std::mutex layoutLock;
|
||||
Map<uint32, VkPipelineLayout> cachedLayouts;
|
||||
|
||||
void PipelineLayout::create() {
|
||||
@@ -357,6 +358,7 @@ void PipelineLayout::create() {
|
||||
layoutHash = CRC::Calculate(createInfo.pSetLayouts, sizeof(VkDescriptorSetLayout) * createInfo.setLayoutCount,
|
||||
CRC::CRC_32(), layoutHash);
|
||||
|
||||
std::unique_lock l(layoutLock);
|
||||
if (cachedLayouts.contains(layoutHash)) {
|
||||
layoutHandle = cachedLayouts[layoutHash];
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user