fixing triggered assertion in blitter
This commit is contained in:
@@ -55,10 +55,7 @@ fn alloc(context: *anyopaque, len: usize, alignment: Alignment, ret_addr: usize)
|
||||
|
||||
if (self.callbacks) |callbacks| {
|
||||
if (callbacks.pfn_allocation) |pfn_allocation| {
|
||||
const ptr: ?[*]u8 = @ptrCast(pfn_allocation(self.callbacks.?.p_user_data, len, alignment.toByteUnits(), self.scope));
|
||||
//std.debug.print("test {*}\n", .{ptr});
|
||||
//std.debug.dumpCurrentStackTrace(.{});
|
||||
return ptr;
|
||||
return @ptrCast(pfn_allocation(self.callbacks.?.p_user_data, len, alignment.toByteUnits(), self.scope));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const lib = @import("lib.zig");
|
||||
const zm = @import("zmath");
|
||||
|
||||
pub fn fromAspect(format: vk.Format, aspect: vk.ImageAspectFlags) vk.Format {
|
||||
if (aspect.color_bit or (aspect.color_bit and aspect.stencil_bit)) {
|
||||
if (aspect.color_bit or (aspect.depth_bit and aspect.stencil_bit)) {
|
||||
return format;
|
||||
} else if (aspect.depth_bit) {
|
||||
if (format == .d16_unorm or format == .d16_unorm_s8_uint) {
|
||||
@@ -20,7 +20,7 @@ pub fn fromAspect(format: vk.Format, aspect: vk.ImageAspectFlags) vk.Format {
|
||||
}
|
||||
}
|
||||
lib.unsupported("format {s}", .{@tagName(format)});
|
||||
return format;
|
||||
return .undefined;
|
||||
}
|
||||
|
||||
pub fn toAspect(format: vk.Format) vk.ImageAspectFlags {
|
||||
@@ -40,7 +40,7 @@ pub inline fn texelSize(format: vk.Format) usize {
|
||||
return lib.c.vkuFormatTexelBlockSize(@intCast(@intFromEnum(format)));
|
||||
}
|
||||
|
||||
pub inline fn supportsColorAttachemendBlend(format: vk.Format) bool {
|
||||
pub fn supportsColorAttachemendBlend(format: vk.Format) bool {
|
||||
return switch (format) {
|
||||
// Vulkan 1.1 mandatory
|
||||
.r5g6b5_unorm_pack16,
|
||||
|
||||
Reference in New Issue
Block a user