fix: VK_INDEX_TYPE_UINT32 (was UINT16) + remove unused depth from pipeline

- vkCmdBindIndexBuffer indexType changed from 0 (UINT16) to 1 (UINT32)
  to match uint[] index data — this was causing black screen
- Removed depth stencil state, depth attachment format, and depth
  rendering attachment from pipeline/renderer (depth buffer still
  created in swapchain but unused)
This commit is contained in:
emil28092005
2026-06-18 12:59:01 +03:00
parent aca8d1ab4d
commit 233041ab00
6 changed files with 18 additions and 46 deletions
+2 -14
View File
@@ -14,7 +14,7 @@ internal sealed unsafe class VulkanPipeline : IDisposable
private readonly VkDevice _device;
private bool _disposed;
public VulkanPipeline(VkDevice device, VkFormat colorFormat, VkFormat depthFormat, byte[] vertSpv, byte[] fragSpv)
public VulkanPipeline(VkDevice device, VkFormat colorFormat, byte[] vertSpv, byte[] fragSpv)
{
_device = device;
VertModule = CreateShaderModule(vertSpv);
@@ -115,16 +115,6 @@ internal sealed unsafe class VulkanPipeline : IDisposable
sampleShadingEnable = VkBool32.False,
};
var depthStencilState = new VkPipelineDepthStencilStateCreateInfo
{
sType = VkStructureType.PipelineDepthStencilStateCreateInfo,
depthTestEnable = VkBool32.False,
depthWriteEnable = VkBool32.False,
depthCompareOp = VkCompareOp.Less,
depthBoundsTestEnable = VkBool32.False,
stencilTestEnable = VkBool32.False,
};
var blendAttachment = new VkPipelineColorBlendAttachmentState
{
blendEnable = VkBool32.False,
@@ -154,7 +144,7 @@ internal sealed unsafe class VulkanPipeline : IDisposable
{
stageFlags = VkShaderStageFlags.Vertex,
offset = 0,
size = 64,
size = 4,
};
var descLayout = DescriptorSetLayout;
@@ -179,7 +169,6 @@ internal sealed unsafe class VulkanPipeline : IDisposable
sType = VkStructureType.PipelineRenderingCreateInfo,
colorAttachmentCount = 1,
pColorAttachmentFormats = &colorFormat,
depthAttachmentFormat = depthFormat,
};
var pipelineInfo = new VkGraphicsPipelineCreateInfo
@@ -193,7 +182,6 @@ internal sealed unsafe class VulkanPipeline : IDisposable
pViewportState = &viewportState,
pRasterizationState = &rasterizationState,
pMultisampleState = &multisampleState,
pDepthStencilState = &depthStencilState,
pColorBlendState = &colorBlendState,
pDynamicState = &dynamicState,
layout = PipelineLayout,