From b5c857c73f40b66fafe4c2c655d84cf12769b5c0 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 19 Dec 2020 23:50:07 +0100 Subject: [PATCH] pgraphnodes: Backport ShaderGenerator stub to 1.10.x Needed if interrogate is being run with the __aarch64__ definition in a multi-arch build --- panda/src/pgraphnodes/shaderGenerator.cxx | 24 +++++++++++++++++++++++ panda/src/pgraphnodes/shaderGenerator.h | 16 ++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 6c9b9b8a03..bfb466409e 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -2028,4 +2028,28 @@ operator == (const ShaderKey &other) const { && _light_ramp == other._light_ramp; } +#else + +// Stubs for when building without Cg support. +ShaderGenerator:: +ShaderGenerator(const GraphicsStateGuardianBase *gsg) { +} + +ShaderGenerator:: +~ShaderGenerator() { +} + +void ShaderGenerator:: +rehash_generated_shaders() { +} + +void ShaderGenerator:: +clear_generated_shaders() { +} + +CPT(ShaderAttrib) ShaderGenerator:: +synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { + return nullptr; +} + #endif // HAVE_CG diff --git a/panda/src/pgraphnodes/shaderGenerator.h b/panda/src/pgraphnodes/shaderGenerator.h index a3d37c4ad9..7ef11d148d 100644 --- a/panda/src/pgraphnodes/shaderGenerator.h +++ b/panda/src/pgraphnodes/shaderGenerator.h @@ -18,14 +18,14 @@ #include "pandabase.h" #include "typedReferenceCount.h" +#include "graphicsStateGuardianBase.h" +#include "shaderAttrib.h" +#include "renderState.h" #ifdef HAVE_CG -#include "graphicsStateGuardianBase.h" #include "graphicsOutputBase.h" #include "nodePath.h" -#include "shaderAttrib.h" -#include "renderState.h" #include "renderAttrib.h" #include "colorAttrib.h" @@ -196,6 +196,16 @@ private: // If we don't have Cg, let's replace this with a stub. class EXPCL_PANDA_PGRAPHNODES ShaderGenerator : public TypedReferenceCount { +PUBLISHED: + ShaderGenerator(const GraphicsStateGuardianBase *gsg); + virtual ~ShaderGenerator(); + + virtual CPT(ShaderAttrib) synthesize_shader(const RenderState *rs, + const GeomVertexAnimationSpec &anim); + + void rehash_generated_shaders(); + void clear_generated_shaders(); + public: static TypeHandle get_class_type() { return _type_handle;