Nothing
This commit is contained in:
@@ -23,11 +23,9 @@ pub fn init(engine: *Engine, queue_type: QueueType) !CommandBuffer {
|
||||
.queue_type = queue_type,
|
||||
.level = .primary,
|
||||
});
|
||||
const proxy: vk.CommandBufferProxy = .init(handle, engine.device.wrapper);
|
||||
const allocator = engine.vk_allocator.allocator;
|
||||
return .{
|
||||
.proxy = proxy,
|
||||
.allocator = allocator,
|
||||
.proxy = .init(handle, engine.device.wrapper),
|
||||
.allocator = engine.vk_allocator.allocator,
|
||||
.queue_type = queue_type,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ pub fn init(allocator: std.mem.Allocator, maybe_window: ?*glfw.Window) !Engine {
|
||||
var queue_create_info: std.ArrayList(vk.DeviceQueueCreateInfo) = .initBuffer(&queue_create_info_buffer);
|
||||
|
||||
const queue_allocations: QueueAllocations = blk: {
|
||||
var queue_allocator: QueueAllocator = .init(instance, physical_device);
|
||||
var queue_allocator = QueueAllocator.init(instance, physical_device);
|
||||
const queue_families_properties = queue_allocator.queueFamiliesProperties();
|
||||
|
||||
const graphics_queue_family = findGraphicsQueueFamily(queue_families_properties) orelse return error.NoGraphicsQueue;
|
||||
@@ -347,21 +347,21 @@ pub fn init(allocator: std.mem.Allocator, maybe_window: ?*glfw.Window) !Engine {
|
||||
}, &vk_allocator.interface);
|
||||
errdefer device.destroyCommandPool(transfer_command_pool, &vk_allocator.interface);
|
||||
|
||||
const graphics_queue: Queue = .init(
|
||||
const graphics_queue = Queue.init(
|
||||
device.getDeviceQueue(
|
||||
queue_allocations.graphics_queue.family,
|
||||
queue_allocations.graphics_queue.index,
|
||||
),
|
||||
queue_allocations.graphics_queue,
|
||||
);
|
||||
const compute_queue: Queue = .init(
|
||||
const compute_queue = Queue.init(
|
||||
device.getDeviceQueue(
|
||||
queue_allocations.compute_queue.family,
|
||||
queue_allocations.compute_queue.index,
|
||||
),
|
||||
queue_allocations.compute_queue,
|
||||
);
|
||||
const transfer_queue: Queue = .init(
|
||||
const transfer_queue = Queue.init(
|
||||
device.getDeviceQueue(
|
||||
queue_allocations.transfer_queue.family,
|
||||
queue_allocations.transfer_queue.index,
|
||||
@@ -692,6 +692,10 @@ fn findPresentationQueueFamily(queue_families_properties: []const vk.QueueFamily
|
||||
return null;
|
||||
}
|
||||
|
||||
fn makeArena(self: *const Engine) std.heap.ArenaAllocator {
|
||||
return .init(self.vk_allocator.allocator);
|
||||
}
|
||||
|
||||
fn resolveCommandPool(self: *const Engine, queue_type: QueueType) vk.CommandPool {
|
||||
return switch (queue_type) {
|
||||
.graphics => self.graphics_command_pool,
|
||||
@@ -975,7 +979,7 @@ pub fn bindImageMemory(self: *Engine, image: vk.Image, memory: vk.DeviceMemory,
|
||||
}
|
||||
|
||||
pub fn createBuffer(self: *Engine, create_info: BufferCreateInfo) !vk.Buffer {
|
||||
var arena: std.heap.ArenaAllocator = .init(self.vk_allocator.allocator);
|
||||
var arena = self.makeArena();
|
||||
defer arena.deinit();
|
||||
const allocator = arena.allocator();
|
||||
|
||||
@@ -998,7 +1002,7 @@ pub fn createBuffer(self: *Engine, create_info: BufferCreateInfo) !vk.Buffer {
|
||||
}
|
||||
|
||||
pub fn createDescriptorSetLayout(self: *Engine, create_info: DescriptorSetLayoutCreateInfo) !vk.DescriptorSetLayout {
|
||||
var arena: std.heap.ArenaAllocator = .init(self.vk_allocator.allocator);
|
||||
var arena = self.makeArena();
|
||||
defer arena.deinit();
|
||||
const allocator = arena.allocator();
|
||||
|
||||
@@ -1074,7 +1078,7 @@ pub fn createFramebuffer(self: *Engine, create_info: FramebufferCreateInfo) !vk.
|
||||
}
|
||||
|
||||
pub fn createGraphicsPipeline(self: *Engine, create_info: GraphicsPipelineCreateInfo) !vk.Pipeline {
|
||||
var arena: std.heap.ArenaAllocator = .init(self.vk_allocator.allocator);
|
||||
var arena = self.makeArena();
|
||||
defer arena.deinit();
|
||||
const allocator = arena.allocator();
|
||||
|
||||
@@ -1153,7 +1157,7 @@ pub fn createGraphicsPipeline(self: *Engine, create_info: GraphicsPipelineCreate
|
||||
}
|
||||
|
||||
pub fn createImage(self: *Engine, create_info: ImageCreateInfo) !vk.Image {
|
||||
var arena: std.heap.ArenaAllocator = .init(self.vk_allocator.allocator);
|
||||
var arena = self.makeArena();
|
||||
defer arena.deinit();
|
||||
const allocator = arena.allocator();
|
||||
|
||||
@@ -1206,7 +1210,7 @@ pub fn createPipelineLayout(self: *Engine, create_info: PipelineLayoutCreateInfo
|
||||
}
|
||||
|
||||
pub fn createRenderPass(self: *Engine, create_info: RenderPassCreateInfo) !vk.RenderPass {
|
||||
var arena: std.heap.ArenaAllocator = .init(self.vk_allocator.allocator);
|
||||
var arena = self.makeArena();
|
||||
defer arena.deinit();
|
||||
const allocator = arena.allocator();
|
||||
|
||||
@@ -1258,7 +1262,7 @@ pub fn createShaderModule(self: *Engine, create_info: ShaderModuleCreateInfo) !v
|
||||
}
|
||||
|
||||
pub fn createSwapchain(self: *Engine, create_info: SwapchainCreateInfo) !vk.SwapchainKHR {
|
||||
var arena: std.heap.ArenaAllocator = .init(self.vk_allocator.allocator);
|
||||
var arena = self.makeArena();
|
||||
defer arena.deinit();
|
||||
const allocator = arena.allocator();
|
||||
|
||||
@@ -1402,7 +1406,7 @@ pub fn unmapMemory(self: *Engine, memory: vk.DeviceMemory) void {
|
||||
}
|
||||
|
||||
pub fn updateDescriptorSets(self: *Engine, update_info: DescriptorSetsUpdateInfo) !void {
|
||||
var arena: std.heap.ArenaAllocator = .init(self.vk_allocator.allocator);
|
||||
var arena = self.makeArena();
|
||||
defer arena.deinit();
|
||||
const allocator = arena.allocator();
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ fn allocationFunction(
|
||||
) callconv(vk.vulkan_call_conv) ?*anyopaque {
|
||||
const self: *VkAllocator = @ptrCast(@alignCast(p_user_data.?));
|
||||
|
||||
const desired_alignment: std.mem.Alignment = .fromByteUnits(alignment);
|
||||
const desired_alignment = std.mem.Alignment.fromByteUnits(alignment);
|
||||
std.debug.assert(std.mem.Alignment.compare(actual_alignment, .gte, desired_alignment));
|
||||
|
||||
self.mutex.lock();
|
||||
@@ -91,7 +91,7 @@ fn reallocationFunction(
|
||||
) callconv(vk.vulkan_call_conv) ?*anyopaque {
|
||||
const self: *VkAllocator = @ptrCast(@alignCast(p_user_data.?));
|
||||
|
||||
const desired_alignment: std.mem.Alignment = .fromByteUnits(alignment);
|
||||
const desired_alignment = std.mem.Alignment.fromByteUnits(alignment);
|
||||
std.debug.assert(std.mem.Alignment.compare(actual_alignment, .gte, desired_alignment));
|
||||
|
||||
self.mutex.lock();
|
||||
|
||||
Reference in New Issue
Block a user