Try to auto-detect some simple-type query functions.
[panamaz] / src / notzed.vulkan.test / classes / vulkan / test / TestCube.java
index 9f022e6..c7be005 100644 (file)
@@ -195,10 +195,7 @@ public class TestCube {
                                famprops = dev.vkGetPhysicalDeviceQueueFamilyProperties(frame);
 
                                for (int j = 0; j < famprops.length(); j++) {
-                                       boolean present;
-
-                                       dev.vkGetPhysicalDeviceSurfaceSupportKHR(j, surface, present$h);
-                                       present = present$h.get(0) != 0;
+                                       boolean present = dev.vkGetPhysicalDeviceSurfaceSupportKHR(j, surface);
 
                                        if (present && present_queue == -1)
                                                present_queue = j;
@@ -408,19 +405,10 @@ public class TestCube {
                                VK_IMAGE_VIEW_TYPE_2D,
                                VK_FORMAT_D16_UNORM,
                                frame);
-
-                       VkComponentMapping components = viewinfo.getComponents();
-                       components.setR(VK_COMPONENT_SWIZZLE_R);
-                       components.setG(VK_COMPONENT_SWIZZLE_G);
-                       components.setB(VK_COMPONENT_SWIZZLE_B);
-                       components.setA(VK_COMPONENT_SWIZZLE_A);
-                       VkImageSubresourceRange subresourceRange = viewinfo.getSubresourceRange();
-                       subresourceRange.setAspectMask(VK_IMAGE_ASPECT_DEPTH_BIT);
-                       subresourceRange.setLevelCount(1);
-                       subresourceRange.setLayerCount(1);
+                       viewinfo.getComponents().set(VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A);
+                       viewinfo.getSubresourceRange().set(VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1);
 
                        depthView = device.vkCreateImageView(viewinfo, scope);
-
                        depthFormat = format;
                }
        }