gpu: panic on z-buffer overflow

Drawing more than 65k objects is reasonable, but not today.

Updates gio#127

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-08 15:51:29 +02:00
parent 700d8d8c2c
commit 52864950f1
+4
View File
@@ -750,6 +750,10 @@ loop:
continue
}
state.z++
if state.z != int(uint16(state.z)) {
// TODO(eliasnaur) gioui.org/issue/127.
panic("more than 65k paint objects not supported")
}
// Assume 16-bit depth buffer.
const zdepth = 1 << 16
// Convert z to window-space, assuming depth range [0;1].