Renderer: Working compute implementation
This commit is contained in:
committed by
Jérôme Leclercq
parent
4605eed0da
commit
fe8715f1fb
@@ -58,9 +58,8 @@ namespace Nz
|
||||
deviceInfo.features.depthClamping = physDevice.features.depthClamp;
|
||||
deviceInfo.features.nonSolidFaceFilling = physDevice.features.fillModeNonSolid;
|
||||
deviceInfo.features.storageBuffers = true;
|
||||
deviceInfo.features.textureRead = true;
|
||||
deviceInfo.features.textureReadWithoutFormat = physDevice.features.shaderStorageImageReadWithoutFormat;
|
||||
deviceInfo.features.textureWrite = true;
|
||||
deviceInfo.features.textureReadWrite = true;
|
||||
deviceInfo.features.textureWriteWithoutFormat = physDevice.features.shaderStorageImageWriteWithoutFormat;
|
||||
deviceInfo.features.unrestrictedTextureViews = true;
|
||||
|
||||
|
||||
@@ -80,6 +80,22 @@ namespace Nz
|
||||
m_commandBuffer.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vkPipeline.GetPipeline());
|
||||
}
|
||||
|
||||
void VulkanCommandBufferBuilder::BindComputeShaderBinding(UInt32 set, const ShaderBinding& binding)
|
||||
{
|
||||
const VulkanShaderBinding& vkBinding = static_cast<const VulkanShaderBinding&>(binding);
|
||||
const VulkanRenderPipelineLayout& pipelineLayout = vkBinding.GetOwner();
|
||||
|
||||
m_commandBuffer.BindDescriptorSet(VK_PIPELINE_BIND_POINT_COMPUTE, pipelineLayout.GetPipelineLayout(), set, vkBinding.GetDescriptorSet());
|
||||
}
|
||||
|
||||
void VulkanCommandBufferBuilder::BindComputeShaderBinding(const RenderPipelineLayout& pipelineLayout, UInt32 set, const ShaderBinding& binding)
|
||||
{
|
||||
const VulkanRenderPipelineLayout& vkPipelineLayout = static_cast<const VulkanRenderPipelineLayout&>(pipelineLayout);
|
||||
const VulkanShaderBinding& vkBinding = static_cast<const VulkanShaderBinding&>(binding);
|
||||
|
||||
m_commandBuffer.BindDescriptorSet(VK_PIPELINE_BIND_POINT_COMPUTE, vkPipelineLayout.GetPipelineLayout(), set, vkBinding.GetDescriptorSet());
|
||||
}
|
||||
|
||||
void VulkanCommandBufferBuilder::BindIndexBuffer(const RenderBuffer& indexBuffer, IndexType indexType, UInt64 offset)
|
||||
{
|
||||
const VulkanBuffer& vkBuffer = static_cast<const VulkanBuffer&>(indexBuffer);
|
||||
@@ -97,7 +113,7 @@ namespace Nz
|
||||
m_commandBuffer.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, vkPipeline.Get(*m_currentRenderPass, m_currentSubpassIndex));
|
||||
}
|
||||
|
||||
void VulkanCommandBufferBuilder::BindShaderBinding(UInt32 set, const ShaderBinding& binding)
|
||||
void VulkanCommandBufferBuilder::BindRenderShaderBinding(UInt32 set, const ShaderBinding& binding)
|
||||
{
|
||||
const VulkanShaderBinding& vkBinding = static_cast<const VulkanShaderBinding&>(binding);
|
||||
const VulkanRenderPipelineLayout& pipelineLayout = vkBinding.GetOwner();
|
||||
@@ -105,7 +121,7 @@ namespace Nz
|
||||
m_commandBuffer.BindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout.GetPipelineLayout(), set, vkBinding.GetDescriptorSet());
|
||||
}
|
||||
|
||||
void VulkanCommandBufferBuilder::BindShaderBinding(const RenderPipelineLayout& pipelineLayout, UInt32 set, const ShaderBinding& binding)
|
||||
void VulkanCommandBufferBuilder::BindRenderShaderBinding(const RenderPipelineLayout& pipelineLayout, UInt32 set, const ShaderBinding& binding)
|
||||
{
|
||||
const VulkanRenderPipelineLayout& vkPipelineLayout = static_cast<const VulkanRenderPipelineLayout&>(pipelineLayout);
|
||||
const VulkanShaderBinding& vkBinding = static_cast<const VulkanShaderBinding&>(binding);
|
||||
|
||||
@@ -294,31 +294,6 @@ namespace Nz
|
||||
return std::make_shared<VulkanTexture>(std::static_pointer_cast<VulkanTexture>(shared_from_this()), viewInfo);
|
||||
}
|
||||
|
||||
PixelFormat VulkanTexture::GetFormat() const
|
||||
{
|
||||
return m_textureInfo.pixelFormat;
|
||||
}
|
||||
|
||||
UInt8 VulkanTexture::GetLevelCount() const
|
||||
{
|
||||
return m_textureInfo.levelCount;
|
||||
}
|
||||
|
||||
VulkanTexture* VulkanTexture::GetParentTexture() const
|
||||
{
|
||||
return m_parentTexture.get();
|
||||
}
|
||||
|
||||
Vector3ui VulkanTexture::GetSize(UInt8 level) const
|
||||
{
|
||||
return Vector3ui(GetLevelSize(m_textureInfo.width, level), GetLevelSize(m_textureInfo.height, level), GetLevelSize(m_textureInfo.depth, level));
|
||||
}
|
||||
|
||||
ImageType VulkanTexture::GetType() const
|
||||
{
|
||||
return m_textureInfo.type;
|
||||
}
|
||||
|
||||
bool VulkanTexture::Update(const void* ptr, const Boxui& box, unsigned int srcWidth, unsigned int srcHeight, UInt8 level)
|
||||
{
|
||||
std::size_t textureSize = box.width * box.height * box.depth * PixelFormatInfo::GetBytesPerPixel(m_textureInfo.pixelFormat);
|
||||
|
||||
Reference in New Issue
Block a user