Add renderer texture transition contract

This commit is contained in:
2026-06-02 17:13:44 +02:00
parent 56cb9eaacb
commit 18617cdbd2
9 changed files with 432 additions and 8 deletions

View File

@@ -21,6 +21,7 @@ enum class RecordedRenderCommandKind : std::uint8_t {
draw,
upload_texture,
generate_mipmaps,
transition_texture,
copy_texture,
read_texture,
capture_frame,
@@ -52,6 +53,8 @@ struct RecordedRenderCommand {
std::uint32_t sampler_slot = 0;
TextureDesc source_desc {};
TextureDesc destination_desc {};
TextureState before_state = TextureState::undefined;
TextureState after_state = TextureState::undefined;
ReadbackRegion readback_region {};
ReadbackRegion source_region {};
ReadbackRegion destination_region {};
@@ -148,6 +151,10 @@ public:
std::span<const std::byte> rgba_or_channel_bytes) noexcept override;
[[nodiscard]] pp::foundation::Status generate_mipmaps(
ITexture2D& texture) noexcept override;
[[nodiscard]] pp::foundation::Status transition_texture(
ITexture2D& texture,
TextureState before,
TextureState after) noexcept override;
[[nodiscard]] pp::foundation::Status copy_texture(
ITexture2D& source,
ReadbackRegion source_region,