Clamp skybox to prevent +inf overflow
This commit is contained in:
@@ -41,6 +41,11 @@ pub fn load(filename: []const u8, engine: *Engine, cube_size: u32, global_unifor
|
||||
defer img.deinit();
|
||||
std.debug.assert(img.num_components == 4);
|
||||
|
||||
// clamp +inf to max half float
|
||||
for (std.mem.bytesAsSlice(f16, img.data)) |*sample| {
|
||||
sample.* = @min(sample.*, std.math.floatMax(f16));
|
||||
}
|
||||
|
||||
// --- SYNCHRONIZATION PRIMITIVES ------------------------------------------
|
||||
|
||||
const semaphore_transfer_transition = try engine.createSemaphore();
|
||||
|
||||
Reference in New Issue
Block a user