MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ReadVertexLayout

Method ReadVertexLayout

Source/Engine/Graphics/Shaders/GPUShader.cpp:203–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void GPUShader::ReadVertexLayout(MemoryReadStream& stream, GPUVertexLayout*& inputLayout, GPUVertexLayout*& vertexLayout)
204{
205 inputLayout = vertexLayout = nullptr;
206
207 // Read input layout (based on shader reflection)
208 GPUVertexLayout::Elements elements;
209 stream.Read(elements);
210 inputLayout = GPUVertexLayout::Get(elements);
211
212 // [Deprecated in v1.10]
213 byte inputLayoutSize;
214 stream.ReadByte(&inputLayoutSize);
215 if (inputLayoutSize == 0)
216 return;
217 void* elementsData = stream.Move(sizeof(VertexElement) * inputLayoutSize);
218 if (inputLayoutSize > GPU_MAX_VS_ELEMENTS)
219 {
220 LOG(Error, "Incorrect input layout size.");
221 return;
222 }
223 elements.Set((VertexElement*)elementsData, inputLayoutSize);
224 vertexLayout = GPUVertexLayout::Get(elements);
225}
226
227GPUResourceType GPUShader::GetResourceType() const
228{

Callers

nothing calls this directly

Calls 5

GetFunction · 0.50
ReadMethod · 0.45
ReadByteMethod · 0.45
MoveMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected