   OpenGL OpenCL problem
  I'm trying to midify the floating-point output image of my openGL program with openCL.This functions draws the output to the framebuffer object:void DrawToTexture(){// Setting up RMT -------------------------------------------------------------------------- //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboRenderTarget);glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texRtDiffuse, 0);glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, texRtNormal, 0);GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT };glDrawBuffers(2, buffers);glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rbRenderBuffer);// ----------------------------------------------------------------------------------------- //glEnableClientState(GL_VERTEX_ARRAY);glEnableClientState(GL_ELEMENT_ARRAY_BUFFER);glUseProgram(gpRenderScene);glClearColor(0.1f,0.1f,0.2f,1);glClearDepth(1);glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);scene.DrawOpenGL(attrRefsRenderScene.refPosition, attrRefsRenderScene.refNormal, attrRefsRenderScene.refTexcoord, unifRefsRenderScene.refTexture, unifRefsRenderScene.refUseDiffTexture);// Disabling RMT --------------------------------------------------------------------------- //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);// ----------------------------------------------------------------------------------------- //ProcessImageCL();}And here is ProcessImageCL():void ProcessImageCL(){glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboRenderTarget);glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, pboSrc);glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);glReadPixels(0, 0, screenW, screenH, GL_BGRA, GL_FLOAT, NULL); /* Registering PBO */glFlush();clEnqueueAcquireGLObjects(clCommandQueue, 1, &clMemPboIn, 0, NULL, NULL);clEnqueueAcquireGLObjects(clCommandQueue, 1, &clMemPboOut, 0, NULL, NULL);/* Updating kernel parameters and executing kernel */CLERRCHK(clSetKernelArg(clKernel, 0, sizeof(cl_mem), (void*)&clMemPboIn));CLERRCHK(clSetKernelArg(clKernel, 1, sizeof(cl_mem), (void*)&clMemPboOut));CLERRCHK(clSetKernelArg(clKernel, 2, sizeof(cl_int), (void*)&screenW));CLERRCHK(clSetKernelArg(clKernel, 3, sizeof(cl_int), (void*)&screenH));CLERRCHK(clEnqueueNDRangeKernel(clCommandQueue, clKernel, 2, NULL, (size_t*)clGlobalWorkSize, (size_t*)clLocalWorkSize, 0, NULL, NULL));/* Unregistering PBO */CLERRCHK(clEnqueueReleaseGLObjects(clCommandQueue, 1, &clMemPboIn, 0, NULL, NULL));CLERRCHK(clEnqueueReleaseGLObjects(clCommandQueue, 1, &clMemPboOut, 0, NULL, NULL));CLERRCHK(clFinish(clCommandQueue));glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pboDst);glBindTexture(GL_TEXTURE_2D, texRtNormal);glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, screenW, screenH, GL_BGRA, GL_FLOAT, NULL);}Init functions:bool InitOpenGL(){// Initialize glewglewInit();// Create vertex and element bufferfloat aspect = (float)screenW / (float)screenH;float vertexBufferQuad[] = { -1 * aspect, -1,  0,  0,  0,/**/  1 * aspect, -1,  0,  1,  0,/**/ -1 * aspect,  1,  0,  0,  1,/**/  1 * aspect,  1,  0,  1,  1 };vbQuad  = glutilCreateBuffer(GL_ARRAY_BUFFER, vertexBufferQuad, sizeof(vertexBufferQuad));GLuint elementBufferQuad[] = { 0, 1, 2, 3 };ebQuad = glutilCreateBuffer(GL_ELEMENT_ARRAY_BUFFER, elementBufferQuad, sizeof(elementBufferQuad));// Create shaders and link the into one GLSL programvsRenderQuad = glutilCreateShader(GL_VERTEX_SHADER, L"shRndrQuadVS.glsl");fsRenderQuad = glutilCreateShader(GL_FRAGMENT_SHADER, L"shRndrQuadFS.glsl");gpRenderQuad = glutilLinkShaders(vsRenderQuad, fsRenderQuad);vsRenderScene = glutilCreateShader(GL_VERTEX_SHADER, L"shRndrSceneVS.glsl");fsRenderScene = glutilCreateShader(GL_FRAGMENT_SHADER, L"shRndrSceneFS.glsl");gpRenderScene = glutilLinkShaders(vsRenderScene, fsRenderScene);// Binding uniform and varying shader variables and thier referencesunifRefsRenderQuad.refTexture    = glGetUniformLocation(gpRenderQuad, "texture");attrRefsRenderQuad.refPosition   = glGetAttribLocation(gpRenderQuad, "positionVS");attrRefsRenderQuad.refTexcoord   = glGetAttribLocation(gpRenderQuad, "texcoordVS");unifRefsRenderScene.refTexture   = glGetUniformLocation(gpRenderScene, "texture");unifRefsRenderScene.refUseDiffTexture = glGetUniformLocation(gpRenderScene, "useDiffTexture");attrRefsRenderScene.refPosition  = glGetAttribLocation(gpRenderScene, "positionVS");attrRefsRenderScene.refNormal    = glGetAttribLocation(gpRenderScene, "normalVS");attrRefsRenderScene.refTexcoord  = glGetAttribLocation(gpRenderScene, "texcoordVS");// Create Frame Buffer ObjectglGenFramebuffersEXT(1, &fboRenderTarget);glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboRenderTarget);// Create render bufferglGenRenderbuffersEXT(1, &rbRenderBuffer);glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rbRenderBuffer);glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, screenW, screenH);glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);// Create render target texturestexRtDiffuse = glutilCreateTexture(screenW, screenH, GL_RGBA16F);texRtNormal = glutilCreateTexture(screenW, screenH, GL_RGBA16F);glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texRtDiffuse, 0);glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, texRtNormal, 0);// Set frame buffer's renderbuffer to rbRenderBufferglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rbRenderBuffer);glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);// Set up OpenGL BG and DEPTH propertiesglEnable(GL_DEPTH_TEST);glDepthFunc(GL_LESS);glShadeModel(GL_SMOOTH);glClearColor(1,1,1,1);glClearDepth(1);// Initializing sceneif(!scene.LoadSceneFromFile(L"testscene01.obj"))return false;scene.CreateOGLBuffsAndTexs();// Create Pixel Buffer ObjectsCreatePBO(&pboSrc, 16);CreatePBO(&pboDst, 16);return true;}void CreatePBO(GLuint* pbo, size_t texelSizeInBytes){// set up data parameter    int numTexels = screenW * screenH;    int sizeTexData = texelSizeInBytes * numTexels;    // create buffer objectglGenBuffers(1, pbo);    glBindBuffer(GL_ARRAY_BUFFER, *pbo);    // buffer data    glBufferData(GL_ARRAY_BUFFER, sizeTexData, NULL, GL_DYNAMIC_DRAW);    glBindBuffer(GL_ARRAY_BUFFER, 0);}bool InitOpenCL(){    clLocalWorkSize[0] = 16;    clLocalWorkSize[1] = 16;clGlobalWorkSize[0] = clutilRoundUp((int)clLocalWorkSize[0], screenW);    clGlobalWorkSize[1] = clutilRoundUp((int)clLocalWorkSize[1], screenH);/* Initializing OpenCL */CLERRCHK(clGetPlatformIDs(1, &clPlatformID, NULL));CLERRCHK(clGetDeviceIDs(clPlatformID, CL_DEVICE_TYPE_GPU, 1, &clDeviceID, NULL));cl_context_properties props[] = {CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(), CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(), CL_CONTEXT_PLATFORM, (cl_context_properties)clPlatformID, 0};clContext = clCreateContext(props, 1, &clDeviceID, NULL, NULL, &clError);CLERRCHK(clError);clCommandQueue = clCreateCommandQueue(clContext, clDeviceID, 0, &clError);CLERRCHK(clError);/* Creating OpenCL memory buffers - GL-CL interop*/clMemPboIn = clCreateFromGLBuffer(clContext, CL_MEM_READ_ONLY, pboSrc,  &clError);CLERRCHK(clError);clMemPboOut = clCreateFromGLBuffer(clContext, CL_MEM_WRITE_ONLY, pboDst,  &clError);CLERRCHK(clError);/* Loading and compiling OpenCL program and kernel from file */clProgramSource = clutilReadWholeFile("clPostProcess.cl");CLERRCHK(clProgramSource.size() == 0 ? 1 : CL_SUCCESS);const char* scrPtr = clProgramSource.c_str();size_t clKernelSize = clProgramSource.length();clProgram = clCreateProgramWithSource(clContext, 1, (const char **)&(scrPtr), (size_t*)&clKernelSize, &clError);CLERRCHK(clError);CLERRCHK(clBuildProgram(clProgram, 0, NULL, NULL, NULL, NULL));clKernel = clCreateKernel(clProgram, "clPostProcessKernel", &clError);CLERRCHK(clError);return true;}CL kernel:__kernel void clPostProcessKernel(__global const float* gDataIn, __global float* gDataOut, int imgWidth, int imgHeight, __local uint* lmin){// Stop kernel execution if pixel is out of boundaries.    const int x = get_global_id(0);    const int y = get_global_id(1);    if(x >= imgWidth || y >= imgHeight )return;const int tx = get_local_id(0);    const int ty = get_local_id(1);const int bw = get_local_size(0);    const int bh = get_local_size(1);gDataOut[y * imgWidth + x] = 0.0f;return;}Everything works fine when i use simple RGBA output, but in case of RGBAF16 I get CL_OUT_OF_RESOURCES error. Sorry for the tons of code, but I really don't know what can be the problem. I have even tried it with OpenGL 3 with freeglut (this version uses freeglut too), but the result is the same, unsigned output ok, floating point CL_OUT_OF_RESOURCES.