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 @@ ...@@ -3,6 +3,7 @@
#include <vulkan/vulkan.hpp> #include <vulkan/vulkan.hpp>
#include "QueueManager.hpp" #include "QueueManager.hpp"
#include "DrawcallRecording.hpp"
namespace vkcv namespace vkcv
{ {
......
...@@ -51,8 +51,10 @@ namespace vkcv { ...@@ -51,8 +51,10 @@ namespace vkcv {
const PushConstantData &pushConstantData, const PushConstantData &pushConstantData,
const size_t drawcallIndex); const size_t drawcallIndex);
void InitMeshShaderDrawFunctions(vk::Device device);
struct MeshShaderDrawcall { 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) {} : descriptorSets(descriptorSets), taskCount(taskCount) {}
std::vector<DescriptorSetUsage> descriptorSets; std::vector<DescriptorSetUsage> descriptorSets;
......
...@@ -307,6 +307,11 @@ namespace vkcv ...@@ -307,6 +307,11 @@ namespace vkcv
// jetzt koennen wir mit dem device die queues erstellen // jetzt koennen wir mit dem device die queues erstellen
vk::Device device = physicalDevice.createDevice(deviceCreateInfo); vk::Device device = physicalDevice.createDevice(deviceCreateInfo);
if (usingMeshShaders)
{
InitMeshShaderDrawFunctions(device);
}
QueueManager queueManager = QueueManager::create(device, queuePairsGraphics, queuePairsCompute, queuePairsTransfer); QueueManager queueManager = QueueManager::create(device, queuePairsGraphics, queuePairsCompute, queuePairsTransfer);
......
...@@ -43,6 +43,22 @@ namespace vkcv { ...@@ -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( void recordMeshShaderDrawcall(
vk::CommandBuffer cmdBuffer, vk::CommandBuffer cmdBuffer,
vk::PipelineLayout pipelineLayout, vk::PipelineLayout pipelineLayout,
...@@ -71,6 +87,6 @@ namespace vkcv { ...@@ -71,6 +87,6 @@ namespace vkcv {
pushConstantData.sizePerDrawcall, pushConstantData.sizePerDrawcall,
drawcallPushConstantData); 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