Access violation in glLinkProgram using sampler2D texture[] array

I am running into driver Access violation when trying to link a vertex and fragment program in OpenGL.

Platform is Windows 11 Pro v 22H2

OpenGL context information:

<span>OpenGL version string</span><span>: </span><span>"4.6.0 - Build 31.0.101.4575"</span><span>.</span><br><span>OpenGL version</span><span>: </span><span>4.6.</span><br><span>Vendor</span><span>: </span><span>Intel</span><br><span>Card name</span><span>: </span><span>Intel(R) Iris(R) Xe Graphics</span><br><span>Card version</span><span>: </span><span>4.6.0 - Build 31.0.101.4575</span>

Fragment shader:

#version 120<br><br>// Repro requirements to fail on intel<br>// 1. texture array uniform inside a struct<br>// 2. array passed to function where it is indexed<br><br>struct Structure {<br>  sampler2D textures[6]; <br>};<br>uniform Structure u_data;<br><br>float sample(in sampler2D array[6], in vec2 texcoord) {<br>  return texture2D(array[0], texcoord).x;<br>}<br><br>void main() {<br>  float s = sample(u_data.textures, vec2(0.0));<br>  gl_FragColor = vec4( s );<br>}

Vertex shader:

#version 120<br><br>void main() {<br>vec4 viewPosition = gl_ModelViewMatrix * gl_Vertex;<br>  gl_Position = gl_ProjectionMatrix * viewPosition;<br>}

If I index the array directly in the main method or if I move the uniform textures out from the structure and use it the linking passes. So this seems to be a combination of GLSL language features that provokes the crash.

Graphics bug report.docx (20.4 KB)

Hello  @ulassi

Thank you for posting on the Intel️® communities.

We understand you are experiencing issues with Intel® Iris® Xe Graphics, we will be more than happy to assist you.

Please download the latest graphics driver 31.0.101.4900. Then, use the Display Driver Uninstaller (DDU). After that, please install the latest driver previously downloaded.

Please make sure you run Windows update and your BIOS is up to date (contact your system manufacturer).

Also, in order to have more information about your system, please download, install and run Intel® System Support Utility for Windows. Make sure you check “Everything” before you scan, then save the report and attach it to your response.

Best regards,

Jose B.

Intel Customer Support Technician

Hello ulassi

We hope you are doing fine.

Were you able to clean install the latest graphics driver and update the system?

Let us know if you still need assistance by attaching the required report.

Best regards,

Jose B.

Intel Customer Support Technician

Hi, sorry for the delay. But I managed to install the new driver as per your instructions. This is still an issue on that driver. You can find the report you requested attached to this message.

Best,

Urban

report.txt (222 KB)

Hello ulassi

Thank you for the information provided.

We are sorry that after the steps taken the issue persists. Please answer the following:

·      Do you work for or represent a software company?

·      Are you developing a game or an app?

·      Have you tried using a third-party GPU to replicate the issue?

Best regards,

Jose B.

Intel Customer Support Technician

* Yes I work for a company, this issue was discovered while developing for this company.

* We develop a desktop application

* This issue is not reproducible on neither Nvidia or AMD GPU:s.

Hello ulassi

Thank you for your replay.

Is it possible for you to share the application you are developing? As well the steps to try to reproduce the issue.

Please let us know, we would like to further investigate.

Best regards,

Jose B.

Intel Customer Support Technician

I can share an executable that reproduces the issue. Can you contact me on my email and I can share an archive with you.

Hello ulassi

Thank you for the confirmation.

I will contact you privately.

Best regards,

Jose B.

Intel Customer Support Technician

Hello ulassi

We hope you are doing fine.

Did you receive my email?

Let us know if you still need assistance by sending the required information.

Best regards,

Jose B.

Intel Customer Support Technician

Hi,

Yes I did, and I did respond by sending an archive of binaries. Did you not receive anything?

Hello ulassi

Thank you for letting us know.

Unfortunately, we did not receive your reply. Could you please reply my previous email with the files again?

Best regards,

Jose B.

Intel Customer Support Technician

Hello ulassi

We hope you are doing fine.

Were you able to send the information again?

Let us know if you still need assistance.

Best regards,

Jose B.

Intel Customer Support Technician

I did send an email to the adress again.

Is there anything that could block a zip archive from being transmitted?

Hello ulassi

We appreciate your response.

Allow us to check more options internally, to try to get the files from you. We will post back as soon as we have any information.

Best regards,

Jose B.

Intel Customer Support Technician

Hello ulassi

Thank you for patiently waiting.

After checking, we only have 2 methods (forum and email). Is there any cloud method you consider secure?

Please let us know.

Best regards,

Jose B.

Intel Customer Support Technician

I sent another reply to the adress, this time with a link to a shared file.

Hope that one does it :).

Best,

ulassi

Hello ulassi

Thank you for patiently waiting.

We have an update on this matter.

We received your files and tried to replicate the issue in our lab. However, we have different results.

Since we were able to get the output “Compile sucessful, linking… Test Program Linked sucessfully!”, according to the information you provided, it means that it worked for us.

We will send an email with some more information. We highly recommend checking with the app developers. Please note that this case will no longer be monitored by Intel.

Best regards,

Jose B.

Intel Customer Support Technician

We have a workaround for this implemented in our application, the repro app basically uses the same code above with some of our setup libs to reproduce this (not in your lab it seems though).

For anyone interested, the workaround is not passing the array sampler as function parameter:

float sample(<br>  in sampler2D tex0, <br>  in sampler2D tex1, <br>  in sampler2D tex2, <br>  in sampler2D tex3, <br>  in sampler2D tex4, <br>  in sampler2D tex5, <br>  in vec2 texcoord) {<br>  // sample the 6 textures here<br>}<br><br>void main() {<br>  float s = sample(<br>     u_data.textures[0],<br>     u_data.textures[1],<br>     u_data.textures[2],<br>     u_data.textures[3],<br>     u_data.textures[4],<br>     u_data.textures[5], <br>     vec2(0.0));<br>  gl_FragColor = vec4( s );<br>}