adding fragment derivatives, base pipeline cache, missing KHR function to avoid CTS crash + lots of minor bugfixes
This commit is contained in:
@@ -14,7 +14,6 @@ pub const Interface = base.ShaderModule;
|
||||
|
||||
interface: Interface,
|
||||
module: spv.Module,
|
||||
module_allocator: std.heap.ArenaAllocator,
|
||||
|
||||
/// Pipelines need SPIR-V module reference so shader module may not
|
||||
/// be destroy on call to `vkDestroyShaderModule`
|
||||
@@ -29,10 +28,6 @@ pub fn create(device: *base.Device, allocator: std.mem.Allocator, info: *const v
|
||||
const soft_device: *SoftDevice = @alignCast(@fieldParentPtr("interface", device));
|
||||
const device_allocator = soft_device.device_allocator.allocator();
|
||||
|
||||
var module_allocator_arena: std.heap.ArenaAllocator = .init(device_allocator);
|
||||
errdefer module_allocator_arena.deinit();
|
||||
const module_allocator = module_allocator_arena.allocator();
|
||||
|
||||
interface.vtable = &.{
|
||||
.destroy = destroy,
|
||||
};
|
||||
@@ -41,7 +36,7 @@ pub fn create(device: *base.Device, allocator: std.mem.Allocator, info: *const v
|
||||
|
||||
self.* = .{
|
||||
.interface = interface,
|
||||
.module = spv.Module.init(module_allocator, code, .{
|
||||
.module = spv.Module.init(device_allocator, code, .{
|
||||
.use_simd_vectors_specializations = base.config.shaders_simd,
|
||||
}) catch |err| switch (err) {
|
||||
spv.Module.ModuleError.OutOfMemory => return VkError.OutOfHostMemory,
|
||||
@@ -55,9 +50,9 @@ pub fn create(device: *base.Device, allocator: std.mem.Allocator, info: *const v
|
||||
return VkError.ValidationFailed;
|
||||
},
|
||||
},
|
||||
.module_allocator = module_allocator_arena,
|
||||
.ref_count = std.atomic.Value(usize).init(1),
|
||||
};
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -67,7 +62,11 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
||||
}
|
||||
|
||||
pub fn drop(self: *Self, allocator: std.mem.Allocator) void {
|
||||
self.module_allocator.deinit();
|
||||
const soft_device: *SoftDevice = @alignCast(@fieldParentPtr("interface", self.interface.owner));
|
||||
const device_allocator = soft_device.device_allocator.allocator();
|
||||
|
||||
self.module.deinit(device_allocator);
|
||||
|
||||
allocator.destroy(self);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user