diff --git a/docs/features.txt b/docs/features.txt index 213445da598..5f86d47494b 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -487,7 +487,7 @@ Vulkan 1.2 -- all DONE: anv, hk, nvk, panvk/v10+, pvr, tu, vn VK_EXT_sampler_filter_minmax DONE (anv, lvp, nvk, panvk/v10+, radv, tu, vn) VK_EXT_scalar_block_layout DONE (anv, dzn, hasvk, kk, lvp, nvk, panvk, pvr, radv, tu, vn, v3dv/vc7+) VK_EXT_separate_stencil_usage DONE (anv, dzn, hasvk, kk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn) - VK_EXT_shader_viewport_index_layer DONE (anv, hasvk, lvp, nvk, radv, tu, vn) + VK_EXT_shader_viewport_index_layer DONE (anv, hasvk, kk, lvp, nvk, radv, tu, vn) Vulkan 1.3 -- all DONE: anv, hk, lvp, nvk, panvk/v10+, radv, tu, vn, v3dv diff --git a/src/kosmickrisp/compiler/msl_iomap.c b/src/kosmickrisp/compiler/msl_iomap.c index aed3f012d29..a24cf9a36f5 100644 --- a/src/kosmickrisp/compiler/msl_iomap.c +++ b/src/kosmickrisp/compiler/msl_iomap.c @@ -61,6 +61,7 @@ static const char *VARYING_SLOT_NAME[NUM_TOTAL_VARYING_SLOTS] = { [VARYING_SLOT_PSIZ] = "point_size", [VARYING_SLOT_PRIMITIVE_ID] = "primitive_id", [VARYING_SLOT_LAYER] = "layer", + [VARYING_SLOT_VIEWPORT] = "viewport_index", [VARYING_SLOT_VAR0] = "vary_00", [VARYING_SLOT_VAR1] = "vary_01", [VARYING_SLOT_VAR2] = "vary_02", @@ -101,6 +102,7 @@ static const char *VARYING_SLOT_SEMANTIC[NUM_TOTAL_VARYING_SLOTS] = { [VARYING_SLOT_PSIZ] = "[[point_size]]", [VARYING_SLOT_PRIMITIVE_ID] = "[[primitive_id]]", [VARYING_SLOT_LAYER] = "[[render_target_array_index]]", + [VARYING_SLOT_VIEWPORT] = "[[viewport_array_index]]", [VARYING_SLOT_VAR0] = "[[user(vary_00)]]", [VARYING_SLOT_VAR1] = "[[user(vary_01)]]", [VARYING_SLOT_VAR2] = "[[user(vary_02)]]", diff --git a/src/kosmickrisp/compiler/msl_nir_lower_common.c b/src/kosmickrisp/compiler/msl_nir_lower_common.c index 76f902bb10d..029a3f95e86 100644 --- a/src/kosmickrisp/compiler/msl_nir_lower_common.c +++ b/src/kosmickrisp/compiler/msl_nir_lower_common.c @@ -217,6 +217,14 @@ msl_ensure_vertex_position_output(nir_shader *nir) static bool msl_fs_io_types(nir_builder *b, nir_intrinsic_instr *intr, void *data) { + if (intr->intrinsic == nir_intrinsic_load_input) { + struct nir_io_semantics io = nir_intrinsic_io_semantics(intr); + if (io.location == VARYING_SLOT_VIEWPORT) { + nir_intrinsic_set_dest_type(intr, nir_type_uint32); + return true; + } + } + if (intr->intrinsic == nir_intrinsic_store_output) { struct nir_io_semantics io = nir_intrinsic_io_semantics(intr); if (io.location == FRAG_RESULT_SAMPLE_MASK) { @@ -256,7 +264,8 @@ msl_vs_io_types(nir_builder *b, nir_intrinsic_instr *intr, void *data) { if (intr->intrinsic == nir_intrinsic_store_output) { struct nir_io_semantics io = nir_intrinsic_io_semantics(intr); - if (io.location == VARYING_SLOT_LAYER) { + if (io.location == VARYING_SLOT_LAYER || + io.location == VARYING_SLOT_VIEWPORT) { nir_intrinsic_set_src_type(intr, nir_type_uint32); return true; } diff --git a/src/kosmickrisp/vulkan/kk_physical_device.c b/src/kosmickrisp/vulkan/kk_physical_device.c index 8cd4589be6b..92dab7230ed 100644 --- a/src/kosmickrisp/vulkan/kk_physical_device.c +++ b/src/kosmickrisp/vulkan/kk_physical_device.c @@ -86,7 +86,7 @@ kk_get_device_extensions(const struct kk_instance *instance, .EXT_sampler_filter_minmax = false, .EXT_scalar_block_layout = true, .EXT_separate_stencil_usage = true, - .EXT_shader_viewport_index_layer = false, + .EXT_shader_viewport_index_layer = true, /* Vulkan 1.3 */ .KHR_copy_commands2 = true, @@ -161,6 +161,7 @@ kk_get_device_features( .imageCubeArray = true, .independentBlend = true, .logicOp = true, + .multiViewport = true, .robustBufferAccess = true, .samplerAnisotropy = true, .shaderInt16 = true,