Skip to content

Commit aefc7c8

Browse files
committed
Fix sampler2DViewOf3D.
1 parent 43ca448 commit aefc7c8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,10 +596,7 @@
596596
if (getMVKConfig().useMTLHeap) {
597597
auto* extFeatures = (VkPhysicalDeviceImage2DViewOf3DFeaturesEXT*)next;
598598
extFeatures->image2DViewOf3D = true;
599-
600-
// TODO (ncesario-lunarg) Related CTS tests (e.g., dEQP-VK.pipeline.monolithic.image_2d_view_3d_image.compute.sampler.mip0_layer0)
601-
// are failing with this enabled.
602-
extFeatures->sampler2DViewOf3D = false;
599+
extFeatures->sampler2DViewOf3D = true;
603600
}
604601
break;
605602
}

MoltenVK/MoltenVK/GPUObjects/MVKImage.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,9 @@ static MTLRegion getMTLRegion(const ImgRgn& imgRgn) {
11121112

11131113
// Metal before 3.0 doesn't support 3D compressed textures, so we'll
11141114
// decompress the texture ourselves, and we need to be able to write to it.
1115-
bool makeWritable = MVK_MACOS && _is3DCompressed;
1115+
// Additionally, the ability to create 2D view over 3D image is dependent
1116+
// on the write capability to work correctly.
1117+
bool makeWritable = (MVK_MACOS && _is3DCompressed) || _is2DViewOn3DImageCompatible;
11161118
if (makeWritable) {
11171119
mvkEnableFlags(mtlUsage, MTLTextureUsageShaderWrite);
11181120
}

0 commit comments

Comments
 (0)