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

Method UpdateCB

Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp:1132–1158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1130}
1131
1132void GPUContextVulkan::UpdateCB(GPUConstantBuffer* cb, const void* data)
1133{
1134 ASSERT(data && cb);
1135 auto cbVulkan = static_cast<GPUConstantBufferVulkan*>(cb);
1136 const uint32 size = cbVulkan->GetSize();
1137 if (size == 0)
1138 return;
1139
1140 // Allocate bytes for the buffer
1141 const auto allocation = _device->UniformBufferUploader->Allocate(size, 0, this);
1142
1143 // Copy data
1144 Platform::MemoryCopy(allocation.CPUAddress, data, allocation.Size);
1145
1146 // Cache the allocation to update the descriptor
1147 cbVulkan->Allocation = allocation;
1148
1149 // Mark CB slot as dirty if this CB is binded to the pipeline
1150 for (int32 i = 0; i < ARRAY_COUNT(_cbHandles); i++)
1151 {
1152 if (_cbHandles[i] == cbVulkan)
1153 {
1154 _cbDirtyFlag = true;
1155 break;
1156 }
1157 }
1158}
1159
1160void GPUContextVulkan::Dispatch(GPUShaderProgramCS* shader, uint32 threadGroupCountX, uint32 threadGroupCountY, uint32 threadGroupCountZ)
1161{

Callers 15

ExecuteDrawCallsMethod · 0.45
RenderLUTMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMotionVectorsMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderLightsMethod · 0.45
InitMethod · 0.45

Calls 2

GetSizeMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected