diff --git a/librashader-runtime-gl/src/util.rs b/librashader-runtime-gl/src/util.rs index 204a613..4fcaad3 100644 --- a/librashader-runtime-gl/src/util.rs +++ b/librashader-runtime-gl/src/util.rs @@ -1,4 +1,4 @@ -use gl::types::{GLenum, GLuint}; +use gl::types::{GLenum, GLint, GLuint}; use crate::error; use crate::error::FilterChainError; @@ -6,12 +6,13 @@ use librashader_reflect::back::glsl::GlslVersion; pub unsafe fn gl_compile_shader(stage: GLenum, source: &str) -> error::Result { let (shader, compile_status) = unsafe { + let lens = [source.len() as GLint]; let shader = gl::CreateShader(stage); gl::ShaderSource( shader, 1, - &source.as_bytes().as_ptr().cast(), - std::ptr::null(), + &source.as_ptr().cast(), + lens.as_ptr(), ); gl::CompileShader(shader); let mut compile_status = 0; diff --git a/librashader-runtime-gl/tests/triangle.rs b/librashader-runtime-gl/tests/triangle.rs index 9328d63..78c0707 100644 --- a/librashader-runtime-gl/tests/triangle.rs +++ b/librashader-runtime-gl/tests/triangle.rs @@ -30,8 +30,8 @@ fn triangle_gl46() { let mut filter = FilterChainGL::load_from_path( // "../test/slang-shaders/vhs/VHSPro.slangp", // "../test/slang-shaders/test/history.slangp", - "../test/shaders_slang/crt/crt-royale.slangp", - // "../test/shadersslang/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp", + // "../test/shaders_slang/crt/crt-royale.slangp", + "../test/shaders_slang/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp", Some(&FilterChainOptionsGL { glsl_version: 0, use_dsa: true, diff --git a/test/shaders_slang b/test/shaders_slang index e04aa57..24f9468 160000 --- a/test/shaders_slang +++ b/test/shaders_slang @@ -1 +1 @@ -Subproject commit e04aa575febae5927db6b445a3c47b8f4221df78 +Subproject commit 24f9468e2ef254fa91464939bc73aa63ce4aedf4