<p>I've recently rebuild shaders for my program and it stopped "working" ( black screen ) on OS X ( El Capitan ), but <strong>it's ok on Linux on GTX 660</strong>.</p>

<p>I've tested it on another Apple hardware and <strong>it worked on OS X on R9 395</strong> ( but super slow, because of double ). So I suppose it's problem with my <strong>Intel HD Graphics 5000</strong>.</p>

<p>There are no shader compilation errors, and here is my shader code:</p>

<p><a href="https://github.com/Marqin/YuriaViewer/blob/4241e384da0f27d26cbf5557518db905a9d40039/vertex.glsl" rel="nofollow">https://github.com/Marqin/YuriaViewer/blob/4241e384da0f27d26cbf5557518db905a9d40039/vertex.glsl</a></p>

<p>Keep in mind that this software worked on El Capitan with OpenGL 4.1 before shader rewrite. Here are my glfw hints:</p>

<pre><code>glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
</code></pre>

<p>My program also is checking for <code>GL_ARB_gpu_shader_fp64</code> and it's available on my Macbook ( Macbook Air 2013 mid ).</p>

<p>I've "debugged" it a little and it looks that <code>i</code> is always lesser than <code>vis</code> on OS X, that's why it's black.</p>

<p>I've also made a simple test - I've typed all uniform values in shader by hand and now it wasn't black, but I've got some gibberish on screen. Then I've changed every <code>dvec3</code> and <code>dvec2</code> to float versions and it showed nice fractal. So it looks like <code>double</code> is not working on OS X. But how can it be? It's saying that <code>GL_ARB_gpu_shader_fp64</code> is available and it even doesn't complain when I request it in vertex shader.</p>

<p>How can I make it work on OS X Macbook?</p>

CC BY-SA 3.0
2016-01-11T12:01:05.807Z
It's unfortunately not uncommon for drivers to contain bugs (or "features" to let Game X play optimally even though it doesn't use the API correctly)
ratchet freak
CC BY-SA 3.0
2016-01-11T13:46:39.523Z
I hope it's not driver bug, but my bug with padding in that struct.
Marqin
CC BY-SA 3.0
2016-01-11T13:50:07.660Z
and if you use std430 layout?
ratchet freak
CC BY-SA 3.0
2016-01-11T13:59:30.073Z
@ratchetfreak OS X only support OpenGL [4.1](https://developer.apple.com/opengl/capabilities/) ( also, ARB_gpu_shader_fp64 is not supported on some 4.1 Mac Radeons, but it should be on my Intel ), and std430 was introduced in OpenGL 4.3
Marqin
CC BY-SA 3.0
2016-01-11T14:39:47.893Z
I've tested it now on one iMac, and it's working there ( but super slow ).
Marqin
CC BY-SA 3.0
2016-01-11T14:43:31.763Z
So it looks like this shader is not compatible with Intel cards or it's bug in OS X Intel driver.
Marqin
CC BY-SA 3.0
2016-03-28T09:03:15.333Z
@Marqin Could you convert your last comment into an aswer so we can get this post out of the unanswered queue?
joojaa
CC BY-SA 3.0
2016-03-28T09:36:20.210Z
@joojaa But frankly it's not valid answer. Some time ago I've reorganized my shader, changed types/order of  struct fields and now it "miraculously" work. And I still want to know why it was not working the old way - maybe I just made some error with padding? I cannot find that bug :/
Marqin
CC BY-SA 3.0
2016-03-28T09:41:19.163Z
@Marqin then answer that, the question does not contain your code so theres no way to verify your bug from this anyway.
joojaa
<opengl><shader>
How to make double working in OpenGL 4.1 on OS X ( Intel HD Graphics 5000 )?
Marqin
# How to make double working in OpenGL 4.1 on OS X ( Intel HD Graphics 5000 )?

(Asked by: username_0 on 2016-01-11)

I've recently rebuild shaders for my program and it stopped "working" ( black screen ) on OS X ( El Capitan ), but **it's ok on Linux on GTX 660**.

I've tested it on another Apple hardware and **it worked on OS X on R9 395** ( but super slow, because of double ). So I suppose it's problem with my **Intel HD Graphics 5000**.

There are no shader compilation errors, and here is my shader code:

<https://github.com/username_0/YuriaViewer/blob/4241e384da0f27d26cbf5557518db905a9d40039/vertex.glsl>

Keep in mind that this software worked on El Capitan with OpenGL 4.1 before shader rewrite. Here are my glfw hints:

```
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

```

My program also is checking for `GL_ARB_gpu_shader_fp64` and it's available on my Macbook ( Macbook Air 2013 mid ).

I've "debugged" it a little and it looks that `i` is always lesser than `vis` on OS X, that's why it's black.

I've also made a simple test - I've typed all uniform values in shader by hand and now it wasn't black, but I've got some gibberish on screen. Then I've changed every `dvec3` and `dvec2` to float versions and it showed nice fractal. So it looks like `double` is not working on OS X. But how can it be? It's saying that `GL_ARB_gpu_shader_fp64` is available and it even doesn't complain when I request it in vertex shader.

How can I make it work on OS X Macbook?

**Tags:** opengl, shader

> **Comments:**
> **username_1**: It's unfortunately not uncommon for drivers to contain bugs (or "features" to let Game X play optimally even though it doesn't use the API correctly)  
> **username_0**: I hope it's not driver bug, but my bug with padding in that struct.  
> **username_1**: and if you use std430 layout?  
> **username_0**: @username_1 OS X only support OpenGL [4.1](https://developer.apple.com/opengl/capabilities/) ( also, ARB_gpu_shader_fp64 is not supported on some 4.1 Mac Radeons, but it should be on my Intel ), and std430 was introduced in OpenGL 4.3  
> **username_0**: I've tested it now on one iMac, and it's working there ( but super slow ).  
> **username_0**: So it looks like this shader is not compatible with Intel cards or it's bug in OS X Intel driver.  
> **username_2**: @username_0 Could you convert your last comment into an aswer so we can get this post out of the unanswered queue?  
> **username_0**: @username_2 But frankly it's not valid answer. Some time ago I've reorganized my shader, changed types/order of  struct fields and now it "miraculously" work. And I still want to know why it was not working the old way - maybe I just made some error with padding? I cannot find that bug :/  
> **username_2**: @username_0 then answer that, the question does not contain your code so theres no way to verify your bug from this anyway.  

---

## 0 answers

