small-ish fixes
This commit is contained in:
parent
acd8fe16c6
commit
b416f83eec
1 changed files with 43 additions and 40 deletions
|
@ -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
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue