adding base spv interpreter

This commit is contained in:
2026-01-25 17:57:17 +01:00
parent 87c6a66a2f
commit 067db7a48a
7 changed files with 47 additions and 3 deletions

View File

@@ -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,
};
}

View File

@@ -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);