vulkan: Fix two validation errors introduced by shared memory changes. (#3074)
Some checks are pending
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

This commit is contained in:
squidbus 2025-06-09 19:48:20 -07:00 committed by GitHub
parent 0444e590e0
commit e2b726382e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 5 deletions

View file

@ -34,11 +34,11 @@ void SharedMemoryToStoragePass(IR::Program& program, const RuntimeInfo& runtime_
if (program.info.stage != Stage::Compute) { if (program.info.stage != Stage::Compute) {
return; return;
} }
// Only perform the transform if the host shared memory is insufficient // Only perform the transform if there is shared memory and either host shared memory is
// or the device does not support VK_KHR_workgroup_memory_explicit_layout // insufficient or the device does not support VK_KHR_workgroup_memory_explicit_layout
const u32 shared_memory_size = runtime_info.cs_info.shared_memory_size; const u32 shared_memory_size = runtime_info.cs_info.shared_memory_size;
if (shared_memory_size <= profile.max_shared_memory_size && if (shared_memory_size == 0 || (shared_memory_size <= profile.max_shared_memory_size &&
profile.supports_workgroup_explicit_memory_layout) { profile.supports_workgroup_explicit_memory_layout)) {
return; return;
} }
// Add buffer binding for shared memory storage buffer. // Add buffer binding for shared memory storage buffer.

View file

@ -445,7 +445,25 @@ bool Instance::CreateDevice() {
workgroup_memory_explicit_layout_features.workgroupMemoryExplicitLayout16BitAccess, workgroup_memory_explicit_layout_features.workgroupMemoryExplicitLayout16BitAccess,
}, },
#ifdef __APPLE__ #ifdef __APPLE__
portability_features, vk::PhysicalDevicePortabilitySubsetFeaturesKHR{
.constantAlphaColorBlendFactors = portability_features.constantAlphaColorBlendFactors,
.events = portability_features.events,
.imageViewFormatReinterpretation = portability_features.imageViewFormatReinterpretation,
.imageViewFormatSwizzle = portability_features.imageViewFormatSwizzle,
.imageView2DOn3DImage = portability_features.imageView2DOn3DImage,
.multisampleArrayImage = portability_features.multisampleArrayImage,
.mutableComparisonSamplers = portability_features.mutableComparisonSamplers,
.pointPolygons = portability_features.pointPolygons,
.samplerMipLodBias = portability_features.samplerMipLodBias,
.separateStencilMaskRef = portability_features.separateStencilMaskRef,
.shaderSampleRateInterpolationFunctions =
portability_features.shaderSampleRateInterpolationFunctions,
.tessellationIsolines = portability_features.tessellationIsolines,
.tessellationPointMode = portability_features.tessellationPointMode,
.triangleFans = portability_features.triangleFans,
.vertexAttributeAccessBeyondStride =
portability_features.vertexAttributeAccessBeyondStride,
},
#endif #endif
}; };