-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add SPIR-V reflect to vulkan-utils #270
base: main
Are you sure you want to change the base?
Conversation
I haven't kept up with the other issue, I'll take a look at it this weekend! |
@expipiplus1 it's still work in progress and not ready for merge |
@expipiplus1 do you use code formatters by any means? You could commit its config for the rest of us to follow. |
I use Brittany with the default settings, good idea. I guess I could add an empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there... 😅
Other than a few minor things to polish the only big one remaining is usage of Applicative
instance of pure functions. I, too, use them for quick experiments, but usually I forget what I've meant the very next day.
With all the code set in place it is the time to add more |
nice.
makeDescriptorPoolCreateInfo :: Word32 -> V.Vector (DescriptorSetLayoutCreateInfo '[]) -> DescriptorPoolCreateInfo '[]
makeDescriptorPoolCreateInfo maxSets infos = zero
{ poolSizes = V.fromList
[ zero
{ type' = t
, descriptorCount = fromIntegral n
}
| (t, n) <- analyse infos ]
, maxSets = maxSets
, flags = DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT -- VUID-vkFreeDescriptorSets-descriptorPool-00312: descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag
}
where
analyse :: V.Vector (DescriptorSetLayoutCreateInfo '[]) -> [(DescriptorType, Int)]
analyse = map calculate . groupBy ((==) `on` fst) . sortOn fst . extract
extract :: V.Vector (DescriptorSetLayoutCreateInfo '[]) -> [(DescriptorType, Int)]
extract = map (liftA2 (,) tname (fromIntegral . dcount)) . V.toList . (bindings =<<)
calculate :: [(DescriptorType, Int)] -> (DescriptorType, Int)
calculate = liftA2 (,) (fst . head) (sum . (snd <$>))
tname = descriptorType :: DescriptorSetLayoutBinding -> DescriptorType
dcount = descriptorCount :: DescriptorSetLayoutBinding -> Word32
|
If |
support more descriptor types.(I thought these has been all) here comes the layout(set = 0, binding = 1) uniform textureBuffer texBuf; ...
"separate_images" : [
{
"type" : "samplerBuffer",
"name" : "texBuf",
"set" : 0,
"binding" : 1
}
... now the
|
relate #260