Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build includes without enabling "GL_GOOGLE_include_directive" extension? #259

Closed
ghost opened this issue Oct 10, 2016 · 7 comments
Closed

Comments

@ghost
Copy link

ghost commented Oct 10, 2016

Hello. I have problems with Nvidia. How to disable output of "GL_GOOGLE_include_directive" codes in productive shaders?

@ghost ghost changed the title How to build includes without enabling "GL_GOOGLE_cpp_style_line_directive" extension? How to build includes without enabling "GL_GOOGLE_include_directive" extension? Oct 10, 2016
@antiagainst
Copy link
Contributor

Hi @acterhd,

Do you mean removing the OpSourceExtension GL_GOOGLE_include_directive line in the generated SPIR-V binary module? That actually can be done via the -Os option on glslc (or SetOptimizationLevel for the library API). Yeah, that also runs some other optimization stuff, but I think it's beneficial for productive code. More fine-grained controlling is something not supported yet and should be a TODO.

Hope this solves your problem. Let me know if I am not answering your question. Thanks!

@ghost
Copy link
Author

ghost commented Oct 10, 2016

In glslc none this flag... Even if I built from source. Used old version...

Also, issues with

./shaders/voxelizer/voxelizer.vert.spv


./shaders/voxelizer/voxelizer.geom.spv


./shaders/voxelizer/voxelizer.frag.spv

Geometry info
-------------
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)
error: binding mismatch between shaders for SSBO (named __defaultname)

Fragment info
-------------
(0) : fatal error C9999: *** exception during compilation ***

Link info
---------
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders
error: different buffer variables (named  and ) sharing the same offset within a storage block (named ) between shaders

@antiagainst
Copy link
Contributor

Hmm, now I'm suspecting that the driver compiler is using debug instruction for some meaningful stuff (use OpName for interface matching, etc. which is why the above errors since -Os removes all debug instructions), which is not supposed to be the case: https://www.khronos.org/registry/spir-v/specs/1.0/SPIRV.html#OpSourceExtension. (Notice the "no semantic impact and can safely be removed from a module" part, which means, with or without OpSourceExtension/OpName, the module should just work fine.)

Could you provide the original error from the driver compiler before applying -Os? Thanks!

@ghost
Copy link
Author

ghost commented Oct 10, 2016

Okay.... I can't load any compute shader from SPIR-V in OpenGL...
I tried all variants.

@antiagainst
Copy link
Contributor

Oh, glad to see you've figured out this by yourself. Sorry didn't provide much help. I'll close this for now.

@ghost
Copy link
Author

ghost commented Oct 11, 2016

I anyway can't load SPIR-V modules...

@dneto0
Copy link
Collaborator

dneto0 commented Oct 12, 2016

Loading SPIR-V into OpenGL is a recently-ratified extension.
https://www.opengl.org/registry/specs/ARB/gl_spirv.txt
I'd first check to make sure that your driver supports that extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants