style(renderer): explicit error sets

This commit is contained in:
Qwerasd
2025-06-20 15:16:31 -06:00
parent 9d00018f8b
commit ea7a91e2ba
5 changed files with 42 additions and 25 deletions

View File

@@ -284,14 +284,17 @@ pub inline fn textureOptions(self: Metal) Texture.Options {
}
/// Initializes a Texture suitable for the provided font atlas.
pub fn initAtlasTexture(self: *const Metal, atlas: *const font.Atlas) !Texture {
pub fn initAtlasTexture(
self: *const Metal,
atlas: *const font.Atlas,
) Texture.Error!Texture {
const pixel_format: mtl.MTLPixelFormat = switch (atlas.format) {
.grayscale => .r8unorm,
.rgba => .bgra8unorm,
else => @panic("unsupported atlas format for Metal texture"),
};
return Texture.init(
return try Texture.init(
.{
.device = self.device,
.pixel_format = pixel_format,