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;
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;
}
}
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;
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;
}
}
java-result-return {{ return result$$; }}
}
+type uint32_t*-output,int*-output uint32_t* need-frame {
+ java-arg {{ }}
+ invoke-arg {{ (Addressable){name}.address() }}
+
+ java-result {{ int }}
+ native-init {{ MemorySegment {name} = frame$.allocate(Memory.INT); }}
+ java-result-assign {{ int result$$ = {name}.getAtIndex(Memory.INT, 0); }}
+ java-result-return {{ return result$$; }}
+}
+
+type uint64_t*-output uint64_t* need-frame {
+ java-arg {{ }}
+ invoke-arg {{ (Addressable){name}.address() }}
+
+ java-result {{ long }}
+ native-init {{ MemorySegment {name} = frame$.allocate(Memory.LONG); }}
+ java-result-assign {{ long result$$ = {name}.getAtIndex(Memory.LONG, 0); }}
+ java-result-return {{ return result$$; }}
+}
+
+type void*-output handle*-output need-frame {
+ java-arg {{ }}
+ invoke-arg {{ (Addressable){name}.address() }}
+
+ java-result {{ MemoryAddress }}
+ native-init {{ MemorySegment {name} = frame$.allocate(Memory.POINTER); }}
+ java-result-assign {{ MemoryAddress result$$ = {name}.getAtIndex(Memory.POINTER, 0); }}
+ java-result-return {{ return result$$; }}
+}
+
+type VkBool32*-output uint32_t*-output {
+ java-result {{ boolean }}
+ java-result-return {{ return result$$ != 0; }}
+}
+
# for handle constructors of dispatchable types
type dispatch*-output handle*-output {
java-result-assign {{ {baseType} result$$ = {baseType}.create({name}.get(Memory.POINTER, 0), dispatch, scope$); }}
}
}
+ # A whole bunch of query functions
+ if ($s->{name} =~ m/^vkGet/ && !($last->{fullType} =~ m/const/n) && !(defined($override->{$last->{name}}) && defined($override->{$last->{name}}->{type}))) {
+ if ($last->{fullType} eq 'VkBool32 *') {
+ print "output: [$last->{fullType}] [$last->{deref}] $s->{name}\n" if $sys->{verbose};
+ $override->{$last->{name}}->{type} = 'VkBool32*-output';
+ } elsif ($last->{deref} =~ m/^(int|uint32_t|uint64_t|void)\*$/on) {
+ print "output: [$last->{fullType}] [$last->{deref}] $s->{name}\n" if $sys->{verbose};
+ $override->{$last->{name}}->{type} = $last->{deref}."-output";
+ } else {
+ print "output? [$last->{fullType}] [$last->{deref}] $s->{name}\n" if $sys->{verbose};
+ }
+ }
+
# other per-item things
foreach my $m (@{$s->{items}}) {
my $so = $structTypes->{overrides}->{$m->{baseType}};
my $deref = defined($override->{$m->{name}}) && defined($override->{$m->{name}}->{type}) ? $override->{$m->{name}}->{type} : $m->{deref};
my $type = $types->{$deref};
- die "No type found ".Dumper($m, $s, $override) if !$type;
+ die "No type '$deref' found ".Dumper($m, $s, $override) if !$type;
my $v = buildVars($s, $m, $type);