Open RohacekD opened 3 years ago
So far I worked on the 2nd task. I have a separate program, which takes definition from OpenGL version, creates intermediate (preprocessed) files and also generates a bat file to run glsc.exe on them.
C:/VulkanSDK/Bin/glslc.exe -fshader-stage=vertex basic/Vertex.glsl -o Vertex.spv
C:/VulkanSDK/Bin/glslc.exe -fshader-stage=fragment basic/Fragment.glsl -o Fragment.spv
pause
And it seems like a lot have changed between opengl and vulkan 😢 basic/Vertex.glsl:2: error: '#extension' : extension not supported: GL_ARB_bindless_texture basic/Vertex.glsl:4: warning: attribute deprecated in version 130; may be removed in future release basic/Vertex.glsl:4: error: 'attribute' : no longer supported in core profile; removed in version 420 basic/Vertex.glsl:4: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:5: warning: attribute deprecated in version 130; may be removed in future release basic/Vertex.glsl:5: error: 'attribute' : no longer supported in core profile; removed in version 420 basic/Vertex.glsl:5: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:6: warning: attribute deprecated in version 130; may be removed in future release basic/Vertex.glsl:6: error: 'attribute' : no longer supported in core profile; removed in version 420 basic/Vertex.glsl:6: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:7: warning: attribute deprecated in version 130; may be removed in future release basic/Vertex.glsl:7: error: 'attribute' : no longer supported in core profile; removed in version 420 basic/Vertex.glsl:7: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:8: warning: attribute deprecated in version 130; may be removed in future release basic/Vertex.glsl:8: error: 'attribute' : no longer supported in core profile; removed in version 420 basic/Vertex.glsl:8: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:12: error: 'binding' : uniform/buffer blocks require layout(binding=X) basic/Vertex.glsl:24: error: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan basic/Vertex.glsl:27: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:28: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:29: error: 'location' : SPIR-V requires location for user input/output basic/Vertex.glsl:30: error: 'location' : SPIR-V requires location for user input/output 5 warnings and 17 errors generated.
F:\workspaces\Vulkan\data\obj\shaders\compile>C:/VulkanSDK/Bin/glslc.exe -fshader-stage=fragment basic/Fragment.glsl -o Fragment.spv basic/Fragment.glsl:2: error: '#extension' : extension not supported: GL_ARB_bindless_texture basic/Fragment.glsl:5: error: 'binding' : uniform/buffer blocks require layout(binding=X) basic/Fragment.glsl:17: error: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan basic/Fragment.glsl:18: error: 'binding' : sampler/texture/image requires layout(binding=X) basic/Fragment.glsl:20: error: 'location' : SPIR-V requires location for user input/output basic/Fragment.glsl:21: error: 'location' : SPIR-V requires location for user input/output basic/Fragment.glsl:22: error: 'location' : SPIR-V requires location for user input/output basic/Fragment.glsl:24: error: 'location' : SPIR-V requires location for user input/output basic/Fragment.glsl:53: error: 'ltc' : member of block cannot be or contain a sampler, image, or atomic_uint type basic/Fragment.glsl:54: error: 'ltcMag' : member of block cannot be or contain a sampler, image, or atomic_uint type basic/Fragment.glsl:53: error: 'binding' : sampler/texture/image requires layout(binding=X) basic/Fragment.glsl:54: error: 'binding' : sampler/texture/image requires layout(binding=X) basic/Fragment.glsl:49: error: 'binding' : uniform/buffer blocks require layout(binding=X)
error: 'location' : SPIR-V requires location for user input/output should be fixed by now error: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan is part of 1) basic/Vertex.glsl:2: error: '#extension' : extension not supported: GL_ARB_bindless_texture should be solved through #ifdef statement in preprocessor
basic/Vertex.glsl:2: error: '#extension' : extension not supported: GL_ARB_bindless_texture fixed for now
I would like to be able to use the same shader definitions as in OpenGL. This consists of multiple tasks.
BONUS - Some filesystem watcher would be nice. E.g. OpenGL implementation.