From 77b957bf5e3e6c9b41e6cb720ecbe77db351508c Mon Sep 17 00:00:00 2001 From: chyyran Date: Sat, 10 Aug 2024 13:53:23 -0400 Subject: [PATCH] reflect: stop adding null bytes to uniform names --- librashader-reflect/src/reflect/cross/glsl.rs | 1 - librashader-runtime-gl/src/filter_chain/filter_impl.rs | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/librashader-reflect/src/reflect/cross/glsl.rs b/librashader-reflect/src/reflect/cross/glsl.rs index 4234a46..ce214fc 100644 --- a/librashader-reflect/src/reflect/cross/glsl.rs +++ b/librashader-reflect/src/reflect/cross/glsl.rs @@ -146,7 +146,6 @@ impl CompileShader for CrossReflect { self.fragment .set_decoration(res.id, Decoration::Binding, DecorationValue::unset())?; let mut name = res.name.to_string(); - name.push('\0'); texture_fixups.push((name, binding)); } diff --git a/librashader-runtime-gl/src/filter_chain/filter_impl.rs b/librashader-runtime-gl/src/filter_chain/filter_impl.rs index ff600a6..f17154b 100644 --- a/librashader-runtime-gl/src/filter_chain/filter_impl.rs +++ b/librashader-runtime-gl/src/filter_chain/filter_impl.rs @@ -63,8 +63,8 @@ impl FilterChainImpl { let offset = meta.offset(); if offset.ubo.is_some() { - let vert_name = format!("LIBRA_UBO_VERTEX_INSTANCE.{}\0", meta.id()); - let frag_name = format!("LIBRA_UBO_FRAGMENT_INSTANCE.{}\0", meta.id()); + let vert_name = format!("LIBRA_UBO_VERTEX_INSTANCE.{}", meta.id()); + let frag_name = format!("LIBRA_UBO_FRAGMENT_INSTANCE.{}", meta.id()); unsafe { let vertex = gl::GetUniformLocation(pipeline, vert_name.as_ptr().cast()); let fragment = gl::GetUniformLocation(pipeline, frag_name.as_ptr().cast()); @@ -74,8 +74,8 @@ impl FilterChainImpl { } if offset.push.is_some() { - let vert_name = format!("LIBRA_PUSH_VERTEX_INSTANCE.{}\0", meta.id()); - let frag_name = format!("LIBRA_PUSH_FRAGMENT_INSTANCE.{}\0", meta.id()); + let vert_name = format!("LIBRA_PUSH_VERTEX_INSTANCE.{}", meta.id()); + let frag_name = format!("LIBRA_PUSH_FRAGMENT_INSTANCE.{}", meta.id()); unsafe { let vertex = gl::GetUniformLocation(pipeline, vert_name.as_ptr().cast()); let fragment = gl::GetUniformLocation(pipeline, frag_name.as_ptr().cast());