File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/main/java/net/vulkanmod/vulkan/framebuffer Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,19 @@ private void createSwapChain() {
121121 }
122122
123123 createInfo .preTransform (surfaceProperties .capabilities .currentTransform ());
124- createInfo .compositeAlpha (VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR );
124+
125+ int supportedCompositeAlpha = surfaceProperties .capabilities .supportedCompositeAlpha ();
126+ if ((supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR ) != 0 ) {
127+ createInfo .compositeAlpha (VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR );
128+ }else if ((supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR ) != 0 ){
129+ // PowerVR GE8320 Vulkan drivers don't support the alpha composite opaque bit.
130+ // In that case, use the inherit mode if supported.
131+ createInfo .compositeAlpha (VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR );
132+ } else {
133+ // Not sure how to handle the other cases, to be honest...
134+ throw new RuntimeException ("Neither opaque, nor inherited alpha compositing modes are supported." );
135+ }
136+
125137 createInfo .presentMode (presentMode );
126138 createInfo .clipped (true );
127139
You can’t perform that action at this time.
0 commit comments