Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
ERR("Failed to allocate code block array.\n");
return false;
- }
- return true;
+}
+static unsigned int sm6_function_alloc_block_id(struct sm6_function *function) +{
- return ++function->block_current_id;
+}
+static struct sm6_block *sm6_function_create_block(struct sm6_function *function) +{
- struct sm6_block *block;
- if (!sm6_function_blocks_reserve(function, function->block_count + 1) || !(block = sm6_block_create()))
Is this useful? You already reserved space for all the blocks just before calling this function in loop. Relatedly, you don't seem to need to keep a capacity count for the blocks, since everything is allocated at the beginning.