Main Menu

Recent posts

#11
Bug Reports / RFE / unsatisfiedLinkError
Last post by jakethesnake - September 01, 2024, 06:59:32
Hello. I have a a distributed app, and one of the users is getting a java.lang.unsatisfiedLinkError when loading lwjgl.dll

From googling, I found this:
https://github.com/libgdx/libgdx/issues/5524

And indeed, the problem resolved when the user changed his name from something cryllic to ascii.

This is with the previous version of lwjgl. I'm not sure if something has been fixed in the latest release. I can't make sense of the patch notes. It would be strange though, as this bug would have been noticed from day 1.

#12
General Java Game Development / Compile cuda-c to ptx
Last post by codex - August 24, 2024, 15:36:47
I need a little help here with compiling cuda-c to ptx. I've been using this demo as a guide, but it doesn't show how to do that exactly. I can't find any other demos/tutorials specific to lwjgl for cuda, so I'm a little lost here.

MemoryStack stack = ...

PointerBuffer program = stack.mallocPointer(1);
PointerBuffer headers = stack.mallocPointer(1);
PointerBuffer includeNames = stack.mallocPointer(1);
PointerBuffer options = stack.mallocPointer(1);
PointerBuffer codeSize = stack.mallocPointer(1);

String src = "insert-cuda-c-source-here";

NVRTC.nvrtcCreateProgram(program, src, "MyCuda.cu", headers, includeNames));
long prog = program.get(0);
NVRTC.nvrtcCompileProgram(program.get(0), options));
NVRTC.nvrtcGetCUBINSize(prog, codeSize));
ByteBuffer code = stack.malloc(codeSize.getIntBuffer(0, 1).get(0));
NVRTC.nvrtcGetCUBIN(prog, code);

My specific problem is that nvrtcGetCUBINSize writes to a PointerBuffer, and I am unclear of how to actually access the underlying value.
#13
OpenGL / How to disable hardware accele...
Last post by BeetNode - August 07, 2024, 12:08:22
How do you force LWJGL to not use the GPU?
#14
Bug Reports / RFE / Re: [BUG] nullability annotati...
Last post by spasi - August 03, 2024, 08:25:38
There's a JEP draft now, adding for future reference: Null-Restricted and Nullable Types
#15
Bug Reports / RFE / Re: [BUG] nullability annotati...
Last post by vanzomerenc - August 01, 2024, 19:06:55
Quote from: spasi on August 01, 2024, 11:17:06Not yet, but if JSpecify gets the expected adoption, we could migrate to it in an upcoming major release (3.4.0 or 3.5.0).

That is very encouraging to hear. If it's a matter of having someone to do the work, I'd be willing to do it.

It's also excellent to hear that the Valhalla and/or Panama projects will eventually make this whole issue irrelevant.
#16
Bug Reports / RFE / Re: [BUG] nullability annotati...
Last post by spasi - August 01, 2024, 11:17:06
Hey @vanzomerenc,

Quote from: vanzomerenc on July 31, 2024, 22:12:58Is there any plan to move LWJGL to a different annotation package such as JSpecify?
Not yet, but if JSpecify gets the expected adoption, we could migrate to it in an upcoming major release (3.4.0 or 3.5.0). Also note that jsr305 is not bundled/distributed by LWJGL. It is entirely optional and up to the user if they want to use it during development.

In the LWJGL 4 prototype I've been working on, jsr305 annotations have already been removed. The hope is that null-excluding types will be available in some form with Valhalla, which will reduce/eliminate the need for nullability annotations. Also, Java null values cannot be used with Panama for NULL pointers, you have to use MemorySegment.NULL instead. This alone removes 99% of @Nullable annotations in the LWJGL API.
#17
Bug Reports / RFE / [BUG] nullability annotations ...
Last post by vanzomerenc - July 31, 2024, 22:12:58
LWJGL uses nullability annotations from JSR 305, which appears to have died a very long time ago without an official implementation, or even a draft of a specification.

Because the only implementation of JSR 305 is the unofficial one by the FindBugs team, and it puts annotations in a javax package, anyone who distributes it is technically violating Oracle's licensing agreement.

Google Guava has an issue that I think explains the situation pretty well: https://github.com/google/guava/issues/2960

