🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Why only write_imagef for shared gl texture?

Started by
19 comments, last by AndreyVK_D3D 5 years, 7 months ago
59 minutes ago, Andrey OGL_D3D said:

@_Flame_, can you create a simple project without any dependencies ?

I haven't PkgConfig, GLFW. 

 

Is glut instead of glfw?

Replaced.

Advertisement
27 minutes ago, _Flame_ said:

Is glut instead of glfw?

Yes, you can use glut instead of glfw, please create simple test project, i will change code and test of result.

3DGraphics,Direct3D12,Vulkan,OpenCL,Algorithms

Changed. Texture is created inside QuadDrawable.cpp and opencl code inside OpenCLWorker.cpp Also copy kernel.cl to the folder with app.

15 hours ago, _Flame_ said:

Changed. Texture is created inside QuadDrawable.cpp and opencl code inside OpenCLWorker.cpp Also copy kernel.cl to the folder with app.

i Have a black texture even using write_imagef:


    float4 valf = { 255.f, 0.f, 0.f, 255.f };
    write_imagef(outputImage, coords, valf);


Sorry, i have found my mistake, i should change texture parameters:

 


const int TEXTURE_INTERNAL_FORMAT = GL_RGBA;
    const GLenum TEXTURE_FORMAT = GL_RGBA;
    const GLenum TEXTURE_TYPE = GL_UNSIGNED_BYTE;

 

3DGraphics,Direct3D12,Vulkan,OpenCL,Algorithms

Yes, and probably to change into - float4 valf = { 1.f, 0.f, 0.f, 0.f };

Hi @_Flame_, I have no any ideas, try to ask on AMD forum,  I think  moderator dipak, can help you.

 

3DGraphics,Direct3D12,Vulkan,OpenCL,Algorithms

Hi Andrey. Thank you a lot for your help! Have you tried on amd?

1 minute ago, _Flame_ said:

Have you tried on amd?

Yes, i have the same result on AMD, black texture for

 GL_RGBA_INTEGER/GL_RGBA8UI and 


uint4 vali = { 255, 0, 0, 255 };
write_imageui(outputImage, coords, vali);

Also, I have some AMD forum posts about OpenCL/Vulkan. You should ask about it on AMD even if you have an invalid result on nVidia/Intel.

3DGraphics,Direct3D12,Vulkan,OpenCL,Algorithms

Hello Andrey.

The problem is not in opencl but in opengl. I used sampler2d in fragment shader but isampler2d/usampler2d should be used. Thank you for your help.

Hi @_Flame_, I'm glad that you have the decision

3DGraphics,Direct3D12,Vulkan,OpenCL,Algorithms

This topic is closed to new replies.

Advertisement