xenko
xenko copied to clipboard
XKSL shader compilation issue
Hi there, I noticed a problem with the shader compilation when using StructuredBuffer and custom structs.
Below is the shader that I am writing in XKSL:
shader CustomEffect : ShaderBaseStream
{
struct VertexData
{
float3 test;
float4 test1;
float test2;
};
StructuredBuffer<VertexData> VertexBuffer;
.....
}
And as a result I get the following .hlsl file:
StructuredBuffer<VertexData> VertexBuffer_id16;
struct PS_STREAMS
{
float4 ColorTarget_id1;
};
struct PS_OUTPUT
{
float4 ColorTarget_id1 : SV_Target0;
};
struct VS_STREAMS
{
float4 Position_id15;
float4 ShadingPosition_id0;
};
struct VS_OUTPUT
{
float4 ShadingPosition_id0 : SV_Position;
};
struct VS_INPUT
{
float4 Position_id15 : POSITION;
};
struct VertexData
{
float4 test;
};
.... Now obviously the compiler XKSL to HLSL is doing something silly because my struct VertexData is included after my StructuredBuffer which results in a hlsl compilation error since the VertexData struct is unknown at this stage...
Thanks for the report. This will be fixed in our next 2.0 release.