blob: 4262e11cb661f2e4d77241020e825dc2cf64f0b2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<title>Test shader validation.</title>
<script src="js/webgpu-functions.js"></script>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
const shaders = `
struct Vertex
{
float4 position : SV_Position;
float4 attributePosition : attribute(0);
};
vertex Vertex vertex_main()
{
Vertex result;
result.position = float4(0, 0, 0, 1);
result.attributePosition = result.position;
return result;
}
fragment float4 fragment_main(float4 position : attribute(0)) : SV_Target 0
{
return position;
}
`
promise_test(() => {
return getBasicDevice().then(function(device) {
let shaderModule = device.createShaderModule({ code: shaders });
assert_true(shaderModule instanceof GPUShaderModule, "Shader module created successfully.");
}, function() {
});
}, "Test shader code validation when creating modules.");
</script>
</html>