struct Input
{
    float4 Color : TEXCOORD0;
    float2 UV : TEXCOORD1;
};

#include "RootConstants.hlsl"

float4 main(Input input) : SV_Target0
{
    // Retrieve the texture using SM6.6 bindless syntax
    // Texture2D texture = ResourceDescriptorHeap[TextureIndex]; (Must cast to Texture2D<float4>)
    // Wait, ResourceDescriptorHeap indexing returns a wrapper, usually we use Textures[TextureIndex]?
    // Juliet seems to use `ResourceDescriptorHeap` for Buffers.
    // Let's check Triangle.vert/frag.
    
    // In bindless, usually:
    // Texture2D<float4> tex = ResourceDescriptorHeap[TextureIndex];
    // SamplerState samp = SamplerDescriptorHeap[0]; // Assuming static sampler or passed index
    
    // I need to check how Juliet accesses textures.
    // I'll assume standard SM6.6 usage.
    Texture2D<float4> tex = ResourceDescriptorHeap[TextureIndex];
    SamplerState      samp = SamplerDescriptorHeap[0]; // Point sampler or Linear? ImGui usually uses Linear.
    // D3D12GraphicsDevice.cpp created static samplers.
    // Root signature has Static Samplers.
    // RegisterSpace 0.
    // Sampler register 0 is Point/Nearest?
    // Let's check CreateGraphicsRootSignature in D3D12GraphicsDevice.cpp.
    // It creates s_nearest at 0.
    
    // If I want Linear, I might need another sampler or rely on s_nearest for font (pixel art font?)
    // Default ImGui font is usually antialiased, so Linear is preferred.
    // But pixel aligned UI... 
    // I will use `SamplerDescriptorHeap[0]` for now.
    
    return input.Color * tex.Sample(samp, input.UV);
}
