Use Tint to extract local workgroup size

BUG=dawn:578

Change-Id: I7526fdcc3ee96099d1487cd159a7bea9210f2b4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38143
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Ryan Harrison 2021-01-19 18:09:31 +00:00 committed by Commit Bot service account
parent 0f9c2d7b78
commit 1dee9164bf
1 changed files with 11 additions and 1 deletions

View File

@ -711,6 +711,10 @@ namespace dawn_native {
auto metadata = std::make_unique<EntryPointMetadata>();
metadata->stage = PipelineStateToShaderStage(entryPoint.stage);
metadata->localWorkgroupSize.x = entryPoint.workgroup_size_x;
metadata->localWorkgroupSize.y = entryPoint.workgroup_size_y;
metadata->localWorkgroupSize.z = entryPoint.workgroup_size_z;
result[entryPoint.name] = std::move(metadata);
}
return std::move(result);
@ -770,13 +774,19 @@ namespace dawn_native {
"Tint and SPIRV-Cross returned different stages for entry point");
}
if (tintEntry->localWorkgroupSize.x != tintEntry->localWorkgroupSize.x ||
tintEntry->localWorkgroupSize.y != tintEntry->localWorkgroupSize.y ||
tintEntry->localWorkgroupSize.z != tintEntry->localWorkgroupSize.z) {
return DAWN_VALIDATION_ERROR(
"Tint and SPIRV-Cross returned different values for local workgroup size");
}
// TODO(rharrison): Use the Inspector to get this data.
tintEntry->bindings = crossEntry->bindings;
tintEntry->usedVertexAttributes = crossEntry->usedVertexAttributes;
tintEntry->fragmentOutputFormatBaseTypes =
crossEntry->fragmentOutputFormatBaseTypes;
tintEntry->fragmentOutputsWritten = crossEntry->fragmentOutputsWritten;
tintEntry->localWorkgroupSize = crossEntry->localWorkgroupSize;
}
return {};
}