Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

113 Neutral

About _Flame_

  • Rank

Personal Information

  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you, now it's clear that I need to create a different framebuffer with specific format.
  2. What I actually expect is to change a format of output into something like GL_RGBAI8 and be able to write int where each byte prepesents corresponding color. I found several post in the internet where people state that the only possible format is vec4. Is it true? Yes, I want to change the format of resulting color but not intermediate buffer.
  3. Hello . Yes, black screen. Maybe we need to change framebuffer pixel format somehow.
  4. Hello. I can only use vec4 in glsl as out color. How to use other formats like int, uint, ivec4, ..?
  5. 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.
  6. Hi Andrey. Thank you a lot for your help! Have you tried on amd?
  7. Yes, and probably to change into - float4 valf = { 1.f, 0.f, 0.f, 0.f };
  8. Changed. Texture is created inside QuadDrawable.cpp and opencl code inside OpenCLWorker.cpp Also copy kernel.cl to the folder with app.
  9. Is glut instead of glfw? Replaced.
  10. In Cuda we can declare a variable this way - __device__ int someVar; Then via cudaMemcpyToSymbol we can copy/transfer a value to that variable. And we can refer to this variable from kernels. This variable will be available through the whole app life. This is some sort of static variable of TU and this is really handy beasue we don't need to pass such variables as kernel arguments. I see now these is no such thing in OpenCL. I'm not doing anything specific, just learning OpenCL/Cuda and facinated by their opportunities.
  11. Thanks, I have already figured out that the only way in OpenCL to transfer data from host to device is through function parameters. There is no analog of cudaMemcpyToSymbol in OpenCL.
  12. Looks like no. write_imagei black screen
  13. Found needed combination - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32I, width, height, 0, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, nullptr) or glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32I, width, height, 0, GL_RGBA_INTEGER, GL_INT, nullptr) Now format is CL_SIGNED_INT32 but image is still black.
  14. CL_UNORM_INT8. Is it possible to control it? According to cl spec internal GL_RGBA32I format corresponds to CL_RGBA, CL_SIGNED_INT32. But when I try to use glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32I, width, height, 0, GL_RGBA, GL_INT, nullptr) then clCreateFromGLTexture returns CL_INVALID_GL_OBJECT error.
  15. Hello Andrey. __kernel void convolution(write_only image2d_t outputImage) { int tidx = get_global_id(0); int tidy = get_global_id(1); int2 coords = 0; coords.x = tidx; coords.y = tidy; int4 val; val.x = 255; val.y = 255; val.z = 255; val.w = 255; write_imagei(outputImage, coords, val); } 2) May be problem with normalized colors value (float/int/uint) ? The problem is that according to documentation write_imagei can be used with image_channel_data_type set to one of the following values: CL_SIGNED_INT8, CL_SIGNED_INT16, or CL_SIGNED_INT32. I know how to control it if I create an image by clcreateimage2d by no clue how to do it with shared opengl texture. I get black color unless i use write_imagef
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!