| 55 | } |
| 56 | |
| 57 | static ID3D11Buffer *createConstantBuffer(unsigned sizeBytes) |
| 58 | { |
| 59 | ZoneScopedN(__FUNCTION__); |
| 60 | |
| 61 | // Fill in a buffer description. |
| 62 | D3D11_BUFFER_DESC cbDesc = {}; |
| 63 | cbDesc.ByteWidth = sizeBytes; |
| 64 | cbDesc.Usage = D3D11_USAGE_DYNAMIC; |
| 65 | cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; |
| 66 | cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; |
| 67 | |
| 68 | // Create the buffer. |
| 69 | ID3D11Buffer *res = nullptr; |
| 70 | DX_CHECK(g_device->CreateBuffer(&cbDesc, nullptr, &res)); |
| 71 | |
| 72 | return res; |
| 73 | } |
| 74 | |
| 75 | static void updateConstantBuffer(ID3D11DeviceContext *context, ID3D11Buffer *constantBuffer, void *data, |
| 76 | unsigned sizeBytes) |
no outgoing calls
no test coverage detected