Validate SPIR-V code when creating ShaderModules

This integrates spirv-val in dawn_native so that regular and
WebGPU-specific validation of shaders is done.

Also adds tests to check OpUndef is correctly rejected so we know
WebGPU-specific validation is working.

Change-Id: If49d276c98bca8cd3c6c1a420903fe34923a2942
This commit is contained in:
Corentin Wallez
2018-09-06 17:25:46 +02:00
committed by Corentin Wallez
parent ae62847f1c
commit 21d8438ad6
10 changed files with 189 additions and 36 deletions

View File

@@ -47,6 +47,7 @@ class ValidationTest : public testing::Test {
void StartExpectDeviceError();
bool EndExpectDeviceError();
std::string GetLastDeviceErrorMessage() const;
dawn::RenderPassDescriptor CreateSimpleRenderPass();
@@ -66,6 +67,7 @@ class ValidationTest : public testing::Test {
private:
static void OnDeviceError(const char* message, dawnCallbackUserdata userdata);
std::string mDeviceErrorMessage;
bool mExpectError = false;
bool mError = false;