Skip to content
Snippets Groups Projects
Commit 19356f9a authored by Artur Wasmut's avatar Artur Wasmut
Browse files

[#87] Fetching the function pointer to relevant mesh shading draw commands...

[#87] Fetching the function pointer to relevant mesh shading draw commands now. Also, it compiles. GGWP vulkan.hpp for not being able to use extensions properly.
parent 682504ad
No related branches found
No related tags found
1 merge request!74Resolve "Mesh Shader Implementation"
Pipeline #26209 passed
......@@ -3,6 +3,7 @@
#include <vulkan/vulkan.hpp>
#include "QueueManager.hpp"
#include "DrawcallRecording.hpp"
namespace vkcv
{
......
......@@ -51,8 +51,10 @@ namespace vkcv {
const PushConstantData &pushConstantData,
const size_t drawcallIndex);
void InitMeshShaderDrawFunctions(vk::Device device);
struct MeshShaderDrawcall {
inline MeshShaderDrawcall(const std::vector<DescriptorSetUsage> descriptorSets, uint32_t taskCout)
inline MeshShaderDrawcall(const std::vector<DescriptorSetUsage> descriptorSets, uint32_t taskCount)
: descriptorSets(descriptorSets), taskCount(taskCount) {}
std::vector<DescriptorSetUsage> descriptorSets;
......
......@@ -307,6 +307,11 @@ namespace vkcv
// jetzt koennen wir mit dem device die queues erstellen
vk::Device device = physicalDevice.createDevice(deviceCreateInfo);
if (usingMeshShaders)
{
InitMeshShaderDrawFunctions(device);
}
QueueManager queueManager = QueueManager::create(device, queuePairsGraphics, queuePairsCompute, queuePairsTransfer);
......
......@@ -43,6 +43,22 @@ namespace vkcv {
}
}
struct MeshShaderFunctions
{
PFN_vkCmdDrawMeshTasksNV cmdDrawMeshTasks = nullptr;
PFN_vkCmdDrawMeshTasksIndirectNV cmdDrawMeshTasksIndirect = nullptr;
PFN_vkCmdDrawMeshTasksIndirectCountNV cmdDrawMeshTasksIndirectCount = nullptr;
} MeshShaderFunctions;
void InitMeshShaderDrawFunctions(vk::Device device)
{
MeshShaderFunctions.cmdDrawMeshTasks = reinterpret_cast<PFN_vkCmdDrawMeshTasksNV>(vkGetDeviceProcAddr(VkDevice(device), "vkCmdDrawMeshTasksNV"));
MeshShaderFunctions.cmdDrawMeshTasksIndirect = reinterpret_cast<PFN_vkCmdDrawMeshTasksIndirectNV>(vkGetDeviceProcAddr(VkDevice(device), "vkCmdDrawMeshTasksIndirectNV"));
MeshShaderFunctions.cmdDrawMeshTasksIndirectCount = reinterpret_cast<PFN_vkCmdDrawMeshTasksIndirectCountNV>(vkGetDeviceProcAddr(VkDevice(device), "vkCmdDrawMeshTasksIndirectCountNV"));
}
void recordMeshShaderDrawcall(
vk::CommandBuffer cmdBuffer,
vk::PipelineLayout pipelineLayout,
......@@ -71,6 +87,6 @@ namespace vkcv {
pushConstantData.sizePerDrawcall,
drawcallPushConstantData);
cmdBuffer.drawMeshTasksNV(drawcall.taskCount, firstTask);
MeshShaderFunctions.cmdDrawMeshTasks(cmdBuffer, drawcall.taskCount, firstTask);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment