Update DeviceLostTests to use WGSL

Bug: dawn:572
Change-Id: I0555f88baa42c6fdd236478ab2ad4d7ba59448ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33763
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Austin Eng 2020-11-26 13:23:55 +00:00 committed by Commit Bot service account
parent 225074a74a
commit 21c1e5f623
1 changed files with 13 additions and 15 deletions

View File

@ -110,14 +110,13 @@ TEST_P(DeviceLostTest, CreateBindGroupLayoutFails) {
// Test that GetBindGroupLayout fails when device is lost
TEST_P(DeviceLostTest, GetBindGroupLayoutFails) {
wgpu::ShaderModule csModule =
utils::CreateShaderModule(device, utils::SingleShaderStage::Compute, R"(
#version 450
layout(set = 0, binding = 0) uniform UniformBuffer {
vec4 pos;
};
void main() {
})");
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[block]] struct UniformBuffer {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> ubo : UniformBuffer;
[[stage(compute)]] fn main() -> void {
})");
wgpu::ComputePipelineDescriptor descriptor;
descriptor.layout = nullptr;
@ -199,13 +198,12 @@ TEST_P(DeviceLostTest, CreateSamplerFails) {
TEST_P(DeviceLostTest, CreateShaderModuleFails) {
SetCallbackAndLoseForTesting();
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"(
#version 450
layout(location = 0) in vec4 color;
layout(location = 0) out vec4 fragColor;
void main() {
fragColor = color;
})"));
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, R"(
[[location(0)]] var<in> color : vec4<f32>;
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
fragColor = color;
})"));
}
// Tests that CreateSwapChain fails when device is lost