mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 14:13:39 +00:00
Make usage of overridable constants a validation error
This feature is not yet implemented in Tint and it not planned for OT. BUG=dawn:799 Change-Id: Ib97dcd39e8ae956aa6fdc4cc1b148ec7f101b061 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54280 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
3a9174a4c9
commit
8c584a1f4c
@ -886,6 +886,11 @@ namespace dawn_native {
|
||||
for (auto& entryPoint : entryPoints) {
|
||||
ASSERT(result.count(entryPoint.name) == 0);
|
||||
|
||||
if (!entryPoint.overridable_constants.empty()) {
|
||||
return DAWN_VALIDATION_ERROR(
|
||||
"Pipeline overridable constants are not implemented yet");
|
||||
}
|
||||
|
||||
auto metadata = std::make_unique<EntryPointMetadata>();
|
||||
|
||||
DAWN_TRY_ASSIGN(metadata->stage, TintPipelineStageToShaderStage(entryPoint.stage));
|
||||
|
@ -305,6 +305,23 @@ fn fragmentMain(input : VertexOut) -> [[location(0)]] vec4<f32> {
|
||||
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&rpDesc);
|
||||
}
|
||||
|
||||
// Feature currently not implemented in Tint, so should fail validation.
|
||||
TEST_P(ShaderTests, PipelineOverridableUsed) {
|
||||
DAWN_TEST_UNSUPPORTED_IF(HasToggleEnabled("skip_validation"));
|
||||
DAWN_TEST_UNSUPPORTED_IF(!HasToggleEnabled("use_tint_generator"));
|
||||
|
||||
std::string shader = R"(
|
||||
[[override]] let foo : f32;
|
||||
|
||||
[[stage(compute)]]
|
||||
fn ep_func() {
|
||||
var local_foo : f32;
|
||||
local_foo = foo;
|
||||
return;
|
||||
})";
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, shader.c_str()));
|
||||
}
|
||||
|
||||
DAWN_INSTANTIATE_TEST(ShaderTests,
|
||||
D3D12Backend(),
|
||||
MetalBackend(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user