Skip to content

Commit

Permalink
fix(bgfx): wrong function signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed May 1, 2019
1 parent 2359615 commit fb7dca5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 33 deletions.
39 changes: 25 additions & 14 deletions modules/lwjgl/bgfx/src/generated/java/org/lwjgl/bgfx/BGFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,9 @@ public static void bgfx_attachment_init(@NativeType("bgfx_attachment_t *") BGFXA
// --- [ bgfx_vertex_decl_begin ] ---

/** Unsafe version of: {@link #bgfx_vertex_decl_begin vertex_decl_begin} */
public static void nbgfx_vertex_decl_begin(long _decl, int _renderer) {
public static long nbgfx_vertex_decl_begin(long _decl, int _renderer) {
long __functionAddress = Functions.vertex_decl_begin;
invokePV(_decl, _renderer, __functionAddress);
return invokePP(_decl, _renderer, __functionAddress);
}

/**
Expand All @@ -1180,16 +1180,19 @@ public static void nbgfx_vertex_decl_begin(long _decl, int _renderer) {
* @param _decl the vertex declaration
* @param _renderer the renderer type. One of:<br><table><tr><td>{@link #BGFX_RENDERER_TYPE_NOOP RENDERER_TYPE_NOOP}</td><td>{@link #BGFX_RENDERER_TYPE_DIRECT3D9 RENDERER_TYPE_DIRECT3D9}</td><td>{@link #BGFX_RENDERER_TYPE_DIRECT3D11 RENDERER_TYPE_DIRECT3D11}</td><td>{@link #BGFX_RENDERER_TYPE_DIRECT3D12 RENDERER_TYPE_DIRECT3D12}</td></tr><tr><td>{@link #BGFX_RENDERER_TYPE_GNM RENDERER_TYPE_GNM}</td><td>{@link #BGFX_RENDERER_TYPE_METAL RENDERER_TYPE_METAL}</td><td>{@link #BGFX_RENDERER_TYPE_NVN RENDERER_TYPE_NVN}</td><td>{@link #BGFX_RENDERER_TYPE_OPENGLES RENDERER_TYPE_OPENGLES}</td></tr><tr><td>{@link #BGFX_RENDERER_TYPE_OPENGL RENDERER_TYPE_OPENGL}</td><td>{@link #BGFX_RENDERER_TYPE_VULKAN RENDERER_TYPE_VULKAN}</td><td>{@link #BGFX_RENDERER_TYPE_COUNT RENDERER_TYPE_COUNT}</td></tr></table>
*/
public static void bgfx_vertex_decl_begin(@NativeType("bgfx_vertex_decl_t *") BGFXVertexDecl _decl, @NativeType("bgfx_renderer_type_t") int _renderer) {
nbgfx_vertex_decl_begin(_decl.address(), _renderer);
@Nullable
@NativeType("bgfx_vertex_decl_t *")
public static BGFXVertexDecl bgfx_vertex_decl_begin(@NativeType("bgfx_vertex_decl_t *") BGFXVertexDecl _decl, @NativeType("bgfx_renderer_type_t") int _renderer) {
long __result = nbgfx_vertex_decl_begin(_decl.address(), _renderer);
return BGFXVertexDecl.createSafe(__result);
}

// --- [ bgfx_vertex_decl_add ] ---

/** Unsafe version of: {@link #bgfx_vertex_decl_add vertex_decl_add} */
public static void nbgfx_vertex_decl_add(long _decl, int _attrib, byte _num, int _type, boolean _normalized, boolean _asInt) {
public static long nbgfx_vertex_decl_add(long _decl, int _attrib, byte _num, int _type, boolean _normalized, boolean _asInt) {
long __functionAddress = Functions.vertex_decl_add;
invokePV(_decl, _attrib, _num, _type, _normalized, _asInt, __functionAddress);
return invokePP(_decl, _attrib, _num, _type, _normalized, _asInt, __functionAddress);
}

/**
Expand All @@ -1206,8 +1209,11 @@ public static void nbgfx_vertex_decl_add(long _decl, int _attrib, byte _num, int
* @param _asInt packaging rule for {@code vertexPack}, {@code vertexUnpack}, and {@code vertexConvert} for {@link #BGFX_ATTRIB_TYPE_UINT8 ATTRIB_TYPE_UINT8} and {@link #BGFX_ATTRIB_TYPE_INT16 ATTRIB_TYPE_INT16}. Unpacking
* code must be implemented inside vertex shader.
*/
public static void bgfx_vertex_decl_add(@NativeType("bgfx_vertex_decl_t *") BGFXVertexDecl _decl, @NativeType("bgfx_attrib_t") int _attrib, @NativeType("uint8_t") int _num, @NativeType("bgfx_attrib_type_t") int _type, @NativeType("bool") boolean _normalized, @NativeType("bool") boolean _asInt) {
nbgfx_vertex_decl_add(_decl.address(), _attrib, (byte)_num, _type, _normalized, _asInt);
@Nullable
@NativeType("bgfx_vertex_decl_t *")
public static BGFXVertexDecl bgfx_vertex_decl_add(@NativeType("bgfx_vertex_decl_t *") BGFXVertexDecl _decl, @NativeType("bgfx_attrib_t") int _attrib, @NativeType("uint8_t") int _num, @NativeType("bgfx_attrib_type_t") int _type, @NativeType("bool") boolean _normalized, @NativeType("bool") boolean _asInt) {
long __result = nbgfx_vertex_decl_add(_decl.address(), _attrib, (byte)_num, _type, _normalized, _asInt);
return BGFXVertexDecl.createSafe(__result);
}

// --- [ bgfx_vertex_decl_decode ] ---
Expand Down Expand Up @@ -1260,9 +1266,9 @@ public static boolean bgfx_vertex_decl_has(@NativeType("bgfx_vertex_decl_t const
// --- [ bgfx_vertex_decl_skip ] ---

/** Unsafe version of: {@link #bgfx_vertex_decl_skip vertex_decl_skip} */
public static void nbgfx_vertex_decl_skip(long _decl, byte _num) {
public static long nbgfx_vertex_decl_skip(long _decl, byte _num) {
long __functionAddress = Functions.vertex_decl_skip;
invokePV(_decl, _num, __functionAddress);
return invokePP(_decl, _num, __functionAddress);
}

/**
Expand All @@ -1271,8 +1277,11 @@ public static void nbgfx_vertex_decl_skip(long _decl, byte _num) {
* @param _decl the vertex declaration
* @param _num the number of bytes to skip
*/
public static void bgfx_vertex_decl_skip(@NativeType("bgfx_vertex_decl_t *") BGFXVertexDecl _decl, @NativeType("uint8_t") int _num) {
nbgfx_vertex_decl_skip(_decl.address(), (byte)_num);
@Nullable
@NativeType("bgfx_vertex_decl_t *")
public static BGFXVertexDecl bgfx_vertex_decl_skip(@NativeType("bgfx_vertex_decl_t *") BGFXVertexDecl _decl, @NativeType("uint8_t") int _num) {
long __result = nbgfx_vertex_decl_skip(_decl.address(), (byte)_num);
return BGFXVertexDecl.createSafe(__result);
}

// --- [ bgfx_vertex_decl_end ] ---
Expand Down Expand Up @@ -3915,12 +3924,14 @@ public static void bgfx_set_view_order(@NativeType("bgfx_view_id_t") int _id, @N
/**
* Begin submitting draw calls from thread.
*
* @param _forThread explicitly request an encoder for a worker thread
*
* @return an encoder for submitting draw calls from multiple threads
*/
@NativeType("struct bgfx_encoder_s *")
public static long bgfx_encoder_begin() {
public static long bgfx_encoder_begin(@NativeType("bool") boolean _forThread) {
long __functionAddress = Functions.encoder_begin;
return invokeP(__functionAddress);
return invokeP(_forThread, __functionAddress);
}

// --- [ bgfx_encoder_end ] ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,15 @@ RGBA16S
MapToInt..uint8_t("_resolve", "resolve flags", "RESOLVE_\\w+")
)

void(
bgfx_vertex_decl_t.p(
"vertex_decl_begin",
"Start a vertex declaration.",

bgfx_vertex_decl_t.p("_decl", "the vertex declaration"),
bgfx_renderer_type_t("_renderer", "the renderer type", RendererType)
)

void(
bgfx_vertex_decl_t.p(
"vertex_decl_add",
"""
Adds attribute to a vertex declaration.
Expand Down Expand Up @@ -845,7 +845,7 @@ RGBA16S
bgfx_attrib_t("_attr", "the attribute to query", Attrib)
)

void(
bgfx_vertex_decl_t.p(
"vertex_decl_skip",
"Skips {@code _num} bytes in vertex stream.",

Expand Down Expand Up @@ -2022,6 +2022,8 @@ RGBA16S
"encoder_begin",
"Begin submitting draw calls from thread.",

bool("_forThread", "explicitly request an encoder for a worker thread"),

returnDoc = "an encoder for submitting draw calls from multiple threads"
)

Expand Down
35 changes: 21 additions & 14 deletions modules/lwjgl/core/src/generated/c/org_lwjgl_system_JNI.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeP__SJ(JNIEnv *__env, jcl
UNUSED_PARAMS(__env, clazz)
return JavaCritical_org_lwjgl_system_JNI_invokeP__SJ(param0, __functionAddress);
}
JNIEXPORT jlong JNICALL JavaCritical_org_lwjgl_system_JNI_invokeP__ZJ(jboolean param0, jlong __functionAddress) {
return (jlong)((intptr_t (*) (jboolean))(intptr_t)__functionAddress)(param0);
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeP__ZJ(JNIEnv *__env, jclass clazz, jboolean param0, jlong __functionAddress) {
UNUSED_PARAMS(__env, clazz)
return JavaCritical_org_lwjgl_system_JNI_invokeP__ZJ(param0, __functionAddress);
}
JNIEXPORT jlong JNICALL JavaCritical_org_lwjgl_system_JNI_invokeP__IIJ(jint param0, jint param1, jlong __functionAddress) {
return (jlong)((intptr_t (*) (jint, jint))(intptr_t)__functionAddress)(param0, param1);
}
Expand All @@ -515,6 +522,13 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__IJJ(JNIEnv *__env, j
UNUSED_PARAMS(__env, clazz)
return JavaCritical_org_lwjgl_system_JNI_invokePP__IJJ(param0, param1, __functionAddress);
}
JNIEXPORT jlong JNICALL JavaCritical_org_lwjgl_system_JNI_invokePP__JBJ(jlong param0, jbyte param1, jlong __functionAddress) {
return (jlong)((intptr_t (*) (intptr_t, jbyte))(intptr_t)__functionAddress)((intptr_t)param0, param1);
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__JBJ(JNIEnv *__env, jclass clazz, jlong param0, jbyte param1, jlong __functionAddress) {
UNUSED_PARAMS(__env, clazz)
return JavaCritical_org_lwjgl_system_JNI_invokePP__JBJ(param0, param1, __functionAddress);
}
JNIEXPORT jlong JNICALL JavaCritical_org_lwjgl_system_JNI_invokePP__JDJ(jlong param0, jdouble param1, jlong __functionAddress) {
return (jlong)((intptr_t (*) (intptr_t, jdouble))(intptr_t)__functionAddress)((intptr_t)param0, param1);
}
Expand Down Expand Up @@ -578,6 +592,13 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeJP__SSSBIJJ(JNIEnv *__en
UNUSED_PARAMS(__env, clazz)
return JavaCritical_org_lwjgl_system_JNI_invokeJP__SSSBIJJ(param0, param1, param2, param3, param4, param5, __functionAddress);
}
JNIEXPORT jlong JNICALL CRITICAL(org_lwjgl_system_JNI_invokePP__JIBIZZJ)(jlong param0, jint param1, jbyte param2, jint param3, jboolean param4, jboolean param5, jlong __functionAddress) {
return (jlong)((intptr_t (*) (intptr_t, jint, jbyte, jint, jboolean, jboolean))(intptr_t)__functionAddress)((intptr_t)param0, param1, param2, param3, param4, param5);
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__JIBIZZJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jbyte param2, jint param3, jboolean param4, jboolean param5, jlong __functionAddress) {
UNUSED_PARAMS(__env, clazz)
return CRITICAL(org_lwjgl_system_JNI_invokePP__JIBIZZJ)(param0, param1, param2, param3, param4, param5, __functionAddress);
}
JNIEXPORT jlong JNICALL JavaCritical_org_lwjgl_system_JNI_invokePJP__JJJ(jlong param0, jlong param1, jlong __functionAddress) {
return (jlong)((intptr_t (*) (intptr_t, jlong))(intptr_t)__functionAddress)((intptr_t)param0, param1);
}
Expand Down Expand Up @@ -1572,13 +1593,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IJJ(JNIEnv *__env, jc
UNUSED_PARAMS(__env, clazz)
JavaCritical_org_lwjgl_system_JNI_invokePV__IJJ(param0, param1, __functionAddress);
}
JNIEXPORT void JNICALL JavaCritical_org_lwjgl_system_JNI_invokePV__JBJ(jlong param0, jbyte param1, jlong __functionAddress) {
((void (*) (intptr_t, jbyte))(intptr_t)__functionAddress)((intptr_t)param0, param1);
}
JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JBJ(JNIEnv *__env, jclass clazz, jlong param0, jbyte param1, jlong __functionAddress) {
UNUSED_PARAMS(__env, clazz)
JavaCritical_org_lwjgl_system_JNI_invokePV__JBJ(param0, param1, __functionAddress);
}
JNIEXPORT void JNICALL JavaCritical_org_lwjgl_system_JNI_invokePV__JFJ(jlong param0, jfloat param1, jlong __functionAddress) {
((void (*) (intptr_t, jfloat))(intptr_t)__functionAddress)((intptr_t)param0, param1);
}
Expand Down Expand Up @@ -1768,13 +1782,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JBSIISJ(JNIEnv *__env
UNUSED_PARAMS(__env, clazz)
CRITICAL(org_lwjgl_system_JNI_invokePV__JBSIISJ)(param0, param1, param2, param3, param4, param5, __functionAddress);
}
JNIEXPORT void JNICALL CRITICAL(org_lwjgl_system_JNI_invokePV__JIBIZZJ)(jlong param0, jint param1, jbyte param2, jint param3, jboolean param4, jboolean param5, jlong __functionAddress) {
((void (*) (intptr_t, jint, jbyte, jint, jboolean, jboolean))(intptr_t)__functionAddress)((intptr_t)param0, param1, param2, param3, param4, param5);
}
JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIBIZZJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jbyte param2, jint param3, jboolean param4, jboolean param5, jlong __functionAddress) {
UNUSED_PARAMS(__env, clazz)
CRITICAL(org_lwjgl_system_JNI_invokePV__JIBIZZJ)(param0, param1, param2, param3, param4, param5, __functionAddress);
}
JNIEXPORT void JNICALL CRITICAL(org_lwjgl_system_JNI_invokePV__JIIIIZJ)(jlong param0, jint param1, jint param2, jint param3, jint param4, jboolean param5, jlong __functionAddress) {
((void (*) (intptr_t, jint, jint, jint, jint, jboolean))(intptr_t)__functionAddress)((intptr_t)param0, param1, param2, param3, param4, param5);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ private JNI() {}
public static native long invokeP(long __functionAddress);
public static native long invokeP(int param0, long __functionAddress);
public static native long invokeP(short param0, long __functionAddress);
public static native long invokeP(boolean param0, long __functionAddress);
public static native long invokeP(int param0, int param1, long __functionAddress);
public static native long invokePP(long param0, long __functionAddress);
public static native long invokePP(int param0, long param1, long __functionAddress);
public static native long invokePP(long param0, byte param1, long __functionAddress);
public static native long invokePP(long param0, double param1, long __functionAddress);
public static native long invokePP(long param0, int param1, long __functionAddress);
public static native long invokePP(short param0, long param1, long __functionAddress);
Expand All @@ -119,6 +121,7 @@ private JNI() {}
public static native long invokePP(int param0, int param1, int param2, long param3, long __functionAddress);
public static native long invokePP(long param0, int param1, int param2, int param3, long __functionAddress);
public static native long invokeJP(short param0, short param1, short param2, byte param3, int param4, long param5, long __functionAddress);
public static native long invokePP(long param0, int param1, byte param2, int param3, boolean param4, boolean param5, long __functionAddress);
public static native long invokePJP(long param0, long param1, long __functionAddress);
public static native long invokePPP(long param0, long param1, long __functionAddress);
public static native long invokePJP(long param0, int param1, long param2, long __functionAddress);
Expand Down Expand Up @@ -261,7 +264,6 @@ private JNI() {}
public static native void invokeJV(long param0, int param1, long __functionAddress);
public static native void invokePV(byte param0, long param1, long __functionAddress);
public static native void invokePV(int param0, long param1, long __functionAddress);
public static native void invokePV(long param0, byte param1, long __functionAddress);
public static native void invokePV(long param0, float param1, long __functionAddress);
public static native void invokePV(long param0, int param1, long __functionAddress);
public static native void invokePV(long param0, short param1, long __functionAddress);
Expand Down Expand Up @@ -289,7 +291,6 @@ private JNI() {}
public static native void invokePV(long param0, short param1, short param2, int param3, boolean param4, long __functionAddress);
public static native void invokePV(long param0, byte param1, short param2, byte param3, int param4, int param5, long __functionAddress);
public static native void invokePV(long param0, byte param1, short param2, int param3, int param4, short param5, long __functionAddress);
public static native void invokePV(long param0, int param1, byte param2, int param3, boolean param4, boolean param5, long __functionAddress);
public static native void invokePV(long param0, int param1, int param2, int param3, int param4, boolean param5, long __functionAddress);
public static native void invokePV(long param0, short param1, int param2, short param3, short param4, byte param5, long __functionAddress);
public static native void invokePV(long param0, short param1, short param2, int param3, int param4, int param5, long __functionAddress);
Expand Down

0 comments on commit fb7dca5

Please sign in to comment.