Results 1 to 2 of 2

Thread: Interoperability block texture access

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    4

    Interoperability block texture access

    Texture Initialization:
    Code :
    for (int i = 0; i < data.Length; i +=4) {
    				data [i] = 125;
    			}
    			GL.BindTexture (TextureTarget.Texture2D, tboID [0]);
    			GL.TexImage2D<byte> (TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba8, w, h, 0,
    			                     PixelFormat.Rgba, PixelType.UnsignedByte, data);
     
    			GL.BindTexture (TextureTarget.Texture2D, 0)

    TBO+FBO Initialization:

    Code :
    			GL.BindFramebuffer (FramebufferTarget.FramebufferExt, fboID [0]);
    			GL.FramebufferTexture2D (FramebufferTarget.FramebufferExt, FramebufferAttachment.ColorAttachment0,
    			                         TextureTarget.Texture2D, tboID [0], 0);
    			GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0);
    CL/GL Initialization:
    Code :
    bufferID = CL.CreateFromGLTexture2D (context, MemFlags.MemReadWrite, TextureTarget.Texture2D, ((uint[])tboID.Clone()) [0], 0);

    Render Loop:
    Code :
    			for (int i = 0; i < data.Length; i += 4) {
    				data [i] = tt;
    			}
    			tt++;
    			GL.BindTexture (TextureTarget.Texture2D, tboID [0]);
    			GL.TexImage2D<byte> (TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba8, w, h, 0,
    			                     PixelFormat.Rgba, PixelType.UnsignedByte, data);
     
    			GL.BindTexture (TextureTarget.Texture2D, 0);
    			GL.BindFramebuffer (FramebufferTarget.FramebufferExt, fboID [0]);
    			GL.FramebufferTexture2D (FramebufferTarget.FramebufferExt, FramebufferAttachment.ColorAttachment0,
    			                         TextureTarget.Texture2D, tboID [0], 0);
    			GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0);GL.BindFramebuffer (FramebufferTarget.ReadFramebuffer, fboID [0]);
     
    			GL.ReadBuffer (ReadBufferMode.ColorAttachment0);
    			GL.DrawBuffer (DrawBufferMode.Back);
     
    			GL.BlitFramebuffer (0, 0, w, h, 0, 0, w, h, ClearBufferMask.ColorBufferBit, BlitFramebufferFilter.Nearest);
     
    			GL.BindFramebuffer (FramebufferTarget.ReadFramebuffer, 0);

    The work of this should be simple. The color of screen is being changed from black to red. And It works until there is no CL/GL initialization. When I add it, it doesn't work.

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    4

    Re: Interoperability block texture access

    You can see more information about my issue here http://forums.amd.com/forum/messagev...&enterthread=y.

Similar Threads

  1. Block edges updates
    By arthur.sw in forum OpenCL
    Replies: 8
    Last Post: 04-08-2011, 12:10 AM
  2. Re: block edges
    By arthur.sw in forum OpenCL
    Replies: 0
    Last Post: 04-07-2011, 05:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •