Skip to content

Both DX backends ignore VertexFormatHandle entirely: the custom vertex format API is... #164

Description

@CanReader

src/Graphics/DirectX11/DirectX11Renderer.cpp:487; src/Graphics/DirectX12/DirectX12Renderer.cpp:1012;
src/Graphics/DirectX11/DirectX11Shader.hpp:57-64; src/Graphics/DirectX11/DirectX11Shader.cpp:97

grep -n "VertexFormat" src/Graphics/DirectX11/*.cpp src/Graphics/DirectX12/*.cpp returns zero hits.
Both backends hardcode the stride:

  • DX11: UINT stride = sizeof(Sleak::Vertex); (:487)
  • DX12: vbView.StrideInBytes = sizeof(Sleak::Vertex); (:1012)

GL (OpenGLRenderer.cpp:349-351) and Vulkan (VulkanRenderer.cpp:687, VulkanPipelines.cpp:741) both honor
the handle. Sleak::Vertex is 96 bytes (MeshData.hpp:14 states so in its own doc comment); SleakCraft's
VoxelVertex is 48.

It compounds at the input layout: DirectX11Shader.hpp:57-64 hardcodes DefaultLayout offsets
0/12/24/40/56, and DirectX11Shader.cpp:97 picks between exactly two fixed tables based only on
whether the VS declares BLENDINDICES. So flat_shader.hlsl: whose VS_INPUT (lines 8-14) is precisely
the 48-byte voxel layout with color@24 and uv@40: is fed color from byte 40 and UV from byte 56, at double
the correct stride
.

Consequence: SleakCraft renders garbage geometry on -r d3d11 and -r d3d12. This is the engine's headline
custom-vertex-format abstraction (CLAUDE.md §3) silently absent on two of four backends.

Severity: corruption.

Found by a full audit of the graphics layer. Assessed severity: corruption.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: renderingRenderer, shaders, post processingbackend: dx11Specific to the dx11 backendbackend: dx12Specific to the dx12 backendbackend: openglSpecific to the opengl backendbackend: vulkanSpecific to the vulkan backendbugSomething isn't workingpriority: criticalCrash, data loss, or blocks other workvisualIncorrect or degraded rendering output

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions