diff --git a/src/backend/gl/src/device.rs b/src/backend/gl/src/device.rs index cf87a135fa7..35f49b3cf25 100644 --- a/src/backend/gl/src/device.rs +++ b/src/backend/gl/src/device.rs @@ -360,11 +360,13 @@ impl Device { _ => panic!("Unhandled") }; - for (name, (btype, set, binding)) in desc_remap_data.get_names_and_data() { - let gl = &self.share.context; - unsafe { - let index = gl.GetUniformBlockIndex(program, name.as_ptr() as _); - gl.UniformBlockBinding(program, index, *desc_remap_data.get_binding(*btype, *set, *binding).unwrap()) + if self.share.legacy_features.contains(LegacyFeatures::NO_EXPLICIT_LAYOUTS_IN_SHADER) { + for (name, (btype, set, binding)) in desc_remap_data.get_names_and_data() { + let gl = &self.share.context; + unsafe { + let index = gl.GetUniformBlockIndex(program, name.as_ptr() as _); + gl.UniformBlockBinding(program, index, *desc_remap_data.get_binding(*btype, *set, *binding).unwrap()) + } } }