writer/hlsl: Don't emit literal integer divide-by-zeros

FXC errors on these, and they are undefined behavior in WGSL.

Bug: tint:1083
Change-Id: I7643fdc6991f8729f274535b603b761398412398
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60500
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-08-03 17:51:32 +00:00
committed by Tint LUCI CQ
parent 72dad76c21
commit 51750f15d2
7 changed files with 48 additions and 8 deletions

View File

@@ -5,5 +5,5 @@ void f() {
const int c = (1 / 0);
return;
}
C:\src\tint\test\Shader@0x000001BC7A7DD8D0(3,18-22): error X4010: Unsigned integer divide by zero
O:\src\chrome\src\third_party\dawn\third_party\tint\test\Shader@0x000002477B82F5C0(3,18-22): error X4010: Unsigned integer divide by zero