| 1130 | } |
| 1131 | |
| 1132 | void 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 | |
| 1160 | void GPUContextVulkan::Dispatch(GPUShaderProgramCS* shader, uint32 threadGroupCountX, uint32 threadGroupCountY, uint32 threadGroupCountZ) |
| 1161 | { |
no test coverage detected