style(renderer): capture generic consts as decls in returned struct

Out of an abundance of caution, since there have been issues in the past
relating to consts outside of the returned struct.
pull/7620/head
Qwerasd 2025-06-20 14:51:55 -06:00
parent b9e35c5970
commit dccbec2283
1 changed files with 15 additions and 15 deletions

View File

@ -68,24 +68,24 @@ const log = std.log.scoped(.generic_renderer);
/// [ Texture ] - An abstraction over a GPU texture. /// [ Texture ] - An abstraction over a GPU texture.
/// ///
pub fn Renderer(comptime GraphicsAPI: type) type { pub fn Renderer(comptime GraphicsAPI: type) type {
const Target = GraphicsAPI.Target;
const Buffer = GraphicsAPI.Buffer;
const Texture = GraphicsAPI.Texture;
const RenderPass = GraphicsAPI.RenderPass;
const shaderpkg = GraphicsAPI.shaders;
const cellpkg = GraphicsAPI.cellpkg;
const imagepkg = GraphicsAPI.imagepkg;
const Image = imagepkg.Image;
const ImageMap = imagepkg.ImageMap;
const Shaders = shaderpkg.Shaders;
const ImagePlacementList = std.ArrayListUnmanaged(imagepkg.Placement);
return struct { return struct {
const Self = @This(); const Self = @This();
const Target = GraphicsAPI.Target;
const Buffer = GraphicsAPI.Buffer;
const Texture = GraphicsAPI.Texture;
const RenderPass = GraphicsAPI.RenderPass;
const shaderpkg = GraphicsAPI.shaders;
const cellpkg = GraphicsAPI.cellpkg;
const imagepkg = GraphicsAPI.imagepkg;
const Image = imagepkg.Image;
const ImageMap = imagepkg.ImageMap;
const Shaders = shaderpkg.Shaders;
const ImagePlacementList = std.ArrayListUnmanaged(imagepkg.Placement);
/// Allocator that can be used /// Allocator that can be used
alloc: std.mem.Allocator, alloc: std.mem.Allocator,