Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20493 Discussions

Intel GPU - Passing Image Samplers to Functions

Scenomics
Beginner
803 Views

Consider the following example:

   #version 430 core
   uvec4 ProcessImage( uimage2D image, ivec2 coords )
   {
      uvec4 val = imageLoad( image, coords );
      // Do some processing...
      return val;
   }

   layout( r8ui ) uniform uimage2D src_image;
   layout( r8ui ) uniform uimage2D dst_image;

   void main()
   {
      ivec2 coords = ivec2( gl_GlobalInvocationID );
      uvec4 val = ProcessImage( src_image, coords );
      imageStore( dst_image, coords, val );
   }

The problem is with the function declaration:

   uvec4 ProcessImage( uimage2D image, ivec2 coords )

I apparently need to use the writeonly qualifier or I can't pass an image sampler to a function. That wouldn't even work anyway, because I want to be able to call imageLoad( ... ) in my function.

After some investigation, it looks like GL_EXT_shader_image_load_formatted would make it possible to pass image samplers to functions. For now we have special versions of our shaders for Intel GPUs. Is there any plan for Intel to support this extension?

Here's a GitHub discussion of the issue as it affects other vendors:

https://github.com/KhronosGroup/GLSL/issues/57

 

Thanks for any information you can provide 🙂

0 Kudos
7 Replies
AndrewG_Intel
Moderator
780 Views

Hello @Scenomics

Thank you for posting on the Intel® communities.


In order to provide you with the correct information or route this request to the proper channel of support, could you please confirm/provide the following information?


1- The exact model (SKU) of the Intel® Graphics Controllers (GPU) you are using:

2- Do you work for a software company?

3- Are you developing software or hardware using Intel® components and/or Intel® tools? If yes, please provide more details and elaborate more on the type of project you are developing.

4- Why are you looking for/do you need this information?


Best regards,

Andrew G.

Intel Customer Support Technician


0 Kudos
Scenomics
Beginner
654 Views

Thank you very much for the reply. I'll answer your questions below.

1- The exact model (SKU) of the Intel® Graphics Controllers (GPU) you are using:

   There are several. For example Intel® UHD 630. Here's the information OpenGL returned about this device.

   GL Vendor: Intel
   GL Renderer: Intel(R) UHD Graphics 630
   GL Version: 4.6.0 - Build 30.0.101.1191
   GL Shading Language Version: 4.60 - Build 30.0.101.1191

2- Do you work for a software company?

   Yes, this is for a work project.

3- Are you developing software or hardware using Intel® components and/or Intel® tools? If yes, please provide more details and elaborate more on the type of project you are developing.

   I would be happy to discuss this via PM or email. As an aside to this, I'm interested in trying Intel compilers.

4- Why are you looking for/do you need this information?

   Intel has a very large installed base of GPUs. It's important that our products work on Intel GPUs, and it would be great if we could use the full range of OpenGL features. Image samplers, such as image2D, are a critical part of modern OpenGL, especially for compute shaders. When you are using compute shaders, the only way to get data out is to write data to shader buffers or image samplers. Being unable to pass image samplers to functions makes it difficult to use functions in GLSL, and it's tedious/error prone to have to inline everything.

0 Kudos
Scenomics
Beginner
654 Views

I just wanted to let you know that I replied to this promptly, but it didn't save my reply. I sincerely apologize for the delayed response!

 

1- The exact model (SKU) of the Intel® Graphics Controllers (GPU) you are using:

   Intel UHD Graphics 630. Here's the information the driver reported about the device.

   GL renderer using pixel format 5
   GL Vendor: Intel
   GL Renderer: Intel(R) UHD Graphics 630
   GL Version: 4.6.0 - Build 30.0.101.1191
   GL Shading Language Version: 4.60 - Build 30.0.101.1191

2- Do you work for a software company?

   Yes, this is for work.

3- Are you developing software or hardware using Intel® components and/or Intel® tools? If yes, please provide more details and elaborate more on the type of project you are developing.

   I can't discuss the details in public, but I can via PM or email. As an aside, I am interested in Intel compilers.

4- Why are you looking for/do you need this information?

   Compute shaders are the most important GPU compute tech. When you are using compute shaders, the only way to get information out is by writing to a shader buffer or writing to an image sampler such as image2D or uimage2D and so forth. Intel has a very large installed base of GPUs and we would like to be use compute shaders on Intel GPUs without having to manually inline all our function calls. For reference, this isn't just a problem on Intel GPUs either (as noted in the GitHub discussion linked in my original post). That's why I inquired about any plans to support GL_EXT_shader_image_load_formatted on Intel GPUs.

0 Kudos
AndrewG_Intel
Moderator
752 Views

Hello Scenomics

We are checking this thread and we would like to know if you need further assistance. Please do not hesitate to contact us back if you have additional inquiries.


Best regards,

Andrew G.

Intel Customer Support Technician


0 Kudos
Scenomics
Beginner
746 Views

I've replied twice, but my replies keep getting deleted for some reason. Not sure what to do.

0 Kudos
AndrewG_Intel
Moderator
713 Views

Hello Scenomics

Thank you for your response and for all the details you sent via private message.


We understand that you work for a company developing software for Intel hardware where you need to run compute shaders on Intel GPUs making software for GPU compute, including video processing and other domains.

We understand that you would like to know about future support for GL_EXT_shader_image_load_formatted since right now you're manually inlining code for deployment on Intel GPUs because you cannot pass image samplers to functions.


Please allow us to review this and we will be posting back in the thread as soon as possible.


Best regards,

Andrew G.

Intel Customer Support Technician


0 Kudos
AndrewG_Intel
Moderator
672 Views

Hello Scenomics

Thank you for your patience in this matter.


After reviewing this further, we would like to inform you that we cannot provide information or comments about unannounced features or products. However, we would like to refer you to the Developer Software Forums, there are different subforums there that might be useful and you could receive some assistance there.


Having said that, we will proceed to close this thread now.

Thank you for your understanding.

Best regards,

Andrew G.

Intel Customer Support Technician


0 Kudos
Reply