Add renderer texture transition contract
This commit is contained in:
@@ -35,6 +35,17 @@ enum class TextureUsage : std::uint32_t {
|
||||
copy_destination = 1U << 5U,
|
||||
};
|
||||
|
||||
enum class TextureState : std::uint8_t {
|
||||
undefined,
|
||||
shader_read,
|
||||
render_target,
|
||||
upload_destination,
|
||||
copy_source,
|
||||
copy_destination,
|
||||
readback_source,
|
||||
present,
|
||||
};
|
||||
|
||||
[[nodiscard]] constexpr TextureUsage operator|(TextureUsage lhs, TextureUsage rhs) noexcept
|
||||
{
|
||||
return static_cast<TextureUsage>(
|
||||
@@ -285,6 +296,10 @@ public:
|
||||
std::span<const std::byte> rgba_or_channel_bytes) noexcept = 0;
|
||||
[[nodiscard]] virtual pp::foundation::Status generate_mipmaps(
|
||||
ITexture2D& texture) noexcept = 0;
|
||||
[[nodiscard]] virtual pp::foundation::Status transition_texture(
|
||||
ITexture2D& texture,
|
||||
TextureState before,
|
||||
TextureState after) noexcept = 0;
|
||||
[[nodiscard]] virtual pp::foundation::Status copy_texture(
|
||||
ITexture2D& source,
|
||||
ReadbackRegion source_region,
|
||||
@@ -358,11 +373,17 @@ public:
|
||||
TextureDesc destination,
|
||||
ReadbackRegion destination_region) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status validate_mipmap_generation_desc(TextureDesc desc) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status validate_texture_state(TextureState state) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status validate_texture_transition_desc(
|
||||
TextureDesc desc,
|
||||
TextureState before,
|
||||
TextureState after) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status validate_blit_filter(BlitFilter filter) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status validate_blit_descs(
|
||||
TextureDesc source,
|
||||
TextureDesc destination) noexcept;
|
||||
[[nodiscard]] const char* texture_format_name(TextureFormat format) noexcept;
|
||||
[[nodiscard]] const char* texture_state_name(TextureState state) noexcept;
|
||||
[[nodiscard]] const char* primitive_topology_name(PrimitiveTopology topology) noexcept;
|
||||
[[nodiscard]] const char* blit_filter_name(BlitFilter filter) noexcept;
|
||||
[[nodiscard]] const char* blend_factor_name(BlendFactor factor) noexcept;
|
||||
|
||||
Reference in New Issue
Block a user