From: Mikko Rasa Date: Thu, 4 Mar 2021 21:32:28 +0000 (+0200) Subject: Make builtins const X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=69680f4d284cdf7b16a2966250a88ab1257862f3;p=libs%2Fgl.git Make builtins const --- 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