| 423 | } |
| 424 | |
| 425 | void CommandListWrapper::writeBuffer(IBuffer* b, const void* data, size_t dataSize, uint64_t destOffsetBytes) |
| 426 | { |
| 427 | if (!requireOpenState()) |
| 428 | return; |
| 429 | |
| 430 | if (dataSize + destOffsetBytes > b->getDesc().byteSize) |
| 431 | { |
| 432 | error("writeBuffer: dataSize + destOffsetBytes is greater than the buffer size"); |
| 433 | return; |
| 434 | } |
| 435 | |
| 436 | if (destOffsetBytes > 0 && b->getDesc().isVolatile) |
| 437 | { |
| 438 | error("writeBuffer: cannot write into volatile buffers with an offset"); |
| 439 | return; |
| 440 | } |
| 441 | |
| 442 | if (dataSize > 0x10000 && b->getDesc().isVolatile) |
| 443 | { |
| 444 | error("writeBuffer: cannot write more than 65535 bytes into volatile buffers"); |
| 445 | return; |
| 446 | } |
| 447 | |
| 448 | m_CommandList->writeBuffer(b, data, dataSize, destOffsetBytes); |
| 449 | } |
| 450 | |
| 451 | void CommandListWrapper::clearBufferUInt(IBuffer* b, uint32_t clearValue) |
| 452 | { |