Added:
- Depth buffer - Debug display basics - Basic vector + matrix maths Made partially with gemini + antigravity
This commit is contained in:
@@ -1,34 +1,25 @@
|
||||
struct Input
|
||||
{
|
||||
uint VertexIndex : SV_VertexID;
|
||||
};
|
||||
|
||||
struct Output
|
||||
{
|
||||
float4 Color : TEXCOORD0;
|
||||
float4 Position : SV_Position;
|
||||
};
|
||||
|
||||
// Bindless storage buffer access
|
||||
// We assume DescriptorIndex 0 is our buffer for this example, or passed via push constant
|
||||
// Since we don't have push constants hooked up in the C++ simplified example yet,
|
||||
// we will assume the First descriptor in the heap is our buffer (Index 0).
|
||||
// In a real app, 'bufferIndex' would be passed as a Root Constant.
|
||||
#include "RootConstants.hlsl"
|
||||
|
||||
Output main(Input input)
|
||||
Output main(uint vertexIndex : SV_VertexID)
|
||||
{
|
||||
Output output;
|
||||
|
||||
// Retrieve the buffer using SM6.6 bindless syntax
|
||||
// heap index 0 is used for simplicity.
|
||||
uint bufferIndex = 0;
|
||||
// We use index 0 as the sample app doesn't pass push constants yet.
|
||||
uint bufferIndex = 0;
|
||||
ByteAddressBuffer buffer = ResourceDescriptorHeap[bufferIndex];
|
||||
|
||||
// Read position from buffer (Index * stride)
|
||||
// Stride = 2 float (pos) + 4 float (color) = 6 * 4 = 24 bytes ?
|
||||
// Let's assume just position 2D (8 bytes) + Color (16 bytes)
|
||||
uint stride = 24;
|
||||
uint offset = input.VertexIndex * stride;
|
||||
uint offset = vertexIndex * stride;
|
||||
|
||||
float2 pos = asfloat(buffer.Load2(offset));
|
||||
float4 col = asfloat(buffer.Load4(offset + 8));
|
||||
|
||||
Reference in New Issue
Block a user