Obviously a lot of projects are in the same boat and I don't think Oracle is going to go knocking down doors about this, but it's not great to encourage violating license terms. Is there any plan to move LWJGL to a different annotation package such as JSpecify?
#18
The July release of Area Zero (v0.15.0) is now available for download: https://ephemeraltechnicalarts.com/area-zero

Release Notes:

0.15.0 (7/19/2024)
  1. Matches ending in a draw are now resolved by determining which character has the higher percentage of their
     damage meter filled.  Percentage graphics added to damage meter.
  2. Special attack revisions:
     a. Each special attack has 5 options: regular, EX, regular with armor (blue), EX with armor (yellow)
       and heavy armor (red).
     b. The new option for heavy armor requires one blue meter to activate, but will continue to armor while
       red (super) meter is available.
     c. Armor tutorial objective updated and moved to the Advanced tutorial.
  3. Iteration on tutorial mode. Updates to run cancelling, parry and armored attacks.
  4. Character statistics card added to character select screen. Press the light punch button (typically 'X' or
     'square' on Xbox and PS controllers, respectively).
  5. Further iterations on the new characters, Michael and Christopher.
     a. Move lists updated.
     b. Color palettes defined and coordinated with the selected character's brother for assists.
     c. Christopher's balloons now colored to match his color palette. Mirror matches should be able to
        distinguish between balloons.
     d. Begin iterating on animations for the brothers.
#19
OpenGL / imageLoad() not giving the exp...
Last post by Graph3r - July 05, 2024, 01:35:10
I made a compute shader that would use the depth buffer texture as a input for post processing, the imageLoad() returns a vec4, but the image only has one channel. I first tried to just write imageLoad(depthImage, gid).r but nothing happened, I tried going through r, g, b and a channels too, but it wouldn't work either. When using a vertex and fragment shader to render the depth texture as a quad, it worked and displayed the depth as a grayscale. Why doesn't the imageLoad do anything, here is parts of the code if it helps:
// Setup
depthTexture = glGenTextures();
glBindTexture(GL_TEXTURE_2D, depthTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, width, height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, (FloatBuffer) null);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthTexture, 0);
computeProgram = ShaderProgram.fromFiles("src\\game\\test.compute", "offscreenrenderer", 0);
quad = new FullscreenQuad();
computeProgram.use();
glBindImageTexture(0, renderedTexture, 0, false, 0, GL_READ_ONLY, GL_RGBA32F);
glBindImageTexture(1, depthTexture, 0, false, 0, GL_READ_ONLY, GL_R32F);
glBindImageTexture(2, processedTexture, 0, false, 0, GL_WRITE_ONLY, GL_RGBA32F);
computeProgram.unuse();

// Methods in the code for starting the rendering and for doing the post processing:
public void start() {
    glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
    //glBindRenderbuffer(GL_RENDERBUFFER, depthBuffer);
    glViewport(0, 0, width, height);
}

public void runPostProcess() {
    computeProgram.use();
    glDispatchCompute((int) Math.ceil(width / 16.0), (int) Math.ceil(height / 16.0), 1);
    glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
    computeProgram.unuse();

    glBindFramebuffer(GL_FRAMEBUFFER, 0);
    glClear(GL_COLOR_BUFFER_BIT);
    quad.setTexture(processedTexture);
    quad.render();
}
Simple debugging in the compute shader:
#version 430
layout(local_size_x = 16, local_size_y = 16) in;

layout(binding = 0, rgba32f) uniform image2D inputImage; // Works
layout(binding = 1, r32f) uniform image2D depthImage; // Doesn't work
layout(binding = 2, rgba32f) uniform image2D outputImage; // Works

void main() {
    ivec2 pos = ivec2(gl_GlobalInvocationID.xy);
    imageStore(outputImage, pos, imageLoad(depthImage, pos));
}
#20
OpenGL / OpenGl ARB_base_instance exten...
Last post by Graou - June 20, 2024, 09:37:27
Hi,
I would have liked to use the services of the ARB_base_instance extension but there are some symptoms which make me believe that it is not supported.
I was able to see this directly in runtime or by querying the list of supported extensions.
Is it a desire specific to LWJGL to ignore this extension, an implementation still to be done or a potential problem on the side of my environment?
The LWJGL versions I tested are 3.3.2 to 3.3.3+5 and the OpenGl version is 4.1 ATI-4.14.1.