From 69680f4d284cdf7b16a2966250a88ab1257862f3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 4 Mar 2021 23:32:28 +0200 Subject: [PATCH] Make builtins const --- source/glsl/builtin.cpp | 2 +- source/glsl/builtin.h | 2 +- source/glsl/compiler.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/glsl/builtin.cpp b/source/glsl/builtin.cpp index 9aa6a6c2..3800e14b 100644 --- a/source/glsl/builtin.cpp +++ b/source/glsl/builtin.cpp @@ -29,7 +29,7 @@ Module *get_builtins_module() return builtins_module.get(); } -Stage *get_builtins(Stage::Type type) +const Stage *get_builtins(Stage::Type type) { Module *module = get_builtins_module(); if(!module) diff --git a/source/glsl/builtin.h b/source/glsl/builtin.h index 00cd3ff3..78131672 100644 --- a/source/glsl/builtin.h +++ b/source/glsl/builtin.h @@ -7,7 +7,7 @@ namespace Msp { namespace GL { namespace SL { -Stage *get_builtins(Stage::Type); +const Stage *get_builtins(Stage::Type); } // namespace SL } // namespace GL diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index c2a0656d..8caeba1f 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -234,9 +234,9 @@ void Compiler::generate(Stage &stage, Mode mode) stage.required_features.glsl_version = module->shared.required_features.glsl_version; inject_block(stage.content, module->shared.content); - if(Stage *builtins = get_builtins(stage.type)) + if(const Stage *builtins = get_builtins(stage.type)) inject_block(stage.content, builtins->content); - if(Stage *builtins = get_builtins(Stage::SHARED)) + if(const Stage *builtins = get_builtins(Stage::SHARED)) inject_block(stage.content, builtins->content); // Initial resolving pass -- 2.43.0