| 859 | } |
| 860 | |
| 861 | void SetTextureBindingByUnit(HRenderContext render_context, uint32_t unit, dmGraphics::HTexture texture) |
| 862 | { |
| 863 | if (unit >= render_context->m_TextureBindTable.Size()) |
| 864 | { |
| 865 | render_context->m_TextureBindTable.SetCapacity(unit + 1); |
| 866 | |
| 867 | // Make sure new data area is zeroed out |
| 868 | uint32_t fill_index_start = render_context->m_TextureBindTable.Size(); |
| 869 | uint32_t fill_size = render_context->m_TextureBindTable.Remaining() * sizeof(TextureBinding); |
| 870 | |
| 871 | render_context->m_TextureBindTable.SetSize(render_context->m_TextureBindTable.Capacity()); |
| 872 | memset(&render_context->m_TextureBindTable[fill_index_start], 0, fill_size); |
| 873 | } |
| 874 | |
| 875 | render_context->m_TextureBindTable[unit].m_Texture = texture; |
| 876 | render_context->m_TextureBindTable[unit].m_Samplerhash = 0; |
| 877 | } |
| 878 | |
| 879 | static void TrimTextureBindingTable(HRenderContext render_context) |
| 880 | { |