adding base spv interpreter
This commit is contained in:
@@ -14,6 +14,8 @@ pub const ObjectType: vk.ObjectType = .pipeline;
|
||||
owner: *Device,
|
||||
|
||||
vtable: *const VTable,
|
||||
bind_point: vk.PipelineBindPoint,
|
||||
stages: vk.ShaderStageFlags,
|
||||
|
||||
pub const VTable = struct {
|
||||
destroy: *const fn (*Self, std.mem.Allocator) void,
|
||||
@@ -22,20 +24,34 @@ pub const VTable = struct {
|
||||
pub fn initCompute(device: *Device, allocator: std.mem.Allocator, cache: ?*PipelineCache, info: *const vk.ComputePipelineCreateInfo) VkError!Self {
|
||||
_ = allocator;
|
||||
_ = cache;
|
||||
_ = info;
|
||||
|
||||
var stages: vk.ShaderStageFlags = .{};
|
||||
for (info.p_stages[0..info.stage_count]) |stage| {
|
||||
stages = stages.merge(stage orelse continue);
|
||||
}
|
||||
|
||||
return .{
|
||||
.owner = device,
|
||||
.vtable = undefined,
|
||||
.bind_point = .compute,
|
||||
.stages = stages,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn initGraphics(device: *Device, allocator: std.mem.Allocator, cache: ?*PipelineCache, info: *const vk.GraphicsPipelineCreateInfo) VkError!Self {
|
||||
_ = allocator;
|
||||
_ = cache;
|
||||
_ = info;
|
||||
|
||||
var stages: vk.ShaderStageFlags = .{};
|
||||
for (info.p_stages[0..info.stage_count]) |stage| {
|
||||
stages = stages.merge(stage orelse continue);
|
||||
}
|
||||
|
||||
return .{
|
||||
.owner = device,
|
||||
.vtable = undefined,
|
||||
.bind_point = .graphics,
|
||||
.stages = stages,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ pub const DRIVER_DEBUG_ALLOCATOR_ENV_NAME = "STROLL_DEBUG_ALLOCATOR";
|
||||
pub const DRIVER_LOGS_ENV_NAME = "STROLL_LOGS_LEVEL";
|
||||
|
||||
/// Default driver name
|
||||
pub const DRIVER_NAME = "Unnamed Driver";
|
||||
pub const DRIVER_NAME = "Unnamed Stroll Driver";
|
||||
/// Default Vulkan version
|
||||
pub const VULKAN_VERSION = vk.makeApiVersion(0, 1, 0, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user