Skip to content

Commit

Permalink
OgreNext: Fix shaders compilation on d3d12 mesa driver (WSLg) (#851)
Browse files Browse the repository at this point in the history
Old GPUs and systems with incomplete GL implementations like WSLg would trigger shader compiler errors for several reasons:

* because C++ saw that GL_ARB_shader_storage_buffer_object was supported but we didn't request it in the shader.
* because C++ required the use of GLSL 4.30 (not supported by d3d12 as of 2023/05), even if GLSL 4.20 plus some extensions would also work fine.

This was tested on both mesa 22.2.5 and 23.1.0 .

---------

Signed-off-by: Silvio Traversaro <[email protected]>
Signed-off-by: Silvio Traversaro <[email protected]>
  • Loading branch information
traversaro authored May 22, 2023
1 parent ef4abec commit 388a766
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
@property( syntax != glslvk )
#version 430
@property( GL3+ >= 430 )
#version 430
@else
#version 420
#extension GL_ARB_arrays_of_arrays: enable
#extension GL_ARB_compute_shader: enable
@end
@else
#version 450
@end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@property( syntax != glslvk )
#version 430
@property( GL3+ >= 430 )
#version 430
@else
#version 420
#extension GL_ARB_compute_shader: enable
@end
#define ogre_B0 binding = 0
#define ogre_B1 binding = 1
@else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#version 430 core
@else
#version 330 core

@property( !hlms_readonly_is_tex )
#extension GL_ARB_shader_storage_buffer_object: require
@end
@end
@end

Expand Down

0 comments on commit 388a766

Please sign in to comment.