Skip to content

Commit

Permalink
WebGPU: fixed DrawCommandTest.StructuredBufferArray test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Jul 6, 2024
1 parent f5112c4 commit 006e57a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Tests/DiligentCoreAPITest/src/DrawCommandTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,30 @@ void main(in uint VertId : SV_VertexID,
)"
};

const std::string DrawTest_VSStructuredBufferArray_WGPU{
R"(
struct BufferData
{
float4 data;
};
StructuredBuffer<BufferData> g_Buffers_0;
StructuredBuffer<BufferData> g_Buffers_1;
struct PSInput
{
float4 Pos : SV_POSITION;
float3 Color : COLOR;
};
void main(in uint VertId : SV_VertexID,
out PSInput PSIn)
{
PSIn.Pos = g_Buffers_0[VertId].data;
PSIn.Color = g_Buffers_1[VertId].data.rgb;
}
)"
};

const std::string DrawTest_VSFormattedBuffers{
R"(
Expand Down Expand Up @@ -2888,6 +2912,10 @@ void DrawCommandTest::TestStructuredOrFormattedBuffers(BUFFER_MODE BuffMode,
{
ShaderCI.Source = UseArray ? HLSL::DrawTest_VSStructuredBufferArray.c_str() : HLSL::DrawTest_VSStructuredBuffers.c_str();
}
else if (DeviceInfo.IsWebGPUDevice())
{
ShaderCI.Source = UseArray ? HLSL::DrawTest_VSStructuredBufferArray_WGPU.c_str() : HLSL::DrawTest_VSStructuredBuffers.c_str();
}
else
{
if (UseArray)
Expand Down

0 comments on commit 006e57a

Please sign in to comment.