mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 08:06:19 +00:00
Pipeline overridable constants: D3D12 backend
D3D12 doesn't have native pipeline constants feature. This is done by using #define. Add some new tests to make sure these define approaches work as expected. Also makes duplicate pipeline constant entries an invalid case. Bug: dawn:1137 Change-Id: Iefed44a749625b535bbafbb39f42699f0b42e06a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68860 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
@@ -105,12 +105,12 @@ TEST_F(ComputePipelineOverridableConstantsValidationTest, ConstantsIdentifierLoo
|
||||
TestCreatePipeline(constants);
|
||||
}
|
||||
{
|
||||
// Valid: set the same constant twice
|
||||
// Error: set the same constant twice
|
||||
std::vector<wgpu::ConstantEntry> constants{
|
||||
{nullptr, "c0", 0},
|
||||
{nullptr, "c0", 1},
|
||||
};
|
||||
TestCreatePipeline(constants);
|
||||
ASSERT_DEVICE_ERROR(TestCreatePipeline(constants));
|
||||
}
|
||||
{
|
||||
// Valid: find by constant numeric id
|
||||
@@ -158,12 +158,12 @@ TEST_F(ComputePipelineOverridableConstantsValidationTest, UninitializedConstants
|
||||
TestCreatePipeline(constants);
|
||||
}
|
||||
{
|
||||
// Valid: all constants initialized (with duplicate initializations)
|
||||
// Error: duplicate initializations
|
||||
std::vector<wgpu::ConstantEntry> constants{
|
||||
{nullptr, "c0", false}, {nullptr, "c2", 1}, {nullptr, "c5", 1},
|
||||
{nullptr, "c8", 1}, {nullptr, "c2", 2},
|
||||
};
|
||||
TestCreatePipeline(constants);
|
||||
ASSERT_DEVICE_ERROR(TestCreatePipeline(constants));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user