LWJGL Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 8 9 [10]
 91 
 on: May 27, 2017, 11:49:13 
Started by Lightbuffer - Last post by Lightbuffer
Hello there!

LWJGL3 tutorials are cool and quite educational, but it's very difficult to apply them on practice. I have a quite hard time grasping those concepts and putting them together, since there's a lot of stuff going on. Meanwhile a video game written in LWJGL3 with source code and ability to tweak and compile will help to advance and see how these techniques and stuff is applied.

Are there any simple (2d or 3d) video games which are written in LWJGL3 and are open-sourced?

Thanks for attention! :)

 92 
 on: May 26, 2017, 19:22:44 
Started by officialhopsof - Last post by Evan407
You can find a description of the parameters in the javadoc or in the OpenCL Reference Page for clCreateContext.

Btw, I just tried your program (with the #define) and it builds without errors.
I haven't been able to test it with more than a single device. My pc only has one graphics card but my aim was to retrieve all the devices in the nature of OpenCL. I intend to use OpenCL for some image processing applications to drastically increase the speed of my iterations.

So far I've found out openCL has a pointless Work Group with the important work items which are kernel instances that are called on like functions or methods. I think there may be some hierarchy redundancy there.

The point is that there is Global and Constant memory defined by the host and then there is openCL kernel that runs off this memory using memory commands. You have to fill the buffers with the global and constant memory and then run kernel. After you can unmap a region of a memory object aka retrieve the computed results. Explicitly copying data / mapping and unmaping regions of a memory object.

Create memory objects in global memory, enqueue memory commands. Kernel execution commands.

 93 
 on: May 26, 2017, 13:59:08 
Started by jrdan - Last post by darkyellow
In what way is this a lwjgl issue?  You are asking a question about getting the context from another process which is neither lwjgl nor GLFW relevant. I'm not trying to be nasty to you but there might be better places to ask this question (best location is unknown to me though)

 94 
 on: May 26, 2017, 06:23:04 
Started by jrdan - Last post by jrdan
no one can fix this issue´╝č

 95 
 on: May 25, 2017, 18:35:05 
Started by officialhopsof - Last post by spasi
You can find a description of the parameters in the javadoc or in the OpenCL Reference Page for clCreateContext.

Btw, I just tried your program (with the #define) and it builds without errors.

 96 
 on: May 25, 2017, 17:26:03 
Started by officialhopsof - Last post by Evan407
I haven't gotten there yet but here is what I run
java -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true -cp Dependencies/lwjgl/*:. com.evanstools.opencl.demo.Demo
it provides more error reporting.

I'm able to create a context for each platform. I'm trying to retrieve all devices.
http://evansgame.com/com/evanstools/opencl/demo/Platform.java

There are error callbacks too that help. I'm still trying to find out how to use the parameters of
Quote
invoke(long errinfo, long private_info, long cb, long user_data)

They are long data types I'm assuming ... pointers. I've been referring them to as id like a memory id or reference type or pointers. Basically all the longs are pointers.

 97 
 on: May 24, 2017, 21:44:03 
Started by officialhopsof - Last post by spasi
There's nothing unusual about OpenCL in LWJGL. Inspect the CL_PROGRAM_BUILD_LOG to see what the problem is.

 98 
 on: May 24, 2017, 20:40:06 
Started by Evan407 - Last post by Evan407
this solved it
Code: [Select]
sudo apt install nvidia-opencl-icd-375
Quote
"Number of platforms: 1"

 99 
 on: May 24, 2017, 20:32:45 
Started by Evan407 - Last post by Evan407
Code: [Select]
package com.evanstools.opencl.demo;
import static org.lwjgl.opencl.CL10.*;
import org.lwjgl.*;
import java.nio.*;
import static org.lwjgl.BufferUtils.*;
class Demo{
  public static void main(String[] args){
    PointerBuffer platforms = createPointerBuffer(1);
    IntBuffer num_platforms = createIntBuffer(1);
    clGetPlatformIDs(platforms,num_platforms);
    System.out.printf("Number of platforms: %d%n",num_platforms.get());
  }
}
Quote
Number of platforms: 0

 100 
 on: May 24, 2017, 20:10:30 
Started by officialhopsof - Last post by officialhopsof
The OpenCL Definition says that C99 preprocessor directives are available for use, however when I try to use one with LWJGL I get a build error (error code -11)

Code: [Select]
    String programSource =
       "#define A 1\n"
     + "kernel void foo(global int* definedNumber){\n"
     + "  *definedNumber = A;\n"
     + "}";
   
    clProgram = CL10.clCreateProgramWithSource(clContext, programSource, errcode_ret);
    int errcode = clBuildProgram(clProgram, clDevice, "", null, NULL);
    checkCLError(errcode); // <--- Build error (errcode == -11)

If i change the programSouce to

Code: [Select]
kernel void foo(global int* definedNumber){
  *definedNumber = 1;
}

The program compiles just fine.

Are preprocessor directives not available when using LWJGL?

Quote
Error Code -11
CL_BUILD_PROGRAM _FAILURE   
clBuildProgram   
if there is a failure to build the program executable. This error will be returned if clBuildProgram does not return until the build has completed.

Pages: 1 ... 8 9 [10]