Skip to content

Commit d79d56f

Browse files
committed
shaderpipeline: Move ShaderModule class to gobj
It can't be in shaderpipeline, because Shader is in gobj, and requires ShaderModule.
1 parent 9b01e4b commit d79d56f

File tree

9 files changed

+13
-8
lines changed

9 files changed

+13
-8
lines changed

panda/src/gobj/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ set(P3GOBJ_HEADERS
4949
shader.I shader.h
5050
shaderBuffer.h shaderBuffer.I
5151
shaderContext.h shaderContext.I
52+
shaderModule.h shaderModule.I
53+
shaderType.h shaderType.I
5254
simpleAllocator.h simpleAllocator.I
5355
simpleLru.h simpleLru.I
5456
sliderTable.I sliderTable.h
@@ -129,6 +131,8 @@ set(P3GOBJ_SOURCES
129131
shader.cxx
130132
shaderBuffer.cxx
131133
shaderContext.cxx
134+
shaderModule.cxx
135+
shaderType.cxx
132136
simpleAllocator.cxx
133137
simpleLru.cxx
134138
sliderTable.cxx

panda/src/gobj/config_gobj.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "samplerState.h"
5454
#include "shader.h"
5555
#include "shaderContext.h"
56+
#include "shaderModule.h"
5657
#include "shaderType.h"
5758
#include "transformBlend.h"
5859
#include "transformBlendTable.h"
@@ -586,8 +587,9 @@ ConfigureFn(config_gobj) {
586587
QueryContext::init_type();
587588
SamplerContext::init_type();
588589
SamplerState::init_type();
589-
ShaderContext::init_type();
590590
Shader::init_type();
591+
ShaderContext::init_type();
592+
ShaderModule::init_type();
591593
ShaderType::init_type();
592594
SliderTable::init_type();
593595
Texture::init_type();

panda/src/gobj/p3gobj_composite2.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
#include "samplerContext.cxx"
66
#include "samplerState.cxx"
77
#include "savedContext.cxx"
8+
#include "shader.cxx"
89
#include "shaderBuffer.cxx"
910
#include "shaderContext.cxx"
10-
#include "shader.cxx"
11+
#include "shaderModule.cxx"
1112
#include "shaderType.cxx"
1213
#include "simpleAllocator.cxx"
1314
#include "simpleLru.cxx"
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "copyOnWriteObject.h"
1818
#include "bamCacheRecord.h"
1919
#include "shaderType.h"
20+
#include "internalName.h"
2021

2122
/**
2223
* Represents a single shader module in some intermediate representation for
@@ -27,7 +28,7 @@
2728
* shared between multiple Shader objects, with a unique copy automatically
2829
* being created if the Shader needs to manipulate the module.
2930
*/
30-
class EXPCL_PANDA_SHADERPIPELINE ShaderModule : public CopyOnWriteObject {
31+
class EXPCL_PANDA_GOBJ ShaderModule : public CopyOnWriteObject {
3132
PUBLISHED:
3233
enum class Stage {
3334
vertex,
@@ -48,7 +49,7 @@ class EXPCL_PANDA_SHADERPIPELINE ShaderModule : public CopyOnWriteObject {
4849

4950
PUBLISHED:
5051
const ShaderType *type;
51-
CPT_InternalName name;
52+
CPT(InternalName) name;
5253

5354
MAKE_PROPERTY2(location, has_location, get_location);
5455

panda/src/shaderpipeline/config_shaderpipeline.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "shaderCompilerGlslPreProc.h"
1919
#include "shaderCompilerCg.h"
2020

21-
#include "shaderModule.h"
2221
#include "shaderModuleGlsl.h"
2322
#include "shaderModuleSpirV.h"
2423

@@ -47,7 +46,6 @@ init_libshaderpipeline() {
4746
initialized = true;
4847

4948
ShaderCompilerGlslang::init_type();
50-
ShaderModule::init_type();
5149
ShaderModuleSpirV::init_type();
5250
ShaderModuleGlsl::init_type();
5351

panda/src/shaderpipeline/p3shaderpipeline_composite1.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "config_shaderpipeline.cxx"
2-
#include "shaderModule.cxx"
32
#include "shaderModuleGlsl.cxx"
43
#include "shaderModuleSpirV.cxx"
54
#include "shaderCompiler.cxx"

panda/src/shaderpipeline/shaderModuleSpirV.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ShaderModuleSpirV(Stage stage, std::vector<uint32_t> words) :
6262
if (def._dtype == DT_variable && def._builtin == SpvBuiltInMax) {
6363
Variable var;
6464
var.type = def._type;
65-
var.name = def._name;
65+
var.name = InternalName::make(def._name);
6666
var._location = def._location;
6767
//var._id = id;
6868

0 commit comments

Comments
 (0)