Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan in Processing (draft) #948

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
316 changes: 40 additions & 276 deletions README.md

Large diffs are not rendered by default.

36 changes: 33 additions & 3 deletions core/.classpath
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="library/jogl-all.jar" sourcepath="library/jogl-all-src.jar"/>
<classpathentry kind="lib" path="library/gluegen-rt.jar"/>
<classpathentry exported="true" kind="lib" path="library/jogl-all.jar" sourcepath="library/jogl-all-src.jar"/>
<classpathentry exported="true" kind="lib" path="library/gluegen-rt.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFX11"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-assimp.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-assimp-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-assimp-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-assimp-sources.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-glfw.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-glfw-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-glfw-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-glfw-sources.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-openal.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-openal-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-openal-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-openal-sources.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-shaderc.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-shaderc-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-shaderc-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-shaderc-sources.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-sources.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-stb.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-stb-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-stb-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-stb-sources.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-vma.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-vma-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-vma-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-vma-sources.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-vulkan.jar"/>
<classpathentry exported="true" kind="lib" path="library/lwjgl-vulkan-sources.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 14 additions & 3 deletions core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
bin
bin-test

/library/gluegen-rt*.jar
/library/jogl-all*.jar

/natives

core-sources.jar

different/build
different/build

DepthTest.java
DirectPGL.java
HighQuantityBug.java
ImageTest.java
LoadsOfImagesPShape.java
LoadsOfImagesTest.java
PShapeTest.java
Sketch1.java
Sketch2.java
ThreadBug1.java
14 changes: 4 additions & 10 deletions core/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -99,8 +99,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Expand All @@ -114,7 +114,6 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
Expand Down Expand Up @@ -209,11 +208,9 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=2
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
Expand Down Expand Up @@ -241,7 +238,6 @@ org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
Expand Down Expand Up @@ -313,7 +309,6 @@ org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
Expand Down Expand Up @@ -464,7 +459,6 @@ org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
Expand Down
Binary file added core/library/gluegen-rt.jar
Binary file not shown.
Binary file added core/library/jogl-all.jar
Binary file not shown.
Binary file added core/library/lwjgl-assimp-natives-linux.jar
Binary file not shown.
Binary file added core/library/lwjgl-assimp-natives-windows.jar
Binary file not shown.
Binary file added core/library/lwjgl-assimp-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-assimp.jar
Binary file not shown.
Binary file added core/library/lwjgl-glfw-natives-linux.jar
Binary file not shown.
Binary file added core/library/lwjgl-glfw-natives-windows.jar
Binary file not shown.
Binary file added core/library/lwjgl-glfw-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-glfw.jar
Binary file not shown.
Binary file added core/library/lwjgl-natives-linux.jar
Binary file not shown.
Binary file added core/library/lwjgl-natives-windows.jar
Binary file not shown.
Binary file added core/library/lwjgl-openal-natives-linux.jar
Binary file not shown.
Binary file added core/library/lwjgl-openal-natives-windows.jar
Binary file not shown.
Binary file added core/library/lwjgl-openal-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-openal.jar
Binary file not shown.
Binary file added core/library/lwjgl-shaderc-natives-linux.jar
Binary file not shown.
Binary file added core/library/lwjgl-shaderc-natives-windows.jar
Binary file not shown.
Binary file added core/library/lwjgl-shaderc-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-shaderc.jar
Binary file not shown.
Binary file added core/library/lwjgl-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-stb-natives-linux.jar
Binary file not shown.
Binary file added core/library/lwjgl-stb-natives-windows.jar
Binary file not shown.
Binary file added core/library/lwjgl-stb-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-stb.jar
Binary file not shown.
Binary file added core/library/lwjgl-vma-natives-linux.jar
Binary file not shown.
Binary file added core/library/lwjgl-vma-natives-windows.jar
Binary file not shown.
Binary file added core/library/lwjgl-vma-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-vma.jar
Binary file not shown.
Binary file added core/library/lwjgl-vulkan-sources.jar
Binary file not shown.
Binary file added core/library/lwjgl-vulkan.jar
Binary file not shown.
Binary file added core/library/lwjgl.jar
Binary file not shown.
47 changes: 47 additions & 0 deletions core/src/processing/GL2VK/Frame.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package processing.GL2VK;

import java.nio.LongBuffer;

import static org.lwjgl.system.MemoryStack.stackGet;

/**
* Wraps the needed sync objects for an in flight frame
*
* This frame's sync objects must be deleted manually
* */
public class Frame {

private final long imageAvailableSemaphore;
private final long renderFinishedSemaphore;
private final long fence;

public Frame(long imageAvailableSemaphore, long renderFinishedSemaphore, long fence) {
this.imageAvailableSemaphore = imageAvailableSemaphore;
this.renderFinishedSemaphore = renderFinishedSemaphore;
this.fence = fence;
}

public long imageAvailableSemaphore() {
return imageAvailableSemaphore;
}

public LongBuffer pImageAvailableSemaphore() {
return stackGet().longs(imageAvailableSemaphore);
}

public long renderFinishedSemaphore() {
return renderFinishedSemaphore;
}

public LongBuffer pRenderFinishedSemaphore() {
return stackGet().longs(renderFinishedSemaphore);
}

public long fence() {
return fence;
}

public LongBuffer pFence() {
return stackGet().longs(fence);
}
}
Loading
Loading