From: Mikko Rasa Date: Mon, 19 Apr 2021 07:54:17 +0000 (+0300) Subject: Disallow loading uniforms without a custom shader X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=22fb2172d1cb59b339f29666946dee6818bb8558 Disallow loading uniforms without a custom shader --- diff --git a/source/materials/renderpass.cpp b/source/materials/renderpass.cpp index 033c43b1..e6a9a0a4 100644 --- a/source/materials/renderpass.cpp +++ b/source/materials/renderpass.cpp @@ -263,6 +263,8 @@ void RenderPass::Loader::texunit_named(unsigned, const string &n) void RenderPass::Loader::uniforms() { + if(!obj.shprog || obj.shprog_from_material) + throw runtime_error("Shader is required for uniforms"); obj.ensure_private_shader_data(); load_sub(*obj.shdata); }