ShaderGenerator: remove unnecessary member, define all stub methods

This commit is contained in:
rdb 2020-12-19 11:14:16 +01:00
parent f65fd44c08
commit 10bb4a33d3
2 changed files with 29 additions and 8 deletions

View File

@ -2032,4 +2032,28 @@ operator == (const ShaderKey &other) const {
&& _light_ramp == other._light_ramp; && _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 #endif // HAVE_CG

View File

@ -89,7 +89,6 @@ protected:
// RenderState analysis information. Created by analyze_renderstate: // RenderState analysis information. Created by analyze_renderstate:
CPT(RenderState) _state;
struct ShaderKey { struct ShaderKey {
ShaderKey(); ShaderKey();
bool operator < (const ShaderKey &other) const; bool operator < (const ShaderKey &other) const;
@ -197,16 +196,14 @@ private:
// If we don't have Cg, let's replace this with a stub. // If we don't have Cg, let's replace this with a stub.
class EXPCL_PANDA_PGRAPHNODES ShaderGenerator : public TypedReferenceCount { class EXPCL_PANDA_PGRAPHNODES ShaderGenerator : public TypedReferenceCount {
PUBLISHED: PUBLISHED:
ShaderGenerator(const GraphicsStateGuardianBase *gsg) {} ShaderGenerator(const GraphicsStateGuardianBase *gsg);
virtual ~ShaderGenerator() {} virtual ~ShaderGenerator();
virtual CPT(ShaderAttrib) synthesize_shader(const RenderState *rs, virtual CPT(ShaderAttrib) synthesize_shader(const RenderState *rs,
const GeomVertexAnimationSpec &anim) { const GeomVertexAnimationSpec &anim);
return nullptr;
}
void rehash_generated_shaders() {} void rehash_generated_shaders();
void clear_generated_shaders() {} void clear_generated_shaders();
public: public:
static TypeHandle get_class_type() { static TypeHandle get_class_type() {