adding primitive restart, integer texture sampling and mip/lod management in sampling
Test / build_and_test (push) Successful in 49s
Build / build (push) Successful in 1m0s

This commit is contained in:
2026-06-05 22:16:28 +02:00
parent b1279bde60
commit c7a298978a
10 changed files with 469 additions and 113 deletions
+3 -1
View File
@@ -37,6 +37,7 @@ mode: union(enum) {
binding_description: ?[]vk.VertexInputBindingDescription,
attribute_description: ?[]vk.VertexInputAttributeDescription,
topology: vk.PrimitiveTopology,
primitive_restart_enable: vk.Bool32,
},
viewport_state: struct {
viewports: ?[]vk.Viewport,
@@ -122,6 +123,7 @@ pub fn initGraphics(device: *Device, allocator: std.mem.Allocator, cache: ?*Pipe
break :blk null;
},
.topology = if (info.p_input_assembly_state) |state| state.topology else return VkError.ValidationFailed,
.primitive_restart_enable = if (info.p_input_assembly_state) |state| state.primitive_restart_enable else return VkError.ValidationFailed,
},
.viewport_state = .{
.viewports = blk: {
@@ -169,7 +171,7 @@ pub fn initGraphics(device: *Device, allocator: std.mem.Allocator, cache: ?*Pipe
if (info.p_dynamic_state) |dynamic_state| {
if (dynamic_state.p_dynamic_states) |states| {
for (states[0..], 0..dynamic_state.dynamic_state_count) |info_state, _| {
for (states[0..dynamic_state.dynamic_state_count]) |info_state| {
switch (info_state) {
.viewport => state.viewport = true,
.scissor => state.scissor = true,
+10
View File
@@ -13,10 +13,15 @@ pub const ObjectType: vk.ObjectType = .sampler;
owner: *Device,
mag_filter: vk.Filter,
min_filter: vk.Filter,
mipmap_mode: vk.SamplerMipmapMode,
address_mode_u: vk.SamplerAddressMode,
address_mode_v: vk.SamplerAddressMode,
address_mode_w: vk.SamplerAddressMode,
mip_lod_bias: f32,
min_lod: f32,
max_lod: f32,
border_color: vk.BorderColor,
unnormalized_coordinates: vk.Bool32,
vtable: *const VTable,
@@ -30,10 +35,15 @@ pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.Sampl
.owner = device,
.mag_filter = info.mag_filter,
.min_filter = info.min_filter,
.mipmap_mode = info.mipmap_mode,
.address_mode_u = info.address_mode_u,
.address_mode_v = info.address_mode_v,
.address_mode_w = info.address_mode_w,
.mip_lod_bias = info.mip_lod_bias,
.min_lod = info.min_lod,
.max_lod = info.max_lod,
.border_color = info.border_color,
.unnormalized_coordinates = info.unnormalized_coordinates,
.vtable = undefined,
};
}