convert the last lossy casts to checked ones

This commit is contained in:
2026-09-21 01:22:16 +03:00
parent cd583ba02b
commit d297ec4271
5 changed files with 47 additions and 25 deletions
+3 -1
View File
@@ -152,7 +152,9 @@ impl TonemapPipeline {
-1.0, 3.0, 0.0, -1.0, // top-left (off-screen)
];
let vb_desc = D3D11_BUFFER_DESC {
ByteWidth: size_of_val(&verts) as u32,
// verts is a 12-float array, so the size is a compile-time constant
// well inside u32.
ByteWidth: u32::try_from(size_of_val(&verts)).unwrap_or(0),
Usage: D3D11_USAGE_IMMUTABLE,
BindFlags: D3D11_BIND_VERTEX_BUFFER.0 as u32,
CPUAccessFlags: 0,