# glProgramBinary fails

**URL:** <https://forums.imgtec.com/t/glprogrambinary-fails/3529>\
**Category:** Uncategorized\
**Created:** [June 10, 2022, 2:00pm UTC](https://forums.imgtec.com/t/glprogrambinary-fails/3529 "2022-06-10T14:00:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antoine](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Antoine](https://forums.imgtec.com/u/Antoine)\
**Post date:** [June 10, 2022, 2:00pm UTC](https://forums.imgtec.com/t/glprogrambinary-fails/3529/1 "2022-06-10T14:00:26Z")

</div>

Hello,

I am trying to use glProgramBinary and glGetProgramBinary on a compute shader, with OpenGL ES 3.2 build 1.10@5371573

I can successfuly obtain a buffer from a successfully Linked & Validated program through glGetProgramBinary.

But when I try to use glProgramBinary, with the buffer & length & binary format value I just got from the first function.  
The program GL\_LINK\_STATUS is set to false, and the info log tells:  
`Unpack program binary error: could not load corrupt binary data`

As expected:  
The GL\_NUM\_BINARY\_FORMATS gives me 1  
The supported extensions includes: GL\_IMG\_program\_binary, and GL\_OES\_get\_program\_binary

I’ve also read about \*OES functions here [GL\_IMG\_program\_binary (imgtec.com)](https://docs.imgtec.com/Architecture_Guides/Supported_Extensions_OpenGL_ES_EGL/topics/GL_IMG_program_binary.html)  
So I’ve also tested with both glGetProgramBinary/glProgramBinary and glGetProgramBinaryOES/glProgramBinaryOES but still got the same error.

Could it be related to the program containing only 1 compute shader and no other types ?

Best regards,  
Antoine

---

<div class="post-metadata">

**Author:** ![AlejandroC](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AlejandroC](https://forums.imgtec.com/u/AlejandroC)\
**Post date:** [June 10, 2022, 4:46pm UTC](https://forums.imgtec.com/t/glprogrambinary-fails/3529/2 "2022-06-10T16:46:56Z")

</div>

Hi Antoine,

Thanks for your message, I will look into the issue you are having and try to reproduce it. I will come back once I have more information.

Best regards,  
Alejandro

---

<div class="post-metadata">

**Author:** ![ThomasW](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@ThomasW](https://forums.imgtec.com/u/ThomasW)\
**Post date:** [June 27, 2022, 2:57pm UTC](https://forums.imgtec.com/t/glprogrambinary-fails/3529/3 "2022-06-27T14:57:49Z")

</div>

Hi Antoine,

Please see if the same issue occurs when you run our sample. It can be found here: [Native\_SDK/examples/OpenGLES/BinaryShaders at master · powervr-graphics/Native\_SDK · GitHub](https://github.com/powervr-graphics/Native_SDK/tree/master/examples/OpenGLES/BinaryShaders)

If the sample works on your hardware then you can try using your compute shader with it. This will let us know if the issue is caused by the binary conversion of the shader. If you encounter any problems running the sample then please send us your compute shader for us to test.

```auto
The supported extensions includes: GL_IMG_program_binary, and GL_OES_get_program_binary

```

The prefix for the GetProgramBinary extension is OES while the prefix for ProgramBinary is IMG. The binary format might not be compatible between these two extensions. If these are the only supported extensions for GetProgramBinary and ProgramBinary then the issue may be with the driver not supporting matching types or not reporting all the extensions correctly.

Regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![hello\_world\_666](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@hello\_world\_666](https://forums.imgtec.com/u/hello_world_666)\
**Post date:** [December 29, 2023, 6:21am UTC](https://forums.imgtec.com/t/glprogrambinary-fails/3529/4 "2023-12-29T06:21:16Z")

</div>

Hi，ThomasW，I also encountered the same problem.

Does the compute shader support this feature on PowerVR GPU?  
The same code runs fine on both Adreno GPU and Mali GPU.

My test phone supported extensions includes: GL\_IMG\_program\_binary, and GL\_OES\_get\_program\_binary.

Looking forward to your reply, thank you!
