1

I am using Ubuntu 16.4 with NVIDIA driver 384.111 and I have a similar problem to this one.

I compiled a minimal GLSL vertex shader (one input and an empty main function) to SPIR-V the same way as described in the linked discussion. When I load and specialize it, the specialization is not successful and the info log contains only random data.

I decided to post this question because the discussion refereced in the linked comment does not exists anymore and is over a year old. I could not find any other references to this problem here or at the NVIDIA dev forums.

Is there any mistake which could legitimately produce a broken info log or is this a driver error? It somehow seems unlikely that this issue has been present for over a year and nobody discussed it.

My GLSL shader looks like this:

#version 330  
layout(location = 0) in  vec3 vPosition; 

void main() {
}

I used the following command to compile the code to SPIR-V:

./glslangValidator -G quad.vert -o quad.vert.spv

The following code loads the shader:

glShaderBinary(1, &shader, GL_SHADER_BINARY_FORMAT_SPIR_V_ARB, shader_source.data(), (GLsizei)shader_source.size());
glSpecializeShader(shader, "main", 0, nullptr, nullptr);
Wobak
  • 11
  • 4
  • This question belongs to https://askubuntu.com/ – Sebastian D'Agostino Jun 16 '18 at 19:47
  • 3
    @sebadagostino: No it doesn't. This is a OpenGL API programming question. Neither GLSL, nor SPIR-V nor shaders are something specific to Ubuntu, or any OS for that matter. – datenwolf Jun 16 '18 at 19:54
  • 3
    @Wobak: Can you provide a MVCE that goes beyond the Q&A you linked? I.e. the GLSL and host program sources, which SPIR-V compiler you used and how you invoked it and *what you did differently __if you did so__.* Otherwise I'm going to close this question as a duplicate. – datenwolf Jun 16 '18 at 19:57
  • @datenwolf The linked question seems to have a problem because of the hardware it is running. Here the main difference I see is that it uses Ubuntu. I understand that this is either related to the operative system or is a duplicate of the linked question. – Sebastian D'Agostino Jun 16 '18 at 19:59
  • @sebadagostino: I do not think this problem is related to ubuntu. Either it is my mistake, or a bug in the driver – Wobak Jun 16 '18 at 20:33
  • @datenwolf: I hope the extenson of the question is enough to prevent a duplication. If the question in the comment I linked would still be available, this would probably be a duplication. However, I do not think this is a duplicate of [this question](https://stackoverflow.com/questions/43515969/loading-spirv-binary-shader-fails) because I do not have an AMD GPU, nor does the application crash. – Wobak Jun 16 '18 at 20:37
  • 1
    @sebadagostino: The NVidia proprietary driver is a binary blob. The only thing an individual Linux distribution changes about it is the thin kernel shim that's used to load the rest of the blob. Other than that, NVidia drivers are pretty much uniform across systems. Especially the userland parts, which the OpenGL implementation, GLSL compiler and SPIR-V loader are part of. – datenwolf Jun 16 '18 at 21:06

0 Answers0