Make HLSL cache key guard comment ASSERT more specific
SPIRV-Cross still emits some comments, so for now, just check that the specific guard comments Dawn uses are not contained in the HLSL output. Bug: dawn:549 Change-Id: Ia6d32befa5ef983e56494542d46e9c3592b6480a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36300 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
0eb61724c8
commit
9a38e5b60d
|
@ -372,11 +372,14 @@ namespace dawn_native { namespace d3d12 {
|
||||||
// blob.
|
// blob.
|
||||||
// These strings can be HLSL comments because Tint does not emit HLSL comments.
|
// These strings can be HLSL comments because Tint does not emit HLSL comments.
|
||||||
// TODO(dawn:549): Replace guards strings with something more secure.
|
// TODO(dawn:549): Replace guards strings with something more secure.
|
||||||
ASSERT(hlslSource.find("//") == std::string::npos);
|
constexpr char kStartGuard[] = "// Start shader autogenerated by Dawn.";
|
||||||
|
constexpr char kEndGuard[] = "// End shader autogenerated by Dawn.";
|
||||||
|
ASSERT(hlslSource.find(kStartGuard) == std::string::npos);
|
||||||
|
ASSERT(hlslSource.find(kEndGuard) == std::string::npos);
|
||||||
|
|
||||||
stream << "// Start shader autogenerated by Dawn.";
|
stream << kStartGuard << "\n";
|
||||||
stream << hlslSource;
|
stream << hlslSource;
|
||||||
stream << "// End of shader autogenerated by Dawn.";
|
stream << "\n" << kEndGuard;
|
||||||
|
|
||||||
stream << compileFlags;
|
stream << compileFlags;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue