MCPcopy Create free account
hub / github.com/defold/defold / DrawSetupCompute

Function DrawSetupCompute

engine/graphics/src/vulkan/graphics_vulkan.cpp:3105–3120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3103 }
3104
3105 static void DrawSetupCompute(VulkanContext* context, VkCommandBuffer vk_command_buffer, ScratchBuffer* scratchBuffer)
3106 {
3107 VkDevice vk_device = context->m_LogicalDevice.m_Device;
3108 VulkanProgram* program_ptr = context->m_CurrentProgram;
3109 assert(program_ptr->m_ComputeModule);
3110
3111 PrepareScatchBuffer(context, scratchBuffer, program_ptr);
3112
3113 // Write the uniform data to the descriptors
3114 uint32_t dynamic_alignment = (uint32_t) context->m_PhysicalDevice.m_Properties.limits.minUniformBufferOffsetAlignment;
3115 VkResult res = CommitUniforms(context, vk_command_buffer, vk_device, program_ptr, VK_PIPELINE_BIND_POINT_COMPUTE, scratchBuffer, context->m_DynamicOffsetBuffer, dynamic_alignment);
3116 CHECK_VK_ERROR(res);
3117
3118 Pipeline* pipeline = GetOrCreateComputePipeline(vk_device, context->m_VkPipelineCache, context->m_PipelineCache, program_ptr);
3119 vkCmdBindPipeline(vk_command_buffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline);
3120 }
3121
3122 static bool DrawSetup(VulkanContext* context, VkCommandBuffer vk_command_buffer, ScratchBuffer* scratchBuffer, DeviceBuffer* indexBuffer, Type indexBufferType)
3123 {

Callers 1

VulkanDispatchComputeFunction · 0.70

Calls 4

PrepareScatchBufferFunction · 0.85
CommitUniformsFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected