adding descriptor writes for storage buffers
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
const std = @import("std");
|
||||
const vk = @import("vulkan");
|
||||
const base = @import("base");
|
||||
const spv = @import("spv");
|
||||
|
||||
const SoftDevice = @import("../SoftDevice.zig");
|
||||
const SoftPipeline = @import("../SoftPipeline.zig");
|
||||
|
||||
const VkError = base.VkError;
|
||||
|
||||
const Self = @This();
|
||||
|
||||
device: *SoftDevice,
|
||||
pipeline: ?*SoftPipeline,
|
||||
|
||||
pub fn init(device: *SoftDevice) Self {
|
||||
return .{
|
||||
.device = device,
|
||||
.pipeline = null,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn destroy(self: *Self) void {
|
||||
_ = self;
|
||||
}
|
||||
|
||||
pub fn bindPipeline(self: *Self, pipeline: *SoftPipeline) void {
|
||||
self.pipeline = pipeline;
|
||||
}
|
||||
@@ -2,24 +2,38 @@ const std = @import("std");
|
||||
const vk = @import("vulkan");
|
||||
const base = @import("base");
|
||||
|
||||
const SoftDevice = @import("../SoftDevice.zig");
|
||||
const SoftImage = @import("../SoftImage.zig");
|
||||
const SoftPipeline = @import("../SoftPipeline.zig");
|
||||
|
||||
const ComputeRoutines = @import("ComputeRoutines.zig");
|
||||
|
||||
const cmd = base.commands;
|
||||
const VkError = base.VkError;
|
||||
|
||||
const Self = @This();
|
||||
|
||||
pub fn init() Self {
|
||||
return .{};
|
||||
compute_routine: ComputeRoutines,
|
||||
|
||||
pub fn init(device: *SoftDevice) Self {
|
||||
return .{
|
||||
.compute_routine = .init(device),
|
||||
};
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Self) void {
|
||||
_ = self;
|
||||
self.compute_routine.destroy();
|
||||
}
|
||||
|
||||
pub fn dispatch(self: *Self, command: *const cmd.Command) VkError!void {
|
||||
_ = self;
|
||||
switch (command.*) {
|
||||
.BindPipeline => |data| {
|
||||
if (data.bind_point == .compute) {
|
||||
self.compute_routine.bindPipeline(@alignCast(@fieldParentPtr("interface", data.pipeline)));
|
||||
} else {
|
||||
// TODO
|
||||
}
|
||||
},
|
||||
.ClearColorImage => |data| try clearColorImage(&data),
|
||||
.CopyBuffer => |data| try copyBuffer(&data),
|
||||
.CopyImage => |data| try copyImage(&data),
|
||||
|
||||
Reference in New Issue
Block a user