godot icon indicating copy to clipboard operation
godot copied to clipboard

Direct3D 12: Enhance management of texture data life cycle

Open RandomShaper opened this issue 1 year ago • 0 comments

  1. When available, graphics memory is asked not to be zero-initialized.

    That brings better performance since in most cases those bytes will be overwritten anyway.

  2. Texture memory initialization is tracked across the limbo, garbage and done states.

    • Limbo: resource just allocated, contents are dangerous unless overwritten by certain operations (like a clear), or discarded.
    • Garbage: the memory has been discarded (i.e., D3D12 knows it has to ignore previous contents), but it's still not guaranteed to be black, orthogonally to the non-zero-mem feature.
    • Done: the texture has known contents, either because it was updated with some image data or because it was cleared, worst case by this code, to black, to ensure garbage data is never used.

RandomShaper avatar Feb 02 '24 14:02 RandomShaper