0

I'm getting the error

fatal error C9999: *** exception during compilation ***

Whenever I try to recompile a GLSL shader that uses Image api for texture writes, for example

layout(binding = 0) coherent uniform image3D Voxels;

Initial compilation works fine however. Has anyone else encountered this, and is there workaround?

ragnar
  • 480
  • 3
  • 18
  • What do you mean by "initial compilation?" What are you recompiling? – Nicol Bolas Jun 20 '12 at 23:37
  • When I start the program, I load and compile all my shaders. I also have a routine that recompiles all my shaders, allowing me to edit them without relaunching my program. However, the second I add any code that uses functionality from the `ARB_shader_image_load_store` extension, I lose the ability to recompile that shader. – ragnar Jun 21 '12 at 00:21
  • Well, we can't really do anything if we can't see your code. *However*, if you're re-compiling your shaders and programs in-place (using the same program objects), then odds are good that you're hitting a driver bug. That's a fairly untested codepath; developers usually compile/link shaders/programs *once* and leave them that way. So try using different shader/program objects if you're recompiling. – Nicol Bolas Jun 21 '12 at 01:33

1 Answers1

2

Okay, I've come up with a workaround. Essentially, I had to make my recompilation process a bit more destructive.

First, it is (now) necessary to detach all shaders (vert,frag,geom,etc...) from your shader program.

Second, when recompiling the individual shaders it is (now) necessary to delete and recreate a new shader id

glDeleteShader(shader_id);
shader_id = glCreateShader(GL_FRAGMENT_SHADER);

Then you can reload the shader source, after which you can safely re-attach, or rather attach the new shaders to your shader program, re-link everything, and hopefully it all works.

ragnar
  • 480
  • 3
  • 18