Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_framebuffer.hh
| Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
| #define MTL_FB_CONFIG_MAX (MTL_FB_CONFIG_CUSTOM + 1) | #define MTL_FB_CONFIG_MAX (MTL_FB_CONFIG_CUSTOM + 1) | ||||
| MTLRenderPassDescriptor *framebuffer_descriptor_[MTL_FB_CONFIG_MAX]; | MTLRenderPassDescriptor *framebuffer_descriptor_[MTL_FB_CONFIG_MAX]; | ||||
| MTLRenderPassColorAttachmentDescriptor | MTLRenderPassColorAttachmentDescriptor | ||||
| *colour_attachment_descriptors_[GPU_FB_MAX_COLOR_ATTACHMENT]; | *colour_attachment_descriptors_[GPU_FB_MAX_COLOR_ATTACHMENT]; | ||||
| /** Whether `MTLRenderPassDescriptor[N]` requires updating with latest state. */ | /** Whether `MTLRenderPassDescriptor[N]` requires updating with latest state. */ | ||||
| bool descriptor_dirty_[MTL_FB_CONFIG_MAX]; | bool descriptor_dirty_[MTL_FB_CONFIG_MAX]; | ||||
| /** Whether SRGB is enabled for this frame-buffer configuration. */ | /** Whether SRGB is enabled for this frame-buffer configuration. */ | ||||
| bool srgb_enabled_; | bool enabled_srgb_; | ||||
| /** Whether the primary Frame-buffer attachment is an SRGB target or not. */ | /** Whether the primary Frame-buffer attachment is an SRGB target or not. */ | ||||
| bool is_srgb_; | bool srgb_; | ||||
| public: | public: | ||||
| /** | /** | ||||
| * Create a conventional framebuffer to attach texture to. | * Create a conventional framebuffer to attach texture to. | ||||
| */ | */ | ||||
| MTLFrameBuffer(MTLContext *ctx, const char *name); | MTLFrameBuffer(MTLContext *ctx, const char *name); | ||||
| ~MTLFrameBuffer(); | ~MTLFrameBuffer(); | ||||
| ▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | public: | ||||
| bool get_pending_clear() | bool get_pending_clear() | ||||
| { | { | ||||
| return has_pending_clear_; | return has_pending_clear_; | ||||
| } | } | ||||
| bool get_srgb_enabled() | bool get_srgb_enabled() | ||||
| { | { | ||||
| return srgb_enabled_; | return enabled_srgb_; | ||||
| } | } | ||||
| bool get_is_srgb() | bool get_is_srgb() | ||||
| { | { | ||||
| return is_srgb_; | return srgb_; | ||||
| } | } | ||||
| private: | private: | ||||
| /* Clears a render target by force-opening a render pass. */ | /* Clears a render target by force-opening a render pass. */ | ||||
| void force_clear(); | void force_clear(); | ||||
| MEM_CXX_CLASS_ALLOC_FUNCS("MTLFrameBuffer"); | MEM_CXX_CLASS_ALLOC_FUNCS("MTLFrameBuffer"); | ||||
| }; | }; | ||||
| } // namespace blender::gpu | } // namespace blender::gpu | ||||