small-ish fixes

This commit is contained in:
nek0 2023-08-24 03:54:57 +02:00
parent acd8fe16c6
commit b416f83eec

View file

@ -103,8 +103,11 @@ createFrames
indirectBuffer <- createAllocatedBuffer
allocator
(sizeOf maxObjects)
Vk.BUFFER_USAGE_STORAGE_BUFFER_BIT
(sizeOf (undefined :: Vk.DrawIndirectCommand))
(Vk.BUFFER_USAGE_TRANSFER_DST_BIT .|.
Vk.BUFFER_USAGE_STORAGE_BUFFER_BIT .|.
Vk.BUFFER_USAGE_INDIRECT_BUFFER_BIT
)
VMA.MEMORY_USAGE_CPU_TO_GPU
let allocationInfo = Vk.zero
@ -285,7 +288,7 @@ recordCommandBuffer
(V.fromList [ allocatedBuffer $ meshBuffer mesh ])
(V.fromList [ 0 ])
let indirectOffset = fromIntegral $
let indirectOffset = fromIntegral $
first * fromIntegral ( sizeOf (undefined :: Vk.DrawIndirectCommand))
drawStride = fromIntegral $ sizeOf (undefined :: Vk.DrawIndirectCommand)
@ -298,49 +301,49 @@ recordCommandBuffer
)
draws
V.mapM_
(\(IndirectBatch mesh material first count) -> do
-- V.mapM_
-- (\(IndirectBatch mesh material first count) -> do
when
(materialTextureSet material /= Vk.NULL_HANDLE)
(Vk.cmdBindDescriptorSets
commandBuffer
Vk.PIPELINE_BIND_POINT_GRAPHICS
(materialPipelineLayout material)
2
(V.singleton $ materialTextureSet material)
V.empty
)
-- when
-- (materialTextureSet material /= Vk.NULL_HANDLE)
-- (Vk.cmdBindDescriptorSets
-- commandBuffer
-- Vk.PIPELINE_BIND_POINT_GRAPHICS
-- (materialPipelineLayout material)
-- 2
-- (V.singleton $ materialTextureSet material)
-- V.empty
-- )
Vk.cmdBindPipeline commandBuffer Vk.PIPELINE_BIND_POINT_GRAPHICS (materialPipeline material)
-- Vk.cmdBindPipeline commandBuffer Vk.PIPELINE_BIND_POINT_GRAPHICS (materialPipeline material)
Vk.cmdBindDescriptorSets
commandBuffer
Vk.PIPELINE_BIND_POINT_GRAPHICS
(materialPipelineLayout material)
0
(V.singleton $ frameGlobalDescriptor frame)
V.empty
-- Vk.cmdBindDescriptorSets
-- commandBuffer
-- Vk.PIPELINE_BIND_POINT_GRAPHICS
-- (materialPipelineLayout material)
-- 0
-- (V.singleton $ frameGlobalDescriptor frame)
-- V.empty
Vk.cmdBindDescriptorSets
commandBuffer
Vk.PIPELINE_BIND_POINT_GRAPHICS
(materialPipelineLayout material)
1
(V.singleton $ frameObjectDescriptor frame)
V.empty
-- Vk.cmdBindDescriptorSets
-- commandBuffer
-- Vk.PIPELINE_BIND_POINT_GRAPHICS
-- (materialPipelineLayout material)
-- 1
-- (V.singleton $ frameObjectDescriptor frame)
-- V.empty
Vk.cmdBindVertexBuffers
commandBuffer
0
(V.fromList [ allocatedBuffer $ meshBuffer mesh ])
(V.fromList [ 0 ])
-- Vk.cmdBindVertexBuffers
-- commandBuffer
-- 0
-- (V.fromList [ allocatedBuffer $ meshBuffer mesh ])
-- (V.fromList [ 0 ])
mapM_
(Vk.cmdDraw commandBuffer (fromIntegral $ V.length $ meshVertices mesh) 1 0)
[first .. (count - 1)]
)
draws
-- mapM_
-- (Vk.cmdDraw commandBuffer (fromIntegral $ V.length $ meshVertices mesh) 1 0)
-- [first .. (count - 1)]
-- )
-- draws
prepareRecording
:: V2 CInt