| 2542 | } |
| 2543 | |
| 2544 | void Context::flushTextureUpdateBatch(CommandBuffer& _cmdbuf) |
| 2545 | { |
| 2546 | BGFX_PROFILER_SCOPE("flushTextureUpdateBatch", 0xff2040ff); |
| 2547 | if (m_textureUpdateBatch.sort() ) |
| 2548 | { |
| 2549 | const uint32_t pos = _cmdbuf.m_pos; |
| 2550 | |
| 2551 | uint32_t currentKey = UINT32_MAX; |
| 2552 | |
| 2553 | for (uint32_t ii = 0, num = m_textureUpdateBatch.m_num; ii < num; ++ii) |
| 2554 | { |
| 2555 | _cmdbuf.m_pos = m_textureUpdateBatch.m_values[ii]; |
| 2556 | |
| 2557 | TextureHandle handle; |
| 2558 | _cmdbuf.read(handle); |
| 2559 | |
| 2560 | uint8_t side; |
| 2561 | _cmdbuf.read(side); |
| 2562 | |
| 2563 | uint8_t mip; |
| 2564 | _cmdbuf.read(mip); |
| 2565 | |
| 2566 | Rect rect; |
| 2567 | _cmdbuf.read(rect); |
| 2568 | |
| 2569 | uint16_t zz; |
| 2570 | _cmdbuf.read(zz); |
| 2571 | |
| 2572 | uint16_t depth; |
| 2573 | _cmdbuf.read(depth); |
| 2574 | |
| 2575 | uint16_t pitch; |
| 2576 | _cmdbuf.read(pitch); |
| 2577 | |
| 2578 | const Memory* mem; |
| 2579 | _cmdbuf.read(mem); |
| 2580 | |
| 2581 | uint32_t key = m_textureUpdateBatch.m_keys[ii]; |
| 2582 | if (key != currentKey) |
| 2583 | { |
| 2584 | if (currentKey != UINT32_MAX) |
| 2585 | { |
| 2586 | m_renderCtx->updateTextureEnd(); |
| 2587 | } |
| 2588 | currentKey = key; |
| 2589 | m_renderCtx->updateTextureBegin(handle, side, mip); |
| 2590 | } |
| 2591 | |
| 2592 | m_renderCtx->updateTexture(handle, side, mip, rect, zz, depth, pitch, mem); |
| 2593 | |
| 2594 | release(mem); |
| 2595 | } |
| 2596 | |
| 2597 | if (currentKey != UINT32_MAX) |
| 2598 | { |
| 2599 | m_renderCtx->updateTextureEnd(); |
| 2600 | } |
| 2601 |
nothing calls this directly
no test coverage detected