Run substitute_overrides for all tests.

This CL updates all of the integration tests to run the substitute_override
transform where needed. The test runner is updated to match comments in
the spvasm files as well as the wgsl files.

Bug: tint:1155
Change-Id: I8187d426970d056d744e530ed6447e4ec69db5f4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101661
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
dan sinclair 2022-09-09 16:04:39 +00:00 committed by Dawn LUCI CQ
parent 93df967003
commit e214a130dd
19 changed files with 33 additions and 36 deletions

View File

@ -1,3 +1,5 @@
// flags: --transform substitute_override
@id(0) override x_dim = 2;
@compute

View File

@ -1,9 +1,4 @@
#ifndef WGSL_SPEC_CONSTANT_0
#define WGSL_SPEC_CONSTANT_0 2
#endif
static const int x_dim = WGSL_SPEC_CONSTANT_0;
[numthreads(3, WGSL_SPEC_CONSTANT_0, 3)]
[numthreads(3, 2, 3)]
void main() {
return;
}

View File

@ -1,9 +1,4 @@
#ifndef WGSL_SPEC_CONSTANT_0
#define WGSL_SPEC_CONSTANT_0 2
#endif
static const int x_dim = WGSL_SPEC_CONSTANT_0;
[numthreads(3, WGSL_SPEC_CONSTANT_0, 3)]
[numthreads(3, 2, 3)]
void main() {
return;
}

View File

@ -1,13 +1,9 @@
#version 310 es
#ifndef WGSL_SPEC_CONSTANT_0
#define WGSL_SPEC_CONSTANT_0 2
#endif
const int x_dim = WGSL_SPEC_CONSTANT_0;
void tint_symbol() {
}
layout(local_size_x = 3, local_size_y = WGSL_SPEC_CONSTANT_0, local_size_z = 3) in;
layout(local_size_x = 3, local_size_y = 2, local_size_z = 3) in;
void main() {
tint_symbol();
return;

View File

@ -1,8 +1,6 @@
#include <metal_stdlib>
using namespace metal;
constant int x_dim [[function_constant(0)]];
kernel void tint_symbol() {
return;
}

View File

@ -1,26 +1,16 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 12
; Bound: 5
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpName %x_dim "x_dim"
OpExecutionMode %main LocalSize 3 2 3
OpName %main "main"
OpDecorate %x_dim SpecId 0
OpDecorate %11 SpecId 0
OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
%int = OpTypeInt 32 1
%x_dim = OpSpecConstant %int 2
%void = OpTypeVoid
%3 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%11 = OpSpecConstant %uint 2
%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %uint_3 %11 %uint_3
%main = OpFunction %void None %3
%6 = OpLabel
%1 = OpTypeFunction %void
%main = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd

View File

@ -1,4 +1,4 @@
@id(0) override x_dim = 2;
const x_dim = 2;
@compute @workgroup_size((1 + 2), x_dim, clamp(((1 - 2) + 4), 0, 5))
fn main() {

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_DeclareConst_F32.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,4 @@
; flags: --transform substitute_override
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_DeclareConst_F32_WithoutSpecId.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_DeclareConst_False.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_DeclareConst_I32.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_DeclareConst_Id_MaxValid.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_DeclareConst_True.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_DeclareConst_U32.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvModuleScopeVarParserTest_ScalarSpecConstant_UsedInFunction.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvParserTest_EmitFunctions_Function_EntryPoint_LocalSize_And_WGSBuiltin_SpecConstant.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvParserTest_EmitFunctions_Function_EntryPoint_WorkgroupSizeBuiltin_SpecConstant_Only.spvasm
; SPIR-V
; Version: 1.0

View File

@ -1,3 +1,5 @@
; flags: --transform substitute_override
;
; Test: SpvParserTest_EmitFunctions_Function_EntryPoint_WorkgroupSize_MixedConstantSpecConstant.spvasm
; SPIR-V
; Version: 1.0

View File

@ -767,7 +767,7 @@ func invoke(wd, exe string, args ...string) (ok bool, output string) {
return true, str
}
var reFlags = regexp.MustCompile(` *\/\/ *flags:(.*)\n`)
var reFlags = regexp.MustCompile(`^ *(?:\/\/|;) *flags:(.*) *\n`)
// parseFlags looks for a `// flags:` header at the start of the file with the
// given path, returning each of the space delimited tokens that follow for the