trying to integrate legacy index buffer rendering
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "Pipeline.h"
|
||||
#include "DescriptorSets.h"
|
||||
#include "RenderTarget.h"
|
||||
#include <vulkan/vulkan_core.h>
|
||||
|
||||
using namespace Seele;
|
||||
using namespace Seele::Vulkan;
|
||||
@@ -310,6 +311,11 @@ void RenderCommand::draw(uint32 vertexCount, uint32 instanceCount, int32 firstVe
|
||||
vkCmdDraw(handle, vertexCount, instanceCount, firstVertex, firstInstance);
|
||||
}
|
||||
|
||||
void RenderCommand::drawIndexed(uint32 indexCount, uint32 instanceCount, int32 firstIndex, uint32 vertexOffset, uint32 firstInstance)
|
||||
{
|
||||
assert(threadId == std::this_thread::get_id());
|
||||
vkCmdDrawIndexed(handle, indexCount, instanceCount, firstIndex, vertexOffset, firstIndex);
|
||||
}
|
||||
void RenderCommand::dispatch(uint32 groupX, uint32 groupY, uint32 groupZ)
|
||||
{
|
||||
assert(threadId == std::this_thread::get_id());
|
||||
|
||||
@@ -88,6 +88,7 @@ public:
|
||||
virtual void bindIndexBuffer(Gfx::PIndexBuffer indexBuffer) override;
|
||||
virtual void pushConstants(Gfx::PPipelineLayout layout, Gfx::SeShaderStageFlags stage, uint32 offset, uint32 size, const void* data) override;
|
||||
virtual void draw(uint32 vertexCount, uint32 instanceCount, int32 firstVertex, uint32 firstInstance) override;
|
||||
virtual void drawIndexed(uint32 indexCount, uint32 instanceCount, int32 firstIndex, uint32 vertexOffset, uint32 firstInstance) override;
|
||||
virtual void dispatch(uint32 groupX, uint32 groupY, uint32 groupZ) override;
|
||||
private:
|
||||
PGraphicsPipeline pipeline;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Graphics.h"
|
||||
#include "Allocator.h"
|
||||
#include "Buffer.h"
|
||||
#include "Graphics/Enums.h"
|
||||
#include "PipelineCache.h"
|
||||
#include "CommandBuffer.h"
|
||||
#include "Initializer.h"
|
||||
@@ -10,6 +11,8 @@
|
||||
#include "Framebuffer.h"
|
||||
#include "Shader.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <cstring>
|
||||
#include <vulkan/vulkan_core.h>
|
||||
|
||||
using namespace Seele;
|
||||
using namespace Seele::Vulkan;
|
||||
@@ -466,6 +469,18 @@ void Graphics::pickPhysicalDevice()
|
||||
physicalDevice = bestDevice;
|
||||
vkGetPhysicalDeviceProperties(physicalDevice, &props);
|
||||
vkGetPhysicalDeviceFeatures(physicalDevice, &features);
|
||||
uint32 count = 0;
|
||||
vkEnumerateDeviceExtensionProperties(physicalDevice, "VK_EXT_mesh_shader", &count, nullptr);
|
||||
Array<VkExtensionProperties> extensionProps(count);
|
||||
vkEnumerateDeviceExtensionProperties(physicalDevice, "VK_EXT_mesh_shader", &count, extensionProps.data());
|
||||
for(size_t i = 0; i < count; ++i)
|
||||
{
|
||||
if(std::strcmp("VK_EXT_mesh_shader", extensionProps[i].extensionName) == 0)
|
||||
{
|
||||
Gfx::useMeshShading = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::createDevice(GraphicsInitializer initializer)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
using namespace Seele;
|
||||
using namespace Seele::Vulkan;
|
||||
|
||||
double useMeshShading = false;
|
||||
double currentFrameDelta = 0;
|
||||
double Gfx::getCurrentFrameDelta()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user