MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / setPrefabRootLayout

Method setPrefabRootLayout

OgreMain/src/OgreGpuProgram.cpp:116–154  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

114 void GpuProgram::setAutoReflectArrayBindingsInRootLayout( bool /*bReflectArrayRootLayouts*/ ) {}
115 //-----------------------------------------------------------------------------
116 void GpuProgram::setPrefabRootLayout( const PrefabRootLayout::PrefabRootLayout &prefab )
117 {
118 if( prefab == PrefabRootLayout::None )
119 {
120 unsetRootLayout();
121 return;
122 }
123
124 RootLayout rootLayout;
125
126 DescBindingRange *descBindingRange = rootLayout.mDescBindingRanges[0];
127
128 uint16 maxTextures = 4u;
129 if( prefab == PrefabRootLayout::High )
130 maxTextures = 8u;
131 if( prefab == PrefabRootLayout::Max )
132 maxTextures = 32u;
133
134 descBindingRange[DescBindingTypes::Texture].start = 0u;
135 descBindingRange[DescBindingTypes::Texture].end = maxTextures;
136 descBindingRange[DescBindingTypes::Sampler].start = 0u;
137 descBindingRange[DescBindingTypes::Sampler].end = maxTextures;
138
139 if( prefab == PrefabRootLayout::Standard || prefab == PrefabRootLayout::High )
140 {
141 rootLayout.mParamsBuffStages = ( 1u << VertexShader ) | ( 1u << PixelShader );
142 descBindingRange[DescBindingTypes::ParamBuffer].start = 0u;
143 descBindingRange[DescBindingTypes::ParamBuffer].end = 2u;
144 }
145 else if( prefab == PrefabRootLayout::Max )
146 {
147 for( size_t i = 0u; i < NumShaderTypes; ++i )
148 rootLayout.mParamsBuffStages |= 1u << i;
149 descBindingRange[DescBindingTypes::ParamBuffer].start = 0u;
150 descBindingRange[DescBindingTypes::ParamBuffer].end = NumShaderTypes;
151 }
152
153 setRootLayout( mType, rootLayout );
154 }
155 //-----------------------------------------------------------------------------
156 void GpuProgram::setReplaceVersionMacro( bool bReplace ) {}
157 //-----------------------------------------------------------------------------

Callers 2

doSetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected