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

JNI improvements #886

Merged
merged 75 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
5eea92e
Properly convert Java char to C char in inputSwizzle
javagl Mar 22, 2024
0bedf8d
Add basic test for JNI input swizzle
javagl Mar 23, 2024
4638ca0
Removed unused imports
javagl Mar 23, 2024
006112d
Expose supercompression functions via JNI
javagl Mar 23, 2024
a512cc5
Fix typo in comment
javagl Mar 23, 2024
0ff0788
Compare result of swizzle to reference
javagl Mar 24, 2024
d624c0c
Merge branch 'fix-jni-input-swizzle' into jni-add-supercompression
javagl Mar 24, 2024
bf62503
A draft for createFromMemory. Details to be discussed.
javagl Mar 24, 2024
7da5422
Test swizzle without reference image
javagl Mar 26, 2024
89b29cb
Organize imports
javagl Mar 26, 2024
13a571c
Merge remote-tracking branch 'upstream/main' into fix-jni-input-swizzle
javagl Mar 26, 2024
4f055ac
Merge branch 'fix-jni-input-swizzle' into jni-add-supercompression
javagl Mar 26, 2024
e229793
Merge branch 'jni-add-supercompression' into jni-add-create-from-memory
javagl Mar 26, 2024
bf0c644
Allow KtxTestLibraryLoader to work on Windows
javagl Mar 26, 2024
f0ae844
Fix typo
javagl Mar 26, 2024
b463496
Comments for KtxErrorCode
javagl Mar 26, 2024
332510f
String representation of error codes
javagl Mar 26, 2024
790b8b2
Update test with predefined transcode format constant
javagl Mar 26, 2024
33f3e45
Merge branch 'jni-add-supercompression' into jni-improvements
javagl Mar 26, 2024
68d1295
Comments for KtxTranscodeFormat
javagl Mar 26, 2024
0a4d725
Copyright updates
javagl Mar 26, 2024
8f58109
First pass of error handling: Throw for null
javagl Mar 26, 2024
3673c0a
Throw exception when trying to use destroyed textures
javagl Mar 27, 2024
2cea7b8
Minor comment update
javagl Mar 27, 2024
2081c29
Comments for KtxSupercmpScheme
javagl Mar 27, 2024
6a3f1f3
Add basic tests for CreateFromMemory
javagl Mar 27, 2024
a5adb8a
Basic out-of-memory checks. Minor cleanups.
javagl Mar 27, 2024
1576b92
Minor copyright updates
javagl Mar 27, 2024
2c86122
Cache field and method IDs
javagl Mar 28, 2024
70a8bbb
More error handling. Add KtxException.
javagl Mar 28, 2024
4cc87cc
Fix typo
javagl Mar 28, 2024
2306747
Fix wrong return type
javagl Mar 28, 2024
1436108
Make storage mode consistent with native layer.
javagl Mar 29, 2024
111d843
Make ASTC parameters consistent with native
javagl Mar 29, 2024
ea4e80a
Align ASTC encoder mode with native layer
javagl Mar 29, 2024
c3c8600
Align ASTC quality level and flag bits with native layer
javagl Mar 29, 2024
978738d
Align supercompression scheme with native layer
javagl Mar 29, 2024
20ba2a9
Align create flags with native layer
javagl Mar 29, 2024
ec28c4c
Align transcode format with native, add flag bits, add comments
javagl Mar 29, 2024
d67ae19
Minor comments and tests pass
javagl Apr 1, 2024
ed9ae37
Align KtxErrorCode with native side
javagl Apr 2, 2024
5c503ca
Minor doc fix
javagl Apr 2, 2024
237b65e
Add some JavaDoc...
javagl Apr 2, 2024
29588e8
JavaDoc fixes
javagl Apr 2, 2024
b747849
Add generation of JavaDoc to POM
javagl Apr 2, 2024
2810d2b
More JavaDocs...
javagl Apr 3, 2024
affe150
And even more JavaDoc
javagl Apr 3, 2024
f03cbd1
Prevent instantiation for constants classes
javagl Apr 3, 2024
47656c3
Merge remote-tracking branch 'upstream/main' into jni-improvements
javagl Apr 3, 2024
9a8f50a
Minor fix of malformed JavaDoc for Maven
javagl Apr 11, 2024
647a5fc
Fix test for input swizzling in JNI
javagl Apr 12, 2024
1e3b46d
Merge branch 'fix-jni-input-swizzle' into jni-improvements
javagl Apr 12, 2024
8602046
Fix embarrassing error in length computation
javagl Apr 12, 2024
de6318e
Merge remote-tracking branch 'upstream/main' into jni-improvements
javagl Apr 14, 2024
180ab89
Update for upstream changes
javagl Apr 14, 2024
71419fc
Update documentation to match native side
javagl Apr 14, 2024
4e9f360
Merge remote-tracking branch 'upstream/main' into jni-improvements
javagl Apr 15, 2024
6d39078
Merge remote-tracking branch 'upstream/main' into jni-improvements
javagl Aug 17, 2024
dbbdf8a
Additional exception checks
javagl Aug 17, 2024
60419db
Update KhrDfTransfer names
javagl Aug 24, 2024
0ce0721
Update KtxBasisParams name
javagl Aug 24, 2024
1790346
Update KtxErrorCode names
javagl Aug 24, 2024
6f7bed8
Update KtxPackAstcBlockDimension names
javagl Aug 24, 2024
8e2c055
Update KtxPackAstcEncoderMode names
javagl Aug 24, 2024
ea215db
Update KtxPackAstcQualityLevel names
javagl Aug 24, 2024
ada93e2
Update KtxPackUastcFlagBits names
javagl Aug 24, 2024
fd2af17
Update KtxSupercmpScheme names
javagl Aug 24, 2024
5eacbe3
Update KtxTextureCreate... names
javagl Aug 24, 2024
a24a8cb
Update KtxTranscodeFlagBits names
javagl Aug 24, 2024
aa5e994
Update KtxTranscodeFormat names
javagl Aug 24, 2024
6fb3c60
Create binding for ktxErrorString
javagl Aug 24, 2024
311d73b
Handle negative KTX_error_code
javagl Aug 24, 2024
14dca5f
Add missing file for KtxErrorCode.cpp
javagl Aug 24, 2024
c35040d
Fix reference to renamed constant in JavaDoc
javagl Aug 26, 2024
f994d14
Merge branch 'KhronosGroup:main' into jni-improvements
javagl Sep 9, 2024
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
1 change: 1 addition & 0 deletions interface/java_binding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ add_library(ktx-jni SHARED
src/main/cpp/KtxTexture.cpp
src/main/cpp/KtxTexture1.cpp
src/main/cpp/KtxTexture2.cpp
src/main/cpp/KtxErrorCode.cpp
src/main/cpp/libktx-jni.cpp
${CMAKE_CURRENT_BINARY_DIR}/ktx-jni.manifest
)
Expand Down
13 changes: 13 additions & 0 deletions interface/java_binding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,19 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
19 changes: 19 additions & 0 deletions interface/java_binding/src/main/cpp/KtxErrorCode.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024, Khronos Group and Contributors
* SPDX-License-Identifier: Apache-2.0
*/

#include "libktx-jni.h"
#include <iostream>

extern "C" JNIEXPORT jstring JNICALL Java_org_khronos_ktx_KtxErrorCode_createString(JNIEnv *env, jclass, jint error)
{
KTX_error_code errorNative = KTX_error_code(error);
const char* errorStringNative = ktxErrorString(errorNative);

// If this causes an OutOfMemoryError, then it will return
// 'null', with the OutOfMemoryError pending
jstring errorString = env->NewStringUTF(errorStringNative);
return errorString;
}

Loading
Loading